@zealicsolutions/web-ui 1.0.106 → 1.0.107

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/cjs/index.js CHANGED
@@ -9635,7 +9635,7 @@ var mst={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 2
9635
9635
  *
9636
9636
  * This source code is licensed under the ISC license.
9637
9637
  * See the LICENSE file in the root directory of this source tree.
9638
- */function Ust(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(null==e||e(n),!1===r||!n.defaultPrevented)return null==t?void 0:t(n)}}function Gst(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function Kst(...e){return t=>{let r=!1;const n=e.map(e=>{const n=Gst(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():Gst(e[t],null)}}}}function Yst(...e){return s.useCallback(Kst(...e),e)}function Xst(e,r=[]){let n=[];const o=()=>{const t=n.map(e=>s.createContext(e));return function(r){const n=(null==r?void 0:r[e])||t;return s.useMemo(()=>({[`__scope${e}`]:{...r,[e]:n}}),[r,n])}};return o.scopeName=e,[function(r,o){const a=s.createContext(o),i=n.length;n=[...n,o];const l=r=>{var n;const{scope:o,children:l,...c}=r,u=(null==(n=null==o?void 0:o[e])?void 0:n[i])||a,d=s.useMemo(()=>c,Object.values(c));return t.jsx(u.Provider,{value:d,children:l})};return l.displayName=r+"Provider",[l,function(t,n){var l;const c=(null==(l=null==n?void 0:n[e])?void 0:l[i])||a,u=s.useContext(c);if(u)return u;if(void 0!==o)return o;throw new Error(`\`${t}\` must be used within \`${r}\``)}]},Zst(o,...r)]}function Zst(...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 s.useMemo(()=>({[`__scope${t.scopeName}`]:n}),[n])}};return r.scopeName=t.scopeName,r}var Qst=null!=globalThis&&globalThis.document?s.useLayoutEffect:()=>{},Jst=s[" useId ".trim().toString()]||(()=>{}),elt=0;function tlt(e){const[t,r]=s.useState(Jst());return Qst(()=>{r(e=>e??String(elt++))},[e]),t?`radix-${t}`:""}var rlt=s[" useInsertionEffect ".trim().toString()]||Qst;function nlt({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,a,i]=function({defaultProp:e,onChange:t}){const[r,n]=s.useState(e),o=s.useRef(r),a=s.useRef(t);return rlt(()=>{a.current=t},[t]),s.useEffect(()=>{var e;o.current!==r&&(null==(e=a.current)||e.call(a,r),o.current=r)},[r,o]),[r,n,a]}({defaultProp:t,onChange:r}),l=void 0!==e,c=l?e:o;{const t=s.useRef(void 0!==e);s.useEffect(()=>{const e=t.current;e!==l&&console.warn(`${n} is changing from ${e?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. 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=l},[l,n])}const u=s.useCallback(t=>{var r;if(l){const n=function(e){return"function"==typeof e}(t)?t(e):t;n!==e&&(null==(r=i.current)||r.call(i,n))}else a(t)},[l,e,a,i]);return[c,u]}function olt(e){const r=ilt(e),n=s.forwardRef((e,n)=>{const{children:o,...a}=e,i=s.Children.toArray(o),l=i.find(clt);if(l){const e=l.props.children,o=i.map(t=>t===l?s.Children.count(e)>1?s.Children.only(null):s.isValidElement(e)?e.props.children:null:t);return t.jsx(r,{...a,ref:n,children:s.isValidElement(e)?s.cloneElement(e,void 0,o):null})}return t.jsx(r,{...a,ref:n,children:o})});return n.displayName=`${e}.Slot`,n}var alt=olt("Slot");function ilt(e){const t=s.forwardRef((e,t)=>{const{children:r,...n}=e;if(s.isValidElement(r)){const e=function(e){var t,r;let n=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,o=n&&"isReactWarning"in n&&n.isReactWarning;return o?e.ref:(n=null==(r=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:r.get,o=n&&"isReactWarning"in n&&n.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}(r),o=function(e,t){const r={...t};for(const n in t){const o=e[n],a=t[n];/^on[A-Z]/.test(n)?o&&a?r[n]=(...e)=>{const t=a(...e);return o(...e),t}:o&&(r[n]=o):"style"===n?r[n]={...o,...a}:"className"===n&&(r[n]=[o,a].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==s.Fragment&&(o.ref=t?Kst(t,e):e),s.cloneElement(r,o)}return s.Children.count(r)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var slt=Symbol("radix.slottable");function llt(e){const r=({children:e})=>t.jsx(t.Fragment,{children:e});return r.displayName=`${e}.Slottable`,r.__radixId=slt,r}function clt(e){return s.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===slt}var ult=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,r)=>{const n=olt(`Primitive.${r}`),o=s.forwardRef((e,o)=>{const{asChild:a,...i}=e,s=a?n:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),t.jsx(s,{...i,ref:o})});return o.displayName=`Primitive.${r}`,{...e,[r]:o}},{});function dlt(e,t){e&&d.flushSync(()=>e.dispatchEvent(t))}function plt(e){const t=s.useRef(e);return s.useEffect(()=>{t.current=e}),s.useMemo(()=>(...e)=>{var r;return null==(r=t.current)?void 0:r.call(t,...e)},[])}var hlt,flt="dismissableLayer.update",mlt="dismissableLayer.pointerDownOutside",vlt="dismissableLayer.focusOutside",ylt=s.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),glt=s.forwardRef((e,r)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:l,onDismiss:c,...u}=e,d=s.useContext(ylt),[p,h]=s.useState(null),f=(null==p?void 0:p.ownerDocument)??(null==globalThis?void 0:globalThis.document),[,m]=s.useState({}),v=Yst(r,e=>h(e)),y=Array.from(d.layers),[g]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=y.indexOf(g),x=p?y.indexOf(p):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,k=x>=b,_=function(e,t=(null==globalThis?void 0:globalThis.document)){const r=plt(e),n=s.useRef(!1),o=s.useRef(()=>{});return s.useEffect(()=>{const e=e=>{if(e.target&&!n.current){let n=function(){wlt(mlt,r,a,{discrete:!0})};const a={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=n,t.addEventListener("click",o.current,{once:!0})):n()}else t.removeEventListener("click",o.current);n.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}(e=>{const t=e.target,r=[...d.branches].some(e=>e.contains(t));!k||r||(null==a||a(e),null==l||l(e),e.defaultPrevented||null==c||c())},f),C=function(e,t=(null==globalThis?void 0:globalThis.document)){const r=plt(e),n=s.useRef(!1);return s.useEffect(()=>{const e=e=>{e.target&&!n.current&&wlt(vlt,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))||(null==i||i(e),null==l||l(e),e.defaultPrevented||null==c||c())},f);return function(e,t=(null==globalThis?void 0:globalThis.document)){const r=plt(e);s.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&&(null==o||o(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))},f),s.useEffect(()=>{if(p)return n&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(hlt=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),xlt(),()=>{n&&1===d.layersWithOutsidePointerEventsDisabled.size&&(f.body.style.pointerEvents=hlt)}},[p,f,n,d]),s.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),xlt())},[p,d]),s.useEffect(()=>{const e=()=>m({});return document.addEventListener(flt,e),()=>document.removeEventListener(flt,e)},[]),t.jsx(ult.div,{...u,ref:v,style:{pointerEvents:w?k?"auto":"none":void 0,...e.style},onFocusCapture:Ust(e.onFocusCapture,C.onFocusCapture),onBlurCapture:Ust(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:Ust(e.onPointerDownCapture,_.onPointerDownCapture)})});glt.displayName="DismissableLayer";var blt=s.forwardRef((e,r)=>{const n=s.useContext(ylt),o=s.useRef(null),a=Yst(r,o);return s.useEffect(()=>{const e=o.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),t.jsx(ult.div,{...e,ref:a})});function xlt(){const e=new CustomEvent(flt);document.dispatchEvent(e)}function wlt(e,t,r,{discrete:n}){const o=r.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?dlt(o,a):o.dispatchEvent(a)}blt.displayName="DismissableLayerBranch";var klt="focusScope.autoFocusOnMount",_lt="focusScope.autoFocusOnUnmount",Clt={bubbles:!1,cancelable:!0},Mlt=s.forwardRef((e,r)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...l}=e,[c,u]=s.useState(null),d=plt(a),p=plt(i),h=s.useRef(null),f=Yst(r,e=>u(e)),m=s.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;s.useEffect(()=>{if(o){let e=function(e){if(m.paused||!c)return;const t=e.target;c.contains(t)?h.current=t:Plt(h.current,{select:!0})},t=function(e){if(m.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||Plt(h.current,{select:!0}))},r=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&Plt(c)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const n=new MutationObserver(r);return c&&n.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),n.disconnect()}}},[o,c,m.paused]),s.useEffect(()=>{if(c){Elt.add(m);const e=document.activeElement;if(!c.contains(e)){const t=new CustomEvent(klt,Clt);c.addEventListener(klt,d),c.dispatchEvent(t),t.defaultPrevented||(function(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Plt(n,{select:t}),document.activeElement!==r)return}(function(e){return e.filter(e=>"A"!==e.tagName)}(Slt(c)),{select:!0}),document.activeElement===e&&Plt(c))}return()=>{c.removeEventListener(klt,d),setTimeout(()=>{const t=new CustomEvent(_lt,Clt);c.addEventListener(_lt,p),c.dispatchEvent(t),t.defaultPrevented||Plt(e??document.body,{select:!0}),c.removeEventListener(_lt,p),Elt.remove(m)},0)}}},[c,d,p,m]);const v=s.useCallback(e=>{if(!n&&!o||m.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,r=document.activeElement;if(t&&r){const t=e.currentTarget,[o,a]=function(e){const t=Slt(e),r=Dlt(t,e),n=Dlt(t.reverse(),e);return[r,n]}(t);o&&a?e.shiftKey||r!==a?e.shiftKey&&r===o&&(e.preventDefault(),n&&Plt(a,{select:!0})):(e.preventDefault(),n&&Plt(o,{select:!0})):r===t&&e.preventDefault()}},[n,o,m.paused]);return t.jsx(ult.div,{tabIndex:-1,...l,ref:f,onKeyDown:v})});function Slt(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 Dlt(e,t){for(const r of e)if(!Olt(r,{upTo:t}))return r}function Olt(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 Plt(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()}}Mlt.displayName="FocusScope";var Elt=function(){let e=[];return{add(t){const r=e[0];t!==r&&(null==r||r.pause()),e=jlt(e,t),e.unshift(t)},remove(t){var r;e=jlt(e,t),null==(r=e[0])||r.resume()}}}();function jlt(e,t){const r=[...e],n=r.indexOf(t);return-1!==n&&r.splice(n,1),r}var Tlt=s.forwardRef((e,r)=>{var n;const{container:o,...a}=e,[i,l]=s.useState(!1);Qst(()=>l(!0),[]);const c=o||i&&(null==(n=null==globalThis?void 0:globalThis.document)?void 0:n.body);return c?u.default.createPortal(t.jsx(ult.div,{...a,ref:r}),c):null});Tlt.displayName="Portal";var Nlt=e=>{const{present:t,children:r}=e,n=function(e){const[t,r]=s.useState(),n=s.useRef(null),o=s.useRef(e),a=s.useRef("none"),i=e?"mounted":"unmounted",[l,c]=function(e,t){return s.useReducer((e,r)=>t[e][r]??e,e)}(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return s.useEffect(()=>{const e=Rlt(n.current);a.current="mounted"===l?e:"none"},[l]),Qst(()=>{const t=n.current,r=o.current;if(r!==e){const n=a.current,i=Rlt(t);e?c("MOUNT"):"none"===i||"none"===(null==t?void 0:t.display)?c("UNMOUNT"):c(r&&n!==i?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),Qst(()=>{if(t){let e;const r=t.ownerDocument.defaultView??window,i=a=>{const i=Rlt(n.current).includes(a.animationName);if(a.target===t&&i&&(c("ANIMATION_END"),!o.current)){const n=t.style.animationFillMode;t.style.animationFillMode="forwards",e=r.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=n)})}},s=e=>{e.target===t&&(a.current=Rlt(n.current))};return t.addEventListener("animationstart",s),t.addEventListener("animationcancel",i),t.addEventListener("animationend",i),()=>{r.clearTimeout(e),t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",i),t.removeEventListener("animationend",i)}}c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:s.useCallback(e=>{n.current=e?getComputedStyle(e):null,r(e)},[])}}(t),o="function"==typeof r?r({present:n.isPresent}):s.Children.only(r),a=Yst(n.ref,function(e){var t,r;let n=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,o=n&&"isReactWarning"in n&&n.isReactWarning;return o?e.ref:(n=null==(r=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:r.get,o=n&&"isReactWarning"in n&&n.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}(o));return"function"==typeof r||n.isPresent?s.cloneElement(o,{ref:a}):null};function Rlt(e){return(null==e?void 0:e.animationName)||"none"}Nlt.displayName="Presence";var Flt=0;function zlt(){s.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ilt()),document.body.insertAdjacentElement("beforeend",e[1]??Ilt()),Flt++,()=>{1===Flt&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Flt--}},[])}function Ilt(){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 Alt=function(){return Alt=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Alt.apply(this,arguments)};function Llt(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 o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}function Blt(e,t,r){if(r||2===arguments.length)for(var n,o=0,a=t.length;o<a;o++)(n||!(o in t))&&(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}var Vlt="right-scroll-bar-position",Hlt="width-before-scroll-bar";function qlt(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var $lt=typeof window<"u"?s.useLayoutEffect:s.useEffect,Wlt=new WeakMap;function Ult(t,r){var n=function(t,r){var n=e.useState(function(){return{value:t,callback:r,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=r,n.facade}(null,function(e){return t.forEach(function(t){return qlt(t,e)})});return $lt(function(){var e=Wlt.get(n);if(e){var r=new Set(e),o=new Set(t),a=n.current;r.forEach(function(e){o.has(e)||qlt(e,null)}),o.forEach(function(e){r.has(e)||qlt(e,a)})}Wlt.set(n,t)},[t]),n}function Glt(e){return e}function Klt(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=Glt);var r=[],n=!1,o={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 o=t(e,n);return r.push(o),function(){r=r.filter(function(e){return e!==o})}},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 o=r;r=[],o.forEach(e),t=r}var a=function(){var r=t;t=[],r.forEach(e)},i=function(){return Promise.resolve().then(a)};i(),r={push:function(e){t.push(e),i()},filter:function(e){return t=t.filter(e),r}}}};return o}(null);return t.options=Alt({async:!0,ssr:!1},e),t}var Ylt=function(e){var t=e.sideCar,r=Llt(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 s.createElement(n,Alt({},r))};function Xlt(e,t){return e.useMedium(t),Ylt}Ylt.isSideCarExport=!0;var Zlt=Klt(),Qlt=function(){},Jlt=s.forwardRef(function(e,t){var r=s.useRef(null),n=s.useState({onScrollCapture:Qlt,onWheelCapture:Qlt,onTouchMoveCapture:Qlt}),o=n[0],a=n[1],i=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,p=e.shards,h=e.sideCar,f=e.noRelative,m=e.noIsolation,v=e.inert,y=e.allowPinchZoom,g=e.as,b=void 0===g?"div":g,x=e.gapMode,w=Llt(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=h,_=Ult([r,t]),C=Alt(Alt({},w),o);return s.createElement(s.Fragment,null,d&&s.createElement(k,{sideCar:Zlt,removeScrollBar:u,shards:p,noRelative:f,noIsolation:m,inert:v,setCallbacks:a,allowPinchZoom:!!y,lockRef:r,gapMode:x}),i?s.cloneElement(s.Children.only(l),Alt(Alt({},C),{ref:_})):s.createElement(b,Alt({},C,{className:c,ref:_}),l))});Jlt.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Jlt.classNames={fullWidth:Hlt,zeroRight:Vlt};function ect(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var tct=function(){var e=0,t=null;return{add:function(r){0==e&&(t=ect())&&(function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}(t,r),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},rct=function(){var e=function(){var e=tct();return function(t,r){s.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}}();return function(t){var r=t.styles,n=t.dynamic;return e(r,n),null}},nct={left:0,top:0,right:0,gap:0},oct=function(e){return parseInt(e||"",10)||0},act=function(e){if(void 0===e&&(e="margin"),typeof window>"u")return nct;var t=function(e){var t=window.getComputedStyle(document.body),r=t["padding"===e?"paddingLeft":"marginLeft"],n=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[oct(r),oct(n),oct(o)]}(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])}},ict=rct(),sct="data-scroll-locked",lct=function(e,t,r,n){var o=e.left,a=e.top,i=e.right,s=e.gap;return void 0===r&&(r="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(n,";\n padding-right: ").concat(s,"px ").concat(n,";\n }\n body[").concat(sct,"] {\n overflow: hidden ").concat(n,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(n,";"),"margin"===r&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(a,"px;\n padding-right: ").concat(i,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(s,"px ").concat(n,";\n "),"padding"===r&&"padding-right: ".concat(s,"px ").concat(n,";")].filter(Boolean).join(""),"\n }\n \n .").concat(Vlt," {\n right: ").concat(s,"px ").concat(n,";\n }\n \n .").concat(Hlt," {\n margin-right: ").concat(s,"px ").concat(n,";\n }\n \n .").concat(Vlt," .").concat(Vlt," {\n right: 0 ").concat(n,";\n }\n \n .").concat(Hlt," .").concat(Hlt," {\n margin-right: 0 ").concat(n,";\n }\n \n body[").concat(sct,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n }\n")},cct=function(){var e=parseInt(document.body.getAttribute(sct)||"0",10);return isFinite(e)?e:0},uct=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=void 0===n?"margin":n;s.useEffect(function(){return document.body.setAttribute(sct,(cct()+1).toString()),function(){var e=cct()-1;e<=0?document.body.removeAttribute(sct):document.body.setAttribute(sct,e.toString())}},[]);var a=s.useMemo(function(){return act(o)},[o]);return s.createElement(ict,{styles:lct(a,!t,o,r?"":"!important")})},dct=!1;if(typeof window<"u")try{var pct=Object.defineProperty({},"passive",{get:function(){return dct=!0,!0}});window.addEventListener("test",pct,pct),window.removeEventListener("test",pct,pct)}catch{dct=!1}var hct=!!dct&&{passive:!1},fct=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])},mct=function(e,t){var r=t.ownerDocument,n=t;do{if(typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host),vct(e,n)){var o=yct(e,n);if(o[1]>o[2])return!0}n=n.parentNode}while(n&&n!==r.body);return!1},vct=function(e,t){return"v"===e?function(e){return fct(e,"overflowY")}(t):function(e){return fct(e,"overflowX")}(t)},yct=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)},gct=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},bct=function(e){return[e.deltaX,e.deltaY]},xct=function(e){return e&&"current"in e?e.current:e},wct=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},kct=0,_ct=[];function Cct(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Mct=Xlt(Zlt,function(e){var t=s.useRef([]),r=s.useRef([0,0]),n=s.useRef(),o=s.useState(kct++)[0],a=s.useState(rct)[0],i=s.useRef(e);s.useEffect(function(){i.current=e},[e]),s.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=Blt([e.lockRef.current],(e.shards||[]).map(xct),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=s.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!i.current.allowPinchZoom;var o,a=gct(e),s=r.current,l="deltaX"in e?e.deltaX:s[0]-a[0],c="deltaY"in e?e.deltaY:s[1]-a[1],u=e.target,d=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var p=mct(d,u);if(!p)return!0;if(p?o=d:(o="v"===d?"h":"v",p=mct(d,u)),!p)return!1;if(!n.current&&"changedTouches"in e&&(l||c)&&(n.current=o),!o)return!0;var h=n.current||o;return function(e,t,r,n){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),a=o*n,i=r.target,s=t.contains(i),l=!1,c=a>0,u=0,d=0;do{if(!i)break;var p=yct(e,i),h=p[0],f=p[1]-p[2]-o*h;(h||f)&&vct(e,i)&&(u+=f,d+=h);var m=i.parentNode;i=m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE?m.host:m}while(!s&&i!==document.body||s&&(t.contains(i)||t===i));return(c&&Math.abs(u)<1||!c&&Math.abs(d)<1)&&(l=!0),l}(h,t,e,"h"===h?l:c)},[]),c=s.useCallback(function(e){var r=e;if(_ct.length&&_ct[_ct.length-1]===a){var n="deltaY"in r?bct(r):gct(r),o=t.current.filter(function(e){return e.name===r.type&&(e.target===r.target||r.target===e.shadowParent)&&function(e,t){return e[0]===t[0]&&e[1]===t[1]}(e.delta,n)})[0];if(o&&o.should)return void(r.cancelable&&r.preventDefault());if(!o){var s=(i.current.shards||[]).map(xct).filter(Boolean).filter(function(e){return e.contains(r.target)});(s.length>0?l(r,s[0]):!i.current.noIsolation)&&r.cancelable&&r.preventDefault()}}},[]),u=s.useCallback(function(e,r,n,o){var a={name:e,delta:r,target:n,should:o,shadowParent:Cct(n)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=s.useCallback(function(e){r.current=gct(e),n.current=void 0},[]),p=s.useCallback(function(t){u(t.type,bct(t),t.target,l(t,e.lockRef.current))},[]),h=s.useCallback(function(t){u(t.type,gct(t),t.target,l(t,e.lockRef.current))},[]);s.useEffect(function(){return _ct.push(a),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:h}),document.addEventListener("wheel",c,hct),document.addEventListener("touchmove",c,hct),document.addEventListener("touchstart",d,hct),function(){_ct=_ct.filter(function(e){return e!==a}),document.removeEventListener("wheel",c,hct),document.removeEventListener("touchmove",c,hct),document.removeEventListener("touchstart",d,hct)}},[]);var f=e.removeScrollBar,m=e.inert;return s.createElement(s.Fragment,null,m?s.createElement(a,{styles:wct(o)}):null,f?s.createElement(uct,{noRelative:e.noRelative,gapMode:e.gapMode}):null)});var Sct=s.forwardRef(function(e,t){return s.createElement(Jlt,Alt({},e,{ref:t,sideCar:Mct}))});Sct.classNames=Jlt.classNames;var Dct=new WeakMap,Oct=new WeakMap,Pct={},Ect=0,jct=function(e){return e&&(e.host||jct(e.parentNode))},Tct=function(e,t,r,n){var o=function(e,t){return t.map(function(t){if(e.contains(t))return t;var r=jct(t);return r&&e.contains(r)?r:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(e){return!!e})}(t,Array.isArray(e)?e:[e]);Pct[r]||(Pct[r]=new WeakMap);var a=Pct[r],i=[],s=new Set,l=new Set(o),c=function(e){!e||s.has(e)||(s.add(e),c(e.parentNode))};o.forEach(c);var u=function(e){!e||l.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(n),o=null!==t&&"false"!==t,l=(Dct.get(e)||0)+1,c=(a.get(e)||0)+1;Dct.set(e,l),a.set(e,c),i.push(e),1===l&&o&&Oct.set(e,!0),1===c&&e.setAttribute(r,"true"),o||e.setAttribute(n,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return u(t),s.clear(),Ect++,function(){i.forEach(function(e){var t=Dct.get(e)-1,o=a.get(e)-1;Dct.set(e,t),a.set(e,o),t||(Oct.has(e)||e.removeAttribute(n),Oct.delete(e)),o||e.removeAttribute(r)}),--Ect||(Dct=new WeakMap,Dct=new WeakMap,Oct=new WeakMap,Pct={})}},Nct=function(e,t,r){void 0===r&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=function(e){return typeof document>"u"?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),Tct(n,o,r,"aria-hidden")):function(){return null}},Rct="Dialog",[Fct,zct]=Xst(Rct),[Ict,Act]=Fct(Rct),Lct=e=>{const{__scopeDialog:r,children:n,open:o,defaultOpen:a,onOpenChange:i,modal:l=!0}=e,c=s.useRef(null),u=s.useRef(null),[d,p]=nlt({prop:o,defaultProp:a??!1,onChange:i,caller:Rct});return t.jsx(Ict,{scope:r,triggerRef:c,contentRef:u,contentId:tlt(),titleId:tlt(),descriptionId:tlt(),open:d,onOpenChange:p,onOpenToggle:s.useCallback(()=>p(e=>!e),[p]),modal:l,children:n})};Lct.displayName=Rct;var Bct="DialogTrigger",Vct=s.forwardRef((e,r)=>{const{__scopeDialog:n,...o}=e,a=Act(Bct,n),i=Yst(r,a.triggerRef);return t.jsx(ult.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":sut(a.open),...o,ref:i,onClick:Ust(e.onClick,a.onOpenToggle)})});Vct.displayName=Bct;var Hct="DialogPortal",[qct,$ct]=Fct(Hct,{forceMount:void 0}),Wct=e=>{const{__scopeDialog:r,forceMount:n,children:o,container:a}=e,i=Act(Hct,r);return t.jsx(qct,{scope:r,forceMount:n,children:s.Children.map(o,e=>t.jsx(Nlt,{present:n||i.open,children:t.jsx(Tlt,{asChild:!0,container:a,children:e})}))})};Wct.displayName=Hct;var Uct="DialogOverlay",Gct=s.forwardRef((e,r)=>{const n=$ct(Uct,e.__scopeDialog),{forceMount:o=n.forceMount,...a}=e,i=Act(Uct,e.__scopeDialog);return i.modal?t.jsx(Nlt,{present:o||i.open,children:t.jsx(Yct,{...a,ref:r})}):null});Gct.displayName=Uct;var Kct=olt("DialogOverlay.RemoveScroll"),Yct=s.forwardRef((e,r)=>{const{__scopeDialog:n,...o}=e,a=Act(Uct,n);return t.jsx(Sct,{as:Kct,allowPinchZoom:!0,shards:[a.contentRef],children:t.jsx(ult.div,{"data-state":sut(a.open),...o,ref:r,style:{pointerEvents:"auto",...o.style}})})}),Xct="DialogContent",Zct=s.forwardRef((e,r)=>{const n=$ct(Xct,e.__scopeDialog),{forceMount:o=n.forceMount,...a}=e,i=Act(Xct,e.__scopeDialog);return t.jsx(Nlt,{present:o||i.open,children:i.modal?t.jsx(Qct,{...a,ref:r}):t.jsx(Jct,{...a,ref:r})})});Zct.displayName=Xct;var Qct=s.forwardRef((e,r)=>{const n=Act(Xct,e.__scopeDialog),o=s.useRef(null),a=Yst(r,n.contentRef,o);return s.useEffect(()=>{const e=o.current;if(e)return Nct(e)},[]),t.jsx(eut,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ust(e.onCloseAutoFocus,e=>{var t;e.preventDefault(),null==(t=n.triggerRef.current)||t.focus()}),onPointerDownOutside:Ust(e.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:Ust(e.onFocusOutside,e=>e.preventDefault())})}),Jct=s.forwardRef((e,r)=>{const n=Act(Xct,e.__scopeDialog),o=s.useRef(!1),a=s.useRef(!1);return t.jsx(eut,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{var r,i;null==(r=e.onCloseAutoFocus)||r.call(e,t),t.defaultPrevented||(o.current||null==(i=n.triggerRef.current)||i.focus(),t.preventDefault()),o.current=!1,a.current=!1},onInteractOutside:t=>{var r,i;null==(r=e.onInteractOutside)||r.call(e,t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(a.current=!0));const s=t.target;(null==(i=n.triggerRef.current)?void 0:i.contains(s))&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&a.current&&t.preventDefault()}})}),eut=s.forwardRef((e,r)=>{const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:i,...l}=e,c=Act(Xct,n),u=s.useRef(null),d=Yst(r,u);return zlt(),t.jsxs(t.Fragment,{children:[t.jsx(Mlt,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:i,children:t.jsx(glt,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":sut(c.open),...l,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),t.jsxs(t.Fragment,{children:[t.jsx(dut,{titleId:c.titleId}),t.jsx(put,{contentRef:u,descriptionId:c.descriptionId})]})]})}),tut="DialogTitle",rut=s.forwardRef((e,r)=>{const{__scopeDialog:n,...o}=e,a=Act(tut,n);return t.jsx(ult.h2,{id:a.titleId,...o,ref:r})});rut.displayName=tut;var nut="DialogDescription",out=s.forwardRef((e,r)=>{const{__scopeDialog:n,...o}=e,a=Act(nut,n);return t.jsx(ult.p,{id:a.descriptionId,...o,ref:r})});out.displayName=nut;var aut="DialogClose",iut=s.forwardRef((e,r)=>{const{__scopeDialog:n,...o}=e,a=Act(aut,n);return t.jsx(ult.button,{type:"button",...o,ref:r,onClick:Ust(e.onClick,()=>a.onOpenChange(!1))})});function sut(e){return e?"open":"closed"}iut.displayName=aut;var lut="DialogTitleWarning",[cut,uut]=function(e,r){const n=s.createContext(r),o=e=>{const{children:r,...o}=e,a=s.useMemo(()=>o,Object.values(o));return t.jsx(n.Provider,{value:a,children:r})};return o.displayName=e+"Provider",[o,function(t){const o=s.useContext(n);if(o)return o;if(void 0!==r)return r;throw new Error(`\`${t}\` must be used within \`${e}\``)}]}(lut,{contentName:Xct,titleName:tut,docsSlug:"dialog"}),dut=({titleId:e})=>{const t=uut(lut),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 s.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},put=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${uut("DialogDescriptionWarning").contentName}}.`;return s.useEffect(()=>{var n;const o=null==(n=e.current)?void 0:n.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},hut=Lct,fut=Vct,mut=Wct,vut=Gct,yut=Zct,gut=rut,but=out,xut=iut;function wut(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=wut(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function kut(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=wut(e))&&(n&&(n+=" "),n+=t);return n}const _ut=e=>{const t=Dut(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:e=>{const r=e.split("-");return""===r[0]&&1!==r.length&&r.shift(),Cut(r,t)||Sut(e)},getConflictingClassGroupIds:(e,t)=>{const o=r[e]||[];return t&&n[e]?[...o,...n[e]]:o}}},Cut=(e,t)=>{var r;if(0===e.length)return t.classGroupId;const n=e[0],o=t.nextPart.get(n),a=o?Cut(e.slice(1),o):void 0;if(a)return a;if(0===t.validators.length)return;const i=e.join("-");return null==(r=t.validators.find(({validator:e})=>e(i)))?void 0:r.classGroupId},Mut=/^\[(.+)\]$/,Sut=e=>{if(Mut.test(e)){const t=Mut.exec(e)[1],r=null==t?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Dut=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return jut(Object.entries(e.classGroups),r).forEach(([e,r])=>{Out(r,n,e,t)}),n},Out=(e,t,r,n)=>{e.forEach(e=>{if("string"==typeof e){return void((""===e?t:Put(t,e)).classGroupId=r)}if("function"==typeof e)return Eut(e)?void Out(e(n),t,r,n):void t.validators.push({validator:e,classGroupId:r});Object.entries(e).forEach(([e,o])=>{Out(o,Put(t,e),r,n)})})},Put=(e,t)=>{let r=e;return t.split("-").forEach(e=>{r.nextPart.has(e)||r.nextPart.set(e,{nextPart:new Map,validators:[]}),r=r.nextPart.get(e)}),r},Eut=e=>e.isThemeGetter,jut=(e,t)=>t?e.map(([e,r])=>{const n=r.map(e=>"string"==typeof e?t+e:"object"==typeof e?Object.fromEntries(Object.entries(e).map(([e,r])=>[t+e,r])):e);return[e,n]}):e,Tut=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const o=(o,a)=>{r.set(o,a),t++,t>e&&(t=0,n=r,r=new Map)};return{get(e){let t=r.get(e);return void 0!==t?t:void 0!==(t=n.get(e))?(o(e,t),t):void 0},set(e,t){r.has(e)?r.set(e,t):o(e,t)}}},Nut=e=>{const{separator:t,experimentalParseClassName:r}=e,n=1===t.length,o=t[0],a=t.length,i=e=>{const r=[];let i,s=0,l=0;for(let c=0;c<e.length;c++){let u=e[c];if(0===s){if(u===o&&(n||e.slice(c,c+a)===t)){r.push(e.slice(l,c)),l=c+a;continue}if("/"===u){i=c;continue}}"["===u?s++:"]"===u&&s--}const c=0===r.length?e:e.substring(l),u=c.startsWith("!");return{modifiers:r,hasImportantModifier:u,baseClassName:u?c.substring(1):c,maybePostfixModifierPosition:i&&i>l?i-l:void 0}};return r?e=>r({className:e,parseClassName:i}):i},Rut=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(e=>{"["===e[0]?(t.push(...r.sort(),e),r=[]):r.push(e)}),t.push(...r.sort()),t},Fut=/\s+/;function zut(){let e,t,r=0,n="";for(;r<arguments.length;)(e=arguments[r++])&&(t=Iut(e))&&(n&&(n+=" "),n+=t);return n}const Iut=e=>{if("string"==typeof e)return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Iut(e[n]))&&(r&&(r+=" "),r+=t);return r};function Aut(e,...t){let r,n,o,a=function(s){const l=t.reduce((e,t)=>t(e),e());return r=(e=>({cache:Tut(e.cacheSize),parseClassName:Nut(e),..._ut(e)}))(l),n=r.cache.get,o=r.cache.set,a=i,i(s)};function i(e){const t=n(e);if(t)return t;const a=((e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o}=t,a=[],i=e.trim().split(Fut);let s="";for(let e=i.length-1;e>=0;e-=1){const t=i[e],{modifiers:l,hasImportantModifier:c,baseClassName:u,maybePostfixModifierPosition:d}=r(t);let p=!!d,h=n(p?u.substring(0,d):u);if(!h){if(!p){s=t+(s.length>0?" "+s:s);continue}if(h=n(u),!h){s=t+(s.length>0?" "+s:s);continue}p=!1}const f=Rut(l).join(":"),m=c?f+"!":f,v=m+h;if(a.includes(v))continue;a.push(v);const y=o(h,p);for(let e=0;e<y.length;++e){const t=y[e];a.push(m+t)}s=t+(s.length>0?" "+s:s)}return s})(e,r);return o(e,a),a}return function(){return a(zut.apply(null,arguments))}}const Lut=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},But=/^\[(?:([a-z-]+):)?(.+)\]$/i,Vut=/^\d+\/\d+$/,Hut=new Set(["px","full","screen"]),qut=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,$ut=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Wut=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Uut=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Gut=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Kut=e=>Xut(e)||Hut.has(e)||Vut.test(e),Yut=e=>cdt(e,"length",udt),Xut=e=>!!e&&!Number.isNaN(Number(e)),Zut=e=>cdt(e,"number",Xut),Qut=e=>!!e&&Number.isInteger(Number(e)),Jut=e=>e.endsWith("%")&&Xut(e.slice(0,-1)),edt=e=>But.test(e),tdt=e=>qut.test(e),rdt=new Set(["length","size","percentage"]),ndt=e=>cdt(e,rdt,ddt),odt=e=>cdt(e,"position",ddt),adt=new Set(["image","url"]),idt=e=>cdt(e,adt,hdt),sdt=e=>cdt(e,"",pdt),ldt=()=>!0,cdt=(e,t,r)=>{const n=But.exec(e);return!!n&&(n[1]?"string"==typeof t?n[1]===t:t.has(n[1]):r(n[2]))},udt=e=>$ut.test(e)&&!Wut.test(e),ddt=()=>!1,pdt=e=>Uut.test(e),hdt=e=>Gut.test(e),fdt=()=>{const e=Lut("colors"),t=Lut("spacing"),r=Lut("blur"),n=Lut("brightness"),o=Lut("borderColor"),a=Lut("borderRadius"),i=Lut("borderSpacing"),s=Lut("borderWidth"),l=Lut("contrast"),c=Lut("grayscale"),u=Lut("hueRotate"),d=Lut("invert"),p=Lut("gap"),h=Lut("gradientColorStops"),f=Lut("gradientColorStopPositions"),m=Lut("inset"),v=Lut("margin"),y=Lut("opacity"),g=Lut("padding"),b=Lut("saturate"),x=Lut("scale"),w=Lut("sepia"),k=Lut("skew"),_=Lut("space"),C=Lut("translate"),M=()=>["auto",edt,t],S=()=>[edt,t],D=()=>["",Kut,Yut],O=()=>["auto",Xut,edt],P=()=>["","0",edt],E=()=>[Xut,edt];return{cacheSize:500,separator:":",theme:{colors:[ldt],spacing:[Kut,Yut],blur:["none","",tdt,edt],brightness:E(),borderColor:[e],borderRadius:["none","","full",tdt,edt],borderSpacing:S(),borderWidth:D(),contrast:E(),grayscale:P(),hueRotate:E(),invert:P(),gap:S(),gradientColorStops:[e],gradientColorStopPositions:[Jut,Yut],inset:M(),margin:M(),opacity:E(),padding:S(),saturate:E(),scale:E(),sepia:P(),skew:E(),space:S(),translate:S()},classGroups:{aspect:[{aspect:["auto","square","video",edt]}],container:["container"],columns:[{columns:[tdt]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",edt]}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Qut,edt]}],basis:[{basis:M()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",edt]}],grow:[{grow:P()}],shrink:[{shrink:P()}],order:[{order:["first","last","none",Qut,edt]}],"grid-cols":[{"grid-cols":[ldt]}],"col-start-end":[{col:["auto",{span:["full",Qut,edt]},edt]}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":[ldt]}],"row-start-end":[{row:["auto",{span:[Qut,edt]},edt]}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",edt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",edt]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal","start","end","center","between","around","evenly","stretch"]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[g]}],px:[{px:[g]}],py:[{py:[g]}],ps:[{ps:[g]}],pe:[{pe:[g]}],pt:[{pt:[g]}],pr:[{pr:[g]}],pb:[{pb:[g]}],pl:[{pl:[g]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[_]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[_]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",edt,t]}],"min-w":[{"min-w":[edt,t,"min","max","fit"]}],"max-w":[{"max-w":[edt,t,"none","full","min","max","fit","prose",{screen:[tdt]},tdt]}],h:[{h:[edt,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[edt,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[edt,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[edt,t,"auto","min","max","fit"]}],"font-size":[{text:["base",tdt,Yut]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Zut]}],"font-family":[{font:[ldt]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",edt]}],"line-clamp":[{"line-clamp":["none",Xut,Zut]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Kut,edt]}],"list-image":[{"list-image":["none",edt]}],"list-style-type":[{list:["none","disc","decimal",edt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","none","wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Kut,Yut]}],"underline-offset":[{"underline-offset":["auto",Kut,edt]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",edt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",edt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",odt]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",ndt]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},idt]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[f]}],"gradient-via-pos":[{via:[f]}],"gradient-to-pos":[{to:[f]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:["solid","dashed","dotted","double","none","hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:["solid","dashed","dotted","double","none"]}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["","solid","dashed","dotted","double","none"]}],"outline-offset":[{"outline-offset":[Kut,edt]}],"outline-w":[{outline:[Kut,Yut]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:D()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[Kut,Yut]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",tdt,sdt]}],"shadow-color":[{shadow:[ldt]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",tdt,edt]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[b]}],sepia:[{sepia:[w]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[w]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",edt]}],duration:[{duration:E()}],ease:[{ease:["linear","in","out","in-out",edt]}],delay:[{delay:E()}],animate:[{animate:["none","spin","ping","pulse","bounce",edt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[Qut,edt]}],"translate-x":[{"translate-x":[C]}],"translate-y":[{"translate-y":[C]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",edt]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",edt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",edt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Kut,Yut,Zut]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},mdt=Aut(fdt);function vdt(...e){return mdt(kut(e))}const ydt=hut,gdt=fut,bdt=mut,xdt=s.forwardRef(({className:e,...r},n)=>t.jsx(vut,{ref:n,className:vdt("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...r}));xdt.displayName=vut.displayName;const wdt=s.forwardRef(({className:e,children:r,...n},o)=>t.jsxs(bdt,{children:[t.jsx(xdt,{}),t.jsxs(yut,{ref:o,className:vdt("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[r,t.jsxs(xut,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[t.jsx(Wst,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));wdt.displayName=yut.displayName;const kdt=({className:e,...r})=>t.jsx("div",{className:vdt("flex flex-col space-y-1.5 text-center sm:text-left",e),...r});kdt.displayName="DialogHeader";const _dt=({className:e,...r})=>t.jsx("div",{className:vdt("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...r});_dt.displayName="DialogFooter";const Cdt=s.forwardRef(({className:e,...r},n)=>t.jsx(gut,{ref:n,className:vdt("text-lg font-semibold leading-none tracking-tight",e),...r}));Cdt.displayName=gut.displayName;const Mdt=s.forwardRef(({className:e,...r},n)=>t.jsx(but,{ref:n,className:vdt("text-sm text-muted-foreground",e),...r}));Mdt.displayName=but.displayName;const Sdt=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,Ddt=kut,Odt=(e,t)=>r=>{var n;if(null==(null==t?void 0:t.variants))return Ddt(e,null==r?void 0:r.class,null==r?void 0:r.className);const{variants:o,defaultVariants:a}=t,i=Object.keys(o).map(e=>{const t=null==r?void 0:r[e],n=null==a?void 0:a[e];if(null===t)return null;const i=Sdt(t)||Sdt(n);return o[e][i]}),s=r&&Object.entries(r).reduce((e,t)=>{let[r,n]=t;return void 0===n||(e[r]=n),e},{}),l=null==t||null===(n=t.compoundVariants)||void 0===n?void 0:n.reduce((e,t)=>{let{class:r,className:n,...o}=t;return Object.entries(o).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...a,...s}[t]):{...a,...s}[t]===r})?[...e,r,n]:e},[]);return Ddt(e,i,l,null==r?void 0:r.class,null==r?void 0:r.className)},Pdt=Odt("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Edt=s.forwardRef(({className:e,variant:r,size:n,asChild:o=!1,...a},i)=>t.jsx(o?alt:"button",{className:vdt(Pdt({variant:r,size:n,className:e})),ref:i,...a}));Edt.displayName="Button";const jdt=({translations:e,children:r,isDisabled:n=!1})=>r?t.jsx(gdt,{asChild:!0,disabled:n,children:r}):t.jsx(gdt,{asChild:!0,children:t.jsxs(Edt,{variant:"default",size:"sm",className:"w-full gap-0 sm:w-auto text-xs sm:text-sm",disabled:n,children:[t.jsx(_st,{className:"h-3 w-3 sm:h-4 sm:w-4 mr-1 sm:mr-2"}),e.addEvent]})});var Tdt="AlertDialog",[Ndt,Rdt]=Xst(Tdt,[zct]),Fdt=zct(),zdt=e=>{const{__scopeAlertDialog:r,...n}=e,o=Fdt(r);return t.jsx(hut,{...o,...n,modal:!0})};zdt.displayName=Tdt;var Idt=s.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...o}=e,a=Fdt(n);return t.jsx(fut,{...a,...o,ref:r})});Idt.displayName="AlertDialogTrigger";var Adt=e=>{const{__scopeAlertDialog:r,...n}=e,o=Fdt(r);return t.jsx(mut,{...o,...n})};Adt.displayName="AlertDialogPortal";var Ldt=s.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...o}=e,a=Fdt(n);return t.jsx(vut,{...a,...o,ref:r})});Ldt.displayName="AlertDialogOverlay";var Bdt="AlertDialogContent",[Vdt,Hdt]=Ndt(Bdt),qdt=llt("AlertDialogContent"),$dt=s.forwardRef((e,r)=>{const{__scopeAlertDialog:n,children:o,...a}=e,i=Fdt(n),l=s.useRef(null),c=Yst(r,l),u=s.useRef(null);return t.jsx(cut,{contentName:Bdt,titleName:Wdt,docsSlug:"alert-dialog",children:t.jsx(Vdt,{scope:n,cancelRef:u,children:t.jsxs(yut,{role:"alertdialog",...i,...a,ref:c,onOpenAutoFocus:Ust(a.onOpenAutoFocus,e=>{var t;e.preventDefault(),null==(t=u.current)||t.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[t.jsx(qdt,{children:o}),t.jsx(Qdt,{contentRef:l})]})})})});$dt.displayName=Bdt;var Wdt="AlertDialogTitle",Udt=s.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...o}=e,a=Fdt(n);return t.jsx(gut,{...a,...o,ref:r})});Udt.displayName=Wdt;var Gdt="AlertDialogDescription",Kdt=s.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...o}=e,a=Fdt(n);return t.jsx(but,{...a,...o,ref:r})});Kdt.displayName=Gdt;var Ydt=s.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...o}=e,a=Fdt(n);return t.jsx(xut,{...a,...o,ref:r})});Ydt.displayName="AlertDialogAction";var Xdt="AlertDialogCancel",Zdt=s.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...o}=e,{cancelRef:a}=Hdt(Xdt,n),i=Fdt(n),s=Yst(r,a);return t.jsx(xut,{...i,...o,ref:s})});Zdt.displayName=Xdt;var Qdt=({contentRef:e})=>{const t=`\`${Bdt}\` requires a description for the component to be accessible for screen reader users.\n\nYou can add a description to the \`${Bdt}\` by passing a \`${Gdt}\` 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 \`${Bdt}\`. 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 s.useEffect(()=>{var r;document.getElementById(null==(r=e.current)?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Jdt=Ldt,ept=$dt,tpt=Ydt,rpt=Zdt,npt=Udt,opt=Kdt;const apt=zdt,ipt=Idt,spt=Adt,lpt=s.forwardRef(({className:e,...r},n)=>t.jsx(Jdt,{className:vdt("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...r,ref:n}));lpt.displayName=Jdt.displayName;const cpt=s.forwardRef(({className:e,...r},n)=>t.jsxs(spt,{children:[t.jsx(lpt,{}),t.jsx(ept,{ref:n,className:vdt("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r})]}));cpt.displayName=ept.displayName;const upt=({className:e,...r})=>t.jsx("div",{className:vdt("flex flex-col space-y-2 text-center sm:text-left",e),...r});upt.displayName="AlertDialogHeader";const dpt=({className:e,...r})=>t.jsx("div",{className:vdt("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...r});dpt.displayName="AlertDialogFooter";const ppt=s.forwardRef(({className:e,...r},n)=>t.jsx(npt,{ref:n,className:vdt("text-lg font-semibold",e),...r}));ppt.displayName=npt.displayName;const hpt=s.forwardRef(({className:e,...r},n)=>t.jsx(opt,{ref:n,className:vdt("text-sm text-muted-foreground",e),...r}));hpt.displayName=opt.displayName;const fpt=s.forwardRef(({className:e,...r},n)=>t.jsx(tpt,{ref:n,className:vdt(Pdt(),e),...r}));fpt.displayName=tpt.displayName;const mpt=s.forwardRef(({className:e,...r},n)=>t.jsx(rpt,{ref:n,className:vdt(Pdt({variant:"outline"}),"mt-2 sm:mt-0",e),...r}));mpt.displayName=rpt.displayName;var vpt=function(){return vpt=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},vpt.apply(this,arguments)};function ypt(e,t,r){for(var n,o=0,a=t.length;o<a;o++)(n||!(o in t))&&(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}function gpt(e){return"multiple"===e.mode}function bpt(e){return"range"===e.mode}function xpt(e){return"single"===e.mode}var wpt={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};var kpt=Object.freeze({__proto__:null,formatCaption:function(e,t){return Vit(e,"LLLL y",t)},formatDay:function(e,t){return Vit(e,"d",t)},formatMonthCaption:function(e,t){return Vit(e,"LLLL",t)},formatWeekNumber:function(e){return"".concat(e)},formatWeekdayName:function(e,t){return Vit(e,"cccccc",t)},formatYearCaption:function(e,t){return Vit(e,"yyyy",t)}}),_pt=Object.freeze({__proto__:null,labelDay:function(e,t,r){return Vit(e,"do MMMM (EEEE)",r)},labelMonthDropdown:function(){return"Month: "},labelNext:function(){return"Go to next month"},labelPrevious:function(){return"Go to previous month"},labelWeekNumber:function(e){return"Week n. ".concat(e)},labelWeekday:function(e,t){return Vit(e,"cccc",t)},labelYearDropdown:function(){return"Year: "}});var Cpt=e.createContext(void 0);function Mpt(e){var r,n,o=e.initialProps,a={captionLayout:"buttons",classNames:wpt,formatters:kpt,labels:_pt,locale:fit,modifiersClassNames:{},modifiers:{},numberOfMonths:1,styles:{},today:new Date,mode:"default"},i=function(e){var t=e.fromYear,r=e.toYear,n=e.fromMonth,o=e.toMonth,a=e.fromDate,i=e.toDate;return n?a=tit(n):t&&(a=new Date(t,0,1)),o?i=Jat(o):r&&(i=new Date(r,11,31)),{fromDate:a?Bat(a):void 0,toDate:i?Bat(i):void 0}}(o),s=i.fromDate,l=i.toDate,c=null!==(r=o.captionLayout)&&void 0!==r?r:a.captionLayout;"buttons"!==c&&(!s||!l)&&(c="buttons"),(xpt(o)||gpt(o)||bpt(o))&&(n=o.onSelect);var u=vpt(vpt(vpt({},a),o),{captionLayout:c,classNames:vpt(vpt({},a.classNames),o.classNames),components:vpt({},o.components),formatters:vpt(vpt({},a.formatters),o.formatters),fromDate:s,labels:vpt(vpt({},a.labels),o.labels),mode:o.mode||a.mode,modifiers:vpt(vpt({},a.modifiers),o.modifiers),modifiersClassNames:vpt(vpt({},a.modifiersClassNames),o.modifiersClassNames),onSelect:n,styles:vpt(vpt({},a.styles),o.styles),toDate:l});return t.jsx(Cpt.Provider,{value:u,children:e.children})}function Spt(){var t=e.useContext(Cpt);if(!t)throw new Error("useDayPicker must be used within a DayPickerProvider.");return t}function Dpt(e){var r=Spt(),n=r.locale,o=r.classNames,a=r.styles,i=r.formatters.formatCaption;return t.jsx("div",{className:o.caption_label,style:a.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:i(e.displayMonth,{locale:n})})}function Opt(e){return t.jsx("svg",vpt({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:t.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function Ppt(e){var r,n,o=e.onChange,a=e.value,i=e.children,s=e.caption,l=e.className,c=e.style,u=Spt(),d=null!==(n=null===(r=u.components)||void 0===r?void 0:r.IconDropdown)&&void 0!==n?n:Opt;return t.jsxs("div",{className:l,style:c,children:[t.jsx("span",{className:u.classNames.vhidden,children:e["aria-label"]}),t.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:u.classNames.dropdown,style:u.styles.dropdown,value:a,onChange:o,children:i}),t.jsxs("div",{className:u.classNames.caption_label,style:u.styles.caption_label,"aria-hidden":"true",children:[s,t.jsx(d,{className:u.classNames.dropdown_icon,style:u.styles.dropdown_icon})]})]})}function Ept(e){var r,n=Spt(),o=n.fromDate,a=n.toDate,i=n.styles,s=n.locale,l=n.formatters.formatMonthCaption,c=n.classNames,u=n.components,d=n.labels.labelMonthDropdown;if(!o)return t.jsx(t.Fragment,{});if(!a)return t.jsx(t.Fragment,{});var p=[];if(Kit(o,a))for(var h=tit(o),f=o.getMonth();f<=a.getMonth();f++)p.push(ist(h,f));else for(h=tit(new Date),f=0;f<=11;f++)p.push(ist(h,f));var m=null!==(r=null==u?void 0:u.Dropdown)&&void 0!==r?r:Ppt;return t.jsx(m,{name:"months","aria-label":d(),className:c.dropdown_month,style:i.dropdown_month,onChange:function(t){var r=Number(t.target.value),n=ist(tit(e.displayMonth),r);e.onChange(n)},value:e.displayMonth.getMonth(),caption:l(e.displayMonth,{locale:s}),children:p.map(function(e){return t.jsx("option",{value:e.getMonth(),children:l(e,{locale:s})},e.getMonth())})})}function jpt(e){var r,n=e.displayMonth,o=Spt(),a=o.fromDate,i=o.toDate,s=o.locale,l=o.styles,c=o.classNames,u=o.components,d=o.formatters.formatYearCaption,p=o.labels.labelYearDropdown,h=[];if(!a)return t.jsx(t.Fragment,{});if(!i)return t.jsx(t.Fragment,{});for(var f=a.getFullYear(),m=i.getFullYear(),v=f;v<=m;v++)h.push(cst(nit(new Date),v));var y=null!==(r=null==u?void 0:u.Dropdown)&&void 0!==r?r:Ppt;return t.jsx(y,{name:"years","aria-label":p(),className:c.dropdown_year,style:l.dropdown_year,onChange:function(t){var r=cst(tit(n),Number(t.target.value));e.onChange(r)},value:n.getFullYear(),caption:d(n,{locale:s}),children:h.map(function(e){return t.jsx("option",{value:e.getFullYear(),children:d(e,{locale:s})},e.getFullYear())})})}function Tpt(){var t=Spt(),r=function(e){var t=e.month,r=e.defaultMonth,n=e.today,o=t||r||n||new Date,a=e.toDate,i=e.fromDate,s=e.numberOfMonths,l=void 0===s?1:s;return a&&Yat(a,o)<0&&(o=Eat(a,-1*(l-1))),i&&Yat(o,i)<0&&(o=i),tit(o)}(t),n=function(t,r){var n=e.useState(t),o=n[0];return[void 0===r?o:r,n[1]]}(r,t.month),o=n[0],a=n[1];return[o,function(e){var r;if(!t.disableNavigation){var n=tit(e);a(n),null===(r=t.onMonthChange)||void 0===r||r.call(t,n)}}]}var Npt=e.createContext(void 0);function Rpt(e){var r=Spt(),n=Tpt(),o=n[0],a=n[1],i=function(e,t){for(var r=t.reverseMonths,n=t.numberOfMonths,o=tit(e),a=Yat(tit(Eat(o,n)),o),i=[],s=0;s<a;s++){var l=Eat(o,s);i.push(l)}return r&&(i=i.reverse()),i}(o,r),s=function(e,t){if(!t.disableNavigation){var r=t.toDate,n=t.pagedNavigation,o=t.numberOfMonths,a=void 0===o?1:o,i=n?a:1,s=tit(e);if(!r)return Eat(s,i);if(!(Yat(r,e)<a))return Eat(s,i)}}(o,r),l=function(e,t){if(!t.disableNavigation){var r=t.fromDate,n=t.pagedNavigation,o=t.numberOfMonths,a=n?void 0===o?1:o:1,i=tit(e);if(!r)return Eat(i,-a);if(!(Yat(i,r)<=0))return Eat(i,-a)}}(o,r),c=function(e){return i.some(function(t){return Git(e,t)})},u={currentMonth:o,displayMonths:i,goToMonth:a,goToDate:function(e,t){c(e)||(t&&Uit(e,t)?a(Eat(e,1+-1*r.numberOfMonths)):a(e))},previousMonth:l,nextMonth:s,isDateDisplayed:c};return t.jsx(Npt.Provider,{value:u,children:e.children})}function Fpt(){var t=e.useContext(Npt);if(!t)throw new Error("useNavigation must be used within a NavigationProvider");return t}function zpt(e){var r,n=Spt(),o=n.classNames,a=n.styles,i=n.components,s=Fpt().goToMonth,l=function(t){s(Eat(t,e.displayIndex?-e.displayIndex:0))},c=null!==(r=null==i?void 0:i.CaptionLabel)&&void 0!==r?r:Dpt,u=t.jsx(c,{id:e.id,displayMonth:e.displayMonth});return t.jsxs("div",{className:o.caption_dropdowns,style:a.caption_dropdowns,children:[t.jsx("div",{className:o.vhidden,children:u}),t.jsx(Ept,{onChange:l,displayMonth:e.displayMonth}),t.jsx(jpt,{onChange:l,displayMonth:e.displayMonth})]})}function Ipt(e){return t.jsx("svg",vpt({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:t.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function Apt(e){return t.jsx("svg",vpt({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:t.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var Lpt=e.forwardRef(function(e,r){var n=Spt(),o=n.classNames,a=n.styles,i=[o.button_reset,o.button];e.className&&i.push(e.className);var s=i.join(" "),l=vpt(vpt({},a.button_reset),a.button);return e.style&&Object.assign(l,e.style),t.jsx("button",vpt({},e,{ref:r,type:"button",className:s,style:l}))});function Bpt(e){var r,n,o=Spt(),a=o.dir,i=o.locale,s=o.classNames,l=o.styles,c=o.labels,u=c.labelPrevious,d=c.labelNext,p=o.components;if(!e.nextMonth&&!e.previousMonth)return t.jsx(t.Fragment,{});var h=u(e.previousMonth,{locale:i}),f=[s.nav_button,s.nav_button_previous].join(" "),m=d(e.nextMonth,{locale:i}),v=[s.nav_button,s.nav_button_next].join(" "),y=null!==(r=null==p?void 0:p.IconRight)&&void 0!==r?r:Apt,g=null!==(n=null==p?void 0:p.IconLeft)&&void 0!==n?n:Ipt;return t.jsxs("div",{className:s.nav,style:l.nav,children:[!e.hidePrevious&&t.jsx(Lpt,{name:"previous-month","aria-label":h,className:f,style:l.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:"rtl"===a?t.jsx(y,{className:s.nav_icon,style:l.nav_icon}):t.jsx(g,{className:s.nav_icon,style:l.nav_icon})}),!e.hideNext&&t.jsx(Lpt,{name:"next-month","aria-label":m,className:v,style:l.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:"rtl"===a?t.jsx(g,{className:s.nav_icon,style:l.nav_icon}):t.jsx(y,{className:s.nav_icon,style:l.nav_icon})})]})}function Vpt(e){var r=Spt().numberOfMonths,n=Fpt(),o=n.previousMonth,a=n.nextMonth,i=n.goToMonth,s=n.displayMonths,l=s.findIndex(function(t){return Git(e.displayMonth,t)}),c=0===l,u=l===s.length-1,d=r>1&&(c||!u),p=r>1&&(u||!c);return t.jsx(Bpt,{displayMonth:e.displayMonth,hideNext:d,hidePrevious:p,nextMonth:a,previousMonth:o,onPreviousClick:function(){o&&i(o)},onNextClick:function(){a&&i(a)}})}function Hpt(e){var r,n,o=Spt(),a=o.classNames,i=o.disableNavigation,s=o.styles,l=o.captionLayout,c=o.components,u=null!==(r=null==c?void 0:c.CaptionLabel)&&void 0!==r?r:Dpt;return n=i?t.jsx(u,{id:e.id,displayMonth:e.displayMonth}):"dropdown"===l?t.jsx(zpt,{displayMonth:e.displayMonth,id:e.id}):"dropdown-buttons"===l?t.jsxs(t.Fragment,{children:[t.jsx(zpt,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),t.jsx(Vpt,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):t.jsxs(t.Fragment,{children:[t.jsx(u,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),t.jsx(Vpt,{displayMonth:e.displayMonth,id:e.id})]}),t.jsx("div",{className:a.caption,style:s.caption,children:n})}function qpt(e){var r=Spt(),n=r.footer,o=r.styles,a=r.classNames.tfoot;return n?t.jsx("tfoot",{className:a,style:o.tfoot,children:t.jsx("tr",{children:t.jsx("td",{colSpan:8,children:n})})}):t.jsx(t.Fragment,{})}function $pt(){var e=Spt(),r=e.classNames,n=e.styles,o=e.showWeekNumber,a=e.locale,i=e.weekStartsOn,s=e.ISOWeek,l=e.formatters.formatWeekdayName,c=e.labels.labelWeekday,u=function(e,t,r){for(var n=r?Aat(new Date):Iat(new Date,{locale:e,weekStartsOn:t}),o=[],a=0;a<7;a++){var i=Pat(n,a);o.push(i)}return o}(a,i,s);return t.jsxs("tr",{style:n.head_row,className:r.head_row,children:[o&&t.jsx("td",{style:n.head_cell,className:r.head_cell}),u.map(function(e,o){return t.jsx("th",{scope:"col",className:r.head_cell,style:n.head_cell,"aria-label":c(e,{locale:a}),children:l(e,{locale:a})},o)})]})}function Wpt(){var e,r=Spt(),n=r.classNames,o=r.styles,a=r.components,i=null!==(e=null==a?void 0:a.HeadRow)&&void 0!==e?e:$pt;return t.jsx("thead",{style:o.head,className:n.head,children:t.jsx(i,{})})}function Upt(e){var r=Spt(),n=r.locale,o=r.formatters.formatDay;return t.jsx(t.Fragment,{children:o(e.date,{locale:n})})}var Gpt=e.createContext(void 0);function Kpt(e){if(!gpt(e.initialProps)){return t.jsx(Gpt.Provider,{value:{selected:void 0,modifiers:{disabled:[]}},children:e.children})}return t.jsx(Ypt,{initialProps:e.initialProps,children:e.children})}function Ypt(e){var r=e.initialProps,n=e.children,o=r.selected,a=r.min,i=r.max,s={disabled:[]};o&&s.disabled.push(function(e){var t=i&&o.length>i-1,r=o.some(function(t){return Gat(t,e)});return!(!t||r)});var l={selected:o,onDayClick:function(e,t,n){var s,l;if((null===(s=r.onDayClick)||void 0===s||s.call(r,e,t,n),!!(!t.selected||!a||(null==o?void 0:o.length)!==a))&&!!(t.selected||!i||(null==o?void 0:o.length)!==i)){var c=o?ypt([],o):[];if(t.selected){var u=c.findIndex(function(t){return Gat(e,t)});c.splice(u,1)}else c.push(e);null===(l=r.onSelect)||void 0===l||l.call(r,c,e,t,n)}},modifiers:s};return t.jsx(Gpt.Provider,{value:l,children:n})}function Xpt(){var t=e.useContext(Gpt);if(!t)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return t}var Zpt,Qpt=e.createContext(void 0);function Jpt(e){if(!bpt(e.initialProps)){return t.jsx(Qpt.Provider,{value:{selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}},children:e.children})}return t.jsx(eht,{initialProps:e.initialProps,children:e.children})}function eht(e){var r=e.initialProps,n=e.children,o=r.selected,a=o||{},i=a.from,s=a.to,l=r.min,c=r.max,u={range_start:[],range_end:[],range_middle:[],disabled:[]};if(i?(u.range_start=[i],s?(u.range_end=[s],Gat(i,s)||(u.range_middle=[{after:i,before:s}])):u.range_end=[i]):s&&(u.range_start=[s],u.range_end=[s]),l&&(i&&!s&&u.disabled.push({after:Xit(i,l-1),before:Pat(i,l-1)}),i&&s&&u.disabled.push({after:i,before:Pat(i,l-1)}),!i&&s&&u.disabled.push({after:Xit(s,l-1),before:Pat(s,l-1)})),c){if(i&&!s&&(u.disabled.push({before:Pat(i,1-c)}),u.disabled.push({after:Pat(i,c-1)})),i&&s){var d=c-(Hat(s,i)+1);u.disabled.push({before:Xit(i,d)}),u.disabled.push({after:Pat(s,d)})}!i&&s&&(u.disabled.push({before:Pat(s,1-c)}),u.disabled.push({after:Pat(s,c-1)}))}return t.jsx(Qpt.Provider,{value:{selected:o,onDayClick:function(e,t,n){var a,i;null===(a=r.onDayClick)||void 0===a||a.call(r,e,t,n);var s=function(e,t){var r=t||{},n=r.from,o=r.to;return n&&o?Gat(o,e)&&Gat(n,e)?void 0:Gat(o,e)?{from:o,to:void 0}:Gat(n,e)?void 0:Wit(n,e)?{from:e,to:o}:{from:n,to:e}:o?Wit(e,o)?{from:o,to:e}:{from:e,to:o}:n?Uit(e,n)?{from:e,to:n}:{from:n,to:e}:{from:e,to:void 0}}(e,o);null===(i=r.onSelect)||void 0===i||i.call(r,s,e,t,n)},modifiers:u},children:n})}function tht(){var t=e.useContext(Qpt);if(!t)throw new Error("useSelectRange must be used within a SelectRangeProvider");return t}function rht(e){return Array.isArray(e)?ypt([],e):void 0!==e?[e]:[]}!function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"}(Zpt||(Zpt={}));var nht=Zpt.Selected,oht=Zpt.Disabled,aht=Zpt.Hidden,iht=Zpt.Today,sht=Zpt.RangeEnd,lht=Zpt.RangeMiddle,cht=Zpt.RangeStart,uht=Zpt.Outside;var dht=e.createContext(void 0);function pht(e){var r=Spt(),n=function(e,t,r){var n,o=((n={})[nht]=rht(e.selected),n[oht]=rht(e.disabled),n[aht]=rht(e.hidden),n[iht]=[e.today],n[sht]=[],n[lht]=[],n[cht]=[],n[uht]=[],n);return e.fromDate&&o[oht].push({before:e.fromDate}),e.toDate&&o[oht].push({after:e.toDate}),gpt(e)?o[oht]=o[oht].concat(t.modifiers[oht]):bpt(e)&&(o[oht]=o[oht].concat(r.modifiers[oht]),o[cht]=r.modifiers[cht],o[lht]=r.modifiers[lht],o[sht]=r.modifiers[sht]),o}(r,Xpt(),tht()),o=function(e){var t={};return Object.entries(e).forEach(function(e){var r=e[0],n=e[1];t[r]=rht(n)}),t}(r.modifiers),a=vpt(vpt({},n),o);return t.jsx(dht.Provider,{value:a,children:e.children})}function hht(){var t=e.useContext(dht);if(!t)throw new Error("useModifiers must be used within a ModifiersProvider");return t}function fht(e,t){return t.some(function(t){if("boolean"==typeof t)return t;if(function(e){return Kat(e)}(t))return Gat(e,t);if(function(e){return Array.isArray(e)&&e.every(Kat)}(t))return t.includes(e);if(function(e){return!(!e||"object"!=typeof e||!("from"in e))}(t))return function(e,t){var r,n=t.from,o=t.to;return n&&o?(Hat(o,n)<0&&(n=(r=[o,n])[0],o=r[1]),Hat(e,n)>=0&&Hat(o,e)>=0):o?Gat(o,e):!!n&&Gat(n,e)}(e,t);if(function(e){return!(!e||"object"!=typeof e||!("dayOfWeek"in e))}(t))return t.dayOfWeek.includes(e.getDay());if(function(e){return!!(e&&"object"==typeof e&&"before"in e&&"after"in e)}(t)){var r=Hat(t.before,e)>0,n=Hat(t.after,e)<0;return Wit(t.before,t.after)?n&&r:r||n}return function(e){return!(!e||"object"!=typeof e||!("after"in e))}(t)?Hat(e,t.after)>0:function(e){return!(!e||"object"!=typeof e||!("before"in e))}(t)?Hat(t.before,e)>0:"function"==typeof t&&t(e)})}function mht(e,t,r){var n=Object.keys(t).reduce(function(r,n){var o=t[n];return fht(e,o)&&r.push(n),r},[]),o={};return n.forEach(function(e){return o[e]=!0}),r&&!Git(e,r)&&(o.outside=!0),o}function vht(e,t){var r=t.moveBy,n=t.direction,o=t.context,a=t.modifiers,i=t.retry,s=void 0===i?{count:0,lastFocused:e}:i,l=o.weekStartsOn,c=o.fromDate,u=o.toDate,d=o.locale,p={day:Pat,week:qat,month:Eat,year:$at,startOfWeek:function(e){return o.ISOWeek?Aat(e):Iat(e,{locale:d,weekStartsOn:l})},endOfWeek:function(e){return o.ISOWeek?ait(e):oit(e,{locale:d,weekStartsOn:l})}}[r](e,"after"===n?1:-1);"before"===n&&c?p=Wat([c,p]):"after"===n&&u&&(p=Uat([u,p]));var h=!0;if(a){var f=mht(p,a);h=!f.disabled&&!f.hidden}return h?p:s.count>365?s.lastFocused:vht(p,{moveBy:r,direction:n,context:o,modifiers:a,retry:vpt(vpt({},s),{count:s.count+1})})}var yht=e.createContext(void 0);function ght(r){var n=Fpt(),o=hht(),a=e.useState(),i=a[0],s=a[1],l=e.useState(),c=l[0],u=l[1],d=function(e,t){for(var r,n,o=tit(e[0]),a=Jat(e[e.length-1]),i=o;i<=a;){var s=mht(i,t);if(s.disabled||s.hidden)i=Pat(i,1);else{if(s.selected)return i;s.today&&!n&&(n=i),r||(r=i),i=Pat(i,1)}}return n||r}(n.displayMonths,o),p=i??(c&&n.isDateDisplayed(c))?c:d,h=function(e){s(e)},f=Spt(),m=function(e,t){if(i){var r=vht(i,{moveBy:e,direction:t,context:f,modifiers:o});Gat(i,r)||(n.goToDate(r,i),h(r))}},v={focusedDay:i,focusTarget:p,blur:function(){u(i),s(void 0)},focus:h,focusDayAfter:function(){return m("day","after")},focusDayBefore:function(){return m("day","before")},focusWeekAfter:function(){return m("week","after")},focusWeekBefore:function(){return m("week","before")},focusMonthBefore:function(){return m("month","before")},focusMonthAfter:function(){return m("month","after")},focusYearBefore:function(){return m("year","before")},focusYearAfter:function(){return m("year","after")},focusStartOfWeek:function(){return m("startOfWeek","before")},focusEndOfWeek:function(){return m("endOfWeek","after")}};return t.jsx(yht.Provider,{value:v,children:r.children})}function bht(){var t=e.useContext(yht);if(!t)throw new Error("useFocusContext must be used within a FocusProvider");return t}var xht=e.createContext(void 0);function wht(e){if(!xpt(e.initialProps)){return t.jsx(xht.Provider,{value:{selected:void 0},children:e.children})}return t.jsx(kht,{initialProps:e.initialProps,children:e.children})}function kht(e){var r=e.initialProps,n=e.children,o={selected:r.selected,onDayClick:function(e,t,n){var o,a,i;null===(o=r.onDayClick)||void 0===o||o.call(r,e,t,n),!t.selected||r.required?null===(i=r.onSelect)||void 0===i||i.call(r,e,e,t,n):null===(a=r.onSelect)||void 0===a||a.call(r,void 0,e,t,n)}};return t.jsx(xht.Provider,{value:o,children:n})}function _ht(){var t=e.useContext(xht);if(!t)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return t}function Cht(e,t){var r=[e.classNames.day];return Object.keys(t).forEach(function(t){var n=e.modifiersClassNames[t];if(n)r.push(n);else if(function(e){return Object.values(Zpt).includes(e)}(t)){var o=e.classNames["day_".concat(t)];o&&r.push(o)}}),r}function Mht(r,n,o){var a,i,s,l=Spt(),c=bht(),u=function(e,t){return mht(e,hht(),t)}(r,n),d=function(e,t){var r=Spt(),n=_ht(),o=Xpt(),a=tht(),i=bht(),s=i.focusDayAfter,l=i.focusDayBefore,c=i.focusWeekAfter,u=i.focusWeekBefore,d=i.blur,p=i.focus,h=i.focusMonthBefore,f=i.focusMonthAfter,m=i.focusYearBefore,v=i.focusYearAfter,y=i.focusStartOfWeek,g=i.focusEndOfWeek;return{onClick:function(i){var s,l,c,u;xpt(r)?null===(s=n.onDayClick)||void 0===s||s.call(n,e,t,i):gpt(r)?null===(l=o.onDayClick)||void 0===l||l.call(o,e,t,i):bpt(r)?null===(c=a.onDayClick)||void 0===c||c.call(a,e,t,i):null===(u=r.onDayClick)||void 0===u||u.call(r,e,t,i)},onFocus:function(n){var o;p(e),null===(o=r.onDayFocus)||void 0===o||o.call(r,e,t,n)},onBlur:function(n){var o;d(),null===(o=r.onDayBlur)||void 0===o||o.call(r,e,t,n)},onKeyDown:function(n){var o;switch(n.key){case"ArrowLeft":n.preventDefault(),n.stopPropagation(),"rtl"===r.dir?s():l();break;case"ArrowRight":n.preventDefault(),n.stopPropagation(),"rtl"===r.dir?l():s();break;case"ArrowDown":n.preventDefault(),n.stopPropagation(),c();break;case"ArrowUp":n.preventDefault(),n.stopPropagation(),u();break;case"PageUp":n.preventDefault(),n.stopPropagation(),n.shiftKey?m():h();break;case"PageDown":n.preventDefault(),n.stopPropagation(),n.shiftKey?v():f();break;case"Home":n.preventDefault(),n.stopPropagation(),y();break;case"End":n.preventDefault(),n.stopPropagation(),g()}null===(o=r.onDayKeyDown)||void 0===o||o.call(r,e,t,n)},onKeyUp:function(n){var o;null===(o=r.onDayKeyUp)||void 0===o||o.call(r,e,t,n)},onMouseEnter:function(n){var o;null===(o=r.onDayMouseEnter)||void 0===o||o.call(r,e,t,n)},onMouseLeave:function(n){var o;null===(o=r.onDayMouseLeave)||void 0===o||o.call(r,e,t,n)},onPointerEnter:function(n){var o;null===(o=r.onDayPointerEnter)||void 0===o||o.call(r,e,t,n)},onPointerLeave:function(n){var o;null===(o=r.onDayPointerLeave)||void 0===o||o.call(r,e,t,n)},onTouchCancel:function(n){var o;null===(o=r.onDayTouchCancel)||void 0===o||o.call(r,e,t,n)},onTouchEnd:function(n){var o;null===(o=r.onDayTouchEnd)||void 0===o||o.call(r,e,t,n)},onTouchMove:function(n){var o;null===(o=r.onDayTouchMove)||void 0===o||o.call(r,e,t,n)},onTouchStart:function(n){var o;null===(o=r.onDayTouchStart)||void 0===o||o.call(r,e,t,n)}}}(r,u),p=function(){var e=Spt(),t=_ht(),r=Xpt(),n=tht();return xpt(e)?t.selected:gpt(e)?r.selected:bpt(e)?n.selected:void 0}(),h=!(!l.onDayClick&&"default"===l.mode);e.useEffect(function(){var e;u.outside||c.focusedDay&&h&&Gat(c.focusedDay,r)&&(null===(e=o.current)||void 0===e||e.focus())},[c.focusedDay,r,o,h,u.outside]);var f=Cht(l,u).join(" "),m=function(e,t){var r=vpt({},e.styles.day);return Object.keys(t).forEach(function(t){var n;r=vpt(vpt({},r),null===(n=e.modifiersStyles)||void 0===n?void 0:n[t])}),r}(l,u),v=!!(u.outside&&!l.showOutsideDays||u.hidden),y=null!==(s=null===(i=l.components)||void 0===i?void 0:i.DayContent)&&void 0!==s?s:Upt,g={style:m,className:f,children:t.jsx(y,{date:r,displayMonth:n,activeModifiers:u}),role:"gridcell"},b=c.focusTarget&&Gat(c.focusTarget,r)&&!u.outside,x=c.focusedDay&&Gat(c.focusedDay,r),w=vpt(vpt(vpt({},g),((a={disabled:u.disabled,role:"gridcell"})["aria-selected"]=u.selected,a.tabIndex=x||b?0:-1,a)),d);return{isButton:h,isHidden:v,activeModifiers:u,selectedDays:p,buttonProps:w,divProps:g}}function Sht(r){var n=e.useRef(null),o=Mht(r.date,r.displayMonth,n);return o.isHidden?t.jsx("div",{role:"gridcell"}):o.isButton?t.jsx(Lpt,vpt({name:"day",ref:n},o.buttonProps)):t.jsx("div",vpt({},o.divProps))}function Dht(e){var r=e.number,n=e.dates,o=Spt(),a=o.onWeekNumberClick,i=o.styles,s=o.classNames,l=o.locale,c=o.labels.labelWeekNumber,u=(0,o.formatters.formatWeekNumber)(Number(r),{locale:l});if(!a)return t.jsx("span",{className:s.weeknumber,style:i.weeknumber,children:u});var d=c(Number(r),{locale:l});return t.jsx(Lpt,{name:"week-number","aria-label":d,className:s.weeknumber,style:i.weeknumber,onClick:function(e){a(r,n,e)},children:u})}function Oht(e){var r,n,o,a=Spt(),i=a.styles,s=a.classNames,l=a.showWeekNumber,c=a.components,u=null!==(r=null==c?void 0:c.Day)&&void 0!==r?r:Sht,d=null!==(n=null==c?void 0:c.WeekNumber)&&void 0!==n?n:Dht;return l&&(o=t.jsx("td",{className:s.cell,style:i.cell,children:t.jsx(d,{number:e.weekNumber,dates:e.dates})})),t.jsxs("tr",{className:s.row,style:i.row,children:[o,e.dates.map(function(r){return t.jsx("td",{className:s.cell,style:i.cell,role:"presentation",children:t.jsx(u,{displayMonth:e.displayMonth,date:r})},function(e){return Math.trunc(+Dat(e)/1e3)}(r))})]})}function Pht(e,t,r){for(var n=null!=r&&r.ISOWeek?ait(t):oit(t,r),o=null!=r&&r.ISOWeek?Aat(e):Iat(e,r),a=Hat(n,o),i=[],s=0;s<=a;s++)i.push(Pat(o,s));var l=i.reduce(function(e,t){var n=null!=r&&r.ISOWeek?mit(t):yit(t,r),o=e.find(function(e){return e.weekNumber===n});return o?(o.dates.push(t),e):(e.push({weekNumber:n,dates:[t]}),e)},[]);return l}function Eht(e){var r,n,o,a=Spt(),i=a.locale,s=a.classNames,l=a.styles,c=a.hideHead,u=a.fixedWeeks,d=a.components,p=a.weekStartsOn,h=a.firstWeekContainsDate,f=a.ISOWeek,m=function(e,t){var r=Pht(tit(e),Jat(e),t);if(null!=t&&t.useFixedWeeks){var n=$it(e,t);if(n<6){var o=r[r.length-1],a=o.dates[o.dates.length-1],i=qat(a,6-n),s=Pht(qat(a,1),i,t);r.push.apply(r,s)}}return r}(e.displayMonth,{useFixedWeeks:!!u,ISOWeek:f,locale:i,weekStartsOn:p,firstWeekContainsDate:h}),v=null!==(r=null==d?void 0:d.Head)&&void 0!==r?r:Wpt,y=null!==(n=null==d?void 0:d.Row)&&void 0!==n?n:Oht,g=null!==(o=null==d?void 0:d.Footer)&&void 0!==o?o:qpt;return t.jsxs("table",{id:e.id,className:s.table,style:l.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!c&&t.jsx(v,{}),t.jsx("tbody",{className:s.tbody,style:l.tbody,children:m.map(function(r){return t.jsx(y,{displayMonth:e.displayMonth,dates:r.dates,weekNumber:r.weekNumber},r.weekNumber)})}),t.jsx(g,{displayMonth:e.displayMonth})]})}var jht=typeof window<"u"&&window.document&&window.document.createElement?e.useLayoutEffect:e.useEffect,Tht=!1,Nht=0;function Rht(){return"react-day-picker-".concat(++Nht)}function Fht(r){var n,o,a=Spt(),i=a.dir,s=a.classNames,l=a.styles,c=a.components,u=Fpt().displayMonths,d=function(t){var r,n=t??(Tht?Rht():null),o=e.useState(n),a=o[0],i=o[1];return jht(function(){null===a&&i(Rht())},[]),e.useEffect(function(){!1===Tht&&(Tht=!0)},[]),null!==(r=t??a)&&void 0!==r?r:void 0}(a.id?"".concat(a.id,"-").concat(r.displayIndex):void 0),p=a.id?"".concat(a.id,"-grid-").concat(r.displayIndex):void 0,h=[s.month],f=l.month,m=0===r.displayIndex,v=r.displayIndex===u.length-1,y=!m&&!v;"rtl"===i&&(v=(n=[m,v])[0],m=n[1]),m&&(h.push(s.caption_start),f=vpt(vpt({},f),l.caption_start)),v&&(h.push(s.caption_end),f=vpt(vpt({},f),l.caption_end)),y&&(h.push(s.caption_between),f=vpt(vpt({},f),l.caption_between));var g=null!==(o=null==c?void 0:c.Caption)&&void 0!==o?o:Hpt;return t.jsxs("div",{className:h.join(" "),style:f,children:[t.jsx(g,{id:d,displayMonth:r.displayMonth,displayIndex:r.displayIndex}),t.jsx(Eht,{id:p,"aria-labelledby":d,displayMonth:r.displayMonth})]},r.displayIndex)}function zht(e){var r=Spt(),n=r.classNames,o=r.styles;return t.jsx("div",{className:n.months,style:o.months,children:e.children})}function Iht(r){var n,o,a=r.initialProps,i=Spt(),s=bht(),l=Fpt(),c=e.useState(!1),u=c[0],d=c[1];e.useEffect(function(){i.initialFocus&&s.focusTarget&&(u||(s.focus(s.focusTarget),d(!0)))},[i.initialFocus,u,s.focus,s.focusTarget,s]);var p=[i.classNames.root,i.className];i.numberOfMonths>1&&p.push(i.classNames.multiple_months),i.showWeekNumber&&p.push(i.classNames.with_weeknumber);var h=vpt(vpt({},i.styles.root),i.style),f=Object.keys(a).filter(function(e){return e.startsWith("data-")}).reduce(function(e,t){var r;return vpt(vpt({},e),((r={})[t]=a[t],r))},{}),m=null!==(o=null===(n=a.components)||void 0===n?void 0:n.Months)&&void 0!==o?o:zht;return t.jsx("div",vpt({className:p.join(" "),style:h,dir:i.dir,id:i.id,nonce:a.nonce,title:a.title,lang:a.lang},f,{children:t.jsx(m,{children:l.displayMonths.map(function(e,r){return t.jsx(Fht,{displayIndex:r,displayMonth:e},r)})})}))}function Aht(e){var r=e.children,n=function(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 o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(e,["children"]);return t.jsx(Mpt,{initialProps:n,children:t.jsx(Rpt,{children:t.jsx(wht,{initialProps:n,children:t.jsx(Kpt,{initialProps:n,children:t.jsx(Jpt,{initialProps:n,children:t.jsx(pht,{children:t.jsx(ght,{children:r})})})})})})})}function Lht(e){return t.jsx(Aht,vpt({},e,{children:t.jsx(Iht,{initialProps:e})}))}function Bht({className:e,classNames:r,showOutsideDays:n=!0,...o}){return t.jsx(Lht,{showOutsideDays:n,className:vdt("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:vdt(Pdt({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:vdt(Pdt({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:bg-accent/50 aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...r},components:{IconLeft:({className:e,...r})=>t.jsx(Ost,{className:vdt("h-4 w-4",e),...r}),IconRight:({className:e,...r})=>t.jsx(Pst,{className:vdt("h-4 w-4",e),...r})},...o})}Bht.displayName="Calendar";var Vht=e=>"checkbox"===e.type,Hht=e=>e instanceof Date,qht=e=>null==e;const $ht=e=>"object"==typeof e;var Wht=e=>!qht(e)&&!Array.isArray(e)&&$ht(e)&&!Hht(e),Uht=e=>Wht(e)&&e.target?Vht(e.target)?e.target.checked:e.target.value:e,Ght=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),Kht=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Yht(e){let t;const r=Array.isArray(e),n=typeof FileList<"u"&&e instanceof FileList;if(e instanceof Date)t=new Date(e);else{if(Kht&&(e instanceof Blob||n)||!r&&!Wht(e))return e;if(t=r?[]:{},r||(e=>{const t=e.constructor&&e.constructor.prototype;return Wht(t)&&t.hasOwnProperty("isPrototypeOf")})(e))for(const r in e)e.hasOwnProperty(r)&&(t[r]=Yht(e[r]));else t=e}return t}var Xht=e=>/^\w*$/.test(e),Zht=e=>void 0===e,Qht=e=>Array.isArray(e)?e.filter(Boolean):[],Jht=e=>Qht(e.replace(/["|']|\]/g,"").split(/\.|\[/)),eft=(e,t,r)=>{if(!t||!Wht(e))return r;const n=(Xht(t)?[t]:Jht(t)).reduce((e,t)=>qht(e)?e:e[t],e);return Zht(n)||n===e?Zht(e[t])?r:e[t]:n},tft=e=>"boolean"==typeof e,rft=(e,t,r)=>{let n=-1;const o=Xht(t)?[t]:Jht(t),a=o.length,i=a-1;for(;++n<a;){const t=o[n];let a=r;if(n!==i){const r=e[t];a=Wht(r)||Array.isArray(r)?r:isNaN(+o[n+1])?{}:[]}if("__proto__"===t||"constructor"===t||"prototype"===t)return;e[t]=a,e=e[t]}};const nft="blur",oft="focusout",aft="change",ift="onBlur",sft="onChange",lft="onSubmit",cft="onTouched",uft="all",dft="max",pft="min",hft="maxLength",fft="minLength",mft="pattern",vft="required",yft="validate",gft=l.default.createContext(null);gft.displayName="HookFormContext";const bft=()=>l.default.useContext(gft);var xft=(e,t,r,n=!0)=>{const o={defaultValues:t._defaultValues};for(const a in e)Object.defineProperty(o,a,{get:()=>{const o=a;return t._proxyFormState[o]!==uft&&(t._proxyFormState[o]=!n||uft),r&&(r[o]=!0),e[o]}});return o};const wft=typeof window<"u"?s.useLayoutEffect:s.useEffect;var kft=e=>"string"==typeof e,_ft=(e,t,r,n,o)=>kft(e)?(n&&t.watch.add(e),eft(r,e,o)):Array.isArray(e)?e.map(e=>(n&&t.watch.add(e),eft(r,e))):(n&&(t.watchAll=!0),r);function Cft(e){const t=bft(),{name:r,disabled:n,control:o=t.control,shouldUnregister:a}=e,i=Ght(o._names.array,r),s=function(e){const t=bft(),{control:r=t.control,name:n,defaultValue:o,disabled:a,exact:i}=e||{},s=l.default.useRef(o),[c,u]=l.default.useState(r._getWatch(n,s.current));return wft(()=>r._subscribe({name:n,formState:{values:!0},exact:i,callback:e=>!a&&u(_ft(n,r._names,e.values||r._formValues,!1,s.current))}),[n,r,a,i]),l.default.useEffect(()=>r._removeUnmounted()),c}({control:o,name:r,defaultValue:eft(o._formValues,r,eft(o._defaultValues,r,e.defaultValue)),exact:!0}),c=function(e){const t=bft(),{control:r=t.control,disabled:n,name:o,exact:a}=e||{},[i,s]=l.default.useState(r._formState),c=l.default.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return wft(()=>r._subscribe({name:o,formState:c.current,exact:a,callback:e=>{!n&&s({...r._formState,...e})}}),[o,n,a]),l.default.useEffect(()=>{c.current.isValid&&r._setValid(!0)},[r]),l.default.useMemo(()=>xft(i,r,c.current,!1),[i,r])}({control:o,name:r,exact:!0}),u=l.default.useRef(e),d=l.default.useRef(o.register(r,{...e.rules,value:s,...tft(e.disabled)?{disabled:e.disabled}:{}})),p=l.default.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!eft(c.errors,r)},isDirty:{enumerable:!0,get:()=>!!eft(c.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!eft(c.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!eft(c.validatingFields,r)},error:{enumerable:!0,get:()=>eft(c.errors,r)}}),[c,r]),h=l.default.useCallback(e=>d.current.onChange({target:{value:Uht(e),name:r},type:aft}),[r]),f=l.default.useCallback(()=>d.current.onBlur({target:{value:eft(o._formValues,r),name:r},type:nft}),[r,o._formValues]),m=l.default.useCallback(e=>{const t=eft(o._fields,r);t&&e&&(t._f.ref={focus:()=>e.focus&&e.focus(),select:()=>e.select&&e.select(),setCustomValidity:t=>e.setCustomValidity(t),reportValidity:()=>e.reportValidity()})},[o._fields,r]),v=l.default.useMemo(()=>({name:r,value:s,...tft(n)||c.disabled?{disabled:c.disabled||n}:{},onChange:h,onBlur:f,ref:m}),[r,n,c.disabled,h,f,m,s]);return l.default.useEffect(()=>{const e=o._options.shouldUnregister||a;o.register(r,{...u.current.rules,...tft(u.current.disabled)?{disabled:u.current.disabled}:{}});const t=(e,t)=>{const r=eft(o._fields,e);r&&r._f&&(r._f.mount=t)};if(t(r,!0),e){const e=Yht(eft(o._options.defaultValues,r));rft(o._defaultValues,r,e),Zht(eft(o._formValues,r))&&rft(o._formValues,r,e)}return!i&&o.register(r),()=>{(i?e&&!o._state.action:e)?o.unregister(r):t(r,!1)}},[r,o,i,a]),l.default.useEffect(()=>{o._setDisabledField({disabled:n,name:r})},[n,r,o]),l.default.useMemo(()=>({field:v,formState:c,fieldState:p}),[v,c,p])}const Mft=e=>e.render(Cft(e));var Sft=(e,t,r,n,o)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:o||!0}}:{},Dft=e=>Array.isArray(e)?e:[e],Oft=()=>{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=[]}}},Pft=e=>qht(e)||!$ht(e);function Eft(e,t,r=new WeakSet){if(Pft(e)||Pft(t))return e===t;if(Hht(e)&&Hht(t))return e.getTime()===t.getTime();const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const a of n){const n=e[a];if(!o.includes(a))return!1;if("ref"!==a){const e=t[a];if(Hht(n)&&Hht(e)||Wht(n)&&Wht(e)||Array.isArray(n)&&Array.isArray(e)?!Eft(n,e,r):n!==e)return!1}}return!0}var jft=e=>Wht(e)&&!Object.keys(e).length,Tft=e=>"file"===e.type,Nft=e=>"function"==typeof e,Rft=e=>{if(!Kht)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Fft=e=>"select-multiple"===e.type,zft=e=>"radio"===e.type,Ift=e=>Rft(e)&&e.isConnected;function Aft(e,t){const r=Array.isArray(t)?t:Xht(t)?[t]:Jht(t),n=1===r.length?e:function(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=Zht(e)?n++:e[t[n++]];return e}(e,r),o=r.length-1,a=r[o];return n&&delete n[a],0!==o&&(Wht(n)&&jft(n)||Array.isArray(n)&&function(e){for(const t in e)if(e.hasOwnProperty(t)&&!Zht(e[t]))return!1;return!0}(n))&&Aft(e,r.slice(0,-1)),e}var Lft=e=>{for(const t in e)if(Nft(e[t]))return!0;return!1};function Bft(e,t={}){const r=Array.isArray(e);if(Wht(e)||r)for(const r in e)Array.isArray(e[r])||Wht(e[r])&&!Lft(e[r])?(t[r]=Array.isArray(e[r])?[]:{},Bft(e[r],t[r])):qht(e[r])||(t[r]=!0);return t}function Vft(e,t,r){const n=Array.isArray(e);if(Wht(e)||n)for(const n in e)Array.isArray(e[n])||Wht(e[n])&&!Lft(e[n])?Zht(t)||Pft(r[n])?r[n]=Array.isArray(e[n])?Bft(e[n],[]):{...Bft(e[n])}:Vft(e[n],qht(t)?{}:t[n],r[n]):r[n]=!Eft(e[n],t[n]);return r}var Hft=(e,t)=>Vft(e,t,Bft(t));const qft={value:!1,isValid:!1},$ft={value:!0,isValid:!0};var Wft=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&&!Zht(e[0].attributes.value)?Zht(e[0].value)||""===e[0].value?$ft:{value:e[0].value,isValid:!0}:$ft:qft}return qft},Uft=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Zht(e)?e:t?""===e?NaN:e&&+e:r&&kft(e)?new Date(e):n?n(e):e;const Gft={isValid:!1,value:null};var Kft=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,Gft):Gft;function Yft(e){const t=e.ref;return Tft(t)?t.files:zft(t)?Kft(e.refs).value:Fft(t)?[...t.selectedOptions].map(({value:e})=>e):Vht(t)?Wft(e.refs).value:Uft(Zht(t.value)?e.ref.value:t.value,e)}var Xft=e=>e instanceof RegExp,Zft=e=>Zht(e)?e:Xft(e)?e.source:Wht(e)?Xft(e.value)?e.value.source:e.value:e,Qft=e=>({isOnSubmit:!e||e===lft,isOnBlur:e===ift,isOnChange:e===sft,isOnAll:e===uft,isOnTouch:e===cft});const Jft="AsyncFunction";var emt=e=>!!e&&!!e.validate&&!!(Nft(e.validate)&&e.validate.constructor.name===Jft||Wht(e.validate)&&Object.values(e.validate).find(e=>e.constructor.name===Jft)),tmt=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))));const rmt=(e,t,r,n)=>{for(const o of r||Object.keys(e)){const r=eft(e,o);if(r){const{_f:e,...a}=r;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],o)&&!n)return!0;if(e.ref&&t(e.ref,e.name)&&!n)return!0;if(rmt(a,t))break}else if(Wht(a)&&rmt(a,t))break}}};function nmt(e,t,r){const n=eft(e,r);if(n||Xht(r))return{error:n,name:r};const o=r.split(".");for(;o.length;){const n=o.join("."),a=eft(t,n),i=eft(e,n);if(a&&!Array.isArray(a)&&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};o.pop()}return{name:r}}var omt=(e,t,r)=>{const n=Dft(eft(e,r));return rft(n,"root",t[r]),rft(e,r,n),e},amt=e=>kft(e);function imt(e,t,r="validate"){if(amt(e)||Array.isArray(e)&&e.every(amt)||tft(e)&&!e)return{type:r,message:amt(e)?e:"",ref:t}}var smt=e=>Wht(e)&&!Xft(e)?e:{value:e,message:""},lmt=async(e,t,r,n,o,a)=>{const{ref:i,refs:s,required:l,maxLength:c,minLength:u,min:d,max:p,pattern:h,validate:f,name:m,valueAsNumber:v,mount:y}=e._f,g=eft(r,m);if(!y||t.has(m))return{};const b=s?s[0]:i,x=e=>{o&&b.reportValidity&&(b.setCustomValidity(tft(e)?"":e||""),b.reportValidity())},w={},k=zft(i),_=Vht(i),C=k||_,M=(v||Tft(i))&&Zht(i.value)&&Zht(g)||Rft(i)&&""===i.value||""===g||Array.isArray(g)&&!g.length,S=Sft.bind(null,m,n,w),D=(e,t,r,n=hft,o=fft)=>{const a=e?t:r;w[m]={type:e?n:o,message:a,ref:i,...S(e?n:o,a)}};if(a?!Array.isArray(g)||!g.length:l&&(!C&&(M||qht(g))||tft(g)&&!g||_&&!Wft(s).isValid||k&&!Kft(s).isValid)){const{value:e,message:t}=amt(l)?{value:!!l,message:l}:smt(l);if(e&&(w[m]={type:vft,message:t,ref:b,...S(vft,t)},!n))return x(t),w}if(!(M||qht(d)&&qht(p))){let e,t;const r=smt(p),o=smt(d);if(qht(g)||isNaN(g)){const n=i.valueAsDate||new Date(g),a=e=>new Date((new Date).toDateString()+" "+e),s="time"==i.type,l="week"==i.type;kft(r.value)&&g&&(e=s?a(g)>a(r.value):l?g>r.value:n>new Date(r.value)),kft(o.value)&&g&&(t=s?a(g)<a(o.value):l?g<o.value:n<new Date(o.value))}else{const n=i.valueAsNumber||g&&+g;qht(r.value)||(e=n>r.value),qht(o.value)||(t=n<o.value)}if((e||t)&&(D(!!e,r.message,o.message,dft,pft),!n))return x(w[m].message),w}if((c||u)&&!M&&(kft(g)||a&&Array.isArray(g))){const e=smt(c),t=smt(u),r=!qht(e.value)&&g.length>+e.value,o=!qht(t.value)&&g.length<+t.value;if((r||o)&&(D(r,e.message,t.message),!n))return x(w[m].message),w}if(h&&!M&&kft(g)){const{value:e,message:t}=smt(h);if(Xft(e)&&!g.match(e)&&(w[m]={type:mft,message:t,ref:i,...S(mft,t)},!n))return x(t),w}if(f)if(Nft(f)){const e=imt(await f(g,r),b);if(e&&(w[m]={...e,...S(yft,e.message)},!n))return x(e.message),w}else if(Wht(f)){let e={};for(const t in f){if(!jft(e)&&!n)break;const o=imt(await f[t](g,r),b,t);o&&(e={...o,...S(t,o.message)},x(o.message),n&&(w[m]=e))}if(!jft(e)&&(w[m]={ref:b,...e},!n))return w}return x(!0),w};const cmt={mode:lft,reValidateMode:sft,shouldFocusError:!0};function umt(e={}){let t,r={...cmt,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Nft(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1},o={},a=(Wht(r.defaultValues)||Wht(r.values))&&Yht(r.defaultValues||r.values)||{},i=r.shouldUnregister?{}:Yht(a),s={action:!1,mount:!1,watch:!1},l={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let d={...u};const p={array:Oft(),state:Oft()},h=r.criteriaMode===uft,f=async e=>{if(!r.disabled&&(u.isValid||d.isValid||e)){const e=r.resolver?jft((await b()).errors):await x(o,!0);e!==n.isValid&&p.state.next({isValid:e})}},m=(e,t)=>{!r.disabled&&(u.isValidating||u.validatingFields||d.isValidating||d.validatingFields)&&((e||Array.from(l.mount)).forEach(e=>{e&&(t?rft(n.validatingFields,e,t):Aft(n.validatingFields,e))}),p.state.next({validatingFields:n.validatingFields,isValidating:!jft(n.validatingFields)}))},v=(e,t,r,n)=>{const l=eft(o,e);if(l){const o=eft(i,e,Zht(r)?eft(a,e):r);Zht(o)||n&&n.defaultChecked||t?rft(i,e,t?o:Yft(l._f)):_(e,o),s.mount&&f()}},y=(e,t,o,i,s)=>{let l=!1,c=!1;const h={name:e};if(!r.disabled){if(!o||i){(u.isDirty||d.isDirty)&&(c=n.isDirty,n.isDirty=h.isDirty=w(),l=c!==h.isDirty);const r=Eft(eft(a,e),t);c=!!eft(n.dirtyFields,e),r?Aft(n.dirtyFields,e):rft(n.dirtyFields,e,!0),h.dirtyFields=n.dirtyFields,l=l||(u.dirtyFields||d.dirtyFields)&&c!==!r}if(o){const t=eft(n.touchedFields,e);t||(rft(n.touchedFields,e,o),h.touchedFields=n.touchedFields,l=l||(u.touchedFields||d.touchedFields)&&t!==o)}l&&s&&p.state.next(h)}return l?h:{}},g=(e,o,a,i)=>{const s=eft(n.errors,e),l=(u.isValid||d.isValid)&&tft(o)&&n.isValid!==o;if(r.delayError&&a?(t=(e=>t=>{clearTimeout(c),c=setTimeout(e,t)})(()=>((e,t)=>{rft(n.errors,e,t),p.state.next({errors:n.errors})})(e,a)),t(r.delayError)):(clearTimeout(c),t=null,a?rft(n.errors,e,a):Aft(n.errors,e)),(a?!Eft(s,a):s)||!jft(i)||l){const t={...i,...l&&tft(o)?{isValid:o}:{},errors:n.errors,name:e};n={...n,...t},p.state.next(t)}},b=async e=>{m(e,!0);const t=await r.resolver(i,r.context,((e,t,r,n)=>{const o={};for(const r of e){const e=eft(t,r);e&&rft(o,r,e._f)}return{criteriaMode:r,names:[...e],fields:o,shouldUseNativeValidation:n}})(e||l.mount,o,r.criteriaMode,r.shouldUseNativeValidation));return m(e),t},x=async(e,t,o={valid:!0})=>{for(const a in e){const s=e[a];if(s){const{_f:e,...c}=s;if(e){const c=l.array.has(e.name),d=s._f&&emt(s._f);d&&u.validatingFields&&m([a],!0);const p=await lmt(s,l.disabled,i,h,r.shouldUseNativeValidation&&!t,c);if(d&&u.validatingFields&&m([a]),p[e.name]&&(o.valid=!1,t))break;!t&&(eft(p,e.name)?c?omt(n.errors,p,e.name):rft(n.errors,e.name,p[e.name]):Aft(n.errors,e.name))}!jft(c)&&await x(c,t,o)}}return o.valid},w=(e,t)=>!r.disabled&&(e&&t&&rft(i,e,t),!Eft(P(),a)),k=(e,t,r)=>_ft(e,l,{...s.mount?i:Zht(t)?a:kft(e)?{[e]:t}:t},r,t),_=(e,t,r={})=>{const n=eft(o,e);let a=t;if(n){const r=n._f;r&&(!r.disabled&&rft(i,e,Uft(t,r)),a=Rft(r.ref)&&qht(t)?"":t,Fft(r.ref)?[...r.ref.options].forEach(e=>e.selected=a.includes(e.value)):r.refs?Vht(r.ref)?r.refs.forEach(e=>{(!e.defaultChecked||!e.disabled)&&(Array.isArray(a)?e.checked=!!a.find(t=>t===e.value):e.checked=a===e.value||!!a)}):r.refs.forEach(e=>e.checked=e.value===a):Tft(r.ref)?r.ref.value="":(r.ref.value=a,r.ref.type||p.state.next({name:e,values:Yht(i)})))}(r.shouldDirty||r.shouldTouch)&&y(e,a,r.shouldTouch,r.shouldDirty,!0),r.shouldValidate&&O(e)},C=(e,t,r)=>{for(const n in t){if(!t.hasOwnProperty(n))return;const a=t[n],i=e+"."+n,s=eft(o,i);(l.array.has(e)||Wht(a)||s&&!s._f)&&!Hht(a)?C(i,a,r):_(i,a,r)}},M=(e,t,r={})=>{const c=eft(o,e),h=l.array.has(e),f=Yht(t);rft(i,e,f),h?(p.array.next({name:e,values:Yht(i)}),(u.isDirty||u.dirtyFields||d.isDirty||d.dirtyFields)&&r.shouldDirty&&p.state.next({name:e,dirtyFields:Hft(a,i),isDirty:w(e,f)})):!c||c._f||qht(f)?_(e,f,r):C(e,f,r),tmt(e,l)&&p.state.next({...n}),p.state.next({name:s.mount?e:void 0,values:Yht(i)})},S=async e=>{s.mount=!0;const a=e.target;let c=a.name,v=!0;const w=eft(o,c),k=e=>{v=Number.isNaN(e)||Hht(e)&&isNaN(e.getTime())||Eft(e,eft(i,c,e))},_=Qft(r.mode),C=Qft(r.reValidateMode);if(w){let s,M;const S=a.type?Yft(w._f):Uht(e),D=e.type===nft||e.type===oft,P=!(e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate))(w._f)&&!r.resolver&&!eft(n.errors,c)&&!w._f.deps||((e,t,r,n,o)=>!o.isOnAll&&(!r&&o.isOnTouch?!(t||e):(r?n.isOnBlur:o.isOnBlur)?!e:!(r?n.isOnChange:o.isOnChange)||e))(D,eft(n.touchedFields,c),n.isSubmitted,C,_),E=tmt(c,l,D);rft(i,c,S),D?(w._f.onBlur&&w._f.onBlur(e),t&&t(0)):w._f.onChange&&w._f.onChange(e);const j=y(c,S,D),T=!jft(j)||E;if(!D&&p.state.next({name:c,type:e.type,values:Yht(i)}),P)return(u.isValid||d.isValid)&&("onBlur"===r.mode?D&&f():D||f()),T&&p.state.next({name:c,...E?{}:j});if(!D&&E&&p.state.next({...n}),r.resolver){const{errors:e}=await b([c]);if(k(S),v){const t=nmt(n.errors,o,c),r=nmt(e,o,t.name||c);s=r.error,c=r.name,M=jft(e)}}else m([c],!0),s=(await lmt(w,l.disabled,i,h,r.shouldUseNativeValidation))[c],m([c]),k(S),v&&(s?M=!1:(u.isValid||d.isValid)&&(M=await x(o,!0)));v&&(w._f.deps&&O(w._f.deps),g(c,M,s,j))}},D=(e,t)=>{if(eft(n.errors,t)&&e.focus)return e.focus(),1},O=async(e,t={})=>{let a,i;const s=Dft(e);if(r.resolver){const t=await(async e=>{const{errors:t}=await b(e);if(e)for(const r of e){const e=eft(t,r);e?rft(n.errors,r,e):Aft(n.errors,r)}else n.errors=t;return t})(Zht(e)?e:s);a=jft(t),i=e?!s.some(e=>eft(t,e)):a}else e?(i=(await Promise.all(s.map(async e=>{const t=eft(o,e);return await x(t&&t._f?{[e]:t}:t)}))).every(Boolean),(i||n.isValid)&&f()):i=a=await x(o);return p.state.next({...!kft(e)||(u.isValid||d.isValid)&&a!==n.isValid?{}:{name:e},...r.resolver||!e?{isValid:a}:{},errors:n.errors}),t.shouldFocus&&!i&&rmt(o,D,e?s:l.mount),i},P=e=>{const t={...s.mount?i:a};return Zht(e)?t:kft(e)?eft(t,e):e.map(e=>eft(t,e))},E=(e,t)=>({invalid:!!eft((t||n).errors,e),isDirty:!!eft((t||n).dirtyFields,e),error:eft((t||n).errors,e),isValidating:!!eft(n.validatingFields,e),isTouched:!!eft((t||n).touchedFields,e)}),j=(e,t,r)=>{const a=(eft(o,e,{_f:{}})._f||{}).ref,i=eft(n.errors,e)||{},{ref:s,message:l,type:c,...u}=i;rft(n.errors,e,{...u,...t,ref:a}),p.state.next({name:e,errors:n.errors,isValid:!1}),r&&r.shouldFocus&&a&&a.focus&&a.focus()},T=e=>p.state.subscribe({next:t=>{((e,t,r)=>!e||!t||e===t||Dft(e).some(e=>e&&(r?e===t:e.startsWith(t)||t.startsWith(e))))(e.name,t.name,e.exact)&&((e,t,r,n)=>{r(e);const{name:o,...a}=e;return jft(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(e=>t[e]===(!n||uft))})(t,e.formState||u,B,e.reRenderRoot)&&e.callback({values:{...i},...n,...t})}}).unsubscribe,N=(e,t={})=>{for(const s of e?Dft(e):l.mount)l.mount.delete(s),l.array.delete(s),t.keepValue||(Aft(o,s),Aft(i,s)),!t.keepError&&Aft(n.errors,s),!t.keepDirty&&Aft(n.dirtyFields,s),!t.keepTouched&&Aft(n.touchedFields,s),!t.keepIsValidating&&Aft(n.validatingFields,s),!r.shouldUnregister&&!t.keepDefaultValue&&Aft(a,s);p.state.next({values:Yht(i)}),p.state.next({...n,...t.keepDirty?{isDirty:w()}:{}}),!t.keepIsValid&&f()},R=({disabled:e,name:t})=>{(tft(e)&&s.mount||e||l.disabled.has(t))&&(e?l.disabled.add(t):l.disabled.delete(t))},F=(e,t={})=>{let n=eft(o,e);const i=tft(t.disabled)||tft(r.disabled);return rft(o,e,{...n||{},_f:{...n&&n._f?n._f:{ref:{name:e}},name:e,mount:!0,...t}}),l.mount.add(e),n?R({disabled:tft(t.disabled)?t.disabled:r.disabled,name:e}):v(e,!0,t.value),{...i?{disabled:t.disabled||r.disabled}:{},...r.progressive?{required:!!t.required,min:Zft(t.min),max:Zft(t.max),minLength:Zft(t.minLength),maxLength:Zft(t.maxLength),pattern:Zft(t.pattern)}:{},name:e,onChange:S,onBlur:S,ref:i=>{if(i){F(e,t),n=eft(o,e);const r=Zht(i.value)&&i.querySelectorAll&&i.querySelectorAll("input,select,textarea")[0]||i,s=(e=>zft(e)||Vht(e))(r),l=n._f.refs||[];if(s?l.find(e=>e===r):r===n._f.ref)return;rft(o,e,{_f:{...n._f,...s?{refs:[...l.filter(Ift),r,...Array.isArray(eft(a,e))?[{}]:[]],ref:{type:r.type,name:e}}:{ref:r}}}),v(e,!1,void 0,r)}else n=eft(o,e,{}),n._f&&(n._f.mount=!1),(r.shouldUnregister||t.shouldUnregister)&&(!Ght(l.array,e)||!s.action)&&l.unMount.add(e)}}},z=()=>r.shouldFocusError&&rmt(o,D,l.mount),I=(e,t)=>async a=>{let s;a&&(a.preventDefault&&a.preventDefault(),a.persist&&a.persist());let c=Yht(i);if(p.state.next({isSubmitting:!0}),r.resolver){const{errors:e,values:t}=await b();n.errors=e,c=Yht(t)}else await x(o);if(l.disabled.size)for(const e of l.disabled)Aft(c,e);if(Aft(n.errors,"root"),jft(n.errors)){p.state.next({errors:{}});try{await e(c,a)}catch(e){s=e}}else t&&await t({...n.errors},a),z(),setTimeout(z);if(p.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:jft(n.errors)&&!s,submitCount:n.submitCount+1,errors:n.errors}),s)throw s},A=(e,t={})=>{const c=e?Yht(e):a,d=Yht(c),h=jft(e),f=h?a:d;if(t.keepDefaultValues||(a=c),!t.keepValues){if(t.keepDirtyValues){const e=new Set([...l.mount,...Object.keys(Hft(a,i))]);for(const t of Array.from(e))eft(n.dirtyFields,t)?rft(f,t,eft(i,t)):M(t,eft(f,t))}else{if(Kht&&Zht(e))for(const e of l.mount){const t=eft(o,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(Rft(e)){const t=e.closest("form");if(t){t.reset();break}}}}if(t.keepFieldsRef)for(const e of l.mount)M(e,eft(f,e));else o={}}i=r.shouldUnregister?t.keepDefaultValues?Yht(a):{}:Yht(f),p.array.next({values:{...f}}),p.state.next({values:{...f}})}l={mount:t.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!u.isValid||!!t.keepIsValid||!!t.keepDirtyValues,s.watch=!!r.shouldUnregister,p.state.next({submitCount:t.keepSubmitCount?n.submitCount:0,isDirty:!h&&(t.keepDirty?n.isDirty:!(!t.keepDefaultValues||Eft(e,a))),isSubmitted:!!t.keepIsSubmitted&&n.isSubmitted,dirtyFields:h?{}:t.keepDirtyValues?t.keepDefaultValues&&i?Hft(a,i):n.dirtyFields:t.keepDefaultValues&&e?Hft(a,e):t.keepDirty?n.dirtyFields:{},touchedFields:t.keepTouched?n.touchedFields:{},errors:t.keepErrors?n.errors:{},isSubmitSuccessful:!!t.keepIsSubmitSuccessful&&n.isSubmitSuccessful,isSubmitting:!1})},L=(e,t)=>A(Nft(e)?e(i):e,t),B=e=>{n={...n,...e}},V={control:{register:F,unregister:N,getFieldState:E,handleSubmit:I,setError:j,_subscribe:T,_runSchema:b,_focusError:z,_getWatch:k,_getDirty:w,_setValid:f,_setFieldArray:(e,t=[],l,c,h=!0,f=!0)=>{if(c&&l&&!r.disabled){if(s.action=!0,f&&Array.isArray(eft(o,e))){const t=l(eft(o,e),c.argA,c.argB);h&&rft(o,e,t)}if(f&&Array.isArray(eft(n.errors,e))){const t=l(eft(n.errors,e),c.argA,c.argB);h&&rft(n.errors,e,t),((e,t)=>{!Qht(eft(e,t)).length&&Aft(e,t)})(n.errors,e)}if((u.touchedFields||d.touchedFields)&&f&&Array.isArray(eft(n.touchedFields,e))){const t=l(eft(n.touchedFields,e),c.argA,c.argB);h&&rft(n.touchedFields,e,t)}(u.dirtyFields||d.dirtyFields)&&(n.dirtyFields=Hft(a,i)),p.state.next({name:e,isDirty:w(e,t),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else rft(i,e,t)},_setDisabledField:R,_setErrors:e=>{n.errors=e,p.state.next({errors:n.errors,isValid:!1})},_getFieldArray:e=>Qht(eft(s.mount?i:a,e,r.shouldUnregister?eft(a,e,[]):[])),_reset:A,_resetDefaultValues:()=>Nft(r.defaultValues)&&r.defaultValues().then(e=>{L(e,r.resetOptions),p.state.next({isLoading:!1})}),_removeUnmounted:()=>{for(const e of l.unMount){const t=eft(o,e);t&&(t._f.refs?t._f.refs.every(e=>!Ift(e)):!Ift(t._f.ref))&&N(e)}l.unMount=new Set},_disableForm:e=>{tft(e)&&(p.state.next({disabled:e}),rmt(o,(t,r)=>{const n=eft(o,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:p,_proxyFormState:u,get _fields(){return o},get _formValues(){return i},get _state(){return s},set _state(e){s=e},get _defaultValues(){return a},get _names(){return l},set _names(e){l=e},get _formState(){return n},get _options(){return r},set _options(e){r={...r,...e}}},subscribe:e=>(s.mount=!0,d={...d,...e.formState},T({...e,formState:d})),trigger:O,register:F,handleSubmit:I,watch:(e,t)=>Nft(e)?p.state.subscribe({next:r=>e(k(void 0,t),r)}):k(e,t,!0),setValue:M,getValues:P,reset:L,resetField:(e,t={})=>{eft(o,e)&&(Zht(t.defaultValue)?M(e,Yht(eft(a,e))):(M(e,t.defaultValue),rft(a,e,Yht(t.defaultValue))),t.keepTouched||Aft(n.touchedFields,e),t.keepDirty||(Aft(n.dirtyFields,e),n.isDirty=t.defaultValue?w(e,Yht(eft(a,e))):w()),t.keepError||(Aft(n.errors,e),u.isValid&&f()),p.state.next({...n}))},clearErrors:e=>{e&&Dft(e).forEach(e=>Aft(n.errors,e)),p.state.next({errors:e?n.errors:{}})},unregister:N,setError:j,setFocus:(e,t={})=>{const r=eft(o,e),n=r&&r._f;if(n){const e=n.refs?n.refs[0]:n.ref;e.focus&&(e.focus(),t.shouldSelect&&Nft(e.select)&&e.select())}},getFieldState:E};return{...V,formControl:V}}var dmt=s.forwardRef((e,r)=>t.jsx(ult.label,{...e,ref:r,onMouseDown:t=>{var r;t.target.closest("button, input, select, textarea")||(null==(r=e.onMouseDown)||r.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));dmt.displayName="Label";var pmt=dmt;const hmt=Odt("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),fmt=s.forwardRef(({className:e,...r},n)=>t.jsx(pmt,{ref:n,className:vdt(hmt(),e),...r}));fmt.displayName=pmt.displayName;const mmt=e=>{const{children:t,...r}=e;return l.default.createElement(gft.Provider,{value:r},t)},vmt=s.createContext({}),ymt=({...e})=>t.jsx(vmt.Provider,{value:{name:e.name},children:t.jsx(Mft,{...e})}),gmt=()=>{const e=s.useContext(vmt),t=s.useContext(bmt),{getFieldState:r,formState:n}=bft(),o=r(e.name,n);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:a}=t;return{id:a,name:e.name,formItemId:`${a}-form-item`,formDescriptionId:`${a}-form-item-description`,formMessageId:`${a}-form-item-message`,...o}},bmt=s.createContext({}),xmt=s.forwardRef(({className:e,...r},n)=>{const o=s.useId();return t.jsx(bmt.Provider,{value:{id:o},children:t.jsx("div",{ref:n,className:vdt("space-y-2",e),...r})})});xmt.displayName="FormItem";const wmt=s.forwardRef(({className:e,...r},n)=>{const{error:o,formItemId:a}=gmt();return t.jsx(fmt,{ref:n,className:vdt(o&&"text-destructive",e),htmlFor:a,...r})});wmt.displayName="FormLabel";const kmt=s.forwardRef(({...e},r)=>{const{error:n,formItemId:o,formDescriptionId:a,formMessageId:i}=gmt();return t.jsx(alt,{ref:r,id:o,"aria-describedby":n?`${a} ${i}`:`${a}`,"aria-invalid":!!n,...e})});kmt.displayName="FormControl";const _mt=s.forwardRef(({className:e,...r},n)=>{const{formDescriptionId:o}=gmt();return t.jsx("p",{ref:n,id:o,className:vdt("text-sm text-muted-foreground",e),...r})});_mt.displayName="FormDescription";const Cmt=s.forwardRef(({className:e,children:r,...n},o)=>{const{error:a,formMessageId:i}=gmt(),s=a?String(null==a?void 0:a.message):r;return s?t.jsx("p",{ref:o,id:i,className:vdt("text-sm font-medium text-destructive",e),...n,children:s}):null});Cmt.displayName="FormMessage";const Mmt=s.forwardRef(({className:e,type:r,...n},o)=>t.jsx("input",{type:r,className:vdt("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:o,...n}));Mmt.displayName="Input";const Smt=["top","right","bottom","left"],Dmt=Math.min,Omt=Math.max,Pmt=Math.round,Emt=Math.floor,jmt=e=>({x:e,y:e}),Tmt={left:"right",right:"left",bottom:"top",top:"bottom"},Nmt={start:"end",end:"start"};function Rmt(e,t,r){return Omt(e,Dmt(t,r))}function Fmt(e,t){return"function"==typeof e?e(t):e}function zmt(e){return e.split("-")[0]}function Imt(e){return e.split("-")[1]}function Amt(e){return"x"===e?"y":"x"}function Lmt(e){return"y"===e?"height":"width"}const Bmt=new Set(["top","bottom"]);function Vmt(e){return Bmt.has(zmt(e))?"y":"x"}function Hmt(e){return Amt(Vmt(e))}function qmt(e){return e.replace(/start|end/g,e=>Nmt[e])}const $mt=["left","right"],Wmt=["right","left"],Umt=["top","bottom"],Gmt=["bottom","top"];function Kmt(e,t,r,n){const o=Imt(e);let a=function(e,t,r){switch(e){case"top":case"bottom":return r?t?Wmt:$mt:t?$mt:Wmt;case"left":case"right":return t?Umt:Gmt;default:return[]}}(zmt(e),"start"===r,n);return o&&(a=a.map(e=>e+"-"+o),t&&(a=a.concat(a.map(qmt)))),a}function Ymt(e){return e.replace(/left|right|bottom|top/g,e=>Tmt[e])}function Xmt(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 Zmt(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function Qmt(e,t,r){let{reference:n,floating:o}=e;const a=Vmt(t),i=Hmt(t),s=Lmt(i),l=zmt(t),c="y"===a,u=n.x+n.width/2-o.width/2,d=n.y+n.height/2-o.height/2,p=n[s]/2-o[s]/2;let h;switch(l){case"top":h={x:u,y:n.y-o.height};break;case"bottom":h={x:u,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:d};break;case"left":h={x:n.x-o.width,y:d};break;default:h={x:n.x,y:n.y}}switch(Imt(t)){case"start":h[i]-=p*(r&&c?-1:1);break;case"end":h[i]+=p*(r&&c?-1:1)}return h}async function Jmt(e,t){var r;void 0===t&&(t={});const{x:n,y:o,platform:a,rects:i,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:h=0}=Fmt(t,e),f=Xmt(h),m=s[p?"floating"===d?"reference":"floating":d],v=Zmt(await a.getClippingRect({element:null==(r=await(null==a.isElement?void 0:a.isElement(m)))||r?m:m.contextElement||await(null==a.getDocumentElement?void 0:a.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),y="floating"===d?{x:n,y:o,width:i.floating.width,height:i.floating.height}:i.reference,g=await(null==a.getOffsetParent?void 0:a.getOffsetParent(s.floating)),b=await(null==a.isElement?void 0:a.isElement(g))&&await(null==a.getScale?void 0:a.getScale(g))||{x:1,y:1},x=Zmt(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:g,strategy:l}):y);return{top:(v.top-x.top+f.top)/b.y,bottom:(x.bottom-v.bottom+f.bottom)/b.y,left:(v.left-x.left+f.left)/b.x,right:(x.right-v.right+f.right)/b.x}}function evt(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function tvt(e){return Smt.some(t=>e[t]>=0)}const rvt=new Set(["left","top"]);function nvt(){return typeof window<"u"}function ovt(e){return svt(e)?(e.nodeName||"").toLowerCase():"#document"}function avt(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function ivt(e){var t;return null==(t=(svt(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function svt(e){return!!nvt()&&(e instanceof Node||e instanceof avt(e).Node)}function lvt(e){return!!nvt()&&(e instanceof Element||e instanceof avt(e).Element)}function cvt(e){return!!nvt()&&(e instanceof HTMLElement||e instanceof avt(e).HTMLElement)}function uvt(e){return!(!nvt()||typeof ShadowRoot>"u")&&(e instanceof ShadowRoot||e instanceof avt(e).ShadowRoot)}const dvt=new Set(["inline","contents"]);function pvt(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=Cvt(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!dvt.has(o)}const hvt=new Set(["table","td","th"]);function fvt(e){return hvt.has(ovt(e))}const mvt=[":popover-open",":modal"];function vvt(e){return mvt.some(t=>{try{return e.matches(t)}catch{return!1}})}const yvt=["transform","translate","scale","rotate","perspective"],gvt=["transform","translate","scale","rotate","perspective","filter"],bvt=["paint","layout","strict","content"];function xvt(e){const t=wvt(),r=lvt(e)?Cvt(e):e;return yvt.some(e=>!!r[e]&&"none"!==r[e])||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||gvt.some(e=>(r.willChange||"").includes(e))||bvt.some(e=>(r.contain||"").includes(e))}function wvt(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const kvt=new Set(["html","body","#document"]);function _vt(e){return kvt.has(ovt(e))}function Cvt(e){return avt(e).getComputedStyle(e)}function Mvt(e){return lvt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Svt(e){if("html"===ovt(e))return e;const t=e.assignedSlot||e.parentNode||uvt(e)&&e.host||ivt(e);return uvt(t)?t.host:t}function Dvt(e){const t=Svt(e);return _vt(t)?e.ownerDocument?e.ownerDocument.body:e.body:cvt(t)&&pvt(t)?t:Dvt(t)}function Ovt(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);const o=Dvt(e),a=o===(null==(n=e.ownerDocument)?void 0:n.body),i=avt(o);if(a){const e=Pvt(i);return t.concat(i,i.visualViewport||[],pvt(o)?o:[],e&&r?Ovt(e):[])}return t.concat(o,Ovt(o,[],r))}function Pvt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Evt(e){const t=Cvt(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=cvt(e),a=o?e.offsetWidth:r,i=o?e.offsetHeight:n,s=Pmt(r)!==a||Pmt(n)!==i;return s&&(r=a,n=i),{width:r,height:n,$:s}}function jvt(e){return lvt(e)?e:e.contextElement}function Tvt(e){const t=jvt(e);if(!cvt(t))return jmt(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:a}=Evt(t);let i=(a?Pmt(r.width):r.width)/n,s=(a?Pmt(r.height):r.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!s||!Number.isFinite(s))&&(s=1),{x:i,y:s}}const Nvt=jmt(0);function Rvt(e){const t=avt(e);return wvt()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Nvt}function Fvt(e,t,r,n){void 0===t&&(t=!1),void 0===r&&(r=!1);const o=e.getBoundingClientRect(),a=jvt(e);let i=jmt(1);t&&(n?lvt(n)&&(i=Tvt(n)):i=Tvt(e));const s=function(e,t,r){return void 0===t&&(t=!1),!(!r||t&&r!==avt(e))&&t}(a,r,n)?Rvt(a):jmt(0);let l=(o.left+s.x)/i.x,c=(o.top+s.y)/i.y,u=o.width/i.x,d=o.height/i.y;if(a){const e=avt(a),t=n&&lvt(n)?avt(n):n;let r=e,o=Pvt(r);for(;o&&n&&t!==r;){const e=Tvt(o),t=o.getBoundingClientRect(),n=Cvt(o),a=t.left+(o.clientLeft+parseFloat(n.paddingLeft))*e.x,i=t.top+(o.clientTop+parseFloat(n.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=a,c+=i,r=avt(o),o=Pvt(r)}}return Zmt({width:u,height:d,x:l,y:c})}function zvt(e,t){const r=Mvt(e).scrollLeft;return t?t.left+r:Fvt(ivt(e)).left+r}function Ivt(e,t,r){void 0===r&&(r=!1);const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-(r?0:zvt(e,n)),y:n.top+t.scrollTop}}const Avt=new Set(["absolute","fixed"]);function Lvt(e,t,r){let n;if("viewport"===t)n=function(e,t){const r=avt(e),n=ivt(e),o=r.visualViewport;let a=n.clientWidth,i=n.clientHeight,s=0,l=0;if(o){a=o.width,i=o.height;const e=wvt();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:a,height:i,x:s,y:l}}(e,r);else if("document"===t)n=function(e){const t=ivt(e),r=Mvt(e),n=e.ownerDocument.body,o=Omt(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),a=Omt(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+zvt(e);const s=-r.scrollTop;return"rtl"===Cvt(n).direction&&(i+=Omt(t.clientWidth,n.clientWidth)-o),{width:o,height:a,x:i,y:s}}(ivt(e));else if(lvt(t))n=function(e,t){const r=Fvt(e,!0,"fixed"===t),n=r.top+e.clientTop,o=r.left+e.clientLeft,a=cvt(e)?Tvt(e):jmt(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:o*a.x,y:n*a.y}}(t,r);else{const r=Rvt(e);n={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Zmt(n)}function Bvt(e,t){const r=Svt(e);return!(r===t||!lvt(r)||_vt(r))&&("fixed"===Cvt(r).position||Bvt(r,t))}function Vvt(e,t){const r=t.get(e);if(r)return r;let n=Ovt(e,[],!1).filter(e=>lvt(e)&&"body"!==ovt(e)),o=null;const a="fixed"===Cvt(e).position;let i=a?Svt(e):e;for(;lvt(i)&&!_vt(i);){const t=Cvt(i),r=xvt(i);!r&&"fixed"===t.position&&(o=null),(a?!r&&!o:!r&&"static"===t.position&&o&&Avt.has(o.position)||pvt(i)&&!r&&Bvt(e,i))?n=n.filter(e=>e!==i):o=t,i=Svt(i)}return t.set(e,n),n}function Hvt(e,t,r){const n=cvt(t),o=ivt(t),a="fixed"===r,i=Fvt(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=jmt(0);function c(){l.x=zvt(o)}if(n||!n&&!a)if(("body"!==ovt(t)||pvt(o))&&(s=Mvt(t)),n){const e=Fvt(t,!0,a,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&c();a&&!n&&o&&c();const u=!o||n||a?jmt(0):Ivt(o,s);return{x:i.left+s.scrollLeft-l.x-u.x,y:i.top+s.scrollTop-l.y-u.y,width:i.width,height:i.height}}function qvt(e){return"static"===Cvt(e).position}function $vt(e,t){if(!cvt(e)||"fixed"===Cvt(e).position)return null;if(t)return t(e);let r=e.offsetParent;return ivt(e)===r&&(r=r.ownerDocument.body),r}function Wvt(e,t){const r=avt(e);if(vvt(e))return r;if(!cvt(e)){let t=Svt(e);for(;t&&!_vt(t);){if(lvt(t)&&!qvt(t))return t;t=Svt(t)}return r}let n=$vt(e,t);for(;n&&fvt(n)&&qvt(n);)n=$vt(n,t);return n&&_vt(n)&&qvt(n)&&!xvt(n)?r:n||function(e){let t=Svt(e);for(;cvt(t)&&!_vt(t);){if(xvt(t))return t;if(vvt(t))return null;t=Svt(t)}return null}(e)||r}const Uvt={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const a="fixed"===o,i=ivt(n),s=!!t&&vvt(t.floating);if(n===i||s&&a)return r;let l={scrollLeft:0,scrollTop:0},c=jmt(1);const u=jmt(0),d=cvt(n);if((d||!d&&!a)&&(("body"!==ovt(n)||pvt(i))&&(l=Mvt(n)),cvt(n))){const e=Fvt(n);c=Tvt(n),u.x=e.x+n.clientLeft,u.y=e.y+n.clientTop}const p=!i||d||a?jmt(0):Ivt(i,l,!0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+u.x+p.x,y:r.y*c.y-l.scrollTop*c.y+u.y+p.y}},getDocumentElement:ivt,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const a=[..."clippingAncestors"===r?vvt(t)?[]:Vvt(t,this._c):[].concat(r),n],i=a[0],s=a.reduce((e,r)=>{const n=Lvt(t,r,o);return e.top=Omt(n.top,e.top),e.right=Dmt(n.right,e.right),e.bottom=Dmt(n.bottom,e.bottom),e.left=Omt(n.left,e.left),e},Lvt(t,i,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:Wvt,getElementRects:async function(e){const t=this.getOffsetParent||Wvt,r=this.getDimensions,n=await r(e.floating);return{reference:Hvt(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}=Evt(e);return{width:t,height:r}},getScale:Tvt,isElement:lvt,isRTL:function(e){return"rtl"===Cvt(e).direction}};function Gvt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Kvt(e,t,r,n){void 0===n&&(n={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=n,c=jvt(e),u=o||a?[...c?Ovt(c):[],...Ovt(t)]:[];u.forEach(e=>{o&&e.addEventListener("scroll",r,{passive:!0}),a&&e.addEventListener("resize",r)});const d=c&&s?function(e,t){let r,n=null;const o=ivt(e);function a(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return function i(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),a();const c=e.getBoundingClientRect(),{left:u,top:d,width:p,height:h}=c;if(s||t(),!p||!h)return;const f={rootMargin:-Emt(d)+"px "+-Emt(o.clientWidth-(u+p))+"px "+-Emt(o.clientHeight-(d+h))+"px "+-Emt(u)+"px",threshold:Omt(0,Dmt(1,l))||1};let m=!0;function v(t){const n=t[0].intersectionRatio;if(n!==l){if(!m)return i();n?i(!1,n):r=setTimeout(()=>{i(!1,1e-7)},1e3)}1===n&&!Gvt(c,e.getBoundingClientRect())&&i(),m=!1}try{n=new IntersectionObserver(v,{...f,root:o.ownerDocument})}catch{n=new IntersectionObserver(v,f)}n.observe(e)}(!0),a}(c,r):null;let p=-1,h=null;i&&(h=new ResizeObserver(e=>{let[n]=e;n&&n.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),r()}),c&&!l&&h.observe(c),h.observe(t));let f,m=l?Fvt(e):null;return l&&function t(){const n=Fvt(e);m&&!Gvt(m,n)&&r(),m=n,f=requestAnimationFrame(t)}(),r(),()=>{var e;u.forEach(e=>{o&&e.removeEventListener("scroll",r),a&&e.removeEventListener("resize",r)}),null==d||d(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(f)}}const Yvt=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:a,placement:i,middlewareData:s}=t,l=await async function(e,t){const{placement:r,platform:n,elements:o}=e,a=await(null==n.isRTL?void 0:n.isRTL(o.floating)),i=zmt(r),s=Imt(r),l="y"===Vmt(r),c=rvt.has(i)?-1:1,u=a&&l?-1:1,d=Fmt(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:f}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof f&&(h="end"===s?-1*f:f),l?{x:h*u,y:p*c}:{x:p*c,y:h*u}}(t,e);return i===(null==(r=s.offset)?void 0:r.placement)&&null!=(n=s.arrow)&&n.alignmentOffset?{}:{x:o+l.x,y:a+l.y,data:{...l,placement:i}}}}},Xvt=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:s={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...l}=Fmt(e,t),c={x:r,y:n},u=await Jmt(t,l),d=Vmt(zmt(o)),p=Amt(d);let h=c[p],f=c[d];if(a){const e="y"===p?"bottom":"right";h=Rmt(h+u["y"===p?"top":"left"],h,h-u[e])}if(i){const e="y"===d?"bottom":"right";f=Rmt(f+u["y"===d?"top":"left"],f,f-u[e])}const m=s.fn({...t,[p]:h,[d]:f});return{...m,data:{x:m.x-r,y:m.y-n,enabled:{[p]:a,[d]:i}}}}}},Zvt=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:a,rects:i,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:m=!0,...v}=Fmt(e,t);if(null!=(r=a.arrow)&&r.alignmentOffset)return{};const y=zmt(o),g=Vmt(s),b=zmt(s)===s,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=p||(b||!m?[Ymt(s)]:function(e){const t=Ymt(e);return[qmt(e),t,qmt(t)]}(s)),k="none"!==f;!p&&k&&w.push(...Kmt(s,m,f,x));const _=[s,...w],C=await Jmt(t,v),M=[];let S=(null==(n=a.flip)?void 0:n.overflows)||[];if(u&&M.push(C[y]),d){const e=function(e,t,r){void 0===r&&(r=!1);const n=Imt(e),o=Hmt(e),a=Lmt(o);let i="x"===o?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=Ymt(i)),[i,Ymt(i)]}(o,i,x);M.push(C[e[0]],C[e[1]])}if(S=[...S,{placement:o,overflows:M}],!M.every(e=>e<=0)){var D,O;const e=((null==(D=a.flip)?void 0:D.index)||0)+1,t=_[e];if(t&&("alignment"!==d||g===Vmt(t)||S.every(e=>e.overflows[0]>0&&Vmt(e.placement)===g)))return{data:{index:e,overflows:S},reset:{placement:t}};let r=null==(O=S.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:O.placement;if(!r)switch(h){case"bestFit":{var P;const e=null==(P=S.filter(e=>{if(k){const t=Vmt(e.placement);return t===g||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:P[0];e&&(r=e);break}case"initialPlacement":r=s}if(o!==r)return{reset:{placement:r}}}return{}}}},Qvt=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:a,platform:i,elements:s}=t,{apply:l=()=>{},...c}=Fmt(e,t),u=await Jmt(t,c),d=zmt(o),p=Imt(o),h="y"===Vmt(o),{width:f,height:m}=a.floating;let v,y;"top"===d||"bottom"===d?(v=d,y=p===(await(null==i.isRTL?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(y=d,v="end"===p?"top":"bottom");const g=m-u.top-u.bottom,b=f-u.left-u.right,x=Dmt(m-u[v],g),w=Dmt(f-u[y],b),k=!t.middlewareData.shift;let _=x,C=w;if(null!=(r=t.middlewareData.shift)&&r.enabled.x&&(C=b),null!=(n=t.middlewareData.shift)&&n.enabled.y&&(_=g),k&&!p){const e=Omt(u.left,0),t=Omt(u.right,0),r=Omt(u.top,0),n=Omt(u.bottom,0);h?C=f-2*(0!==e||0!==t?e+t:Omt(u.left,u.right)):_=m-2*(0!==r||0!==n?r+n:Omt(u.top,u.bottom))}await l({...t,availableWidth:C,availableHeight:_});const M=await i.getDimensions(s.floating);return f!==M.width||m!==M.height?{reset:{rects:!0}}:{}}}},Jvt=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=Fmt(e,t);switch(n){case"referenceHidden":{const e=evt(await Jmt(t,{...o,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:tvt(e)}}}case"escaped":{const e=evt(await Jmt(t,{...o,altBoundary:!0}),r.floating);return{data:{escapedOffsets:e,escaped:tvt(e)}}}default:return{}}}}},eyt=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:a,platform:i,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=Fmt(e,t)||{};if(null==c)return{};const d=Xmt(u),p={x:r,y:n},h=Hmt(o),f=Lmt(h),m=await i.getDimensions(c),v="y"===h,y=v?"top":"left",g=v?"bottom":"right",b=v?"clientHeight":"clientWidth",x=a.reference[f]+a.reference[h]-p[h]-a.floating[f],w=p[h]-a.reference[h],k=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c));let _=k?k[b]:0;(!_||!await(null==i.isElement?void 0:i.isElement(k)))&&(_=s.floating[b]||a.floating[f]);const C=x/2-w/2,M=_/2-m[f]/2-1,S=Dmt(d[y],M),D=Dmt(d[g],M),O=S,P=_-m[f]-D,E=_/2-m[f]/2+C,j=Rmt(O,E,P),T=!l.arrow&&null!=Imt(o)&&E!==j&&a.reference[f]/2-(E<O?S:D)-m[f]/2<0,N=T?E<O?E-O:E-P:0;return{[h]:p[h]+N,data:{[h]:j,centerOffset:E-j-N,...T&&{alignmentOffset:N}},reset:T}}}),tyt=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:a,middlewareData:i}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=Fmt(e,t),u={x:r,y:n},d=Vmt(o),p=Amt(d);let h=u[p],f=u[d];const m=Fmt(s,t),v="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const e="y"===p?"height":"width",t=a.reference[p]-a.floating[e]+v.mainAxis,r=a.reference[p]+a.reference[e]-v.mainAxis;h<t?h=t:h>r&&(h=r)}if(c){var y,g;const e="y"===p?"width":"height",t=rvt.has(zmt(o)),r=a.reference[d]-a.floating[e]+(t&&(null==(y=i.offset)?void 0:y[d])||0)+(t?0:v.crossAxis),n=a.reference[d]+a.reference[e]+(t?0:(null==(g=i.offset)?void 0:g[d])||0)-(t?v.crossAxis:0);f<r?f=r:f>n&&(f=n)}return{[p]:h,[d]:f}}}},ryt=(e,t,r)=>{const n=new Map,o={platform:Uvt,...r},a={...o.platform,_c:n};return(async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:a=[],platform:i}=r,s=a.filter(Boolean),l=await(null==i.isRTL?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=Qmt(c,n,l),p=n,h={},f=0;for(let r=0;r<s.length;r++){const{name:a,fn:m}=s[r],{x:v,y:y,data:g,reset:b}=await m({x:u,y:d,initialPlacement:n,placement:p,strategy:o,middlewareData:h,rects:c,platform:i,elements:{reference:e,floating:t}});u=v??u,d=y??d,h={...h,[a]:{...h[a],...g}},b&&f<=50&&(f++,"object"==typeof b&&(b.placement&&(p=b.placement),b.rects&&(c=!0===b.rects?await i.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:u,y:d}=Qmt(c,p,l))),r=-1)}return{x:u,y:d,placement:p,strategy:o,middlewareData:h}})(e,t,{...o,platform:a})};var nyt=typeof document<"u"?e.useLayoutEffect:function(){};function oyt(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,o;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(!oyt(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;0!==n--;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;0!==n--;){const r=o[n];if(!("_owner"===r&&e.$$typeof||oyt(e[r],t[r])))return!1}return!0}return e!=e&&t!=t}function ayt(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function iyt(e,t){const r=ayt(e);return Math.round(t*r)/r}function syt(e){const t=s.useRef(e);return nyt(()=>{t.current=e}),t}const lyt=e=>({name:"arrow",options:e,fn(t){const{element:r,padding:n}="function"==typeof e?e(t):e;return r&&function(e){return{}.hasOwnProperty.call(e,"current")}(r)?null!=r.current?eyt({element:r.current,padding:n}).fn(t):{}:r?eyt({element:r,padding:n}).fn(t):{}}}),cyt=(e,t)=>({...Yvt(e),options:[e,t]}),uyt=(e,t)=>({...Xvt(e),options:[e,t]}),dyt=(e,t)=>({...tyt(e),options:[e,t]}),pyt=(e,t)=>({...Zvt(e),options:[e,t]}),hyt=(e,t)=>({...Qvt(e),options:[e,t]}),fyt=(e,t)=>({...Jvt(e),options:[e,t]}),myt=(e,t)=>({...lyt(e),options:[e,t]});var vyt=s.forwardRef((e,r)=>{const{children:n,width:o=10,height:a=5,...i}=e;return t.jsx(ult.svg,{...i,ref:r,width:o,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:t.jsx("polygon",{points:"0,0 30,0 15,10"})})});vyt.displayName="Arrow";var yyt=vyt;function gyt(e){const[t,r]=s.useState(void 0);return Qst(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;const n=t[0];let o,a;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,a=t.blockSize}else o=e.offsetWidth,a=e.offsetHeight;r({width:o,height:a})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}var byt="Popper",[xyt,wyt]=Xst(byt),[kyt,_yt]=xyt(byt),Cyt=e=>{const{__scopePopper:r,children:n}=e,[o,a]=s.useState(null);return t.jsx(kyt,{scope:r,anchor:o,onAnchorChange:a,children:n})};Cyt.displayName=byt;var Myt="PopperAnchor",Syt=s.forwardRef((e,r)=>{const{__scopePopper:n,virtualRef:o,...a}=e,i=_yt(Myt,n),l=s.useRef(null),c=Yst(r,l);return s.useEffect(()=>{i.onAnchorChange((null==o?void 0:o.current)||l.current)}),o?null:t.jsx(ult.div,{...a,ref:c})});Syt.displayName=Myt;var Dyt="PopperContent",[Oyt,Pyt]=xyt(Dyt),Eyt=s.forwardRef((e,r)=>{var n,o,a,i,l,c;const{__scopePopper:u,side:p="bottom",sideOffset:h=0,align:f="center",alignOffset:m=0,arrowPadding:v=0,avoidCollisions:y=!0,collisionBoundary:g=[],collisionPadding:b=0,sticky:x="partial",hideWhenDetached:w=!1,updatePositionStrategy:k="optimized",onPlaced:_,...C}=e,M=_yt(Dyt,u),[S,D]=s.useState(null),O=Yst(r,e=>D(e)),[P,E]=s.useState(null),j=gyt(P),T=(null==j?void 0:j.width)??0,N=(null==j?void 0:j.height)??0,R=p+("center"!==f?"-"+f:""),F="number"==typeof b?b:{top:0,right:0,bottom:0,left:0,...b},z=Array.isArray(g)?g:[g],I=z.length>0,A={padding:F,boundary:z.filter(Ryt),altBoundary:I},{refs:L,floatingStyles:B,placement:V,isPositioned:H,middlewareData:q}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:a,floating:i}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[p,h]=s.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[f,m]=s.useState(n);oyt(f,n)||m(n);const[v,y]=s.useState(null),[g,b]=s.useState(null),x=s.useCallback(e=>{e!==C.current&&(C.current=e,y(e))},[]),w=s.useCallback(e=>{e!==M.current&&(M.current=e,b(e))},[]),k=a||v,_=i||g,C=s.useRef(null),M=s.useRef(null),S=s.useRef(p),D=null!=c,O=syt(c),P=syt(o),E=syt(u),j=s.useCallback(()=>{if(!C.current||!M.current)return;const e={placement:t,strategy:r,middleware:f};P.current&&(e.platform=P.current),ryt(C.current,M.current,e).then(e=>{const t={...e,isPositioned:!1!==E.current};T.current&&!oyt(S.current,t)&&(S.current=t,d.flushSync(()=>{h(t)}))})},[f,t,r,P,E]);nyt(()=>{!1===u&&S.current.isPositioned&&(S.current.isPositioned=!1,h(e=>({...e,isPositioned:!1})))},[u]);const T=s.useRef(!1);nyt(()=>(T.current=!0,()=>{T.current=!1}),[]),nyt(()=>{if(k&&(C.current=k),_&&(M.current=_),k&&_){if(O.current)return O.current(k,_,j);j()}},[k,_,j,O,D]);const N=s.useMemo(()=>({reference:C,floating:M,setReference:x,setFloating:w}),[x,w]),R=s.useMemo(()=>({reference:k,floating:_}),[k,_]),F=s.useMemo(()=>{const e={position:r,left:0,top:0};if(!R.floating)return e;const t=iyt(R.floating,p.x),n=iyt(R.floating,p.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",...ayt(R.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,l,R.floating,p.x,p.y]);return s.useMemo(()=>({...p,update:j,refs:N,elements:R,floatingStyles:F}),[p,j,N,R,F])}({strategy:"fixed",placement:R,whileElementsMounted:(...e)=>Kvt(...e,{animationFrame:"always"===k}),elements:{reference:M.anchor},middleware:[cyt({mainAxis:h+N,alignmentAxis:m}),y&&uyt({mainAxis:!0,crossAxis:!1,limiter:"partial"===x?dyt():void 0,...A}),y&&pyt({...A}),hyt({...A,apply:({elements:e,rects:t,availableWidth:r,availableHeight:n})=>{const{width:o,height:a}=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",`${o}px`),i.setProperty("--radix-popper-anchor-height",`${a}px`)}}),P&&myt({element:P,padding:v}),Fyt({arrowWidth:T,arrowHeight:N}),w&&fyt({strategy:"referenceHidden",...A})]}),[$,W]=zyt(V),U=plt(_);Qst(()=>{H&&(null==U||U())},[H,U]);const G=null==(n=q.arrow)?void 0:n.x,K=null==(o=q.arrow)?void 0:o.y,Y=0!==(null==(a=q.arrow)?void 0:a.centerOffset),[X,Z]=s.useState();return Qst(()=>{S&&Z(window.getComputedStyle(S).zIndex)},[S]),t.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...B,transform:H?B.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:X,"--radix-popper-transform-origin":[null==(i=q.transformOrigin)?void 0:i.x,null==(l=q.transformOrigin)?void 0:l.y].join(" "),...(null==(c=q.hide)?void 0:c.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:t.jsx(Oyt,{scope:u,placedSide:$,onArrowChange:E,arrowX:G,arrowY:K,shouldHideArrow:Y,children:t.jsx(ult.div,{"data-side":$,"data-align":W,...C,ref:O,style:{...C.style,animation:H?void 0:"none"}})})})});Eyt.displayName=Dyt;var jyt="PopperArrow",Tyt={top:"bottom",right:"left",bottom:"top",left:"right"},Nyt=s.forwardRef(function(e,r){const{__scopePopper:n,...o}=e,a=Pyt(jyt,n),i=Tyt[a.placedSide];return t.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:t.jsx(yyt,{...o,ref:r,style:{...o.style,display:"block"}})})});function Ryt(e){return null!==e}Nyt.displayName=jyt;var Fyt=e=>({name:"transformOrigin",options:e,fn(t){var r,n,o;const{placement:a,rects:i,middlewareData:s}=t,l=0!==(null==(r=s.arrow)?void 0:r.centerOffset),c=l?0:e.arrowWidth,u=l?0:e.arrowHeight,[d,p]=zyt(a),h={start:"0%",center:"50%",end:"100%"}[p],f=((null==(n=s.arrow)?void 0:n.x)??0)+c/2,m=((null==(o=s.arrow)?void 0:o.y)??0)+u/2;let v="",y="";return"bottom"===d?(v=l?h:`${f}px`,y=-u+"px"):"top"===d?(v=l?h:`${f}px`,y=`${i.floating.height+u}px`):"right"===d?(v=-u+"px",y=l?h:`${m}px`):"left"===d&&(v=`${i.floating.width+u}px`,y=l?h:`${m}px`),{data:{x:v,y:y}}}});function zyt(e){const[t,r="center"]=e.split("-");return[t,r]}var Iyt=Cyt,Ayt=Syt,Lyt=Eyt,Byt=Nyt,Vyt="Popover",[Hyt,qyt]=Xst(Vyt,[wyt]),$yt=wyt(),[Wyt,Uyt]=Hyt(Vyt),Gyt=e=>{const{__scopePopover:r,children:n,open:o,defaultOpen:a,onOpenChange:i,modal:l=!1}=e,c=$yt(r),u=s.useRef(null),[d,p]=s.useState(!1),[h,f]=nlt({prop:o,defaultProp:a??!1,onChange:i,caller:Vyt});return t.jsx(Iyt,{...c,children:t.jsx(Wyt,{scope:r,contentId:tlt(),triggerRef:u,open:h,onOpenChange:f,onOpenToggle:s.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:d,onCustomAnchorAdd:s.useCallback(()=>p(!0),[]),onCustomAnchorRemove:s.useCallback(()=>p(!1),[]),modal:l,children:n})})};Gyt.displayName=Vyt;var Kyt="PopoverAnchor",Yyt=s.forwardRef((e,r)=>{const{__scopePopover:n,...o}=e,a=Uyt(Kyt,n),i=$yt(n),{onCustomAnchorAdd:l,onCustomAnchorRemove:c}=a;return s.useEffect(()=>(l(),()=>c()),[l,c]),t.jsx(Ayt,{...i,...o,ref:r})});Yyt.displayName=Kyt;var Xyt="PopoverTrigger",Zyt=s.forwardRef((e,r)=>{const{__scopePopover:n,...o}=e,a=Uyt(Xyt,n),i=$yt(n),s=Yst(r,a.triggerRef),l=t.jsx(ult.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":dgt(a.open),...o,ref:s,onClick:Ust(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?l:t.jsx(Ayt,{asChild:!0,...i,children:l})});Zyt.displayName=Xyt;var Qyt="PopoverPortal",[Jyt,egt]=Hyt(Qyt,{forceMount:void 0}),tgt=e=>{const{__scopePopover:r,forceMount:n,children:o,container:a}=e,i=Uyt(Qyt,r);return t.jsx(Jyt,{scope:r,forceMount:n,children:t.jsx(Nlt,{present:n||i.open,children:t.jsx(Tlt,{asChild:!0,container:a,children:o})})})};tgt.displayName=Qyt;var rgt="PopoverContent",ngt=s.forwardRef((e,r)=>{const n=egt(rgt,e.__scopePopover),{forceMount:o=n.forceMount,...a}=e,i=Uyt(rgt,e.__scopePopover);return t.jsx(Nlt,{present:o||i.open,children:i.modal?t.jsx(agt,{...a,ref:r}):t.jsx(igt,{...a,ref:r})})});ngt.displayName=rgt;var ogt=olt("PopoverContent.RemoveScroll"),agt=s.forwardRef((e,r)=>{const n=Uyt(rgt,e.__scopePopover),o=s.useRef(null),a=Yst(r,o),i=s.useRef(!1);return s.useEffect(()=>{const e=o.current;if(e)return Nct(e)},[]),t.jsx(Sct,{as:ogt,allowPinchZoom:!0,children:t.jsx(sgt,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ust(e.onCloseAutoFocus,e=>{var t;e.preventDefault(),i.current||null==(t=n.triggerRef.current)||t.focus()}),onPointerDownOutside:Ust(e.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey,n=2===t.button||r;i.current=n},{checkForDefaultPrevented:!1}),onFocusOutside:Ust(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),igt=s.forwardRef((e,r)=>{const n=Uyt(rgt,e.__scopePopover),o=s.useRef(!1),a=s.useRef(!1);return t.jsx(sgt,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{var r,i;null==(r=e.onCloseAutoFocus)||r.call(e,t),t.defaultPrevented||(o.current||null==(i=n.triggerRef.current)||i.focus(),t.preventDefault()),o.current=!1,a.current=!1},onInteractOutside:t=>{var r,i;null==(r=e.onInteractOutside)||r.call(e,t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(a.current=!0));const s=t.target;(null==(i=n.triggerRef.current)?void 0:i.contains(s))&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&a.current&&t.preventDefault()}})}),sgt=s.forwardRef((e,r)=>{const{__scopePopover:n,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:d,...p}=e,h=Uyt(rgt,n),f=$yt(n);return zlt(),t.jsx(Mlt,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:i,children:t.jsx(glt,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:d,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>h.onOpenChange(!1),children:t.jsx(Lyt,{"data-state":dgt(h.open),role:"dialog",id:h.contentId,...f,...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)"}})})})}),lgt="PopoverClose",cgt=s.forwardRef((e,r)=>{const{__scopePopover:n,...o}=e,a=Uyt(lgt,n);return t.jsx(ult.button,{type:"button",...o,ref:r,onClick:Ust(e.onClick,()=>a.onOpenChange(!1))})});cgt.displayName=lgt;var ugt=s.forwardRef((e,r)=>{const{__scopePopover:n,...o}=e,a=$yt(n);return t.jsx(Byt,{...a,...o,ref:r})});function dgt(e){return e?"open":"closed"}ugt.displayName="PopoverArrow";var pgt=tgt,hgt=ngt;const fgt=Gyt,mgt=Zyt,vgt=s.forwardRef(({className:e,align:r="center",sideOffset:n=4,...o},a)=>t.jsx(pgt,{children:t.jsx(hgt,{ref:a,align:r,sideOffset:n,className:vdt("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));function ygt(e){const r=e+"CollectionProvider",[n,o]=Xst(r),[a,i]=n(r,{collectionRef:{current:null},itemMap:new Map}),s=e=>{const{scope:r,children:n}=e,o=l.default.useRef(null),i=l.default.useRef(new Map).current;return t.jsx(a,{scope:r,itemMap:i,collectionRef:o,children:n})};s.displayName=r;const c=e+"CollectionSlot",u=olt(c),d=l.default.forwardRef((e,r)=>{const{scope:n,children:o}=e,a=Yst(r,i(c,n).collectionRef);return t.jsx(u,{ref:a,children:o})});d.displayName=c;const p=e+"CollectionItemSlot",h="data-radix-collection-item",f=olt(p),m=l.default.forwardRef((e,r)=>{const{scope:n,children:o,...a}=e,s=l.default.useRef(null),c=Yst(r,s),u=i(p,n);return l.default.useEffect(()=>(u.itemMap.set(s,{ref:s,...a}),()=>{u.itemMap.delete(s)})),t.jsx(f,{[h]:"",ref:c,children:o})});return m.displayName=p,[{Provider:s,Slot:d,ItemSlot:m},function(t){const r=i(e+"CollectionConsumer",t);return l.default.useCallback(()=>{const e=r.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${h}]`));return Array.from(r.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[r.collectionRef,r.itemMap])},o]}vgt.displayName=hgt.displayName;var ggt=s.createContext(void 0);function bgt(e){const t=s.useContext(ggt);return e||t||"ltr"}var xgt="rovingFocusGroup.onEntryFocus",wgt={bubbles:!1,cancelable:!0},kgt="RovingFocusGroup",[_gt,Cgt,Mgt]=ygt(kgt),[Sgt,Dgt]=Xst(kgt,[Mgt]),[Ogt,Pgt]=Sgt(kgt),Egt=s.forwardRef((e,r)=>t.jsx(_gt.Provider,{scope:e.__scopeRovingFocusGroup,children:t.jsx(_gt.Slot,{scope:e.__scopeRovingFocusGroup,children:t.jsx(jgt,{...e,ref:r})})}));Egt.displayName=kgt;var jgt=s.forwardRef((e,r)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:a=!1,dir:i,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:p=!1,...h}=e,f=s.useRef(null),m=Yst(r,f),v=bgt(i),[y,g]=nlt({prop:l,defaultProp:c??null,onChange:u,caller:kgt}),[b,x]=s.useState(!1),w=plt(d),k=Cgt(n),_=s.useRef(!1),[C,M]=s.useState(0);return s.useEffect(()=>{const e=f.current;if(e)return e.addEventListener(xgt,w),()=>e.removeEventListener(xgt,w)},[w]),t.jsx(Ogt,{scope:n,orientation:o,dir:v,loop:a,currentTabStopId:y,onItemFocus:s.useCallback(e=>g(e),[g]),onItemShiftTab:s.useCallback(()=>x(!0),[]),onFocusableItemAdd:s.useCallback(()=>M(e=>e+1),[]),onFocusableItemRemove:s.useCallback(()=>M(e=>e-1),[]),children:t.jsx(ult.div,{tabIndex:b||0===C?-1:0,"data-orientation":o,...h,ref:m,style:{outline:"none",...e.style},onMouseDown:Ust(e.onMouseDown,()=>{_.current=!0}),onFocus:Ust(e.onFocus,e=>{const t=!_.current;if(e.target===e.currentTarget&&t&&!b){const t=new CustomEvent(xgt,wgt);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=k().filter(e=>e.focusable);Fgt([e.find(e=>e.active),e.find(e=>e.id===y),...e].filter(Boolean).map(e=>e.ref.current),p)}}_.current=!1}),onBlur:Ust(e.onBlur,()=>x(!1))})})}),Tgt="RovingFocusGroupItem",Ngt=s.forwardRef((e,r)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:a=!1,tabStopId:i,children:l,...c}=e,u=tlt(),d=i||u,p=Pgt(Tgt,n),h=p.currentTabStopId===d,f=Cgt(n),{onFocusableItemAdd:m,onFocusableItemRemove:v,currentTabStopId:y}=p;return s.useEffect(()=>{if(o)return m(),()=>v()},[o,m,v]),t.jsx(_gt.ItemSlot,{scope:n,id:d,focusable:o,active:a,children:t.jsx(ult.span,{tabIndex:h?0:-1,"data-orientation":p.orientation,...c,ref:r,onMouseDown:Ust(e.onMouseDown,e=>{o?p.onItemFocus(d):e.preventDefault()}),onFocus:Ust(e.onFocus,()=>p.onItemFocus(d)),onKeyDown:Ust(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void p.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,r){const n=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,r);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(n)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(n)))return Rgt[n]}(e,p.orientation,p.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let r=f().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(()=>Fgt(r))}}),children:"function"==typeof l?l({isCurrentTabStop:h,hasTabStop:null!=y}):l})})});Ngt.displayName=Tgt;var Rgt={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Fgt(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}var zgt=Egt,Igt=Ngt;function Agt(e){const t=s.useRef({value:e,previous:e});return s.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Lgt="Radio",[Bgt,Vgt]=Xst(Lgt),[Hgt,qgt]=Bgt(Lgt),$gt=s.forwardRef((e,r)=>{const{__scopeRadio:n,name:o,checked:a=!1,required:i,disabled:l,value:c="on",onCheck:u,form:d,...p}=e,[h,f]=s.useState(null),m=Yst(r,e=>f(e)),v=s.useRef(!1),y=!h||(d||!!h.closest("form"));return t.jsxs(Hgt,{scope:n,checked:a,disabled:l,children:[t.jsx(ult.button,{type:"button",role:"radio","aria-checked":a,"data-state":Kgt(a),"data-disabled":l?"":void 0,disabled:l,value:c,...p,ref:m,onClick:Ust(e.onClick,e=>{a||null==u||u(),y&&(v.current=e.isPropagationStopped(),v.current||e.stopPropagation())})}),y&&t.jsx(Ggt,{control:h,bubbles:!v.current,name:o,value:c,checked:a,required:i,disabled:l,form:d,style:{transform:"translateX(-100%)"}})]})});$gt.displayName=Lgt;var Wgt="RadioIndicator",Ugt=s.forwardRef((e,r)=>{const{__scopeRadio:n,forceMount:o,...a}=e,i=qgt(Wgt,n);return t.jsx(Nlt,{present:o||i.checked,children:t.jsx(ult.span,{"data-state":Kgt(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:r})})});Ugt.displayName=Wgt;var Ggt=s.forwardRef(({__scopeRadio:e,control:r,checked:n,bubbles:o=!0,...a},i)=>{const l=s.useRef(null),c=Yst(l,i),u=Agt(n),d=gyt(r);return s.useEffect(()=>{const e=l.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:o});r.call(e,n),e.dispatchEvent(t)}},[u,n,o]),t.jsx(ult.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...a,tabIndex:-1,ref:c,style:{...a.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function Kgt(e){return e?"checked":"unchecked"}Ggt.displayName="RadioBubbleInput";var Ygt=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Xgt="RadioGroup",[Zgt,Qgt]=Xst(Xgt,[Dgt,Vgt]),Jgt=Dgt(),ebt=Vgt(),[tbt,rbt]=Zgt(Xgt),nbt=s.forwardRef((e,r)=>{const{__scopeRadioGroup:n,name:o,defaultValue:a,value:i,required:s=!1,disabled:l=!1,orientation:c,dir:u,loop:d=!0,onValueChange:p,...h}=e,f=Jgt(n),m=bgt(u),[v,y]=nlt({prop:i,defaultProp:a??null,onChange:p,caller:Xgt});return t.jsx(tbt,{scope:n,name:o,required:s,disabled:l,value:v,onValueChange:y,children:t.jsx(zgt,{asChild:!0,...f,orientation:c,dir:m,loop:d,children:t.jsx(ult.div,{role:"radiogroup","aria-required":s,"aria-orientation":c,"data-disabled":l?"":void 0,dir:m,...h,ref:r})})})});nbt.displayName=Xgt;var obt="RadioGroupItem",abt=s.forwardRef((e,r)=>{const{__scopeRadioGroup:n,disabled:o,...a}=e,i=rbt(obt,n),l=i.disabled||o,c=Jgt(n),u=ebt(n),d=s.useRef(null),p=Yst(r,d),h=i.value===a.value,f=s.useRef(!1);return s.useEffect(()=>{const e=e=>{Ygt.includes(e.key)&&(f.current=!0)},t=()=>f.current=!1;return document.addEventListener("keydown",e),document.addEventListener("keyup",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("keyup",t)}},[]),t.jsx(Igt,{asChild:!0,...c,focusable:!l,active:h,children:t.jsx($gt,{disabled:l,required:i.required,checked:h,...u,...a,name:i.name,ref:p,onCheck:()=>i.onValueChange(a.value),onKeyDown:Ust(e=>{"Enter"===e.key&&e.preventDefault()}),onFocus:Ust(a.onFocus,()=>{var e;f.current&&(null==(e=d.current)||e.click())})})})});abt.displayName=obt;var ibt=s.forwardRef((e,r)=>{const{__scopeRadioGroup:n,...o}=e,a=ebt(n);return t.jsx(Ugt,{...a,...o,ref:r})});ibt.displayName="RadioGroupIndicator";var sbt=nbt,lbt=abt,cbt=ibt;const ubt=s.forwardRef(({className:e,...r},n)=>t.jsx(sbt,{className:vdt("grid gap-2",e),...r,ref:n}));ubt.displayName=sbt.displayName;const dbt=s.forwardRef(({className:e,...r},n)=>t.jsx(lbt,{ref:n,className:vdt("aspect-square h-4 w-4 rounded-full border border-primary text-primary shadow focus:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),...r,children:t.jsx(cbt,{className:"flex items-center justify-center",children:t.jsx(Nst,{className:"h-3.5 w-3.5 fill-primary"})})}));dbt.displayName=lbt.displayName;const pbt=s.forwardRef(({className:e,...r},n)=>t.jsx("textarea",{className:vdt("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...r}));pbt.displayName="Textarea";const hbt=(e,t,r)=>{if(e&&"reportValidity"in e){const n=eft(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},fbt=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?hbt(n.ref,r,e):n.refs&&n.refs.forEach(t=>hbt(t,r,e))}},mbt=(e,t)=>{t.shouldUseNativeValidation&&fbt(e,t);const r={};for(const n in e){const o=eft(t.fields,n),a=Object.assign(e[n]||{},{ref:o&&o.ref});if(vbt(t.names||Object.keys(e),n)){const e=Object.assign({},eft(r,n));rft(e,"root",a),rft(r,n,e)}else rft(r,n,a)}return r},vbt=(e,t)=>e.some(e=>e.startsWith(t+"."));var ybt=function(e,t){for(var r={};e.length;){var n=e[0],o=n.code,a=n.message,i=n.path.join(".");if(!r[i])if("unionErrors"in n){var s=n.unionErrors[0].errors[0];r[i]={message:s.message,type:s.code}}else r[i]={message:a,type:o};if("unionErrors"in n&&n.unionErrors.forEach(function(t){return t.errors.forEach(function(t){return e.push(t)})}),t){var l=r[i].types,c=l&&l[n.code];r[i]=Sft(i,t,r,o,c?[].concat(c,n.message):n.message)}e.shift()}return r},gbt=function(e,t,r){return void 0===r&&(r={}),function(n,o,a){try{return Promise.resolve(function(o,i){try{var s=Promise.resolve(e["sync"===r.mode?"parse":"parseAsync"](n,t)).then(function(e){return a.shouldUseNativeValidation&&fbt({},a),{errors:{},values:r.raw?n:e}})}catch(e){return i(e)}return s&&s.then?s.then(void 0,i):s}(0,function(e){if(function(e){return Array.isArray(null==e?void 0:e.errors)}(e))return{values:{},errors:mbt(ybt(e.errors,!a.shouldUseNativeValidation&&"all"===a.criteriaMode),a)};throw e}))}catch(e){return Promise.reject(e)}}};const bbt=e.createContext({});function xbt(t){const r=e.useRef(null);return null===r.current&&(r.current=t()),r.current}const wbt=e.createContext(null),kbt=e.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class _bt extends s.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){const e=this.props.sizeRef.current;e.height=t.offsetHeight||0,e.width=t.offsetWidth||0,e.top=t.offsetTop,e.left=t.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function Cbt({children:r,isPresent:n}){const o=e.useId(),a=e.useRef(null),i=e.useRef({width:0,height:0,top:0,left:0}),{nonce:l}=e.useContext(kbt);return e.useInsertionEffect(()=>{const{width:e,height:t,top:r,left:s}=i.current;if(n||!a.current||!e||!t)return;a.current.dataset.motionPopId=o;const c=document.createElement("style");return l&&(c.nonce=l),document.head.appendChild(c),c.sheet&&c.sheet.insertRule(`\n [data-motion-pop-id="${o}"] {\n position: absolute !important;\n width: ${e}px !important;\n height: ${t}px !important;\n top: ${r}px !important;\n left: ${s}px !important;\n }\n `),()=>{document.head.removeChild(c)}},[n]),t.jsx(_bt,{isPresent:n,childRef:a,sizeRef:i,children:s.cloneElement(r,{ref:a})})}const Mbt=({children:r,initial:n,isPresent:o,onExitComplete:a,custom:i,presenceAffectsLayout:l,mode:c})=>{const u=xbt(Sbt),d=e.useId(),p=e.useCallback(e=>{u.set(e,!0);for(const e of u.values())if(!e)return;a&&a()},[u,a]),h=e.useMemo(()=>({id:d,initial:n,isPresent:o,custom:i,onExitComplete:p,register:e=>(u.set(e,!1),()=>u.delete(e))}),l?[Math.random(),p]:[o,p]);return e.useMemo(()=>{u.forEach((e,t)=>u.set(t,!1))},[o]),s.useEffect(()=>{!o&&!u.size&&a&&a()},[o]),"popLayout"===c&&(r=t.jsx(Cbt,{isPresent:o,children:r})),t.jsx(wbt.Provider,{value:h,children:r})};function Sbt(){return new Map}function Dbt(t=!0){const r=e.useContext(wbt);if(null===r)return[!0,null];const{isPresent:n,onExitComplete:o,register:a}=r,i=e.useId();e.useEffect(()=>{t&&a(i)},[t]);const s=e.useCallback(()=>t&&o&&o(i),[i,o,t]);return!n&&o?[!1,s]:[!0]}const Obt=e=>e.key||"";function Pbt(t){const r=[];return e.Children.forEach(t,t=>{e.isValidElement(t)&&r.push(t)}),r}const Ebt=typeof window<"u",jbt=Ebt?e.useLayoutEffect:e.useEffect,Tbt=({children:r,custom:n,initial:o=!0,onExitComplete:a,presenceAffectsLayout:i=!0,mode:s="sync",propagate:l=!1})=>{const[c,u]=Dbt(l),d=e.useMemo(()=>Pbt(r),[r]),p=l&&!c?[]:d.map(Obt),h=e.useRef(!0),f=e.useRef(d),m=xbt(()=>new Map),[v,y]=e.useState(d),[g,b]=e.useState(d);jbt(()=>{h.current=!1,f.current=d;for(let e=0;e<g.length;e++){const t=Obt(g[e]);p.includes(t)?m.delete(t):!0!==m.get(t)&&m.set(t,!1)}},[g,p.length,p.join("-")]);const x=[];if(d!==v){let e=[...d];for(let t=0;t<g.length;t++){const r=g[t],n=Obt(r);p.includes(n)||(e.splice(t,0,r),x.push(r))}return"wait"===s&&x.length&&(e=x),b(Pbt(e)),void y(d)}"production"!==process.env.NODE_ENV&&"wait"===s&&g.length>1&&console.warn('You\'re attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.');const{forceRender:w}=e.useContext(bbt);return t.jsx(t.Fragment,{children:g.map(e=>{const r=Obt(e),v=!(l&&!c)&&(d===g||p.includes(r));return t.jsx(Mbt,{isPresent:v,initial:!(h.current&&!o)&&void 0,custom:v?void 0:n,presenceAffectsLayout:i,mode:s,onExitComplete:v?void 0:()=>{if(!m.has(r))return;m.set(r,!0);let e=!0;m.forEach(t=>{t||(e=!1)}),e&&(null==w||w(),b(f.current),l&&(null==u||u()),a&&a())},children:e},r)})})},Nbt=e=>e;let Rbt=Nbt,Fbt=Nbt;function zbt(e){let t;return()=>(void 0===t&&(t=e()),t)}"production"!==process.env.NODE_ENV&&(Rbt=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},Fbt=(e,t)=>{if(!e)throw new Error(t)});const Ibt=(e,t,r)=>{const n=t-e;return 0===n?1:(r-e)/n},Abt=e=>1e3*e,Lbt=e=>e/1e3,Bbt=!1;const Vbt=["read","resolveKeyframes","update","preRender","render","postRender"];function Hbt(e,t){let r=!1,n=!0;const o={delta:0,timestamp:0,isProcessing:!1},a=()=>r=!0,i=Vbt.reduce((e,t)=>(e[t]=function(e){let t=new Set,r=new Set,n=!1,o=!1;const a=new WeakSet;let i={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(l.schedule(t),e()),t(i)}const l={schedule:(e,o=!1,i=!1)=>{const s=i&&n?t:r;return o&&a.add(e),s.has(e)||s.add(e),e},cancel:e=>{r.delete(e),a.delete(e)},process:e=>{i=e,n?o=!0:(n=!0,[t,r]=[r,t],t.forEach(s),t.clear(),n=!1,o&&(o=!1,l.process(e)))}};return l}(a),e),{}),{read:s,resolveKeyframes:l,update:c,preRender:u,render:d,postRender:p}=i,h=()=>{const a=performance.now();r=!1,o.delta=n?1e3/60:Math.max(Math.min(a-o.timestamp,40),1),o.timestamp=a,o.isProcessing=!0,s.process(o),l.process(o),c.process(o),u.process(o),d.process(o),p.process(o),o.isProcessing=!1,r&&t&&(n=!1,e(h))};return{schedule:Vbt.reduce((t,a)=>{const s=i[a];return t[a]=(t,a=!1,i=!1)=>(r||(r=!0,n=!0,o.isProcessing||e(h)),s.schedule(t,a,i)),t},{}),cancel:e=>{for(let t=0;t<Vbt.length;t++)i[Vbt[t]].cancel(e)},state:o,steps:i}}const{schedule:qbt,cancel:$bt,state:Wbt,steps:Ubt}=Hbt(typeof requestAnimationFrame<"u"?requestAnimationFrame:Nbt,!0),Gbt=e.createContext({strict:!1}),Kbt={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Ybt={};for(const e in Kbt)Ybt[e]={isEnabled:t=>Kbt[e].some(e=>!!t[e])};const Xbt=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Zbt(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Xbt.has(e)}let Qbt=e=>!Zbt(e);try{!function(e){e&&(Qbt=t=>t.startsWith("on")?!Zbt(t):e(t))}(require("@emotion/is-prop-valid").default)}catch{}const Jbt=new Set;function ext(e,t,r){e||Jbt.has(t)||(console.warn(t),Jbt.add(t))}function txt(e){if(typeof Proxy>"u")return e;const t=new Map;return new Proxy((...t)=>("production"!==process.env.NODE_ENV&&ext(!1,"motion() is deprecated. Use motion.create() instead."),e(...t)),{get:(r,n)=>"create"===n?e:(t.has(n)||t.set(n,e(n)),t.get(n))})}const rxt=e.createContext({});function nxt(e){return"string"==typeof e||Array.isArray(e)}function oxt(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}const axt=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ixt=["initial",...axt];function sxt(e){return oxt(e.animate)||ixt.some(t=>nxt(e[t]))}function lxt(e){return!(!sxt(e)&&!e.variants)}function cxt(t){const{initial:r,animate:n}=function(e,t){if(sxt(e)){const{initial:t,animate:r}=e;return{initial:!1===t||nxt(t)?t:void 0,animate:nxt(r)?r:void 0}}return!1!==e.inherit?t:{}}(t,e.useContext(rxt));return e.useMemo(()=>({initial:r,animate:n}),[uxt(r),uxt(n)])}function uxt(e){return Array.isArray(e)?e.join(" "):e}const dxt=Symbol.for("motionComponentSymbol");function pxt(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function hxt(t,r,n){return e.useCallback(e=>{e&&t.onMount&&t.onMount(e),r&&(e?r.mount(e):r.unmount()),n&&("function"==typeof n?n(e):pxt(n)&&(n.current=e))},[r])}const fxt=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),mxt="data-"+fxt("framerAppearId"),{schedule:vxt}=Hbt(queueMicrotask,!1),yxt=e.createContext({});function gxt(t,r,n,o,a){var i,s;const{visualElement:l}=e.useContext(rxt),c=e.useContext(Gbt),u=e.useContext(wbt),d=e.useContext(kbt).reducedMotion,p=e.useRef(null);o=o||c.renderer,!p.current&&o&&(p.current=o(t,{visualState:r,parent:l,props:n,presenceContext:u,blockInitialAnimation:!!u&&!1===u.initial,reducedMotionConfig:d}));const h=p.current,f=e.useContext(yxt);h&&!h.projection&&a&&("html"===h.type||"svg"===h.type)&&function(e,t,r,n){const{layoutId:o,layout:a,drag:i,dragConstraints:s,layoutScroll:l,layoutRoot:c}=t;e.projection=new r(e.latestValues,t["data-framer-portal-id"]?void 0:bxt(e.parent)),e.projection.setOptions({layoutId:o,layout:a,alwaysMeasureLayout:!!i||s&&pxt(s),visualElement:e,animationType:"string"==typeof a?a:"both",initialPromotionConfig:n,layoutScroll:l,layoutRoot:c})}(p.current,n,a,f);const m=e.useRef(!1);e.useInsertionEffect(()=>{h&&m.current&&h.update(n,u)});const v=n[mxt],y=e.useRef(!!v&&!(null!==(i=window.MotionHandoffIsComplete)&&void 0!==i&&i.call(window,v))&&(null===(s=window.MotionHasOptimisedAnimation)||void 0===s?void 0:s.call(window,v)));return jbt(()=>{h&&(m.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),vxt.render(h.render),y.current&&h.animationState&&h.animationState.animateChanges())}),e.useEffect(()=>{h&&(!y.current&&h.animationState&&h.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var e;null===(e=window.MotionHandoffMarkAsComplete)||void 0===e||e.call(window,v)}),y.current=!1))}),h}function bxt(e){if(e)return!1!==e.options.allowProjection?e.projection:bxt(e.parent)}function xxt({preloadedFeatures:r,createVisualElement:n,useRender:o,useVisualState:a,Component:i}){var s,l;function c(s,l){let c;const u={...e.useContext(kbt),...s,layoutId:wxt(s)},{isStatic:d}=u,p=cxt(s),h=a(s,d);if(!d&&Ebt){!function(t,r){const n=e.useContext(Gbt).strict;if("production"!==process.env.NODE_ENV&&r&&n){const e="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";t.ignoreStrict?Rbt(!1,e):Fbt(!1,e)}}(u,r);const t=function(e){const{drag:t,layout:r}=Ybt;if(!t&&!r)return{};const n={...t,...r};return{MeasureLayout:null!=t&&t.isEnabled(e)||null!=r&&r.isEnabled(e)?n.MeasureLayout:void 0,ProjectionNode:n.ProjectionNode}}(u);c=t.MeasureLayout,p.visualElement=gxt(i,h,u,n,t.ProjectionNode)}return t.jsxs(rxt.Provider,{value:p,children:[c&&p.visualElement?t.jsx(c,{visualElement:p.visualElement,...u}):null,o(i,s,hxt(h,p.visualElement,l),h,d,p.visualElement)]})}r&&function(e){for(const t in e)Ybt[t]={...Ybt[t],...e[t]}}(r),c.displayName=`motion.${"string"==typeof i?i:`create(${null!==(l=null!==(s=i.displayName)&&void 0!==s?s:i.name)&&void 0!==l?l:""})`}`;const u=e.forwardRef(c);return u[dxt]=i,u}function wxt({layoutId:t}){const r=e.useContext(bbt).id;return r&&void 0!==t?r+"-"+t:t}const kxt=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function _xt(e){return"string"==typeof e&&!e.includes("-")&&!!(kxt.indexOf(e)>-1||/[A-Z]/u.test(e))}function Cxt(e){const t=[{},{}];return null==e||e.values.forEach((e,r)=>{t[0][r]=e.get(),t[1][r]=e.getVelocity()}),t}function Mxt(e,t,r,n){if("function"==typeof t){const[o,a]=Cxt(n);t=t(void 0!==r?r:e.custom,o,a)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){const[o,a]=Cxt(n);t=t(void 0!==r?r:e.custom,o,a)}return t}const Sxt=e=>Array.isArray(e),Dxt=e=>Sxt(e)?e[e.length-1]||0:e,Oxt=e=>!(!e||!e.getVelocity);function Pxt(e){const t=Oxt(e)?e.get():e;return(e=>!!(e&&"object"==typeof e&&e.mix&&e.toValue))(t)?t.toValue():t}const Ext=t=>(r,n)=>{const o=e.useContext(rxt),a=e.useContext(wbt),i=()=>function({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:r},n,o,a){const i={latestValues:jxt(n,o,a,e),renderState:t()};return r&&(i.onMount=e=>r({props:n,current:e,...i}),i.onUpdate=e=>r(e)),i}(t,r,o,a);return n?i():xbt(i)};function jxt(e,t,r,n){const o={},a=n(e,{});for(const e in a)o[e]=Pxt(a[e]);let{initial:i,animate:s}=e;const l=sxt(e),c=lxt(e);t&&c&&!l&&!1!==e.inherit&&(void 0===i&&(i=t.initial),void 0===s&&(s=t.animate));let u=!!r&&!1===r.initial;u=u||!1===i;const d=u?s:i;if(d&&"boolean"!=typeof d&&!oxt(d)){const t=Array.isArray(d)?d:[d];for(let r=0;r<t.length;r++){const n=Mxt(e,t[r]);if(n){const{transitionEnd:e,transition:t,...r}=n;for(const e in r){let t=r[e];if(Array.isArray(t)){t=t[u?t.length-1:0]}null!==t&&(o[e]=t)}for(const t in e)o[t]=e[t]}}}return o}const Txt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Nxt=new Set(Txt),Rxt=e=>t=>"string"==typeof t&&t.startsWith(e),Fxt=Rxt("--"),zxt=Rxt("var(--"),Ixt=e=>!!zxt(e)&&Axt.test(e.split("/*")[0].trim()),Axt=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Lxt=(e,t)=>t&&"number"==typeof e?t.transform(e):e,Bxt=(e,t,r)=>r>t?t:r<e?e:r,Vxt={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},Hxt={...Vxt,transform:e=>Bxt(0,1,e)},qxt={...Vxt,default:1},$xt=e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),Wxt=$xt("deg"),Uxt=$xt("%"),Gxt=$xt("px"),Kxt=$xt("vh"),Yxt=$xt("vw"),Xxt={...Uxt,parse:e=>Uxt.parse(e)/100,transform:e=>Uxt.transform(100*e)},Zxt={borderWidth:Gxt,borderTopWidth:Gxt,borderRightWidth:Gxt,borderBottomWidth:Gxt,borderLeftWidth:Gxt,borderRadius:Gxt,radius:Gxt,borderTopLeftRadius:Gxt,borderTopRightRadius:Gxt,borderBottomRightRadius:Gxt,borderBottomLeftRadius:Gxt,width:Gxt,maxWidth:Gxt,height:Gxt,maxHeight:Gxt,top:Gxt,right:Gxt,bottom:Gxt,left:Gxt,padding:Gxt,paddingTop:Gxt,paddingRight:Gxt,paddingBottom:Gxt,paddingLeft:Gxt,margin:Gxt,marginTop:Gxt,marginRight:Gxt,marginBottom:Gxt,marginLeft:Gxt,backgroundPositionX:Gxt,backgroundPositionY:Gxt},Qxt={rotate:Wxt,rotateX:Wxt,rotateY:Wxt,rotateZ:Wxt,scale:qxt,scaleX:qxt,scaleY:qxt,scaleZ:qxt,skew:Wxt,skewX:Wxt,skewY:Wxt,distance:Gxt,translateX:Gxt,translateY:Gxt,translateZ:Gxt,x:Gxt,y:Gxt,z:Gxt,perspective:Gxt,transformPerspective:Gxt,opacity:Hxt,originX:Xxt,originY:Xxt,originZ:Gxt},Jxt={...Vxt,transform:Math.round},ewt={...Zxt,...Qxt,zIndex:Jxt,size:Gxt,fillOpacity:Hxt,strokeOpacity:Hxt,numOctaves:Jxt},twt={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},rwt=Txt.length;function nwt(e,t,r){const{style:n,vars:o,transformOrigin:a}=e;let i=!1,s=!1;for(const e in t){const r=t[e];if(Nxt.has(e))i=!0;else if(Fxt(e))o[e]=r;else{const t=Lxt(r,ewt[e]);e.startsWith("origin")?(s=!0,a[e]=t):n[e]=t}}if(t.transform||(i||r?n.transform=function(e,t,r){let n="",o=!0;for(let a=0;a<rwt;a++){const i=Txt[a],s=e[i];if(void 0===s)continue;let l=!0;if(l="number"==typeof s?s===(i.startsWith("scale")?1:0):0===parseFloat(s),!l||r){const e=Lxt(s,ewt[i]);l||(o=!1,n+=`${twt[i]||i}(${e}) `),r&&(t[i]=e)}}return n=n.trim(),r?n=r(t,o?"":n):o&&(n="none"),n}(t,e.transform,r):n.transform&&(n.transform="none")),s){const{originX:e="50%",originY:t="50%",originZ:r=0}=a;n.transformOrigin=`${e} ${t} ${r}`}}const owt={offset:"stroke-dashoffset",array:"stroke-dasharray"},awt={offset:"strokeDashoffset",array:"strokeDasharray"};function iwt(e,t,r){return"string"==typeof e?e:Gxt.transform(t+r*e)}function swt(e,{attrX:t,attrY:r,attrScale:n,originX:o,originY:a,pathLength:i,pathSpacing:s=1,pathOffset:l=0,...c},u,d){if(nwt(e,c,d),u)return void(e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox));e.attrs=e.style,e.style={};const{attrs:p,style:h,dimensions:f}=e;p.transform&&(f&&(h.transform=p.transform),delete p.transform),f&&(void 0!==o||void 0!==a||h.transform)&&(h.transformOrigin=function(e,t,r){return`${iwt(t,e.x,e.width)} ${iwt(r,e.y,e.height)}`}(f,void 0!==o?o:.5,void 0!==a?a:.5)),void 0!==t&&(p.x=t),void 0!==r&&(p.y=r),void 0!==n&&(p.scale=n),void 0!==i&&function(e,t,r=1,n=0,o=!0){e.pathLength=1;const a=o?owt:awt;e[a.offset]=Gxt.transform(-n);const i=Gxt.transform(t),s=Gxt.transform(r);e[a.array]=`${i} ${s}`}(p,i,s,l,!1)}const lwt=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),cwt=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),uwt=e=>"string"==typeof e&&"svg"===e.toLowerCase();function dwt(e,{style:t,vars:r},n,o){Object.assign(e.style,t,o&&o.getProjectionStyles(n));for(const t in r)e.style.setProperty(t,r[t])}const pwt=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function hwt(e,t,r,n){dwt(e,t,void 0,n);for(const r in t.attrs)e.setAttribute(pwt.has(r)?r:fxt(r),t.attrs[r])}const fwt={};function mwt(e,{layout:t,layoutId:r}){return Nxt.has(e)||e.startsWith("origin")||(t||void 0!==r)&&(!!fwt[e]||"opacity"===e)}function vwt(e,t,r){var n;const{style:o}=e,a={};for(const i in o)(Oxt(o[i])||t.style&&Oxt(t.style[i])||mwt(i,e)||void 0!==(null===(n=null==r?void 0:r.getValue(i))||void 0===n?void 0:n.liveStyle))&&(a[i]=o[i]);return a}function ywt(e,t,r){const n=vwt(e,t,r);for(const r in e)if(Oxt(e[r])||Oxt(t[r])){n[-1!==Txt.indexOf(r)?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r]=e[r]}return n}const gwt=["x","y","width","height","cx","cy","r"],bwt={useVisualState:Ext({scrapeMotionValuesFromProps:ywt,createRenderState:cwt,onUpdate:({props:e,prevProps:t,current:r,renderState:n,latestValues:o})=>{if(!r)return;let a=!!e.drag;if(!a)for(const e in o)if(Nxt.has(e)){a=!0;break}if(!a)return;let i=!t;if(t)for(let r=0;r<gwt.length;r++){const n=gwt[r];e[n]!==t[n]&&(i=!0)}i&&qbt.read(()=>{(function(e,t){try{t.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}})(r,n),qbt.render(()=>{swt(n,o,uwt(r.tagName),e.transformTemplate),hwt(r,n)})})}})},xwt={useVisualState:Ext({scrapeMotionValuesFromProps:vwt,createRenderState:lwt})};function wwt(e,t,r){for(const n in t)!Oxt(t[n])&&!mwt(n,r)&&(e[n]=t[n])}function kwt(t,r){const n={};return wwt(n,t.style||{},t),Object.assign(n,function({transformTemplate:t},r){return e.useMemo(()=>{const e={style:{},transform:{},transformOrigin:{},vars:{}};return nwt(e,r,t),Object.assign({},e.vars,e.style)},[r])}(t,r)),n}function _wt(e,t){const r={},n=kwt(e,t);return e.drag&&!1!==e.dragListener&&(r.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=n,r}function Cwt(t,r,n,o){const a=e.useMemo(()=>{const e={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return swt(e,r,uwt(o),t.transformTemplate),{...e.attrs,style:{...e.style}}},[r]);if(t.style){const e={};wwt(e,t.style,t),a.style={...e,...a.style}}return a}function Mwt(t=!1){return(r,n,o,{latestValues:a},i)=>{const s=(_xt(r)?Cwt:_wt)(n,a,i,r),l=function(e,t,r){const n={};for(const o in e)"values"===o&&"object"==typeof e.values||(Qbt(o)||!0===r&&Zbt(o)||!t&&!Zbt(o)||e.draggable&&o.startsWith("onDrag"))&&(n[o]=e[o]);return n}(n,"string"==typeof r,t),c=r!==e.Fragment?{...l,...s,ref:o}:{},{children:u}=n,d=e.useMemo(()=>Oxt(u)?u.get():u,[u]);return e.createElement(r,{...c,children:d})}}function Swt(e,t){return function(r,{forwardMotionProps:n}={forwardMotionProps:!1}){return xxt({..._xt(r)?bwt:xwt,preloadedFeatures:e,useRender:Mwt(n),createVisualElement:t,Component:r})}}function Dwt(e,t){if(!Array.isArray(t))return!1;const r=t.length;if(r!==e.length)return!1;for(let n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}function Owt(e,t,r){const n=e.getProps();return Mxt(n,t,void 0!==r?r:n.custom,e)}const Pwt=zbt(()=>void 0!==window.ScrollTimeline);class Ewt{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>"finished"in e?e.finished:e))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let r=0;r<this.animations.length;r++)this.animations[r][e]=t}attachTimeline(e,t){const r=this.animations.map(r=>Pwt()&&r.attachTimeline?r.attachTimeline(e):"function"==typeof t?t(r):void 0);return()=>{r.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let t=0;t<this.animations.length;t++)e=Math.max(e,this.animations[t].duration);return e}runAll(e){this.animations.forEach(t=>t[e]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class jwt extends Ewt{then(e,t){return Promise.all(this.animations).then(e).catch(t)}}function Twt(e,t){return e?e[t]||e.default||e:void 0}const Nwt=2e4;function Rwt(e){let t=0;let r=e.next(t);for(;!r.done&&t<Nwt;)t+=50,r=e.next(t);return t>=Nwt?1/0:t}function Fwt(e){return"function"==typeof e}function zwt(e,t){e.timeline=t,e.onfinish=null}const Iwt=e=>Array.isArray(e)&&"number"==typeof e[0],Awt={linearEasing:void 0};function Lwt(e,t){const r=zbt(e);return()=>{var e;return null!==(e=Awt[t])&&void 0!==e?e:r()}}const Bwt=Lwt(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Vwt=(e,t,r=10)=>{let n="";const o=Math.max(Math.round(t/r),2);for(let t=0;t<o;t++)n+=e(Ibt(0,o-1,t))+", ";return`linear(${n.substring(0,n.length-2)})`};function Hwt(e){return!!("function"==typeof e&&Bwt()||!e||"string"==typeof e&&(e in $wt||Bwt())||Iwt(e)||Array.isArray(e)&&e.every(Hwt))}const qwt=([e,t,r,n])=>`cubic-bezier(${e}, ${t}, ${r}, ${n})`,$wt={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:qwt([0,.65,.55,1]),circOut:qwt([.55,0,1,.45]),backIn:qwt([.31,.01,.66,-.59]),backOut:qwt([.33,1.53,.69,.99])};function Wwt(e,t){if(e)return"function"==typeof e&&Bwt()?Vwt(e,t):Iwt(e)?qwt(e):Array.isArray(e)?e.map(e=>Wwt(e,t)||$wt.easeOut):$wt[e]}const Uwt={x:!1,y:!1};function Gwt(){return Uwt.x||Uwt.y}function Kwt(e,t){const r=function(e){if(e instanceof Element)return[e];if("string"==typeof e){const t=document.querySelectorAll(e);return t?Array.from(t):[]}return Array.from(e)}(e),n=new AbortController;return[r,{passive:!0,...t,signal:n.signal},()=>n.abort()]}function Ywt(e){return t=>{"touch"===t.pointerType||Gwt()||e(t)}}const Xwt=(e,t)=>!!t&&(e===t||Xwt(e,t.parentElement)),Zwt=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary,Qwt=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const Jwt=new WeakSet;function ekt(e){return t=>{"Enter"===t.key&&e(t)}}function tkt(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}function rkt(e){return Zwt(e)&&!Gwt()}function nkt(e,t,r={}){const[n,o,a]=Kwt(e,r),i=e=>{const n=e.currentTarget;if(!rkt(e)||Jwt.has(n))return;Jwt.add(n);const a=t(e),i=(e,t)=>{window.removeEventListener("pointerup",s),window.removeEventListener("pointercancel",l),rkt(e)&&Jwt.has(n)&&(Jwt.delete(n),"function"==typeof a&&a(e,{success:t}))},s=e=>{i(e,r.useGlobalTarget||Xwt(n,e.target))},l=e=>{i(e,!1)};window.addEventListener("pointerup",s,o),window.addEventListener("pointercancel",l,o)};return n.forEach(e=>{!function(e){return Qwt.has(e.tagName)||-1!==e.tabIndex}(e)&&null===e.getAttribute("tabindex")&&(e.tabIndex=0),(r.useGlobalTarget?window:e).addEventListener("pointerdown",i,o),e.addEventListener("focus",e=>((e,t)=>{const r=e.currentTarget;if(!r)return;const n=ekt(()=>{if(Jwt.has(r))return;tkt(r,"down");const e=ekt(()=>{tkt(r,"up")});r.addEventListener("keyup",e,t),r.addEventListener("blur",()=>tkt(r,"cancel"),t)});r.addEventListener("keydown",n,t),r.addEventListener("blur",()=>r.removeEventListener("keydown",n),t)})(e,o),o)}),a}const okt=new Set(["width","height","top","left","right","bottom",...Txt]);let akt;function ikt(){akt=void 0}const skt={now:()=>(void 0===akt&&skt.set(Wbt.isProcessing||Bbt?Wbt.timestamp:performance.now()),akt),set:e=>{akt=e,queueMicrotask(ikt)}};function lkt(e,t){-1===e.indexOf(t)&&e.push(t)}function ckt(e,t){const r=e.indexOf(t);r>-1&&e.splice(r,1)}class ukt{constructor(){this.subscriptions=[]}add(e){return lkt(this.subscriptions,e),()=>ckt(this.subscriptions,e)}notify(e,t,r){const n=this.subscriptions.length;if(n)if(1===n)this.subscriptions[0](e,t,r);else for(let o=0;o<n;o++){const n=this.subscriptions[o];n&&n(e,t,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function dkt(e,t){return t?e*(1e3/t):0}class pkt{constructor(e,t={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(e,t=!0)=>{const r=skt.now();this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),t&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=skt.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=(e=>!isNaN(parseFloat(e)))(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return"production"!==process.env.NODE_ENV&&ext(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new ukt);const r=this.events[e].add(t);return"change"===e?()=>{r(),qbt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)}setWithVelocity(e,t,r){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=skt.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return dkt(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function hkt(e,t){return new pkt(e,t)}function fkt(e,t,r){e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,hkt(r))}function mkt(e,t){const r=e.getValue("willChange");if(function(e){return!(!Oxt(e)||!e.add)}(r))return r.add(t)}function vkt(e){return e.props[mxt]}const ykt=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e;function gkt(e,t,r,n){if(e===t&&r===n)return Nbt;const o=t=>function(e,t,r,n,o){let a,i,s=0;do{i=t+(r-t)/2,a=ykt(i,n,o)-e,a>0?r=i:t=i}while(Math.abs(a)>1e-7&&++s<12);return i}(t,0,1,e,r);return e=>0===e||1===e?e:ykt(o(e),t,n)}const bkt=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,xkt=e=>t=>1-e(1-t),wkt=gkt(.33,1.53,.69,.99),kkt=xkt(wkt),_kt=bkt(kkt),Ckt=e=>(e*=2)<1?.5*kkt(e):.5*(2-Math.pow(2,-10*(e-1))),Mkt=e=>1-Math.sin(Math.acos(e)),Skt=xkt(Mkt),Dkt=bkt(Mkt),Okt=e=>/^0[^.\s]+$/u.test(e);function Pkt(e){return"number"==typeof e?0===e:null===e||("none"===e||"0"===e||Okt(e))}const Ekt=e=>Math.round(1e5*e)/1e5,jkt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const Tkt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Nkt=(e,t)=>r=>!!("string"==typeof r&&Tkt.test(r)&&r.startsWith(e)||t&&!function(e){return null==e}(r)&&Object.prototype.hasOwnProperty.call(r,t)),Rkt=(e,t,r)=>n=>{if("string"!=typeof n)return n;const[o,a,i,s]=n.match(jkt);return{[e]:parseFloat(o),[t]:parseFloat(a),[r]:parseFloat(i),alpha:void 0!==s?parseFloat(s):1}},Fkt={...Vxt,transform:e=>Math.round((e=>Bxt(0,255,e))(e))},zkt={test:Nkt("rgb","red"),parse:Rkt("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:n=1})=>"rgba("+Fkt.transform(e)+", "+Fkt.transform(t)+", "+Fkt.transform(r)+", "+Ekt(Hxt.transform(n))+")"};const Ikt={test:Nkt("#"),parse:function(e){let t="",r="",n="",o="";return e.length>5?(t=e.substring(1,3),r=e.substring(3,5),n=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),r=e.substring(2,3),n=e.substring(3,4),o=e.substring(4,5),t+=t,r+=r,n+=n,o+=o),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:o?parseInt(o,16)/255:1}},transform:zkt.transform},Akt={test:Nkt("hsl","hue"),parse:Rkt("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:n=1})=>"hsla("+Math.round(e)+", "+Uxt.transform(Ekt(t))+", "+Uxt.transform(Ekt(r))+", "+Ekt(Hxt.transform(n))+")"},Lkt={test:e=>zkt.test(e)||Ikt.test(e)||Akt.test(e),parse:e=>zkt.test(e)?zkt.parse(e):Akt.test(e)?Akt.parse(e):Ikt.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?zkt.transform(e):Akt.transform(e)},Bkt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const Vkt="number",Hkt="color",qkt=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function $kt(e){const t=e.toString(),r=[],n={color:[],number:[],var:[]},o=[];let a=0;const i=t.replace(qkt,e=>(Lkt.test(e)?(n.color.push(a),o.push(Hkt),r.push(Lkt.parse(e))):e.startsWith("var(")?(n.var.push(a),o.push("var"),r.push(e)):(n.number.push(a),o.push(Vkt),r.push(parseFloat(e))),++a,"${}")).split("${}");return{values:r,split:i,indexes:n,types:o}}function Wkt(e){return $kt(e).values}function Ukt(e){const{split:t,types:r}=$kt(e),n=t.length;return e=>{let o="";for(let a=0;a<n;a++)if(o+=t[a],void 0!==e[a]){const t=r[a];o+=t===Vkt?Ekt(e[a]):t===Hkt?Lkt.transform(e[a]):e[a]}return o}}const Gkt=e=>"number"==typeof e?0:e;const Kkt={test:function(e){var t,r;return isNaN(e)&&"string"==typeof e&&((null===(t=e.match(jkt))||void 0===t?void 0:t.length)||0)+((null===(r=e.match(Bkt))||void 0===r?void 0:r.length)||0)>0},parse:Wkt,createTransformer:Ukt,getAnimatableNone:function(e){const t=Wkt(e);return Ukt(e)(t.map(Gkt))}},Ykt=new Set(["brightness","contrast","saturate","opacity"]);function Xkt(e){const[t,r]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[n]=r.match(jkt)||[];if(!n)return e;const o=r.replace(n,"");let a=Ykt.has(t)?1:0;return n!==r&&(a*=100),t+"("+a+o+")"}const Zkt=/\b([a-z-]*)\(.*?\)/gu,Qkt={...Kkt,getAnimatableNone:e=>{const t=e.match(Zkt);return t?t.map(Xkt).join(" "):e}},Jkt={...ewt,color:Lkt,backgroundColor:Lkt,outlineColor:Lkt,fill:Lkt,stroke:Lkt,borderColor:Lkt,borderTopColor:Lkt,borderRightColor:Lkt,borderBottomColor:Lkt,borderLeftColor:Lkt,filter:Qkt,WebkitFilter:Qkt},e_t=e=>Jkt[e];function t_t(e,t){let r=e_t(e);return r!==Qkt&&(r=Kkt),r.getAnimatableNone?r.getAnimatableNone(t):void 0}const r_t=new Set(["auto","none","0"]);const n_t=e=>e===Vxt||e===Gxt,o_t=(e,t)=>parseFloat(e.split(", ")[t]),a_t=(e,t)=>(r,{transform:n})=>{if("none"===n||!n)return 0;const o=n.match(/^matrix3d\((.+)\)$/u);if(o)return o_t(o[1],t);{const t=n.match(/^matrix\((.+)\)$/u);return t?o_t(t[1],e):0}},i_t=new Set(["x","y","z"]),s_t=Txt.filter(e=>!i_t.has(e));const l_t={width:({x:e},{paddingLeft:t="0",paddingRight:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),height:({y:e},{paddingTop:t="0",paddingBottom:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:a_t(4,13),y:a_t(5,14)};l_t.translateX=l_t.x,l_t.translateY=l_t.y;const c_t=new Set;let u_t=!1,d_t=!1;function p_t(){if(d_t){const e=Array.from(c_t).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),r=new Map;t.forEach(e=>{const t=function(e){const t=[];return s_t.forEach(r=>{const n=e.getValue(r);void 0!==n&&(t.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),t}(e);t.length&&(r.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();const t=r.get(e);t&&t.forEach(([t,r])=>{var n;null===(n=e.getValue(t))||void 0===n||n.set(r)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)})}d_t=!1,u_t=!1,c_t.forEach(e=>e.complete()),c_t.clear()}function h_t(){c_t.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(d_t=!0)})}class f_t{constructor(e,t,r,n,o,a=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=r,this.motionValue=n,this.element=o,this.isAsync=a}scheduleResolve(){this.isScheduled=!0,this.isAsync?(c_t.add(this),u_t||(u_t=!0,qbt.read(h_t),qbt.resolveKeyframes(p_t))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:r,motionValue:n}=this;for(let o=0;o<e.length;o++)if(null===e[o])if(0===o){const o=null==n?void 0:n.get(),a=e[e.length-1];if(void 0!==o)e[0]=o;else if(r&&t){const n=r.readValue(t,a);null!=n&&(e[0]=n)}void 0===e[0]&&(e[0]=a),n&&void 0===o&&n.set(e[0])}else e[o]=e[o-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),c_t.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,c_t.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const m_t=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),v_t=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function y_t(e,t,r=1){Fbt(r<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[n,o]=function(e){const t=v_t.exec(e);if(!t)return[,];const[,r,n,o]=t;return[`--${r??n}`,o]}(e);if(!n)return;const a=window.getComputedStyle(t).getPropertyValue(n);if(a){const e=a.trim();return m_t(e)?parseFloat(e):e}return Ixt(o)?y_t(o,t,r+1):o}const g_t=e=>t=>t.test(e),b_t=[Vxt,Gxt,Uxt,Wxt,Yxt,Kxt,{test:e=>"auto"===e,parse:e=>e}],x_t=e=>b_t.find(g_t(e));class w_t extends f_t{constructor(e,t,r,n,o){super(e,t,r,n,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:r}=this;if(!t||!t.current)return;super.readKeyframes();for(let r=0;r<e.length;r++){let n=e[r];if("string"==typeof n&&(n=n.trim(),Ixt(n))){const o=y_t(n,t.current);void 0!==o&&(e[r]=o),r===e.length-1&&(this.finalKeyframe=n)}}if(this.resolveNoneKeyframes(),!okt.has(r)||2!==e.length)return;const[n,o]=e,a=x_t(n),i=x_t(o);if(a!==i)if(n_t(a)&&n_t(i))for(let t=0;t<e.length;t++){const r=e[t];"string"==typeof r&&(e[t]=parseFloat(r))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:t}=this,r=[];for(let t=0;t<e.length;t++)Pkt(e[t])&&r.push(t);r.length&&function(e,t,r){let n,o=0;for(;o<e.length&&!n;){const t=e[o];"string"==typeof t&&!r_t.has(t)&&$kt(t).values.length&&(n=e[o]),o++}if(n&&r)for(const o of t)e[o]=t_t(r,n)}(e,r,t)}measureInitialState(){const{element:e,unresolvedKeyframes:t,name:r}=this;if(!e||!e.current)return;"height"===r&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=l_t[r](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;const n=t[t.length-1];void 0!==n&&e.getValue(r,n).jump(n,!1)}measureEndState(){var e;const{element:t,name:r,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const o=t.getValue(r);o&&o.jump(this.measuredOrigin,!1);const a=n.length-1,i=n[a];n[a]=l_t[r](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==i&&void 0===this.finalKeyframe&&(this.finalKeyframe=i),!(null===(e=this.removedTransforms)||void 0===e)&&e.length&&this.removedTransforms.forEach(([e,r])=>{t.getValue(e).set(r)}),this.resolveNoneKeyframes()}}const k_t=(e,t)=>"zIndex"!==t&&!("number"!=typeof e&&!Array.isArray(e)&&("string"!=typeof e||!Kkt.test(e)&&"0"!==e||e.startsWith("url(")));const __t=e=>null!==e;function C_t(e,{repeat:t,repeatType:r="loop"},n){const o=e.filter(__t),a=t&&"loop"!==r&&t%2==1?0:o.length-1;return a&&void 0!==n?n:o[a]}class M_t{constructor({autoplay:e=!0,delay:t=0,type:r="keyframes",repeat:n=0,repeatDelay:o=0,repeatType:a="loop",...i}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=skt.now(),this.options={autoplay:e,delay:t,type:r,repeat:n,repeatDelay:o,repeatType:a,...i},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&(h_t(),p_t()),this._resolved}onKeyframesResolved(e,t){this.resolvedAt=skt.now(),this.hasAttemptedResolve=!0;const{name:r,type:n,velocity:o,delay:a,onComplete:i,onUpdate:s,isGenerator:l}=this.options;if(!l&&!function(e,t,r,n){const o=e[0];if(null===o)return!1;if("display"===t||"visibility"===t)return!0;const a=e[e.length-1],i=k_t(o,t),s=k_t(a,t);return Rbt(i===s,`You are trying to animate ${t} from "${o}" to "${a}". ${o} is not an animatable value - to enable this animation set ${o} to a value animatable to ${a} via the \`style\` property.`),!(!i||!s)&&(function(e){const t=e[0];if(1===e.length)return!0;for(let r=0;r<e.length;r++)if(e[r]!==t)return!0}(e)||("spring"===r||Fwt(r))&&n)}(e,r,n,o)){if(!a)return s&&s(C_t(e,this.options,t)),i&&i(),void this.resolveFinishedPromise();this.options.duration=0}const c=this.initPlayback(e,t);!1!==c&&(this._resolved={keyframes:e,finalKeyframe:t,...c},this.onPostResolved())}onPostResolved(){}then(e,t){return this.currentFinishedPromise.then(e,t)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}const S_t=(e,t,r)=>e+(t-e)*r;function D_t(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function O_t(e,t){return r=>r>0?t:e}const P_t=(e,t,r)=>{const n=e*e,o=r*(t*t-n)+n;return o<0?0:Math.sqrt(o)},E_t=[Ikt,zkt,Akt];function j_t(e){const t=(e=>E_t.find(t=>t.test(e)))(e);if(Rbt(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let r=t.parse(e);return t===Akt&&(r=function({hue:e,saturation:t,lightness:r,alpha:n}){e/=360,r/=100;let o=0,a=0,i=0;if(t/=100){const n=r<.5?r*(1+t):r+t-r*t,s=2*r-n;o=D_t(s,n,e+1/3),a=D_t(s,n,e),i=D_t(s,n,e-1/3)}else o=a=i=r;return{red:Math.round(255*o),green:Math.round(255*a),blue:Math.round(255*i),alpha:n}}(r)),r}const T_t=(e,t)=>{const r=j_t(e),n=j_t(t);if(!r||!n)return O_t(e,t);const o={...r};return e=>(o.red=P_t(r.red,n.red,e),o.green=P_t(r.green,n.green,e),o.blue=P_t(r.blue,n.blue,e),o.alpha=S_t(r.alpha,n.alpha,e),zkt.transform(o))},N_t=(e,t)=>r=>t(e(r)),R_t=(...e)=>e.reduce(N_t),F_t=new Set(["none","hidden"]);function z_t(e,t){return r=>S_t(e,t,r)}function I_t(e){return"number"==typeof e?z_t:"string"==typeof e?Ixt(e)?O_t:Lkt.test(e)?T_t:B_t:Array.isArray(e)?A_t:"object"==typeof e?Lkt.test(e)?T_t:L_t:O_t}function A_t(e,t){const r=[...e],n=r.length,o=e.map((e,r)=>I_t(e)(e,t[r]));return e=>{for(let t=0;t<n;t++)r[t]=o[t](e);return r}}function L_t(e,t){const r={...e,...t},n={};for(const o in r)void 0!==e[o]&&void 0!==t[o]&&(n[o]=I_t(e[o])(e[o],t[o]));return e=>{for(const t in n)r[t]=n[t](e);return r}}const B_t=(e,t)=>{const r=Kkt.createTransformer(t),n=$kt(e),o=$kt(t);return n.indexes.var.length===o.indexes.var.length&&n.indexes.color.length===o.indexes.color.length&&n.indexes.number.length>=o.indexes.number.length?F_t.has(e)&&!o.values.length||F_t.has(t)&&!n.values.length?function(e,t){return F_t.has(e)?r=>r<=0?e:t:r=>r>=1?t:e}(e,t):R_t(A_t(function(e,t){var r;const n=[],o={color:0,var:0,number:0};for(let a=0;a<t.values.length;a++){const i=t.types[a],s=e.indexes[i][o[i]],l=null!==(r=e.values[s])&&void 0!==r?r:0;n[a]=l,o[i]++}return n}(n,o),o.values),r):(Rbt(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),O_t(e,t))};function V_t(e,t,r){return"number"==typeof e&&"number"==typeof t&&"number"==typeof r?S_t(e,t,r):I_t(e)(e,t)}function H_t(e,t,r){const n=Math.max(t-5,0);return dkt(r-e(n),t-n)}const q_t=100,$_t=10,W_t=1,U_t=0,G_t=800,K_t=.3,Y_t=.3,X_t={granular:.01,default:2},Z_t={granular:.005,default:.5},Q_t=.01,J_t=10,eCt=.05,tCt=1,rCt=.001;function nCt({duration:e=G_t,bounce:t=K_t,velocity:r=U_t,mass:n=W_t}){let o,a;Rbt(e<=Abt(J_t),"Spring duration must be 10 seconds or less");let i=1-t;i=Bxt(eCt,tCt,i),e=Bxt(Q_t,J_t,Lbt(e)),i<1?(o=t=>{const n=t*i,o=n*e,a=n-r,s=aCt(t,i),l=Math.exp(-o);return rCt-a/s*l},a=t=>{const n=t*i*e,a=n*r+r,s=Math.pow(i,2)*Math.pow(t,2)*e,l=Math.exp(-n),c=aCt(Math.pow(t,2),i);return(-o(t)+rCt>0?-1:1)*((a-s)*l)/c}):(o=t=>Math.exp(-t*e)*((t-r)*e+1)-rCt,a=t=>Math.exp(-t*e)*(e*e*(r-t)));const s=function(e,t,r){let n=r;for(let r=1;r<oCt;r++)n-=e(n)/t(n);return n}(o,a,5/e);if(e=Abt(e),isNaN(s))return{stiffness:q_t,damping:$_t,duration:e};{const t=Math.pow(s,2)*n;return{stiffness:t,damping:2*i*Math.sqrt(n*t),duration:e}}}const oCt=12;function aCt(e,t){return e*Math.sqrt(1-t*t)}const iCt=["duration","bounce"],sCt=["stiffness","damping","mass"];function lCt(e,t){return t.some(t=>void 0!==e[t])}function cCt(e=Y_t,t=K_t){const r="object"!=typeof e?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:n,restDelta:o}=r;const a=r.keyframes[0],i=r.keyframes[r.keyframes.length-1],s={done:!1,value:a},{stiffness:l,damping:c,mass:u,duration:d,velocity:p,isResolvedFromDuration:h}=function(e){let t={velocity:U_t,stiffness:q_t,damping:$_t,mass:W_t,isResolvedFromDuration:!1,...e};if(!lCt(e,sCt)&&lCt(e,iCt))if(e.visualDuration){const r=e.visualDuration,n=2*Math.PI/(1.2*r),o=n*n,a=2*Bxt(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:W_t,stiffness:o,damping:a}}else{const r=nCt(e);t={...t,...r,mass:W_t},t.isResolvedFromDuration=!0}return t}({...r,velocity:-Lbt(r.velocity||0)}),f=p||0,m=c/(2*Math.sqrt(l*u)),v=i-a,y=Lbt(Math.sqrt(l/u)),g=Math.abs(v)<5;let b;if(n||(n=g?X_t.granular:X_t.default),o||(o=g?Z_t.granular:Z_t.default),m<1){const e=aCt(y,m);b=t=>{const r=Math.exp(-m*y*t);return i-r*((f+m*y*v)/e*Math.sin(e*t)+v*Math.cos(e*t))}}else if(1===m)b=e=>i-Math.exp(-y*e)*(v+(f+y*v)*e);else{const e=y*Math.sqrt(m*m-1);b=t=>{const r=Math.exp(-m*y*t),n=Math.min(e*t,300);return i-r*((f+m*y*v)*Math.sinh(n)+e*v*Math.cosh(n))/e}}const x={calculatedDuration:h&&d||null,next:e=>{const t=b(e);if(h)s.done=e>=d;else{let r=0;m<1&&(r=0===e?Abt(f):H_t(b,e,t));const a=Math.abs(r)<=n,l=Math.abs(i-t)<=o;s.done=a&&l}return s.value=s.done?i:t,s},toString:()=>{const e=Math.min(Rwt(x),Nwt),t=Vwt(t=>x.next(e*t).value,e,30);return e+"ms "+t}};return x}function uCt({keyframes:e,velocity:t=0,power:r=.8,timeConstant:n=325,bounceDamping:o=10,bounceStiffness:a=500,modifyTarget:i,min:s,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],p={done:!1,value:d},h=e=>void 0===s?l:void 0===l||Math.abs(s-e)<Math.abs(l-e)?s:l;let f=r*t;const m=d+f,v=void 0===i?m:i(m);v!==m&&(f=v-d);const y=e=>-f*Math.exp(-e/n),g=e=>v+y(e),b=e=>{const t=y(e),r=g(e);p.done=Math.abs(t)<=c,p.value=p.done?v:r};let x,w;const k=e=>{(e=>void 0!==s&&e<s||void 0!==l&&e>l)(p.value)&&(x=e,w=cCt({keyframes:[p.value,h(p.value)],velocity:H_t(g,e,p.value),damping:o,stiffness:a,restDelta:c,restSpeed:u}))};return k(0),{calculatedDuration:null,next:e=>{let t=!1;return!w&&void 0===x&&(t=!0,b(e),k(e)),void 0!==x&&e>=x?w.next(e-x):(!t&&b(e),p)}}}const dCt=gkt(.42,0,1,1),pCt=gkt(0,0,.58,1),hCt=gkt(.42,0,.58,1),fCt={linear:Nbt,easeIn:dCt,easeInOut:hCt,easeOut:pCt,circIn:Mkt,circInOut:Dkt,circOut:Skt,backIn:kkt,backInOut:_kt,backOut:wkt,anticipate:Ckt},mCt=e=>{if(Iwt(e)){Fbt(4===e.length,"Cubic bezier arrays must contain four numerical values.");const[t,r,n,o]=e;return gkt(t,r,n,o)}return"string"==typeof e?(Fbt(void 0!==fCt[e],`Invalid easing type '${e}'`),fCt[e]):e};function vCt(e,t,{clamp:r=!0,ease:n,mixer:o}={}){const a=e.length;if(Fbt(a===t.length,"Both input and output ranges must be the same length"),1===a)return()=>t[0];if(2===a&&t[0]===t[1])return()=>t[1];const i=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=function(e,t,r){const n=[],o=r||V_t,a=e.length-1;for(let r=0;r<a;r++){let a=o(e[r],e[r+1]);if(t){const e=Array.isArray(t)?t[r]||Nbt:t;a=R_t(e,a)}n.push(a)}return n}(t,n,o),l=s.length,c=r=>{if(i&&r<e[0])return t[0];let n=0;if(l>1)for(;n<e.length-2&&!(r<e[n+1]);n++);const o=Ibt(e[n],e[n+1],r);return s[n](o)};return r?t=>c(Bxt(e[0],e[a-1],t)):c}function yCt(e){const t=[0];return function(e,t){const r=e[e.length-1];for(let n=1;n<=t;n++){const o=Ibt(0,t,n);e.push(S_t(r,1,o))}}(t,e.length-1),t}function gCt(e,t){return e.map(()=>t||hCt).splice(0,e.length-1)}function bCt({duration:e=300,keyframes:t,times:r,ease:n="easeInOut"}){const o=(e=>Array.isArray(e)&&"number"!=typeof e[0])(n)?n.map(mCt):mCt(n),a={done:!1,value:t[0]},i=function(e,t){return e.map(e=>e*t)}(r&&r.length===t.length?r:yCt(t),e),s=vCt(i,t,{ease:Array.isArray(o)?o:gCt(t,o)});return{calculatedDuration:e,next:t=>(a.value=s(t),a.done=t>=e,a)}}const xCt=e=>{const t=({timestamp:t})=>e(t);return{start:()=>qbt.update(t,!0),stop:()=>$bt(t),now:()=>Wbt.isProcessing?Wbt.timestamp:skt.now()}},wCt={decay:uCt,inertia:uCt,tween:bCt,keyframes:bCt,spring:cCt},kCt=e=>e/100;class _Ct extends M_t{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:e}=this.options;e&&e()};const{name:t,motionValue:r,element:n,keyframes:o}=this.options,a=(null==n?void 0:n.KeyframeResolver)||f_t;this.resolver=new a(o,(e,t)=>this.onKeyframesResolved(e,t),t,r,n),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(e){const{type:t="keyframes",repeat:r=0,repeatDelay:n=0,repeatType:o,velocity:a=0}=this.options,i=Fwt(t)?t:wCt[t]||bCt;let s,l;i!==bCt&&"number"!=typeof e[0]&&("production"!==process.env.NODE_ENV&&Fbt(2===e.length,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${e}`),s=R_t(kCt,V_t(e[0],e[1])),e=[0,100]);const c=i({...this.options,keyframes:e});"mirror"===o&&(l=i({...this.options,keyframes:[...e].reverse(),velocity:-a})),null===c.calculatedDuration&&(c.calculatedDuration=Rwt(c));const{calculatedDuration:u}=c,d=u+n;return{generator:c,mirroredGenerator:l,mapPercentToKeyframes:s,calculatedDuration:u,resolvedDuration:d,totalDuration:d*(r+1)-n}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&e?this.state=this.pendingPlayState:this.pause()}tick(e,t=!1){const{resolved:r}=this;if(!r){const{keyframes:e}=this.options;return{done:!0,value:e[e.length-1]}}const{finalKeyframe:n,generator:o,mirroredGenerator:a,mapPercentToKeyframes:i,keyframes:s,calculatedDuration:l,totalDuration:c,resolvedDuration:u}=r;if(null===this.startTime)return o.next(0);const{delay:d,repeat:p,repeatType:h,repeatDelay:f,onUpdate:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-c/this.speed,this.startTime)),t?this.currentTime=e:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const v=this.currentTime-d*(this.speed>=0?1:-1),y=this.speed>=0?v<0:v>c;this.currentTime=Math.max(v,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=c);let g=this.currentTime,b=o;if(p){const e=Math.min(this.currentTime,c)/u;let t=Math.floor(e),r=e%1;!r&&e>=1&&(r=1),1===r&&t--,t=Math.min(t,p+1),!!(t%2)&&("reverse"===h?(r=1-r,f&&(r-=f/u)):"mirror"===h&&(b=a)),g=Bxt(0,1,r)*u}const x=y?{done:!1,value:s[0]}:b.next(g);i&&(x.value=i(x.value));let{done:w}=x;!y&&null!==l&&(w=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const k=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return k&&void 0!==n&&(x.value=C_t(s,this.options,n)),m&&m(x.value),k&&this.finish(),x}get duration(){const{resolved:e}=this;return e?Lbt(e.calculatedDuration):0}get time(){return Lbt(this.currentTime)}set time(e){e=Abt(e),this.currentTime=e,null!==this.holdTime||0===this.speed?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=Lbt(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:e=xCt,onPlay:t,startTime:r}=this.options;this.driver||(this.driver=e(e=>this.tick(e))),t&&t();const n=this.driver.now();null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=n):this.startTime=r??this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;this._resolved?(this.state="paused",this.holdTime=null!==(e=this.currentTime)&&void 0!==e?e:0):this.pendingPlayState="paused"}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}const CCt=new Set(["opacity","clipPath","filter","transform"]);function MCt(e,t,r,{delay:n=0,duration:o=300,repeat:a=0,repeatType:i="loop",ease:s="easeInOut",times:l}={}){const c={[t]:r};l&&(c.offset=l);const u=Wwt(s,o);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:n,duration:o,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:a+1,direction:"reverse"===i?"alternate":"normal"})}const SCt=zbt(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));const DCt={anticipate:Ckt,backInOut:_kt,circInOut:Dkt};class OCt extends M_t{constructor(e){super(e);const{name:t,motionValue:r,element:n,keyframes:o}=this.options;this.resolver=new w_t(o,(e,t)=>this.onKeyframesResolved(e,t),t,r,n),this.resolver.scheduleResolve()}initPlayback(e,t){let{duration:r=300,times:n,ease:o,type:a,motionValue:i,name:s,startTime:l}=this.options;if(!i.owner||!i.owner.current)return!1;if("string"==typeof o&&Bwt()&&function(e){return e in DCt}(o)&&(o=DCt[o]),function(e){return Fwt(e.type)||"spring"===e.type||!Hwt(e.ease)}(this.options)){const{onComplete:t,onUpdate:i,motionValue:s,element:l,...c}=this.options,u=function(e,t){const r=new _Ct({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let n={done:!1,value:e[0]};const o=[];let a=0;for(;!n.done&&a<2e4;)n=r.sample(a),o.push(n.value),a+=10;return{times:void 0,keyframes:o,duration:a-10,ease:"linear"}}(e,c);1===(e=u.keyframes).length&&(e[1]=e[0]),r=u.duration,n=u.times,o=u.ease,a="keyframes"}const c=MCt(i.owner.current,s,e,{...this.options,duration:r,times:n,ease:o});return c.startTime=l??this.calcStartTime(),this.pendingTimeline?(zwt(c,this.pendingTimeline),this.pendingTimeline=void 0):c.onfinish=()=>{const{onComplete:r}=this.options;i.set(C_t(e,this.options,t)),r&&r(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:r,times:n,type:a,ease:o,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:t}=e;return Lbt(t)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:t}=e;return Lbt(t.currentTime||0)}set time(e){const{resolved:t}=this;if(!t)return;const{animation:r}=t;r.currentTime=Abt(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:t}=e;return t.playbackRate}set speed(e){const{resolved:t}=this;if(!t)return;const{animation:r}=t;r.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:t}=e;return t.playState}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:t}=e;return t.startTime}attachTimeline(e){if(this._resolved){const{resolved:t}=this;if(!t)return Nbt;const{animation:r}=t;zwt(r,e)}else this.pendingTimeline=e;return Nbt}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:t}=e;"finished"===t.playState&&this.updateFinishedPromise(),t.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:t}=e;t.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:t,keyframes:r,duration:n,type:o,ease:a,times:i}=e;if("idle"===t.playState||"finished"===t.playState)return;if(this.time){const{motionValue:e,onUpdate:t,onComplete:s,element:l,...c}=this.options,u=new _Ct({...c,keyframes:r,duration:n,type:o,ease:a,times:i,isGenerator:!0}),d=Abt(this.time);e.setWithVelocity(u.sample(d-10).value,u.sample(d).value,10)}const{onStop:s}=this.options;s&&s(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:t,name:r,repeatDelay:n,repeatType:o,damping:a,type:i}=e;if(!(t&&t.owner&&t.owner.current instanceof HTMLElement))return!1;const{onUpdate:s,transformTemplate:l}=t.owner.getProps();return SCt()&&r&&CCt.has(r)&&!s&&!l&&!n&&"mirror"!==o&&0!==a&&"inertia"!==i}}const PCt={type:"spring",stiffness:500,damping:25,restSpeed:10},ECt={type:"keyframes",duration:.8},jCt={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},TCt=(e,{keyframes:t})=>t.length>2?ECt:Nxt.has(e)?e.startsWith("scale")?(e=>({type:"spring",stiffness:550,damping:0===e?2*Math.sqrt(550):30,restSpeed:10}))(t[1]):PCt:jCt;const NCt=(e,t,r,n={},o,a)=>i=>{const s=Twt(n,e)||{},l=s.delay||n.delay||0;let{elapsed:c=0}=n;c-=Abt(l);let u={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:t.getVelocity(),...s,delay:-c,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{i(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:o};(function({when:e,delay:t,delayChildren:r,staggerChildren:n,staggerDirection:o,repeat:a,repeatType:i,repeatDelay:s,from:l,elapsed:c,...u}){return!!Object.keys(u).length})(s)||(u={...u,...TCt(e,u)}),u.duration&&(u.duration=Abt(u.duration)),u.repeatDelay&&(u.repeatDelay=Abt(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let d=!1;if((!1===u.type||0===u.duration&&!u.repeatDelay)&&(u.duration=0,0===u.delay&&(d=!0)),d&&!a&&void 0!==t.get()){const e=C_t(u.keyframes,s);if(void 0!==e)return qbt.update(()=>{u.onUpdate(e),u.onComplete()}),new jwt([])}return!a&&OCt.supports(u)?new OCt(u):new _Ct(u)};function RCt({protectedKeys:e,needsAnimating:t},r){const n=e.hasOwnProperty(r)&&!0!==t[r];return t[r]=!1,n}function FCt(e,t,{delay:r=0,transitionOverride:n,type:o}={}){var a;let{transition:i=e.getDefaultTransition(),transitionEnd:s,...l}=t;n&&(i=n);const c=[],u=o&&e.animationState&&e.animationState.getState()[o];for(const t in l){const n=e.getValue(t,null!==(a=e.latestValues[t])&&void 0!==a?a:null),o=l[t];if(void 0===o||u&&RCt(u,t))continue;const s={delay:r,...Twt(i||{},t)};let d=!1;if(window.MotionHandoffAnimation){const r=vkt(e);if(r){const e=window.MotionHandoffAnimation(r,t,qbt);null!==e&&(s.startTime=e,d=!0)}}mkt(e,t),n.start(NCt(t,n,o,e.shouldReduceMotion&&okt.has(t)?{type:!1}:s,e,d));const p=n.animation;p&&c.push(p)}return s&&Promise.all(c).then(()=>{qbt.update(()=>{s&&function(e,t){const r=Owt(e,t);let{transitionEnd:n={},transition:o={},...a}=r||{};a={...a,...n};for(const t in a)fkt(e,t,Dxt(a[t]))}(e,s)})}),c}function zCt(e,t,r={}){var n;const o=Owt(e,t,"exit"===r.type?null===(n=e.presenceContext)||void 0===n?void 0:n.custom:void 0);let{transition:a=e.getDefaultTransition()||{}}=o||{};r.transitionOverride&&(a=r.transitionOverride);const i=o?()=>Promise.all(FCt(e,o,r)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(n=0)=>{const{delayChildren:o=0,staggerChildren:i,staggerDirection:s}=a;return function(e,t,r=0,n=0,o=1,a){const i=[],s=(e.variantChildren.size-1)*n,l=1===o?(e=0)=>e*n:(e=0)=>s-e*n;return Array.from(e.variantChildren).sort(ICt).forEach((e,n)=>{e.notify("AnimationStart",t),i.push(zCt(e,t,{...a,delay:r+l(n)}).then(()=>e.notify("AnimationComplete",t)))}),Promise.all(i)}(e,t,o+n,i,s,r)}:()=>Promise.resolve(),{when:l}=a;if(l){const[e,t]="beforeChildren"===l?[i,s]:[s,i];return e().then(()=>t())}return Promise.all([i(),s(r.delay)])}function ICt(e,t){return e.sortNodePosition(t)}const ACt=ixt.length;function LCt(e){if(!e)return;if(!e.isControllingVariants){const t=e.parent&&LCt(e.parent)||{};return void 0!==e.props.initial&&(t.initial=e.props.initial),t}const t={};for(let r=0;r<ACt;r++){const n=ixt[r],o=e.props[n];(nxt(o)||!1===o)&&(t[n]=o)}return t}const BCt=[...axt].reverse(),VCt=axt.length;function HCt(e){return t=>Promise.all(t.map(({animation:t,options:r})=>function(e,t,r={}){let n;if(e.notify("AnimationStart",t),Array.isArray(t)){const o=t.map(t=>zCt(e,t,r));n=Promise.all(o)}else if("string"==typeof t)n=zCt(e,t,r);else{const o="function"==typeof t?Owt(e,t,r.custom):t;n=Promise.all(FCt(e,o,r))}return n.then(()=>{e.notify("AnimationComplete",t)})}(e,t,r)))}function qCt(e){let t=HCt(e),r=UCt(),n=!0;const o=t=>(r,n)=>{var o;const a=Owt(e,n,"exit"===t?null===(o=e.presenceContext)||void 0===o?void 0:o.custom:void 0);if(a){const{transition:e,transitionEnd:t,...n}=a;r={...r,...n,...t}}return r};function a(a){const{props:i}=e,s=LCt(e.parent)||{},l=[],c=new Set;let u={},d=1/0;for(let t=0;t<VCt;t++){const p=BCt[t],h=r[p],f=void 0!==i[p]?i[p]:s[p],m=nxt(f),v=p===a?h.isActive:null;!1===v&&(d=t);let y=f===s[p]&&f!==i[p]&&m;if(y&&n&&e.manuallyAnimateOnMount&&(y=!1),h.protectedKeys={...u},!h.isActive&&null===v||!f&&!h.prevProp||oxt(f)||"boolean"==typeof f)continue;const g=$Ct(h.prevProp,f);let b=g||p===a&&h.isActive&&!y&&m||t>d&&m,x=!1;const w=Array.isArray(f)?f:[f];let k=w.reduce(o(p),{});!1===v&&(k={});const{prevResolvedValues:_={}}=h,C={..._,...k},M=t=>{b=!0,c.has(t)&&(x=!0,c.delete(t)),h.needsAnimating[t]=!0;const r=e.getValue(t);r&&(r.liveStyle=!1)};for(const e in C){const t=k[e],r=_[e];if(u.hasOwnProperty(e))continue;let n=!1;n=Sxt(t)&&Sxt(r)?!Dwt(t,r):t!==r,n?null!=t?M(e):c.add(e):void 0!==t&&c.has(e)?M(e):h.protectedKeys[e]=!0}h.prevProp=f,h.prevResolvedValues=k,h.isActive&&(u={...u,...k}),n&&e.blockInitialAnimation&&(b=!1),b&&(!y||!g||x)&&l.push(...w.map(e=>({animation:e,options:{type:p}})))}if(c.size){const t={};c.forEach(r=>{const n=e.getBaseTarget(r),o=e.getValue(r);o&&(o.liveStyle=!0),t[r]=n??null}),l.push({animation:t})}let p=!!l.length;return n&&(!1===i.initial||i.initial===i.animate)&&!e.manuallyAnimateOnMount&&(p=!1),n=!1,p?t(l):Promise.resolve()}return{animateChanges:a,setActive:function(t,n){var o;if(r[t].isActive===n)return Promise.resolve();null===(o=e.variantChildren)||void 0===o||o.forEach(e=>{var r;return null===(r=e.animationState)||void 0===r?void 0:r.setActive(t,n)}),r[t].isActive=n;const i=a(t);for(const e in r)r[e].protectedKeys={};return i},setAnimateFunction:function(r){t=r(e)},getState:()=>r,reset:()=>{r=UCt(),n=!0}}}function $Ct(e,t){return"string"==typeof t?t!==e:!!Array.isArray(t)&&!Dwt(t,e)}function WCt(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function UCt(){return{animate:WCt(!0),whileInView:WCt(),whileHover:WCt(),whileTap:WCt(),whileDrag:WCt(),whileFocus:WCt(),exit:WCt()}}class GCt{constructor(e){this.isMounted=!1,this.node=e}update(){}}let KCt=0;const YCt={animation:{Feature:class extends GCt{constructor(e){super(e),e.animationState||(e.animationState=qCt(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();oxt(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),null===(e=this.unmountControls)||void 0===e||e.call(this)}}},exit:{Feature:class extends GCt{constructor(){super(...arguments),this.id=KCt++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;const n=this.node.animationState.setActive("exit",!e);t&&!e&&n.then(()=>t(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}}};function XCt(e,t,r,n={passive:!0}){return e.addEventListener(t,r,n),()=>e.removeEventListener(t,r)}function ZCt(e){return{point:{x:e.pageX,y:e.pageY}}}function QCt(e,t,r,n){return XCt(e,t,(e=>t=>Zwt(t)&&e(t,ZCt(t)))(r),n)}const JCt=(e,t)=>Math.abs(e-t);class eMt{constructor(e,t,{transformPagePoint:r,contextWindow:n,dragSnapToOrigin:o=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const e=nMt(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,r=function(e,t){const r=JCt(e.x,t.x),n=JCt(e.y,t.y);return Math.sqrt(r**2+n**2)}(e.offset,{x:0,y:0})>=3;if(!t&&!r)return;const{point:n}=e,{timestamp:o}=Wbt;this.history.push({...n,timestamp:o});const{onStart:a,onMove:i}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),i&&i(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=tMt(t,this.transformPagePoint),qbt.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();const{onEnd:r,onSessionEnd:n,resumeAnimation:o}=this.handlers;if(this.dragSnapToOrigin&&o&&o(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const a=nMt("pointercancel"===e.type?this.lastMoveEventInfo:tMt(t,this.transformPagePoint),this.history);this.startEvent&&r&&r(e,a),n&&n(e,a)},!Zwt(e))return;this.dragSnapToOrigin=o,this.handlers=t,this.transformPagePoint=r,this.contextWindow=n||window;const a=tMt(ZCt(e),this.transformPagePoint),{point:i}=a,{timestamp:s}=Wbt;this.history=[{...i,timestamp:s}];const{onSessionStart:l}=t;l&&l(e,nMt(a,this.history)),this.removeListeners=R_t(QCt(this.contextWindow,"pointermove",this.handlePointerMove),QCt(this.contextWindow,"pointerup",this.handlePointerUp),QCt(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),$bt(this.updatePoint)}}function tMt(e,t){return t?{point:t(e.point)}:e}function rMt(e,t){return{x:e.x-t.x,y:e.y-t.y}}function nMt({point:e},t){return{point:e,delta:rMt(e,aMt(t)),offset:rMt(e,oMt(t)),velocity:iMt(t,.1)}}function oMt(e){return e[0]}function aMt(e){return e[e.length-1]}function iMt(e,t){if(e.length<2)return{x:0,y:0};let r=e.length-1,n=null;const o=aMt(e);for(;r>=0&&(n=e[r],!(o.timestamp-n.timestamp>Abt(t)));)r--;if(!n)return{x:0,y:0};const a=Lbt(o.timestamp-n.timestamp);if(0===a)return{x:0,y:0};const i={x:(o.x-n.x)/a,y:(o.y-n.y)/a};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function sMt(e){return e.max-e.min}function lMt(e,t,r,n=.5){e.origin=n,e.originPoint=S_t(t.min,t.max,e.origin),e.scale=sMt(r)/sMt(t),e.translate=S_t(r.min,r.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function cMt(e,t,r,n){lMt(e.x,t.x,r.x,n?n.originX:void 0),lMt(e.y,t.y,r.y,n?n.originY:void 0)}function uMt(e,t,r){e.min=r.min+t.min,e.max=e.min+sMt(t)}function dMt(e,t,r){e.min=t.min-r.min,e.max=e.min+sMt(t)}function pMt(e,t,r){dMt(e.x,t.x,r.x),dMt(e.y,t.y,r.y)}function hMt(e,t,r){return{min:void 0!==t?e.min+t:void 0,max:void 0!==r?e.max+r-(e.max-e.min):void 0}}function fMt(e,t){let r=t.min-e.min,n=t.max-e.max;return t.max-t.min<e.max-e.min&&([r,n]=[n,r]),{min:r,max:n}}const mMt=.35;function vMt(e,t,r){return{min:yMt(e,t),max:yMt(e,r)}}function yMt(e,t){return"number"==typeof e?e:e[t]||0}const gMt=()=>({x:{min:0,max:0},y:{min:0,max:0}});function bMt(e){return[e("x"),e("y")]}function xMt({top:e,left:t,right:r,bottom:n}){return{x:{min:t,max:r},y:{min:e,max:n}}}function wMt(e){return void 0===e||1===e}function kMt({scale:e,scaleX:t,scaleY:r}){return!wMt(e)||!wMt(t)||!wMt(r)}function _Mt(e){return kMt(e)||CMt(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function CMt(e){return MMt(e.x)||MMt(e.y)}function MMt(e){return e&&"0%"!==e}function SMt(e,t,r){return r+t*(e-r)}function DMt(e,t,r,n,o){return void 0!==o&&(e=SMt(e,o,n)),SMt(e,r,n)+t}function OMt(e,t=0,r=1,n,o){e.min=DMt(e.min,t,r,n,o),e.max=DMt(e.max,t,r,n,o)}function PMt(e,{x:t,y:r}){OMt(e.x,t.translate,t.scale,t.originPoint),OMt(e.y,r.translate,r.scale,r.originPoint)}const EMt=.999999999999,jMt=1.0000000000001;function TMt(e,t){e.min=e.min+t,e.max=e.max+t}function NMt(e,t,r,n,o=.5){OMt(e,t,r,S_t(e.min,e.max,o),n)}function RMt(e,t){NMt(e.x,t.x,t.scaleX,t.scale,t.originX),NMt(e.y,t.y,t.scaleY,t.scale,t.originY)}function FMt(e,t){return xMt(function(e,t){if(!t)return e;const r=t({x:e.left,y:e.top}),n=t({x:e.right,y:e.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}(e.getBoundingClientRect(),t))}const zMt=({current:e})=>e?e.ownerDocument.defaultView:null,IMt=new WeakMap;class AMt{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=e}start(e,{snapToCursor:t=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&!1===r.isPresent)return;const{dragSnapToOrigin:n}=this.getProps();this.panSession=new eMt(e,{onSessionStart:e=>{const{dragSnapToOrigin:r}=this.getProps();r?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(ZCt(e).point)},onStart:(e,t)=>{const{drag:r,dragPropagation:n,onDragStart:o}=this.getProps();if(r&&!n&&(this.openDragLock&&this.openDragLock(),this.openDragLock=function(e){return"x"===e||"y"===e?Uwt[e]?null:(Uwt[e]=!0,()=>{Uwt[e]=!1}):Uwt.x||Uwt.y?null:(Uwt.x=Uwt.y=!0,()=>{Uwt.x=Uwt.y=!1})}(r),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),bMt(e=>{let t=this.getAxisMotionValue(e).get()||0;if(Uxt.test(t)){const{projection:r}=this.visualElement;if(r&&r.layout){const n=r.layout.layoutBox[e];n&&(t=sMt(n)*(parseFloat(t)/100))}}this.originPoint[e]=t}),o&&qbt.postRender(()=>o(e,t)),mkt(this.visualElement,"transform");const{animationState:a}=this.visualElement;a&&a.setActive("whileDrag",!0)},onMove:(e,t)=>{const{dragPropagation:r,dragDirectionLock:n,onDirectionLock:o,onDrag:a}=this.getProps();if(!r&&!this.openDragLock)return;const{offset:i}=t;if(n&&null===this.currentDirection)return this.currentDirection=function(e,t=10){let r=null;return Math.abs(e.y)>t?r="y":Math.abs(e.x)>t&&(r="x"),r}(i),void(null!==this.currentDirection&&o&&o(this.currentDirection));this.updateAxis("x",t.point,i),this.updateAxis("y",t.point,i),this.visualElement.render(),a&&a(e,t)},onSessionEnd:(e,t)=>this.stop(e,t),resumeAnimation:()=>bMt(e=>{var t;return"paused"===this.getAnimationState(e)&&(null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.play())})},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:n,contextWindow:zMt(this.visualElement)})}stop(e,t){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:n}=t;this.startAnimation(n);const{onDragEnd:o}=this.getProps();o&&qbt.postRender(()=>o(e,t))}cancel(){this.isDragging=!1;const{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,r){const{drag:n}=this.getProps();if(!r||!LMt(e,n,this.currentDirection))return;const o=this.getAxisMotionValue(e);let a=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(a=function(e,{min:t,max:r},n){return void 0!==t&&e<t?e=n?S_t(t,e,n.min):Math.max(e,t):void 0!==r&&e>r&&(e=n?S_t(r,e,n.max):Math.min(e,r)),e}(a,this.constraints[e],this.elastic[e])),o.set(a)}resolveConstraints(){var e;const{dragConstraints:t,dragElastic:r}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout,o=this.constraints;t&&pxt(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(e,{top:t,left:r,bottom:n,right:o}){return{x:hMt(e.x,r,o),y:hMt(e.y,t,n)}}(n.layoutBox,t),this.elastic=function(e=mMt){return!1===e?e=0:!0===e&&(e=mMt),{x:vMt(e,"left","right"),y:vMt(e,"top","bottom")}}(r),o!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&bMt(e=>{!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=function(e,t){const r={};return void 0!==t.min&&(r.min=t.min-e.min),void 0!==t.max&&(r.max=t.max-e.min),r}(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!pxt(e))return!1;const r=e.current;Fbt(null!==r,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:n}=this.visualElement;if(!n||!n.layout)return!1;const o=function(e,t,r){const n=FMt(e,r),{scroll:o}=t;return o&&(TMt(n.x,o.offset.x),TMt(n.y,o.offset.y)),n}(r,n.root,this.visualElement.getTransformPagePoint());let a=function(e,t){return{x:fMt(e.x,t.x),y:fMt(e.y,t.y)}}(n.layout.layoutBox,o);if(t){const e=t(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(a));this.hasMutatedConstraints=!!e,e&&(a=xMt(e))}return a}startAnimation(e){const{drag:t,dragMomentum:r,dragElastic:n,dragTransition:o,dragSnapToOrigin:a,onDragTransitionEnd:i}=this.getProps(),s=this.constraints||{},l=bMt(i=>{if(!LMt(i,t,this.currentDirection))return;let l=s&&s[i]||{};a&&(l={min:0,max:0});const c=n?200:1e6,u=n?40:1e7,d={type:"inertia",velocity:r?e[i]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...o,...l};return this.startAxisValueAnimation(i,d)});return Promise.all(l).then(i)}startAxisValueAnimation(e,t){const r=this.getAxisMotionValue(e);return mkt(this.visualElement,e),r.start(NCt(e,r,0,t,this.visualElement,!1))}stopAnimation(){bMt(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){bMt(e=>{var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.pause()})}getAnimationState(e){var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.state}getAxisMotionValue(e){const t=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps();return r[t]||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){bMt(t=>{const{drag:r}=this.getProps();if(!LMt(t,r,this.currentDirection))return;const{projection:n}=this.visualElement,o=this.getAxisMotionValue(t);if(n&&n.layout){const{min:r,max:a}=n.layout.layoutBox[t];o.set(e[t]-S_t(r,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:r}=this.visualElement;if(!pxt(t)||!r||!this.constraints)return;this.stopAnimation();const n={x:0,y:0};bMt(e=>{const t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){const r=t.get();n[e]=function(e,t){let r=.5;const n=sMt(e),o=sMt(t);return o>n?r=Ibt(t.min,t.max-n,e.min):n>o&&(r=Ibt(e.min,e.max-o,t.min)),Bxt(0,1,r)}({min:r,max:r},this.constraints[e])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),bMt(t=>{if(!LMt(t,e,null))return;const r=this.getAxisMotionValue(t),{min:o,max:a}=this.constraints[t];r.set(S_t(o,a,n[t]))})}addListeners(){if(!this.visualElement.current)return;IMt.set(this.visualElement,this);const e=QCt(this.visualElement.current,"pointerdown",e=>{const{drag:t,dragListener:r=!0}=this.getProps();t&&r&&this.start(e)}),t=()=>{const{dragConstraints:e}=this.getProps();pxt(e)&&e.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,n=r.addEventListener("measure",t);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),qbt.read(t);const o=XCt(window,"resize",()=>this.scalePositionWithinConstraints()),a=r.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(bMt(t=>{const r=this.getAxisMotionValue(t);r&&(this.originPoint[t]+=e[t].translate,r.set(r.get()+e[t].translate))}),this.visualElement.render())});return()=>{o(),e(),n(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:r=!1,dragPropagation:n=!1,dragConstraints:o=!1,dragElastic:a=mMt,dragMomentum:i=!0}=e;return{...e,drag:t,dragDirectionLock:r,dragPropagation:n,dragConstraints:o,dragElastic:a,dragMomentum:i}}}function LMt(e,t,r){return!(!0!==t&&t!==e||null!==r&&r!==e)}const BMt=e=>(t,r)=>{e&&qbt.postRender(()=>e(t,r))};const VMt={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function HMt(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const qMt={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!Gxt.test(e))return e;e=parseFloat(e)}return`${HMt(e,t.target.x)}% ${HMt(e,t.target.y)}%`}},$Mt={correct:(e,{treeScale:t,projectionDelta:r})=>{const n=e,o=Kkt.parse(e);if(o.length>5)return n;const a=Kkt.createTransformer(e),i="number"!=typeof o[0]?1:0,s=r.x.scale*t.x,l=r.y.scale*t.y;o[0+i]/=s,o[1+i]/=l;const c=S_t(s,l,.5);return"number"==typeof o[2+i]&&(o[2+i]/=c),"number"==typeof o[3+i]&&(o[3+i]/=c),a(o)}};class WMt extends e.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:r,layoutId:n}=this.props,{projection:o}=e;(function(e){Object.assign(fwt,e)})(GMt),o&&(t.group&&t.group.add(o),r&&r.register&&n&&r.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),VMt.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:r,drag:n,isPresent:o}=this.props,a=r.projection;return a&&(a.isPresent=o,n||e.layoutDependency!==t||void 0===t?a.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?a.promote():a.relegate()||qbt.postRender(()=>{const e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),vxt.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:r}=this.props,{projection:n}=e;n&&(n.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(n),r&&r.deregister&&r.deregister(n))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function UMt(r){const[n,o]=Dbt(),a=e.useContext(bbt);return t.jsx(WMt,{...r,layoutGroup:a,switchLayoutGroup:e.useContext(yxt),isPresent:n,safeToRemove:o})}const GMt={borderRadius:{...qMt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:qMt,borderTopRightRadius:qMt,borderBottomLeftRadius:qMt,borderBottomRightRadius:qMt,boxShadow:$Mt};const KMt=(e,t)=>e.depth-t.depth;class YMt{constructor(){this.children=[],this.isDirty=!1}add(e){lkt(this.children,e),this.isDirty=!0}remove(e){ckt(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(KMt),this.isDirty=!1,this.children.forEach(e)}}const XMt=["TopLeft","TopRight","BottomLeft","BottomRight"],ZMt=XMt.length,QMt=e=>"string"==typeof e?parseFloat(e):e,JMt=e=>"number"==typeof e||Gxt.test(e);function eSt(e,t){return void 0!==e[t]?e[t]:e.borderRadius}const tSt=nSt(0,.5,Skt),rSt=nSt(.5,.95,Nbt);function nSt(e,t,r){return n=>n<e?0:n>t?1:r(Ibt(e,t,n))}function oSt(e,t){e.min=t.min,e.max=t.max}function aSt(e,t){oSt(e.x,t.x),oSt(e.y,t.y)}function iSt(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function sSt(e,t,r,n,o){return e=SMt(e-=t,1/r,n),void 0!==o&&(e=SMt(e,1/o,n)),e}function lSt(e,t,[r,n,o],a,i){!function(e,t=0,r=1,n=.5,o,a=e,i=e){if(Uxt.test(t)&&(t=parseFloat(t),t=S_t(i.min,i.max,t/100)-i.min),"number"!=typeof t)return;let s=S_t(a.min,a.max,n);e===a&&(s-=t),e.min=sSt(e.min,t,r,s,o),e.max=sSt(e.max,t,r,s,o)}(e,t[r],t[n],t[o],t.scale,a,i)}const cSt=["x","scaleX","originX"],uSt=["y","scaleY","originY"];function dSt(e,t,r,n){lSt(e.x,t,cSt,r?r.x:void 0,n?n.x:void 0),lSt(e.y,t,uSt,r?r.y:void 0,n?n.y:void 0)}function pSt(e){return 0===e.translate&&1===e.scale}function hSt(e){return pSt(e.x)&&pSt(e.y)}function fSt(e,t){return e.min===t.min&&e.max===t.max}function mSt(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function vSt(e,t){return mSt(e.x,t.x)&&mSt(e.y,t.y)}function ySt(e){return sMt(e.x)/sMt(e.y)}function gSt(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class bSt{constructor(){this.members=[]}add(e){lkt(this.members,e),e.scheduleRender()}remove(e){if(ckt(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){const t=this.members.findIndex(t=>e===t);if(0===t)return!1;let r;for(let e=t;e>=0;e--){const t=this.members[e];if(!1!==t.isPresent){r=t;break}}return!!r&&(this.promote(r),!0)}promote(e,t){const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.instance&&r.scheduleRender(),e.scheduleRender(),e.resumeFrom=r,t&&(e.resumeFrom.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:n}=e.options;!1===n&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:t,resumingFrom:r}=e;t.onExitComplete&&t.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const xSt={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},wSt=typeof window<"u"&&void 0!==window.MotionDebug,kSt=["","X","Y","Z"],_St={visibility:"hidden"};let CSt=0;function MSt(e,t,r,n){const{latestValues:o}=t;o[e]&&(r[e]=o[e],t.setStaticValue(e,0),n&&(n[e]=0))}function SSt(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const r=vkt(t);if(window.MotionHasOptimisedAnimation(r,"transform")){const{layout:t,layoutId:n}=e.options;window.MotionCancelOptimisedAnimation(r,"transform",qbt,!(t||n))}const{parent:n}=e;n&&!n.hasCheckedOptimisedAppear&&SSt(n)}function DSt({attachResizeListener:e,defaultParent:t,measureScroll:r,checkIsScrollRoot:n,resetTransform:o}){return class{constructor(e={},r=(null==t?void 0:t())){this.id=CSt++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,wSt&&(xSt.totalNodes=xSt.resolvedTargetDeltas=xSt.recalculatedProjection=0),this.nodes.forEach(ESt),this.nodes.forEach(ISt),this.nodes.forEach(ASt),this.nodes.forEach(jSt),wSt&&window.MotionDebug.record(xSt)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=r?r.root||r:this,this.path=r?[...r.path,r]:[],this.parent=r,this.depth=r?r.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new YMt)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new ukt),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){const r=this.eventHandlers.get(e);r&&r.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t,r=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=function(e){return e instanceof SVGElement&&"svg"!==e.tagName}(t),this.instance=t;const{layoutId:n,layout:o,visualElement:a}=this.options;if(a&&!a.current&&a.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),r&&(o||n)&&(this.isLayoutDirty=!0),e){let r;const n=()=>this.root.updateBlockedByResize=!1;e(t,()=>{this.root.updateBlockedByResize=!0,r&&r(),r=function(e,t){const r=skt.now(),n=({timestamp:o})=>{const a=o-r;a>=t&&($bt(n),e(a-t))};return qbt.read(n,!0),()=>$bt(n)}(n,250),VMt.hasAnimatedSinceResize&&(VMt.hasAnimatedSinceResize=!1,this.nodes.forEach(zSt))})}n&&this.root.registerSharedNode(n,this),!1!==this.options.animate&&a&&(n||o)&&this.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t,hasRelativeTargetChanged:r,layout:n})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||a.getDefaultTransition()||$St,{onLayoutAnimationStart:i,onLayoutAnimationComplete:s}=a.getProps(),l=!this.targetLayout||!vSt(this.targetLayout,n)||r,c=!t&&r;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||c||t&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(e,c);const t={...Twt(o,"layout"),onPlay:i,onComplete:s};(a.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t)}else t||zSt(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=n})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,$bt(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(LSt),this.animationId++)}getTransformTemplate(){const{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&SSt(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){const t=this.path[e];t.shouldResetTransform=!0,t.updateScroll("snapshot"),t.options.layoutRoot&&t.willUpdate(!1)}const{layoutId:t,layout:r}=this.options;if(void 0===t&&!r)return;const n=this.getTransformTemplate();this.prevTransformTemplateValue=n?n(this.latestValues,""):void 0,this.updateSnapshot(),e&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(NSt);this.isUpdating||this.nodes.forEach(RSt),this.isUpdating=!1,this.nodes.forEach(FSt),this.nodes.forEach(OSt),this.nodes.forEach(PSt),this.clearAllSnapshots();const e=skt.now();Wbt.delta=Bxt(0,1e3/60,e-Wbt.timestamp),Wbt.timestamp=e,Wbt.isProcessing=!0,Ubt.update.process(Wbt),Ubt.preRender.process(Wbt),Ubt.render.process(Wbt),Wbt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,vxt.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(TSt),this.sharedNodes.forEach(BSt)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,qbt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){qbt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!(this.instance&&(this.updateScroll(),this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty)))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();const e=this.layout;this.layout=this.measure(!1),this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:t}=this.options;t&&t.notify("LayoutMeasure",this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e="measure"){let t=!(!this.options.layoutScroll||!this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t){const t=n(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:r(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!o)return;const e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!hSt(this.projectionDelta),r=this.getTransformTemplate(),n=r?r(this.latestValues,""):void 0,a=n!==this.prevTransformTemplateValue;e&&(t||_Mt(this.latestValues)||a)&&(o(this.instance,n),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){const t=this.measurePageBox();let r=this.removeElementScroll(t);return e&&(r=this.removeTransform(r)),function(e){GSt(e.x),GSt(e.y)}(r),{animationId:this.root.animationId,measuredBox:t,layoutBox:r,latestValues:{},source:this.id}}measurePageBox(){var e;const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const r=t.measureViewportBox();if(!(null===(e=this.scroll)||void 0===e?void 0:e.wasRoot)&&!this.path.some(YSt)){const{scroll:e}=this.root;e&&(TMt(r.x,e.offset.x),TMt(r.y,e.offset.y))}return r}removeElementScroll(e){var t;const r={x:{min:0,max:0},y:{min:0,max:0}};if(aSt(r,e),null!==(t=this.scroll)&&void 0!==t&&t.wasRoot)return r;for(let t=0;t<this.path.length;t++){const n=this.path[t],{scroll:o,options:a}=n;n!==this.root&&o&&a.layoutScroll&&(o.wasRoot&&aSt(r,e),TMt(r.x,o.offset.x),TMt(r.y,o.offset.y))}return r}applyTransform(e,t=!1){const r={x:{min:0,max:0},y:{min:0,max:0}};aSt(r,e);for(let e=0;e<this.path.length;e++){const n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&RMt(r,{x:-n.scroll.offset.x,y:-n.scroll.offset.y}),_Mt(n.latestValues)&&RMt(r,n.latestValues)}return _Mt(this.latestValues)&&RMt(r,this.latestValues),r}removeTransform(e){const t={x:{min:0,max:0},y:{min:0,max:0}};aSt(t,e);for(let e=0;e<this.path.length;e++){const r=this.path[e];if(!r.instance||!_Mt(r.latestValues))continue;kMt(r.latestValues)&&r.updateSnapshot();const n=gMt();aSt(n,r.measurePageBox()),dSt(t,r.latestValues,r.snapshot?r.snapshot.layoutBox:void 0,n)}return _Mt(this.latestValues)&&dSt(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:void 0===e.crossfade||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Wbt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){var t;const r=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=r.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=r.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=r.isSharedProjectionDirty);const n=!!this.resumingFrom||this!==r;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||null!==(t=this.parent)&&void 0!==t&&t.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:o,layoutId:a}=this.options;if(this.layout&&(o||a)){if(this.resolvedRelativeTargetAt=Wbt.timestamp,!this.targetDelta&&!this.relativeTarget){const e=this.getClosestProjectingParent();e&&e.layout&&1!==this.animationProgress?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},pMt(this.relativeTargetOrigin,this.layout.layoutBox,e.layout.layoutBox),aSt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(this.relativeTarget||this.targetDelta){if(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),function(e,t,r){uMt(e.x,t.x,r.x),uMt(e.y,t.y,r.y)}(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):aSt(this.target,this.layout.layoutBox),PMt(this.target,this.targetDelta)):aSt(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const e=this.getClosestProjectingParent();e&&!!e.resumingFrom==!!this.resumingFrom&&!e.options.layoutScroll&&e.target&&1!==this.animationProgress?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},pMt(this.relativeTargetOrigin,this.target,e.target),aSt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}wSt&&xSt.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(this.parent&&!kMt(this.parent.latestValues)&&!CMt(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!(!(this.relativeTarget||this.targetDelta||this.options.layoutRoot)||!this.layout)}calcProjection(){var e;const t=this.getLead(),r=!!this.resumingFrom||this!==t;let n=!0;if((this.isProjectionDirty||!(null===(e=this.parent)||void 0===e)&&e.isProjectionDirty)&&(n=!1),r&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===Wbt.timestamp&&(n=!1),n)return;const{layout:o,layoutId:a}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!o&&!a)return;aSt(this.layoutCorrected,this.layout.layoutBox);const i=this.treeScale.x,s=this.treeScale.y;(function(e,t,r,n=!1){const o=r.length;if(!o)return;let a,i;t.x=t.y=1;for(let s=0;s<o;s++){a=r[s],i=a.projectionDelta;const{visualElement:o}=a.options;o&&o.props.style&&"contents"===o.props.style.display||(n&&a.options.layoutScroll&&a.scroll&&a!==a.root&&RMt(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),i&&(t.x*=i.x.scale,t.y*=i.y.scale,PMt(e,i)),n&&_Mt(a.latestValues)&&RMt(e,a.latestValues))}t.x<jMt&&t.x>EMt&&(t.x=1),t.y<jMt&&t.y>EMt&&(t.y=1)})(this.layoutCorrected,this.treeScale,this.path,r),t.layout&&!t.target&&(1!==this.treeScale.x||1!==this.treeScale.y)&&(t.target=t.layout.layoutBox,t.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:l}=t;l?(this.projectionDelta&&this.prevProjectionDelta?(iSt(this.prevProjectionDelta.x,this.projectionDelta.x),iSt(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),cMt(this.projectionDelta,this.layoutCorrected,l,this.latestValues),(this.treeScale.x!==i||this.treeScale.y!==s||!gSt(this.projectionDelta.x,this.prevProjectionDelta.x)||!gSt(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),wSt&&xSt.recalculatedProjection++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){var t;if(null===(t=this.options.visualElement)||void 0===t||t.scheduleRender(),e){const e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(e,t=!1){const r=this.snapshot,n=r?r.latestValues:{},o={...this.latestValues},a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;const i={x:{min:0,max:0},y:{min:0,max:0}},s=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),c=!l||l.members.length<=1,u=!(!s||c||!0!==this.options.crossfade||this.path.some(qSt));let d;this.animationProgress=0,this.mixTargetDelta=t=>{const r=t/1e3;VSt(a.x,e.x,r),VSt(a.y,e.y,r),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(pMt(i,this.layout.layoutBox,this.relativeParent.layout.layoutBox),function(e,t,r,n){HSt(e.x,t.x,r.x,n),HSt(e.y,t.y,r.y,n)}(this.relativeTarget,this.relativeTargetOrigin,i,r),d&&function(e,t){return fSt(e.x,t.x)&&fSt(e.y,t.y)}(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),aSt(d,this.relativeTarget)),s&&(this.animationValues=o,function(e,t,r,n,o,a){o?(e.opacity=S_t(0,void 0!==r.opacity?r.opacity:1,tSt(n)),e.opacityExit=S_t(void 0!==t.opacity?t.opacity:1,0,rSt(n))):a&&(e.opacity=S_t(void 0!==t.opacity?t.opacity:1,void 0!==r.opacity?r.opacity:1,n));for(let o=0;o<ZMt;o++){const a=`border${XMt[o]}Radius`;let i=eSt(t,a),s=eSt(r,a);void 0===i&&void 0===s||(i||(i=0),s||(s=0),0===i||0===s||JMt(i)===JMt(s)?(e[a]=Math.max(S_t(QMt(i),QMt(s),n),0),(Uxt.test(s)||Uxt.test(i))&&(e[a]+="%")):e[a]=s)}(t.rotate||r.rotate)&&(e.rotate=S_t(t.rotate||0,r.rotate||0,n))}(o,n,this.latestValues,r,u,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=r},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&($bt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=qbt.update(()=>{VMt.hasAnimatedSinceResize=!0,this.currentAnimation=function(e,t,r){const n=Oxt(e)?e:hkt(e);return n.start(NCt("",n,t,r)),n.animation}(0,1e3,{...e,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const e=this.getLead();let{targetWithTransforms:t,target:r,layout:n,latestValues:o}=e;if(t&&r&&n){if(this!==e&&this.layout&&n&&KSt(this.options.animationType,this.layout.layoutBox,n.layoutBox)){r=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const t=sMt(this.layout.layoutBox.x);r.x.min=e.target.x.min,r.x.max=r.x.min+t;const n=sMt(this.layout.layoutBox.y);r.y.min=e.target.y.min,r.y.max=r.y.min+n}aSt(t,r),RMt(t,o),cMt(this.projectionDeltaWithTransform,this.layoutCorrected,t,o)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new bSt),this.sharedNodes.get(e).add(t);const r=t.options.initialPromotionConfig;t.promote({transition:r?r.transition:void 0,preserveFollowOpacity:r&&r.shouldPreserveFollowOpacity?r.shouldPreserveFollowOpacity(t):void 0})}isLead(){const e=this.getStack();return!e||e.lead===this}getLead(){var e;const{layoutId:t}=this.options;return t&&(null===(e=this.getStack())||void 0===e?void 0:e.lead)||this}getPrevLead(){var e;const{layoutId:t}=this.options;return t?null===(e=this.getStack())||void 0===e?void 0:e.prevLead:void 0}getStack(){const{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:r}={}){const n=this.getStack();n&&n.promote(this,r),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){const e=this.getStack();return!!e&&e.relegate(this)}resetSkewAndRotation(){const{visualElement:e}=this.options;if(!e)return;let t=!1;const{latestValues:r}=e;if((r.z||r.rotate||r.rotateX||r.rotateY||r.rotateZ||r.skewX||r.skewY)&&(t=!0),!t)return;const n={};r.z&&MSt("z",e,n,this.animationValues);for(let t=0;t<kSt.length;t++)MSt(`rotate${kSt[t]}`,e,n,this.animationValues),MSt(`skew${kSt[t]}`,e,n,this.animationValues);e.render();for(const t in n)e.setStaticValue(t,n[t]),this.animationValues&&(this.animationValues[t]=n[t]);e.scheduleRender()}getProjectionStyles(e){var t,r;if(!this.instance||this.isSVG)return;if(!this.isVisible)return _St;const n={visibility:""},o=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,n.opacity="",n.pointerEvents=Pxt(null==e?void 0:e.pointerEvents)||"",n.transform=o?o(this.latestValues,""):"none",n;const a=this.getLead();if(!this.projectionDelta||!this.layout||!a.target){const t={};return this.options.layoutId&&(t.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,t.pointerEvents=Pxt(null==e?void 0:e.pointerEvents)||""),this.hasProjected&&!_Mt(this.latestValues)&&(t.transform=o?o({},""):"none",this.hasProjected=!1),t}const i=a.animationValues||a.latestValues;this.applyTransformsToTarget(),n.transform=function(e,t,r){let n="";const o=e.x.translate/t.x,a=e.y.translate/t.y,i=(null==r?void 0:r.z)||0;if((o||a||i)&&(n=`translate3d(${o}px, ${a}px, ${i}px) `),(1!==t.x||1!==t.y)&&(n+=`scale(${1/t.x}, ${1/t.y}) `),r){const{transformPerspective:e,rotate:t,rotateX:o,rotateY:a,skewX:i,skewY:s}=r;e&&(n=`perspective(${e}px) ${n}`),t&&(n+=`rotate(${t}deg) `),o&&(n+=`rotateX(${o}deg) `),a&&(n+=`rotateY(${a}deg) `),i&&(n+=`skewX(${i}deg) `),s&&(n+=`skewY(${s}deg) `)}const s=e.x.scale*t.x,l=e.y.scale*t.y;return(1!==s||1!==l)&&(n+=`scale(${s}, ${l})`),n||"none"}(this.projectionDeltaWithTransform,this.treeScale,i),o&&(n.transform=o(i,n.transform));const{x:s,y:l}=this.projectionDelta;n.transformOrigin=`${100*s.origin}% ${100*l.origin}% 0`,a.animationValues?n.opacity=a===this?null!==(r=null!==(t=i.opacity)&&void 0!==t?t:this.latestValues.opacity)&&void 0!==r?r:1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:n.opacity=a===this?void 0!==i.opacity?i.opacity:"":void 0!==i.opacityExit?i.opacityExit:0;for(const e in fwt){if(void 0===i[e])continue;const{correct:t,applyTo:r}=fwt[e],o="none"===n.transform?i[e]:t(i[e],a);if(r){const e=r.length;for(let t=0;t<e;t++)n[r[t]]=o}else n[e]=o}return this.options.layoutId&&(n.pointerEvents=a===this?Pxt(null==e?void 0:e.pointerEvents)||"":"none"),n}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>{var t;return null===(t=e.currentAnimation)||void 0===t?void 0:t.stop()}),this.root.nodes.forEach(NSt),this.root.sharedNodes.clear()}}}function OSt(e){e.updateLayout()}function PSt(e){var t;const r=(null===(t=e.resumeFrom)||void 0===t?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&r&&e.hasListeners("didUpdate")){const{layoutBox:t,measuredBox:n}=e.layout,{animationType:o}=e.options,a=r.source!==e.layout.source;"size"===o?bMt(e=>{const n=a?r.measuredBox[e]:r.layoutBox[e],o=sMt(n);n.min=t[e].min,n.max=n.min+o}):KSt(o,r.layoutBox,t)&&bMt(n=>{const o=a?r.measuredBox[n]:r.layoutBox[n],i=sMt(t[n]);o.max=o.min+i,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[n].max=e.relativeTarget[n].min+i)});const i={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};cMt(i,t,r.layoutBox);const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};a?cMt(s,e.applyTransform(n,!0),r.measuredBox):cMt(s,t,r.layoutBox);const l=!hSt(i);let c=!1;if(!e.resumeFrom){const n=e.getClosestProjectingParent();if(n&&!n.resumeFrom){const{snapshot:o,layout:a}=n;if(o&&a){const i={x:{min:0,max:0},y:{min:0,max:0}};pMt(i,r.layoutBox,o.layoutBox);const s={x:{min:0,max:0},y:{min:0,max:0}};pMt(s,t,a.layoutBox),vSt(i,s)||(c=!0),n.options.layoutRoot&&(e.relativeTarget=s,e.relativeTargetOrigin=i,e.relativeParent=n)}}}e.notifyListeners("didUpdate",{layout:t,snapshot:r,delta:s,layoutDelta:i,hasLayoutChanged:l,hasRelativeTargetChanged:c})}else if(e.isLead()){const{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function ESt(e){wSt&&xSt.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function jSt(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function TSt(e){e.clearSnapshot()}function NSt(e){e.clearMeasurements()}function RSt(e){e.isLayoutDirty=!1}function FSt(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function zSt(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function ISt(e){e.resolveTargetDelta()}function ASt(e){e.calcProjection()}function LSt(e){e.resetSkewAndRotation()}function BSt(e){e.removeLeadSnapshot()}function VSt(e,t,r){e.translate=S_t(t.translate,0,r),e.scale=S_t(t.scale,1,r),e.origin=t.origin,e.originPoint=t.originPoint}function HSt(e,t,r,n){e.min=S_t(t.min,r.min,n),e.max=S_t(t.max,r.max,n)}function qSt(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}const $St={duration:.45,ease:[.4,0,.1,1]},WSt=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),USt=WSt("applewebkit/")&&!WSt("chrome/")?Math.round:Nbt;function GSt(e){e.min=USt(e.min),e.max=USt(e.max)}function KSt(e,t,r){return"position"===e||"preserve-aspect"===e&&!function(e,t,r){return Math.abs(e-t)<=r}(ySt(t),ySt(r),.2)}function YSt(e){var t;return e!==e.root&&(null===(t=e.scroll)||void 0===t?void 0:t.wasRoot)}const XSt=DSt({attachResizeListener:(e,t)=>XCt(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ZSt={current:void 0},QSt=DSt({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!ZSt.current){const e=new XSt({});e.mount(window),e.setOptions({layoutScroll:!0}),ZSt.current=e}return ZSt.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>"fixed"===window.getComputedStyle(e).position}),JSt={pan:{Feature:class extends GCt{constructor(){super(...arguments),this.removePointerDownListener=Nbt}onPointerDown(e){this.session=new eMt(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:zMt(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:r,onPanEnd:n}=this.node.getProps();return{onSessionStart:BMt(e),onStart:BMt(t),onMove:r,onEnd:(e,t)=>{delete this.session,n&&qbt.postRender(()=>n(e,t))}}}mount(){this.removePointerDownListener=QCt(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends GCt{constructor(e){super(e),this.removeGroupControls=Nbt,this.removeListeners=Nbt,this.controls=new AMt(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Nbt}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:QSt,MeasureLayout:UMt}};function eDt(e,t,r){const{props:n}=e;e.animationState&&n.whileHover&&e.animationState.setActive("whileHover","Start"===r);const o=n["onHover"+r];o&&qbt.postRender(()=>o(t,ZCt(t)))}function tDt(e,t,r){const{props:n}=e;e.animationState&&n.whileTap&&e.animationState.setActive("whileTap","Start"===r);const o=n["onTap"+("End"===r?"":r)];o&&qbt.postRender(()=>o(t,ZCt(t)))}const rDt=new WeakMap,nDt=new WeakMap,oDt=e=>{const t=rDt.get(e.target);t&&t(e)},aDt=e=>{e.forEach(oDt)};function iDt(e,t,r){const n=function({root:e,...t}){const r=e||document;nDt.has(r)||nDt.set(r,{});const n=nDt.get(r),o=JSON.stringify(t);return n[o]||(n[o]=new IntersectionObserver(aDt,{root:e,...t})),n[o]}(t);return rDt.set(e,r),n.observe(e),()=>{rDt.delete(e),n.unobserve(e)}}const sDt={some:0,all:1};const lDt={inView:{Feature:class extends GCt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:t,margin:r,amount:n="some",once:o}=e,a={root:t?t.current:void 0,rootMargin:r,threshold:"number"==typeof n?n:sDt[n]};return iDt(this.node.current,a,e=>{const{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,o&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);const{onViewportEnter:r,onViewportLeave:n}=this.node.getProps(),a=t?r:n;a&&a(e)})}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}(e,t))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends GCt{mount(){const{current:e}=this.node;e&&(this.unmount=nkt(e,e=>(tDt(this.node,e,"Start"),(e,{success:t})=>tDt(this.node,e,t?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends GCt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=R_t(XCt(this.node.current,"focus",()=>this.onFocus()),XCt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends GCt{mount(){const{current:e}=this.node;e&&(this.unmount=function(e,t,r={}){const[n,o,a]=Kwt(e,r),i=Ywt(e=>{const{target:r}=e,n=t(e);if("function"!=typeof n||!r)return;const a=Ywt(e=>{n(e),r.removeEventListener("pointerleave",a)});r.addEventListener("pointerleave",a,o)});return n.forEach(e=>{e.addEventListener("pointerenter",i,o)}),a}(e,e=>(eDt(this.node,e,"Start"),e=>eDt(this.node,e,"End"))))}unmount(){}}}},cDt={layout:{ProjectionNode:QSt,MeasureLayout:UMt}},uDt={current:null},dDt={current:!1};const pDt=[...b_t,Lkt,Kkt],hDt=new WeakMap;const fDt=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class mDt{scrapeMotionValuesFromProps(e,t,r){return{}}constructor({parent:e,props:t,presenceContext:r,reducedMotionConfig:n,blockInitialAnimation:o,visualState:a},i={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=f_t,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const e=skt.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,qbt.render(this.render,!1,!0))};const{latestValues:s,renderState:l,onUpdate:c}=a;this.onUpdate=c,this.latestValues=s,this.baseTarget={...s},this.initialValues=t.initial?{...s}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=n,this.options=i,this.blockInitialAnimation=!!o,this.isControllingVariants=sxt(t),this.isVariantNode=lxt(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!(!e||!e.current);const{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(const e in d){const t=d[e];void 0!==s[e]&&Oxt(t)&&t.set(s[e],!1)}}mount(e){this.current=e,hDt.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),dDt.current||function(){if(dDt.current=!0,Ebt)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>uDt.current=e.matches;e.addListener(t),t()}else uDt.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||uDt.current),"production"!==process.env.NODE_ENV&&ext(!0!==this.shouldReduceMotion,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){hDt.delete(this.current),this.projection&&this.projection.unmount(),$bt(this.notifyUpdate),$bt(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}bindToMotionValue(e,t){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const r=Nxt.has(e),n=t.on("change",t=>{this.latestValues[e]=t,this.props.onUpdate&&qbt.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),o=t.on("renderRequest",this.scheduleRender);let a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{n(),o(),a&&a(),t.owner&&t.stop()})}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}updateFeatures(){let e="animation";for(e in Ybt){const t=Ybt[e];if(!t)continue;const{isEnabled:r,Feature:n}=t;if(!this.features[e]&&n&&r(this.props)&&(this.features[e]=new n(this)),this.features[e]){const t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<fDt.length;t++){const r=fDt[t];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const n=e["on"+r];n&&(this.propEventSubscriptions[r]=this.on(r,n))}this.prevMotionValues=function(e,t,r){for(const n in t){const o=t[n],a=r[n];if(Oxt(o))e.addValue(n,o),"development"===process.env.NODE_ENV&&ext("11.18.2"===o.version,`Attempting to mix Motion versions ${o.version} with 11.18.2 may not work as expected.`);else if(Oxt(a))e.addValue(n,hkt(o,{owner:e}));else if(a!==o)if(e.hasValue(n)){const t=e.getValue(n);!0===t.liveStyle?t.jump(o):t.hasAnimated||t.set(o)}else{const t=e.getStaticValue(n);e.addValue(n,hkt(void 0!==t?t:o,{owner:e}))}}for(const n in r)void 0===t[n]&&e.removeValue(n);return t}(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){const r=this.values.get(e);t!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return void 0===r&&void 0!==t&&(r=hkt(null===t?void 0:t,{owner:this}),this.addValue(e,r)),r}readValue(e,t){var r;let n=void 0===this.latestValues[e]&&this.current?null!==(r=this.getBaseTargetFromProps(this.props,e))&&void 0!==r?r:this.readValueFromInstance(this.current,e,this.options):this.latestValues[e];return null!=n&&("string"==typeof n&&(m_t(n)||Okt(n))?n=parseFloat(n):!(e=>pDt.find(g_t(e)))(n)&&Kkt.test(t)&&(n=t_t(e,t)),this.setBaseTarget(e,Oxt(n)?n.get():n)),Oxt(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;const{initial:r}=this.props;let n;if("string"==typeof r||"object"==typeof r){const o=Mxt(this.props,r,null===(t=this.presenceContext)||void 0===t?void 0:t.custom);o&&(n=o[e])}if(r&&void 0!==n)return n;const o=this.getBaseTargetFromProps(this.props,e);return void 0===o||Oxt(o)?void 0!==this.initialValues[e]&&void 0===n?void 0:this.baseTarget[e]:o}on(e,t){return this.events[e]||(this.events[e]=new ukt),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class vDt extends mDt{constructor(){super(...arguments),this.KeyframeResolver=w_t}sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:r}){delete t[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Oxt(e)&&(this.childSubscription=e.on("change",e=>{this.current&&(this.current.textContent=`${e}`)}))}}class yDt extends vDt{constructor(){super(...arguments),this.type="html",this.renderInstance=dwt}readValueFromInstance(e,t){if(Nxt.has(t)){const e=e_t(t);return e&&e.default||0}{const r=function(e){return window.getComputedStyle(e)}(e),n=(Fxt(t)?r.getPropertyValue(t):r[t])||0;return"string"==typeof n?n.trim():n}}measureInstanceViewportBox(e,{transformPagePoint:t}){return FMt(e,t)}build(e,t,r){nwt(e,t,r.transformTemplate)}scrapeMotionValuesFromProps(e,t,r){return vwt(e,t,r)}}class gDt extends vDt{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=gMt}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Nxt.has(t)){const e=e_t(t);return e&&e.default||0}return t=pwt.has(t)?t:fxt(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,r){return ywt(e,t,r)}build(e,t,r){swt(e,t,this.isSVGTag,r.transformTemplate)}renderInstance(e,t,r,n){hwt(e,t,0,n)}mount(e){this.isSVGTag=uwt(e.tagName),super.mount(e)}}const bDt=(t,r)=>_xt(t)?new gDt(r):new yDt(r,{allowProjection:t!==e.Fragment}),xDt=txt(Swt({...YCt,...lDt,...JSt,...cDt},bDt));var wDt=Array(12).fill(0),kDt=({visible:e,className:t})=>l.default.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},l.default.createElement("div",{className:"sonner-spinner"},wDt.map((e,t)=>l.default.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${t}`})))),_Dt=l.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},l.default.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),CDt=l.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},l.default.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),MDt=l.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},l.default.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),SDt=l.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},l.default.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),DDt=l.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},l.default.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),l.default.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),ODt=1,PDt=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:r,...n}=e,o="number"==typeof(null==e?void 0:e.id)||(null==(t=e.id)?void 0:t.length)>0?e.id:ODt++,a=this.toasts.find(e=>e.id===o),i=void 0===e.dismissible||e.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),a?this.toasts=this.toasts.map(t=>t.id===o?(this.publish({...t,...e,id:o,title:r}),{...t,...e,id:o,dismissible:i,title:r}):t):this.addToast({title:r,...n,dismissible:i,id:o}),o},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let r;void 0!==t.loading&&(r=this.create({...t,promise:e,type:"loading",message:t.loading,description:"function"!=typeof t.description?t.description:void 0}));let n,o=e instanceof Promise?e:e(),a=void 0!==r,i=o.then(async e=>{if(n=["resolve",e],l.default.isValidElement(e))a=!1,this.create({id:r,type:"default",message:e});else if(EDt(e)&&!e.ok){a=!1;let n="function"==typeof t.error?await t.error(`HTTP error! status: ${e.status}`):t.error,o="function"==typeof t.description?await t.description(`HTTP error! status: ${e.status}`):t.description;this.create({id:r,type:"error",message:n,description:o})}else if(void 0!==t.success){a=!1;let n="function"==typeof t.success?await t.success(e):t.success,o="function"==typeof t.description?await t.description(e):t.description;this.create({id:r,type:"success",message:n,description:o})}}).catch(async e=>{if(n=["reject",e],void 0!==t.error){a=!1;let n="function"==typeof t.error?await t.error(e):t.error,o="function"==typeof t.description?await t.description(e):t.description;this.create({id:r,type:"error",message:n,description:o})}}).finally(()=>{var e;a&&(this.dismiss(r),r=void 0),null==(e=t.finally)||e.call(t)}),s=()=>new Promise((e,t)=>i.then(()=>"reject"===n[0]?t(n[1]):e(n[1])).catch(t));return"string"!=typeof r&&"number"!=typeof r?{unwrap:s}:Object.assign(r,{unwrap:s})},this.custom=(e,t)=>{let r=(null==t?void 0:t.id)||ODt++;return this.create({jsx:e(r),id:r,...t}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},EDt=e=>e&&"object"==typeof e&&"ok"in e&&"boolean"==typeof e.ok&&"status"in e&&"number"==typeof e.status,jDt=(e,t)=>{let r=(null==t?void 0:t.id)||ODt++;return PDt.addToast({title:e,...t,id:r}),r},TDt=Object.assign(jDt,{success:PDt.success,info:PDt.info,warning:PDt.warning,error:PDt.error,custom:PDt.custom,message:PDt.message,promise:PDt.promise,dismiss:PDt.dismiss,loading:PDt.loading},{getHistory:()=>PDt.toasts,getToasts:()=>PDt.getActiveToasts()});function NDt(e){return void 0!==e.label}!function(e,{insertAt:t}={}){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===t&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}(':where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}\n');var RDt=3,FDt=14;function zDt(...e){return e.filter(Boolean).join(" ")}var IDt=t=>{var r,n,o,a,i,s,c,u,d,p,h;let{invert:f,toast:m,unstyled:v,interacting:y,setHeights:g,visibleToasts:b,heights:x,index:w,toasts:k,expanded:_,removeToast:C,defaultRichColors:M,closeButton:S,style:D,cancelButtonStyle:O,actionButtonStyle:P,className:E="",descriptionClassName:j="",duration:T,position:N,gap:R,loadingIcon:F,expandByDefault:z,classNames:I,icons:A,closeButtonAriaLabel:L="Close toast",pauseWhenPageIsHidden:B}=t,[V,H]=l.default.useState(null),[q,$]=l.default.useState(null),[W,U]=l.default.useState(!1),[G,K]=l.default.useState(!1),[Y,X]=l.default.useState(!1),[Z,Q]=l.default.useState(!1),[J,ee]=l.default.useState(!1),[te,re]=l.default.useState(0),[ne,oe]=l.default.useState(0),ae=l.default.useRef(m.duration||T||4e3),ie=l.default.useRef(null),se=l.default.useRef(null),le=0===w,ce=w+1<=b,ue=m.type,de=!1!==m.dismissible,pe=m.className||"",he=m.descriptionClassName||"",fe=l.default.useMemo(()=>x.findIndex(e=>e.toastId===m.id)||0,[x,m.id]),me=l.default.useMemo(()=>{var e;return null!=(e=m.closeButton)?e:S},[m.closeButton,S]),ve=l.default.useMemo(()=>m.duration||T||4e3,[m.duration,T]),ye=l.default.useRef(0),ge=l.default.useRef(0),be=l.default.useRef(0),xe=l.default.useRef(null),[we,ke]=N.split("-"),_e=l.default.useMemo(()=>x.reduce((e,t,r)=>r>=fe?e:e+t.height,0),[x,fe]),Ce=(()=>{let[e,t]=l.default.useState(document.hidden);return l.default.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",e),()=>window.removeEventListener("visibilitychange",e)},[]),e})(),Me=m.invert||f,Se="loading"===ue;ge.current=l.default.useMemo(()=>fe*R+_e,[fe,_e]),l.default.useEffect(()=>{ae.current=ve},[ve]),l.default.useEffect(()=>{U(!0)},[]),l.default.useEffect(()=>{let e=se.current;if(e){let t=e.getBoundingClientRect().height;return oe(t),g(e=>[{toastId:m.id,height:t,position:m.position},...e]),()=>g(e=>e.filter(e=>e.toastId!==m.id))}},[g,m.id]),l.default.useLayoutEffect(()=>{if(!W)return;let e=se.current,t=e.style.height;e.style.height="auto";let r=e.getBoundingClientRect().height;e.style.height=t,oe(r),g(e=>e.find(e=>e.toastId===m.id)?e.map(e=>e.toastId===m.id?{...e,height:r}:e):[{toastId:m.id,height:r,position:m.position},...e])},[W,m.title,m.description,g,m.id]);let De=l.default.useCallback(()=>{K(!0),re(ge.current),g(e=>e.filter(e=>e.toastId!==m.id)),setTimeout(()=>{C(m)},200)},[m,C,g,ge]);return l.default.useEffect(()=>{if(m.promise&&"loading"===ue||m.duration===1/0||"loading"===m.type)return;let e;return _||y||B&&Ce?(()=>{if(be.current<ye.current){let e=(new Date).getTime()-ye.current;ae.current=ae.current-e}be.current=(new Date).getTime()})():ae.current!==1/0&&(ye.current=(new Date).getTime(),e=setTimeout(()=>{var e;null==(e=m.onAutoClose)||e.call(m,m),De()},ae.current)),()=>clearTimeout(e)},[_,y,m,ue,B,Ce,De]),l.default.useEffect(()=>{m.delete&&De()},[De,m.delete]),l.default.createElement("li",{tabIndex:0,ref:se,className:zDt(E,pe,null==I?void 0:I.toast,null==(r=null==m?void 0:m.classNames)?void 0:r.toast,null==I?void 0:I.default,null==I?void 0:I[ue],null==(n=null==m?void 0:m.classNames)?void 0:n[ue]),"data-sonner-toast":"","data-rich-colors":null!=(o=m.richColors)?o:M,"data-styled":!(m.jsx||m.unstyled||v),"data-mounted":W,"data-promise":!!m.promise,"data-swiped":J,"data-removed":G,"data-visible":ce,"data-y-position":we,"data-x-position":ke,"data-index":w,"data-front":le,"data-swiping":Y,"data-dismissible":de,"data-type":ue,"data-invert":Me,"data-swipe-out":Z,"data-swipe-direction":q,"data-expanded":!!(_||z&&W),style:{"--index":w,"--toasts-before":w,"--z-index":k.length-w,"--offset":`${G?te:ge.current}px`,"--initial-height":z?"auto":`${ne}px`,...D,...m.style},onDragEnd:()=>{X(!1),H(null),xe.current=null},onPointerDown:e=>{Se||!de||(ie.current=new Date,re(ge.current),e.target.setPointerCapture(e.pointerId),"BUTTON"!==e.target.tagName&&(X(!0),xe.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{var e,t,r,n;if(Z||!de)return;xe.current=null;let o=Number((null==(e=se.current)?void 0:e.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),a=Number((null==(t=se.current)?void 0:t.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),i=(new Date).getTime()-(null==(r=ie.current)?void 0:r.getTime()),s="x"===V?o:a,l=Math.abs(s)/i;if(Math.abs(s)>=20||l>.11)return re(ge.current),null==(n=m.onDismiss)||n.call(m,m),$("x"===V?o>0?"right":"left":a>0?"down":"up"),De(),Q(!0),void ee(!1);X(!1),H(null)},onPointerMove:e=>{var r,n,o,a;if(!xe.current||!de||(null==(r=window.getSelection())?void 0:r.toString().length)>0)return;let i=e.clientY-xe.current.y,s=e.clientX-xe.current.x,l=null!=(n=t.swipeDirections)?n:function(e){let[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}(N);!V&&(Math.abs(s)>1||Math.abs(i)>1)&&H(Math.abs(s)>Math.abs(i)?"x":"y");let c={x:0,y:0};"y"===V?(l.includes("top")||l.includes("bottom"))&&(l.includes("top")&&i<0||l.includes("bottom")&&i>0)&&(c.y=i):"x"===V&&(l.includes("left")||l.includes("right"))&&(l.includes("left")&&s<0||l.includes("right")&&s>0)&&(c.x=s),(Math.abs(c.x)>0||Math.abs(c.y)>0)&&ee(!0),null==(o=se.current)||o.style.setProperty("--swipe-amount-x",`${c.x}px`),null==(a=se.current)||a.style.setProperty("--swipe-amount-y",`${c.y}px`)}},me&&!m.jsx?l.default.createElement("button",{"aria-label":L,"data-disabled":Se,"data-close-button":!0,onClick:Se||!de?()=>{}:()=>{var e;De(),null==(e=m.onDismiss)||e.call(m,m)},className:zDt(null==I?void 0:I.closeButton,null==(a=null==m?void 0:m.classNames)?void 0:a.closeButton)},null!=(i=null==A?void 0:A.close)?i:DDt):null,m.jsx||e.isValidElement(m.title)?m.jsx?m.jsx:"function"==typeof m.title?m.title():m.title:l.default.createElement(l.default.Fragment,null,ue||m.icon||m.promise?l.default.createElement("div",{"data-icon":"",className:zDt(null==I?void 0:I.icon,null==(s=null==m?void 0:m.classNames)?void 0:s.icon)},m.promise||"loading"===m.type&&!m.icon?m.icon||(null!=A&&A.loading?l.default.createElement("div",{className:zDt(null==I?void 0:I.loader,null==(Oe=null==m?void 0:m.classNames)?void 0:Oe.loader,"sonner-loader"),"data-visible":"loading"===ue},A.loading):F?l.default.createElement("div",{className:zDt(null==I?void 0:I.loader,null==(Pe=null==m?void 0:m.classNames)?void 0:Pe.loader,"sonner-loader"),"data-visible":"loading"===ue},F):l.default.createElement(kDt,{className:zDt(null==I?void 0:I.loader,null==(Ee=null==m?void 0:m.classNames)?void 0:Ee.loader),visible:"loading"===ue})):null,"loading"!==m.type?m.icon||(null==A?void 0:A[ue])||(e=>{switch(e){case"success":return _Dt;case"info":return MDt;case"warning":return CDt;case"error":return SDt;default:return null}})(ue):null):null,l.default.createElement("div",{"data-content":"",className:zDt(null==I?void 0:I.content,null==(c=null==m?void 0:m.classNames)?void 0:c.content)},l.default.createElement("div",{"data-title":"",className:zDt(null==I?void 0:I.title,null==(u=null==m?void 0:m.classNames)?void 0:u.title)},"function"==typeof m.title?m.title():m.title),m.description?l.default.createElement("div",{"data-description":"",className:zDt(j,he,null==I?void 0:I.description,null==(d=null==m?void 0:m.classNames)?void 0:d.description)},"function"==typeof m.description?m.description():m.description):null),e.isValidElement(m.cancel)?m.cancel:m.cancel&&NDt(m.cancel)?l.default.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||O,onClick:e=>{var t,r;NDt(m.cancel)&&de&&(null==(r=(t=m.cancel).onClick)||r.call(t,e),De())},className:zDt(null==I?void 0:I.cancelButton,null==(p=null==m?void 0:m.classNames)?void 0:p.cancelButton)},m.cancel.label):null,e.isValidElement(m.action)?m.action:m.action&&NDt(m.action)?l.default.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||P,onClick:e=>{var t,r;NDt(m.action)&&(null==(r=(t=m.action).onClick)||r.call(t,e),!e.defaultPrevented&&De())},className:zDt(null==I?void 0:I.actionButton,null==(h=null==m?void 0:m.classNames)?void 0:h.actionButton)},m.action.label):null));var Oe,Pe,Ee};function ADt(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return"auto"!==e&&e?e:window.getComputedStyle(document.documentElement).direction}function LDt(e,t){let r={};return[e,t].forEach((e,t)=>{let n=1===t,o=n?"--mobile-offset":"--offset",a=n?"16px":"32px";function i(e){["top","right","bottom","left"].forEach(t=>{r[`${o}-${t}`]="number"==typeof e?`${e}px`:e})}"number"==typeof e||"string"==typeof e?i(e):"object"==typeof e?["top","right","bottom","left"].forEach(t=>{void 0===e[t]?r[`${o}-${t}`]=a:r[`${o}-${t}`]="number"==typeof e[t]?`${e[t]}px`:e[t]}):i(a)}),r}e.forwardRef(function(e,t){let{invert:r,position:n="bottom-right",hotkey:o=["altKey","KeyT"],expand:a,closeButton:i,className:s,offset:c,mobileOffset:d,theme:p="light",richColors:h,duration:f,style:m,visibleToasts:v=RDt,toastOptions:y,dir:g=ADt(),gap:b=FDt,loadingIcon:x,icons:w,containerAriaLabel:k="Notifications",pauseWhenPageIsHidden:_}=e,[C,M]=l.default.useState([]),S=l.default.useMemo(()=>Array.from(new Set([n].concat(C.filter(e=>e.position).map(e=>e.position)))),[C,n]),[D,O]=l.default.useState([]),[P,E]=l.default.useState(!1),[j,T]=l.default.useState(!1),[N,R]=l.default.useState("system"!==p?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),F=l.default.useRef(null),z=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),I=l.default.useRef(null),A=l.default.useRef(!1),L=l.default.useCallback(e=>{M(t=>{var r;return null!=(r=t.find(t=>t.id===e.id))&&r.delete||PDt.dismiss(e.id),t.filter(({id:t})=>t!==e.id)})},[]);return l.default.useEffect(()=>PDt.subscribe(e=>{e.dismiss?M(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t)):setTimeout(()=>{u.default.flushSync(()=>{M(t=>{let r=t.findIndex(t=>t.id===e.id);return-1!==r?[...t.slice(0,r),{...t[r],...e},...t.slice(r+1)]:[e,...t]})})})}),[]),l.default.useEffect(()=>{if("system"!==p)return void R(p);if("system"===p&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?R("dark"):R("light")),typeof window>"u")return;let e=window.matchMedia("(prefers-color-scheme: dark)");try{e.addEventListener("change",({matches:e})=>{R(e?"dark":"light")})}catch{e.addListener(({matches:e})=>{try{R(e?"dark":"light")}catch(e){console.error(e)}})}},[p]),l.default.useEffect(()=>{C.length<=1&&E(!1)},[C]),l.default.useEffect(()=>{let e=e=>{var t,r;o.every(t=>e[t]||e.code===t)&&(E(!0),null==(t=F.current)||t.focus()),"Escape"===e.code&&(document.activeElement===F.current||null!=(r=F.current)&&r.contains(document.activeElement))&&E(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[o]),l.default.useEffect(()=>{if(F.current)return()=>{I.current&&(I.current.focus({preventScroll:!0}),I.current=null,A.current=!1)}},[F.current]),l.default.createElement("section",{ref:t,"aria-label":`${k} ${z}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},S.map((t,n)=>{var o;let[u,p]=t.split("-");return C.length?l.default.createElement("ol",{key:t,dir:"auto"===g?ADt():g,tabIndex:-1,ref:F,className:s,"data-sonner-toaster":!0,"data-theme":N,"data-y-position":u,"data-lifted":P&&C.length>1&&!a,"data-x-position":p,style:{"--front-toast-height":`${(null==(o=D[0])?void 0:o.height)||0}px`,"--width":"356px","--gap":`${b}px`,...m,...LDt(c,d)},onBlur:e=>{A.current&&!e.currentTarget.contains(e.relatedTarget)&&(A.current=!1,I.current&&(I.current.focus({preventScroll:!0}),I.current=null))},onFocus:e=>{e.target instanceof HTMLElement&&"false"===e.target.dataset.dismissible||A.current||(A.current=!0,I.current=e.relatedTarget)},onMouseEnter:()=>E(!0),onMouseMove:()=>E(!0),onMouseLeave:()=>{j||E(!1)},onDragEnd:()=>E(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&"false"===e.target.dataset.dismissible||T(!0)},onPointerUp:()=>T(!1)},C.filter(e=>!e.position&&0===n||e.position===t).map((n,o)=>{var s,c;return l.default.createElement(IDt,{key:n.id,icons:w,index:o,toast:n,defaultRichColors:h,duration:null!=(s=null==y?void 0:y.duration)?s:f,className:null==y?void 0:y.className,descriptionClassName:null==y?void 0:y.descriptionClassName,invert:r,visibleToasts:v,closeButton:null!=(c=null==y?void 0:y.closeButton)?c:i,interacting:j,position:t,style:null==y?void 0:y.style,unstyled:null==y?void 0:y.unstyled,classNames:null==y?void 0:y.classNames,cancelButtonStyle:null==y?void 0:y.cancelButtonStyle,actionButtonStyle:null==y?void 0:y.actionButtonStyle,removeToast:L,toasts:C.filter(e=>e.position==n.position),heights:D.filter(e=>e.position==n.position),setHeights:O,expandByDefault:a,gap:b,loadingIcon:x,expanded:P,pauseWhenPageIsHidden:_,swipeDirections:e.swipeDirections})})):null}))});const BDt=({open:e,editType:r,onEditTypeChange:n,onConfirm:o,onClose:a,translations:i})=>t.jsx(apt,{open:e,children:t.jsxs(cpt,{className:"max-w-[425px]",children:[t.jsxs(upt,{children:[t.jsxs(ppt,{className:"flex items-center",children:[t.jsx(_st,{className:"mr-2 h-5 w-5 text-primary"}),i.editRecurringEventTitle]}),t.jsx(hpt,{className:"text-left",children:i.editRecurringEventDescription}),t.jsx("div",{className:"h-2"}),t.jsx("div",{className:"mt-4 space-y-4",children:t.jsx(ubt,{defaultValue:"all",value:r,onValueChange:e=>n(e),children:t.jsx("div",{className:"space-y-4",children:[{value:"single",label:i.editThisOccurrence,description:i.editThisOccurrenceDescription},{value:"future",label:i.editThisAndFuture,description:i.editThisAndFutureDescription},{value:"all",label:i.editAllOccurrences,description:i.editAllOccurrencesDescription}].map(e=>t.jsxs("div",{className:"flex space-x-4",children:[t.jsx(dbt,{value:e.value,id:`edit-${e.value}`}),t.jsxs(fmt,{htmlFor:`edit-${e.value}`,className:"flex flex-col flex-1 items-start cursor-pointer",children:[t.jsx("span",{className:"leading-none",children:e.label}),t.jsx("span",{className:"text-sm text-muted-foreground mt-1",children:e.description})]})]},e.value))})})}),t.jsx("div",{className:"h-2"})]}),t.jsxs(dpt,{children:[t.jsx(mpt,{onClick:a,children:i.cancel}),t.jsxs(fpt,{onClick:o,className:"w-full sm:w-auto",children:[t.jsx(_st,{className:"h-3 w-3 sm:h-4 sm:w-4 mr-1 sm:mr-2"}),i.save]})]})]})}),VDt=(e,t,r,n)=>{if(!n||!Yit(e,{start:t,end:r}))return!1;switch(n){case"daily":return!0;case"weekly":return qit(e)===qit(t);case"monthly":return e.getDate()===t.getDate();default:return!1}},HDt=e=>{if("string"!=typeof e||!e.includes("T"))return!1;const t=Zit(e);return!Number.isNaN(t.getTime())},qDt=e=>{if(HDt(e)){const t=Zit(e);return{hours:t.getUTCHours(),minutes:t.getUTCMinutes()}}const t=e.match(/^(\d{1,2}):(\d{2})(?::(\d{2}))?$/);if(t){return{hours:Math.min(23,Math.max(0,parseInt(t[1],10))),minutes:Math.min(59,Math.max(0,parseInt(t[2],10)))}}return{hours:0,minutes:0}},$Dt=(e,t)=>{const{hours:r,minutes:n}=qDt(t);return lst(sst(new Date(e),r),n)},WDt=e=>{const{hours:t,minutes:r}=qDt(e);return 60*t+r},UDt=(e,t)=>0===WDt(e)&&WDt(t)>=1439,GDt=e=>{const{hours:t,minutes:r}=qDt(e);return`${String(t).padStart(2,"0")}:${String(r).padStart(2,"0")}`};function KDt(e,[t,r]){return Math.min(r,Math.max(t,e))}var YDt=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"}),XDt=s.forwardRef((e,r)=>t.jsx(ult.span,{...e,ref:r,style:{...YDt,...e.style}}));XDt.displayName="VisuallyHidden";var ZDt=XDt,QDt=[" ","Enter","ArrowUp","ArrowDown"],JDt=[" ","Enter"],eOt="Select",[tOt,rOt,nOt]=ygt(eOt),[oOt,aOt]=Xst(eOt,[nOt,wyt]),iOt=wyt(),[sOt,lOt]=oOt(eOt),[cOt,uOt]=oOt(eOt),dOt=e=>{const{__scopeSelect:r,children:n,open:o,defaultOpen:a,onOpenChange:i,value:l,defaultValue:c,onValueChange:u,dir:d,name:p,autoComplete:h,disabled:f,required:m,form:v}=e,y=iOt(r),[g,b]=s.useState(null),[x,w]=s.useState(null),[k,_]=s.useState(!1),C=bgt(d),[M,S]=nlt({prop:o,defaultProp:a??!1,onChange:i,caller:eOt}),[D,O]=nlt({prop:l,defaultProp:c,onChange:u,caller:eOt}),P=s.useRef(null),E=!g||(v||!!g.closest("form")),[j,T]=s.useState(new Set),N=Array.from(j).map(e=>e.props.value).join(";");return t.jsx(Iyt,{...y,children:t.jsxs(sOt,{required:m,scope:r,trigger:g,onTriggerChange:b,valueNode:x,onValueNodeChange:w,valueNodeHasChildren:k,onValueNodeHasChildrenChange:_,contentId:tlt(),value:D,onValueChange:O,open:M,onOpenChange:S,dir:C,triggerPointerDownPosRef:P,disabled:f,children:[t.jsx(tOt.Provider,{scope:r,children:t.jsx(cOt,{scope:e.__scopeSelect,onNativeOptionAdd:s.useCallback(e=>{T(t=>new Set(t).add(e))},[]),onNativeOptionRemove:s.useCallback(e=>{T(t=>{const r=new Set(t);return r.delete(e),r})},[]),children:n})}),E?t.jsxs(JOt,{"aria-hidden":!0,required:m,tabIndex:-1,name:p,autoComplete:h,value:D,onChange:e=>O(e.target.value),disabled:f,form:v,children:[void 0===D?t.jsx("option",{value:""}):null,Array.from(j)]},N):null]})})};dOt.displayName=eOt;var pOt="SelectTrigger",hOt=s.forwardRef((e,r)=>{const{__scopeSelect:n,disabled:o=!1,...a}=e,i=iOt(n),l=lOt(pOt,n),c=l.disabled||o,u=Yst(r,l.onTriggerChange),d=rOt(n),p=s.useRef("touch"),[h,f,m]=tPt(e=>{const t=d().filter(e=>!e.disabled),r=t.find(e=>e.value===l.value),n=rPt(t,e,r);void 0!==n&&l.onValueChange(n.value)}),v=e=>{c||(l.onOpenChange(!0),m()),e&&(l.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return t.jsx(Ayt,{asChild:!0,...i,children:t.jsx(ult.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":ePt(l.value)?"":void 0,...a,ref:u,onClick:Ust(a.onClick,e=>{e.currentTarget.focus(),"mouse"!==p.current&&v(e)}),onPointerDown:Ust(a.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&&(v(e),e.preventDefault())}),onKeyDown:Ust(a.onKeyDown,e=>{const t=""!==h.current;!(e.ctrlKey||e.altKey||e.metaKey)&&1===e.key.length&&f(e.key),(!t||" "!==e.key)&&QDt.includes(e.key)&&(v(),e.preventDefault())})})})});hOt.displayName=pOt;var fOt="SelectValue",mOt=s.forwardRef((e,r)=>{const{__scopeSelect:n,className:o,style:a,children:i,placeholder:s="",...l}=e,c=lOt(fOt,n),{onValueNodeHasChildrenChange:u}=c,d=void 0!==i,p=Yst(r,c.onValueNodeChange);return Qst(()=>{u(d)},[u,d]),t.jsx(ult.span,{...l,ref:p,style:{pointerEvents:"none"},children:ePt(c.value)?t.jsx(t.Fragment,{children:s}):i})});mOt.displayName=fOt;var vOt=s.forwardRef((e,r)=>{const{__scopeSelect:n,children:o,...a}=e;return t.jsx(ult.span,{"aria-hidden":!0,...a,ref:r,children:o||"▼"})});vOt.displayName="SelectIcon";var yOt=e=>t.jsx(Tlt,{asChild:!0,...e});yOt.displayName="SelectPortal";var gOt="SelectContent",bOt=s.forwardRef((e,r)=>{const n=lOt(gOt,e.__scopeSelect),[o,a]=s.useState();if(Qst(()=>{a(new DocumentFragment)},[]),!n.open){const r=o;return r?d.createPortal(t.jsx(wOt,{scope:e.__scopeSelect,children:t.jsx(tOt.Slot,{scope:e.__scopeSelect,children:t.jsx("div",{children:e.children})})}),r):null}return t.jsx(COt,{...e,ref:r})});bOt.displayName=gOt;var xOt=10,[wOt,kOt]=oOt(gOt),_Ot=olt("SelectContent.RemoveScroll"),COt=s.forwardRef((e,r)=>{const{__scopeSelect:n,position:o="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:i,onPointerDownOutside:l,side:c,sideOffset:u,align:d,alignOffset:p,arrowPadding:h,collisionBoundary:f,collisionPadding:m,sticky:v,hideWhenDetached:y,avoidCollisions:g,...b}=e,x=lOt(gOt,n),[w,k]=s.useState(null),[_,C]=s.useState(null),M=Yst(r,e=>k(e)),[S,D]=s.useState(null),[O,P]=s.useState(null),E=rOt(n),[j,T]=s.useState(!1),N=s.useRef(!1);s.useEffect(()=>{if(w)return Nct(w)},[w]),zlt();const R=s.useCallback(e=>{const[t,...r]=E().map(e=>e.ref.current),[n]=r.slice(-1),o=document.activeElement;for(const r of e)if(r===o||(null==r||r.scrollIntoView({block:"nearest"}),r===t&&_&&(_.scrollTop=0),r===n&&_&&(_.scrollTop=_.scrollHeight),null==r||r.focus(),document.activeElement!==o))return},[E,_]),F=s.useCallback(()=>R([S,w]),[R,S,w]);s.useEffect(()=>{j&&F()},[j,F]);const{onOpenChange:z,triggerPointerDownPosRef:I}=x;s.useEffect(()=>{if(w){let e={x:0,y:0};const t=t=>{var r,n;e={x:Math.abs(Math.round(t.pageX)-((null==(r=I.current)?void 0:r.x)??0)),y:Math.abs(Math.round(t.pageY)-((null==(n=I.current)?void 0:n.y)??0))}},r=r=>{e.x<=10&&e.y<=10?r.preventDefault():w.contains(r.target)||z(!1),document.removeEventListener("pointermove",t),I.current=null};return null!==I.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",r,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",r,{capture:!0})}}},[w,z,I]),s.useEffect(()=>{const e=()=>z(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[z]);const[A,L]=tPt(e=>{const t=E().filter(e=>!e.disabled),r=t.find(e=>e.ref.current===document.activeElement),n=rPt(t,e,r);n&&setTimeout(()=>n.ref.current.focus())}),B=s.useCallback((e,t,r)=>{const n=!N.current&&!r;(void 0!==x.value&&x.value===t||n)&&(D(e),n&&(N.current=!0))},[x.value]),V=s.useCallback(()=>null==w?void 0:w.focus(),[w]),H=s.useCallback((e,t,r)=>{const n=!N.current&&!r;(void 0!==x.value&&x.value===t||n)&&P(e)},[x.value]),q="popper"===o?SOt:MOt,$=q===SOt?{side:c,sideOffset:u,align:d,alignOffset:p,arrowPadding:h,collisionBoundary:f,collisionPadding:m,sticky:v,hideWhenDetached:y,avoidCollisions:g}:{};return t.jsx(wOt,{scope:n,content:w,viewport:_,onViewportChange:C,itemRefCallback:B,selectedItem:S,onItemLeave:V,itemTextRefCallback:H,focusSelectedItem:F,selectedItemText:O,position:o,isPositioned:j,searchRef:A,children:t.jsx(Sct,{as:_Ot,allowPinchZoom:!0,children:t.jsx(Mlt,{asChild:!0,trapped:x.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:Ust(a,e=>{var t;null==(t=x.trigger)||t.focus({preventScroll:!0}),e.preventDefault()}),children:t.jsx(glt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:t.jsx(q,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:e=>e.preventDefault(),...b,...$,onPlaced:()=>T(!0),ref:M,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:Ust(b.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),!t&&1===e.key.length&&L(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=E().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(()=>R(t)),e.preventDefault()}})})})})})})});COt.displayName="SelectContentImpl";var MOt=s.forwardRef((e,r)=>{const{__scopeSelect:n,onPlaced:o,...a}=e,i=lOt(gOt,n),l=kOt(gOt,n),[c,u]=s.useState(null),[d,p]=s.useState(null),h=Yst(r,e=>p(e)),f=rOt(n),m=s.useRef(!1),v=s.useRef(!0),{viewport:y,selectedItem:g,selectedItemText:b,focusSelectedItem:x}=l,w=s.useCallback(()=>{if(i.trigger&&i.valueNode&&c&&d&&y&&g&&b){const e=i.trigger.getBoundingClientRect(),t=d.getBoundingClientRect(),r=i.valueNode.getBoundingClientRect(),n=b.getBoundingClientRect();if("rtl"!==i.dir){const o=n.left-t.left,a=r.left-o,i=e.left-a,s=e.width+i,l=Math.max(s,t.width),u=window.innerWidth-xOt,d=KDt(a,[xOt,Math.max(xOt,u-l)]);c.style.minWidth=s+"px",c.style.left=d+"px"}else{const o=t.right-n.right,a=window.innerWidth-r.right-o,i=window.innerWidth-e.right-a,s=e.width+i,l=Math.max(s,t.width),u=window.innerWidth-xOt,d=KDt(a,[xOt,Math.max(xOt,u-l)]);c.style.minWidth=s+"px",c.style.right=d+"px"}const a=f(),s=window.innerHeight-2*xOt,l=y.scrollHeight,u=window.getComputedStyle(d),p=parseInt(u.borderTopWidth,10),h=parseInt(u.paddingTop,10),v=parseInt(u.borderBottomWidth,10),x=p+h+l+parseInt(u.paddingBottom,10)+v,w=Math.min(5*g.offsetHeight,x),k=window.getComputedStyle(y),_=parseInt(k.paddingTop,10),C=parseInt(k.paddingBottom,10),M=e.top+e.height/2-xOt,S=s-M,D=g.offsetHeight/2,O=p+h+(g.offsetTop+D),P=x-O;if(O<=M){const e=a.length>0&&g===a[a.length-1].ref.current;c.style.bottom="0px";const t=d.clientHeight-y.offsetTop-y.offsetHeight,r=O+Math.max(S,D+(e?C:0)+t+v);c.style.height=r+"px"}else{const e=a.length>0&&g===a[0].ref.current;c.style.top="0px";const t=Math.max(M,p+y.offsetTop+(e?_:0)+D)+P;c.style.height=t+"px",y.scrollTop=O-M+y.offsetTop}c.style.margin=`${xOt}px 0`,c.style.minHeight=w+"px",c.style.maxHeight=s+"px",null==o||o(),requestAnimationFrame(()=>m.current=!0)}},[f,i.trigger,i.valueNode,c,d,y,g,b,i.dir,o]);Qst(()=>w(),[w]);const[k,_]=s.useState();Qst(()=>{d&&_(window.getComputedStyle(d).zIndex)},[d]);const C=s.useCallback(e=>{e&&!0===v.current&&(w(),null==x||x(),v.current=!1)},[w,x]);return t.jsx(DOt,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:m,onScrollButtonChange:C,children:t.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:t.jsx(ult.div,{...a,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});MOt.displayName="SelectItemAlignedPosition";var SOt=s.forwardRef((e,r)=>{const{__scopeSelect:n,align:o="start",collisionPadding:a=xOt,...i}=e,s=iOt(n);return t.jsx(Lyt,{...s,...i,ref:r,align:o,collisionPadding:a,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)"}})});SOt.displayName="SelectPopperPosition";var[DOt,OOt]=oOt(gOt,{}),POt="SelectViewport",EOt=s.forwardRef((e,r)=>{const{__scopeSelect:n,nonce:o,...a}=e,i=kOt(POt,n),l=OOt(POt,n),c=Yst(r,i.onViewportChange),u=s.useRef(0);return t.jsxs(t.Fragment,{children:[t.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),t.jsx(tOt.Slot,{scope:n,children:t.jsx(ult.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:Ust(a.onScroll,e=>{const t=e.currentTarget,{contentWrapper:r,shouldExpandOnScrollRef:n}=l;if(null!=n&&n.current&&r){const e=Math.abs(u.current-t.scrollTop);if(e>0){const n=window.innerHeight-2*xOt,o=parseFloat(r.style.minHeight),a=parseFloat(r.style.height),i=Math.max(o,a);if(i<n){const o=i+e,a=Math.min(n,o),s=o-a;r.style.height=a+"px","0px"===r.style.bottom&&(t.scrollTop=s>0?s:0,r.style.justifyContent="flex-end")}}}u.current=t.scrollTop})})})]})});EOt.displayName=POt;var jOt="SelectGroup",[TOt,NOt]=oOt(jOt),ROt=s.forwardRef((e,r)=>{const{__scopeSelect:n,...o}=e,a=tlt();return t.jsx(TOt,{scope:n,id:a,children:t.jsx(ult.div,{role:"group","aria-labelledby":a,...o,ref:r})})});ROt.displayName=jOt;var FOt="SelectLabel",zOt=s.forwardRef((e,r)=>{const{__scopeSelect:n,...o}=e,a=NOt(FOt,n);return t.jsx(ult.div,{id:a.id,...o,ref:r})});zOt.displayName=FOt;var IOt="SelectItem",[AOt,LOt]=oOt(IOt),BOt=s.forwardRef((e,r)=>{const{__scopeSelect:n,value:o,disabled:a=!1,textValue:i,...l}=e,c=lOt(IOt,n),u=kOt(IOt,n),d=c.value===o,[p,h]=s.useState(i??""),[f,m]=s.useState(!1),v=Yst(r,e=>{var t;return null==(t=u.itemRefCallback)?void 0:t.call(u,e,o,a)}),y=tlt(),g=s.useRef("touch"),b=()=>{a||(c.onValueChange(o),c.onOpenChange(!1))};if(""===o)throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return t.jsx(AOt,{scope:n,value:o,disabled:a,textId:y,isSelected:d,onItemTextChange:s.useCallback(e=>{h(t=>t||((null==e?void 0:e.textContent)??"").trim())},[]),children:t.jsx(tOt.ItemSlot,{scope:n,value:o,disabled:a,textValue:p,children:t.jsx(ult.div,{role:"option","aria-labelledby":y,"data-highlighted":f?"":void 0,"aria-selected":d&&f,"data-state":d?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...l,ref:v,onFocus:Ust(l.onFocus,()=>m(!0)),onBlur:Ust(l.onBlur,()=>m(!1)),onClick:Ust(l.onClick,()=>{"mouse"!==g.current&&b()}),onPointerUp:Ust(l.onPointerUp,()=>{"mouse"===g.current&&b()}),onPointerDown:Ust(l.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:Ust(l.onPointerMove,e=>{var t;g.current=e.pointerType,a?null==(t=u.onItemLeave)||t.call(u):"mouse"===g.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ust(l.onPointerLeave,e=>{var t;e.currentTarget===document.activeElement&&(null==(t=u.onItemLeave)||t.call(u))}),onKeyDown:Ust(l.onKeyDown,e=>{var t;""!==(null==(t=u.searchRef)?void 0:t.current)&&" "===e.key||(JDt.includes(e.key)&&b()," "===e.key&&e.preventDefault())})})})})});BOt.displayName=IOt;var VOt="SelectItemText",HOt=s.forwardRef((e,r)=>{const{__scopeSelect:n,className:o,style:a,...i}=e,l=lOt(VOt,n),c=kOt(VOt,n),u=LOt(VOt,n),p=uOt(VOt,n),[h,f]=s.useState(null),m=Yst(r,e=>f(e),u.onItemTextChange,e=>{var t;return null==(t=c.itemTextRefCallback)?void 0:t.call(c,e,u.value,u.disabled)}),v=null==h?void 0:h.textContent,y=s.useMemo(()=>t.jsx("option",{value:u.value,disabled:u.disabled,children:v},u.value),[u.disabled,u.value,v]),{onNativeOptionAdd:g,onNativeOptionRemove:b}=p;return Qst(()=>(g(y),()=>b(y)),[g,b,y]),t.jsxs(t.Fragment,{children:[t.jsx(ult.span,{id:u.textId,...i,ref:m}),u.isSelected&&l.valueNode&&!l.valueNodeHasChildren?d.createPortal(i.children,l.valueNode):null]})});HOt.displayName=VOt;var qOt="SelectItemIndicator",$Ot=s.forwardRef((e,r)=>{const{__scopeSelect:n,...o}=e;return LOt(qOt,n).isSelected?t.jsx(ult.span,{"aria-hidden":!0,...o,ref:r}):null});$Ot.displayName=qOt;var WOt="SelectScrollUpButton",UOt=s.forwardRef((e,r)=>{const n=kOt(WOt,e.__scopeSelect),o=OOt(WOt,e.__scopeSelect),[a,i]=s.useState(!1),l=Yst(r,o.onScrollButtonChange);return Qst(()=>{if(n.viewport&&n.isPositioned){let e=function(){const e=t.scrollTop>0;i(e)};const t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),a?t.jsx(YOt,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});UOt.displayName=WOt;var GOt="SelectScrollDownButton",KOt=s.forwardRef((e,r)=>{const n=kOt(GOt,e.__scopeSelect),o=OOt(GOt,e.__scopeSelect),[a,i]=s.useState(!1),l=Yst(r,o.onScrollButtonChange);return Qst(()=>{if(n.viewport&&n.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,r=Math.ceil(t.scrollTop)<e;i(r)};const t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),a?t.jsx(YOt,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});KOt.displayName=GOt;var YOt=s.forwardRef((e,r)=>{const{__scopeSelect:n,onAutoScroll:o,...a}=e,i=kOt("SelectScrollButton",n),l=s.useRef(null),c=rOt(n),u=s.useCallback(()=>{null!==l.current&&(window.clearInterval(l.current),l.current=null)},[]);return s.useEffect(()=>()=>u(),[u]),Qst(()=>{var e;const t=c().find(e=>e.ref.current===document.activeElement);null==(e=null==t?void 0:t.ref.current)||e.scrollIntoView({block:"nearest"})},[c]),t.jsx(ult.div,{"aria-hidden":!0,...a,ref:r,style:{flexShrink:0,...a.style},onPointerDown:Ust(a.onPointerDown,()=>{null===l.current&&(l.current=window.setInterval(o,50))}),onPointerMove:Ust(a.onPointerMove,()=>{var e;null==(e=i.onItemLeave)||e.call(i),null===l.current&&(l.current=window.setInterval(o,50))}),onPointerLeave:Ust(a.onPointerLeave,()=>{u()})})}),XOt=s.forwardRef((e,r)=>{const{__scopeSelect:n,...o}=e;return t.jsx(ult.div,{"aria-hidden":!0,...o,ref:r})});XOt.displayName="SelectSeparator";var ZOt="SelectArrow",QOt=s.forwardRef((e,r)=>{const{__scopeSelect:n,...o}=e,a=iOt(n),i=lOt(ZOt,n),s=kOt(ZOt,n);return i.open&&"popper"===s.position?t.jsx(Byt,{...a,...o,ref:r}):null});QOt.displayName=ZOt;var JOt=s.forwardRef(({__scopeSelect:e,value:r,...n},o)=>{const a=s.useRef(null),i=Yst(o,a),l=Agt(r);return s.useEffect(()=>{const e=a.current;if(!e)return;const t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,"value").set;if(l!==r&&n){const t=new Event("change",{bubbles:!0});n.call(e,r),e.dispatchEvent(t)}},[l,r]),t.jsx(ult.select,{...n,style:{...YDt,...n.style},ref:i,defaultValue:r})});function ePt(e){return""===e||void 0===e}function tPt(e){const t=plt(e),r=s.useRef(""),n=s.useRef(0),o=s.useCallback(e=>{const o=r.current+e;t(o),function e(t){r.current=t,window.clearTimeout(n.current),""!==t&&(n.current=window.setTimeout(()=>e(""),1e3))}(o)},[t]),a=s.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return s.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,a]}function rPt(e,t,r){const n=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let a=function(e,t){return e.map((r,n)=>e[(t+n)%e.length])}(e,Math.max(o,0));1===n.length&&(a=a.filter(e=>e!==r));const i=a.find(e=>e.textValue.toLowerCase().startsWith(n.toLowerCase()));return i!==r?i:void 0}JOt.displayName="SelectBubbleInput";var nPt=hOt,oPt=vOt,aPt=yOt,iPt=bOt,sPt=EOt,lPt=zOt,cPt=BOt,uPt=HOt,dPt=$Ot,pPt=UOt,hPt=KOt,fPt=XOt;const mPt=dOt,vPt=mOt,yPt=s.forwardRef(({className:e,children:r,...n},o)=>t.jsxs(nPt,{ref:o,className:vdt("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[r,t.jsx(oPt,{asChild:!0,children:t.jsx(Dst,{className:"h-4 w-4 opacity-50"})})]}));yPt.displayName=nPt.displayName;const gPt=s.forwardRef(({className:e,...r},n)=>t.jsx(pPt,{ref:n,className:vdt("flex cursor-default items-center justify-center py-1",e),...r,children:t.jsx(Est,{className:"h-4 w-4"})}));gPt.displayName=pPt.displayName;const bPt=s.forwardRef(({className:e,...r},n)=>t.jsx(hPt,{ref:n,className:vdt("flex cursor-default items-center justify-center py-1",e),...r,children:t.jsx(Dst,{className:"h-4 w-4"})}));bPt.displayName=hPt.displayName;const xPt=s.forwardRef(({className:e,children:r,position:n="popper",...o},a)=>t.jsx(aPt,{children:t.jsxs(iPt,{ref:a,className:vdt("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","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",e),position:n,...o,children:[t.jsx(gPt,{}),t.jsx(sPt,{className:vdt("p-1","popper"===n&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r}),t.jsx(bPt,{})]})}));xPt.displayName=iPt.displayName;const wPt=s.forwardRef(({className:e,...r},n)=>t.jsx(lPt,{ref:n,className:vdt("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...r}));wPt.displayName=lPt.displayName;const kPt=s.forwardRef(({className:e,children:r,...n},o)=>t.jsxs(cPt,{ref:o,className:vdt("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(dPt,{children:t.jsx(Sst,{className:"h-4 w-4"})})}),t.jsx(uPt,{children:r})]}));kPt.displayName=cPt.displayName;const _Pt=s.forwardRef(({className:e,...r},n)=>t.jsx(fPt,{ref:n,className:vdt("-mx-1 my-1 h-px bg-muted",e),...r}));_Pt.displayName=fPt.displayName;var CPt="Switch",[MPt,SPt]=Xst(CPt),[DPt,OPt]=MPt(CPt),PPt=s.forwardRef((e,r)=>{const{__scopeSwitch:n,name:o,checked:a,defaultChecked:i,required:l,disabled:c,value:u="on",onCheckedChange:d,form:p,...h}=e,[f,m]=s.useState(null),v=Yst(r,e=>m(e)),y=s.useRef(!1),g=!f||(p||!!f.closest("form")),[b,x]=nlt({prop:a,defaultProp:i??!1,onChange:d,caller:CPt});return t.jsxs(DPt,{scope:n,checked:b,disabled:c,children:[t.jsx(ult.button,{type:"button",role:"switch","aria-checked":b,"aria-required":l,"data-state":NPt(b),"data-disabled":c?"":void 0,disabled:c,value:u,...h,ref:v,onClick:Ust(e.onClick,e=>{x(e=>!e),g&&(y.current=e.isPropagationStopped(),y.current||e.stopPropagation())})}),g&&t.jsx(TPt,{control:f,bubbles:!y.current,name:o,value:u,checked:b,required:l,disabled:c,form:p,style:{transform:"translateX(-100%)"}})]})});PPt.displayName=CPt;var EPt="SwitchThumb",jPt=s.forwardRef((e,r)=>{const{__scopeSwitch:n,...o}=e,a=OPt(EPt,n);return t.jsx(ult.span,{"data-state":NPt(a.checked),"data-disabled":a.disabled?"":void 0,...o,ref:r})});jPt.displayName=EPt;var TPt=s.forwardRef(({__scopeSwitch:e,control:r,checked:n,bubbles:o=!0,...a},i)=>{const l=s.useRef(null),c=Yst(l,i),u=Agt(n),d=gyt(r);return s.useEffect(()=>{const e=l.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:o});r.call(e,n),e.dispatchEvent(t)}},[u,n,o]),t.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...a,tabIndex:-1,ref:c,style:{...a.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function NPt(e){return e?"checked":"unchecked"}TPt.displayName="SwitchBubbleInput";var RPt=PPt,FPt=jPt;const zPt=s.forwardRef(({className:e,...r},n)=>t.jsx(RPt,{className:vdt("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...r,ref:n,children:t.jsx(FPt,{className:vdt("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));zPt.displayName=RPt.displayName;const IPt=({field:r,form:n,translations:o})=>{const[a,i]=e.useState(0),[s,l]=e.useState(""),[c,u]=e.useState({}),d=n.getValues("startDate"),p=n.getValues("endDate"),h=n.getValues("isRepeatingInterval")||"daily",f=eit({start:d,end:p}).filter(e=>{const t=h;return"daily"===t||("weekly"===t?e.getDay()===d.getDay():"monthly"===t&&e.getDate()===d.getDate())}),m=r.value||[],v=m.filter(e=>f.some(t=>Gat(e,t)));m.length!==v.length&&setTimeout(()=>{r.onChange(v)},0);const y=e=>e.length>=f.length;if("daily"===h)return t.jsx(Bht,{mode:"multiple",selected:r.value||[],onSelect:e=>{e&&y(e)?TDt.error(o.errorCannotExcludeAllDates||"Cannot exclude all dates in the range"):r.onChange(e||[])},fromDate:d,toDate:p,defaultMonth:d,className:"rounded-md border"});const g=f.reduce((e,t)=>{const r=Vit(t,"yyyy-MM");return e[r]||(e[r]=[]),e[r].push(t),e},{}),b=Object.entries(g).sort(([e],[t])=>e.localeCompare(t));if(0===Object.keys(c).length&&b.length>0){const e={};b.forEach(([t],r)=>{e[t]=0===r}),u(e)}const x=""===s.trim()?b:b.filter(e=>{const t=e[1][0];return`${o.monthNames[t.getMonth()]} ${Vit(t,"yyyy")}`.toLowerCase().includes(s.toLowerCase())}),w=Math.ceil(x.length/2),k=x.slice(2*a,2*(a+1));return t.jsxs("div",{className:"rounded-md p-1 w-[300px] overflow-y-auto",children:[t.jsx("div",{className:"text-center font-medium mb-2 text-sm",children:"weekly"===h?o.weeklyIntervalLabel.replace("{dayName}",o.fullDayNames[d.getDay()]).replace("{startDate}",`${Vit(d,"dd")} ${o.monthNames[d.getMonth()].slice(0,3)}`).replace("{endDate}",`${Vit(p,"dd")} ${o.monthNames[p.getMonth()].slice(0,3)} ${Vit(p,"yyyy")}`):o.monthlyIntervalLabel.replace("{dayOfMonth}",Vit(d,"do")).replace("{startDate}",o.monthNames[d.getMonth()].slice(0,3)).replace("{endDate}",`${o.monthNames[p.getMonth()].slice(0,3)} ${Vit(p,"yyyy")}`)}),t.jsxs("div",{className:"flex gap-2 mb-2",children:[t.jsx("div",{className:"flex-grow",children:t.jsx(Mmt,{type:"text",placeholder:o.searchMonthPlaceholder,value:s,onChange:e=>{l(e.target.value),i(0)},className:"h-7 text-xs"})}),x.length>0&&t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(Edt,{type:"button",variant:"outline",size:"sm",className:"h-7 w-7 p-0",onClick:()=>{i(e=>Math.max(e-1,0))},disabled:0===a,children:"←"}),t.jsxs("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:[a+1,"/",Math.max(1,w)]}),t.jsx(Edt,{type:"button",variant:"outline",size:"sm",className:"h-7 w-7 p-0",onClick:()=>{i(e=>Math.min(e+1,w-1))},disabled:a>=w-1,children:"→"})]})]}),0===f.length?t.jsx("div",{className:"text-center text-muted-foreground py-1 text-xs",children:o.noMatchingDates}):0===x.length?t.jsx("div",{className:"text-center text-muted-foreground py-1 text-xs",children:o.noSearchResults.replace("{query}",s)}):t.jsx("div",{children:k.map(([e,n])=>{const a=n[0],i=`${o.monthNames[a.getMonth()]} ${Vit(a,"yyyy")}`,s=c[e],l=n.filter(e=>v.some(t=>Gat(t,e))).length;return t.jsxs("div",{className:"mb-2 border rounded-md overflow-hidden",children:[t.jsxs("div",{className:"py-1 px-2 bg-muted flex justify-between items-center cursor-pointer text-xs",onClick:()=>(e=>{u(t=>({...t,[e]:!t[e]}))})(e),children:[t.jsxs("div",{className:"flex items-center",children:[t.jsx("span",{className:"mr-1 flex items-center justify-center w-4",children:s?t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:t.jsx("path",{d:"m6 9 6 6 6-6"})}):t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:t.jsx("path",{d:"m9 18 6-6-6-6"})})}),t.jsx("span",{className:"font-medium",children:i}),t.jsx("span",{className:"ml-1 text-muted-foreground",children:o.ofExcluded.replace("{count}",l.toString()).replace("{total}",n.length.toString())})]}),t.jsxs("div",{className:"flex gap-1",children:[t.jsx(Edt,{type:"button",variant:"outline",size:"sm",className:"h-5 text-[10px] px-1",onClick:e=>{e.stopPropagation(),(e=>{const t=v,n=e.filter(e=>!t.some(t=>Gat(t,e))),a=[...t,...n];y(a)?TDt.error(o.errorCannotExcludeAllDates||"Cannot exclude all dates in the range"):r.onChange(a)})(n)},children:o.selectAll}),t.jsx(Edt,{type:"button",variant:"outline",size:"sm",className:"h-5 text-[10px] px-1",onClick:e=>{e.stopPropagation(),(e=>{const t=v.filter(t=>!e.some(e=>Gat(e,t)));r.onChange(t)})(n)},disabled:0===l,children:o.clearAll})]})]}),s&&t.jsx("div",{className:"p-1 flex flex-wrap gap-1 bg-background",children:n.map(e=>{const n=v.some(t=>Gat(t,e));return t.jsx(Edt,{type:"button",variant:n?"default":"outline",className:"h-6 px-1 text-[10px]",onClick:()=>{const t=v;if(n)r.onChange(t.filter(t=>!Gat(t,e)));else{const n=[...t,e];if(y(n))return void TDt.error(o.errorCannotExcludeAllDates||"Cannot exclude all dates in the range");r.onChange(n)}},children:Vit(e,o.dateButtonFormat)},e.toISOString())})})]},e)})})]})},APt=({form:r,translations:n,showRepeatToggle:o})=>{const[a,i]=e.useState(!1);e.useState(()=>{const e=r.getValues("isRepeatingExcludedDates");e&&e.length>0&&i(!0)});return o?t.jsx(xDt.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.3},children:t.jsxs(xmt,{className:"flex flex-col rounded-lg border p-4 space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsxs(wmt,{className:"text-base flex items-center cursor-pointer",children:[t.jsx(Cst,{className:"mr-2 h-4 w-4 flex-shrink-0"}),t.jsx("span",{className:"leading-tight",children:n.repeatingEventQuestion})]}),t.jsx(Tbt,{mode:"wait",children:r.watch("isRepeating")&&t.jsx(xDt.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},transition:{duration:.2,ease:"easeInOut"},children:t.jsx(_mt,{className:"text-xs leading-normal max-w-[90%]",children:((e,t,r,o,a,i)=>{const s=e=>Vit(e,"MMM d"),l=n.fullDayNames[e.getDay()],c="enUS"===n.language?Vit(e,"do"):e.getDate().toString(),u=s(e),d=Kit(e,t)?s(t):Vit(t,"MMM d, yyyy"),p=`${GDt(r)} - ${GDt(o)}`;let h="";switch(a||"daily"){case"daily":h=n.repeatDailyDescription.replace("{timeRange}",p).replace("{startDate}",u).replace("{endDate}",d);break;case"weekly":h=n.repeatWeeklyDescription.replace("{dayName}",l).replace("{timeRange}",p).replace("{startDate}",u).replace("{endDate}",d);break;case"monthly":h=n.repeatMonthlyDescription.replace("{dayOfMonth}",c).replace("{timeRange}",p).replace("{startDate}",u).replace("{endDate}",d)}if(i&&i.length>0){const e=i.length;h+=` (${n.withExcludedDates.replace("{count}",e.toString()).replace("{s}",e>1?"s":"")})`}return h})(r.watch("startDate"),r.watch("endDate"),r.watch("startTime"),r.watch("endTime"),r.watch("isRepeatingInterval"),r.watch("isRepeatingExcludedDates"))})})})]}),t.jsx(ymt,{control:r.control,name:"isRepeating",render:({field:e})=>t.jsx(kmt,{children:t.jsx(zPt,{checked:e.value,onCheckedChange:t=>{e.onChange(t),t||(i(!1),r.setValue("isRepeatingExcludedDates",[]))},className:"flex-shrink-0"})})})]}),t.jsx(Tbt,{children:r.watch("isRepeating")&&t.jsx(xDt.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.15},children:t.jsxs("div",{className:"space-y-4",children:[t.jsx(ymt,{control:r.control,name:"isRepeatingInterval",render:({field:e})=>t.jsxs(mPt,{onValueChange:t=>{t!==e.value&&(r.setValue("isRepeatingExcludedDates",[]),i(!1)),e.onChange(t)},value:e.value||"daily",children:[t.jsx(kmt,{children:t.jsx(yPt,{className:"w-full",children:t.jsx(vPt,{})})}),t.jsxs(xPt,{children:[t.jsx(kPt,{value:"daily",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx(wst,{className:"mr-2 h-4 w-4"}),n.repeatDaily]})}),t.jsx(kPt,{value:"weekly",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx(Cst,{className:"mr-2 h-4 w-4"}),n.repeatWeekly]})}),t.jsx(kPt,{value:"monthly",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx(kst,{className:"mr-2 h-4 w-4"}),n.repeatMonthly]})})]})]})}),t.jsxs("div",{className:"flex items-center justify-between mt-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsxs(wmt,{className:"flex items-center text-sm cursor-pointer",children:[t.jsx(jst,{className:"mr-2 h-3 w-3"}),n.excludedDates]}),t.jsx(_mt,{className:"text-xs",children:n.excludedDatesDescription})]}),t.jsx(zPt,{checked:a,onCheckedChange:e=>{i(e),e||r.setValue("isRepeatingExcludedDates",[])},className:"flex-shrink-0"})]}),t.jsx(Tbt,{children:a&&t.jsx(xDt.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.05,ease:"easeInOut"},className:"mt-4",children:t.jsx(ymt,{control:r.control,name:"isRepeatingExcludedDates",render:({field:e})=>t.jsx(xmt,{children:t.jsxs("div",{className:"space-y-4",children:[t.jsxs(fgt,{children:[t.jsx(mgt,{asChild:!0,children:t.jsxs(Edt,{variant:"outline",className:"w-full justify-start text-left font-normal text-sm h-9",type:"button",children:[t.jsx(kst,{className:"mr-2 h-4 w-4"}),n.selectDatesToExclude]})}),t.jsx(vgt,{className:"w-auto p-0 max-w-[320px]",align:"start",children:t.jsx(IPt,{field:e,form:r,translations:n})})]}),t.jsx(Tbt,{children:"daily"===r.watch("isRepeatingInterval")&&t.jsxs(xDt.div,{initial:{opacity:0,height:0,overflow:"hidden"},animate:{opacity:1,height:"auto",overflow:"visible"},exit:{opacity:0,height:0,overflow:"hidden"},transition:{duration:.015,ease:"easeInOut"},className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsx(_mt,{className:"text-xs mb-0",children:n.skipDays}),t.jsx(Edt,{type:"button",variant:"destructive",size:"sm",className:"text-xs h-5 mr-3",disabled:!((r.watch("isRepeatingExcludedDates")||[]).length>0),onClick:()=>{r.setValue("isRepeatingExcludedDates",[])},children:n.clearAll})]}),t.jsx("div",{children:t.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:n.dayNames.map((e,o)=>{const a=o,i=r.watch("isRepeatingExcludedDates")||[],s=eit({start:r.getValues("startDate"),end:r.getValues("endDate")}).filter(e=>e.getDay()===a),l=s.length>0,c=l&&s.every(e=>i.some(t=>Gat(t,e)));return t.jsx(Edt,{type:"button",variant:c?"default":"outline",size:"sm",className:vdt("w-8 h-8 p-0 text-center flex items-center justify-center",0===a||6===a?"font-medium":"",l?"":"opacity-50 cursor-not-allowed"),disabled:!l,onClick:()=>{if(!l)return;const e=r.getValues("startDate"),t=r.getValues("endDate"),o=eit({start:e,end:t}),i=o.filter(e=>e.getDay()===a);let s=[...r.getValues("isRepeatingExcludedDates")||[]];if(c)s=s.filter(e=>!i.some(t=>Gat(t,e)));else{i.forEach(e=>{s.some(t=>Gat(t,e))||s.push(e)});const r="daily",a=o.filter(n=>VDt(n,e,t,r));if(s.length>=a.length)return void TDt.error(n.errorCannotExcludeAllDates)}r.setValue("isRepeatingExcludedDates",s)},children:e.charAt(0)},o)})})})]})}),e.value&&e.value.length>0&&t.jsx("div",{className:"flex flex-wrap gap-1 mt-2",children:e.value.map((r,n)=>t.jsxs(xDt.div,{className:"bg-secondary text-secondary-foreground rounded-md px-2 py-1 text-xs flex items-center",initial:{opacity:0,scale:.6,y:15,rotateX:-10},animate:{opacity:1,scale:1,y:0,rotateX:0},whileHover:{scale:1.05},transition:{type:"spring",stiffness:500,damping:30,delay:0},children:[Vit(r,"MMM d, yyyy"),t.jsxs(Edt,{type:"button",variant:"ghost",size:"sm",className:"h-4 w-4 p-0 ml-1",onClick:()=>{const t=[...e.value||[]];t.splice(n,1),e.onChange(t)},children:[t.jsx("span",{className:"sr-only",children:"Remove"}),"×"]})]},r.toISOString()))}),t.jsx(Cmt,{})]})})})})})]})})})]})}):null},LPt=e.forwardRef(({value:r,onChange:n,...o},a)=>{const i=e.useMemo(()=>GDt(r),[r]),s=e=>{const[t,r]=i.split(":").map(Number);let o=t,a=r;"up"===e?(a+=15,a>=60&&(a=0,o=(o+1)%24)):(a-=15,a<0&&(a=45,o=(o-1+24)%24));const s=`${String(o).padStart(2,"0")}:${String(a).padStart(2,"0")}`;n(s)};return t.jsxs("div",{className:"relative",children:[t.jsx(Mmt,{type:"time",ref:a,value:i,onChange:e=>n(e.target.value),...o,className:"pr-8"}),t.jsxs("div",{className:"absolute right-1 top-1 bottom-1 flex flex-col justify-center",children:[t.jsx(Edt,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4",onClick:()=>s("up"),children:t.jsx(Est,{className:"h-3 w-3"})}),t.jsx(Edt,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4",onClick:()=>s("down"),children:t.jsx(Dst,{className:"h-3 w-3"})})]})]})});function BPt(e){return function(e){return"[object Object]"===Object.prototype.toString.call(e)}(e)||Array.isArray(e)}function VPt(e,t){const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;return JSON.stringify(Object.keys(e.breakpoints||{}))===JSON.stringify(Object.keys(t.breakpoints||{}))&&r.every(r=>{const n=e[r],o=t[r];return"function"==typeof n?`${n}`==`${o}`:BPt(n)&&BPt(o)?VPt(n,o):n===o})}function HPt(e){return e.concat().sort((e,t)=>e.name>t.name?1:-1).map(e=>e.options)}function qPt(e){return"number"==typeof e}function $Pt(e){return"string"==typeof e}function WPt(e){return"boolean"==typeof e}function UPt(e){return"[object Object]"===Object.prototype.toString.call(e)}function GPt(e){return Math.abs(e)}function KPt(e){return Math.sign(e)}function YPt(e,t){return GPt(e-t)}function XPt(e){return tEt(e).map(Number)}function ZPt(e){return e[QPt(e)]}function QPt(e){return Math.max(0,e.length-1)}function JPt(e,t){return t===QPt(e)}function eEt(e,t=0){return Array.from(Array(e),(e,r)=>t+r)}function tEt(e){return Object.keys(e)}function rEt(e,t){return[e,t].reduce((e,t)=>(tEt(t).forEach(r=>{const n=e[r],o=t[r],a=UPt(n)&&UPt(o);e[r]=a?rEt(n,o):o}),e),{})}function nEt(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function oEt(){let e=[];const t={add:function(r,n,o,a={passive:!0}){let i;if("addEventListener"in r)r.addEventListener(n,o,a),i=()=>r.removeEventListener(n,o,a);else{const e=r;e.addListener(o),i=()=>e.removeListener(o)}return e.push(i),t},clear:function(){e=e.filter(e=>e())}};return t}function aEt(e,t,r,n){const o=oEt(),a=1e3/60;let i=null,s=0,l=0;function c(e){if(!l)return;i||(i=e,r(),r());const o=e-i;for(i=e,s+=o;s>=a;)r(),s-=a;n(s/a),l&&(l=t.requestAnimationFrame(c))}function u(){t.cancelAnimationFrame(l),i=null,s=0,l=0}return{init:function(){o.add(e,"visibilitychange",()=>{e.hidden&&(i=null,s=0)})},destroy:function(){u(),o.clear()},start:function(){l||(l=t.requestAnimationFrame(c))},stop:u,update:r,render:n}}function iEt(e=0,t=0){const r=GPt(e-t);function n(t){return t<e}function o(e){return e>t}function a(e){return n(e)||o(e)}return{length:r,max:t,min:e,constrain:function(r){return a(r)?n(r)?e:t:r},reachedAny:a,reachedMax:o,reachedMin:n,removeOffset:function(e){return r?e-r*Math.ceil((e-t)/r):e}}}function sEt(e,t,r){const{constrain:n}=iEt(0,e),o=e+1;let a=i(t);function i(e){return r?GPt((o+e)%o):n(e)}function s(){return a}function l(){return sEt(e,s(),r)}const c={get:s,set:function(e){return a=i(e),c},add:function(e){return l().set(s()+e)},clone:l};return c}function lEt(e,t,r,n,o,a,i,s,l,c,u,d,p,h,f,m,v,y,g){const{cross:b,direction:x}=e,w=["INPUT","SELECT","TEXTAREA"],k={passive:!1},_=oEt(),C=oEt(),M=iEt(50,225).constrain(h.measure(20)),S={mouse:300,touch:400},D={mouse:500,touch:600},O=f?43:25;let P=!1,E=0,j=0,T=!1,N=!1,R=!1,F=!1;function z(e){if(!nEt(e,n)&&e.touches.length>=2)return I(e);const t=a.readPoint(e),r=a.readPoint(e,b),i=YPt(t,E),l=YPt(r,j);if(!(N||F||e.cancelable&&(N=i>l,N)))return I(e);const u=a.pointerMove(e);i>m&&(R=!0),c.useFriction(.3).useDuration(.75),s.start(),o.add(x(u)),e.preventDefault()}function I(e){const t=u.byDistance(0,!1).index!==d.get(),r=a.pointerUp(e)*(f?D:S)[F?"mouse":"touch"],n=function(e,t){const r=d.add(-1*KPt(e)),n=u.byDistance(e,!f).distance;return f||GPt(e)<M?n:v&&t?.5*n:u.byIndex(r.get(),0).distance}(x(r),t),o=function(e,t){if(0===e||0===t||GPt(e)<=GPt(t))return 0;const r=YPt(GPt(e),GPt(t));return GPt(r/e)}(r,n),i=O-10*o,s=y+o/50;N=!1,T=!1,C.clear(),c.useDuration(i).useFriction(s),l.distance(n,!f),F=!1,p.emit("pointerUp")}function A(e){R&&(e.stopPropagation(),e.preventDefault(),R=!1)}return{init:function(e){if(!g)return;function s(s){(WPt(g)||g(e,s))&&function(e){const s=nEt(e,n);F=s,R=f&&s&&!e.buttons&&P,P=YPt(o.get(),i.get())>=2,(!s||0===e.button)&&(function(e){const t=e.nodeName||"";return w.includes(t)}(e.target)||(T=!0,a.pointerDown(e),c.useFriction(0).useDuration(0),o.set(i),function(){const e=F?r:t;C.add(e,"touchmove",z,k).add(e,"touchend",I).add(e,"mousemove",z,k).add(e,"mouseup",I)}(),E=a.readPoint(e),j=a.readPoint(e,b),p.emit("pointerDown")))}(s)}const l=t;_.add(l,"dragstart",e=>e.preventDefault(),k).add(l,"touchmove",()=>{},k).add(l,"touchend",()=>{}).add(l,"touchstart",s).add(l,"mousedown",s).add(l,"touchcancel",I).add(l,"contextmenu",I).add(l,"click",A,!0)},destroy:function(){_.clear(),C.clear()},pointerDown:function(){return T}}}function cEt(e,t){let r,n;function o(e){return e.timeStamp}function a(r,n){const o="client"+("x"===(n||e.scroll)?"X":"Y");return(nEt(r,t)?r:r.touches[0])[o]}return{pointerDown:function(e){return r=e,n=e,a(e)},pointerMove:function(e){const t=a(e)-a(n),i=o(e)-o(r)>170;return n=e,i&&(r=e),t},pointerUp:function(e){if(!r||!n)return 0;const t=a(n)-a(r),i=o(e)-o(r),s=o(e)-o(n)>170,l=t/i;return i&&!s&&GPt(l)>.1?l:0},readPoint:a}}function uEt(e,t,r,n,o,a,i){const s=[e].concat(n);let l,c,u=[],d=!1;function p(e){return o.measureSize(i.measure(e))}return{init:function(o){a&&(c=p(e),u=n.map(p),l=new ResizeObserver(r=>{(WPt(a)||a(o,r))&&function(r){for(const a of r){if(d)return;const r=a.target===e,i=n.indexOf(a.target),s=r?c:u[i];if(GPt(p(r?e:n[i])-s)>=.5){o.reInit(),t.emit("resize");break}}}(r)}),r.requestAnimationFrame(()=>{s.forEach(e=>l.observe(e))}))},destroy:function(){d=!0,l&&l.disconnect()}}}function dEt(e,t,r,n,o){const a=o.measure(10),i=o.measure(50),s=iEt(.1,.99);let l=!1;function c(){return!(l||!e.reachedAny(r.get())||!e.reachedAny(t.get()))}return{shouldConstrain:c,constrain:function(o){if(!c())return;const l=e.reachedMin(t.get())?"min":"max",u=GPt(e[l]-t.get()),d=r.get()-t.get(),p=s.constrain(u/i);r.subtract(d*p),!o&&GPt(d)<a&&(r.set(e.constrain(r.get())),n.useDuration(25).useBaseFriction())},toggleActive:function(e){l=!e}}}function pEt(e,t,r,n){const o=t.min+.1,a=t.max+.1,{reachedMin:i,reachedMax:s}=iEt(o,a);return{loop:function(t){if(!function(e){return 1===e?s(r.get()):-1===e&&i(r.get())}(t))return;const o=e*(-1*t);n.forEach(e=>e.add(o))}}}function hEt(e,t,r,n,o){const{reachedAny:a,removeOffset:i,constrain:s}=n;function l(e){return e.concat().sort((e,t)=>GPt(e)-GPt(t))[0]}function c(t,n){const o=[t,t+r,t-r];if(!e)return t;if(!n)return l(o);const a=o.filter(e=>KPt(e)===n);return a.length?l(a):ZPt(o)-r}return{byDistance:function(r,n){const l=o.get()+r,{index:u,distance:d}=function(r){const n=e?i(r):s(r),o=t.map((e,t)=>({diff:c(e-n,0),index:t})).sort((e,t)=>GPt(e.diff)-GPt(t.diff)),{index:a}=o[0];return{index:a,distance:n}}(l),p=!e&&a(l);return!n||p?{index:u,distance:r}:{index:u,distance:r+c(t[u]-d,0)}},byIndex:function(e,r){return{index:e,distance:c(t[e]-o.get(),r)}},shortcut:c}}function fEt(e,t,r,n,o,a,i,s){const l={passive:!0,capture:!0};let c=0;function u(e){"Tab"===e.code&&(c=(new Date).getTime())}return{init:function(d){s&&(a.add(document,"keydown",u,!1),t.forEach((t,u)=>{a.add(t,"focus",t=>{(WPt(s)||s(d,t))&&function(t){if((new Date).getTime()-c>10)return;i.emit("slideFocusStart"),e.scrollLeft=0;const a=r.findIndex(e=>e.includes(t));qPt(a)&&(o.useDuration(0),n.index(a,0),i.emit("slideFocus"))}(u)},l)}))}}}function mEt(e){let t=e;function r(e){return qPt(e)?e:e.get()}return{get:function(){return t},set:function(e){t=r(e)},add:function(e){t+=r(e)},subtract:function(e){t-=r(e)}}}function vEt(e,t){const r="x"===e.scroll?function(e){return`translate3d(${e}px,0px,0px)`}:function(e){return`translate3d(0px,${e}px,0px)`},n=t.style;let o=null,a=!1;return{clear:function(){a||(n.transform="",t.getAttribute("style")||t.removeAttribute("style"))},to:function(t){if(a)return;const i=function(e){return Math.round(100*e)/100}(e.direction(t));i!==o&&(n.transform=r(i),o=i)},toggleActive:function(e){a=!e}}}function yEt(e,t,r,n,o,a,i,s,l){const c=XPt(o),u=XPt(o).reverse(),d=function(){const e=i[0];return f(h(u,e),r,!1)}().concat(function(){const e=t-i[0]-1;return f(h(c,e),-r,!0)}());function p(e,t){return e.reduce((e,t)=>e-o[t],t)}function h(e,t){return e.reduce((e,r)=>p(e,t)>0?e.concat([r]):e,[])}function f(o,i,c){const u=function(e){return a.map((r,o)=>({start:r-n[o]+.5+e,end:r+t-.5+e}))}(i);return o.map(t=>{const n=c?0:-r,o=c?r:0,a=c?"end":"start",i=u[t][a];return{index:t,loopPoint:i,slideLocation:mEt(-1),translate:vEt(e,l[t]),target:()=>s.get()>i?n:o}})}return{canLoop:function(){return d.every(({index:e})=>p(c.filter(t=>t!==e),t)<=.1)},clear:function(){d.forEach(e=>e.translate.clear())},loop:function(){d.forEach(e=>{const{target:t,translate:r,slideLocation:n}=e,o=t();o!==n.get()&&(r.to(o),n.set(o))})},loopPoints:d}}function gEt(e,t,r){let n,o=!1;return{init:function(a){r&&(n=new MutationObserver(e=>{o||(WPt(r)||r(a,e))&&function(e){for(const r of e)if("childList"===r.type){a.reInit(),t.emit("slidesChanged");break}}(e)}),n.observe(e,{childList:!0}))},destroy:function(){n&&n.disconnect(),o=!0}}}function bEt(e,t,r,n){const o={};let a,i=null,s=null,l=!1;return{init:function(){a=new IntersectionObserver(e=>{l||(e.forEach(e=>{const r=t.indexOf(e.target);o[r]=e}),i=null,s=null,r.emit("slidesInView"))},{root:e.parentElement,threshold:n}),t.forEach(e=>a.observe(e))},destroy:function(){a&&a.disconnect(),l=!0},get:function(e=!0){if(e&&i)return i;if(!e&&s)return s;const t=function(e){return tEt(o).reduce((t,r)=>{const n=parseInt(r),{isIntersecting:a}=o[n];return(e&&a||!e&&!a)&&t.push(n),t},[])}(e);return e&&(i=t),e||(s=t),t}}}function xEt(e,t,r,n,o,a,i,s,l){const{startEdge:c,endEdge:u,direction:d}=e,p=qPt(r);return{groupSlides:function(e){return p?function(e,t){return XPt(e).filter(e=>e%t===0).map(r=>e.slice(r,r+t))}(e,r):function(e){return e.length?XPt(e).reduce((r,p,h)=>{const f=ZPt(r)||0,m=0===f,v=p===QPt(e),y=o[c]-a[f][c],g=o[c]-a[p][u],b=!n&&m?d(i):0,x=GPt(g-(!n&&v?d(s):0)-(y+b));return h&&x>t+l&&r.push(p),v&&r.push(e.length),r},[]).map((t,r,n)=>{const o=Math.max(n[r-1]||0);return e.slice(o,t)}):[]}(e)}}}function wEt(e,t,r,n,o,a,i){const{align:s,axis:l,direction:c,startIndex:u,loop:d,duration:p,dragFree:h,dragThreshold:f,inViewThreshold:m,slidesToScroll:v,skipSnaps:y,containScroll:g,watchResize:b,watchSlides:x,watchDrag:w,watchFocus:k}=a,_={measure:function(e){const{offsetTop:t,offsetLeft:r,offsetWidth:n,offsetHeight:o}=e;return{top:t,right:r+n,bottom:t+o,left:r,width:n,height:o}}},C=_.measure(t),M=r.map(_.measure),S=function(e,t){const r="rtl"===t,n="y"===e,o=!n&&r?-1:1;return{scroll:n?"y":"x",cross:n?"x":"y",startEdge:n?"top":r?"right":"left",endEdge:n?"bottom":r?"left":"right",measureSize:function(e){const{height:t,width:r}=e;return n?t:r},direction:function(e){return e*o}}}(l,c),D=S.measureSize(C),O=function(e){return{measure:function(t){return e*(t/100)}}}(D),P=function(e,t){const r={start:function(){return 0},center:function(e){return n(e)/2},end:n};function n(e){return t-e}return{measure:function(n,o){return $Pt(e)?r[e](n):e(t,n,o)}}}(s,D),E=!d&&!!g,j=d||!!g,{slideSizes:T,slideSizesWithGaps:N,startGap:R,endGap:F}=function(e,t,r,n,o,a){const{measureSize:i,startEdge:s,endEdge:l}=e,c=r[0]&&o,u=function(){if(!c)return 0;const e=r[0];return GPt(t[s]-e[s])}(),d=function(){if(!c)return 0;const e=a.getComputedStyle(ZPt(n));return parseFloat(e.getPropertyValue(`margin-${l}`))}(),p=r.map(i),h=r.map((e,t,r)=>{const n=!t,o=JPt(r,t);return n?p[t]+u:o?p[t]+d:r[t+1][s]-e[s]}).map(GPt);return{slideSizes:p,slideSizesWithGaps:h,startGap:u,endGap:d}}(S,C,M,r,j,o),z=xEt(S,D,v,d,C,M,R,F,2),{snaps:I,snapsAligned:A}=function(e,t,r,n,o){const{startEdge:a,endEdge:i}=e,{groupSlides:s}=o,l=s(n).map(e=>ZPt(e)[i]-e[0][a]).map(GPt).map(t.measure),c=n.map(e=>r[a]-e[a]).map(e=>-GPt(e)),u=s(c).map(e=>e[0]).map((e,t)=>e+l[t]);return{snaps:c,snapsAligned:u}}(S,P,C,M,z),L=-ZPt(I)+ZPt(N),{snapsContained:B,scrollContainLimit:V}=function(e,t,r,n,o){const a=iEt(-t+e,0),i=r.map((e,t)=>{const{min:n,max:o}=a,i=a.constrain(e),s=!t,c=JPt(r,t);return s?o:c||l(n,i)?n:l(o,i)?o:i}).map(e=>parseFloat(e.toFixed(3))),s=function(){const e=i[0],t=ZPt(i);return iEt(i.lastIndexOf(e),i.indexOf(t)+1)}();function l(e,t){return YPt(e,t)<=1}return{snapsContained:function(){if(t<=e+o)return[a.max];if("keepSnaps"===n)return i;const{min:r,max:l}=s;return i.slice(r,l)}(),scrollContainLimit:s}}(D,L,A,g,2),H=E?B:A,{limit:q}=function(e,t,r){const n=t[0];return{limit:iEt(r?n-e:ZPt(t),n)}}(L,H,d),$=sEt(QPt(H),u,d),W=$.clone(),U=XPt(r),G=aEt(n,o,()=>(({dragHandler:e,scrollBody:t,scrollBounds:r,options:{loop:n}})=>{n||r.constrain(e.pointerDown()),t.seek()})(se),e=>(({scrollBody:e,translate:t,location:r,offsetLocation:n,previousLocation:o,scrollLooper:a,slideLooper:i,dragHandler:s,animation:l,eventHandler:c,scrollBounds:u,options:{loop:d}},p)=>{const h=e.settled(),f=!u.shouldConstrain(),m=d?h:h&&f,v=m&&!s.pointerDown();v&&l.stop();const y=r.get()*p+o.get()*(1-p);n.set(y),d&&(a.loop(e.direction()),i.loop()),t.to(n.get()),v&&c.emit("settle"),m||c.emit("scroll")})(se,e)),K=H[$.get()],Y=mEt(K),X=mEt(K),Z=mEt(K),Q=mEt(K),J=function(e,t,r,n,o,a){let i=0,s=0,l=o,c=a,u=e.get(),d=0;function p(e){return l=e,f}function h(e){return c=e,f}const f={direction:function(){return s},duration:function(){return l},velocity:function(){return i},seek:function(){const t=n.get()-e.get();let o=0;return l?(r.set(e),i+=t/l,i*=c,u+=i,e.add(i),o=u-d):(i=0,r.set(n),e.set(n),o=t),s=KPt(o),d=u,f},settled:function(){return GPt(n.get()-t.get())<.001},useBaseFriction:function(){return h(a)},useBaseDuration:function(){return p(o)},useFriction:h,useDuration:p};return f}(Y,Z,X,Q,p,.68),ee=hEt(d,H,L,q,Q),te=function(e,t,r,n,o,a,i){function s(o){const s=o.distance,l=o.index!==t.get();a.add(s),s&&(n.duration()?e.start():(e.update(),e.render(1),e.update())),l&&(r.set(t.get()),t.set(o.index),i.emit("select"))}return{distance:function(e,t){s(o.byDistance(e,t))},index:function(e,r){const n=t.clone().set(e);s(o.byIndex(n.get(),r))}}}(G,$,W,J,ee,Q,i),re=function(e){const{max:t,length:r}=e;return{get:function(e){return r?(e-t)/-r:0}}}(q),ne=oEt(),oe=bEt(t,r,i,m),{slideRegistry:ae}=function(e,t,r,n,o,a){const{groupSlides:i}=o,{min:s,max:l}=n;return{slideRegistry:function(){const n=i(a),o=!e||"keepSnaps"===t;return 1===r.length?[a]:o?n:n.slice(s,l).map((e,t,r)=>{const n=!t,o=JPt(r,t);return n?eEt(ZPt(r[0])+1):o?eEt(QPt(a)-ZPt(r)[0]+1,ZPt(r)[0]):e})}()}}(E,g,H,V,z,U),ie=fEt(e,r,ae,te,J,ne,i,k),se={ownerDocument:n,ownerWindow:o,eventHandler:i,containerRect:C,slideRects:M,animation:G,axis:S,dragHandler:lEt(S,e,n,o,Q,cEt(S,o),Y,G,te,J,ee,$,i,O,h,f,y,.68,w),eventStore:ne,percentOfView:O,index:$,indexPrevious:W,limit:q,location:Y,offsetLocation:Z,previousLocation:X,options:a,resizeHandler:uEt(t,i,o,r,S,b,_),scrollBody:J,scrollBounds:dEt(q,Z,Q,J,O),scrollLooper:pEt(L,q,Z,[Y,Z,X,Q]),scrollProgress:re,scrollSnapList:H.map(re.get),scrollSnaps:H,scrollTarget:ee,scrollTo:te,slideLooper:yEt(S,D,L,T,N,I,H,Z,r),slideFocus:ie,slidesHandler:gEt(t,i,x),slidesInView:oe,slideIndexes:U,slideRegistry:ae,slidesToScroll:z,target:Q,translate:vEt(S,t)};return se}LPt.displayName="TimeInput";const kEt={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function _Et(e){function t(e,t){return rEt(e,t||{})}return{mergeOptions:t,optionsAtMedia:function(r){const n=r.breakpoints||{},o=tEt(n).filter(t=>e.matchMedia(t).matches).map(e=>n[e]).reduce((e,r)=>t(e,r),{});return t(r,o)},optionsMediaQueries:function(t){return t.map(e=>tEt(e.breakpoints||{})).reduce((e,t)=>e.concat(t),[]).map(e.matchMedia)}}}function CEt(e,t,r){const n=e.ownerDocument,o=n.defaultView,a=_Et(o),i=function(e){let t=[];return{init:function(r,n){return t=n.filter(({options:t})=>!1!==e.optionsAtMedia(t).active),t.forEach(t=>t.init(r,e)),n.reduce((e,t)=>Object.assign(e,{[t.name]:t}),{})},destroy:function(){t=t.filter(e=>e.destroy())}}}(a),s=oEt(),l=function(){let e,t={};function r(e){return t[e]||[]}const n={init:function(t){e=t},emit:function(t){return r(t).forEach(r=>r(e,t)),n},off:function(e,o){return t[e]=r(e).filter(e=>e!==o),n},on:function(e,o){return t[e]=r(e).concat([o]),n},clear:function(){t={}}};return n}(),{mergeOptions:c,optionsAtMedia:u,optionsMediaQueries:d}=a,{on:p,off:h,emit:f}=l,m=S;let v,y,g,b,x=!1,w=c(kEt,CEt.globalOptions),k=c(w),_=[];function C(t){const r=wEt(e,g,b,n,o,t,l);if(t.loop&&!r.slideLooper.canLoop()){return C(Object.assign({},t,{loop:!1}))}return r}function M(t,r){x||(w=c(w,t),k=u(w),_=r||_,function(){const{container:t,slides:r}=k;g=($Pt(t)?e.querySelector(t):t)||e.children[0];const n=$Pt(r)?g.querySelectorAll(r):r;b=[].slice.call(n||g.children)}(),v=C(k),d([w,..._.map(({options:e})=>e)]).forEach(e=>s.add(e,"change",S)),k.active&&(v.translate.to(v.location.get()),v.animation.init(),v.slidesInView.init(),v.slideFocus.init(E),v.eventHandler.init(E),v.resizeHandler.init(E),v.slidesHandler.init(E),v.options.loop&&v.slideLooper.loop(),g.offsetParent&&b.length&&v.dragHandler.init(E),y=i.init(E,_)))}function S(e,t){const r=P();D(),M(c({startIndex:r},e),t),l.emit("reInit")}function D(){v.dragHandler.destroy(),v.eventStore.clear(),v.translate.clear(),v.slideLooper.clear(),v.resizeHandler.destroy(),v.slidesHandler.destroy(),v.slidesInView.destroy(),v.animation.destroy(),i.destroy(),s.clear()}function O(e,t,r){!k.active||x||(v.scrollBody.useBaseFriction().useDuration(!0===t?0:k.duration),v.scrollTo.index(e,r||0))}function P(){return v.index.get()}const E={canScrollNext:function(){return v.index.add(1).get()!==P()},canScrollPrev:function(){return v.index.add(-1).get()!==P()},containerNode:function(){return g},internalEngine:function(){return v},destroy:function(){x||(x=!0,s.clear(),D(),l.emit("destroy"),l.clear())},off:h,on:p,emit:f,plugins:function(){return y},previousScrollSnap:function(){return v.indexPrevious.get()},reInit:m,rootNode:function(){return e},scrollNext:function(e){O(v.index.add(1).get(),e,-1)},scrollPrev:function(e){O(v.index.add(-1).get(),e,1)},scrollProgress:function(){return v.scrollProgress.get(v.offsetLocation.get())},scrollSnapList:function(){return v.scrollSnapList},scrollTo:O,selectedScrollSnap:P,slideNodes:function(){return b},slidesInView:function(){return v.slidesInView.get()},slidesNotInView:function(){return v.slidesInView.get(!1)}};return M(t,r),setTimeout(()=>l.emit("init"),0),E}function MEt(t={},r=[]){const n=e.useRef(t),o=e.useRef(r),[a,i]=e.useState(),[s,l]=e.useState(),c=e.useCallback(()=>{a&&a.reInit(n.current,o.current)},[a]);return e.useEffect(()=>{VPt(n.current,t)||(n.current=t,c())},[t,c]),e.useEffect(()=>{(function(e,t){if(e.length!==t.length)return!1;const r=HPt(e),n=HPt(t);return r.every((e,t)=>VPt(e,n[t]))})(o.current,r)||(o.current=r,c())},[r,c]),e.useEffect(()=>{if(typeof window<"u"&&window.document&&window.document.createElement&&s){CEt.globalOptions=MEt.globalOptions;const e=CEt(s,n.current,o.current);return i(e),()=>e.destroy()}i(void 0)},[s,i]),[l,a]}CEt.globalOptions=void 0,MEt.globalOptions=void 0;const SEt=s.createContext(null);function DEt(){const e=s.useContext(SEt);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}const OEt=s.forwardRef(({orientation:e="horizontal",opts:r,setApi:n,plugins:o,className:a,children:i,...l},c)=>{const[u,d]=MEt({...r,axis:"horizontal"===e?"x":"y"},o),[p,h]=s.useState(!1),[f,m]=s.useState(!1),v=s.useCallback(e=>{e&&(h(e.canScrollPrev()),m(e.canScrollNext()))},[]),y=s.useCallback(()=>{null==d||d.scrollPrev()},[d]),g=s.useCallback(()=>{null==d||d.scrollNext()},[d]),b=s.useCallback(e=>{"ArrowLeft"===e.key?(e.preventDefault(),y()):"ArrowRight"===e.key&&(e.preventDefault(),g())},[y,g]);return s.useEffect(()=>{!d||!n||n(d)},[d,n]),s.useEffect(()=>{if(d)return v(d),d.on("reInit",v),d.on("select",v),()=>{null==d||d.off("select",v)}},[d,v]),t.jsx(SEt.Provider,{value:{carouselRef:u,api:d,opts:r,orientation:e||("y"===(null==r?void 0:r.axis)?"vertical":"horizontal"),scrollPrev:y,scrollNext:g,canScrollPrev:p,canScrollNext:f},children:t.jsx("div",{ref:c,onKeyDownCapture:b,className:vdt("relative",a),role:"region","aria-roledescription":"carousel",...l,children:i})})});OEt.displayName="Carousel";const PEt=s.forwardRef(({className:e,...r},n)=>{const{carouselRef:o,orientation:a}=DEt();return t.jsx("div",{ref:o,className:"overflow-hidden",children:t.jsx("div",{ref:n,className:vdt("flex","horizontal"===a?"-ml-4":"-mt-4 flex-col",e),...r})})});PEt.displayName="CarouselContent";const EEt=s.forwardRef(({className:e,...r},n)=>{const{orientation:o}=DEt();return t.jsx("div",{ref:n,role:"group","aria-roledescription":"slide",className:vdt("min-w-0 shrink-0 grow-0 basis-full","horizontal"===o?"pl-4":"pt-4",e),...r})});EEt.displayName="CarouselItem";const jEt=s.forwardRef(({className:e,variant:r="outline",size:n="icon",...o},a)=>{const{orientation:i,scrollPrev:s,canScrollPrev:l}=DEt();return t.jsxs(Edt,{ref:a,variant:r,size:n,className:vdt("absolute h-8 w-8 rounded-full","horizontal"===i?"-left-12 top-1/2 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!l,onClick:s,...o,children:[t.jsx(gst,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Previous slide"})]})});jEt.displayName="CarouselPrevious";const TEt=s.forwardRef(({className:e,variant:r="outline",size:n="icon",...o},a)=>{const{orientation:i,scrollNext:s,canScrollNext:l}=DEt();return t.jsxs(Edt,{ref:a,variant:r,size:n,className:vdt("absolute h-8 w-8 rounded-full","horizontal"===i?"-right-12 top-1/2 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!l,onClick:s,...o,children:[t.jsx(bst,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Next slide"})]})});TEt.displayName="CarouselNext";const NEt=({form:e,translations:r})=>{const n=[{label:r.timePresetAllDay,start:"00:00",end:"23:59"},{label:r.timePresetEarlyMorning,start:"06:00",end:"09:00"},{label:r.timePresetMorning,start:"09:00",end:"12:00"},{label:r.timePresetLunch,start:"12:00",end:"13:00"},{label:r.timePresetEarlyAfternoon,start:"13:00",end:"15:00"},{label:r.timePresetLateAfternoon,start:"15:00",end:"17:00"},{label:r.timePresetEvening,start:"17:00",end:"20:00"},{label:r.timePresetNight,start:"20:00",end:"23:00"}];return t.jsx("div",{className:"pt-2 pb-1",children:t.jsxs(OEt,{className:"w-full max-w-xs mx-auto sm:px-0",children:[t.jsx(PEt,{className:"",children:n.map(r=>t.jsx(EEt,{className:"basis-1/3",children:t.jsx(xDt.div,{whileHover:{scale:1},whileTap:{scale:.95},children:t.jsx(Edt,{type:"button",variant:"outline",size:"sm",onClick:()=>(t=>{e.setValue("startTime",GDt(t.start)),e.setValue("endTime",GDt(t.end))})(r),className:vdt("w-full text-xs h-5 mx-auto flex",e.watch("startTime")===r.start&&e.watch("endTime")===r.end?"bg-primary text-primary-foreground":""),children:t.jsx("span",{className:"text-[10px] sm:text-xs",children:r.label})})})},r.label))}),t.jsx(jEt,{className:"flex",type:"button"}),t.jsx(TEt,{className:"flex",type:"button"})]})})};var REt,FEt;!function(e){e.assertEqual=e=>{},e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const r of e)t[r]=r;return t},e.getValidEnumValues=t=>{const r=e.objectKeys(t).filter(e=>"number"!=typeof t[t[e]]),n={};for(const e of r)n[e]=t[e];return e.objectValues(n)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},e.find=(e,t)=>{for(const r of e)if(t(r))return r},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(REt||(REt={})),(FEt||(FEt={})).mergeShapes=(e,t)=>({...e,...t});const zEt=REt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),IEt=e=>{switch(typeof e){case"undefined":return zEt.undefined;case"string":return zEt.string;case"number":return Number.isNaN(e)?zEt.nan:zEt.number;case"boolean":return zEt.boolean;case"function":return zEt.function;case"bigint":return zEt.bigint;case"symbol":return zEt.symbol;case"object":return Array.isArray(e)?zEt.array:null===e?zEt.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?zEt.promise:typeof Map<"u"&&e instanceof Map?zEt.map:typeof Set<"u"&&e instanceof Set?zEt.set:typeof Date<"u"&&e instanceof Date?zEt.date:zEt.object;default:return zEt.unknown}},AEt=REt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class LEt extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},r={_errors:[]},n=e=>{for(const o of e.issues)if("invalid_union"===o.code)o.unionErrors.map(n);else if("invalid_return_type"===o.code)n(o.returnTypeError);else if("invalid_arguments"===o.code)n(o.argumentsError);else if(0===o.path.length)r._errors.push(t(o));else{let e=r,n=0;for(;n<o.path.length;){const r=o.path[n];n===o.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(t(o))):e[r]=e[r]||{_errors:[]},e=e[r],n++}}};return n(this),r}static assert(e){if(!(e instanceof LEt))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,REt.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},r=[];for(const n of this.issues)if(n.path.length>0){const r=n.path[0];t[r]=t[r]||[],t[r].push(e(n))}else r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}LEt.create=e=>new LEt(e);const BEt=(e,t)=>{let r;switch(e.code){case AEt.invalid_type:r=e.received===zEt.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case AEt.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,REt.jsonStringifyReplacer)}`;break;case AEt.unrecognized_keys:r=`Unrecognized key(s) in object: ${REt.joinValues(e.keys,", ")}`;break;case AEt.invalid_union:r="Invalid input";break;case AEt.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${REt.joinValues(e.options)}`;break;case AEt.invalid_enum_value:r=`Invalid enum value. Expected ${REt.joinValues(e.options)}, received '${e.received}'`;break;case AEt.invalid_arguments:r="Invalid function arguments";break;case AEt.invalid_return_type:r="Invalid function return type";break;case AEt.invalid_date:r="Invalid date";break;case AEt.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:REt.assertNever(e.validation):r="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case AEt.too_small:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type||"bigint"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case AEt.too_big:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case AEt.custom:r="Invalid input";break;case AEt.invalid_intersection_types:r="Intersection results could not be merged";break;case AEt.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case AEt.not_finite:r="Number must be finite";break;default:r=t.defaultError,REt.assertNever(e)}return{message:r}};let VEt=BEt;function HEt(e,t){const r=VEt,n=(e=>{const{data:t,path:r,errorMaps:n,issueData:o}=e,a=[...r,...o.path||[]],i={...o,path:a};if(void 0!==o.message)return{...o,path:a,message:o.message};let s="";const l=n.filter(e=>!!e).slice().reverse();for(const e of l)s=e(i,{data:t,defaultError:s}).message;return{...o,path:a,message:s}})({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===BEt?void 0:BEt].filter(e=>!!e)});e.common.issues.push(n)}class qEt{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const n of t){if("aborted"===n.status)return $Et;"dirty"===n.status&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const e of t){const t=await e.key,n=await e.value;r.push({key:t,value:n})}return qEt.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const n of t){const{key:t,value:o}=n;if("aborted"===t.status||"aborted"===o.status)return $Et;"dirty"===t.status&&e.dirty(),"dirty"===o.status&&e.dirty(),"__proto__"!==t.value&&(typeof o.value<"u"||n.alwaysSet)&&(r[t.value]=o.value)}return{status:e.value,value:r}}}const $Et=Object.freeze({status:"aborted"}),WEt=e=>({status:"dirty",value:e}),UEt=e=>({status:"valid",value:e}),GEt=e=>"aborted"===e.status,KEt=e=>"dirty"===e.status,YEt=e=>"valid"===e.status,XEt=e=>typeof Promise<"u"&&e instanceof Promise;var ZEt;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(ZEt||(ZEt={}));class QEt{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const JEt=(e,t)=>{if(YEt(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new LEt(e.common.issues);return this._error=t,this._error}}};function ejt(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:o}=e;if(t&&(r||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:o}:{errorMap:(t,o)=>{const{message:a}=e;return"invalid_enum_value"===t.code?{message:a??o.defaultError}:typeof o.data>"u"?{message:a??n??o.defaultError}:"invalid_type"!==t.code?{message:o.defaultError}:{message:a??r??o.defaultError}},description:o}}class tjt{get description(){return this._def.description}_getType(e){return IEt(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:IEt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new qEt,ctx:{common:e.parent.common,data:e.data,parsedType:IEt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(XEt(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){const r={common:{issues:[],async:(null==t?void 0:t.async)??!1,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:IEt(e)},n=this._parseSync({data:e,path:r.path,parent:r});return JEt(r,n)}"~validate"(e){var t,r;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:IEt(e)};if(!this["~standard"].async)try{const t=this._parseSync({data:e,path:[],parent:n});return YEt(t)?{value:t.value}:{issues:n.common.issues}}catch(e){null!=(r=null==(t=null==e?void 0:e.message)?void 0:t.toLowerCase())&&r.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(e=>YEt(e)?{value:e.value}:{issues:n.common.issues})}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:IEt(e)},n=this._parse({data:e,path:r.path,parent:r}),o=await(XEt(n)?n:Promise.resolve(n));return JEt(r,o)}refine(e,t){const r=e=>"string"==typeof t||typeof t>"u"?{message:t}:"function"==typeof t?t(e):t;return this._refinement((t,n)=>{const o=e(t),a=()=>n.addIssue({code:AEt.custom,...r(t)});return typeof Promise<"u"&&o instanceof Promise?o.then(e=>!!e||(a(),!1)):!!o||(a(),!1)})}refinement(e,t){return this._refinement((r,n)=>!!e(r)||(n.addIssue("function"==typeof t?t(r,n):t),!1))}_refinement(e){return new Jjt({schema:this,typeName:lTt.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return eTt.create(this,this._def)}nullable(){return tTt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ajt.create(this)}promise(){return Qjt.create(this,this._def)}or(e){return Vjt.create([this,e],this._def)}and(e){return qjt.create(this,e,this._def)}transform(e){return new Jjt({...ejt(this._def),schema:this,typeName:lTt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new rTt({...ejt(this._def),innerType:this,defaultValue:t,typeName:lTt.ZodDefault})}brand(){return new aTt({typeName:lTt.ZodBranded,type:this,...ejt(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new nTt({...ejt(this._def),innerType:this,catchValue:t,typeName:lTt.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return iTt.create(this,e)}readonly(){return sTt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const rjt=/^c[^\s-]{8,}$/i,njt=/^[0-9a-z]+$/,ojt=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ajt=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,ijt=/^[a-z0-9_-]{21}$/i,sjt=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,ljt=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,cjt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let ujt;const djt=/^(?:(?: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])$/,pjt=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,hjt=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,fjt=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,mjt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,vjt=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,yjt="((\\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])))",gjt=new RegExp(`^${yjt}$`);function bjt(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`);return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function xjt(e){return new RegExp(`^${bjt(e)}$`)}function wjt(e){let t=`${yjt}T${bjt(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function kjt(e,t){return!(("v4"!==t&&t||!djt.test(e))&&("v6"!==t&&t||!hjt.test(e)))}function _jt(e,t){if(!sjt.test(e))return!1;try{const[r]=e.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return!("object"!=typeof o||null===o||"typ"in o&&"JWT"!==(null==o?void 0:o.typ)||!o.alg||t&&o.alg!==t)}catch{return!1}}function Cjt(e,t){return!(("v4"!==t&&t||!pjt.test(e))&&("v6"!==t&&t||!fjt.test(e)))}class Mjt extends tjt{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==zEt.string){const t=this._getOrReturnCtx(e);return HEt(t,{code:AEt.invalid_type,expected:zEt.string,received:t.parsedType}),$Et}const t=new qEt;let r;for(const n of this._def.checks)if("min"===n.kind)e.data.length<n.value&&(r=this._getOrReturnCtx(e,r),HEt(r,{code:AEt.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if("max"===n.kind)e.data.length>n.value&&(r=this._getOrReturnCtx(e,r),HEt(r,{code:AEt.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if("length"===n.kind){const o=e.data.length>n.value,a=e.data.length<n.value;(o||a)&&(r=this._getOrReturnCtx(e,r),o?HEt(r,{code:AEt.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):a&&HEt(r,{code:AEt.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),t.dirty())}else if("email"===n.kind)cjt.test(e.data)||(r=this._getOrReturnCtx(e,r),HEt(r,{validation:"email",code:AEt.invalid_string,message:n.message}),t.dirty());else if("emoji"===n.kind)ujt||(ujt=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),ujt.test(e.data)||(r=this._getOrReturnCtx(e,r),HEt(r,{validation:"emoji",code:AEt.invalid_string,message:n.message}),t.dirty());else if("uuid"===n.kind)ajt.test(e.data)||(r=this._getOrReturnCtx(e,r),HEt(r,{validation:"uuid",code:AEt.invalid_string,message:n.message}),t.dirty());else if("nanoid"===n.kind)ijt.test(e.data)||(r=this._getOrReturnCtx(e,r),HEt(r,{validation:"nanoid",code:AEt.invalid_string,message:n.message}),t.dirty());else if("cuid"===n.kind)rjt.test(e.data)||(r=this._getOrReturnCtx(e,r),HEt(r,{validation:"cuid",code:AEt.invalid_string,message:n.message}),t.dirty());else if("cuid2"===n.kind)njt.test(e.data)||(r=this._getOrReturnCtx(e,r),HEt(r,{validation:"cuid2",code:AEt.invalid_string,message:n.message}),t.dirty());else if("ulid"===n.kind)ojt.test(e.data)||(r=this._getOrReturnCtx(e,r),HEt(r,{validation:"ulid",code:AEt.invalid_string,message:n.message}),t.dirty());else if("url"===n.kind)try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),HEt(r,{validation:"url",code:AEt.invalid_string,message:n.message}),t.dirty()}else"regex"===n.kind?(n.regex.lastIndex=0,n.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),HEt(r,{validation:"regex",code:AEt.invalid_string,message:n.message}),t.dirty())):"trim"===n.kind?e.data=e.data.trim():"includes"===n.kind?e.data.includes(n.value,n.position)||(r=this._getOrReturnCtx(e,r),HEt(r,{code:AEt.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),t.dirty()):"toLowerCase"===n.kind?e.data=e.data.toLowerCase():"toUpperCase"===n.kind?e.data=e.data.toUpperCase():"startsWith"===n.kind?e.data.startsWith(n.value)||(r=this._getOrReturnCtx(e,r),HEt(r,{code:AEt.invalid_string,validation:{startsWith:n.value},message:n.message}),t.dirty()):"endsWith"===n.kind?e.data.endsWith(n.value)||(r=this._getOrReturnCtx(e,r),HEt(r,{code:AEt.invalid_string,validation:{endsWith:n.value},message:n.message}),t.dirty()):"datetime"===n.kind?wjt(n).test(e.data)||(r=this._getOrReturnCtx(e,r),HEt(r,{code:AEt.invalid_string,validation:"datetime",message:n.message}),t.dirty()):"date"===n.kind?gjt.test(e.data)||(r=this._getOrReturnCtx(e,r),HEt(r,{code:AEt.invalid_string,validation:"date",message:n.message}),t.dirty()):"time"===n.kind?xjt(n).test(e.data)||(r=this._getOrReturnCtx(e,r),HEt(r,{code:AEt.invalid_string,validation:"time",message:n.message}),t.dirty()):"duration"===n.kind?ljt.test(e.data)||(r=this._getOrReturnCtx(e,r),HEt(r,{validation:"duration",code:AEt.invalid_string,message:n.message}),t.dirty()):"ip"===n.kind?kjt(e.data,n.version)||(r=this._getOrReturnCtx(e,r),HEt(r,{validation:"ip",code:AEt.invalid_string,message:n.message}),t.dirty()):"jwt"===n.kind?_jt(e.data,n.alg)||(r=this._getOrReturnCtx(e,r),HEt(r,{validation:"jwt",code:AEt.invalid_string,message:n.message}),t.dirty()):"cidr"===n.kind?Cjt(e.data,n.version)||(r=this._getOrReturnCtx(e,r),HEt(r,{validation:"cidr",code:AEt.invalid_string,message:n.message}),t.dirty()):"base64"===n.kind?mjt.test(e.data)||(r=this._getOrReturnCtx(e,r),HEt(r,{validation:"base64",code:AEt.invalid_string,message:n.message}),t.dirty()):"base64url"===n.kind?vjt.test(e.data)||(r=this._getOrReturnCtx(e,r),HEt(r,{validation:"base64url",code:AEt.invalid_string,message:n.message}),t.dirty()):REt.assertNever(n);return{status:t.value,value:e.data}}_regex(e,t,r){return this.refinement(t=>e.test(t),{validation:t,code:AEt.invalid_string,...ZEt.errToObj(r)})}_addCheck(e){return new Mjt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ZEt.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ZEt.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ZEt.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ZEt.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...ZEt.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ZEt.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ZEt.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ZEt.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...ZEt.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...ZEt.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...ZEt.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ZEt.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...ZEt.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(null==e?void 0:e.precision)>"u"?null:null==e?void 0:e.precision,offset:(null==e?void 0:e.offset)??!1,local:(null==e?void 0:e.local)??!1,...ZEt.errToObj(null==e?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(null==e?void 0:e.precision)>"u"?null:null==e?void 0:e.precision,...ZEt.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...ZEt.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...ZEt.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...ZEt.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...ZEt.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...ZEt.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...ZEt.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...ZEt.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...ZEt.errToObj(t)})}nonempty(e){return this.min(1,ZEt.errToObj(e))}trim(){return new Mjt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Mjt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Mjt({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isCIDR(){return!!this._def.checks.find(e=>"cidr"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get isBase64url(){return!!this._def.checks.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function Sjt(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n;return Number.parseInt(e.toFixed(o).replace(".",""))%Number.parseInt(t.toFixed(o).replace(".",""))/10**o}Mjt.create=e=>new Mjt({checks:[],typeName:lTt.ZodString,coerce:(null==e?void 0:e.coerce)??!1,...ejt(e)});class Djt extends tjt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==zEt.number){const t=this._getOrReturnCtx(e);return HEt(t,{code:AEt.invalid_type,expected:zEt.number,received:t.parsedType}),$Et}let t;const r=new qEt;for(const n of this._def.checks)"int"===n.kind?REt.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),HEt(t,{code:AEt.invalid_type,expected:"integer",received:"float",message:n.message}),r.dirty()):"min"===n.kind?(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),HEt(t,{code:AEt.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty()):"max"===n.kind?(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),HEt(t,{code:AEt.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty()):"multipleOf"===n.kind?0!==Sjt(e.data,n.value)&&(t=this._getOrReturnCtx(e,t),HEt(t,{code:AEt.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):"finite"===n.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),HEt(t,{code:AEt.not_finite,message:n.message}),r.dirty()):REt.assertNever(n);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,ZEt.toString(t))}gt(e,t){return this.setLimit("min",e,!1,ZEt.toString(t))}lte(e,t){return this.setLimit("max",e,!0,ZEt.toString(t))}lt(e,t){return this.setLimit("max",e,!1,ZEt.toString(t))}setLimit(e,t,r,n){return new Djt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:ZEt.toString(n)}]})}_addCheck(e){return new Djt({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ZEt.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ZEt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ZEt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ZEt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ZEt.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:ZEt.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:ZEt.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ZEt.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ZEt.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>"int"===e.kind||"multipleOf"===e.kind&&REt.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}Djt.create=e=>new Djt({checks:[],typeName:lTt.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...ejt(e)});class Ojt extends tjt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==zEt.bigint)return this._getInvalidInput(e);let t;const r=new qEt;for(const n of this._def.checks)"min"===n.kind?(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),HEt(t,{code:AEt.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty()):"max"===n.kind?(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),HEt(t,{code:AEt.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty()):"multipleOf"===n.kind?e.data%n.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),HEt(t,{code:AEt.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):REt.assertNever(n);return{status:r.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return HEt(t,{code:AEt.invalid_type,expected:zEt.bigint,received:t.parsedType}),$Et}gte(e,t){return this.setLimit("min",e,!0,ZEt.toString(t))}gt(e,t){return this.setLimit("min",e,!1,ZEt.toString(t))}lte(e,t){return this.setLimit("max",e,!0,ZEt.toString(t))}lt(e,t){return this.setLimit("max",e,!1,ZEt.toString(t))}setLimit(e,t,r,n){return new Ojt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:ZEt.toString(n)}]})}_addCheck(e){return new Ojt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ZEt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ZEt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ZEt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ZEt.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:ZEt.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}Ojt.create=e=>new Ojt({checks:[],typeName:lTt.ZodBigInt,coerce:(null==e?void 0:e.coerce)??!1,...ejt(e)});class Pjt extends tjt{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==zEt.boolean){const t=this._getOrReturnCtx(e);return HEt(t,{code:AEt.invalid_type,expected:zEt.boolean,received:t.parsedType}),$Et}return UEt(e.data)}}Pjt.create=e=>new Pjt({typeName:lTt.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...ejt(e)});class Ejt extends tjt{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==zEt.date){const t=this._getOrReturnCtx(e);return HEt(t,{code:AEt.invalid_type,expected:zEt.date,received:t.parsedType}),$Et}if(Number.isNaN(e.data.getTime())){return HEt(this._getOrReturnCtx(e),{code:AEt.invalid_date}),$Et}const t=new qEt;let r;for(const n of this._def.checks)"min"===n.kind?e.data.getTime()<n.value&&(r=this._getOrReturnCtx(e,r),HEt(r,{code:AEt.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),t.dirty()):"max"===n.kind?e.data.getTime()>n.value&&(r=this._getOrReturnCtx(e,r),HEt(r,{code:AEt.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),t.dirty()):REt.assertNever(n);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Ejt({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:ZEt.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:ZEt.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}Ejt.create=e=>new Ejt({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:lTt.ZodDate,...ejt(e)});class jjt extends tjt{_parse(e){if(this._getType(e)!==zEt.symbol){const t=this._getOrReturnCtx(e);return HEt(t,{code:AEt.invalid_type,expected:zEt.symbol,received:t.parsedType}),$Et}return UEt(e.data)}}jjt.create=e=>new jjt({typeName:lTt.ZodSymbol,...ejt(e)});class Tjt extends tjt{_parse(e){if(this._getType(e)!==zEt.undefined){const t=this._getOrReturnCtx(e);return HEt(t,{code:AEt.invalid_type,expected:zEt.undefined,received:t.parsedType}),$Et}return UEt(e.data)}}Tjt.create=e=>new Tjt({typeName:lTt.ZodUndefined,...ejt(e)});class Njt extends tjt{_parse(e){if(this._getType(e)!==zEt.null){const t=this._getOrReturnCtx(e);return HEt(t,{code:AEt.invalid_type,expected:zEt.null,received:t.parsedType}),$Et}return UEt(e.data)}}Njt.create=e=>new Njt({typeName:lTt.ZodNull,...ejt(e)});class Rjt extends tjt{constructor(){super(...arguments),this._any=!0}_parse(e){return UEt(e.data)}}Rjt.create=e=>new Rjt({typeName:lTt.ZodAny,...ejt(e)});class Fjt extends tjt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return UEt(e.data)}}Fjt.create=e=>new Fjt({typeName:lTt.ZodUnknown,...ejt(e)});class zjt extends tjt{_parse(e){const t=this._getOrReturnCtx(e);return HEt(t,{code:AEt.invalid_type,expected:zEt.never,received:t.parsedType}),$Et}}zjt.create=e=>new zjt({typeName:lTt.ZodNever,...ejt(e)});class Ijt extends tjt{_parse(e){if(this._getType(e)!==zEt.undefined){const t=this._getOrReturnCtx(e);return HEt(t,{code:AEt.invalid_type,expected:zEt.void,received:t.parsedType}),$Et}return UEt(e.data)}}Ijt.create=e=>new Ijt({typeName:lTt.ZodVoid,...ejt(e)});class Ajt extends tjt{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==zEt.array)return HEt(t,{code:AEt.invalid_type,expected:zEt.array,received:t.parsedType}),$Et;if(null!==n.exactLength){const e=t.data.length>n.exactLength.value,o=t.data.length<n.exactLength.value;(e||o)&&(HEt(t,{code:e?AEt.too_big:AEt.too_small,minimum:o?n.exactLength.value:void 0,maximum:e?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),r.dirty())}if(null!==n.minLength&&t.data.length<n.minLength.value&&(HEt(t,{code:AEt.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),r.dirty()),null!==n.maxLength&&t.data.length>n.maxLength.value&&(HEt(t,{code:AEt.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((e,r)=>n.type._parseAsync(new QEt(t,e,t.path,r)))).then(e=>qEt.mergeArray(r,e));const o=[...t.data].map((e,r)=>n.type._parseSync(new QEt(t,e,t.path,r)));return qEt.mergeArray(r,o)}get element(){return this._def.type}min(e,t){return new Ajt({...this._def,minLength:{value:e,message:ZEt.toString(t)}})}max(e,t){return new Ajt({...this._def,maxLength:{value:e,message:ZEt.toString(t)}})}length(e,t){return new Ajt({...this._def,exactLength:{value:e,message:ZEt.toString(t)}})}nonempty(e){return this.min(1,e)}}function Ljt(e){if(e instanceof Bjt){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=eTt.create(Ljt(n))}return new Bjt({...e._def,shape:()=>t})}return e instanceof Ajt?new Ajt({...e._def,type:Ljt(e.element)}):e instanceof eTt?eTt.create(Ljt(e.unwrap())):e instanceof tTt?tTt.create(Ljt(e.unwrap())):e instanceof $jt?$jt.create(e.items.map(e=>Ljt(e))):e}Ajt.create=(e,t)=>new Ajt({type:e,minLength:null,maxLength:null,exactLength:null,typeName:lTt.ZodArray,...ejt(t)});class Bjt extends tjt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=REt.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==zEt.object){const t=this._getOrReturnCtx(e);return HEt(t,{code:AEt.invalid_type,expected:zEt.object,received:t.parsedType}),$Et}const{status:t,ctx:r}=this._processInputParams(e),{shape:n,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof zjt&&"strip"===this._def.unknownKeys))for(const e in r.data)o.includes(e)||a.push(e);const i=[];for(const e of o){const t=n[e],o=r.data[e];i.push({key:{status:"valid",value:e},value:t._parse(new QEt(r,o,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof zjt){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of a)i.push({key:{status:"valid",value:e},value:{status:"valid",value:r.data[e]}});else if("strict"===e)a.length>0&&(HEt(r,{code:AEt.unrecognized_keys,keys:a}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of a){const n=r.data[t];i.push({key:{status:"valid",value:t},value:e._parse(new QEt(r,n,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const e=[];for(const t of i){const r=await t.key,n=await t.value;e.push({key:r,value:n,alwaysSet:t.alwaysSet})}return e}).then(e=>qEt.mergeObjectSync(t,e)):qEt.mergeObjectSync(t,i)}get shape(){return this._def.shape()}strict(e){return ZEt.errToObj,new Bjt({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{var n,o;const a=(null==(o=(n=this._def).errorMap)?void 0:o.call(n,t,r).message)??r.defaultError;return"unrecognized_keys"===t.code?{message:ZEt.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new Bjt({...this._def,unknownKeys:"strip"})}passthrough(){return new Bjt({...this._def,unknownKeys:"passthrough"})}extend(e){return new Bjt({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Bjt({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:lTt.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Bjt({...this._def,catchall:e})}pick(e){const t={};for(const r of REt.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new Bjt({...this._def,shape:()=>t})}omit(e){const t={};for(const r of REt.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new Bjt({...this._def,shape:()=>t})}deepPartial(){return Ljt(this)}partial(e){const t={};for(const r of REt.objectKeys(this.shape)){const n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()}return new Bjt({...this._def,shape:()=>t})}required(e){const t={};for(const r of REt.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let e=this.shape[r];for(;e instanceof eTt;)e=e._def.innerType;t[r]=e}return new Bjt({...this._def,shape:()=>t})}keyof(){return Yjt(REt.objectKeys(this.shape))}}Bjt.create=(e,t)=>new Bjt({shape:()=>e,unknownKeys:"strip",catchall:zjt.create(),typeName:lTt.ZodObject,...ejt(t)}),Bjt.strictCreate=(e,t)=>new Bjt({shape:()=>e,unknownKeys:"strict",catchall:zjt.create(),typeName:lTt.ZodObject,...ejt(t)}),Bjt.lazycreate=(e,t)=>new Bjt({shape:e,unknownKeys:"strip",catchall:zjt.create(),typeName:lTt.ZodObject,...ejt(t)});class Vjt extends tjt{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map(async e=>{const r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}})).then(function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;const r=e.map(e=>new LEt(e.ctx.common.issues));return HEt(t,{code:AEt.invalid_union,unionErrors:r}),$Et});{let e;const n=[];for(const o of r){const r={...t,common:{...t.common,issues:[]},parent:null},a=o._parseSync({data:t.data,path:t.path,parent:r});if("valid"===a.status)return a;"dirty"===a.status&&!e&&(e={result:a,ctx:r}),r.common.issues.length&&n.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const o=n.map(e=>new LEt(e));return HEt(t,{code:AEt.invalid_union,unionErrors:o}),$Et}}get options(){return this._def.options}}function Hjt(e,t){const r=IEt(e),n=IEt(t);if(e===t)return{valid:!0,data:e};if(r===zEt.object&&n===zEt.object){const r=REt.objectKeys(t),n=REt.objectKeys(e).filter(e=>-1!==r.indexOf(e)),o={...e,...t};for(const r of n){const n=Hjt(e[r],t[r]);if(!n.valid)return{valid:!1};o[r]=n.data}return{valid:!0,data:o}}if(r===zEt.array&&n===zEt.array){if(e.length!==t.length)return{valid:!1};const r=[];for(let n=0;n<e.length;n++){const o=Hjt(e[n],t[n]);if(!o.valid)return{valid:!1};r.push(o.data)}return{valid:!0,data:r}}return r===zEt.date&&n===zEt.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}Vjt.create=(e,t)=>new Vjt({options:e,typeName:lTt.ZodUnion,...ejt(t)});class qjt extends tjt{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=(e,n)=>{if(GEt(e)||GEt(n))return $Et;const o=Hjt(e.value,n.value);return o.valid?((KEt(e)||KEt(n))&&t.dirty(),{status:t.value,value:o.data}):(HEt(r,{code:AEt.invalid_intersection_types}),$Et)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([e,t])=>n(e,t)):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}qjt.create=(e,t,r)=>new qjt({left:e,right:t,typeName:lTt.ZodIntersection,...ejt(r)});class $jt extends tjt{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==zEt.array)return HEt(r,{code:AEt.invalid_type,expected:zEt.array,received:r.parsedType}),$Et;if(r.data.length<this._def.items.length)return HEt(r,{code:AEt.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),$Et;!this._def.rest&&r.data.length>this._def.items.length&&(HEt(r,{code:AEt.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const n=[...r.data].map((e,t)=>{const n=this._def.items[t]||this._def.rest;return n?n._parse(new QEt(r,e,r.path,t)):null}).filter(e=>!!e);return r.common.async?Promise.all(n).then(e=>qEt.mergeArray(t,e)):qEt.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new $jt({...this._def,rest:e})}}$jt.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new $jt({items:e,typeName:lTt.ZodTuple,rest:null,...ejt(t)})};class Wjt extends tjt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==zEt.map)return HEt(r,{code:AEt.invalid_type,expected:zEt.map,received:r.parsedType}),$Et;const n=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([e,t],a)=>({key:n._parse(new QEt(r,e,r.path,[a,"key"])),value:o._parse(new QEt(r,t,r.path,[a,"value"]))}));if(r.common.async){const e=new Map;return Promise.resolve().then(async()=>{for(const r of a){const n=await r.key,o=await r.value;if("aborted"===n.status||"aborted"===o.status)return $Et;("dirty"===n.status||"dirty"===o.status)&&t.dirty(),e.set(n.value,o.value)}return{status:t.value,value:e}})}{const e=new Map;for(const r of a){const n=r.key,o=r.value;if("aborted"===n.status||"aborted"===o.status)return $Et;("dirty"===n.status||"dirty"===o.status)&&t.dirty(),e.set(n.value,o.value)}return{status:t.value,value:e}}}}Wjt.create=(e,t,r)=>new Wjt({valueType:t,keyType:e,typeName:lTt.ZodMap,...ejt(r)});class Ujt extends tjt{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==zEt.set)return HEt(r,{code:AEt.invalid_type,expected:zEt.set,received:r.parsedType}),$Et;const n=this._def;null!==n.minSize&&r.data.size<n.minSize.value&&(HEt(r,{code:AEt.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),null!==n.maxSize&&r.data.size>n.maxSize.value&&(HEt(r,{code:AEt.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const o=this._def.valueType;function a(e){const r=new Set;for(const n of e){if("aborted"===n.status)return $Et;"dirty"===n.status&&t.dirty(),r.add(n.value)}return{status:t.value,value:r}}const i=[...r.data.values()].map((e,t)=>o._parse(new QEt(r,e,r.path,t)));return r.common.async?Promise.all(i).then(e=>a(e)):a(i)}min(e,t){return new Ujt({...this._def,minSize:{value:e,message:ZEt.toString(t)}})}max(e,t){return new Ujt({...this._def,maxSize:{value:e,message:ZEt.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Ujt.create=(e,t)=>new Ujt({valueType:e,minSize:null,maxSize:null,typeName:lTt.ZodSet,...ejt(t)});class Gjt extends tjt{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Gjt.create=(e,t)=>new Gjt({getter:e,typeName:lTt.ZodLazy,...ejt(t)});class Kjt extends tjt{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return HEt(t,{received:t.data,code:AEt.invalid_literal,expected:this._def.value}),$Et}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Yjt(e,t){return new Xjt({values:e,typeName:lTt.ZodEnum,...ejt(t)})}Kjt.create=(e,t)=>new Kjt({value:e,typeName:lTt.ZodLiteral,...ejt(t)});class Xjt extends tjt{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),r=this._def.values;return HEt(t,{expected:REt.joinValues(r),received:t.parsedType,code:AEt.invalid_type}),$Et}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return HEt(t,{received:t.data,code:AEt.invalid_enum_value,options:r}),$Et}return UEt(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Xjt.create(e,{...this._def,...t})}exclude(e,t=this._def){return Xjt.create(this.options.filter(t=>!e.includes(t)),{...this._def,...t})}}Xjt.create=Yjt;class Zjt extends tjt{_parse(e){const t=REt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==zEt.string&&r.parsedType!==zEt.number){const e=REt.objectValues(t);return HEt(r,{expected:REt.joinValues(e),received:r.parsedType,code:AEt.invalid_type}),$Et}if(this._cache||(this._cache=new Set(REt.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const e=REt.objectValues(t);return HEt(r,{received:r.data,code:AEt.invalid_enum_value,options:e}),$Et}return UEt(e.data)}get enum(){return this._def.values}}Zjt.create=(e,t)=>new Zjt({values:e,typeName:lTt.ZodNativeEnum,...ejt(t)});class Qjt extends tjt{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==zEt.promise&&!1===t.common.async)return HEt(t,{code:AEt.invalid_type,expected:zEt.promise,received:t.parsedType}),$Et;const r=t.parsedType===zEt.promise?t.data:Promise.resolve(t.data);return UEt(r.then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Qjt.create=(e,t)=>new Qjt({type:e,typeName:lTt.ZodPromise,...ejt(t)});class Jjt extends tjt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===lTt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,o={addIssue:e=>{HEt(r,e),e.fatal?t.abort():t.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),"preprocess"===n.type){const e=n.transform(r.data,o);if(r.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return $Et;const n=await this._def.schema._parseAsync({data:e,path:r.path,parent:r});return"aborted"===n.status?$Et:"dirty"===n.status||"dirty"===t.value?WEt(n.value):n});{if("aborted"===t.value)return $Et;const n=this._def.schema._parseSync({data:e,path:r.path,parent:r});return"aborted"===n.status?$Et:"dirty"===n.status||"dirty"===t.value?WEt(n.value):n}}if("refinement"===n.type){const e=e=>{const t=n.refinement(e,o);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===r.common.async){const n=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===n.status?$Et:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(r=>"aborted"===r.status?$Et:("dirty"===r.status&&t.dirty(),e(r.value).then(()=>({status:t.value,value:r.value}))))}if("transform"===n.type){if(!1===r.common.async){const e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!YEt(e))return $Et;const a=n.transform(e.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(e=>YEt(e)?Promise.resolve(n.transform(e.value,o)).then(e=>({status:t.value,value:e})):$Et)}REt.assertNever(n)}}Jjt.create=(e,t,r)=>new Jjt({schema:e,typeName:lTt.ZodEffects,effect:t,...ejt(r)}),Jjt.createWithPreprocess=(e,t,r)=>new Jjt({schema:t,effect:{type:"preprocess",transform:e},typeName:lTt.ZodEffects,...ejt(r)});class eTt extends tjt{_parse(e){return this._getType(e)===zEt.undefined?UEt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}eTt.create=(e,t)=>new eTt({innerType:e,typeName:lTt.ZodOptional,...ejt(t)});class tTt extends tjt{_parse(e){return this._getType(e)===zEt.null?UEt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}tTt.create=(e,t)=>new tTt({innerType:e,typeName:lTt.ZodNullable,...ejt(t)});class rTt extends tjt{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===zEt.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}rTt.create=(e,t)=>new rTt({innerType:e,typeName:lTt.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...ejt(t)});class nTt extends tjt{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return XEt(n)?n.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new LEt(r.common.issues)},input:r.data})})):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new LEt(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}nTt.create=(e,t)=>new nTt({innerType:e,typeName:lTt.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...ejt(t)});class oTt extends tjt{_parse(e){if(this._getType(e)!==zEt.nan){const t=this._getOrReturnCtx(e);return HEt(t,{code:AEt.invalid_type,expected:zEt.nan,received:t.parsedType}),$Et}return{status:"valid",value:e.data}}}oTt.create=e=>new oTt({typeName:lTt.ZodNaN,...ejt(e)});class aTt extends tjt{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class iTt extends tjt{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?$Et:"dirty"===e.status?(t.dirty(),WEt(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})();{const e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?$Et:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new iTt({in:e,out:t,typeName:lTt.ZodPipeline})}}class sTt extends tjt{_parse(e){const t=this._def.innerType._parse(e),r=e=>(YEt(e)&&(e.value=Object.freeze(e.value)),e);return XEt(t)?t.then(e=>r(e)):r(t)}unwrap(){return this._def.innerType}}var lTt;sTt.create=(e,t)=>new sTt({innerType:e,typeName:lTt.ZodReadonly,...ejt(t)}),function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(lTt||(lTt={}));const cTt=Mjt.create,uTt=Pjt.create,dTt=Ejt.create;zjt.create;const pTt=Ajt.create,hTt=Bjt.create;Vjt.create,qjt.create,$jt.create;const fTt=Xjt.create;Qjt.create,eTt.create,tTt.create;const mTt=fTt(["daily","weekly","monthly"]),vTt=e=>{const t=cTt().refine(e=>(e=>/^([0-1]?\d|2[0-3]):[0-5]\d$/.test(e))(e)||HDt(e),e.validations.invalidTimeFormat);return hTt({id:cTt().optional(),title:cTt().min(1,e.validations.eventNameRequired),description:cTt().optional(),startDate:dTt(),endDate:dTt(),startTime:t,endTime:t,color:cTt().min(1,e.validations.colorRequired),isRepeating:uTt(),isRepeatingInterval:mTt.default("daily").optional(),isRepeatingExcludedDates:pTt(dTt()).optional(),resourceId:cTt().optional(),eventType:cTt().optional(),visibility:fTt(["public","private"]).optional()}).refine(e=>{if(e.isRepeating)return WDt(e.endTime)>=WDt(e.startTime);const t=$Dt(e.startDate,e.startTime);return $Dt(e.endDate,e.endTime)>t},{message:e.validations.endTimeBeforeStart,path:["endTime"]})},yTt=({event:r,onAddEvent:n,onUpdateEvent:o,onDeleteEvent:a,onClosePopup:i,open:s,dateFromViewClick:c,translations:u,resources:d})=>{const[p,h]=e.useState(!1),[f,m]=e.useState(!1),[v,y]=e.useState(!1),[g,b]=e.useState(!1),[x,w]=e.useState(!1),[k,_]=e.useState("single"),[C,M]=e.useState("all"),[S,D]=e.useState(!1),O=function(e={}){const t=l.default.useRef(void 0),r=l.default.useRef(void 0),[n,o]=l.default.useState({isDirty:!1,isValidating:!1,isLoading:Nft(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:Nft(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!Nft(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:r,...o}=umt(e);t.current={...o,formState:n}}const a=t.current.control;return a._options=e,wft(()=>{const e=a._subscribe({formState:a._proxyFormState,callback:()=>o({...a._formState}),reRenderRoot:!0});return o(e=>({...e,isReady:!0})),a._formState.isReady=!0,e},[a]),l.default.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),l.default.useEffect(()=>{e.mode&&(a._options.mode=e.mode),e.reValidateMode&&(a._options.reValidateMode=e.reValidateMode)},[a,e.mode,e.reValidateMode]),l.default.useEffect(()=>{e.errors&&(a._setErrors(e.errors),a._focusError())},[a,e.errors]),l.default.useEffect(()=>{e.shouldUnregister&&a._subjects.state.next({values:a._getWatch()})},[a,e.shouldUnregister]),l.default.useEffect(()=>{if(a._proxyFormState.isDirty){const e=a._getDirty();e!==n.isDirty&&a._subjects.state.next({isDirty:e})}},[a,n.isDirty]),l.default.useEffect(()=>{e.values&&!Eft(e.values,r.current)?(a._reset(e.values,{keepFieldsRef:!0,...a._options.resetOptions}),r.current=e.values,o(e=>({...e}))):a._resetDefaultValues()},[a,e.values]),l.default.useEffect(()=>{a._state.mount||(a._setValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),t.current.formState=xft(n,a),t.current}({resolver:gbt(vTt(u)),defaultValues:{id:(null==r?void 0:r.id)||"",title:(null==r?void 0:r.title)||"",description:(null==r?void 0:r.description)||"",startDate:(null==r?void 0:r.startDate)||new Date,endDate:(null==r?void 0:r.endDate)||new Date,startTime:(null==r?void 0:r.startTime)||"09:00",endTime:(null==r?void 0:r.endTime)||"10:00",color:(null==r?void 0:r.color)||"blue",isRepeating:(null==r?void 0:r.isRepeating)||!1,isRepeatingInterval:(null==r?void 0:r.isRepeatingInterval)||"daily",isRepeatingExcludedDates:(null==r?void 0:r.isRepeatingExcludedDates)||[]}});if(e.useEffect(()=>{const e=O.getValues("startDate"),t=O.getValues("endDate"),r=e.toDateString()===t.toDateString();m(!r)},[O,s]),e.useEffect(()=>{O.reset({title:(null==r?void 0:r.title)||"",description:(null==r?void 0:r.description)||"",startDate:(null==r?void 0:r.startDate)||new Date,endDate:(null==r?void 0:r.endDate)||new Date,startTime:(null==r?void 0:r.startTime)||"09:00",endTime:(null==r?void 0:r.endTime)||"10:00",color:(null==r?void 0:r.color)||"blue",isRepeating:(null==r?void 0:r.isRepeating)||!1,isRepeatingInterval:(null==r?void 0:r.isRepeatingInterval)||"daily",isRepeatingExcludedDates:(null==r?void 0:r.isRepeatingExcludedDates)||[],resourceId:null==r?void 0:r.resourceId})},[O,s,r]),e.useEffect(()=>{if(d&&0!==d.length&&!O.getValues("resourceId")){const e=null==r?void 0:r.color;if(e){const t=d.find(t=>t.color===e||t.id===e);t&&O.setValue("resourceId",t.id)}}},[d,r,O]),e.useEffect(()=>{const e=O.watch((e,{name:t})=>{if("startDate"===t||"endDate"===t){const t=e.startDate,r=e.endDate;t>r&&O.setValue("endDate",t);const n=t.toDateString()===r.toDateString();m(!n),n&&O.setValue("isRepeating",!1)}});return()=>e.unsubscribe()},[O]),!u)return console.error("Translations are required for PopupContent"),null;const P=async e=>{var t;h(!0);try{if(null==r||!r.id){const t={startDate:e.startDate,endDate:e.endDate,title:e.title,startTime:e.startTime,endTime:e.endTime,description:e.description,color:e.color,resourceId:e.resourceId,isRepeating:e.isRepeating,isRepeatingInterval:e.isRepeatingInterval||"daily",isRepeatingExcludedDates:e.isRepeatingExcludedDates||[]};return void await Promise.resolve(n(t))}if(!0!==r.isRepeating){console.log("Updating non-repeating event");const t={...r,startDate:e.startDate,endDate:e.endDate,title:e.title,startTime:e.startTime,endTime:e.endTime,description:e.description,color:e.color,resourceId:e.resourceId,isRepeating:e.isRepeating,isRepeatingInterval:e.isRepeatingInterval||"daily",isRepeatingExcludedDates:e.isRepeatingExcludedDates||[]};return void(o&&await Promise.resolve(o(t)))}const a=c||r.startDate||new Date;switch(C){case"single":{const t=new Date(a.getFullYear(),a.getMonth(),a.getDate()),i=(r.isRepeatingExcludedDates||[]).map(e=>{if(e instanceof Date)return new Date(e.getFullYear(),e.getMonth(),e.getDate());try{const t=new Date(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate())}catch{return null}}).filter(e=>null!==e),s=t.toDateString();if(!i.some(e=>e.toDateString()===s)){const e={...r,isRepeatingExcludedDates:[...i,t]};o&&await Promise.resolve(o(e))}const l={title:e.title,description:e.description,startDate:t,endDate:t,startTime:e.startTime,endTime:e.endTime,color:e.color,isRepeating:!1,isRepeatingInterval:"daily",isRepeatingExcludedDates:[]};await Promise.resolve(n(l));break}case"future":if(a.toDateString()===(null==(t=r.startDate)?void 0:t.toDateString())){const t={...r,...e};o&&await Promise.resolve(o(t))}else{const t=new Date(a);t.setDate(t.getDate()-1);const i={...r,endDate:t};o&&await Promise.resolve(o(i));const s={title:e.title,description:e.description,startDate:a,endDate:e.endDate,startTime:e.startTime,endTime:e.endTime,color:e.color,isRepeating:!0,isRepeatingInterval:e.isRepeatingInterval||"daily",isRepeatingExcludedDates:e.isRepeatingExcludedDates||[]};await Promise.resolve(n(s))}break;case"all":{const t={...r,...e};o&&await Promise.resolve(o(t));break}}}catch(e){console.error("Error saving event:",e),TDt.error("Error saving event")}finally{h(!1),null==i||i()}};return t.jsxs(wdt,{className:"sm:max-w-[425px] w-full max-h-[90vh] overflow-y-auto",children:[t.jsxs(kdt,{children:[t.jsxs(Cdt,{className:"text-lg sm:text-xl flex items-center",children:[t.jsx(_st,{className:"mr-2 h-5 w-5"}),null!=r&&r.id?u.editEvent:u.addEvent]}),t.jsx(Mdt,{className:"text-sm sm:text-base",children:null!=r&&r.id?u.editEventDescription:u.createEventDescription})]}),t.jsxs(mmt,{...O,children:[t.jsx(BDt,{open:S,onClose:()=>D(!1),editType:C,onEditTypeChange:e=>M(e),onConfirm:()=>{D(!1),O.handleSubmit(P)()},translations:u}),t.jsxs("form",{onSubmit:e=>{var t,n,o,a;if(e.preventDefault(),null!=r&&r.id&&!0===r.isRepeating){const e=O.getValues(),i=(null==(t=e.startDate)?void 0:t.getTime())!==(null==(n=r.startDate)?void 0:n.getTime()),s=(null==(o=e.endDate)?void 0:o.getTime())!==(null==(a=r.endDate)?void 0:a.getTime()),l=e.isRepeating!==r.isRepeating,c=e.isRepeatingInterval!==(r.isRepeatingInterval||"daily"),u=e.isRepeatingExcludedDates||[],d=r.isRepeatingExcludedDates||[],p=JSON.stringify(u),h=JSON.stringify(d);if(!(i||s||l||c||p!==h||S||e.title===r.title&&e.description===r.description&&e.color===r.color&&e.startTime===r.startTime&&e.endTime===r.endTime))return void D(!0)}O.handleSubmit(P)(e)},className:"space-y-4",children:[t.jsx(ymt,{control:O.control,name:"title",render:({field:e})=>t.jsxs(xmt,{children:[t.jsx(wmt,{children:u.eventTitle}),t.jsx(kmt,{children:t.jsx(Mmt,{placeholder:u.eventTitle,...e,autoFocus:!r})}),t.jsx(Cmt,{})]})}),t.jsx(ymt,{control:O.control,name:"description",render:({field:e})=>t.jsxs(xmt,{children:[t.jsx(wmt,{children:u.eventDescription}),t.jsx(kmt,{children:t.jsx(pbt,{placeholder:u.eventDescription,...e})}),t.jsx(Cmt,{})]})}),t.jsx(NEt,{form:O,translations:u}),t.jsxs("div",{className:"flex space-x-4",children:[t.jsx(ymt,{control:O.control,name:"startDate",render:({field:e})=>t.jsxs(xmt,{className:"flex-1",children:[t.jsx(wmt,{children:u.eventDate}),t.jsxs(fgt,{open:v,onOpenChange:y,children:[t.jsx(mgt,{asChild:!0,children:t.jsx(kmt,{children:t.jsxs(Edt,{variant:"outline",className:"w-full justify-start text-left font-normal",children:[t.jsx(kst,{className:"mr-2 h-4 w-4"}),e.value?Vit(e.value,"PPP"):t.jsx("span",{children:u.pickADate})]})})}),t.jsx(vgt,{className:"w-auto p-0",children:t.jsx(Bht,{mode:"single",selected:e.value,onSelect:t=>{e.onChange(t),y(!1)},defaultMonth:e.value||new Date})})]}),t.jsx(Cmt,{})]})}),t.jsx(ymt,{control:O.control,name:"startTime",render:({field:e})=>t.jsxs(xmt,{className:"flex-1",children:[t.jsx(wmt,{children:u.eventStartTime}),t.jsx(kmt,{children:t.jsx(LPt,{value:e.value,onChange:e.onChange})}),t.jsx(Cmt,{})]})})]}),t.jsxs("div",{className:"flex space-x-4",children:[t.jsx(ymt,{control:O.control,name:"endDate",render:({field:e})=>t.jsxs(xmt,{className:"flex-1",children:[t.jsx(wmt,{children:u.eventEndDate}),t.jsxs(fgt,{open:g,onOpenChange:b,children:[t.jsx(mgt,{asChild:!0,children:t.jsx(kmt,{children:t.jsxs(Edt,{variant:"outline",className:"w-full justify-start text-left font-normal",children:[t.jsx(kst,{className:"mr-2 h-4 w-4"}),e.value?Vit(e.value,"PPP"):t.jsx("span",{children:u.pickADate})]})})}),t.jsx(vgt,{className:"w-auto p-0",children:t.jsx(Bht,{mode:"single",selected:e.value,onSelect:t=>{if(!t)return;const r=O.getValues("startDate"),n=new Date(r.getFullYear(),r.getMonth(),r.getDate()),o=new Date(t.getFullYear(),t.getMonth(),t.getDate());o>n?(e.onChange(t),b(!1)):o<n?TDt.error(u.errorEndDateBeforeStart):(e.onChange(t),b(!1))},fromDate:O.getValues("startDate"),defaultMonth:e.value||new Date})})]}),t.jsx(Cmt,{})]})}),t.jsx(ymt,{control:O.control,name:"endTime",render:({field:e})=>t.jsxs(xmt,{className:"flex-1",children:[t.jsx(wmt,{children:u.eventEndTime}),t.jsx(kmt,{children:t.jsx(LPt,{value:e.value,onChange:e.onChange})}),t.jsx(Cmt,{})]})})]}),t.jsx(Tbt,{children:t.jsx(APt,{form:O,translations:u,showRepeatToggle:f})}),d&&d.length>0?t.jsx(ymt,{control:O.control,name:"resourceId",render:({field:e})=>t.jsxs(xmt,{children:[t.jsx(wmt,{children:"Resource"}),t.jsxs(mPt,{onValueChange:t=>{e.onChange(t);const r=null==d?void 0:d.find(e=>e.id===t);null!=r&&r.color&&O.setValue("color",r.color)},value:e.value,children:[t.jsx(kmt,{children:t.jsx(yPt,{children:t.jsx(vPt,{placeholder:"Select resource"})})}),t.jsx(xPt,{children:d.map(e=>t.jsx(kPt,{value:e.id,children:t.jsxs("div",{className:"flex items-center",children:[e.accentClass&&t.jsx("div",{className:`w-4 h-4 rounded mr-2 ${e.accentClass}`}),e.name]})},e.id))})]}),t.jsx(Cmt,{})]})}):null,t.jsxs(_dt,{className:"flex flex-col space-y-3 sm:space-y-0 sm:flex-row sm:justify-between items-center w-full",children:[(null==r?void 0:r.id)&&t.jsx("div",{className:"w-full sm:w-auto",children:t.jsxs(apt,{children:[t.jsx(ipt,{asChild:!0,children:t.jsx(Edt,{disabled:x,type:"button",variant:"destructive",size:"sm",className:"w-full gap-1 h-10 sm:w-auto bg-red-600 dark:bg-red-800 hover:bg-red-500 dark:hover:bg-red-900 text-xs sm:text-sm",children:x?t.jsxs(t.Fragment,{children:[t.jsx(Vst,{className:"h-4 w-4 animate-spin"}),u.deleting]}):t.jsxs(t.Fragment,{children:[t.jsx($st,{className:"h-4 w-4"}),u.delete]})})}),t.jsxs(cpt,{className:"max-w-[425px]",children:[t.jsxs(upt,{children:[t.jsxs(ppt,{className:"flex items-center",children:[t.jsx(jst,{className:"mr-2 h-5 w-5 text-red-500"}),null!=r&&r.isRepeating?u.repeatEventDeleteTitle:u.confirmDelete]}),t.jsx(hpt,{className:"text-left",children:null!=r&&r.isRepeating?u.repeatEventDeleteDescription:u.confirmDeleteDescription}),t.jsx("div",{className:"h-2"}),(null==r?void 0:r.isRepeating)&&t.jsx("div",{className:"mt-4 space-y-4",children:t.jsx(ubt,{defaultValue:"single",onValueChange:e=>_(e),children:t.jsx("div",{className:"space-y-4",children:[{value:"single",label:u.deleteThisOccurrence,description:u.deleteThisOccurrenceDescription},{value:"future",label:u.deleteThisAndFuture,description:u.deleteThisAndFutureDescription},{value:"all",label:u.deleteAllOccurrences,description:u.deleteAllOccurrencesDescription}].map(e=>t.jsxs("div",{className:"flex space-x-4",children:[t.jsx(dbt,{value:e.value,id:e.value}),t.jsxs(fmt,{htmlFor:e.value,className:"flex flex-col flex-1 items-start cursor-pointer",children:[t.jsx("span",{className:"leading-none",children:e.label}),t.jsx("span",{className:"text-sm text-muted-foreground mt-1",children:e.description})]})]},e.value))})})}),t.jsx("div",{className:"h-2"})]}),t.jsxs(dpt,{children:[t.jsx(mpt,{children:u.cancel}),t.jsxs(fpt,{onClick:async()=>{var e;if(null==r||!r.id)throw Error("Missing Event Id");w(!0);try{const t=c||r.startDate||new Date;if(!r.isRepeating||"all"===k)return void(a&&await Promise.resolve(a(r.id)));if("single"===k){const e=new Date(t.getFullYear(),t.getMonth(),t.getDate()),n=(r.isRepeatingExcludedDates||[]).map(e=>{if(e instanceof Date)return new Date(e.getFullYear(),e.getMonth(),e.getDate());try{const t=new Date(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate())}catch{return null}}).filter(e=>null!==e),a=e.toDateString(),i=n.some(e=>e.toDateString()===a)?n:[...n,e],s={...r,id:r.id,isRepeatingExcludedDates:i};o&&await Promise.resolve(o(s))}else if("future"===k)if(t.toDateString()===(null==(e=r.startDate)?void 0:e.toDateString()))a&&await Promise.resolve(a(r.id));else{const e=new Date(t);e.setDate(e.getDate()-1);const n={...r,id:r.id,endDate:e};o&&await Promise.resolve(o(n))}}finally{w(!1),null==i||i()}},className:"w-full sm:w-auto bg-red-600 dark:bg-red-800 hover:bg-red-500 dark:hover:bg-red-900 sm:text-sm dark:text-white",children:[t.jsx($st,{className:"h-3 w-3 sm:h-4 sm:w-4 mr-1 sm:mr-2"}),u.delete]})]})]})]})}),t.jsxs("div",{className:"flex flex-col sm:flex-row space-y-2 sm:space-y-0 sm:space-x-2 w-full",children:[t.jsx(Edt,{type:"button",variant:"outline",onClick:i,className:"w-full sm:w-1/2 text-xs sm:text-sm",children:u.cancel}),t.jsx(Edt,{type:"submit",className:"w-full sm:w-1/2 text-xs sm:text-sm",disabled:p,children:p?t.jsxs(t.Fragment,{children:[t.jsx(Vst,{className:"h-4 w-4 animate-spin"}),u.saving]}):u.save})]})]})]})]})]})},gTt=({event:r,onAddEvent:n,onUpdateEvent:o,onDeleteEvent:a,onClosePopup:i,onOpenChange:s,dateFromViewClick:l,children:c,isDisabled:u=!1,translations:d,resources:p})=>{const[h,f]=e.useState(!1),m=e=>{u||(f(e),null==s||s(e),e||null==i||i())};return t.jsxs(ydt,{open:h,onOpenChange:m,children:[t.jsx(jdt,{translations:d,isDisabled:u,children:c}),t.jsx(yTt,{event:r,onAddEvent:n,onUpdateEvent:o,onDeleteEvent:a,onClosePopup:()=>m(!1),dateFromViewClick:l,open:h,translations:d,resources:p})]})};function bTt(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],!(t.indexOf(r)>=0)&&(o[r]=e[r]);return o}var xTt=["color"],wTt=e.forwardRef(function(t,r){var n=t.color,o=void 0===n?"currentColor":n,a=bTt(t,xTt);return e.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:r}),e.createElement("path",{d:"M4.5 1C4.77614 1 5 1.22386 5 1.5V2H10V1.5C10 1.22386 10.2239 1 10.5 1C10.7761 1 11 1.22386 11 1.5V2H12.5C13.3284 2 14 2.67157 14 3.5V12.5C14 13.3284 13.3284 14 12.5 14H2.5C1.67157 14 1 13.3284 1 12.5V3.5C1 2.67157 1.67157 2 2.5 2H4V1.5C4 1.22386 4.22386 1 4.5 1ZM10 3V3.5C10 3.77614 10.2239 4 10.5 4C10.7761 4 11 3.77614 11 3.5V3H12.5C12.7761 3 13 3.22386 13 3.5V5H2V3.5C2 3.22386 2.22386 3 2.5 3H4V3.5C4 3.77614 4.22386 4 4.5 4C4.77614 4 5 3.77614 5 3.5V3H10ZM2 6V12.5C2 12.7761 2.22386 13 2.5 13H12.5C12.7761 13 13 12.7761 13 12.5V6H2ZM7 7.5C7 7.22386 7.22386 7 7.5 7C7.77614 7 8 7.22386 8 7.5C8 7.77614 7.77614 8 7.5 8C7.22386 8 7 7.77614 7 7.5ZM9.5 7C9.22386 7 9 7.22386 9 7.5C9 7.77614 9.22386 8 9.5 8C9.77614 8 10 7.77614 10 7.5C10 7.22386 9.77614 7 9.5 7ZM11 7.5C11 7.22386 11.2239 7 11.5 7C11.7761 7 12 7.22386 12 7.5C12 7.77614 11.7761 8 11.5 8C11.2239 8 11 7.77614 11 7.5ZM11.5 9C11.2239 9 11 9.22386 11 9.5C11 9.77614 11.2239 10 11.5 10C11.7761 10 12 9.77614 12 9.5C12 9.22386 11.7761 9 11.5 9ZM9 9.5C9 9.22386 9.22386 9 9.5 9C9.77614 9 10 9.22386 10 9.5C10 9.77614 9.77614 10 9.5 10C9.22386 10 9 9.77614 9 9.5ZM7.5 9C7.22386 9 7 9.22386 7 9.5C7 9.77614 7.22386 10 7.5 10C7.77614 10 8 9.77614 8 9.5C8 9.22386 7.77614 9 7.5 9ZM5 9.5C5 9.22386 5.22386 9 5.5 9C5.77614 9 6 9.22386 6 9.5C6 9.77614 5.77614 10 5.5 10C5.22386 10 5 9.77614 5 9.5ZM3.5 9C3.22386 9 3 9.22386 3 9.5C3 9.77614 3.22386 10 3.5 10C3.77614 10 4 9.77614 4 9.5C4 9.22386 3.77614 9 3.5 9ZM3 11.5C3 11.2239 3.22386 11 3.5 11C3.77614 11 4 11.2239 4 11.5C4 11.7761 3.77614 12 3.5 12C3.22386 12 3 11.7761 3 11.5ZM5.5 11C5.22386 11 5 11.2239 5 11.5C5 11.7761 5.22386 12 5.5 12C5.77614 12 6 11.7761 6 11.5C6 11.2239 5.77614 11 5.5 11ZM7 11.5C7 11.2239 7.22386 11 7.5 11C7.77614 11 8 11.2239 8 11.5C8 11.7761 7.77614 12 7.5 12C7.22386 12 7 11.7761 7 11.5ZM9.5 11C9.22386 11 9 11.2239 9 11.5C9 11.7761 9.22386 12 9.5 12C9.77614 12 10 11.7761 10 11.5C10 11.2239 9.77614 11 9.5 11Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))}),kTt=["color"],_Tt=e.forwardRef(function(t,r){var n=t.color,o=void 0===n?"currentColor":n,a=bTt(t,kTt);return e.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:r}),e.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:o,fillRule:"evenodd",clipRule:"evenodd"}))}),CTt=["color"],MTt=e.forwardRef(function(t,r){var n=t.color,o=void 0===n?"currentColor":n,a=bTt(t,CTt);return e.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:r}),e.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:o,fillRule:"evenodd",clipRule:"evenodd"}))}),STt=.999,DTt=/[\\\/_+.#"@\[\(\{&]/,OTt=/[\\\/_+.#"@\[\(\{&]/g,PTt=/[\s-]/,ETt=/[\s-]/g;function jTt(e,t,r,n,o,a,i){if(a===t.length)return o===e.length?1:.99;var s=`${o},${a}`;if(void 0!==i[s])return i[s];for(var l,c,u,d,p=n.charAt(a),h=r.indexOf(p,o),f=0;h>=0;)(l=jTt(e,t,r,n,h+1,a+1,i))>f&&(h===o?l*=1:DTt.test(e.charAt(h-1))?(l*=.8,(u=e.slice(o,h-1).match(OTt))&&o>0&&(l*=Math.pow(STt,u.length))):PTt.test(e.charAt(h-1))?(l*=.9,(d=e.slice(o,h-1).match(ETt))&&o>0&&(l*=Math.pow(STt,d.length))):(l*=.17,o>0&&(l*=Math.pow(STt,h-o))),e.charAt(h)!==t.charAt(a)&&(l*=.9999)),(l<.1&&r.charAt(h-1)===n.charAt(a+1)||n.charAt(a+1)===n.charAt(a)&&r.charAt(h-1)!==n.charAt(a))&&(.1*(c=jTt(e,t,r,n,h+1,a+2,i))>l&&(l=.1*c)),l>f&&(f=l),h=r.indexOf(p,h+1);return i[s]=f,f}function TTt(e){return e.toLowerCase().replace(ETt," ")}function NTt(e,t,r){return jTt(e=r&&r.length>0?""+(e+" "+r.join(" ")):e,t,TTt(e),TTt(t),0,0,{})}function RTt(){return RTt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},RTt.apply(null,arguments)}function FTt(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(null==e||e(n),!1===r||!n.defaultPrevented)return null==t?void 0:t(n)}}function zTt(...e){return t=>e.forEach(e=>function(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}(e,t))}function ITt(...t){return e.useCallback(zTt(...t),t)}function ATt(...t){const r=t[0];if(1===t.length)return r;const n=()=>{const n=t.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(t){const o=n.reduce((e,{useScope:r,scopeName:n})=>({...e,...r(t)[`__scope${n}`]}),{});return e.useMemo(()=>({[`__scope${r.scopeName}`]:o}),[o])}};return n.scopeName=r.scopeName,n}const LTt=null!=globalThis&&globalThis.document?e.useLayoutEffect:()=>{},BTt=s.useId||(()=>{});let VTt=0;function HTt(e){const[t,r]=s.useState(BTt());return LTt(()=>{r(e=>e??String(VTt++))},[e]),e||(t?`radix-${t}`:"")}function qTt(t){const r=e.useRef(t);return e.useEffect(()=>{r.current=t}),e.useMemo(()=>(...e)=>{var t;return null===(t=r.current)||void 0===t?void 0:t.call(r,...e)},[])}function $Tt({prop:t,defaultProp:r,onChange:n=()=>{}}){const[o,a]=function({defaultProp:t,onChange:r}){const n=e.useState(t),[o]=n,a=e.useRef(o),i=qTt(r);return e.useEffect(()=>{a.current!==o&&(i(o),a.current=o)},[o,a,i]),n}({defaultProp:r,onChange:n}),i=void 0!==t,s=i?t:o,l=qTt(n),c=e.useCallback(e=>{if(i){const r="function"==typeof e?e(t):e;r!==t&&l(r)}else a(e)},[i,t,a,l]);return[s,c]}const WTt=e.forwardRef((t,r)=>{const{children:n,...o}=t,a=e.Children.toArray(n),i=a.find(KTt);if(i){const t=i.props.children,n=a.map(r=>r===i?e.Children.count(t)>1?e.Children.only(null):e.isValidElement(t)?t.props.children:null:r);return e.createElement(UTt,RTt({},o,{ref:r}),e.isValidElement(t)?e.cloneElement(t,void 0,n):null)}return e.createElement(UTt,RTt({},o,{ref:r}),n)});WTt.displayName="Slot";const UTt=e.forwardRef((t,r)=>{const{children:n,...o}=t;return e.isValidElement(n)?e.cloneElement(n,{...YTt(o,n.props),ref:r?zTt(r,n.ref):n.ref}):e.Children.count(n)>1?e.Children.only(null):null});UTt.displayName="SlotClone";const GTt=({children:t})=>e.createElement(e.Fragment,null,t);function KTt(t){return e.isValidElement(t)&&t.type===GTt}function YTt(e,t){const r={...t};for(const n in t){const o=e[n],a=t[n];/^on[A-Z]/.test(n)?o&&a?r[n]=(...e)=>{a(...e),o(...e)}:o&&(r[n]=o):"style"===n?r[n]={...o,...a}:"className"===n&&(r[n]=[o,a].filter(Boolean).join(" "))}return{...e,...r}}const XTt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((t,r)=>{const n=e.forwardRef((t,n)=>{const{asChild:o,...a}=t,i=o?WTt:r;return e.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),e.createElement(i,RTt({},a,{ref:n}))});return n.displayName=`Primitive.${r}`,{...t,[r]:n}},{});const ZTt="dismissableLayer.update",QTt="dismissableLayer.pointerDownOutside",JTt="dismissableLayer.focusOutside";let eNt;const tNt=e.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),rNt=e.forwardRef((t,r)=>{var n;const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:l,onDismiss:c,...u}=t,d=e.useContext(tNt),[p,h]=e.useState(null),f=null!==(n=null==p?void 0:p.ownerDocument)&&void 0!==n?n:null==globalThis?void 0:globalThis.document,[,m]=e.useState({}),v=ITt(r,e=>h(e)),y=Array.from(d.layers),[g]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=y.indexOf(g),x=p?y.indexOf(p):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,k=x>=b,_=function(t,r=(null==globalThis?void 0:globalThis.document)){const n=qTt(t),o=e.useRef(!1),a=e.useRef(()=>{});return e.useEffect(()=>{const e=e=>{if(e.target&&!o.current){let t=function(){oNt(QTt,n,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(r.removeEventListener("click",a.current),a.current=t,r.addEventListener("click",a.current,{once:!0})):t()}else r.removeEventListener("click",a.current);o.current=!1},t=window.setTimeout(()=>{r.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(t),r.removeEventListener("pointerdown",e),r.removeEventListener("click",a.current)}},[r,n]),{onPointerDownCapture:()=>o.current=!0}}(e=>{const t=e.target,r=[...d.branches].some(e=>e.contains(t));!k||r||(null==i||i(e),null==l||l(e),e.defaultPrevented||null==c||c())},f),C=function(t,r=(null==globalThis?void 0:globalThis.document)){const n=qTt(t),o=e.useRef(!1);return e.useEffect(()=>{const e=e=>{e.target&&!o.current&&oNt(JTt,n,{originalEvent:e},{discrete:!1})};return r.addEventListener("focusin",e),()=>r.removeEventListener("focusin",e)},[r,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}(e=>{const t=e.target;[...d.branches].some(e=>e.contains(t))||(null==s||s(e),null==l||l(e),e.defaultPrevented||null==c||c())},f);return function(t,r=(null==globalThis?void 0:globalThis.document)){const n=qTt(t);e.useEffect(()=>{const e=e=>{"Escape"===e.key&&n(e)};return r.addEventListener("keydown",e),()=>r.removeEventListener("keydown",e)},[n,r])}(e=>{x===d.layers.size-1&&(null==a||a(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))},f),e.useEffect(()=>{if(p)return o&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(eNt=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),nNt(),()=>{o&&1===d.layersWithOutsidePointerEventsDisabled.size&&(f.body.style.pointerEvents=eNt)}},[p,f,o,d]),e.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),nNt())},[p,d]),e.useEffect(()=>{const e=()=>m({});return document.addEventListener(ZTt,e),()=>document.removeEventListener(ZTt,e)},[]),e.createElement(XTt.div,RTt({},u,{ref:v,style:{pointerEvents:w?k?"auto":"none":void 0,...t.style},onFocusCapture:FTt(t.onFocusCapture,C.onFocusCapture),onBlurCapture:FTt(t.onBlurCapture,C.onBlurCapture),onPointerDownCapture:FTt(t.onPointerDownCapture,_.onPointerDownCapture)}))});function nNt(){const e=new CustomEvent(ZTt);document.dispatchEvent(e)}function oNt(e,t,n,{discrete:o}){const a=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),o?function(e,t){e&&r.flushSync(()=>e.dispatchEvent(t))}(a,i):a.dispatchEvent(i)}const aNt="focusScope.autoFocusOnMount",iNt="focusScope.autoFocusOnUnmount",sNt={bubbles:!1,cancelable:!0},lNt=e.forwardRef((t,r)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...s}=t,[l,c]=e.useState(null),u=qTt(a),d=qTt(i),p=e.useRef(null),h=ITt(r,e=>c(e)),f=e.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;e.useEffect(()=>{if(o){let e=function(e){if(f.paused||!l)return;const t=e.target;l.contains(t)?p.current=t:pNt(p.current,{select:!0})},t=function(e){if(f.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||pNt(p.current,{select:!0}))},r=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&pNt(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()}}},[o,l,f.paused]),e.useEffect(()=>{if(l){hNt.add(f);const e=document.activeElement;if(!l.contains(e)){const t=new CustomEvent(aNt,sNt);l.addEventListener(aNt,u),l.dispatchEvent(t),t.defaultPrevented||(function(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(pNt(n,{select:t}),document.activeElement!==r)return}(function(e){return e.filter(e=>"A"!==e.tagName)}(cNt(l)),{select:!0}),document.activeElement===e&&pNt(l))}return()=>{l.removeEventListener(aNt,u),setTimeout(()=>{const t=new CustomEvent(iNt,sNt);l.addEventListener(iNt,d),l.dispatchEvent(t),t.defaultPrevented||pNt(e??document.body,{select:!0}),l.removeEventListener(iNt,d),hNt.remove(f)},0)}}},[l,u,d,f]);const m=e.useCallback(e=>{if(!n&&!o||f.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,r=document.activeElement;if(t&&r){const t=e.currentTarget,[o,a]=function(e){const t=cNt(e),r=uNt(t,e),n=uNt(t.reverse(),e);return[r,n]}(t);o&&a?e.shiftKey||r!==a?e.shiftKey&&r===o&&(e.preventDefault(),n&&pNt(a,{select:!0})):(e.preventDefault(),n&&pNt(o,{select:!0})):r===t&&e.preventDefault()}},[n,o,f.paused]);return e.createElement(XTt.div,RTt({tabIndex:-1},s,{ref:h,onKeyDown:m}))});function cNt(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 uNt(e,t){for(const r of e)if(!dNt(r,{upTo:t}))return r}function dNt(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 pNt(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()}}const hNt=function(){let e=[];return{add(t){const r=e[0];t!==r&&(null==r||r.pause()),e=fNt(e,t),e.unshift(t)},remove(t){var r;e=fNt(e,t),null===(r=e[0])||void 0===r||r.resume()}}}();function fNt(e,t){const r=[...e],n=r.indexOf(t);return-1!==n&&r.splice(n,1),r}const mNt=e.forwardRef((t,r)=>{var n;const{container:o=(null==globalThis||null===(n=globalThis.document)||void 0===n?void 0:n.body),...a}=t;return o?u.default.createPortal(e.createElement(XTt.div,RTt({},a,{ref:r})),o):null});const vNt=t=>{const{present:n,children:o}=t,a=function(t){const[n,o]=e.useState(),a=e.useRef({}),i=e.useRef(t),s=e.useRef("none"),l=t?"mounted":"unmounted",[c,u]=function(t,r){return e.useReducer((e,t)=>r[e][t]??e,t)}(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return e.useEffect(()=>{const e=yNt(a.current);s.current="mounted"===c?e:"none"},[c]),LTt(()=>{const e=a.current,r=i.current;if(r!==t){const n=s.current,o=yNt(e);t?u("MOUNT"):"none"===o||"none"===(null==e?void 0:e.display)?u("UNMOUNT"):u(r&&n!==o?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,u]),LTt(()=>{if(n){const e=e=>{const t=yNt(a.current).includes(e.animationName);e.target===n&&t&&r.flushSync(()=>u("ANIMATION_END"))},t=e=>{e.target===n&&(s.current=yNt(a.current))};return n.addEventListener("animationstart",t),n.addEventListener("animationcancel",e),n.addEventListener("animationend",e),()=>{n.removeEventListener("animationstart",t),n.removeEventListener("animationcancel",e),n.removeEventListener("animationend",e)}}u("ANIMATION_END")},[n,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:e.useCallback(e=>{e&&(a.current=getComputedStyle(e)),o(e)},[])}}(n),i="function"==typeof o?o({present:a.isPresent}):e.Children.only(o),s=ITt(a.ref,i.ref);return"function"==typeof o||a.isPresent?e.cloneElement(i,{ref:s}):null};function yNt(e){return(null==e?void 0:e.animationName)||"none"}vNt.displayName="Presence";let gNt=0;function bNt(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var xNt=Klt(),wNt=function(){},kNt=s.forwardRef(function(e,t){var r=s.useRef(null),n=s.useState({onScrollCapture:wNt,onWheelCapture:wNt,onTouchMoveCapture:wNt}),o=n[0],a=n[1],i=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,p=e.shards,h=e.sideCar,f=e.noIsolation,m=e.inert,v=e.allowPinchZoom,y=e.as,g=void 0===y?"div":y,b=Llt(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),x=h,w=Ult([r,t]),k=Alt(Alt({},b),o);return s.createElement(s.Fragment,null,d&&s.createElement(x,{sideCar:xNt,removeScrollBar:u,shards:p,noIsolation:f,inert:m,setCallbacks:a,allowPinchZoom:!!v,lockRef:r}),i?s.cloneElement(s.Children.only(l),Alt(Alt({},k),{ref:w})):s.createElement(g,Alt({},k,{className:c,ref:w}),l))});kNt.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},kNt.classNames={fullWidth:Hlt,zeroRight:Vlt};var _Nt=!1;if(typeof window<"u")try{var CNt=Object.defineProperty({},"passive",{get:function(){return _Nt=!0,!0}});window.addEventListener("test",CNt,CNt),window.removeEventListener("test",CNt,CNt)}catch{_Nt=!1}var MNt=!!_Nt&&{passive:!1},SNt=function(e,t){var r=window.getComputedStyle(e);return"hidden"!==r[t]&&!(r.overflowY===r.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===r[t])},DNt=function(e,t){var r=t;do{if(typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host),ONt(e,r)){var n=PNt(e,r);if(n[1]>n[2])return!0}r=r.parentNode}while(r&&r!==document.body);return!1},ONt=function(e,t){return"v"===e?function(e){return SNt(e,"overflowY")}(t):function(e){return SNt(e,"overflowX")}(t)},PNt=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)},ENt=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},jNt=function(e){return[e.deltaX,e.deltaY]},TNt=function(e){return e&&"current"in e?e.current:e},NNt=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},RNt=0,FNt=[];const zNt=Xlt(xNt,function(e){var t=s.useRef([]),r=s.useRef([0,0]),n=s.useRef(),o=s.useState(RNt++)[0],a=s.useState(function(){return rct()})[0],i=s.useRef(e);s.useEffect(function(){i.current=e},[e]),s.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=Blt([e.lockRef.current],(e.shards||[]).map(TNt),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=s.useCallback(function(e,t){if("touches"in e&&2===e.touches.length)return!i.current.allowPinchZoom;var o,a=ENt(e),s=r.current,l="deltaX"in e?e.deltaX:s[0]-a[0],c="deltaY"in e?e.deltaY:s[1]-a[1],u=e.target,d=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var p=DNt(d,u);if(!p)return!0;if(p?o=d:(o="v"===d?"h":"v",p=DNt(d,u)),!p)return!1;if(!n.current&&"changedTouches"in e&&(l||c)&&(n.current=o),!o)return!0;var h=n.current||o;return function(e,t,r,n){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),a=o*n,i=r.target,s=t.contains(i),l=!1,c=a>0,u=0,d=0;do{var p=PNt(e,i),h=p[0],f=p[1]-p[2]-o*h;(h||f)&&ONt(e,i)&&(u+=f,d+=h),i=i.parentNode}while(!s&&i!==document.body||s&&(t.contains(i)||t===i));return(c&&0===u||!c&&0===d)&&(l=!0),l}(h,t,e,"h"===h?l:c)},[]),c=s.useCallback(function(e){var r=e;if(FNt.length&&FNt[FNt.length-1]===a){var n="deltaY"in r?jNt(r):ENt(r),o=t.current.filter(function(e){return e.name===r.type&&e.target===r.target&&function(e,t){return e[0]===t[0]&&e[1]===t[1]}(e.delta,n)})[0];if(o&&o.should)return void(r.cancelable&&r.preventDefault());if(!o){var s=(i.current.shards||[]).map(TNt).filter(Boolean).filter(function(e){return e.contains(r.target)});(s.length>0?l(r,s[0]):!i.current.noIsolation)&&r.cancelable&&r.preventDefault()}}},[]),u=s.useCallback(function(e,r,n,o){var a={name:e,delta:r,target:n,should:o};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=s.useCallback(function(e){r.current=ENt(e),n.current=void 0},[]),p=s.useCallback(function(t){u(t.type,jNt(t),t.target,l(t,e.lockRef.current))},[]),h=s.useCallback(function(t){u(t.type,ENt(t),t.target,l(t,e.lockRef.current))},[]);s.useEffect(function(){return FNt.push(a),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:h}),document.addEventListener("wheel",c,MNt),document.addEventListener("touchmove",c,MNt),document.addEventListener("touchstart",d,MNt),function(){FNt=FNt.filter(function(e){return e!==a}),document.removeEventListener("wheel",c,MNt),document.removeEventListener("touchmove",c,MNt),document.removeEventListener("touchstart",d,MNt)}},[]);var f=e.removeScrollBar,m=e.inert;return s.createElement(s.Fragment,null,m?s.createElement(a,{styles:NNt(o)}):null,f?s.createElement(uct,{gapMode:"margin"}):null)});var INt=s.forwardRef(function(e,t){return s.createElement(kNt,Alt({},e,{ref:t,sideCar:zNt}))});INt.classNames=kNt.classNames;const ANt="Dialog",[LNt,BNt]=function(t,r=[]){let n=[];const o=()=>{const r=n.map(t=>e.createContext(t));return function(n){const o=(null==n?void 0:n[t])||r;return e.useMemo(()=>({[`__scope${t}`]:{...n,[t]:o}}),[n,o])}};return o.scopeName=t,[function(r,o){const a=e.createContext(o),i=n.length;function s(r){const{scope:n,children:o,...s}=r,l=(null==n?void 0:n[t][i])||a,c=e.useMemo(()=>s,Object.values(s));return e.createElement(l.Provider,{value:c},o)}return n=[...n,o],s.displayName=r+"Provider",[s,function(n,s){const l=(null==s?void 0:s[t][i])||a,c=e.useContext(l);if(c)return c;if(void 0!==o)return o;throw new Error(`\`${n}\` must be used within \`${r}\``)}]},ATt(o,...r)]}(ANt),[VNt,HNt]=LNt(ANt),qNt="DialogPortal",[$Nt,WNt]=LNt(qNt,{forceMount:void 0}),UNt="DialogOverlay",GNt=e.forwardRef((t,r)=>{const n=WNt(UNt,t.__scopeDialog),{forceMount:o=n.forceMount,...a}=t,i=HNt(UNt,t.__scopeDialog);return i.modal?e.createElement(vNt,{present:o||i.open},e.createElement(KNt,RTt({},a,{ref:r}))):null}),KNt=e.forwardRef((t,r)=>{const{__scopeDialog:n,...o}=t,a=HNt(UNt,n);return e.createElement(INt,{as:WTt,allowPinchZoom:!0,shards:[a.contentRef]},e.createElement(XTt.div,RTt({"data-state":eRt(a.open)},o,{ref:r,style:{pointerEvents:"auto",...o.style}})))}),YNt="DialogContent",XNt=e.forwardRef((t,r)=>{const n=WNt(YNt,t.__scopeDialog),{forceMount:o=n.forceMount,...a}=t,i=HNt(YNt,t.__scopeDialog);return e.createElement(vNt,{present:o||i.open},i.modal?e.createElement(ZNt,RTt({},a,{ref:r})):e.createElement(QNt,RTt({},a,{ref:r})))}),ZNt=e.forwardRef((t,r)=>{const n=HNt(YNt,t.__scopeDialog),o=e.useRef(null),a=ITt(r,n.contentRef,o);return e.useEffect(()=>{const e=o.current;if(e)return Nct(e)},[]),e.createElement(JNt,RTt({},t,{ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:FTt(t.onCloseAutoFocus,e=>{var t;e.preventDefault(),null===(t=n.triggerRef.current)||void 0===t||t.focus()}),onPointerDownOutside:FTt(t.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:FTt(t.onFocusOutside,e=>e.preventDefault())}))}),QNt=e.forwardRef((t,r)=>{const n=HNt(YNt,t.__scopeDialog),o=e.useRef(!1),a=e.useRef(!1);return e.createElement(JNt,RTt({},t,{ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{var r,i;(null===(r=t.onCloseAutoFocus)||void 0===r||r.call(t,e),e.defaultPrevented)||(o.current||null===(i=n.triggerRef.current)||void 0===i||i.focus(),e.preventDefault());o.current=!1,a.current=!1},onInteractOutside:e=>{var r,i;null===(r=t.onInteractOutside)||void 0===r||r.call(t,e),e.defaultPrevented||(o.current=!0,"pointerdown"===e.detail.originalEvent.type&&(a.current=!0));const s=e.target;(null===(i=n.triggerRef.current)||void 0===i?void 0:i.contains(s))&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&a.current&&e.preventDefault()}}))}),JNt=e.forwardRef((t,r)=>{const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:i,...s}=t,l=HNt(YNt,n),c=ITt(r,e.useRef(null));return e.useEffect(()=>{var e,t;const r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",null!==(e=r[0])&&void 0!==e?e:bNt()),document.body.insertAdjacentElement("beforeend",null!==(t=r[1])&&void 0!==t?t:bNt()),gNt++,()=>{1===gNt&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),gNt--}},[]),e.createElement(e.Fragment,null,e.createElement(lNt,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:i},e.createElement(rNt,RTt({role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":eRt(l.open)},s,{ref:c,onDismiss:()=>l.onOpenChange(!1)}))),!1)});function eRt(e){return e?"open":"closed"}const tRt=t=>{const{__scopeDialog:r,children:n,open:o,defaultOpen:a,onOpenChange:i,modal:s=!0}=t,l=e.useRef(null),c=e.useRef(null),[u=!1,d]=$Tt({prop:o,defaultProp:a,onChange:i});return e.createElement(VNt,{scope:r,triggerRef:l,contentRef:c,contentId:HTt(),titleId:HTt(),descriptionId:HTt(),open:u,onOpenChange:d,onOpenToggle:e.useCallback(()=>d(e=>!e),[d]),modal:s},n)},rRt=t=>{const{__scopeDialog:r,forceMount:n,children:o,container:a}=t,i=HNt(qNt,r);return e.createElement($Nt,{scope:r,forceMount:n},e.Children.map(o,t=>e.createElement(vNt,{present:n||i.open},e.createElement(mNt,{asChild:!0,container:a},t))))},nRt=GNt,oRt=XNt;var aRt='[cmdk-group=""]',iRt='[cmdk-group-items=""]',sRt='[cmdk-item=""]',lRt=`${sRt}:not([aria-disabled="true"])`,cRt="cmdk-item-select",uRt="data-value",dRt=(e,t,r)=>NTt(e,t,r),pRt=s.createContext(void 0),hRt=()=>s.useContext(pRt),fRt=s.createContext(void 0),mRt=()=>s.useContext(fRt),vRt=s.createContext(void 0),yRt=s.forwardRef((e,t)=>{let r=jRt(()=>{var t,r;return{search:"",value:null!=(r=null!=(t=e.value)?t:e.defaultValue)?r:"",filtered:{count:0,items:new Map,groups:new Set}}}),n=jRt(()=>new Set),o=jRt(()=>new Map),a=jRt(()=>new Map),i=jRt(()=>new Set),l=PRt(e),{label:c,children:u,value:d,onValueChange:p,filter:h,shouldFilter:f,loop:m,disablePointerSelection:v=!1,vimBindings:y=!0,...g}=e,b=s.useId(),x=s.useId(),w=s.useId(),k=s.useRef(null),_=FRt();ERt(()=>{if(void 0!==d){let e=d.trim();r.current.value=e,C.emit()}},[d]),ERt(()=>{_(6,E)},[]);let C=s.useMemo(()=>({subscribe:e=>(i.current.add(e),()=>i.current.delete(e)),snapshot:()=>r.current,setState:(e,t,n)=>{var o,a,i;if(!Object.is(r.current[e],t)){if(r.current[e]=t,"search"===e)P(),D(),_(1,O);else if("value"===e&&(n||_(5,E),void 0!==(null==(o=l.current)?void 0:o.value))){let e=t??"";return void(null==(i=(a=l.current).onValueChange)||i.call(a,e))}C.emit()}},emit:()=>{i.current.forEach(e=>e())}}),[]),M=s.useMemo(()=>({value:(e,t,n)=>{var o;t!==(null==(o=a.current.get(e))?void 0:o.value)&&(a.current.set(e,{value:t,keywords:n}),r.current.filtered.items.set(e,S(t,n)),_(2,()=>{D(),C.emit()}))},item:(e,t)=>(n.current.add(e),t&&(o.current.has(t)?o.current.get(t).add(e):o.current.set(t,new Set([e]))),_(3,()=>{P(),D(),r.current.value||O(),C.emit()}),()=>{a.current.delete(e),n.current.delete(e),r.current.filtered.items.delete(e);let t=j();_(4,()=>{P(),(null==t?void 0:t.getAttribute("id"))===e&&O(),C.emit()})}),group:e=>(o.current.has(e)||o.current.set(e,new Set),()=>{a.current.delete(e),o.current.delete(e)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],disablePointerSelection:v,listId:b,inputId:w,labelId:x,listInnerRef:k}),[]);function S(e,t){var n,o;let a=null!=(o=null==(n=l.current)?void 0:n.filter)?o:dRt;return e?a(e,r.current.search,t):0}function D(){if(!r.current.search||!1===l.current.shouldFilter)return;let e=r.current.filtered.items,t=[];r.current.filtered.groups.forEach(r=>{let n=o.current.get(r),a=0;n.forEach(t=>{let r=e.get(t);a=Math.max(r,a)}),t.push([r,a])});let n=k.current;T().sort((t,r)=>{var n,o;let a=t.getAttribute("id"),i=r.getAttribute("id");return(null!=(n=e.get(i))?n:0)-(null!=(o=e.get(a))?o:0)}).forEach(e=>{let t=e.closest(iRt);t?t.appendChild(e.parentElement===t?e:e.closest(`${iRt} > *`)):n.appendChild(e.parentElement===n?e:e.closest(`${iRt} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=k.current.querySelector(`${aRt}[${uRt}="${encodeURIComponent(e[0])}"]`);null==t||t.parentElement.appendChild(t)})}function O(){let e=T().find(e=>"true"!==e.getAttribute("aria-disabled")),t=null==e?void 0:e.getAttribute(uRt);C.setState("value",t||void 0)}function P(){var e,t,i,s;if(!r.current.search||!1===l.current.shouldFilter)return void(r.current.filtered.count=n.current.size);r.current.filtered.groups=new Set;let c=0;for(let o of n.current){let n=S(null!=(t=null==(e=a.current.get(o))?void 0:e.value)?t:"",null!=(s=null==(i=a.current.get(o))?void 0:i.keywords)?s:[]);r.current.filtered.items.set(o,n),n>0&&c++}for(let[e,t]of o.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=c}function E(){var e,t,r;let n=j();n&&((null==(e=n.parentElement)?void 0:e.firstChild)===n&&(null==(r=null==(t=n.closest(aRt))?void 0:t.querySelector('[cmdk-group-heading=""]'))||r.scrollIntoView({block:"nearest"})),n.scrollIntoView({block:"nearest"}))}function j(){var e;return null==(e=k.current)?void 0:e.querySelector(`${sRt}[aria-selected="true"]`)}function T(){var e;return Array.from(null==(e=k.current)?void 0:e.querySelectorAll(lRt))}function N(e){let t=T()[e];t&&C.setState("value",t.getAttribute(uRt))}function R(e){var t;let r=j(),n=T(),o=n.findIndex(e=>e===r),a=n[o+e];null!=(t=l.current)&&t.loop&&(a=o+e<0?n[n.length-1]:o+e===n.length?n[0]:n[o+e]),a&&C.setState("value",a.getAttribute(uRt))}function F(e){let t,r=j(),n=null==r?void 0:r.closest(aRt);for(;n&&!t;)n=e>0?DRt(n,aRt):ORt(n,aRt),t=null==n?void 0:n.querySelector(lRt);t?C.setState("value",t.getAttribute(uRt)):R(e)}let z=()=>N(T().length-1),I=e=>{e.preventDefault(),e.metaKey?z():e.altKey?F(1):R(1)},A=e=>{e.preventDefault(),e.metaKey?N(0):e.altKey?F(-1):R(-1)};return s.createElement(XTt.div,{ref:t,tabIndex:-1,...g,"cmdk-root":"",onKeyDown:e=>{var t;if(null==(t=g.onKeyDown)||t.call(g,e),!e.defaultPrevented)switch(e.key){case"n":case"j":y&&e.ctrlKey&&I(e);break;case"ArrowDown":I(e);break;case"p":case"k":y&&e.ctrlKey&&A(e);break;case"ArrowUp":A(e);break;case"Home":e.preventDefault(),N(0);break;case"End":e.preventDefault(),z();break;case"Enter":if(!e.nativeEvent.isComposing&&229!==e.keyCode){e.preventDefault();let t=j();if(t){let e=new Event(cRt);t.dispatchEvent(e)}}}}},s.createElement("label",{"cmdk-label":"",htmlFor:M.inputId,id:M.labelId,style:IRt},c),zRt(e,e=>s.createElement(fRt.Provider,{value:C},s.createElement(pRt.Provider,{value:M},e))))}),gRt=s.forwardRef((e,t)=>{var r,n;let o=s.useId(),a=s.useRef(null),i=s.useContext(vRt),l=hRt(),c=PRt(e),u=null!=(n=null==(r=c.current)?void 0:r.forceMount)?n:null==i?void 0:i.forceMount;ERt(()=>{if(!u)return l.item(o,null==i?void 0:i.id)},[u]);let d=RRt(o,a,[e.value,e.children,a],e.keywords),p=mRt(),h=NRt(e=>e.value&&e.value===d.current),f=NRt(e=>!(!u&&!1!==l.filter())||(!e.search||e.filtered.items.get(o)>0));function m(){var e,t;v(),null==(t=(e=c.current).onSelect)||t.call(e,d.current)}function v(){p.setState("value",d.current,!0)}if(s.useEffect(()=>{let t=a.current;if(t&&!e.disabled)return t.addEventListener(cRt,m),()=>t.removeEventListener(cRt,m)},[f,e.onSelect,e.disabled]),!f)return null;let{disabled:y,value:g,onSelect:b,forceMount:x,keywords:w,...k}=e;return s.createElement(XTt.div,{ref:TRt([a,t]),...k,id:o,"cmdk-item":"",role:"option","aria-disabled":!!y,"aria-selected":!!h,"data-disabled":!!y,"data-selected":!!h,onPointerMove:y||l.disablePointerSelection?void 0:v,onClick:y?void 0:m},e.children)}),bRt=s.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:o,...a}=e,i=s.useId(),l=s.useRef(null),c=s.useRef(null),u=s.useId(),d=hRt(),p=NRt(e=>!(!o&&!1!==d.filter())||(!e.search||e.filtered.groups.has(i)));ERt(()=>d.group(i),[]),RRt(i,l,[e.value,e.heading,c]);let h=s.useMemo(()=>({id:i,forceMount:o}),[o]);return s.createElement(XTt.div,{ref:TRt([l,t]),...a,"cmdk-group":"",role:"presentation",hidden:!p||void 0},r&&s.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},r),zRt(e,e=>s.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?u:void 0},s.createElement(vRt.Provider,{value:h},e))))}),xRt=s.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,o=s.useRef(null),a=NRt(e=>!e.search);return r||a?s.createElement(XTt.div,{ref:TRt([o,t]),...n,"cmdk-separator":"",role:"separator"}):null}),wRt=s.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,o=null!=e.value,a=mRt(),i=NRt(e=>e.search),l=NRt(e=>e.value),c=hRt(),u=s.useMemo(()=>{var e;let t=null==(e=c.listInnerRef.current)?void 0:e.querySelector(`${sRt}[${uRt}="${encodeURIComponent(l)}"]`);return null==t?void 0:t.getAttribute("id")},[]);return s.useEffect(()=>{null!=e.value&&a.setState("search",e.value)},[e.value]),s.createElement(XTt.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":u,id:c.inputId,type:"text",value:o?e.value:i,onChange:e=>{o||a.setState("search",e.target.value),null==r||r(e.target.value)}})}),kRt=s.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...o}=e,a=s.useRef(null),i=s.useRef(null),l=hRt();return s.useEffect(()=>{if(i.current&&a.current){let e,t=i.current,r=a.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)}}},[]),s.createElement(XTt.div,{ref:TRt([a,t]),...o,"cmdk-list":"",role:"listbox","aria-label":n,id:l.listId},zRt(e,e=>s.createElement("div",{ref:TRt([i,l.listInnerRef]),"cmdk-list-sizer":""},e)))}),_Rt=s.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:o,contentClassName:a,container:i,...l}=e;return s.createElement(tRt,{open:r,onOpenChange:n},s.createElement(rRt,{container:i},s.createElement(nRt,{"cmdk-overlay":"",className:o}),s.createElement(oRt,{"aria-label":e.label,"cmdk-dialog":"",className:a},s.createElement(yRt,{ref:t,...l}))))}),CRt=s.forwardRef((e,t)=>NRt(e=>0===e.filtered.count)?s.createElement(XTt.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),MRt=s.forwardRef((e,t)=>{let{progress:r,children:n,label:o="Loading...",...a}=e;return s.createElement(XTt.div,{ref:t,...a,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},zRt(e,e=>s.createElement("div",{"aria-hidden":!0},e)))}),SRt=Object.assign(yRt,{List:kRt,Item:gRt,Input:wRt,Group:bRt,Separator:xRt,Dialog:_Rt,Empty:CRt,Loading:MRt});function DRt(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function ORt(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function PRt(e){let t=s.useRef(e);return ERt(()=>{t.current=e}),t}var ERt=typeof window>"u"?s.useEffect:s.useLayoutEffect;function jRt(e){let t=s.useRef();return void 0===t.current&&(t.current=e()),t}function TRt(e){return t=>{e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}}function NRt(e){let t=mRt(),r=()=>e(t.snapshot());return s.useSyncExternalStore(t.subscribe,r,r)}function RRt(e,t,r,n=[]){let o=s.useRef(),a=hRt();return ERt(()=>{var i;let s=(()=>{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():o.current}})(),l=n.map(e=>e.trim());a.value(e,s,l),null==(i=t.current)||i.setAttribute(uRt,s),o.current=s}),o}var FRt=()=>{let[e,t]=s.useState(),r=jRt(()=>new Map);return ERt(()=>{r.current.forEach(e=>e()),r.current=new Map},[e]),(e,n)=>{r.current.set(e,n),t({})}};function zRt({asChild:e,children:t},r){return e&&s.isValidElement(t)?s.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 IRt={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const ARt=s.forwardRef(({className:e,...r},n)=>t.jsx(SRt,{ref:n,className:vdt("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...r}));ARt.displayName=SRt.displayName;const LRt=s.forwardRef(({className:e,...r},n)=>t.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[t.jsx(qst,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),t.jsx(SRt.Input,{ref:n,className:vdt("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...r})]}));LRt.displayName=SRt.Input.displayName;const BRt=s.forwardRef(({className:e,...r},n)=>t.jsx(SRt.List,{ref:n,className:vdt("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...r}));BRt.displayName=SRt.List.displayName;const VRt=s.forwardRef((e,r)=>t.jsx(SRt.Empty,{ref:r,className:"py-6 text-center text-sm",...e}));VRt.displayName=SRt.Empty.displayName;const HRt=s.forwardRef(({className:e,...r},n)=>t.jsx(SRt.Group,{ref:n,className:vdt("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...r}));HRt.displayName=SRt.Group.displayName;const qRt=s.forwardRef(({className:e,...r},n)=>t.jsx(SRt.Separator,{ref:n,className:vdt("-mx-1 h-px bg-border",e),...r}));qRt.displayName=SRt.Separator.displayName;const $Rt=s.forwardRef(({className:e,...r},n)=>t.jsx(SRt.Item,{ref:n,className:vdt("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...r}));$Rt.displayName=SRt.Item.displayName;const WRt=e=>{if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},URt=({day:e,weekday:r,translations:n})=>{const o=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].indexOf(r),a=n.dayNames[o];return t.jsxs("div",{className:"flex items-center w-full",children:[t.jsx("span",{className:"text-xs sm:text-sm text-muted-foreground italic whitespace-nowrap mr-1 sm:mr-2 pl-4",children:a}),t.jsxs("span",{className:"text-xs sm:text-sm font-medium truncate flex-grow text-center",children:[e,WRt(parseInt(e))]})]})};function GRt({className:e,selectedDate:r,onDateChange:n,isAnimating:o,direction:a,translations:i}){const[l,c]=s.useState(!1),u=s.useMemo(()=>(e=>eit({start:tit(e),end:Jat(e)}).map(e=>({dayNumber:Vit(e,"d"),weekday:Vit(e,"EEE"),value:Vit(e,"yyyy-MM-dd"),date:e})))(r),[r]),d=u.find(e=>Vit(e.date,"yyyy-MM-dd")===Vit(r,"yyyy-MM-dd"));return t.jsxs(fgt,{open:l,onOpenChange:c,children:[t.jsx(mgt,{asChild:!0,children:t.jsxs(Edt,{variant:"outline",role:"combobox","aria-expanded":l,"aria-label":i.selectDate,className:vdt("w-[120px] sm:w-[159px] justify-between border border-input bg-background hover:bg-accent hover:text-accent-foreground text-xs sm:text-sm p-2 sm:p-2",e),children:[t.jsx(Tbt,{mode:"wait",children:t.jsx(xDt.div,{initial:!!o&&{y:"down"===a?10:-10,opacity:0},animate:{y:0,opacity:1},exit:{y:"down"===a?-10:10,opacity:0},transition:{duration:.2},className:"w-full",children:d?t.jsx(URt,{day:d.dayNumber,weekday:d.weekday,translations:i}):t.jsx("span",{className:"text-xs sm:text-sm",children:i.selectDate})},null==d?void 0:d.value)}),t.jsx(_Tt,{className:"ml-1 sm:ml-2 h-4 w-4 sm:h-4 sm:w-4 shrink-0 opacity-50"})]})}),t.jsx(vgt,{className:"w-[120px] sm:w-[161px] p-0",children:t.jsxs(ARt,{children:[t.jsx(LRt,{placeholder:`${i.search} ${i.day.toLowerCase()}...`,className:"text-xs sm:text-sm"}),t.jsxs(BRt,{className:"max-h-[300px] overflow-y-auto",children:[t.jsx(VRt,{children:i.noEvents}),t.jsx(HRt,{children:u.map(e=>t.jsxs($Rt,{onSelect:()=>{n(e.date),c(!1)},className:"text-xs sm:text-sm",children:[t.jsx(URt,{day:e.dayNumber,weekday:e.weekday,translations:i}),t.jsx(MTt,{className:vdt("ml-auto h-4 w-4 sm:h-4 sm:w-4",(null==d?void 0:d.value)===e.value?"opacity-100":"opacity-0")})]},e.value))})]})]})})]})}function KRt({className:e,selectedMonth:r,onMonthChange:n,onDateChange:o,isAnimating:a,direction:i,translations:l,currentDate:c}){const[u,d]=s.useState(!1),p=l.monthNames.map(e=>({label:e,value:e.toLowerCase().slice(0,3)}));return t.jsxs(fgt,{open:u,onOpenChange:d,children:[t.jsx(mgt,{asChild:!0,children:t.jsxs(Edt,{variant:"outline",role:"combobox","aria-expanded":u,"aria-label":l.selectDate,className:vdt("w-[110px] sm:w-[151px] justify-center border border-input bg-background hover:bg-accent hover:text-accent-foreground text-xs sm:text-sm p-2 sm:p-2",e),children:[t.jsx(wTt,{className:"hidden sm:inline-block mr-2 h-4 w-4"}),t.jsx(Tbt,{mode:"wait",children:t.jsx(xDt.p,{className:"text-xs sm:text-sm flex-grow text-center",initial:!!a&&{y:"down"===i?10:-10,opacity:0},animate:{y:0,opacity:1},exit:{y:"down"===i?-10:10,opacity:0},transition:{duration:.2},children:r.label},r.value)}),t.jsx(_Tt,{className:"hidden sm:inline-block ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),t.jsx(vgt,{className:"w-[110px] sm:w-[151px] p-0",children:t.jsxs(ARt,{children:[t.jsx(LRt,{placeholder:l.search,className:"text-xs sm:text-sm"}),t.jsxs(BRt,{children:[t.jsx(VRt,{className:"text-xs sm:text-sm",children:l.noEvents}),t.jsx(HRt,{children:p.map(e=>t.jsxs($Rt,{onSelect:()=>(e=>{const t=c.getDate(),r=c.getFullYear(),a=p.findIndex(t=>t.value===e.value),i=new Date(r,a,t);i.getDate()!==t&&i.setMonth(a+1,0),n(e),o&&o(i),d(!1)})(e),className:"text-xs sm:text-sm",children:[e.label,t.jsx(MTt,{className:vdt("ml-auto h-4 w-4 sm:h-4 sm:w-4",r.value===e.value?"opacity-100":"opacity-0")})]},e.value))})]})]})})]})}function YRt({className:r,currentYear:n,onYearChange:o,onDateChange:a,currentDate:i,isAnimating:s,direction:l}){const[c,u]=e.useState(!1),[d,p]=e.useState(n),[h,f]=e.useState(n.toString());e.useEffect(()=>{p(n),f(n.toString())},[n]);const m=e=>{if(e>=1900&&e<=3100){const t=i.getDate(),r=i.getMonth(),n=new Date(e,r,t);n.getMonth()!==r&&n.setDate(0),p(e),f(e.toString()),o(e),a&&a(n)}},v=e=>{m(d+e)};return t.jsxs(fgt,{open:c,onOpenChange:u,children:[t.jsx(mgt,{asChild:!0,children:t.jsx(Edt,{variant:"outline",role:"combobox","aria-expanded":c,"aria-label":"Select a year",className:vdt("w-[70px] sm:w-[71px] justify-center border border-input bg-background hover:bg-accent hover:text-accent-foreground text-xs sm:text-sm p-2 sm:p-2",r),children:t.jsx(Tbt,{mode:"wait",children:t.jsx(xDt.p,{className:"text-xs sm:text-sm",initial:!!s&&{y:"down"===l?10:-10,opacity:0},animate:{y:0,opacity:1},exit:{y:"down"===l?-10:10,opacity:0},transition:{duration:.2},children:d},d)})})}),t.jsx(vgt,{className:"w-[90px] sm:w-[130px] p-2",children:t.jsxs("div",{className:"flex flex-col items-center",children:[t.jsx(Edt,{variant:"ghost",size:"sm",className:"w-full h-8",onClick:()=>v(1),children:t.jsx(Est,{className:"h-4 w-4 sm:h-4 sm:w-4"})}),t.jsx(Mmt,{type:"text",value:h,onChange:e=>{const t=e.target.value;f(t);const r=parseInt(t,10);!isNaN(r)&&r>=1900&&r<=2100&&m(r)},onBlur:()=>{h!==d.toString()&&f(d.toString())},className:"w-full text-center text-xs sm:text-sm h-8"}),t.jsx(Edt,{variant:"ghost",size:"sm",className:"w-full h-8",onClick:()=>v(-1),children:t.jsx(Dst,{className:"h-4 w-4 sm:h-4 sm:w-4"})})]})})]})}const XRt=({currentDate:e,currentView:r,handlePrevious:n,handleNext:o,lastUpdated:a,animationDirection:i,months:s,handleDayChange:l,handleMonthChange:c,handleYearChange:u,currentConfig:d})=>t.jsxs("div",{className:"flex items-center space-x-1 sm:space-x-2",children:[t.jsx(Edt,{variant:"ghost",onClick:n,size:"icon",className:"h-8 w-8 sm:h-10 sm:w-10",children:t.jsx(Ost,{className:"h-4 w-4"})}),t.jsxs(Tbt,{mode:"sync",children:["day"===r&&t.jsx(xDt.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:t.jsx(GRt,{translations:d.localization,className:"font-semibold text-sm sm:text-lg",selectedDate:e,onDateChange:l,isAnimating:"day"===a,direction:i})},"day-switcher"),"year"!==r&&t.jsx(xDt.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:t.jsx(KRt,{className:"font-semibold text-sm sm:text-lg",selectedMonth:s[e.getMonth()],onMonthChange:c,onDateChange:l,isAnimating:"month"===a,direction:i,translations:d.localization,currentDate:e})},"month-switcher"),t.jsx(xDt.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:t.jsx(YRt,{className:"font-semibold text-sm sm:text-lg",currentYear:e.getFullYear(),onYearChange:u,onDateChange:l,currentDate:e,isAnimating:"year"===a,direction:i})},"year-switcher")]}),t.jsx(Edt,{variant:"ghost",onClick:o,size:"icon",className:"h-8 w-8 sm:h-10 sm:w-10",children:t.jsx(Pst,{className:"h-4 w-4"})})]});var[ZRt,QRt]=Xst("Tooltip",[wyt]),JRt=wyt(),eFt="TooltipProvider",tFt=700,rFt="tooltip.open",[nFt,oFt]=ZRt(eFt),aFt=e=>{const{__scopeTooltip:r,delayDuration:n=tFt,skipDelayDuration:o=300,disableHoverableContent:a=!1,children:i}=e,l=s.useRef(!0),c=s.useRef(!1),u=s.useRef(0);return s.useEffect(()=>{const e=u.current;return()=>window.clearTimeout(e)},[]),t.jsx(nFt,{scope:r,isOpenDelayedRef:l,delayDuration:n,onOpen:s.useCallback(()=>{window.clearTimeout(u.current),l.current=!1},[]),onClose:s.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>l.current=!0,o)},[o]),isPointerInTransitRef:c,onPointerInTransitChange:s.useCallback(e=>{c.current=e},[]),disableHoverableContent:a,children:i})};aFt.displayName=eFt;var iFt="Tooltip",[sFt,lFt]=ZRt(iFt),cFt=e=>{const{__scopeTooltip:r,children:n,open:o,defaultOpen:a,onOpenChange:i,disableHoverableContent:l,delayDuration:c}=e,u=oFt(iFt,e.__scopeTooltip),d=JRt(r),[p,h]=s.useState(null),f=tlt(),m=s.useRef(0),v=l??u.disableHoverableContent,y=c??u.delayDuration,g=s.useRef(!1),[b,x]=nlt({prop:o,defaultProp:a??!1,onChange:e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(rFt))):u.onClose(),null==i||i(e)},caller:iFt}),w=s.useMemo(()=>b?g.current?"delayed-open":"instant-open":"closed",[b]),k=s.useCallback(()=>{window.clearTimeout(m.current),m.current=0,g.current=!1,x(!0)},[x]),_=s.useCallback(()=>{window.clearTimeout(m.current),m.current=0,x(!1)},[x]),C=s.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{g.current=!0,x(!0),m.current=0},y)},[y,x]);return s.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),t.jsx(Iyt,{...d,children:t.jsx(sFt,{scope:r,contentId:f,open:b,stateAttribute:w,trigger:p,onTriggerChange:h,onTriggerEnter:s.useCallback(()=>{u.isOpenDelayedRef.current?C():k()},[u.isOpenDelayedRef,C,k]),onTriggerLeave:s.useCallback(()=>{v?_():(window.clearTimeout(m.current),m.current=0)},[_,v]),onOpen:k,onClose:_,disableHoverableContent:v,children:n})})};cFt.displayName=iFt;var uFt="TooltipTrigger",dFt=s.forwardRef((e,r)=>{const{__scopeTooltip:n,...o}=e,a=lFt(uFt,n),i=oFt(uFt,n),l=JRt(n),c=Yst(r,s.useRef(null),a.onTriggerChange),u=s.useRef(!1),d=s.useRef(!1),p=s.useCallback(()=>u.current=!1,[]);return s.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),t.jsx(Ayt,{asChild:!0,...l,children:t.jsx(ult.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...o,ref:c,onPointerMove:Ust(e.onPointerMove,e=>{"touch"!==e.pointerType&&!d.current&&!i.isPointerInTransitRef.current&&(a.onTriggerEnter(),d.current=!0)}),onPointerLeave:Ust(e.onPointerLeave,()=>{a.onTriggerLeave(),d.current=!1}),onPointerDown:Ust(e.onPointerDown,()=>{a.open&&a.onClose(),u.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:Ust(e.onFocus,()=>{u.current||a.onOpen()}),onBlur:Ust(e.onBlur,a.onClose),onClick:Ust(e.onClick,a.onClose)})})});dFt.displayName=uFt;var[pFt,hFt]=ZRt("TooltipPortal",{forceMount:void 0}),fFt="TooltipContent",mFt=s.forwardRef((e,r)=>{const n=hFt(fFt,e.__scopeTooltip),{forceMount:o=n.forceMount,side:a="top",...i}=e,s=lFt(fFt,e.__scopeTooltip);return t.jsx(Nlt,{present:o||s.open,children:s.disableHoverableContent?t.jsx(xFt,{side:a,...i,ref:r}):t.jsx(vFt,{side:a,...i,ref:r})})}),vFt=s.forwardRef((e,r)=>{const n=lFt(fFt,e.__scopeTooltip),o=oFt(fFt,e.__scopeTooltip),a=s.useRef(null),i=Yst(r,a),[l,c]=s.useState(null),{trigger:u,onClose:d}=n,p=a.current,{onPointerInTransitChange:h}=o,f=s.useCallback(()=>{c(null),h(!1)},[h]),m=s.useCallback((e,t)=>{const r=e.currentTarget,n={x:e.clientX,y:e.clientY},o=function(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(r,n,o,a)){case a:return"left";case o:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}(n,r.getBoundingClientRect()),a=function(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r})}return n}(n,o),i=function(e){const{top:t,right:r,bottom:n,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:n},{x:o,y:n}]}(t.getBoundingClientRect()),s=function(e){const t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0),function(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const n=e[r];for(;t.length>=2;){const e=t[t.length-1],r=t[t.length-2];if(!((e.x-r.x)*(n.y-r.y)>=(e.y-r.y)*(n.x-r.x)))break;t.pop()}t.push(n)}t.pop();const r=[];for(let t=e.length-1;t>=0;t--){const n=e[t];for(;r.length>=2;){const e=r[r.length-1],t=r[r.length-2];if(!((e.x-t.x)*(n.y-t.y)>=(e.y-t.y)*(n.x-t.x)))break;r.pop()}r.push(n)}return r.pop(),1===t.length&&1===r.length&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}(t)}([...a,...i]);c(s),h(!0)},[h]);return s.useEffect(()=>()=>f(),[f]),s.useEffect(()=>{if(u&&p){const e=e=>m(e,p),t=e=>m(e,u);return u.addEventListener("pointerleave",e),p.addEventListener("pointerleave",t),()=>{u.removeEventListener("pointerleave",e),p.removeEventListener("pointerleave",t)}}},[u,p,m,f]),s.useEffect(()=>{if(l){const e=e=>{const t=e.target,r={x:e.clientX,y:e.clientY},n=(null==u?void 0:u.contains(t))||(null==p?void 0:p.contains(t)),o=!function(e,t){const{x:r,y:n}=e;let o=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){const i=t[e],s=t[a],l=i.x,c=i.y,u=s.x,d=s.y;c>n!=d>n&&r<(u-l)*(n-c)/(d-c)+l&&(o=!o)}return o}(r,l);n?f():o&&(f(),d())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}},[u,p,l,d,f]),t.jsx(xFt,{...e,ref:i})}),[yFt,gFt]=ZRt(iFt,{isInside:!1}),bFt=llt("TooltipContent"),xFt=s.forwardRef((e,r)=>{const{__scopeTooltip:n,children:o,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:l,...c}=e,u=lFt(fFt,n),d=JRt(n),{onClose:p}=u;return s.useEffect(()=>(document.addEventListener(rFt,p),()=>document.removeEventListener(rFt,p)),[p]),s.useEffect(()=>{if(u.trigger){const e=e=>{const t=e.target;null!=t&&t.contains(u.trigger)&&p()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}},[u.trigger,p]),t.jsx(glt,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:p,children:t.jsxs(Lyt,{"data-state":u.stateAttribute,...d,...c,ref:r,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[t.jsx(bFt,{children:o}),t.jsx(yFt,{scope:n,isInside:!0,children:t.jsx(ZDt,{id:u.contentId,role:"tooltip",children:a||o})})]})})});mFt.displayName=fFt;var wFt="TooltipArrow",kFt=s.forwardRef((e,r)=>{const{__scopeTooltip:n,...o}=e,a=JRt(n);return gFt(wFt,n).isInside?null:t.jsx(Byt,{...a,...o,ref:r})});kFt.displayName=wFt;var _Ft=mFt;const CFt=aFt,MFt=cFt,SFt=dFt,DFt=s.forwardRef(({className:e,sideOffset:r=4,...n},o)=>t.jsx(_Ft,{ref:o,sideOffset:r,className:vdt("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));DFt.displayName=_Ft.displayName;const OFt=({isListView:e,setIsListView:r,currentConfig:n})=>t.jsx(CFt,{children:t.jsxs(MFt,{children:[t.jsx(SFt,{asChild:!0,children:t.jsx(Edt,{variant:"outline",size:"sm",onClick:()=>r(!e),className:"flex items-center space-x-1 w-10 h-10 justify-center overflow-hidden",children:t.jsx(Tbt,{mode:"wait",children:t.jsx(xDt.div,{className:"flex items-center space-x-1",initial:{y:10,opacity:0},animate:{y:0,opacity:1},exit:{y:-10,opacity:0},transition:{duration:.15},children:e?t.jsx(Mst,{className:"h-4 w-4"}):t.jsx(Lst,{className:"h-4 w-4"})},e?"list":"calendar")})})}),t.jsx(DFt,{children:t.jsx("p",{children:e?n.localization.displayCalendar:n.localization.displayList})})]})});var PFt=["Enter"," "],EFt=["ArrowUp","PageDown","End"],jFt=["ArrowDown","PageUp","Home",...EFt],TFt={ltr:[...PFt,"ArrowRight"],rtl:[...PFt,"ArrowLeft"]},NFt={ltr:["ArrowLeft"],rtl:["ArrowRight"]},RFt="Menu",[FFt,zFt,IFt]=ygt(RFt),[AFt,LFt]=Xst(RFt,[IFt,wyt,Dgt]),BFt=wyt(),VFt=Dgt(),[HFt,qFt]=AFt(RFt),[$Ft,WFt]=AFt(RFt),UFt=e=>{const{__scopeMenu:r,open:n=!1,children:o,dir:a,onOpenChange:i,modal:l=!0}=e,c=BFt(r),[u,d]=s.useState(null),p=s.useRef(!1),h=plt(i),f=bgt(a);return s.useEffect(()=>{const e=()=>{p.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>p.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}},[]),t.jsx(Iyt,{...c,children:t.jsx(HFt,{scope:r,open:n,onOpenChange:h,content:u,onContentChange:d,children:t.jsx($Ft,{scope:r,onClose:s.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:p,dir:f,modal:l,children:o})})})};UFt.displayName=RFt;var GFt=s.forwardRef((e,r)=>{const{__scopeMenu:n,...o}=e,a=BFt(n);return t.jsx(Ayt,{...a,...o,ref:r})});GFt.displayName="MenuAnchor";var KFt="MenuPortal",[YFt,XFt]=AFt(KFt,{forceMount:void 0}),ZFt=e=>{const{__scopeMenu:r,forceMount:n,children:o,container:a}=e,i=qFt(KFt,r);return t.jsx(YFt,{scope:r,forceMount:n,children:t.jsx(Nlt,{present:n||i.open,children:t.jsx(Tlt,{asChild:!0,container:a,children:o})})})};ZFt.displayName=KFt;var QFt="MenuContent",[JFt,ezt]=AFt(QFt),tzt=s.forwardRef((e,r)=>{const n=XFt(QFt,e.__scopeMenu),{forceMount:o=n.forceMount,...a}=e,i=qFt(QFt,e.__scopeMenu),s=WFt(QFt,e.__scopeMenu);return t.jsx(FFt.Provider,{scope:e.__scopeMenu,children:t.jsx(Nlt,{present:o||i.open,children:t.jsx(FFt.Slot,{scope:e.__scopeMenu,children:s.modal?t.jsx(rzt,{...a,ref:r}):t.jsx(nzt,{...a,ref:r})})})})}),rzt=s.forwardRef((e,r)=>{const n=qFt(QFt,e.__scopeMenu),o=s.useRef(null),a=Yst(r,o);return s.useEffect(()=>{const e=o.current;if(e)return Nct(e)},[]),t.jsx(azt,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ust(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),nzt=s.forwardRef((e,r)=>{const n=qFt(QFt,e.__scopeMenu);return t.jsx(azt,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),ozt=olt("MenuContent.ScrollLock"),azt=s.forwardRef((e,r)=>{const{__scopeMenu:n,loop:o=!1,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:h,onInteractOutside:f,onDismiss:m,disableOutsideScroll:v,...y}=e,g=qFt(QFt,n),b=WFt(QFt,n),x=BFt(n),w=VFt(n),k=zFt(n),[_,C]=s.useState(null),M=s.useRef(null),S=Yst(r,M,g.onContentChange),D=s.useRef(0),O=s.useRef(""),P=s.useRef(0),E=s.useRef(null),j=s.useRef("right"),T=s.useRef(0),N=v?Sct:s.Fragment,R=v?{as:ozt,allowPinchZoom:!0}:void 0,F=e=>{var t,r;const n=O.current+e,o=k().filter(e=>!e.disabled),a=document.activeElement,i=null==(t=o.find(e=>e.ref.current===a))?void 0:t.textValue,s=function(e,t,r){const n=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let a=function(e,t){return e.map((r,n)=>e[(t+n)%e.length])}(e,Math.max(o,0));1===n.length&&(a=a.filter(e=>e!==r));const i=a.find(e=>e.toLowerCase().startsWith(n.toLowerCase()));return i!==r?i:void 0}(o.map(e=>e.textValue),n,i),l=null==(r=o.find(e=>e.textValue===s))?void 0:r.ref.current;(function e(t){O.current=t,window.clearTimeout(D.current),""!==t&&(D.current=window.setTimeout(()=>e(""),1e3))})(n),l&&setTimeout(()=>l.focus())};s.useEffect(()=>()=>window.clearTimeout(D.current),[]),zlt();const z=s.useCallback(e=>{var t,r;return j.current===(null==(t=E.current)?void 0:t.side)&&function(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return function(e,t){const{x:r,y:n}=e;let o=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){const i=t[e],s=t[a],l=i.x,c=i.y,u=s.x,d=s.y;c>n!=d>n&&r<(u-l)*(n-c)/(d-c)+l&&(o=!o)}return o}(r,t)}(e,null==(r=E.current)?void 0:r.area)},[]);return t.jsx(JFt,{scope:n,searchRef:O,onItemEnter:s.useCallback(e=>{z(e)&&e.preventDefault()},[z]),onItemLeave:s.useCallback(e=>{var t;z(e)||(null==(t=M.current)||t.focus(),C(null))},[z]),onTriggerLeave:s.useCallback(e=>{z(e)&&e.preventDefault()},[z]),pointerGraceTimerRef:P,onPointerGraceIntentChange:s.useCallback(e=>{E.current=e},[]),children:t.jsx(N,{...R,children:t.jsx(Mlt,{asChild:!0,trapped:a,onMountAutoFocus:Ust(i,e=>{var t;e.preventDefault(),null==(t=M.current)||t.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:t.jsx(glt,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:h,onInteractOutside:f,onDismiss:m,children:t.jsx(zgt,{asChild:!0,...w,dir:b.dir,orientation:"vertical",loop:o,currentTabStopId:_,onCurrentTabStopIdChange:C,onEntryFocus:Ust(u,e=>{b.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:t.jsx(Lyt,{role:"menu","aria-orientation":"vertical","data-state":jzt(g.open),"data-radix-menu-content":"",dir:b.dir,...x,...y,ref:S,style:{outline:"none",...y.style},onKeyDown:Ust(y.onKeyDown,e=>{const t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,r=e.ctrlKey||e.altKey||e.metaKey,n=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!r&&n&&F(e.key));const o=M.current;if(e.target!==o||!jFt.includes(e.key))return;e.preventDefault();const a=k().filter(e=>!e.disabled).map(e=>e.ref.current);EFt.includes(e.key)&&a.reverse(),function(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}(a)}),onBlur:Ust(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(D.current),O.current="")}),onPointerMove:Ust(e.onPointerMove,Rzt(e=>{const t=e.target,r=T.current!==e.clientX;if(e.currentTarget.contains(t)&&r){const t=e.clientX>T.current?"right":"left";j.current=t,T.current=e.clientX}}))})})})})})})});tzt.displayName=QFt;var izt=s.forwardRef((e,r)=>{const{__scopeMenu:n,...o}=e;return t.jsx(ult.div,{role:"group",...o,ref:r})});izt.displayName="MenuGroup";var szt=s.forwardRef((e,r)=>{const{__scopeMenu:n,...o}=e;return t.jsx(ult.div,{...o,ref:r})});szt.displayName="MenuLabel";var lzt="MenuItem",czt="menu.itemSelect",uzt=s.forwardRef((e,r)=>{const{disabled:n=!1,onSelect:o,...a}=e,i=s.useRef(null),l=WFt(lzt,e.__scopeMenu),c=ezt(lzt,e.__scopeMenu),u=Yst(r,i),d=s.useRef(!1);return t.jsx(dzt,{...a,ref:u,disabled:n,onClick:Ust(e.onClick,()=>{const e=i.current;if(!n&&e){const t=new CustomEvent(czt,{bubbles:!0,cancelable:!0});e.addEventListener(czt,e=>null==o?void 0:o(e),{once:!0}),dlt(e,t),t.defaultPrevented?d.current=!1:l.onClose()}}),onPointerDown:t=>{var r;null==(r=e.onPointerDown)||r.call(e,t),d.current=!0},onPointerUp:Ust(e.onPointerUp,e=>{var t;d.current||null==(t=e.currentTarget)||t.click()}),onKeyDown:Ust(e.onKeyDown,e=>{const t=""!==c.searchRef.current;n||t&&" "===e.key||PFt.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});uzt.displayName=lzt;var dzt=s.forwardRef((e,r)=>{const{__scopeMenu:n,disabled:o=!1,textValue:a,...i}=e,l=ezt(lzt,n),c=VFt(n),u=s.useRef(null),d=Yst(r,u),[p,h]=s.useState(!1),[f,m]=s.useState("");return s.useEffect(()=>{const e=u.current;e&&m((e.textContent??"").trim())},[i.children]),t.jsx(FFt.ItemSlot,{scope:n,disabled:o,textValue:a??f,children:t.jsx(Igt,{asChild:!0,...c,focusable:!o,children:t.jsx(ult.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...i,ref:d,onPointerMove:Ust(e.onPointerMove,Rzt(e=>{o?l.onItemLeave(e):(l.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ust(e.onPointerLeave,Rzt(e=>l.onItemLeave(e))),onFocus:Ust(e.onFocus,()=>h(!0)),onBlur:Ust(e.onBlur,()=>h(!1))})})})}),pzt=s.forwardRef((e,r)=>{const{checked:n=!1,onCheckedChange:o,...a}=e;return t.jsx(xzt,{scope:e.__scopeMenu,checked:n,children:t.jsx(uzt,{role:"menuitemcheckbox","aria-checked":Tzt(n)?"mixed":n,...a,ref:r,"data-state":Nzt(n),onSelect:Ust(a.onSelect,()=>null==o?void 0:o(!!Tzt(n)||!n),{checkForDefaultPrevented:!1})})})});pzt.displayName="MenuCheckboxItem";var hzt="MenuRadioGroup",[fzt,mzt]=AFt(hzt,{value:void 0,onValueChange:()=>{}}),vzt=s.forwardRef((e,r)=>{const{value:n,onValueChange:o,...a}=e,i=plt(o);return t.jsx(fzt,{scope:e.__scopeMenu,value:n,onValueChange:i,children:t.jsx(izt,{...a,ref:r})})});vzt.displayName=hzt;var yzt="MenuRadioItem",gzt=s.forwardRef((e,r)=>{const{value:n,...o}=e,a=mzt(yzt,e.__scopeMenu),i=n===a.value;return t.jsx(xzt,{scope:e.__scopeMenu,checked:i,children:t.jsx(uzt,{role:"menuitemradio","aria-checked":i,...o,ref:r,"data-state":Nzt(i),onSelect:Ust(o.onSelect,()=>{var e;return null==(e=a.onValueChange)?void 0:e.call(a,n)},{checkForDefaultPrevented:!1})})})});gzt.displayName=yzt;var bzt="MenuItemIndicator",[xzt,wzt]=AFt(bzt,{checked:!1}),kzt=s.forwardRef((e,r)=>{const{__scopeMenu:n,forceMount:o,...a}=e,i=wzt(bzt,n);return t.jsx(Nlt,{present:o||Tzt(i.checked)||!0===i.checked,children:t.jsx(ult.span,{...a,ref:r,"data-state":Nzt(i.checked)})})});kzt.displayName=bzt;var _zt=s.forwardRef((e,r)=>{const{__scopeMenu:n,...o}=e;return t.jsx(ult.div,{role:"separator","aria-orientation":"horizontal",...o,ref:r})});_zt.displayName="MenuSeparator";var Czt=s.forwardRef((e,r)=>{const{__scopeMenu:n,...o}=e,a=BFt(n);return t.jsx(Byt,{...a,...o,ref:r})});Czt.displayName="MenuArrow";var[Mzt,Szt]=AFt("MenuSub"),Dzt="MenuSubTrigger",Ozt=s.forwardRef((e,r)=>{const n=qFt(Dzt,e.__scopeMenu),o=WFt(Dzt,e.__scopeMenu),a=Szt(Dzt,e.__scopeMenu),i=ezt(Dzt,e.__scopeMenu),l=s.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=i,d={__scopeMenu:e.__scopeMenu},p=s.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return s.useEffect(()=>p,[p]),s.useEffect(()=>{const e=c.current;return()=>{window.clearTimeout(e),u(null)}},[c,u]),t.jsx(GFt,{asChild:!0,...d,children:t.jsx(dzt,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":a.contentId,"data-state":jzt(n.open),...e,ref:Kst(r,a.onTriggerChange),onClick:t=>{var r;null==(r=e.onClick)||r.call(e,t),!e.disabled&&!t.defaultPrevented&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ust(e.onPointerMove,Rzt(t=>{i.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!l.current&&(i.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{n.onOpenChange(!0),p()},100))})),onPointerLeave:Ust(e.onPointerLeave,Rzt(e=>{var t,r;p();const o=null==(t=n.content)?void 0:t.getBoundingClientRect();if(o){const t=null==(r=n.content)?void 0:r.dataset.side,a="right"===t,s=a?-5:5,l=o[a?"left":"right"],u=o[a?"right":"left"];i.onPointerGraceIntentChange({area:[{x:e.clientX+s,y:e.clientY},{x:l,y:o.top},{x:u,y:o.top},{x:u,y:o.bottom},{x:l,y:o.bottom}],side:t}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(e),e.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:Ust(e.onKeyDown,t=>{var r;const a=""!==i.searchRef.current;e.disabled||a&&" "===t.key||TFt[o.dir].includes(t.key)&&(n.onOpenChange(!0),null==(r=n.content)||r.focus(),t.preventDefault())})})})});Ozt.displayName=Dzt;var Pzt="MenuSubContent",Ezt=s.forwardRef((e,r)=>{const n=XFt(QFt,e.__scopeMenu),{forceMount:o=n.forceMount,...a}=e,i=qFt(QFt,e.__scopeMenu),l=WFt(QFt,e.__scopeMenu),c=Szt(Pzt,e.__scopeMenu),u=s.useRef(null),d=Yst(r,u);return t.jsx(FFt.Provider,{scope:e.__scopeMenu,children:t.jsx(Nlt,{present:o||i.open,children:t.jsx(FFt.Slot,{scope:e.__scopeMenu,children:t.jsx(azt,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:d,align:"start",side:"rtl"===l.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{var t;l.isUsingKeyboardRef.current&&(null==(t=u.current)||t.focus()),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:Ust(e.onFocusOutside,e=>{e.target!==c.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:Ust(e.onEscapeKeyDown,e=>{l.onClose(),e.preventDefault()}),onKeyDown:Ust(e.onKeyDown,e=>{var t;const r=e.currentTarget.contains(e.target),n=NFt[l.dir].includes(e.key);r&&n&&(i.onOpenChange(!1),null==(t=c.trigger)||t.focus(),e.preventDefault())})})})})})});function jzt(e){return e?"open":"closed"}function Tzt(e){return"indeterminate"===e}function Nzt(e){return Tzt(e)?"indeterminate":e?"checked":"unchecked"}function Rzt(e){return t=>"mouse"===t.pointerType?e(t):void 0}Ezt.displayName=Pzt;var Fzt=UFt,zzt=GFt,Izt=ZFt,Azt=tzt,Lzt=izt,Bzt=szt,Vzt=uzt,Hzt=pzt,qzt=vzt,$zt=gzt,Wzt=kzt,Uzt=_zt,Gzt=Czt,Kzt=Ozt,Yzt=Ezt,Xzt="DropdownMenu",[Zzt,Qzt]=Xst(Xzt,[LFt]),Jzt=LFt(),[eIt,tIt]=Zzt(Xzt),rIt=e=>{const{__scopeDropdownMenu:r,children:n,dir:o,open:a,defaultOpen:i,onOpenChange:l,modal:c=!0}=e,u=Jzt(r),d=s.useRef(null),[p,h]=nlt({prop:a,defaultProp:i??!1,onChange:l,caller:Xzt});return t.jsx(eIt,{scope:r,triggerId:tlt(),triggerRef:d,contentId:tlt(),open:p,onOpenChange:h,onOpenToggle:s.useCallback(()=>h(e=>!e),[h]),modal:c,children:t.jsx(Fzt,{...u,open:p,onOpenChange:h,dir:o,modal:c,children:n})})};rIt.displayName=Xzt;var nIt="DropdownMenuTrigger",oIt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,disabled:o=!1,...a}=e,i=tIt(nIt,n),s=Jzt(n);return t.jsx(zzt,{asChild:!0,...s,children:t.jsx(ult.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...a,ref:Kst(r,i.triggerRef),onPointerDown:Ust(e.onPointerDown,e=>{!o&&0===e.button&&!1===e.ctrlKey&&(i.onOpenToggle(),i.open||e.preventDefault())}),onKeyDown:Ust(e.onKeyDown,e=>{o||(["Enter"," "].includes(e.key)&&i.onOpenToggle(),"ArrowDown"===e.key&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())})})})});oIt.displayName=nIt;var aIt=e=>{const{__scopeDropdownMenu:r,...n}=e,o=Jzt(r);return t.jsx(Izt,{...o,...n})};aIt.displayName="DropdownMenuPortal";var iIt="DropdownMenuContent",sIt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=tIt(iIt,n),i=Jzt(n),l=s.useRef(!1);return t.jsx(Azt,{id:a.contentId,"aria-labelledby":a.triggerId,...i,...o,ref:r,onCloseAutoFocus:Ust(e.onCloseAutoFocus,e=>{var t;l.current||null==(t=a.triggerRef.current)||t.focus(),l.current=!1,e.preventDefault()}),onInteractOutside:Ust(e.onInteractOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey,n=2===t.button||r;(!a.modal||n)&&(l.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});sIt.displayName=iIt;var lIt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=Jzt(n);return t.jsx(Lzt,{...a,...o,ref:r})});lIt.displayName="DropdownMenuGroup";var cIt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=Jzt(n);return t.jsx(Bzt,{...a,...o,ref:r})});cIt.displayName="DropdownMenuLabel";var uIt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=Jzt(n);return t.jsx(Vzt,{...a,...o,ref:r})});uIt.displayName="DropdownMenuItem";var dIt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=Jzt(n);return t.jsx(Hzt,{...a,...o,ref:r})});dIt.displayName="DropdownMenuCheckboxItem";var pIt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=Jzt(n);return t.jsx(qzt,{...a,...o,ref:r})});pIt.displayName="DropdownMenuRadioGroup";var hIt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=Jzt(n);return t.jsx($zt,{...a,...o,ref:r})});hIt.displayName="DropdownMenuRadioItem";var fIt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=Jzt(n);return t.jsx(Wzt,{...a,...o,ref:r})});fIt.displayName="DropdownMenuItemIndicator";var mIt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=Jzt(n);return t.jsx(Uzt,{...a,...o,ref:r})});mIt.displayName="DropdownMenuSeparator";var vIt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=Jzt(n);return t.jsx(Gzt,{...a,...o,ref:r})});vIt.displayName="DropdownMenuArrow";var yIt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=Jzt(n);return t.jsx(Kzt,{...a,...o,ref:r})});yIt.displayName="DropdownMenuSubTrigger";var gIt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=Jzt(n);return t.jsx(Yzt,{...a,...o,ref:r,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});gIt.displayName="DropdownMenuSubContent";var bIt=aIt,xIt=sIt,wIt=cIt,kIt=uIt,_It=dIt,CIt=hIt,MIt=fIt,SIt=mIt,DIt=yIt,OIt=gIt;const PIt=rIt,EIt=oIt,jIt=s.forwardRef(({className:e,inset:r,children:n,...o},a)=>t.jsxs(DIt,{ref:a,className:vdt("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",r&&"pl-8",e),...o,children:[n,t.jsx(Pst,{className:"ml-auto"})]}));jIt.displayName=DIt.displayName;const TIt=s.forwardRef(({className:e,...r},n)=>t.jsx(OIt,{ref:n,className:vdt("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));TIt.displayName=OIt.displayName;const NIt=s.forwardRef(({className:e,sideOffset:r=4,...n},o)=>t.jsx(bIt,{children:t.jsx(xIt,{ref:o,sideOffset:r,className:vdt("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));NIt.displayName=xIt.displayName;const RIt=s.forwardRef(({className:e,inset:r,...n},o)=>t.jsx(kIt,{ref:o,className:vdt("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",r&&"pl-8",e),...n}));RIt.displayName=kIt.displayName;const FIt=s.forwardRef(({className:e,children:r,checked:n,...o},a)=>t.jsxs(_It,{ref:a,className:vdt("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...o,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(MIt,{children:t.jsx(Sst,{className:"h-4 w-4"})})}),r]}));FIt.displayName=_It.displayName;const zIt=s.forwardRef(({className:e,children:r,...n},o)=>t.jsxs(CIt,{ref:o,className:vdt("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(MIt,{children:t.jsx(Nst,{className:"h-2 w-2 fill-current"})})}),r]}));zIt.displayName=CIt.displayName;const IIt=s.forwardRef(({className:e,inset:r,...n},o)=>t.jsx(wIt,{ref:o,className:vdt("px-2 py-1.5 text-sm font-semibold",r&&"pl-8",e),...n}));IIt.displayName=wIt.displayName;const AIt=s.forwardRef(({className:e,...r},n)=>t.jsx(SIt,{ref:n,className:vdt("-mx-1 my-1 h-px bg-muted",e),...r}));AIt.displayName=SIt.displayName;const LIt=({isFilterOpen:e,setIsFilterOpen:r,resources:n,selectedResourceIds:o,toggleResourceSelection:a,currentConfig:i})=>n&&0!==n.length?t.jsxs(PIt,{open:e,onOpenChange:r,children:[t.jsx(EIt,{asChild:!0,children:t.jsx(Edt,{variant:"outline",size:"sm",className:"w-24 overflow-hidden",children:t.jsx(Tbt,{mode:"wait",children:t.jsxs(xDt.div,{className:"flex items-center space-x-1",initial:{y:10,opacity:0},animate:{y:0,opacity:1},exit:{y:-10,opacity:0},transition:{duration:.15},children:[t.jsx(zst,{className:"h-4 w-4 flex-shrink-0"}),t.jsx("span",{className:"text-xs font-medium",children:e?i.localization.filtering:i.localization.filter})]},e?"open":"closed")})})}),t.jsxs(NIt,{children:[t.jsx(IIt,{children:i.localization.filter}),t.jsx(AIt,{}),n.map(e=>t.jsx(FIt,{checked:o.includes(e.id),onCheckedChange:()=>a(e.id),onSelect:e=>{e.preventDefault()},children:t.jsxs("div",{className:"flex items-center",children:[e.accentClass&&t.jsx("div",{className:`w-4 h-4 rounded mr-2 ${e.accentClass}`}),e.name]})},e.id)),t.jsx(AIt,{}),t.jsx(Edt,{variant:"ghost",size:"sm",onClick:()=>r(!1),className:"w-full justify-center h-8 text-sm",children:i.localization.close})]})]}):null,BIt=({is24HourFormat:e,isTimeFormatChanging:r,toggleTimeFormat:n})=>t.jsx(Edt,{variant:"outline",size:"sm",onClick:n,disabled:r,className:"flex items-center space-x-1 w-20 justify-center overflow-hidden",children:t.jsx(Tbt,{mode:"wait",children:t.jsxs(xDt.div,{className:"flex items-center space-x-1",initial:{y:10,opacity:0},animate:{y:0,opacity:1},exit:{y:-10,opacity:0},transition:{duration:.15},children:[t.jsx(Rst,{className:"h-4 w-4 flex-shrink-0"}),t.jsx("span",{className:"text-xs font-medium",children:e?"24h":"12h"})]},e?"24h":"12h")})}),VIt=({handleTodayClick:e,isTodayDisabled:r,getTodayButtonText:n})=>t.jsx(Edt,{variant:"outline",size:"sm",onClick:e,disabled:r,className:"flex items-center space-x-1 w-28 h-10 justify-center overflow-hidden",children:t.jsx(Tbt,{mode:"wait",children:t.jsxs(xDt.div,{className:"flex items-center space-x-1",initial:{opacity:0},animate:{opacity:[0,1.05,1]},transition:{duration:.2,times:[0,.8,1]},children:[t.jsx(Mst,{className:"h-4 w-4 flex-shrink-0"}),t.jsx("span",{children:n()})]},n())})}),HIt=({currentView:e,setCurrentView:r,viewOptions:n,currentConfig:o})=>t.jsx("div",{className:"inline-flex items-center rounded-md border border-input bg-transparent p-1 w-full sm:w-[240px]",children:t.jsx(CFt,{children:n.map(n=>{const a=n.icon,i=e===n.value;return t.jsxs(MFt,{children:[t.jsx(SFt,{asChild:!0,children:t.jsx(xDt.div,{className:"relative flex-grow",initial:!1,animate:{flex:i?2:1},transition:{duration:.2},children:t.jsx(Edt,{variant:i?"secondary":"ghost",size:"sm",className:vdt("relative h-8 w-full overflow-hidden transition-colors",i?"bg-secondary text-secondary-foreground":"hover:bg-secondary/50 hover:text-secondary-foreground",!i&&"cursor-pointer"),onClick:()=>r(n.value),children:t.jsxs("div",{className:"flex items-center justify-center space-x-1 w-full",children:[t.jsx(a,{className:vdt("h-4 w-4 flex-shrink-0",i?"text-primary":"text-muted-foreground")}),t.jsx(Tbt,{children:i&&t.jsx(xDt.span,{className:"text-xs font-medium whitespace-nowrap overflow-hidden",initial:{opacity:0,width:0},animate:{opacity:1,width:"auto"},exit:{opacity:0,width:0},transition:{duration:.2},children:n.label})})]})})})}),t.jsx(DFt,{children:t.jsx("p",{children:`${o.localization.viewBy} ${n.label}`})})]},n.value)})})}),qIt=({currentDate:r,currentView:n,handlePrevious:o,handleNext:a,handleTodayClick:i,toggleTimeFormat:s,setCurrentView:l,isTimeFormatChanging:c,use24HourFormat:u,lastUpdated:d,animationDirection:p,months:h,handleDayChange:f,handleMonthChange:m,handleYearChange:v,currentConfig:y,onEventAdd:g,onEventDelete:b,isListView:x,setIsListView:w,resources:k,selectedResourceIds:_,setSelectedResourceIds:C})=>{const[M,S]=e.useState(!1);(({handleNext:t,handlePrevious:r})=>{const[n,o]=e.useState(0),[a,i]=e.useState(!1);e.useEffect(()=>{const e=e=>{if("ArrowLeft"===e.key||"ArrowRight"===e.key){e.preventDefault();const s=Date.now();!a&&s-n>200&&(i(!0),o(s),"ArrowLeft"===e.key?r():t())}},s=e=>{("ArrowLeft"===e.key||"ArrowRight"===e.key)&&i(!1)};return window.addEventListener("keydown",e),window.addEventListener("keyup",s),()=>{window.removeEventListener("keydown",e),window.removeEventListener("keyup",s)}},[t,r,a,n])})({handleNext:a,handlePrevious:o});const D=[{value:"day",label:y.localization.day,icon:Bst},{value:"week",label:y.localization.week,icon:Fst},{value:"month",label:y.localization.month,icon:Ist},{value:"year",label:y.localization.year,icon:Ast}];return t.jsxs("div",{className:"flex flex-col xl:flex-row justify-between items-center mb-4 space-y-2 sm:px-0",children:[t.jsx(XRt,{currentDate:r,currentView:n,handlePrevious:o,handleNext:a,lastUpdated:d,animationDirection:p,months:h,handleDayChange:f,handleMonthChange:m,handleYearChange:v,currentConfig:y}),t.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2 w-full sm:w-auto",children:[t.jsx(BIt,{is24HourFormat:u,isTimeFormatChanging:c,toggleTimeFormat:s}),t.jsx(LIt,{isFilterOpen:M,setIsFilterOpen:S,resources:k,selectedResourceIds:_,toggleResourceSelection:e=>{C(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},currentConfig:y}),t.jsx(VIt,{handleTodayClick:i,isTodayDisabled:(()=>{const e=new Date;switch(n){case"day":return Gat(r,e);case"week":return Gat(Iat(r,{weekStartsOn:u?1:0}),Iat(e,{weekStartsOn:u?1:0}));case"month":return Git(r,e);case"year":return r.getFullYear()===e.getFullYear();default:return!1}})(),getTodayButtonText:()=>{switch(n){case"day":default:return y.localization.today;case"week":return y.localization.thisWeek;case"month":return y.localization.thisMonth;case"year":return y.localization.thisYear}}}),t.jsx(OFt,{isListView:x,setIsListView:w,currentConfig:y}),t.jsx(HIt,{currentView:n,setCurrentView:l,viewOptions:D,currentConfig:y}),t.jsx(gTt,{translations:y.localization,event:(()=>{switch(n){case"day":default:return{startDate:r,endDate:r};case"week":return{startDate:Iat(r,{weekStartsOn:u?1:0}),endDate:oit(r,{weekStartsOn:u?1:0})}}})(),onAddEvent:g,onDeleteEvent:b,resources:k})]})]})},$It=({currentView:t,currentDate:r,onDateRangeChange:n,is24HourFormat:o})=>{const a=e.useRef(r),i=e.useRef(t),s=e.useCallback(()=>{let e,n;switch(t){case"day":default:e=Bat(r),n=Qat(r);break;case"week":e=Iat(r,{weekStartsOn:o?1:0}),n=oit(r,{weekStartsOn:o?1:0});break;case"month":e=tit(r),n=Jat(r);break;case"year":e=nit(r),n=rit(r)}return{startDate:e,endDate:n}},[t,r,o]),l=e.useCallback(()=>{if(t!==i.current)return!0;const e=a.current;switch(t){case"day":return!Gat(r,e);case"week":return!function(e,t,r){return+Iat(e,r)==+Iat(t,r)}(r,e,{weekStartsOn:o?1:0});case"month":return!Git(r,e);case"year":return!Kit(r,e);default:return!0}},[t,r,o]);e.useEffect(()=>{(async()=>{if(n&&l()){const{startDate:e,endDate:o}=s();await n(e,o),a.current=r,i.current=t}})()},[t,r,n,s,l])},WIt=s.forwardRef(({className:e,...r},n)=>t.jsx("div",{ref:n,className:vdt("rounded-lg border bg-card text-card-foreground shadow-sm",e),...r}));WIt.displayName="Card";const UIt=s.forwardRef(({className:e,...r},n)=>t.jsx("div",{ref:n,className:vdt("flex flex-col space-y-1.5 p-6",e),...r}));UIt.displayName="CardHeader";const GIt=s.forwardRef(({className:e,...r},n)=>t.jsx("div",{ref:n,className:vdt("text-2xl font-semibold leading-none tracking-tight",e),...r}));GIt.displayName="CardTitle";const KIt=s.forwardRef(({className:e,...r},n)=>t.jsx("div",{ref:n,className:vdt("text-sm text-muted-foreground",e),...r}));KIt.displayName="CardDescription";const YIt=s.forwardRef(({className:e,...r},n)=>t.jsx("div",{ref:n,className:vdt("p-6 pt-0",e),...r}));YIt.displayName="CardContent";const XIt=s.forwardRef(({className:e,...r},n)=>t.jsx("div",{ref:n,className:vdt("flex items-center p-6 pt-0",e),...r}));XIt.displayName="CardFooter";var ZIt="ScrollArea",[QIt,JIt]=Xst(ZIt),[eAt,tAt]=QIt(ZIt),rAt=s.forwardRef((e,r)=>{const{__scopeScrollArea:n,type:o="hover",dir:a,scrollHideDelay:i=600,...l}=e,[c,u]=s.useState(null),[d,p]=s.useState(null),[h,f]=s.useState(null),[m,v]=s.useState(null),[y,g]=s.useState(null),[b,x]=s.useState(0),[w,k]=s.useState(0),[_,C]=s.useState(!1),[M,S]=s.useState(!1),D=Yst(r,e=>u(e)),O=bgt(a);return t.jsx(eAt,{scope:n,type:o,dir:O,scrollHideDelay:i,scrollArea:c,viewport:d,onViewportChange:p,content:h,onContentChange:f,scrollbarX:m,onScrollbarXChange:v,scrollbarXEnabled:_,onScrollbarXEnabledChange:C,scrollbarY:y,onScrollbarYChange:g,scrollbarYEnabled:M,onScrollbarYEnabledChange:S,onCornerWidthChange:x,onCornerHeightChange:k,children:t.jsx(ult.div,{dir:O,...l,ref:D,style:{position:"relative","--radix-scroll-area-corner-width":b+"px","--radix-scroll-area-corner-height":w+"px",...e.style}})})});rAt.displayName=ZIt;var nAt="ScrollAreaViewport",oAt=s.forwardRef((e,r)=>{const{__scopeScrollArea:n,children:o,nonce:a,...i}=e,l=tAt(nAt,n),c=Yst(r,s.useRef(null),l.onViewportChange);return t.jsxs(t.Fragment,{children:[t.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:a}),t.jsx(ult.div,{"data-radix-scroll-area-viewport":"",...i,ref:c,style:{overflowX:l.scrollbarXEnabled?"scroll":"hidden",overflowY:l.scrollbarYEnabled?"scroll":"hidden",...e.style},children:t.jsx("div",{ref:l.onContentChange,style:{minWidth:"100%",display:"table"},children:o})})]})});oAt.displayName=nAt;var aAt="ScrollAreaScrollbar",iAt=s.forwardRef((e,r)=>{const{forceMount:n,...o}=e,a=tAt(aAt,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:l}=a,c="horizontal"===e.orientation;return s.useEffect(()=>(c?i(!0):l(!0),()=>{c?i(!1):l(!1)}),[c,i,l]),"hover"===a.type?t.jsx(sAt,{...o,ref:r,forceMount:n}):"scroll"===a.type?t.jsx(lAt,{...o,ref:r,forceMount:n}):"auto"===a.type?t.jsx(cAt,{...o,ref:r,forceMount:n}):"always"===a.type?t.jsx(uAt,{...o,ref:r}):null});iAt.displayName=aAt;var sAt=s.forwardRef((e,r)=>{const{forceMount:n,...o}=e,a=tAt(aAt,e.__scopeScrollArea),[i,l]=s.useState(!1);return s.useEffect(()=>{const e=a.scrollArea;let t=0;if(e){const r=()=>{window.clearTimeout(t),l(!0)},n=()=>{t=window.setTimeout(()=>l(!1),a.scrollHideDelay)};return e.addEventListener("pointerenter",r),e.addEventListener("pointerleave",n),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",r),e.removeEventListener("pointerleave",n)}}},[a.scrollArea,a.scrollHideDelay]),t.jsx(Nlt,{present:n||i,children:t.jsx(cAt,{"data-state":i?"visible":"hidden",...o,ref:r})})}),lAt=s.forwardRef((e,r)=>{const{forceMount:n,...o}=e,a=tAt(aAt,e.__scopeScrollArea),i="horizontal"===e.orientation,l=PAt(()=>u("SCROLL_END"),100),[c,u]=function(e,t){return s.useReducer((e,r)=>t[e][r]??e,e)}("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return s.useEffect(()=>{if("idle"===c){const e=window.setTimeout(()=>u("HIDE"),a.scrollHideDelay);return()=>window.clearTimeout(e)}},[c,a.scrollHideDelay,u]),s.useEffect(()=>{const e=a.viewport,t=i?"scrollLeft":"scrollTop";if(e){let r=e[t];const n=()=>{const n=e[t];r!==n&&(u("SCROLL"),l()),r=n};return e.addEventListener("scroll",n),()=>e.removeEventListener("scroll",n)}},[a.viewport,i,u,l]),t.jsx(Nlt,{present:n||"hidden"!==c,children:t.jsx(uAt,{"data-state":"hidden"===c?"hidden":"visible",...o,ref:r,onPointerEnter:Ust(e.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:Ust(e.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),cAt=s.forwardRef((e,r)=>{const n=tAt(aAt,e.__scopeScrollArea),{forceMount:o,...a}=e,[i,l]=s.useState(!1),c="horizontal"===e.orientation,u=PAt(()=>{if(n.viewport){const e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;l(c?e:t)}},10);return EAt(n.viewport,u),EAt(n.content,u),t.jsx(Nlt,{present:o||i,children:t.jsx(uAt,{"data-state":i?"visible":"hidden",...a,ref:r})})}),uAt=s.forwardRef((e,r)=>{const{orientation:n="vertical",...o}=e,a=tAt(aAt,e.__scopeScrollArea),i=s.useRef(null),l=s.useRef(0),[c,u]=s.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=_At(c.viewport,c.content),p={...o,sizes:c,onSizesChange:u,hasThumb:d>0&&d<1,onThumbChange:e=>i.current=e,onThumbPointerUp:()=>l.current=0,onThumbPointerDown:e=>l.current=e};function h(e,t){return function(e,t,r,n="ltr"){const o=CAt(r),a=o/2,i=t||a,s=o-i,l=r.scrollbar.paddingStart+i,c=r.scrollbar.size-r.scrollbar.paddingEnd-s,u=r.content-r.viewport,d="ltr"===n?[0,u]:[-1*u,0];return SAt([l,c],d)(e)}(e,l.current,c,t)}return"horizontal"===n?t.jsx(dAt,{...p,ref:r,onThumbPositionChange:()=>{if(a.viewport&&i.current){const e=MAt(a.viewport.scrollLeft,c,a.dir);i.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{a.viewport&&(a.viewport.scrollLeft=e)},onDragScroll:e=>{a.viewport&&(a.viewport.scrollLeft=h(e,a.dir))}}):"vertical"===n?t.jsx(pAt,{...p,ref:r,onThumbPositionChange:()=>{if(a.viewport&&i.current){const e=MAt(a.viewport.scrollTop,c);i.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{a.viewport&&(a.viewport.scrollTop=e)},onDragScroll:e=>{a.viewport&&(a.viewport.scrollTop=h(e))}}):null}),dAt=s.forwardRef((e,r)=>{const{sizes:n,onSizesChange:o,...a}=e,i=tAt(aAt,e.__scopeScrollArea),[l,c]=s.useState(),u=s.useRef(null),d=Yst(r,u,i.onScrollbarXChange);return s.useEffect(()=>{u.current&&c(getComputedStyle(u.current))},[u]),t.jsx(mAt,{"data-orientation":"horizontal",...a,ref:d,sizes:n,style:{bottom:0,left:"rtl"===i.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===i.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":CAt(n)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,r)=>{if(i.viewport){const n=i.viewport.scrollLeft+t.deltaX;e.onWheelScroll(n),DAt(n,r)&&t.preventDefault()}},onResize:()=>{u.current&&i.viewport&&l&&o({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:kAt(l.paddingLeft),paddingEnd:kAt(l.paddingRight)}})}})}),pAt=s.forwardRef((e,r)=>{const{sizes:n,onSizesChange:o,...a}=e,i=tAt(aAt,e.__scopeScrollArea),[l,c]=s.useState(),u=s.useRef(null),d=Yst(r,u,i.onScrollbarYChange);return s.useEffect(()=>{u.current&&c(getComputedStyle(u.current))},[u]),t.jsx(mAt,{"data-orientation":"vertical",...a,ref:d,sizes:n,style:{top:0,right:"ltr"===i.dir?0:void 0,left:"rtl"===i.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":CAt(n)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,r)=>{if(i.viewport){const n=i.viewport.scrollTop+t.deltaY;e.onWheelScroll(n),DAt(n,r)&&t.preventDefault()}},onResize:()=>{u.current&&i.viewport&&l&&o({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:kAt(l.paddingTop),paddingEnd:kAt(l.paddingBottom)}})}})}),[hAt,fAt]=QIt(aAt),mAt=s.forwardRef((e,r)=>{const{__scopeScrollArea:n,sizes:o,hasThumb:a,onThumbChange:i,onThumbPointerUp:l,onThumbPointerDown:c,onThumbPositionChange:u,onDragScroll:d,onWheelScroll:p,onResize:h,...f}=e,m=tAt(aAt,n),[v,y]=s.useState(null),g=Yst(r,e=>y(e)),b=s.useRef(null),x=s.useRef(""),w=m.viewport,k=o.content-o.viewport,_=plt(p),C=plt(u),M=PAt(h,10);function S(e){if(b.current){const t=e.clientX-b.current.left,r=e.clientY-b.current.top;d({x:t,y:r})}}return s.useEffect(()=>{const e=e=>{const t=e.target;(null==v?void 0:v.contains(t))&&_(e,k)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})},[w,v,k,_]),s.useEffect(C,[o,C]),EAt(v,M),EAt(m.content,M),t.jsx(hAt,{scope:n,scrollbar:v,hasThumb:a,onThumbChange:plt(i),onThumbPointerUp:plt(l),onThumbPositionChange:C,onThumbPointerDown:plt(c),children:t.jsx(ult.div,{...f,ref:g,style:{position:"absolute",...f.style},onPointerDown:Ust(e.onPointerDown,e=>{0===e.button&&(e.target.setPointerCapture(e.pointerId),b.current=v.getBoundingClientRect(),x.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),S(e))}),onPointerMove:Ust(e.onPointerMove,S),onPointerUp:Ust(e.onPointerUp,e=>{const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=x.current,m.viewport&&(m.viewport.style.scrollBehavior=""),b.current=null})})})}),vAt="ScrollAreaThumb",yAt=s.forwardRef((e,r)=>{const{forceMount:n,...o}=e,a=fAt(vAt,e.__scopeScrollArea);return t.jsx(Nlt,{present:n||a.hasThumb,children:t.jsx(gAt,{ref:r,...o})})}),gAt=s.forwardRef((e,r)=>{const{__scopeScrollArea:n,style:o,...a}=e,i=tAt(vAt,n),l=fAt(vAt,n),{onThumbPositionChange:c}=l,u=Yst(r,e=>l.onThumbChange(e)),d=s.useRef(void 0),p=PAt(()=>{d.current&&(d.current(),d.current=void 0)},100);return s.useEffect(()=>{const e=i.viewport;if(e){const t=()=>{if(p(),!d.current){const t=OAt(e,c);d.current=t,c()}};return c(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[i.viewport,p,c]),t.jsx(ult.div,{"data-state":l.hasThumb?"visible":"hidden",...a,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...o},onPointerDownCapture:Ust(e.onPointerDownCapture,e=>{const t=e.target.getBoundingClientRect(),r=e.clientX-t.left,n=e.clientY-t.top;l.onThumbPointerDown({x:r,y:n})}),onPointerUp:Ust(e.onPointerUp,l.onThumbPointerUp)})});yAt.displayName=vAt;var bAt="ScrollAreaCorner",xAt=s.forwardRef((e,r)=>{const n=tAt(bAt,e.__scopeScrollArea),o=!(!n.scrollbarX||!n.scrollbarY);return"scroll"!==n.type&&o?t.jsx(wAt,{...e,ref:r}):null});xAt.displayName=bAt;var wAt=s.forwardRef((e,r)=>{const{__scopeScrollArea:n,...o}=e,a=tAt(bAt,n),[i,l]=s.useState(0),[c,u]=s.useState(0),d=!(!i||!c);return EAt(a.scrollbarX,()=>{var e;const t=(null==(e=a.scrollbarX)?void 0:e.offsetHeight)||0;a.onCornerHeightChange(t),u(t)}),EAt(a.scrollbarY,()=>{var e;const t=(null==(e=a.scrollbarY)?void 0:e.offsetWidth)||0;a.onCornerWidthChange(t),l(t)}),d?t.jsx(ult.div,{...o,ref:r,style:{width:i,height:c,position:"absolute",right:"ltr"===a.dir?0:void 0,left:"rtl"===a.dir?0:void 0,bottom:0,...e.style}}):null});function kAt(e){return e?parseInt(e,10):0}function _At(e,t){const r=e/t;return isNaN(r)?0:r}function CAt(e){const t=_At(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function MAt(e,t,r="ltr"){const n=CAt(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-o,i=t.content-t.viewport,s=a-n,l=KDt(e,"ltr"===r?[0,i]:[-1*i,0]);return SAt([0,i],[0,s])(l)}function SAt(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 DAt(e,t){return e>0&&e<t}var OAt=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function o(){const a={left:e.scrollLeft,top:e.scrollTop},i=r.left!==a.left,s=r.top!==a.top;(i||s)&&t(),r=a,n=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(n)};function PAt(e,t){const r=plt(e),n=s.useRef(0);return s.useEffect(()=>()=>window.clearTimeout(n.current),[]),s.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function EAt(e,t){const r=plt(t);Qst(()=>{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 jAt=rAt,TAt=oAt,NAt=xAt;const RAt=s.forwardRef(({className:e,children:r,...n},o)=>t.jsxs(jAt,{ref:o,className:vdt("relative overflow-hidden",e),...n,children:[t.jsx(TAt,{className:"h-full w-full rounded-[inherit]",children:r}),t.jsx(FAt,{}),t.jsx(NAt,{})]}));RAt.displayName=jAt.displayName;const FAt=s.forwardRef(({className:e,orientation:r="vertical",...n},o)=>t.jsx(iAt,{ref:o,orientation:r,className:vdt("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 flex-col border-t border-t-transparent p-[1px]",e),...n,children:t.jsx(yAt,{className:"relative flex-1 rounded-full bg-border"})}));FAt.displayName=iAt.displayName;const zAt=(e,t)=>((e,t)=>{const{hours:r,minutes:n}=qDt(e),o=lst(sst(new Date,r),n);return t?Vit(o,"HH:mm"):Vit(o,"h:mm").toLowerCase()+Vit(o,"a").toLowerCase()})(e,t),IAt=(e,t,r)=>r?Vit(sst(e,t),"HH:mm"):Vit(sst(e,t),"h a").toLowerCase(),AAt=e=>{if(!e)return{};try{if(typeof window<"u"){const t=(new Option).style;if(t.color="",t.color=e,""!==t.color)return{backgroundColor:e}}}catch{}return{backgroundColor:e}},LAt=({className:e,style:r})=>t.jsx(xDt.div,{className:vdt("bg-gray-50 dark:bg-transparent rounded-md overflow-hidden relative",e),style:r,initial:{opacity:.4},animate:{opacity:[.4,.5,.4]},transition:{duration:2,repeat:1/0,ease:"easeInOut"},children:t.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-gray-200 dark:via-muted-foreground to-transparent skeleton-shimmer"})}),BAt=({filteredEvents:e,currentDate:r,hoverLineRef:n,hoverTimeRef:o,setClickedTime:a,currentConfig:i,isAddEventPopupOpen:s,onEventAdd:l,onEventUpdate:c,onEventDelete:u,is24HourFormat:d,clickedTime:p,currentTimeLineRef:h,currentTimeTop:f,isLoading:m,setIsAddEventPopupOpen:v,onDateRangeChange:y,resources:g})=>{var b,x;const w=e.filter(e=>e.isRepeating?(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>Gat(e,r)))&&VDt(r,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily"):e.endDate?Yit(r,{start:Bat(e.startDate),end:Qat(e.endDate)}):Gat(e.startDate,r)),k=Array.from({length:24},(e,t)=>t),_=(e,t)=>{if(e.isRepeating){const r=`${zAt(e.startTime,d)} - ${zAt(e.endTime,d)}`,n=Vit(e.startDate,"MMM d"),o=Vit(e.endDate||e.startDate,"MMM d"),a=Vit(t,"EEEE"),s=Vit(t,"do");switch(e.isRepeatingInterval||"daily"){case"daily":default:return i.localization.repeatDailyDescription.replace("{timeRange}",r).replace("{startDate}",n).replace("{endDate}",o);case"weekly":return i.localization.repeatWeeklyDescription.replace("{dayName}",a).replace("{timeRange}",r).replace("{startDate}",n).replace("{endDate}",o);case"monthly":return i.localization.repeatMonthlyDescription.replace("{dayOfMonth}",s).replace("{timeRange}",r).replace("{startDate}",n).replace("{endDate}",o)}}else if(e.endDate&&!Gat(e.startDate,e.endDate)){const r=Math.floor(Xat(Qat(e.endDate),Bat(e.startDate)))+1,n=Math.floor(Xat(Bat(t),Bat(e.startDate)))+1;return i.localization.dayXofY.replace("{x}",n.toString()).replace("{y}",r.toString())}return null},C=w.reduce((e,t)=>{const n=UDt(t.startTime,t.endTime),o=t.endDate&&!Gat(t.startDate,t.endDate);return t.isRepeating?n?e.repeatingFullDayEvents.push(t):e.regularEvents.push(t):o?Gat(t.startDate,r)?e.multiDayEvents.push({...t,isStart:!0}):Gat(t.endDate,r)?e.multiDayEvents.push({...t,isEnd:!0}):e.multiDayEvents.push({...t,isMiddle:!0}):n?e.fullDayEvents.push(t):e.regularEvents.push(t),e},{repeatingFullDayEvents:[],multiDayEvents:[],fullDayEvents:[],regularEvents:[]}),M=[...C.repeatingFullDayEvents,...C.multiDayEvents,...C.fullDayEvents],S=C.regularEvents,{sortedEvents:D,eventPositions:O,maxColumn:P}=(e=>{const t=e.sort((e,t)=>{const n=$Dt(r,e.startTime),o=$Dt(r,t.startTime);return n.getTime()-o.getTime()}),n={};let o=0;const a=(e,t)=>{const n=$Dt(r,e.startTime),o=$Dt(r,e.endTime),a=$Dt(r,t.startTime);return n<$Dt(r,t.endTime)&&a<o};return t.forEach((e,r)=>{let i=0,s=!1;for(let o=0;o<r;o++)a(e,t[o])&&(i=Math.max(i,n[t[o].id].column+1),s=!0);n[e.id]={column:i,span:1},s&&(o=Math.max(o,i))}),0===o?(t.forEach(e=>{n[e.id]={column:0,span:1}}),{sortedEvents:t,eventPositions:n,maxColumn:1}):(t.forEach(e=>{if(n[e.id].column<o){let r=1;for(;r+n[e.id].column<=o&&!t.some(t=>n[t.id].column===n[e.id].column+r&&a(e,t));)r++;n[e.id].span=r}}),{sortedEvents:t,eventPositions:n,maxColumn:o+1})})(S),E=({event:e,currentDate:r})=>t.jsx(gTt,{event:e,onAddEvent:l,onUpdateEvent:c,onDeleteEvent:u,dateFromViewClick:r,translations:i.localization,resources:g,children:t.jsxs("div",{className:vdt("px-2 py-1 rounded cursor-pointer","transition-colors duration-200","hover:bg-opacity-40","dark:hover:bg-opacity-40",(()=>{switch(e.isRepeatingInterval||"daily"){case"daily":default:return"border border-dashed border-opacity-50";case"weekly":case"monthly":return"border border-dotted border-opacity-50"}})(),"min-h-[44px]"),style:AAt(e.color),children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("div",{className:"text-xs font-semibold truncate",children:e.title||"Untitled Event"}),t.jsxs("div",{className:"text-xs font-medium",children:[zAt(e.startTime,d)," - ",zAt(e.endTime,d)]})]}),t.jsx("div",{className:"text-xs italic",children:_(e,r||new Date)}),e.description&&t.jsx("div",{className:"text-xs truncate mt-0.5",children:e.description})]})},e.id),j=({event:e,currentDate:r})=>t.jsx(gTt,{event:e,onAddEvent:l,onUpdateEvent:c,onDeleteEvent:u,dateFromViewClick:r,translations:i.localization,resources:g,children:t.jsxs("div",{className:vdt("px-2 py-1 rounded cursor-pointer","transition-colors duration-200","hover:bg-opacity-40 dark:hover:bg-opacity-40","min-h-[44px]",e.isStart&&["border-l-4","border-l-black/70 dark:border-l-white/50"],e.isEnd&&["border-r-4","border-r-black/70 dark:border-r-white/50"],e.isMiddle&&"border-x-0"),style:AAt(e.color),children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("div",{className:"text-xs font-semibold truncate",children:e.title||"Untitled Event"}),t.jsx("div",{className:"text-xs font-medium",children:e.isStart?`${i.localization.starts}: ${zAt(e.startTime,d)}`:e.isEnd?`${i.localization.ends}: ${zAt(e.endTime,d)}`:i.localization.allDay})]}),t.jsx("div",{className:"text-xs italic",children:_(e,r||new Date)}),e.description&&t.jsx("div",{className:"text-xs truncate mt-0.5",children:e.description})]})},e.id),T=({event:e})=>t.jsx(gTt,{event:e,onAddEvent:l,onUpdateEvent:c,onDeleteEvent:u,dateFromViewClick:r,translations:i.localization,resources:g,children:t.jsxs("div",{className:vdt("px-2 py-1 rounded cursor-pointer","transition-colors duration-200","hover:bg-opacity-40 dark:hover:bg-opacity-40","min-h-[44px]","border-l-4 border-r-4","border-black/70 dark:border-white/50"),style:AAt(e.color),children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("div",{className:"text-xs font-semibold truncate",children:e.title||"Untitled Event"}),t.jsx("div",{className:"text-xs font-medium",children:i.localization.allDay})]}),e.description&&t.jsx("div",{className:"text-xs truncate mt-0.5",children:e.description})]})},e.id),N=({event:e,currentDate:r,index:n})=>e.isRepeating?t.jsx(E,{event:e,currentDate:r,index:n}):e.endDate&&!Gat(e.startDate,e.endDate)?t.jsx(j,{event:e,currentDate:r,index:n}):t.jsx(T,{event:e,index:n});return t.jsxs(WIt,{className:"pb-4 pl-4 pr-4",children:[t.jsxs("div",{className:"sticky top-0 bg-background z-20 pt-4 pb-1",children:[t.jsx("h2",{className:"text-xl font-bold mb-4",children:`${i.localization.monthNames[r.getMonth()]} ${r.getDate()}, ${r.getFullYear()}`}),M.length>0&&t.jsxs("div",{className:"mb-4",children:[t.jsxs("h3",{className:"text-sm font-semibold mb-2",children:[i.localization.fullDayEvents," (",M.length,")"]}),M.map((e,n)=>t.jsx(xDt.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{delay:.05*n},className:"space-y-2 mb-1",children:t.jsx(N,{event:e,currentDate:r,index:n},e.id)},e.id))]})]}),t.jsx(RAt,{className:"px-4 h-[570px]",children:t.jsxs("div",{className:"relative mt-2 mb-2",children:[t.jsx("div",{className:"absolute left-0 w-16 z-10 bg-background",children:t.jsx(gTt,{translations:i.localization,onAddEvent:l,event:{startDate:r,endDate:r,startTime:p||Vit(new Date,"HH:mm"),endTime:p?Rat(Zit(`2000-01-01T${p}`),1).toTimeString().slice(0,5):Vit(Rat(new Date,1),"HH:mm")},resources:g,children:t.jsx("div",{onMouseMove:e=>{const t=e.currentTarget.getBoundingClientRect(),r=e.clientY-t.top;let a,i,s;if(e.ctrlKey){const e=15*Math.round(r/64*60/15);a=Math.floor(e/60),i=e%60,s=e/60*64}else a=Math.floor(r/64),i=Math.floor(r%64/64*60),s=r;const l=`${a.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}`;n.current&&(n.current.style.top=`${s}px`,n.current.style.display="block"),o.current&&(o.current.textContent=l)},onMouseLeave:()=>{n.current&&(n.current.style.display="none")},onClick:e=>{const t=e.currentTarget.getBoundingClientRect(),r=e.clientY-t.top,n=Math.floor(r/64),o=Math.floor(r%64/64*60),i=`${n.toString().padStart(2,"0")}:${o.toString().padStart(2,"0")}`;a(i)},children:k.map(e=>t.jsx("div",{className:"cursor-pointer h-16 pr-2 text-right text-sm text-muted-foreground",children:IAt(r,e,d)},`hour-${e}`))})})}),t.jsxs("div",{className:"ml-16 relative",onDoubleClick:e=>{if(s||!i.dayView.enableDoubleClickToAddEvent)return;const t=e.currentTarget.getBoundingClientRect(),n=e.clientY-t.top,o=Math.floor(n/(16/15)),a=Math.floor(o/60),c=o%60,u=`${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}`,d=`${(a+1).toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}`;l({title:"",startDate:r,endDate:r,startTime:u,endTime:d,color:"blue",isRepeating:!1})},children:[k.map(e=>t.jsx("div",{className:"h-16 border-t border-border"},e)),!(null!=(b=i.dayView)&&b.hideHoverLine)&&t.jsx("div",{ref:n,className:"absolute left-0 right-0 h-px bg-primary z-40 pointer-events-none",style:{display:"none"},children:t.jsx("span",{ref:o,className:"absolute left-0 transform -translate-x-full -translate-y-1/2 bg-primary text-primary-foreground text-xs px-1 rounded"})}),Gat(r,new Date)&&!(null!=(x=i.dayView)&&x.hideTimeline)&&t.jsx("div",{ref:h,className:"absolute left-0 right-0 h-px bg-red-500 z-30 pointer-events-none",style:{top:`${f}px`},children:t.jsx("span",{className:"absolute left-0 transform -translate-x-full -translate-y-1/2 bg-red-500 text-white text-xs px-1 rounded",children:Vit(new Date,"HH:mm")})}),m&&y&&Array.from({length:10}).map((e,r)=>t.jsx(LAt,{className:"absolute top-0 left-0 right-0 h-[3px] dark:h-[1px] animate-pulse bg-primary/20",style:{top:64*r+"px"}},r)),D.map((e,n)=>{const o=$Dt(r,e.startTime),a=$Dt(r,e.endTime),s=60*o.getHours()+o.getMinutes(),p=60*a.getHours()+a.getMinutes()-s,{column:h,span:f}=O[e.id],m=f/P*100,y=h/P*100,b=_(e,r);return t.jsx(gTt,{event:e,onAddEvent:l,onUpdateEvent:c,onDeleteEvent:u,onOpenChange:v,dateFromViewClick:r,translations:i.localization,resources:g,children:t.jsxs(xDt.div,{className:vdt("absolute px-2 py-1 rounded overflow-hidden cursor-pointer","transition-colors duration-200","hover:bg-opacity-40","dark:hover:bg-opacity-40",(()=>{if(!e.isRepeating)return"";switch(e.isRepeatingInterval||"daily"){case"daily":default:return"border border-dashed border-opacity-50";case"weekly":case"monthly":return"border border-dotted border-opacity-50"}})()),style:{...AAt(e.color),top:s*(16/15)+"px",height:`${Math.max(p*(16/15),24)}px`,left:`${y}%`,width:`${m}%`,zIndex:n+1},initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.1*n},children:[t.jsx("div",{className:"text-xs font-semibold truncate",children:e.title||i.localization.untitledEvent}),t.jsxs("div",{className:"text-xs",children:[zAt(e.startTime,d)," - ",zAt(e.endTime,d)]}),e.description&&t.jsx("div",{className:"text-xs font-semibold truncate",children:e.description}),b&&t.jsx("div",{className:"text-xs italic",children:b})]})},`${e.id}-${e.startTime}`)})]})]})})]})},VAt=({events:r,date:n,addEvent:o,updateEvent:a,onDelete:i,children:s,onOpenChange:l,preSelectedColor:c,is24HourFormat:u,translations:d,resources:p})=>{const[h,f]=e.useState(null),[m,v]=e.useState(!1),y=e=>{h&&(a(e),f(null))},g=e=>{const t=e.endDate&&!Gat(e.startDate,e.endDate),r=Gat(e.startDate,n),o=e.endDate&&Gat(e.endDate,n),a=t&&!r&&!o,i=e.isRepeating?vdt("border-2 dark:border border-dashed border-opacity-50",r&&"border-l-solid border-l-2 border-l-black/90 dark:border-l-white/50",o&&"border-r-solid border-r-2 border-r-black/70 dark:border-r-white/50",a&&"border-x-0"):vdt(r&&"border-l-4 border-l-black/70 dark:border-l-white/50",o&&"border-r-4 border-r-black/70 dark:border-r-white/50",a&&"border-x-0");return vdt("p-2 rounded cursor-pointer hover:opacity-80 transition-opacity w-full text-left","transition-colors duration-200","hover:bg-opacity-40","dark:hover:bg-opacity-40",i)},b=e=>{const t=Gat(e.startDate,n),r=e.endDate&&Gat(e.endDate,n);return!t||e.endDate&&!Gat(e.startDate,e.endDate)?t?`Starts ${zAt(e.startTime,u)}`:r?e.isRepeating?`Ends today (${zAt(e.startTime,u)} - ${zAt(e.endTime,u)})`:`Ends ${zAt(e.endTime,u)}`:e.isRepeating?`${zAt(e.startTime,u)} - ${zAt(e.endTime,u)}`:"All day":`${zAt(e.startTime,u)} - ${zAt(e.endTime,u)}`};return t.jsxs(ydt,{open:m,onOpenChange:v,children:[t.jsx(gdt,{asChild:!0,children:s}),t.jsxs(wdt,{className:"sm:max-w-[425px]",children:[t.jsx(kdt,{children:t.jsx(Cdt,{children:Vit(n,"MMMM d, yyyy")})}),t.jsx(RAt,{className:"h-[300px] mt-4",children:t.jsx("div",{className:"space-y-2 pr-4 flex flex-col items-center pl-6",children:r.sort((e,t)=>WDt(e.startTime)-WDt(t.startTime)).map(e=>t.jsx(gTt,{event:e,onAddEvent:o,onUpdateEvent:y,onDeleteEvent:i,onOpenChange:l,dateFromViewClick:n,translations:d,resources:p,children:t.jsxs("div",{className:g(e),style:AAt(e.color),onClick:()=>(e=>{f(e),v(!0)})(e),children:[e.title&&t.jsx("div",{className:"font-semibold truncate",children:e.title}),t.jsx("div",{className:"text-xs",children:b(e)}),e.description&&t.jsx("div",{className:"text-xs truncate mt-0.5",children:e.description})]})},e.id))})}),t.jsxs("div",{className:"mt-4 flex justify-between items-center",children:[t.jsx(gTt,{translations:d,event:{startDate:n,endDate:n,color:c},onAddEvent:o,dateFromViewClick:n,resources:p,children:t.jsxs(Edt,{variant:"outline",className:"flex-grow mr-2",children:[t.jsx(Tst,{className:"mr-2 h-4 w-4"}),d.addEvent]})}),t.jsx(Edt,{variant:"outline",onClick:()=>{f(null),v(!1)},children:"Close"})]})]})]})},HAt=({filteredEvents:e,currentDate:r,currentConfig:n,is24HourFormat:o,onEventAdd:a,onEventUpdate:i,onEventDelete:s,isLoading:l,hoverLineRef:c,hoverTimeRef:u,clickedTime:d,setClickedTime:p,currentTimeLineRef:h,currentTimeTop:f,isAddEventPopupOpen:m,setIsAddEventPopupOpen:v,onDateRangeChange:y,resources:g})=>{var b,x,w;const k=g??[],_=e.filter(e=>{const t=Bat(e.startDate),n=Bat(r);return e.isRepeating?(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>Gat(e,n)))&&VDt(n,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily"):e.endDate?Yit(n,{start:t,end:Qat(e.endDate)}):Gat(t,n)}),C=Array.from({length:24},(e,t)=>({hour:t,label:IAt(r,t,o)})),M=e=>{if(!e.isRepeating)return vdt(e.isStart&&"border-l-4 border-l-black/70 dark:border-l-white/50",e.isEnd&&"border-r-4 border-r-black/70 dark:border-r-white/50",e.isMiddle&&"border-x-0");switch(e.isRepeatingInterval||"daily"){case"daily":default:return"border border-dashed border-opacity-50";case"weekly":case"monthly":return"border border-dotted border-opacity-50"}},S=e=>{if(!e.isRepeating)return vdt(e.isStart&&"border-l-4 border-l-black/70 dark:border-l-white/50",e.isEnd&&"border-r-4 border-r-black/70 dark:border-r-white/50",e.isMiddle&&"border-x-0");switch(e.isRepeatingInterval||"daily"){case"daily":default:return"border border-dashed border-opacity-50";case"weekly":case"monthly":return"border border-dotted border-opacity-50"}};return t.jsx(WIt,{className:"",children:t.jsxs(RAt,{className:"h-[600px]",children:[t.jsxs("div",{className:"flex pl-2 pr-2",children:[t.jsxs("div",{className:"sticky left-0 z-30 w-16 bg-background border-r border-border h-full",children:[t.jsx("div",{className:"sticky top-0 z-[200] bg-background h-12 border-b border-border"}),t.jsx("div",{className:"sticky top-12 z-[200] bg-background h-[3.1rem] flex items-center justify-end pr-4 text-sm text-muted-foreground border-b border-border",children:n.localization.allDay}),t.jsx(gTt,{onAddEvent:a,onDeleteEvent:s,event:{startDate:r,endDate:r,startTime:d||Vit(new Date,"HH:mm"),endTime:Vit(Rat(d?Zit(`2000-01-01T${d}`):new Date,1),"HH:mm"),color:null!=k&&k.length?null==(b=k[0])?void 0:b.accentClass:void 0},translations:n.localization,resources:g,children:t.jsx("div",{onMouseMove:e=>{const t=e.currentTarget.getBoundingClientRect(),r=e.clientY-t.top,n=r+96;let o,a,i;if(e.ctrlKey){const e=15*Math.round(r/64*60/15);o=Math.floor(e/60),a=e%60,i=e/60*64+96}else o=Math.floor(r/64),a=Math.floor(r%64/64*60),i=n;o=Math.max(0,Math.min(23,o)),a=Math.max(0,Math.min(59,a));const s=`${o.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}`;c.current&&(c.current.style.top=`${i}px`,c.current.style.display="block"),u.current&&(u.current.textContent=s)},onMouseLeave:()=>{c.current&&(c.current.style.display="none")},onClick:e=>{const t=e.currentTarget.getBoundingClientRect(),r=e.clientY-t.top,n=Math.floor(r/64),o=Math.floor(r%64/64*60),a=`${n.toString().padStart(2,"0")}:${o.toString().padStart(2,"0")}`;p(a)},children:C.map(({hour:e,label:r})=>t.jsx("div",{className:"h-16 flex items-center justify-end pr-4 text-sm text-muted-foreground cursor-pointer",children:t.jsx("span",{className:"mt-[-46px]",children:r})},e))})})]}),t.jsx("div",{className:"flex-1 relative",children:t.jsxs("div",{className:"grid pb-4",style:{gridTemplateColumns:`repeat(${k.length}, 1fr)`},children:[!(null!=(x=n.dayView)&&x.hideHoverLine)&&t.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{zIndex:150},children:t.jsx("div",{ref:c,className:"absolute left-0 right-0 h-px bg-primary",style:{display:"none"},children:t.jsx("span",{ref:u,className:"absolute left-0 transform -translate-x-full -translate-y-1/2 bg-primary text-primary-foreground text-xs px-1 rounded"})})}),Gat(r,new Date)&&!(null!=(w=n.dayView)&&w.hideTimeline)&&t.jsx("div",{ref:h,className:"absolute left-0 right-0 h-px bg-red-500 pointer-events-none",style:{top:`${f}px`,zIndex:30},children:t.jsx("span",{className:"absolute left-0 transform -translate-x-full -translate-y-1/2 bg-red-500 text-white text-xs px-1 rounded",children:Vit(new Date,"HH:mm")})}),k.map(e=>{const c=_.filter(t=>t.resourceId===e.id),{allDayEvents:u,regularEvents:d}=(e=>e.reduce((e,t)=>{const n=UDt(t.startTime,t.endTime),o=t.endDate&&!Gat(t.startDate,t.endDate);return n?o?Gat(t.startDate,r)?e.allDayEvents.push({...t,isStart:!0}):Gat(t.endDate,r)?e.allDayEvents.push({...t,isEnd:!0}):e.allDayEvents.push({...t,isMiddle:!0}):e.allDayEvents.push(t):e.regularEvents.push(t),e},{allDayEvents:[],regularEvents:[]}))(c),{events:p,totalColumns:h}=(e=>{const t=e.map(e=>{const t=UDt(e.startTime,e.endTime),n=t?0:WDt(e.startTime),o=t?1440:WDt(e.endTime),a=e.endDate&&!Gat(e.startDate,e.endDate),i=a&&Gat(e.startDate,r),s=a&&Gat(e.endDate,r);return{...e,isAllDay:t,startMinutes:n,endMinutes:o,column:0,width:1,isStart:i,isEnd:s,isMiddle:a&&!i&&!s}}).sort((e,t)=>e.isAllDay&&!t.isAllDay?-1:!e.isAllDay&&t.isAllDay?1:e.startMinutes-t.startMinutes),n=[];return t.forEach(e=>{let r=0;for(;;){if(!t.some(t=>t.column===r&&e!==t&&!(e.startMinutes>=t.endMinutes||e.endMinutes<=t.startMinutes))){e.column=r,n[r]=(n[r]||0)+1;break}r++}}),t.forEach(e=>{let r=1,o=e.column+1;for(;o<n.length&&!t.some(t=>t.column===o&&!(e.startMinutes>=t.endMinutes||e.endMinutes<=t.startMinutes));)r++,o++;e.width=r}),{events:t,totalColumns:Math.max(...n.map((e,t)=>t+1),1)}})(d),f=(e,t)=>{const r=UDt(e.startTime,e.endTime);if(e.isRepeating&&!r){const r=Bat(e.startDate),o=Bat(e.endDate||e.startDate);let a,i;switch(e.isRepeatingInterval||"daily"){case"weekly":a=Math.floor(Xat(o,r)/7)+1,i=Math.floor(Xat(t,r)/7)+1;break;case"monthly":a=12*(o.getFullYear()-r.getFullYear())+o.getMonth()-r.getMonth()+1,i=12*(t.getFullYear()-r.getFullYear())+t.getMonth()-r.getMonth()+1;break;default:a=Xat(o,r)+1,i=Xat(t,r)+1}return n.localization.repeatXofY.replace("{x}",i.toString()).replace("{y}",a.toString())}};return t.jsxs("div",{className:"relative border-r border-border flex-1",children:[t.jsx("div",{className:"sticky top-0 z-50 bg-background h-12 flex items-center justify-center border-b border-border",children:t.jsxs("div",{className:"flex items-center space-x-2",children:[e.accentClass&&t.jsx("div",{className:vdt("w-3 h-3 rounded-full flex-shrink-0 hidden sm:block text-center",e.accentClass)}),t.jsx("div",{className:"max-w-[150px] sm:max-w-[200px]",children:t.jsxs("span",{className:"relative font-medium text-sm sm:text-base group",children:[t.jsxs("span",{className:"block truncate",children:[e.name,c.length>0&&` (${c.length})`]}),e.accentClass&&t.jsx("span",{className:vdt("absolute bottom-0 left-0 w-full h-[2px] sm:hidden",e.accentClass)})]})})]})}),t.jsx("div",{className:"sticky top-12 z-50 bg-background min-h-[50px] border-b border-border",children:u.length<=1?u.map(e=>t.jsx("div",{className:"px-1 py-0.5",children:t.jsx(gTt,{event:e,onAddEvent:a,onUpdateEvent:i,onDeleteEvent:s,dateFromViewClick:r,translations:n.localization,resources:g,children:t.jsx(xDt.div,{className:vdt("rounded px-2 py-1 mb-0.5 last:mb-0 cursor-pointer","hover:bg-opacity-40 dark:hover:bg-opacity-40 transition-colors",M(e)),style:AAt(e.color),initial:{opacity:0,y:-10},animate:{opacity:1,y:0},children:t.jsxs("div",{className:"max-w-28 md:max-w-48",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("div",{className:"text-xs font-semibold truncate",children:e.title||n.localization.untitledEvent}),t.jsx("div",{className:"text-xs font-medium truncate",children:e.isStart?`${n.localization.starts}: ${zAt(e.startTime,o)}`:e.isEnd?`${n.localization.ends}: ${zAt(e.endTime,o)}`:null})]}),e.description&&t.jsx("div",{className:"text-xs truncate mt-0.5",children:e.description}),f(e,r)&&t.jsx("div",{className:"text-xs italic",children:f(e,r)})]})})},e.id)})):t.jsx("div",{className:"px-1 py-0.5",children:t.jsx(VAt,{events:u,date:r,addEvent:a,updateEvent:i,is24HourFormat:o,onDelete:s,translations:n.localization,preSelectedColor:"",children:t.jsxs(xDt.div,{className:vdt("rounded px-2 py-1 cursor-pointer group","hover:bg-opacity-40 dark:hover:bg-opacity-40 transition-colors","border border-dashed border-opacity-50"),initial:{opacity:0,y:-10},animate:{opacity:1,y:0},children:[t.jsx("div",{className:"flex items-center justify-between",children:t.jsxs("span",{className:"text-xs font-medium",children:[u.length," ",n.localization.allDay]})}),t.jsxs("div",{className:"text-xs mt-0.5 truncate max-w-24 sm:max-w-44",children:[u.slice(0,3).map(e=>e.title||n.localization.untitledEvent).join(", "),u.length>3&&`, +${u.length-3} more`]})]})})})}),t.jsxs("div",{className:"relative",onDoubleClick:t=>((e,t)=>{if(m||!n.dayView.enableDoubleClickToAddEvent)return;const o=e.currentTarget.getBoundingClientRect(),i=e.clientY-o.top,s=Math.floor(i/(16/15)),l=Math.floor(s/60),c=s%60,u=`${l.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}`,d=`${(l+1).toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}`;a({title:"",startDate:r,endDate:r,startTime:u,endTime:d,color:t,isRepeating:!1})})(t,e.id),children:[C.map(({hour:e})=>t.jsx("div",{className:"h-16 border-b border-border"},e)),l&&y&&Array.from({length:10}).map((e,r)=>t.jsx(LAt,{className:"absolute left-0 right-0 h-[3px] dark:h-[1px] animate-pulse bg-primary/20",style:{top:64*r+"px"}},r)),t.jsx("div",{className:"absolute inset-0",children:p.map((e,l)=>{const c=e.column*(100/h),u=e.width*(100/h);return t.jsx(gTt,{event:e,onAddEvent:a,onUpdateEvent:i,onDeleteEvent:s,onOpenChange:v,dateFromViewClick:r,translations:n.localization,children:t.jsxs(xDt.div,{className:vdt("absolute px-2 py-1 rounded overflow-hidden cursor-pointer","transition-colors duration-200","hover:bg-opacity-40","dark:hover:bg-opacity-40",S(e)),style:{...AAt(e.color),top:e.startMinutes*(16/15)+"px",height:`${Math.max((e.endMinutes-e.startMinutes)*(16/15),24)}px`,left:`${c}%`,width:`${u}%`,zIndex:l+1},initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.1*l},children:[t.jsx("div",{className:"text-xs font-semibold truncate",children:e.title||n.localization.untitledEvent}),t.jsx("div",{className:"text-xs",children:e.isStart?`${n.localization.starts}: ${zAt(e.startTime,o)}`:e.isEnd?`${n.localization.ends}: ${zAt(e.endTime,o)}`:`${zAt(e.startTime,o)} - ${zAt(e.endTime,o)}`}),e.description&&t.jsx("div",{className:"text-xs truncate mt-0.5",children:e.description}),(e.isRepeating||e.isStart||e.isEnd||e.isMiddle)&&t.jsx("div",{className:"text-xs italic",children:f(e,r)})]})},e.id)})})]})]},e.id)})]})})]}),t.jsx(FAt,{orientation:"horizontal"})]})})},qAt=({filteredEvents:e,currentDate:r,currentConfig:n,isLoading:o,is24HourFormat:a,clickedTime:i,currentTimeTop:s,hoverLineRef:l,hoverTimeRef:c,currentTimeLineRef:u,setClickedTime:d,onEventAdd:p,onEventUpdate:h,onEventDelete:f,onDateRangeChange:m,isAddEventPopupOpen:v,setIsAddEventPopupOpen:y,resources:g})=>{var b;const x={filteredEvents:e,currentDate:r,currentConfig:n,is24HourFormat:a,onEventAdd:p,onEventUpdate:h,onEventDelete:f,hoverLineRef:l,hoverTimeRef:c,clickedTime:i,setClickedTime:d,currentTimeLineRef:u,currentTimeTop:s,isLoading:o,isAddEventPopupOpen:v,setIsAddEventPopupOpen:y,onDateRangeChange:m,resources:g};return t.jsx(t.Fragment,{children:"resource"===(null==(b=n.dayView)?void 0:b.viewType)?t.jsx(HAt,{...x}):t.jsx(BAt,{...x})})},$At=({filteredEvents:e,currentView:r,currentDate:n,listSearchTerm:o,setListSearchTerm:a,currentConfig:i,onEventUpdate:s,onEventDelete:l,onEventAdd:c,is24HourFormat:u,isLoading:d,resources:p})=>{let h,f;switch(r){case"day":default:h=Bat(n),f=Qat(n);break;case"week":h=Iat(n),f=oit(n);break;case"month":h=tit(n),f=Jat(n);break;case"year":h=nit(n),f=rit(n)}const m=e.filter(e=>{if(e.isRepeating){const t=()=>eit({start:h,end:f}).some(t=>(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>Gat(e,t)))&&VDt(t,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily"));return"day"===r?(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>Gat(e,n)))&&VDt(n,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily"):t()}if("day"===r){const t=Bat(e.startDate),r=Qat(e.endDate||e.startDate);return Yit(n,{start:t,end:r})}return Yit(e.startDate,{start:h,end:f})||e.endDate&&Yit(e.endDate,{start:h,end:f})}).filter(e=>e.title.toLowerCase().includes(o.toLowerCase())||e.description&&e.description.toLowerCase().includes(o.toLowerCase())).sort((e,t)=>function(e,t){const r=Dat(e),n=Dat(t),o=r.getTime()-n.getTime();return o<0?-1:o>0?1:o}(e.startDate,t.startDate));return t.jsxs(WIt,{className:"p-4",children:[t.jsx(xDt.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.3},className:"mb-4",children:t.jsxs("div",{className:"relative",children:[t.jsx(Tbt,{initial:!1,mode:"wait",children:o?t.jsx(xDt.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.2},className:"absolute left-2.5 top-[0.6rem] transform -translate-y-1/2 flex items-center justify-center",children:t.jsx(Edt,{variant:"ghost",size:"icon",className:"h-5 w-5 p-0",onClick:()=>a(""),children:t.jsx(Wst,{className:"h-4 w-4 text-muted-foreground"})})},"clearButton"):t.jsx(xDt.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.2},className:"absolute left-2.5 top-[0.75rem] transform -translate-y-1/2 flex items-center justify-center",children:t.jsx(qst,{className:"h-4 w-4 text-muted-foreground"})},"searchIcon")}),t.jsx(Mmt,{type:"text",placeholder:i.localization.searchEvents,value:o,onChange:e=>a(e.target.value),className:"pl-10 pr-4 py-2 w-full"})]})}),t.jsxs(RAt,{className:"h-[600px]",children:[t.jsx(Tbt,{initial:!0,children:m.map(e=>{const{dateInfo:r,isMultiDay:o,isOutOfRange:a,isRepeating:d}=(e=>{const t=Bat(e.startDate),r=Qat(e.endDate||e.startDate),n=!Gat(t,r),o=t<h||r>f,a=e.isRepeating;let s="";if(a&&(e.isRepeatingInterval,1)){const t=`${zAt(e.startTime,u)} - ${zAt(e.endTime,u)}`,r=Vit(e.startDate,"MMM d"),n=Vit(e.endDate||e.startDate,"MMM d, yyyy"),o=Vit(e.startDate,"EEEE"),a=Vit(e.startDate,"do");switch(e.isRepeatingInterval||"daily"){case"daily":s=i.localization.repeatDailyDescription.replace("{timeRange}",t).replace("{startDate}",r).replace("{endDate}",n);break;case"weekly":s=i.localization.repeatWeeklyDescription.replace("{dayName}",o).replace("{timeRange}",t).replace("{startDate}",r).replace("{endDate}",n);break;case"monthly":s=i.localization.repeatMonthlyDescription.replace("{dayOfMonth}",a).replace("{timeRange}",t).replace("{startDate}",r).replace("{endDate}",n)}}else s=`${Vit(t,"MMM d")}`,n&&(s+=` - ${Vit(r,"MMM d")}`);return{dateInfo:s,isMultiDay:n,isOutOfRange:o,isRepeating:a}})(e);return t.jsx(xDt.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,height:0},transition:{duration:.3},children:t.jsx(gTt,{event:e,onAddEvent:c,onUpdateEvent:s,onDeleteEvent:l,dateFromViewClick:n,translations:i.localization,resources:p,children:t.jsxs("div",{className:vdt("p-2 rounded-lg cursor-pointer mb-2","hover:opacity-80 transition-opacity",e.isRepeating&&"border border-dashed border-opacity-50"),style:AAt(e.color),children:[t.jsxs("div",{className:"flex justify-between items-center text-sm",children:[t.jsx("span",{className:"font-semibold",children:r}),t.jsxs("div",{className:"flex items-center space-x-2",children:[d&&t.jsx(CFt,{children:t.jsxs(MFt,{children:[t.jsx(SFt,{children:t.jsx(Hst,{className:"h-4 w-4"})}),t.jsx(DFt,{children:t.jsx("p",{children:i.localization.repeatingEvent})})]})}),o&&!d&&t.jsx(CFt,{children:t.jsxs(MFt,{children:[t.jsx(SFt,{children:t.jsx(Mst,{className:"h-4 w-4"})}),t.jsx(DFt,{children:t.jsx("p",{children:i.localization.multiDayEvent})})]})}),a&&t.jsx(CFt,{children:t.jsxs(MFt,{children:[t.jsx(SFt,{children:t.jsx(xst,{className:"h-4 w-4"})}),t.jsx(DFt,{children:t.jsx("p",{children:i.localization.extendsOutOfRange})})]})}),t.jsxs("span",{children:[zAt(e.startTime,u)," - ",zAt(e.endTime,u)]})]})]}),t.jsx("h3",{className:"text-lg font-bold mt-2",children:e.title||"Untitled Event"}),e.description&&t.jsx("p",{className:"mt-1 text-sm",children:e.description})]})})},e.id)})}),!d&&0===m.length&&t.jsx(xDt.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center text-muted-foreground py-8",children:o?i.localization.noEvents:`${i.localization.noEvents} ${i.localization[r]}`})]})]})},WAt=({filteredEvents:e,currentDate:r,currentConfig:n,is24HourFormat:o,setIsAddEventPopupOpen:a,isAddEventPopupOpen:i,setCurrentDate:s,setCurrentView:l,onEventUpdate:c,onEventDelete:u,onEventAdd:d,isLoading:p,onDateRangeChange:h,resources:f})=>{var m;const v=tit(r),y=Jat(r),g=null==(m=n.monthView)?void 0:m.showOnlyCurrentMonth,b=qit(v),x=new Date,w=n.localization.dayNames;let k,_;if(g)k=eit({start:v,end:y}),_=[...w.slice(b),...w.slice(0,b)];else{const e=o?1:0;k=eit({start:Iat(v,{weekStartsOn:e}),end:oit(y,{weekStartsOn:e})}),_=o?[...w.slice(1),w[0]]:w}return t.jsx(WIt,{className:"p-2 sm:p-4",children:t.jsx(RAt,{children:t.jsxs("div",{className:"grid grid-cols-7 gap-1 sm:gap-2",children:[_.map(e=>t.jsx("div",{className:"text-center font-medium text-xs sm:text-sm",children:e},e)),k.map(m=>{const v=Git(m,r);if(g&&!v)return t.jsx("div",{},m.toString());const y=e.filter(e=>e.isRepeating?(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>Gat(e,m)))&&VDt(m,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily"):Gat(e.startDate,m)||e.endDate&&Yit(m,{start:e.startDate,end:e.endDate})),b=((e,t)=>e.reduce((e,r)=>{const n=UDt(r.startTime,r.endTime),o=r.endDate&&!Gat(r.startDate,r.endDate);if(r.isRepeating){if(r.isRepeatingExcludedDates&&r.isRepeatingExcludedDates.some(e=>Gat(e,t)))return e;if(VDt(t,r.startDate,r.endDate||r.startDate,r.isRepeatingInterval||"daily")){let o;o="weekly"===r.isRepeatingInterval||"monthly"===r.isRepeatingInterval||Gat(r.startDate,t)?"start":r.endDate&&Gat(r.endDate,t)?"end":"middle",n?e.repeatingFullDayEvents.push({...r,position:o}):e.regularEvents.push({...r,position:o})}}else if(o){let n;Gat(r.startDate,t)?n="start":Gat(r.endDate,t)?n="end":Yit(t,{start:r.startDate,end:r.endDate})&&(n="middle"),n&&e.multiDayEvents.push({...r,position:n})}else n?e.fullDayEvents.push(r):e.regularEvents.push(r);return e},{repeatingFullDayEvents:[],multiDayEvents:[],fullDayEvents:[],regularEvents:[]}))(y,m),w=[...b.repeatingFullDayEvents,...b.multiDayEvents,...b.fullDayEvents],k=b.regularEvents,_=Gat(m,x);let C=[],M=0;return w.length>0?(C.push(w[0]),M=w.length-1+k.length):k.length>0&&(C.push(k[0]),M=k.length-1),M>0?C=C.slice(0,1):k.length>1&&C.length<2&&C.push(k[1]),t.jsxs("div",{className:vdt("p-1 sm:p-2 h-[80px] sm:h-[130px] border rounded relative group flex flex-col",!v&&!g&&"bg-muted/50"),onDoubleClick:()=>(e=>{i||n.monthView.enableDoubleClickToShiftViewToWeekly&&(s(e),l("week"))})(m),children:[t.jsx("div",{className:vdt("font-semibold mb-1 w-5 h-5 sm:w-6 sm:h-6 flex items-center justify-center text-xs sm:text-sm",_&&"bg-primary text-primary-foreground rounded-full"),children:Vit(m,"d")}),t.jsxs("div",{className:"flex-grow overflow-hidden",children:[p&&h&&t.jsx(LAt,{className:"absolute top-0 left-0 right-0 h-[2px] dark:h-[1px] animate-pulse bg-primary/20"}),C.map((e,r)=>((e,r,i)=>{const s="position"in e,l=s&&"start"===e.position,p=s&&"end"===e.position,h=s&&"middle"===e.position;return t.jsx(xDt.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{duration:.2,delay:.05*r},children:t.jsx(gTt,{event:e,onAddEvent:d,onUpdateEvent:c,onDeleteEvent:u,dateFromViewClick:i,onOpenChange:a,translations:n.localization,resources:f,children:t.jsxs("div",{className:vdt("p-1 text-[8px] h-10 sm:text-xs rounded mb-1 cursor-pointer","transition-colors duration-200","hover:bg-opacity-40","dark:hover:bg-opacity-40",(()=>{if(!e.isRepeating)return vdt(l&&"border-l-4 border-l-black/70 dark:border-l-white/50",p&&"border-r-4 border-r-black/70 dark:border-r-white/50",h&&"border-x-0");switch(e.isRepeatingInterval){case"daily":return vdt("border border-dashed border-opacity-50",l&&"border-l-solid border-l-2 border-l-black/70 dark:border-l-white/50",p&&"border-r-solid border-r-2 border-r-black/70 dark:border-r-white/50",h&&"border-x-0");case"weekly":case"monthly":return"border border-dotted border-opacity-50";default:return""}})()),style:AAt(e.color),children:[t.jsx("div",{className:"font-semibold truncate",children:e.title||"Untitled Event"}),!s&&t.jsxs("div",{className:"hidden sm:block truncate",children:[zAt(e.startTime,o)," - ",zAt(e.endTime,o)]}),s&&!e.isRepeating&&t.jsx("div",{className:"hidden sm:block truncate",children:e.description&&t.jsx("div",{className:"truncate",children:e.description})}),e.isRepeating&&t.jsxs("div",{className:"hidden sm:block truncate",children:[zAt(e.startTime,o)," - ",zAt(e.endTime,o)]})]})})},`${e.id}-${r}`)})(e,r,m)),0===y.length&&t.jsx(gTt,{translations:n.localization,onOpenChange:a,onAddEvent:d,event:{startDate:m,endDate:m},onDeleteEvent:u,resources:f,children:t.jsx(Edt,{variant:"ghost",size:"sm",className:"w-full h-1/2 text-[8px] sm:text-xs text-muted-foreground hover:text-foreground transition-opacity truncate px-0.5 sm:px-2 sm:opacity-0 sm:group-hover:opacity-100",children:t.jsx("span",{className:"hidden sm:inline ml-1",children:n.localization.addEvent})})})]}),M>0&&t.jsx(VAt,{translations:n.localization,events:y,date:m,addEvent:d,updateEvent:c,onDelete:u,is24HourFormat:o,onOpenChange:a,children:t.jsx(xDt.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{duration:.2},children:t.jsxs(Edt,{variant:"ghost",size:"sm",className:"w-full gap-1 text-[8px] sm:text-xs text-muted-foreground hover:text-foreground mt-auto sm:mt-1 truncate px-0.5 sm:px-2 h-5 sm:h-8",children:[t.jsxs("span",{children:["+",M]}),t.jsxs("span",{className:"hidden sm:inline",children:[" ",n.localization.more]})]})})}),1===y.length&&t.jsx(gTt,{translations:n.localization,onOpenChange:a,onAddEvent:d,event:{startDate:m},onDeleteEvent:u,resources:f,children:t.jsxs(Edt,{variant:"ghost",size:"sm",className:"w-full gap-1 text-[8px] sm:text-xs text-muted-foreground hover:text-foreground mt-auto sm:mt-1 sm:opacity-0 sm:group-hover:opacity-100 transition-opacity truncate px-0.5 sm:px-2 ",children:[t.jsx("span",{className:"font-bold",children:"+"}),t.jsx("span",{className:"hidden sm:inline",children:n.localization.addEvent})]})})]},m.toString())})]})})})},UAt=({filteredEvents:e,onEventUpdate:r,onEventDelete:n,onEventAdd:o,isLoading:a,currentDate:i,currentConfig:s,is24HourFormat:l,isAddEventPopupOpen:c,setCurrentDate:u,setCurrentView:d,setIsAddEventPopupOpen:p,onDateRangeChange:h,resources:f})=>{var m;const v=tit(i),y=Jat(i),g=null==(m=s.monthView)?void 0:m.showOnlyCurrentMonth,b=qit(v),x=new Date,w=s.localization.dayNames;let k,_;if(g)k=eit({start:v,end:y}),_=[...w.slice(b),...w.slice(0,b)];else{const e=l?1:0,t=Iat(v,{weekStartsOn:e}),r=oit(y,{weekStartsOn:e});k=eit({start:t,end:r}),_=l?[...w.slice(1),w[0]]:w}const C=Math.ceil(k.length/7);return t.jsx(WIt,{className:"p-2 sm:p-4",children:t.jsx(RAt,{children:t.jsxs("div",{className:"w-full",children:[t.jsx("div",{className:"grid grid-cols-7 border-b",children:_.map(e=>t.jsx("div",{className:"text-center font-medium text-xs sm:text-sm p-2",children:e},e))}),Array.from({length:C}).map((m,v)=>{const y=k.slice(7*v,7*(v+1));return t.jsx("div",{className:"grid grid-cols-7",children:y.map((m,v)=>{const y=Gat(m,x),b=Git(m,i),w=(t=>e.filter(e=>{if(e.isRepeating)return(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>Gat(e,t)))&&VDt(t,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily");const r=Bat(e.startDate),n=Qat(e.endDate||e.startDate);return Yit(t,{start:r,end:n})}).sort((e,t)=>new Date(e.startDate).getTime()+6e4*WDt(e.startTime)-(new Date(t.startDate).getTime()+6e4*WDt(t.startTime))))(m);return g&&!b?t.jsx("div",{},m.toString()):t.jsxs("div",{className:vdt("group min-h-[145px] border-b border-r p-1 relative","transition-colors duration-200",!b&&"bg-muted/50",0===v&&"border-l"),onDoubleClick:()=>(e=>{c||s.monthView.enableDoubleClickToShiftViewToWeekly&&(u(e),d("week"))})(m),children:[a&&h&&t.jsx(LAt,{className:"absolute top-0 left-0 right-0 h-[2px] dark:h-[1px] animate-pulse bg-primary/20"}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("div",{className:vdt("font-semibold w-6 h-6 flex items-center justify-center text-xs sm:text-sm rounded-full",y&&"bg-primary text-primary-foreground"),children:Vit(m,"d")}),t.jsx(gTt,{translations:s.localization,onOpenChange:p,onAddEvent:o,event:{startDate:m,endDate:m},dateFromViewClick:m,onDeleteEvent:n,resources:f,children:t.jsx(Edt,{variant:"ghost",size:"sm",className:"h-6 text-xs text-muted-foreground px-2 sm:opacity-0 sm:group-hover:opacity-100 transition-opacity",children:t.jsx("span",{className:"ml-1 hidden sm:inline",children:s.localization.addEvent})})})]}),t.jsxs("div",{className:"space-y-1 mt-1 overflow-y-auto",children:[w.slice(0,w.length>4?3:4).map((e,a)=>{const i=((e,t)=>{if(e.isRepeating){if("weekly"===e.isRepeatingInterval||"monthly"===e.isRepeatingInterval)return"single";const r=Gat(e.startDate,t),n=e.endDate&&Gat(e.endDate,t);return r&&n?"single":r?"start":n?"end":"middle"}const r=Gat(e.startDate,t),n=e.endDate&&Gat(e.endDate,t);return e.endDate?r&&n?"single":r?"start":n?"end":"middle":"single"})(e,m),c=((e,t)=>{if(!e.isRepeating)return vdt("start"===t&&"border-l-4 border-l-black/70 dark:border-l-white/50","end"===t&&"border-r-4 border-r-black/70 dark:border-r-white/50","middle"===t&&"border-x-0");switch(e.isRepeatingInterval||"daily"){case"daily":return vdt("border border-dashed border-opacity-50","start"===t&&"border-l-solid border-l-2 border-l-black/70 dark:border-l-white/50","end"===t&&"border-r-solid border-r-2 border-r-black/70 dark:border-r-white/50","middle"===t&&"border-x-0");case"weekly":case"monthly":return"border border-dotted border-opacity-50";default:return""}})(e,i),u=e.isRepeating||"single"===i||"start"===i&&!e.isRepeating||"end"===i&&!e.isRepeating;return t.jsx(xDt.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{duration:.2,delay:.05*a},children:t.jsx(gTt,{translations:s.localization,onAddEvent:o,onUpdateEvent:r,event:e,dateFromViewClick:m,onDeleteEvent:n,onOpenChange:p,resources:f,children:t.jsxs("div",{className:vdt("text-xs p-1 min-h-[24px] rounded cursor-pointer","hover:opacity-80 transition-opacity","flex items-center justify-between gap-1",c),style:AAt(e.color),children:[t.jsx("span",{className:"block overflow-hidden text-ellipsis whitespace-nowrap flex-1",children:e.title}),u&&t.jsx("span",{className:"text-[10px] opacity-75 whitespace-nowrap",children:e.isRepeating||"end"!==i?zAt(e.startTime,l):`ends ${zAt(e.endTime,l)}`})]})})},`${e.id}-${a}`)}),w.length>4&&t.jsx(VAt,{translations:s.localization,events:w,date:m,addEvent:o,updateEvent:r,onDelete:n,is24HourFormat:l,resources:f,onOpenChange:p,children:t.jsx(xDt.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{duration:.2},children:t.jsxs(Edt,{variant:"ghost",size:"sm",className:"w-full h-6 text-xs text-muted-foreground hover:text-foreground truncate px-2",children:["+",w.length-3," ",s.localization.more]})})})]})]},m.toString())})},v)})]})})})},GAt=({filteredEvents:e,currentDate:r,currentConfig:n,is24HourFormat:o,setIsAddEventPopupOpen:a,isAddEventPopupOpen:i,setCurrentDate:s,setCurrentView:l,onEventUpdate:c,onEventDelete:u,onEventAdd:d,isLoading:p,onDateRangeChange:h,resources:f})=>{var m;return t.jsx(t.Fragment,{children:"detailed"===(null==(m=n.monthView)?void 0:m.viewType)?t.jsx(UAt,{filteredEvents:e,currentDate:r,is24HourFormat:o,isAddEventPopupOpen:i,currentConfig:n,setCurrentDate:s,setCurrentView:l,onEventAdd:d,onEventUpdate:c,onEventDelete:u,setIsAddEventPopupOpen:a,isLoading:p,onDateRangeChange:h,resources:f}):t.jsx(WAt,{filteredEvents:e,currentDate:r,is24HourFormat:o,isAddEventPopupOpen:i,currentConfig:n,setCurrentDate:s,setCurrentView:l,onEventAdd:d,onEventUpdate:c,onEventDelete:u,setIsAddEventPopupOpen:a,isLoading:p,onDateRangeChange:h,resources:f})})},KAt=({filteredEvents:e,currentDate:r,is24HourFormat:n,hoverLineRef:o,hoverTimeRef:a,setClickedTime:i,clickedTime:s,isAddEventPopupOpen:l,currentConfig:c,setCurrentDate:u,setCurrentView:d,onEventUpdate:p,onEventDelete:h,onEventAdd:f,setIsAddEventPopupOpen:m,isLoading:v,currentTimeLineRef:y,currentTimeTop:g,onDateRangeChange:b,resources:x})=>{var w,k;const _=Iat(r,{weekStartsOn:n?1:0}),C=oit(r,{weekStartsOn:n?1:0}),M=eit({start:_,end:C}),S=Array.from({length:24},(e,t)=>t),D=yit(_,{weekStartsOn:n?1:0}),O=(e,t)=>{if(e.isRepeating)return(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>Gat(e,t)))&&VDt(t,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily");const r=Bat(e.startDate),n=Qat(e.endDate||e.startDate);return Yit(t,{start:r,end:n})},P=e.filter(e=>e.isRepeating?M.some(t=>VDt(t,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily")):Yit(e.startDate,{start:_,end:C})||e.endDate&&Yit(e.endDate,{start:_,end:C})),E=(e=>e.reduce((e,t)=>{const r=UDt(t.startTime,t.endTime),n=t.endDate&&!Gat(t.startDate,t.endDate);return t.isRepeating?r?e.repeatingFullDayEvents.push(t):e.regularEvents.push(t):n?e.multiDayEvents.push(t):r?e.fullDayEvents.push(t):e.regularEvents.push(t),e},{repeatingFullDayEvents:[],multiDayEvents:[],fullDayEvents:[],regularEvents:[]}))(P),j=[...E.repeatingFullDayEvents,...E.multiDayEvents,...E.fullDayEvents],T=({event:e,day:r})=>{var n,o,a;const i=e.endDate&&!Gat(e.startDate,e.endDate),s=Gat(e.startDate,r),l=e.endDate&&Gat(e.endDate,r),u=i&&!s&&!l;return t.jsx(gTt,{event:e,onAddEvent:f,onUpdateEvent:p,onDeleteEvent:h,dateFromViewClick:r,translations:c.localization,resources:x,children:t.jsxs("div",{className:vdt("px-2 py-1 rounded cursor-pointer","transition-colors duration-200","hover:bg-opacity-40 dark:hover:bg-opacity-40","min-h-[24px] text-xs",(()=>{if(!e.isRepeating)return vdt(s&&"border-l-4 border-l-black/70 dark:border-l-white/50",l&&"border-r-4 border-r-black/70 dark:border-r-white/50",u&&"border-x-0");switch(e.isRepeatingInterval||"daily"){case"daily":return vdt("border border-dashed border-opacity-50",s&&"border-l-solid border-l-2 border-l-black/70 dark:border-l-white/50",l&&"border-r-solid border-r-2 border-r-black/70 dark:border-r-white/50",u&&"border-x-0");case"weekly":case"monthly":return"border border-dotted border-opacity-50";default:return""}})()),style:AAt(e.color),children:[t.jsx("div",{className:"font-semibold truncate",children:e.title||"Untitled Event"}),e.description&&t.jsx("div",{className:"truncate",children:e.description}),e.isRepeating&&t.jsx("div",{className:"text-[10px] opacity-75",children:"daily"===e.isRepeatingInterval?null==(n=c.localization)?void 0:n.repeatDaily:"weekly"===e.isRepeatingInterval?null==(o=c.localization)?void 0:o.repeatWeekly:null==(a=c.localization)?void 0:a.repeatMonthly})]})},e.id)};return t.jsxs(WIt,{className:"p-4",children:[j.length>0&&t.jsxs("div",{className:"mb-4 relative z-20",children:[t.jsx("div",{className:"grid grid-cols-8 gap-0",children:M.map(e=>t.jsx("div",{className:"text-center text-xs font-semibold"},e.toString()))}),t.jsxs("div",{className:"grid grid-cols-8 gap-0 relative",children:[t.jsx("div",{className:"absolute left-0 top-0 bottom-2 w-[12.5%] flex items-center justify-center z-10",children:t.jsxs("div",{className:"text-xs truncate font-semibold whitespace-nowrap",children:[c.localization.fullDayEvents," (",j.length,")"]})}),j.map((e,r)=>t.jsxs(xDt.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{delay:.05*r},className:"col-span-8 grid grid-cols-8 gap-0 mb-1",children:[t.jsx("div",{className:"w-[12.5%]"}),M.map(r=>t.jsx("div",{className:"min-h-[24px] px-1",children:Yit(r,{start:e.startDate,end:e.endDate||e.startDate})&&t.jsx(T,{event:e,day:r})},`${e.id}-${r.toString()}`))]},e.id))]})]}),t.jsx(RAt,{className:"h-[600px]",children:t.jsxs("div",{className:"relative mb-2",children:[t.jsxs("div",{className:"grid grid-cols-8 gap-0",children:[t.jsx(gTt,{event:{startDate:_,endDate:C,startTime:s||Vit(new Date,"HH:mm"),endTime:Vit(Rat(s?Zit(`2000-01-01T${s}`):new Date,1),"HH:mm"),isRepeating:!0},onAddEvent:f,dateFromViewClick:_,translations:c.localization,children:t.jsxs("div",{className:"sticky top-0 left-0 z-30 bg-background",onMouseMove:e=>{const t=e.currentTarget.getBoundingClientRect(),r=e.clientY-t.top-48,n=Math.max(0,r);let i,s,l;if(e.ctrlKey){const e=15*Math.round(n/64*60/15);i=Math.floor(e/60),s=e%60,l=e/60*64}else i=Math.floor(n/64),s=Math.floor(n%64/64*60),l=n;const c=`${i.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}`;o.current&&(o.current.style.top=`${l+48}px`,o.current.style.display="block"),a.current&&(a.current.textContent=c)},onMouseLeave:()=>{o.current&&(o.current.style.display="none")},onClick:e=>{const t=e.currentTarget.getBoundingClientRect(),r=e.clientY-t.top-48,n=Math.max(0,r),o=Math.floor(n/64),a=Math.floor(n%64/64*60),s=`${o.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}`;i(s)},children:[t.jsx("div",{className:"sticky top-0 left-0 bg-background h-12 border-b border-r border-border flex items-center justify-center",children:t.jsxs("span",{className:"text-xs font-semibold text-muted-foreground bg-background",children:["Week ",D]})}),S.map(e=>t.jsx("div",{className:"cursor-pointer h-16 pr-2 text-center text-sm text-muted-foreground border-r border-border",children:IAt(r,e,n)},e))]})}),t.jsx("div",{className:"col-span-7 relative z-20",children:t.jsxs("div",{className:"grid grid-cols-7 gap-0",children:[M.map((e,r)=>{const o=E.regularEvents.filter(t=>O(t,e)),{sortedEvents:a,eventPositions:i,maxColumn:s}=((e,t)=>{const r=e.filter(e=>O(e,t)).sort((e,r)=>{const n=$Dt(t,e.startTime),o=$Dt(t,r.startTime);return n.getTime()-o.getTime()}),n={};let o=0;const a=(e,r)=>{const n=$Dt(t,e.startTime),o=$Dt(t,e.endTime),a=$Dt(t,r.startTime);return n<$Dt(t,r.endTime)&&a<o};return r.forEach((e,t)=>{let i=0,s=!1;for(let o=0;o<t;o++)a(e,r[o])&&(i=Math.max(i,n[r[o].id].column+1),s=!0);n[e.id]={column:i,span:1},s&&(o=Math.max(o,i))}),0===o?(r.forEach(e=>{n[e.id]={column:0,span:1}}),{sortedEvents:r,eventPositions:n,maxColumn:1}):(r.forEach(e=>{if(n[e.id].column<o){let t=1;for(;t+n[e.id].column<=o&&!r.some(r=>n[r.id].column===n[e.id].column+t&&a(e,r));)t++;n[e.id].span=t}}),{sortedEvents:r,eventPositions:n,maxColumn:o+1})})(o,e);return t.jsxs("div",{className:"relative",onDoubleClick:()=>(e=>{l||c.weekView.enableDoubleClickToShiftViewToDaily&&(u(e),d("day"))})(e),children:[t.jsx("div",{className:"sticky top-0 z-30 bg-background h-12 flex items-center justify-center border-b border-border",children:t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"text-xs font-semibold",children:c.localization.dayNames[e.getDay()].slice(0,3)}),t.jsx("div",{className:"text-sm "+(Gat(e,new Date)?"bg-primary text-primary-foreground rounded-full w-6 h-6 flex items-center justify-center mx-auto":""),children:Vit(e,"d")})]})}),t.jsxs("div",{className:"relative h-[calc(100%-3rem)]",children:[S.map((e,r)=>t.jsx("div",{className:vdt("h-16",0!==r&&"border-t border-border",r===S.length-1&&"border-b border-border")},e)),a.map((r,o)=>{const{top:a,height:l}=((e,t)=>{const r=$Dt(e.startDate,e.startTime),n=$Dt(e.endDate||e.startDate,e.endTime),o=Bat(t),a=Qat(t);let i,s;e.isRepeating?(i=lst(sst(t,r.getHours()),r.getMinutes()),s=lst(sst(t,n.getHours()),n.getMinutes())):(i=Wat([r,o]),s=Uat([n,a]));const l=i.getHours()+i.getMinutes()/60;return{top:64*l,height:64*(s.getHours()+s.getMinutes()/60-l)}})(r,e),{column:u,span:d}=i[r.id],v=d/s*100,y=u/s*100,g=((e,t)=>{var r,n,o,a,i,s;if(!e.isRepeating){if(e.endDate&&!Gat(e.startDate,e.endDate)){const r=Math.floor(Xat(Qat(e.endDate),Bat(e.startDate)))+1;return`Day ${Math.floor(Xat(Bat(t),Bat(e.startDate)))+1} of ${r}`}return null}switch(e.isRepeatingInterval||"daily"){case"daily":{const a=Math.floor(Xat($Dt(e.endDate||e.startDate,e.endTime),$Dt(e.startDate,e.startTime)))+1,i=eit({start:Bat(e.startDate),end:Bat(e.endDate||e.startDate)}),s=a-((null==(r=e.isRepeatingExcludedDates)?void 0:r.filter(e=>i.some(t=>Gat(t,e))).length)||0),l=eit({start:Bat(e.startDate),end:Bat(t)}),u=(null==(n=e.isRepeatingExcludedDates)?void 0:n.filter(e=>l.some(t=>Gat(t,e))).length)||0,d=Math.floor(Xat(Bat(t),Bat(e.startDate)))+1-u;return`${null==(o=c.localization)?void 0:o.repeatDaily} ${d} of ${s}`}case"weekly":{const e=qit(t),r=null==(a=c.localization)?void 0:a.dayNames[e];return`${null==(i=c.localization)?void 0:i.repeatWeekly} ${r}`}case"monthly":return`${null==(s=c.localization)?void 0:s.repeatMonthly} ${Vit(t,"do")}`;default:return null}})(r,e),b=Gat(r.startDate,e),w=r.endDate&&Gat(r.endDate,e);return t.jsx(gTt,{event:r,onAddEvent:f,onUpdateEvent:p,onDeleteEvent:h,onOpenChange:m,dateFromViewClick:e,translations:c.localization,resources:x,children:t.jsxs(xDt.div,{className:vdt("absolute px-1 py-1 rounded overflow-hidden cursor-pointer","transition-colors duration-200","hover:bg-opacity-40 dark:hover:bg-opacity-40",r.isRepeating&&"border border-dashed border-opacity-50",b&&"border-l-1 border-l-black/70 dark:border-l-white/30",w&&"border-r-1 border-r-black/70 dark:border-r-white/30"),style:{...AAt(r.color),top:`${a}px`,height:`${Math.max(l,24)}px`,left:`${y}%`,width:`${v}%`,zIndex:o+1},initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.1*o},children:[t.jsx("div",{className:"text-xs font-semibold truncate",children:r.title||"Untitled Event"}),t.jsxs("div",{className:"text-xs",children:[zAt(r.startTime,n)," - ",zAt(r.endTime,n)]}),g&&t.jsx("div",{className:"text-xs italic",children:g})]})},`${r.id}-${e.toISOString()}`)}),v&&b&&Array.from({length:10}).map((e,r)=>t.jsx(LAt,{className:"absolute top-0 left-0 right-0 h-[3px] dark:h-[1px] animate-pulse bg-primary/20",style:{top:64*r+"px"}},r))]}),r<M.length-1&&t.jsx("div",{className:"absolute top-12 right-0 w-px h-[calc(100%-3rem)] bg-border"})]},e.toString())}),t.jsx("div",{className:"absolute top-0 right-0 w-px h-full bg-border"})]})})]}),!(null!=(w=c.weekView)&&w.hideHoverLine)&&t.jsx("div",{ref:o,className:"absolute left-[12.5%] right-0 h-px bg-primary z-50 pointer-events-none",style:{display:"none"},children:t.jsx("span",{ref:a,className:"absolute left-0 transform -translate-x-full -translate-y-1/2 bg-primary text-primary-foreground text-xs px-1 rounded"})}),M.some(e=>Gat(e,new Date))&&!(null!=(k=c.weekView)&&k.hideTimeline)&&t.jsxs("div",{ref:y,className:"absolute left-[12.5%] right-0 h-px bg-red-500 z-40 pointer-events-none",style:{top:`${g+48}px`},children:[t.jsx("span",{className:"absolute left-0 transform -translate-x-full -translate-y-1/2 bg-red-500 text-white text-xs px-1 rounded",children:Vit(new Date,"HH:mm")}),M.map((e,r)=>Gat(e,new Date)&&t.jsx("div",{className:"absolute h-4 w-[1px] bg-red-500 transform -translate-y-1/2 opacity-75",style:{left:100/7*r+"%",boxShadow:"0 0 4px rgba(239, 68, 68, 0.5)"}},e.toString()))]})]})})]})},YAt=({filteredEvents:e,currentDate:r,currentConfig:n,is24HourFormat:o,onEventAdd:a,onEventUpdate:i,onEventDelete:s,isLoading:l,setCurrentDate:c,setCurrentView:u,isAddEventPopupOpen:d,setIsAddEventPopupOpen:p,onDateRangeChange:h,resources:f})=>{var m;const v=Iat(r,{weekStartsOn:o?1:0}),y=eit({start:v,end:oit(r,{weekStartsOn:o?1:0})}),g=yit(v,{weekStartsOn:o?1:0}),b=f??[],x=(e,t)=>e.isRepeating?(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>Gat(e,t)))&&VDt(t,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily"):e.endDate?Yit(t,{start:Bat(e.startDate),end:Qat(e.endDate)}):Gat(e.startDate,t),w=e=>{d||n.weekView.enableDoubleClickToShiftViewToDaily&&(c(e),u("day"))},k=(null==(m=n.weekView)?void 0:m.resourceDisplayMode)||"row",_=(e,r,l)=>{const c=((e,t)=>{if(e.isRepeating){if("weekly"===e.isRepeatingInterval||"monthly"===e.isRepeatingInterval)return"single";const r=Gat(e.startDate,t),n=e.endDate&&Gat(e.endDate,t);return r&&n?"single":r?"start":n?"end":"middle"}const r=Gat(e.startDate,t),n=e.endDate&&Gat(e.endDate,t);return e.endDate?r&&n?"single":r?"start":n?"end":"middle":"single"})(e,r),u=((e,t)=>{if(!e.isRepeating)return vdt("start"===t&&"border-l-4 border-l-black/70 dark:border-l-white/50","end"===t&&"border-r-4 border-r-black/70 dark:border-r-white/50","middle"===t&&"border-x-0");switch(e.isRepeatingInterval||"daily"){case"daily":return vdt("border border-dashed border-opacity-50","start"===t&&"border-l-solid border-l-2 border-l-black/70 dark:border-l-white/50","end"===t&&"border-r-solid border-r-2 border-r-black/70 dark:border-r-white/50","middle"===t&&"border-x-0");case"weekly":case"monthly":return"border border-dotted border-opacity-50";default:return""}})(e,c),d=UDt(e.startTime,e.endTime),h=e.isRepeating||"single"===c||!d&&"start"===c&&!e.isRepeating||!d&&"end"===c&&!e.isRepeating;return t.jsx(gTt,{event:e,onAddEvent:a,onUpdateEvent:i,onDeleteEvent:s,onOpenChange:p,dateFromViewClick:r,translations:n.localization,resources:f,children:t.jsxs(xDt.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{delay:.1*l},className:vdt("mb-1 last:mb-0 px-2 py-1 rounded cursor-pointer","transition-colors duration-200","hover:bg-opacity-50 dark:hover:bg-opacity-60","flex items-center justify-between gap-1",u),style:AAt(e.color),children:[t.jsx("span",{className:"block overflow-hidden text-ellipsis whitespace-nowrap flex-1 text-xs",children:e.title||n.localization.untitledEvent}),h&&t.jsx("span",{className:"text-[10px] opacity-75 whitespace-nowrap",children:e.isRepeating||"end"!==c?zAt(e.startTime,o):`ends ${zAt(e.endTime,o)}`})]})},e.id)},C=(e,r,l)=>e.length<=3?t.jsx(gTt,{event:{startDate:r,endDate:r,color:l},onAddEvent:e=>a({...e}),onOpenChange:p,translations:n.localization,children:t.jsxs(xDt.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"group",children:[t.jsx(Edt,{variant:"ghost",size:"sm",className:"w-full h-6 text-xs text-muted-foreground hover:text-foreground truncate px-2 md:hidden",children:"+"}),t.jsxs(Edt,{variant:"ghost",size:"sm",className:"w-full h-6 text-xs text-muted-foreground hover:text-foreground truncate px-2 hidden md:block opacity-0 group-hover:opacity-100 transition-opacity duration-200",children:["+ ",n.localization.addEvent]})]})}):t.jsx(VAt,{events:e,addEvent:a,updateEvent:i,onDelete:s,date:r,is24HourFormat:o,resources:f,preSelectedColor:"",translations:n.localization,children:t.jsx(xDt.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},children:t.jsxs(Edt,{variant:"ghost",size:"sm",className:"w-full h-6 text-xs text-muted-foreground hover:text-foreground truncate px-2",children:["+",e.length-3," ",n.localization.more]})})});return t.jsx(WIt,{className:"h-full flex flex-col overflow-hidden",children:t.jsxs(RAt,{className:"flex-1 h-[calc(100vh-200px)]",children:[t.jsx("div",{className:"min-w-[768px] relative",children:t.jsx("div",{className:"relative",children:"row"===k?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"sticky top-0 z-30 bg-background grid grid-cols-8 gap-0",style:{gridTemplateColumns:`90px repeat(${y.length}, minmax(120px, 1fr))`},children:[t.jsx("div",{className:"sticky left-0 z-30 bg-background border-b border-r border-border p-2 h-[50px] flex items-center justify-center",children:t.jsxs("div",{className:"text-xs font-semibold text-center text-muted-foreground",children:[t.jsx("span",{className:"truncate",children:"Week"})," ",g]})}),y.map(e=>t.jsx("div",{className:"border-b border-r border-border p-2 last:border-r-0 h-[50px] flex items-center justify-center",onDoubleClick:()=>w(e),children:t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"text-xs font-semibold",children:n.localization.dayNames[e.getDay()].slice(0,3)}),t.jsx("div",{className:vdt("text-sm",Gat(e,new Date)&&"bg-primary text-primary-foreground rounded-full w-6 h-6 flex items-center justify-center mx-auto"),children:Vit(e,"d")})]})},e.toString()))]}),b.map(r=>t.jsxs("div",{className:"grid gap-0",style:{gridTemplateColumns:`90px repeat(${y.length}, minmax(120px, 1fr))`},children:[t.jsx("div",{className:"sticky left-0 z-30 bg-background border-b border-r border-border p-2 flex items-center justify-center h-[125px]",children:t.jsxs("div",{className:"flex items-center space-x-2",children:[r.accentClass&&t.jsx("div",{className:vdt("w-4 h-4 md:w-5 md:h-5 rounded-full flex-shrink-0",r.accentClass)}),t.jsx("span",{className:"text-xs md:text-sm font-medium truncate max-w-[120px]",children:r.name})]})}),y.map(n=>{const o=e.filter(e=>e.resourceId===r.id&&x(e,n));return t.jsxs("div",{className:"border-b border-r border-border p-2 h-[125px] last:border-r-0 relative group overflow-hidden",onDoubleClick:()=>w(n),children:[t.jsxs("div",{className:"relative z-10 h-full flex flex-col",children:[t.jsx("div",{className:"flex-1 overflow-auto",children:o.slice(0,(o.length,3)).map((e,t)=>_(e,n,t))}),t.jsx("div",{className:"mt-auto",children:C(o,n,r.id)})]}),l&&h&&t.jsx(LAt,{className:"absolute top-0 left-0 right-0 h-[2px] dark:h-[1px] animate-pulse bg-primary/20"})]},`${r.id}-${n.toString()}`)})]},r.id))]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"sticky top-0 z-30 bg-background grid gap-0",style:{gridTemplateColumns:`90px repeat(${b.length}, minmax(120px, 1fr))`},children:[t.jsx("div",{className:"sticky left-0 z-30 bg-background border-b border-r border-border p-2 h-[50px] flex items-center justify-center",children:t.jsxs("div",{className:"text-xs font-semibold text-center text-muted-foreground",children:[t.jsx("span",{className:"truncate",children:"Week"})," ",g]})}),b.map(e=>t.jsx("div",{className:"border-b border-r border-border p-2 last:border-r-0 h-[50px] flex items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center justify-center",children:[e.accentClass&&t.jsx("div",{className:vdt("w-4 h-4 rounded-full",e.accentClass)}),t.jsx("div",{className:"text-xs font-medium mt-1 truncate max-w-[90px] text-center",children:e.name})]})},e.id))]}),y.map(r=>t.jsxs("div",{className:"grid gap-0",style:{gridTemplateColumns:`90px repeat(${b.length}, minmax(120px, 1fr))`},children:[t.jsxs("div",{className:"sticky left-0 z-30 bg-background border-b border-r border-border p-2 flex flex-col items-center justify-center h-[125px]",onDoubleClick:()=>w(r),children:[t.jsx("div",{className:"font-semibold text-sm",children:n.localization.dayNames[r.getDay()].slice(0,3)}),t.jsx("div",{className:vdt("text-base w-7 h-7 flex items-center justify-center",Gat(r,new Date)&&"bg-primary text-primary-foreground rounded-full"),children:Vit(r,"d")})]}),b.map(n=>{const o=e.filter(e=>e.resourceId===n.id&&x(e,r));return t.jsxs("div",{className:"border-b border-r border-border p-2 h-[125px] last:border-r-0 relative group overflow-hidden",onDoubleClick:()=>w(r),children:[t.jsxs("div",{className:"relative z-10 h-full flex flex-col",children:[t.jsx("div",{className:"flex-1 overflow-auto",children:o.slice(0,(o.length,3)).map((e,t)=>_(e,r,t))}),t.jsx("div",{className:"mt-auto",children:C(o,r,n.id)})]}),l&&h&&t.jsx(LAt,{className:"absolute top-0 left-0 right-0 h-[2px] dark:h-[1px] animate-pulse bg-primary/20"})]},`${r.toString()}-${n.id}`)})]},r.toString()))]})})}),t.jsx(FAt,{orientation:"horizontal"})]})})},XAt=({filteredEvents:e,currentDate:r,is24HourFormat:n,hoverLineRef:o,hoverTimeRef:a,setClickedTime:i,clickedTime:s,isAddEventPopupOpen:l,currentConfig:c,setCurrentDate:u,setCurrentView:d,onEventUpdate:p,onEventDelete:h,onEventAdd:f,setIsAddEventPopupOpen:m,isLoading:v,currentTimeLineRef:y,currentTimeTop:g,onDateRangeChange:b,resources:x})=>{var w;const k={filteredEvents:e,currentDate:r,currentConfig:c,is24HourFormat:n,onEventAdd:f,onEventUpdate:p,onEventDelete:h,isLoading:v,isAddEventPopupOpen:l,setIsAddEventPopupOpen:m,setCurrentDate:u,setCurrentView:d,onDateRangeChange:b,resources:x};return t.jsx(t.Fragment,{children:"resource"===(null==(w=c.weekView)?void 0:w.viewType)?t.jsx(YAt,{...k}):t.jsx(KAt,{...k,hoverLineRef:o,hoverTimeRef:a,setClickedTime:i,clickedTime:s,currentTimeLineRef:y,currentTimeTop:g})})},ZAt=({currentConfig:e,currentDate:r,filteredEvents:n,isAddEventPopupOpen:o,setCurrentDate:a,setCurrentView:i,is24HourFormat:s,isLoading:l,onEventAdd:c,onEventUpdate:u,onEventDelete:d,onDateRangeChange:p,resources:h})=>{const f=function(e){const t=Dat(e.start),r=Dat(e.end);let n=+t>+r;const o=n?+t:+r,a=n?r:t;a.setHours(0,0,0,0),a.setDate(1);const i=[];for(;+a<=o;)i.push(Dat(a)),a.setMonth(a.getMonth()+1);return n?i.reverse():i}({start:nit(r),end:rit(r)}),m=s?1:0,v=s?e.localization.dayNames.slice(1).concat(e.localization.dayNames[0]):e.localization.dayNames;return t.jsx(WIt,{className:"p-4",children:t.jsx(RAt,{children:t.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:[l&&p&&t.jsx(LAt,{className:"absolute top-0 left-0 right-0 h-[2px] dark:h-[1px] animate-pulse bg-primary/20"}),f.map(r=>{const l=tit(r),p=eit({start:l,end:Jat(r)}),f=(qit(l)-m+7)%7;return t.jsxs("div",{className:"border rounded p-2",onDoubleClick:()=>(t=>{o||e.yearView.enableDoubleClickToShiftViewToMonthly&&(a(t),i("month"))})(r),children:[t.jsx("h3",{className:"text-lg font-semibold mb-2 text-center",children:e.localization.monthNames[r.getMonth()]}),t.jsxs("div",{className:"grid grid-cols-7 gap-1",children:[v.map((e,n)=>t.jsxs("div",{className:"text-center text-xs text-muted-foreground",children:[t.jsx("span",{className:"hidden sm:inline",children:e}),t.jsx("span",{className:"sm:hidden",children:e.charAt(0)})]},`${r.toString()}-${e}-${n}`)),Array.from({length:f}).map((e,r)=>t.jsx("div",{className:"h-6 w-6"},`empty-start-${r}`)),p.map(r=>{const o=(e=>n.filter(t=>{if(t.isRepeating)return(!t.isRepeatingExcludedDates||!t.isRepeatingExcludedDates.some(t=>Gat(t,e)))&&VDt(e,t.startDate,t.endDate||t.startDate,t.isRepeatingInterval||"daily");const r=Bat(t.startDate),n=Qat(t.endDate||t.startDate);return Yit(e,{start:r,end:n})}).map(e=>AAt(e.color).backgroundColor))(r),a=Gat(r,new Date),i=n.filter(e=>{if(e.isRepeating)return(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>Gat(e,r)))&&VDt(r,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily");const t=Bat(e.startDate),n=Qat(e.endDate||e.startDate);return Yit(r,{start:t,end:n})});return t.jsx(VAt,{events:i,addEvent:c,updateEvent:u,onDelete:d,date:r,is24HourFormat:s,translations:e.localization,resources:h,children:t.jsx("div",{className:vdt("h-6 w-6 flex items-center justify-center text-xs cursor-pointer","text-foreground"),children:t.jsxs("div",{className:vdt("h-5 w-5 flex items-center justify-center rounded-full relative","transition-all duration-200 ease-in-out",a&&"bg-accent text-accent-foreground",o.length>0?"hover:scale-150 hover:z-10":"hover:bg-gray-200 dark:hover:bg-gray-700"),children:[o.length>0?t.jsx("div",{className:"absolute inset-0 rounded-full overflow-hidden",children:o.map((e,n)=>t.jsx("div",{className:"absolute inset-0",style:{backgroundColor:e,clipPath:`polygon(${n*(100/o.length)}% 0%, ${(n+1)*(100/o.length)}% 0%, ${(n+1)*(100/o.length)}% 100%, ${n*(100/o.length)}% 100%)`}},`${r.toString()}-${n}`))}):t.jsx("div",{className:"absolute inset-0 rounded-full transition-opacity opacity-0 hover:opacity-100 bg-gray-200 dark:bg-gray-700"}),t.jsx("time",{dateTime:Vit(r,"yyyy-MM-dd"),className:"relative z-10",children:Vit(r,"d")})]})})},r.toString())})]})]},r.toString())})]})})})},QAt=({currentView:r,isListView:n,animationDirection:o,currentDate:a,filteredEvents:i,listSearchTerm:s,setListSearchTerm:l,currentConfig:c,resources:u,onEventUpdate:d,onEventDelete:p,isLoading:h,onEventAdd:f,is24HourFormat:m,setCurrentDate:v,setCurrentView:y,onDateRangeChange:g})=>{const[b,x]=e.useState(!1),[w,k]=e.useState(null),_=e.useRef(null),C=e.useRef(null),M=e.useRef(null),S=(()=>{const[t,r]=e.useState(0);return e.useEffect(()=>{const e=()=>{const e=new Date,t=(60*e.getHours()+e.getMinutes())*(16/15);r(t)};e();const t=setInterval(e,6e4);return()=>clearInterval(t)},[]),t})();$It({currentView:r,currentDate:a,onDateRangeChange:g,is24HourFormat:m});const D={filteredEvents:i,currentDate:a,currentConfig:c,onEventUpdate:d,onEventDelete:p,onEventAdd:f,is24HourFormat:m,isLoading:h,resources:u},O={isAddEventPopupOpen:b,setIsAddEventPopupOpen:x,onDateRangeChange:g},P={hoverLineRef:_,hoverTimeRef:C},E={clickedTime:w,setClickedTime:k},j={currentTimeLineRef:M,currentTimeTop:S},T={setCurrentDate:v,setCurrentView:y};return t.jsx(Tbt,{mode:"wait",children:t.jsx(xDt.div,{initial:{opacity:0,y:"up"===o?-20:"down"===o?20:0},animate:{opacity:1,x:0,y:0},exit:{opacity:0,y:"up"===o?20:"down"===o?-20:0},transition:{duration:.1},className:"h-full",children:n?t.jsx($At,{...D,currentView:r,listSearchTerm:s,setListSearchTerm:l}):t.jsxs(t.Fragment,{children:["day"===r&&t.jsx(qAt,{...D,...O,...P,...E,...j}),"week"===r&&t.jsx(XAt,{...D,...O,...P,...E,...j,...T}),"month"===r&&t.jsx(GAt,{...D,...O,...T}),"year"===r&&t.jsx(ZAt,{...D,...O,...T})]})},`${r}-${a.toISOString()}`)})},JAt=({config:r,events:n,isLoading:o=!1,resources:a,onEventAdd:i,onEventUpdate:s,onEventDelete:l,onDateRangeChange:c})=>{const u={...pst,...r},d=ust({config:{defaultView:u.defaultView||"month",use24HourFormatByDefault:u.use24HourFormatByDefault||!1},translations:u.localization}),[p,h]=e.useState(!1),[f,m]=e.useState(""),[v,y]=e.useState([]),g=a&&a.length>0?n.filter(e=>{if(!v.length)return!0;if(e.resourceId)return v.includes(e.resourceId);if(e.color){const t=a.find(t=>t.color===e.color||t.id===e.color);return!!t&&v.includes(t.id)}return!1}):n,b=(()=>{const[t,r]=e.useState(!1);return e.useEffect(()=>{r("ontouchstart"in window||navigator.maxTouchPoints>0)},[]),t})(),x=Sat({onSwipedLeft:()=>d.handleNext(),onSwipedRight:()=>d.handlePrevious(),preventScrollOnSwipe:!1,trackMouse:!1,delta:{left:100,right:100},swipeDuration:150,touchEventOptions:{passive:!0},trackTouch:!0}),w={...d,currentConfig:u,onEventAdd:i,onEventDelete:l,isListView:p};return t.jsxs("div",{...b?x:{},children:[t.jsx(qIt,{...w,setIsListView:h,resources:a,selectedResourceIds:v,setSelectedResourceIds:y}),t.jsx(QAt,{...w,is24HourFormat:d.use24HourFormat,filteredEvents:g,listSearchTerm:f,setListSearchTerm:m,resources:a,onEventUpdate:s,isLoading:o,onDateRangeChange:c})]})};function eLt({config:t={},initialEvents:r=[],onEventAdd:n,onEventUpdate:o,onEventDelete:a,onDateRangeChange:i}){var s,l;const[c,u]=e.useState(r),[d,p]=e.useState(!1),h=e.useRef(null),f=e.useRef(null),m=(null==(s=t.calendarConfig)?void 0:s.localization)||dst,v=async(e,r)=>{var o;let a;try{a=n?await n(e):{...e,id:Date.now().toString()+Math.random().toString(36).substring(2,7)},u(e=>[...e,a]),f.current=a,r?TDt.success(m.eventRestored):TDt.success(m.eventAdded,{action:{label:m.undo,onClick:()=>g(a.id,!0)}})}catch(n){console.error("Error adding event:",n),TDt.error(m.failedToAddEvent,!1!==(null==(o=t.events)?void 0:o.allowUserRetryAfterFailure)?{action:{label:m.tryAgain,onClick:()=>v(e,r)}}:void 0)}},y=async(e,r)=>{var n;try{o&&await o(e),u(t=>t.map(t=>t.id===e.id?e:t)),r?TDt.success(m.eventRestored):TDt.success(m.eventUpdated,{action:{label:m.undo,onClick:()=>y(c.find(t=>t.id===e.id),!0)}})}catch(o){console.error("Error updating event:",o),TDt.error(m.failedToUpdateEvent,!1!==(null==(n=t.events)?void 0:n.allowUserRetryAfterFailure)?{action:{label:m.tryAgain,onClick:()=>y(e,r)}}:void 0)}},g=async(e,r)=>{var n;if(!e)return;const o=r?f.current:c.find(t=>t.id===e);if(o)try{a&&await a(e),u(t=>t.filter(t=>t.id!==e)),r?TDt.success(m.eventDeleted):TDt.success(m.eventDeleted,{action:{label:m.undo,onClick:()=>v(o,!0)}})}catch(o){console.error("Error deleting event:",o),TDt.error(m.failedToDeleteEvent,!1!==(null==(n=t.events)?void 0:n.allowUserRetryAfterFailure)?{action:{label:m.tryAgain,onClick:()=>g(e,r)}}:void 0)}else console.error(`Event with id ${e} not found`)},b=function(t,r,n){const o=e.useRef(),a=e.useRef(null),i=e.useCallback(()=>{var e;o.current&&(clearTimeout(o.current),o.current=void 0,null==(e=null==n?void 0:n.onCancel)||e.call(n),a.current&&(a.current(),a.current=null))},[n]);return e.useEffect(()=>()=>i(),[i]),e.useCallback((...e)=>{var s;return r?(i(),null==(s=null==n?void 0:n.onDebounce)||s.call(n),new Promise(n=>{a.current=n,o.current=setTimeout(async()=>{await t(...e),a.current=null,n()},r)})):t(...e)},[t,r,n,i])}(async(e,r)=>{var n;if(!i)return;h.current&&h.current.abort();const o=new AbortController;h.current=o;try{p(!0);const t=await i(e,r,o.signal);h.current===o&&u(e=>[...e,...t])}catch(o){if(o instanceof DOMException&&"AbortError"===o.name)return;console.error("Error fetching events:",o),TDt.error(m.failedToFetchEvents,!1!==(null==(n=t.events)?void 0:n.allowUserRetryAfterFailure)?{action:{label:m.tryAgain,onClick:()=>b(e,r)}}:void 0)}finally{h.current===o&&(p(!1),h.current=null)}},null==(l=t.events)?void 0:l.debounceTimeOnViewOrDateChange,{onDebounce:()=>{}});return{events:c,isLoading:d,addEvent:v,updateEvent:y,deleteEvent:g,onViewOrDateChange:b}}new Date((new Date).getFullYear(),(new Date).getMonth(),7),new Date((new Date).getFullYear(),(new Date).getMonth(),7),new Date((new Date).getFullYear(),(new Date).getMonth(),9),new Date((new Date).getFullYear(),(new Date).getMonth(),9),new Date((new Date).getFullYear(),(new Date).getMonth(),9),new Date((new Date).getFullYear(),(new Date).getMonth(),9),new Date((new Date).getFullYear(),(new Date).getMonth(),12),new Date((new Date).getFullYear(),(new Date).getMonth(),12),new Date((new Date).getFullYear(),(new Date).getMonth(),15),new Date((new Date).getFullYear(),(new Date).getMonth(),15),new Date((new Date).getFullYear(),(new Date).getMonth(),15),new Date((new Date).getFullYear(),(new Date).getMonth(),15),new Date((new Date).getFullYear(),(new Date).getMonth(),17),new Date((new Date).getFullYear(),(new Date).getMonth(),17),new Date((new Date).getFullYear(),(new Date).getMonth(),19),new Date((new Date).getFullYear(),(new Date).getMonth(),19),new Date((new Date).getFullYear(),(new Date).getMonth(),19),new Date((new Date).getFullYear(),(new Date).getMonth(),19),new Date((new Date).getFullYear(),(new Date).getMonth(),19),new Date((new Date).getFullYear(),(new Date).getMonth(),19),new Date((new Date).getFullYear(),(new Date).getMonth(),20),new Date((new Date).getFullYear(),(new Date).getMonth(),20),new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()+1),new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()+3),new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()),new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()),new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()),new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()),new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()),new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()),new Date((new Date).getFullYear(),(new Date).getMonth(),19),new Date((new Date).getFullYear(),(new Date).getMonth(),19),new Date((new Date).getFullYear(),(new Date).getMonth(),19),new Date((new Date).getFullYear(),(new Date).getMonth(),19),new Date((new Date).getFullYear(),(new Date).getMonth(),19),new Date((new Date).getFullYear(),(new Date).getMonth(),19),new Date((new Date).getFullYear(),(new Date).getMonth(),22),new Date((new Date).getFullYear(),(new Date).getMonth(),22),new Date((new Date).getFullYear(),(new Date).getMonth(),22),new Date((new Date).getFullYear(),(new Date).getMonth(),22),new Date((new Date).getFullYear(),(new Date).getMonth(),25),new Date((new Date).getFullYear(),(new Date).getMonth(),25),new Date((new Date).getFullYear(),(new Date).getMonth(),28),new Date((new Date).getFullYear(),(new Date).getMonth(),28),new Date((new Date).getFullYear(),(new Date).getMonth(),28),new Date((new Date).getFullYear(),(new Date).getMonth(),28),new Date((new Date).getFullYear(),(new Date).getMonth(),28),new Date((new Date).getFullYear(),(new Date).getMonth(),28),new Date((new Date).getFullYear(),(new Date).getMonth(),3),new Date((new Date).getFullYear(),(new Date).getMonth(),3),new Date((new Date).getFullYear(),(new Date).getMonth(),3),new Date((new Date).getFullYear(),(new Date).getMonth(),3),new Date((new Date).getFullYear(),(new Date).getMonth(),3),new Date((new Date).getFullYear(),(new Date).getMonth(),3),new Date((new Date).getFullYear(),(new Date).getMonth(),10),new Date((new Date).getFullYear(),(new Date).getMonth(),10),new Date((new Date).getFullYear(),(new Date).getMonth(),10),new Date((new Date).getFullYear(),(new Date).getMonth(),10),new Date((new Date).getFullYear(),(new Date).getMonth(),10),new Date((new Date).getFullYear(),(new Date).getMonth(),10),new Date((new Date).getFullYear(),(new Date).getMonth(),20),new Date((new Date).getFullYear(),(new Date).getMonth(),20),new Date((new Date).getFullYear(),(new Date).getMonth(),20),new Date((new Date).getFullYear(),(new Date).getMonth(),20),new Date((new Date).getFullYear(),(new Date).getMonth(),20),new Date((new Date).getFullYear(),(new Date).getMonth(),20),new Date((new Date).getFullYear(),(new Date).getMonth(),24),new Date((new Date).getFullYear(),(new Date).getMonth(),24),new Date((new Date).getFullYear(),(new Date).getMonth(),24),new Date((new Date).getFullYear(),(new Date).getMonth(),24),new Date((new Date).getFullYear(),(new Date).getMonth(),24),new Date((new Date).getFullYear(),(new Date).getMonth(),24),new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()-1),new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()+3);var tLt=function(e){var t=e.configurationItemInfo,r=Z(e,["configurationItemInfo"]),n=eLt({initialEvents:r.events||[],onEventAdd:function(e){return Q(void 0,void 0,void 0,function(){var t;return J(this,function(n){switch(n.label){case 0:return[4,null===(t=r.onEventCreate)||void 0===t?void 0:t.call(r,e)];case 1:return n.sent(),[2,X(X({},e),{id:Date.now().toString()})]}})})},onEventUpdate:function(e){return Q(void 0,void 0,void 0,function(){var t;return J(this,function(n){switch(n.label){case 0:return[4,null===(t=r.onEventUpdate)||void 0===t?void 0:t.call(r,e)];case 1:return n.sent(),[2,e]}})})},onEventDelete:r.onEventDelete,onDateRangeChange:r.onDateRangeChange}),o=n.events,a=n.isLoading,i=n.addEvent,s=n.updateEvent,l=n.deleteEvent,c=n.onViewOrDateChange;return lt(nh,X({sx:X({width:"100%",height:"100%"},r.css)},t,{className:"fec-wrapper"},{children:lt(JAt,{events:o,isLoading:a,config:r.config,onEventAdd:i,onEventUpdate:s,onEventDelete:l,onDateRangeChange:c})}))},rLt={exports:{}};const nLt={AED:"د.إ",AFN:"؋",ALL:"L",AMD:"֏",ANG:"ƒ",AOA:"Kz",ARS:"$",AUD:"$",AWG:"ƒ",AZN:"₼",BAM:"KM",BBD:"$",BDT:"৳",BGN:"лв",BHD:".د.ب",BIF:"FBu",BMD:"$",BND:"$",BOB:"$b",BOV:"BOV",BRL:"R$",BSD:"$",BTC:"₿",BTN:"Nu.",BWP:"P",BYN:"Br",BYR:"Br",BZD:"BZ$",CAD:"$",CDF:"FC",CHE:"CHE",CHF:"CHF",CHW:"CHW",CLF:"CLF",CLP:"$",CNH:"¥",CNY:"¥",COP:"$",COU:"COU",CRC:"₡",CUC:"$",CUP:"₱",CVE:"$",CZK:"Kč",DJF:"Fdj",DKK:"kr",DOP:"RD$",DZD:"دج",EEK:"kr",EGP:"£",ERN:"Nfk",ETB:"Br",ETH:"Ξ",EUR:"€",FJD:"$",FKP:"£",GBP:"£",GEL:"₾",GGP:"£",GHC:"₵",GHS:"GH₵",GIP:"£",GMD:"D",GNF:"FG",GTQ:"Q",GYD:"$",HKD:"$",HNL:"L",HRK:"kn",HTG:"G",HUF:"Ft",IDR:"Rp",ILS:"₪",IMP:"£",INR:"₹",IQD:"ع.د",IRR:"﷼",ISK:"kr",JEP:"£",JMD:"J$",JOD:"JD",JPY:"¥",KES:"KSh",KGS:"лв",KHR:"៛",KMF:"CF",KPW:"₩",KRW:"₩",KWD:"KD",KYD:"$",KZT:"₸",LAK:"₭",LBP:"£",LKR:"₨",LRD:"$",LSL:"M",LTC:"Ł",LTL:"Lt",LVL:"Ls",LYD:"LD",MAD:"MAD",MDL:"lei",MGA:"Ar",MKD:"ден",MMK:"K",MNT:"₮",MOP:"MOP$",MRO:"UM",MRU:"UM",MUR:"₨",MVR:"Rf",MWK:"MK",MXN:"$",MXV:"MXV",MYR:"RM",MZN:"MT",NAD:"$",NGN:"₦",NIO:"C$",NOK:"kr",NPR:"₨",NZD:"$",OMR:"﷼",PAB:"B/.",PEN:"S/.",PGK:"K",PHP:"₱",PKR:"₨",PLN:"zł",PYG:"Gs",QAR:"﷼",RMB:"¥",RON:"lei",RSD:"Дин.",RUB:"₽",RWF:"R₣",SAR:"﷼",SBD:"$",SCR:"₨",SDG:"ج.س.",SEK:"kr",SGD:"S$",SHP:"£",SLL:"Le",SOS:"S",SRD:"$",SSP:"£",STD:"Db",STN:"Db",SVC:"$",SYP:"£",SZL:"E",THB:"฿",TJS:"SM",TMT:"T",TND:"د.ت",TOP:"T$",TRL:"₤",TRY:"₺",TTD:"TT$",TVD:"$",TWD:"NT$",TZS:"TSh",UAH:"₴",UGX:"USh",USD:"$",UYI:"UYI",UYU:"$U",UYW:"UYW",UZS:"лв",VEF:"Bs",VES:"Bs.S",VND:"₫",VUV:"VT",WST:"WS$",XAF:"FCFA",XBT:"Ƀ",XCD:"$",XOF:"CFA",XPF:"₣",XSU:"Sucre",XUA:"XUA",YER:"﷼",ZAR:"R",ZMW:"ZK",ZWD:"Z$",ZWL:"$"};rLt.exports=function(e){if("string"!=typeof e)return;const t=e.toUpperCase();return Object.prototype.hasOwnProperty.call(nLt,t)?nLt[t]:void 0},rLt.exports.currencySymbolMap=nLt;var oLt=function(t){var r,n,o=t.required,a=void 0!==o&&o,i=t.requiredErrorText,s=void 0===i?"This field is required":i,l=t.validationErrorText,c=void 0===l?"Invalid numeric value":l,u=t.isDisplayOnly,d=void 0!==u&&u,p=t.backgroundColor,h=t.textAlign,f=void 0===h?"left":h,m=t.textColor,v=void 0===m?"inherit":m,y=t.fontSize,g=void 0===y?"16px":y,b=t.fontFamily,x=void 0===b?"inherit":b,w=t.fontWeight,k=void 0===w?"normal":w,_=t.borderColor,C=t.marginLeft,M=void 0===C?"0":C,S=t.marginTop,D=void 0===S?"0":S,O=t.marginRight,P=void 0===O?"0":O,E=t.marginBottom,j=void 0===E?"0":E,T=t.paddingLeft,N=void 0===T?"0":T,R=t.paddingTop,F=void 0===R?"0":R,z=t.paddingRight,I=void 0===z?"0":z,A=t.paddingBottom,L=void 0===A?"0":A,B=t.width,V=t.height,H=t.minHeight,q=t.maxHeight,$=t.minWidth,W=t.maxWidth,U=t.text,G=t.placeholderText,K=t.configurationItemInfo,Y=t.name,Z=t.numericPrecision,Q=void 0===Z?"1":Z,J=t.currency,ee=t.placement,te=void 0===ee?"left":ee,re=t.sourceDataModelField,ne=jN(),oe=null==ne?void 0:ne.control,ae=oqt().localStateObject,ie=lqt().stateConfig,se=bnt(),le=ae||ie,ce=e.useState(""),ue=ce[0],de=ce[1],pe=!!oe&&!!Y,he=re?null===(r=null==le?void 0:le[re])||void 0===r?void 0:r.value:void 0,fe=re?null==se?void 0:se.getDmfValue(re):void 0,me=Number.isFinite(+Q)&&+Q>0?+Q:1,ve=J?null!==(n=rLt.exports(J.toUpperCase()))&&void 0!==n?n:J.toUpperCase():"",ye={required:!!a&&s,pattern:{value:/^-?\d+(?:\.\d+)?$/,message:c}},ge=X(X(X(X(X(X(X({backgroundColor:p,color:v,fontSize:g,fontFamily:x,fontWeight:k},B&&{width:B}),V&&{height:V}),$&&{minWidth:$}),W&&{maxWidth:W}),H&&{minHeight:H}),q&&{maxHeight:q}),{"& .MuiOutlinedInput-root":{"& fieldset":{borderColor:_},"&:hover fieldset":{borderColor:_},"&.Mui-focused fieldset":{borderColor:_},"&.Mui-disabled fieldset":{borderColor:_}},"& .MuiOutlinedInput-input":{textAlign:f,paddingLeft:N,paddingTop:F,paddingRight:I,paddingBottom:L}}),be={color:v,"&.Mui-focused":{color:v}},xe=X(X(X(X(X(X({marginLeft:M,marginTop:D,marginRight:P,marginBottom:j,display:"inline-flex",flexDirection:"column"},B&&{width:B}),V&&{height:V}),$&&{minWidth:$}),W&&{maxWidth:W}),H&&{minHeight:H}),q&&{maxHeight:q}),we=ve?lt("span",X({style:{color:v,fontWeight:k}},{children:ve})):null;if(d){var ke=void 0!==fe?fe:pe?ne.watch(Y):he,_e=null!=ke?ke:"-";return ct(nh,X({sx:X(X(X(X(X(X(X({},xe),B&&{width:B}),V&&{height:V}),$&&{minWidth:$}),W&&{maxWidth:W}),H&&{minHeight:H}),q&&{maxHeight:q})},K,{children:[U&&lt(Pm,X({sx:{fontSize:g,fontFamily:x,fontWeight:k,color:v,marginLeft:0}},{children:U})),lt(Ic,X({sx:{fontSize:g,fontFamily:x,fontWeight:k,color:v,backgroundColor:p,paddingLeft:N,paddingTop:F,paddingRight:I,paddingBottom:L,border:"1px solid ".concat(_||"#ccc"),borderRadius:"4px",minWidth:"100px"}},{children:"left"===te?"".concat(ve).concat(_e):"".concat(_e).concat(ve)}))]}))}var Ce=function(e,t){return lt(fk,X({type:"number",label:U,required:a,placeholder:G,variant:"outlined",sx:X(X(X(X(X(X(X({},xe),B&&{width:B}),V&&{height:V}),$&&{minWidth:$}),W&&{maxWidth:W}),H&&{minHeight:H}),q&&{maxHeight:q}),inputProps:{step:me},slotProps:{input:{sx:ge,style:{textAlign:f}},inputLabel:{sx:be}},InputProps:{startAdornment:"left"===te&&we?lt(Qm,X({position:"start"},{children:we})):void 0,endAdornment:"right"===te&&we?lt(Qm,X({position:"end"},{children:we})):void 0},error:!!t,helperText:t||null},e,K))};return pe?lt(AN,{name:Y,rules:ye,control:oe,defaultValue:"",render:function(e){var t,r=e.field,n=e.fieldState;return Ce(r,null===(t=n.error)||void 0===t?void 0:t.message)}}):Ce({value:ue,onChange:function(e){return de(e.target.value)}})},aLt=e.forwardRef(function(e,t){var r=e.inputRef,n=Z(e,["inputRef"]);return lt(V_,X({},n,{ref:function(e){"function"==typeof r&&r(e?e.inputElement:null)},mask:Q_,guide:!0,placeholderChar:" "}))}),iLt=function(e){var t=e.masked,r=e.errorMsg,n=e.inputSx,o=e.labelSx,a=Z(e,["masked","errorMsg","inputSx","labelSx"]);return lt(fk,X({},a,{variant:"outlined",error:!!r,helperText:r||null,type:"text",slotProps:{input:X({sx:n},t?{inputComponent:aLt}:{}),inputLabel:{sx:o}}}))},sLt=function(t){var r,n=t.isDisplayOnly,o=void 0!==n&&n,a=t.required,i=void 0!==a&&a,s=t.requiredErrorText,l=void 0===s?"Email is required":s,c=t.validationErrorText,u=void 0===c?"Invalid email address":c,d=t.text,p=t.placeholderText,h=t.masked,f=void 0!==h&&h,m=t.multiLine,v=void 0!==m&&m,y=t.backgroundColor,g=t.borderColor,b=t.color,x=void 0===b?"inherit":b,w=t.fontSize,k=void 0===w?"16px":w,_=t.fontFamily,C=void 0===_?"inherit":_,M=t.fontWeight,S=void 0===M?"normal":M,D=t.textAlign,O=void 0===D?"left":D,P=t.marginLeft,E=void 0===P?"0":P,j=t.marginTop,T=void 0===j?"0":j,N=t.marginRight,R=void 0===N?"0":N,F=t.marginBottom,z=void 0===F?"0":F,I=t.paddingLeft,A=void 0===I?"0":I,L=t.paddingTop,B=void 0===L?"0":L,V=t.paddingRight,H=void 0===V?"0":V,q=t.paddingBottom,$=void 0===q?"0":q,W=t.width,U=t.height,G=t.minHeight,K=t.maxHeight,Y=t.minWidth,Z=t.maxWidth,Q=t.name,J=t.sourceDataModelField,ee=t.configurationItemInfo,te=jN(),re=null==te?void 0:te.control,ne=!(!re||!Q),oe=oqt().localStateObject,ae=lqt().stateConfig,ie=bnt(),se=oe||ae,le=J?null===(r=null==se?void 0:se[J])||void 0===r?void 0:r.value:void 0,ce=J?null==ie?void 0:ie.getDmfValue(J):void 0,ue=e.useState("");ue[0],ue[1];var de=e.useState(""),pe=de[0],he=de[1],fe={required:!!i&&l,pattern:{value:/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@(([^<>()[\]\\.,;:\s@"]+\.)+[^<>()[\]\\.,;:\s@"]{2,})$/,message:u}};if(o){var me=(void 0!==ce?String(null!=ce?ce:""):ne?te.watch(Q)||"":le||"")||p||"-";return ct("div",X({style:X(X(X({display:"inline-flex",flexDirection:"column",marginLeft:E,marginTop:T,marginRight:R,marginBottom:z},W&&{width:W}),U&&{height:U}),{minHeight:G,maxHeight:K,minWidth:Y,maxWidth:Z})},ee,{children:[d&&lt(Pm,X({sx:{fontSize:k,fontFamily:C,fontWeight:S,color:x,marginLeft:0,marginBottom:"4px"}},{children:d})),lt(Ic,X({sx:{fontSize:k,fontFamily:C,fontWeight:S,color:x,paddingLeft:A,paddingTop:B,paddingRight:H,paddingBottom:$,backgroundColor:y,border:"1px solid ".concat(g||"#ccc"),borderRadius:"4px",minWidth:"120px",textAlign:O}},{children:me}))]}))}var ve=X(X(X(X(X(X(X({backgroundColor:y,color:x,fontSize:k,fontFamily:C,fontWeight:S},W&&{width:W}),U&&{height:U}),Y&&{minWidth:Y}),Z&&{maxWidth:Z}),G&&{minHeight:G}),K&&{maxHeight:K}),{"& .MuiOutlinedInput-notchedOutline":{borderColor:g||"inherit"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:g||"inherit"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:g||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled .MuiOutlinedInput-notchedOutline":{borderColor:g||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled:hover .MuiOutlinedInput-notchedOutline":{borderColor:g||"inherit"},"& .MuiOutlinedInput-input":{textAlign:O,paddingLeft:A,paddingTop:B,paddingRight:H,paddingBottom:$}}),ye={color:x,"&.Mui-focused":{color:x}},ge=v?3:1,be=X(X(X(X(X(X({},W&&{width:W}),U&&{height:U}),Y&&{minWidth:Y}),Z&&{maxWidth:Z}),G&&{minHeight:G}),K&&{maxHeight:K});return lt("div",X({style:X(X(X({marginLeft:E,marginTop:T,marginRight:R,marginBottom:z},W&&{width:W}),U&&{height:U}),{minHeight:G,maxHeight:K,minWidth:Y,maxWidth:Z})},ne?{children:lt(AN,{name:Q,rules:fe,control:re,defaultValue:"",render:function(e){var t,r=e.field,n=e.fieldState;return lt(iLt,X({masked:f,required:i,errorMsg:null===(t=n.error)||void 0===t?void 0:t.message,inputSx:ve,labelSx:ye,sx:be,label:d,placeholder:p,multiline:v,minRows:ge,value:r.value||"",onChange:r.onChange},ee||{}))}})}:{children:lt(iLt,X({masked:f,required:i,errorMsg:void 0,inputSx:ve,labelSx:ye,sx:be,label:d,placeholder:p,multiline:v,minRows:ge,value:pe,onChange:function(e){return he(e.target.value)}},ee||{}))}))},lLt=function(e){return{justifyContent:e.textAlign||"flex-start",backgroundColor:e.backgroundColor,paddingTop:e.paddingTop,paddingRight:e.paddingRight,paddingBottom:e.paddingBottom,paddingLeft:e.paddingLeft}},cLt=function(t){var r,n=t.popover,o=void 0===n||n,a=t.items,i=t.marginTop,s=void 0===i?"0":i,l=t.marginRight,c=void 0===l?"0":l,u=t.marginBottom,d=void 0===u?"0":u,p=t.marginLeft,h=void 0===p?"0":p,f=t.paddingTop,m=void 0===f?"0":f,v=t.paddingRight,y=void 0===v?"0":v,g=t.paddingBottom,b=void 0===g?"0":g,x=t.paddingLeft,w=void 0===x?"0":x,k=t.cornerRadius,_=void 0===k?"4px":k,C=t.backgroundColor,M=void 0===C?"#fff":C,S=t.width,D=void 0===S?"100%":S,O=t.height,P=void 0===O?"auto":O,E=t.borderColor,j=void 0===E?"#ccc":E,T=t.borderWeight,N=void 0===T?"1px":T,R=t.buttonText,F=void 0===R?"Open Menu":R,z=t.buttonVariant,I=void 0===z?"contained":z,A=t.buttonTextColor,L=t.buttonFontSize,B=t.buttonFontWeight,V=t.buttonFontFamily,H=t.buttonDisabled,q=void 0!==H&&H,$=t.buttonGap,W=void 0===$?0:$,U=t.buttonStartIcon,G=t.buttonEndIcon,K=t.buttonCornerRadius,Y=void 0===K?"0":K,Z=t.buttonMarginTop,Q=void 0===Z?"0":Z,J=t.buttonMarginRight,ee=void 0===J?"0":J,te=t.buttonMarginBottom,re=void 0===te?"0":te,ne=t.buttonMarginLeft,oe=void 0===ne?"0":ne,ae=t.buttonPaddingTop,ie=void 0===ae?"0":ae,se=t.buttonPaddingRight,le=void 0===se?"0":se,ce=t.buttonPaddingBottom,ue=void 0===ce?"0":ce,de=t.buttonPaddingLeft,pe=void 0===de?"0":de,he=t.buttonIconOnly,fe=t.buttonElevation,me=t.buttonFillColor,ve=t.buttonFillColorDisabled,ye=t.buttonFillColorHover,ge=t.buttonFillColorPressed,be=t.buttonBorderColor,xe=t.buttonBorderColorDisabled,we=t.buttonBorderColorHover,ke=t.buttonBorderColorPressed,_e=t.buttonTextColorDisabled,Ce=t.buttonTextColorHover,Me=t.buttonTextColorPressed,Se=t.buttonColor,De=void 0===Se?"#1976d2":Se,Oe=t.anchorOriginVertical,Pe=void 0===Oe?"bottom":Oe,Ee=t.anchorOriginHorizontal,je=void 0===Ee?"left":Ee,Te=t.transformOriginVertical,Ne=void 0===Te?"top":Te,Re=t.transformOriginHorizontal,Fe=void 0===Re?"left":Re,ze=t.elevation,Ie=void 0===ze?3:ze,Ae=t.moleculeId,Le=t.configurationItemInfo,Be=Qe(),Ve=oqt(),He=Ve.isConfigurationMode,qe=Ve.selectedConfigurationItemId,$e=Ve.onConfigurationItemClicked,We=Ve.onInternalNavigation,Ue=e.useState(null),Ge=Ue[0],Ke=Ue[1],Ye=e.useState(!1),Xe=Ye[0],Ze=Ye[1],Je=Boolean(He&&(qe===Ae||a.some(function(e){return e.id===qe}))),et=function(){return Ze(!1)},tt=X({marginTop:s,marginRight:c,marginBottom:d,marginLeft:h,paddingTop:m,paddingRight:y,paddingBottom:b,paddingLeft:w},o?{display:"inline-block",zIndex:null===(r=null==Be?void 0:Be.zIndex)||void 0===r?void 0:r.drawer}:{width:D,height:P,backgroundColor:M,display:"block",overflow:"hidden",border:"".concat(N," solid ").concat(j),borderRadius:_});return o?ct(nh,{children:[lt(_nt,{ref:Ke,text:F,variant:I,moleculeId:Ae,textColor:A,fontSize:L,fontWeight:B,fontFamily:V,disabled:q,gap:W,startIcon:U,endIcon:G,onClick:function(){return Ze(!0)},marginTop:Q,marginRight:ee,marginBottom:re,marginLeft:oe,paddingTop:ie,paddingRight:le,paddingBottom:ue,paddingLeft:pe,borderRadius:Y,iconOnly:he,elevation:fe,fillColor:me||De,fillColorDisabled:ve,fillColorHover:ye,fillColorPressed:ge,borderColor:be,borderColorDisabled:xe,borderColorHover:we,borderColorPressed:ke,textColorDisabled:_e,textColorHover:Ce,textColorPressed:Me,configurationItemInfo:Le}),lt(ky,X({open:He?Je:Xe,variant:"menu",anchorEl:Ge,disablePortal:!0,disableScrollLock:!0,disableRestoreFocus:!0,disableEnforceFocus:!0,onClose:et,anchorOrigin:{vertical:Pe,horizontal:je},transformOrigin:{vertical:Ne,horizontal:Fe},elevation:Ie,slotProps:{paper:{sx:{backgroundColor:M}}},sx:tt},{children:a.map(function(e){var t=qe===e.id,r={entityId:e.id,entity:"molecule_item",entityType:"menu_item"},n=He?function(e){e.stopPropagation(),null==$e||$e(r,!1)}:void 0,o=He?function(e){e.stopPropagation(),null==$e||$e(r,!0)}:void 0,a=He?{onClick:n,onDoubleClick:o,"data-organism-id":e.id,css:f$({theme:Be,selected:t})}:{};return ct(Dy,X({sx:lLt(e),onClick:function(){var t,r;(null==e?void 0:e.link)&&(P$(e.link)?null==We||We({link:(null===(t=e.link)||void 0===t?void 0:t.internalLink)||""}):O$(null===(r=e.link)||void 0===r?void 0:r.externalLink)),et()},disabled:e.disabled},a,{children:[e.startIcon&&lt(mnt,{iconName:e.startIcon,color:e.textColor}),lt(Ic,X({sx:{ml:e.startIcon?1:0,mr:e.endIcon?1:0,color:e.textColor||"inherit",fontSize:e.fontSize||"inherit",fontWeight:e.fontWeight||"normal",fontFamily:e.fontFamily||"inherit",whiteSpace:e.wrap?"normal":"nowrap",width:"100%",textAlign:e.textAlign||"left"}},{children:e.text})),e.endIcon&&lt(mnt,{iconName:e.endIcon,color:e.textColor})]}),e.id)})}))]}):lt(cl,X({id:Ae,sx:tt,elevation:Ie},Le,{children:lt(Pv,X({disablePadding:!0},{children:a.map(function(e){var t=qe===e.id,r={entityId:e.id,entity:"molecule_item",entityType:"menu_item"},n=He?function(e){e.stopPropagation(),null==$e||$e(r,!1)}:void 0,o=He?function(e){e.stopPropagation(),null==$e||$e(r,!0)}:void 0,a=He?{onClick:n,onDoubleClick:o,"data-organism-id":e.id,css:f$({theme:Be,selected:t})}:{};return ct(Fv,X({disabled:e.disabled,sx:lLt(e),onClick:function(){var t,r;(null==e?void 0:e.link)&&(P$(e.link)?null==We||We({link:(null===(t=e.link)||void 0===t?void 0:t.internalLink)||""}):O$(null===(r=e.link)||void 0===r?void 0:r.externalLink))}},a,{children:[e.startIcon&&lt(mnt,{iconName:e.startIcon,color:e.textColor}),lt(Jv,{primary:lt(Ic,X({sx:{ml:e.startIcon?1:0,mr:e.endIcon?1:0,color:e.textColor||"inherit",fontSize:e.fontSize||"inherit",fontWeight:e.fontWeight||"normal",fontFamily:e.fontFamily||"inherit",whiteSpace:e.wrap?"normal":"nowrap",textAlign:e.textAlign||"left"}},{children:e.text}))}),e.endIcon&&lt(mnt,{iconName:e.endIcon,color:e.textColor})]}),e.id)})}))}))};var uLt=function(e){var t=e.errorMsg,r=e.stepValue,n=e.minValue,o=e.allowNegative,a=e.inputSx,i=e.labelSx,s=Z(e,["errorMsg","stepValue","minValue","allowNegative","inputSx","labelSx"]);return lt(fk,X({},s,{variant:"outlined",type:"number",error:!!t,helperText:t||null,inputProps:{step:r,min:o?void 0:n},slotProps:{input:{sx:a},inputLabel:{sx:i}}}))},dLt=function(t){var r,n=t.isDisplayOnly,o=void 0!==n&&n,a=t.required,i=void 0!==a&&a,s=t.requiredErrorText,l=void 0===s?"This field is required":s,c=t.validationErrorText,u=void 0===c?"Invalid numeric value":c,d=t.text,p=t.placeholderText,h=t.backgroundColor,f=t.borderColor,m=t.textColor,v=void 0===m?"#000":m,y=t.fontSize,g=t.fontFamily,b=t.fontWeight,x=t.allowNegative,w=void 0!==x&&x,k=t.numericPrecision,_=void 0===k?"1":k,C=t.name,M=t.sourceDataModelField,S=t.marginLeft,D=void 0===S?"0":S,O=t.marginTop,P=void 0===O?"0":O,E=t.marginRight,j=void 0===E?"0":E,T=t.marginBottom,N=void 0===T?"0":T,R=t.paddingLeft,F=void 0===R?"0":R,z=t.paddingTop,I=void 0===z?"0":z,A=t.paddingRight,L=void 0===A?"0":A,B=t.paddingBottom,V=void 0===B?"0":B,H=t.width,q=t.height,$=t.configurationItemInfo;t._textAlign;var W=t.minHeight,U=t.maxHeight,G=t.minWidth,K=t.maxWidth,Y=jN(),Z=null==Y?void 0:Y.control,Q=!(!Z||!C),J=oqt().localStateObject,ee=lqt().stateConfig,te=bnt(),re=J||ee,ne=M?null===(r=null==re?void 0:re[M])||void 0===r?void 0:r.value:void 0,oe=M?null==te?void 0:te.getDmfValue(M):void 0,ae=e.useState(""),ie=ae[0],se=ae[1],le=parseFloat(_),ce=w?void 0:0,ue={required:!!i&&l,pattern:{value:w?/^-?\d*(\.\d+)?$/:/^\d*(\.\d+)?$/,message:u}};if(w||(ue.min={value:0,message:"Value cannot be less than zero"}),o){var de="",pe=(de=void 0!==oe?String(null!=oe?oe:""):Q?Y.watch(C)||"":ne)?function(e,t,r){if(!e)return"";var n=parseFloat(e);if(Number.isNaN(n))return e;if(!r&&n<0)return"0";if(t){var o=(t.split(".")[1]||"").length;if(o>0)return n.toFixed(o)}return e}(de,_,w):p||"-";return ct("div",X({style:X(X(X(X(X(X({display:"inline-flex",flexDirection:"column",marginLeft:D,marginTop:P,marginRight:j,marginBottom:N},H&&{width:H}),q&&{height:q}),G&&{minWidth:G}),K&&{maxWidth:K}),W&&{minHeight:W}),U&&{maxHeight:U})},$,{children:[d&&lt(Pm,X({sx:{fontSize:y,fontFamily:g,fontWeight:b,color:v,marginBottom:"4px"}},{children:d})),lt(Ic,X({sx:{fontSize:y,fontFamily:g,fontWeight:b,color:v,paddingLeft:F,paddingTop:I,paddingRight:L,paddingBottom:V,backgroundColor:h,border:"1px solid ".concat(f||"#ccc"),borderRadius:"4px",minWidth:"60px"}},{children:pe}))]}))}var he=X(X(X(X(X(X(X({backgroundColor:h,color:v,fontSize:y,fontFamily:g,fontWeight:b},H&&{width:H}),q&&{height:q}),G&&{minWidth:G}),K&&{maxWidth:K}),W&&{minHeight:W}),U&&{maxHeight:U}),{"& .MuiOutlinedInput-notchedOutline":{borderColor:f||"inherit"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:f||"inherit"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:f||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled .MuiOutlinedInput-notchedOutline":{borderColor:f||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled:hover .MuiOutlinedInput-notchedOutline":{borderColor:f||"inherit"}}),fe={color:v,"&.Mui-focused":{color:v}},me=X(X(X(X(X(X({},H&&{width:H}),q&&{height:q}),G&&{minWidth:G}),K&&{maxWidth:K}),W&&{minHeight:W}),U&&{maxHeight:U});return lt(hm,X({required:i,sx:X(X(X(X(X(X({marginLeft:D,marginTop:P,marginRight:j,marginBottom:N,width:"fit-content"},H&&{width:H}),q&&{height:q}),G&&{minWidth:G}),K&&{maxWidth:K}),W&&{minHeight:W}),U&&{maxHeight:U})},$,Q?{children:lt(AN,{name:C,rules:ue,control:Z,defaultValue:"",render:function(e){var t,r=e.field,n=e.fieldState;return lt(uLt,{errorMsg:null===(t=n.error)||void 0===t?void 0:t.message,label:d,placeholder:p,stepValue:le,minValue:ce,allowNegative:w,inputSx:he,labelSx:fe,sx:me,value:r.value||"",onChange:function(e){return r.onChange(e.target.value)}})}})}:{children:lt(uLt,{errorMsg:void 0,label:d,placeholder:p,stepValue:le,minValue:ce,allowNegative:w,inputSx:he,labelSx:fe,sx:me,value:ie,onChange:function(e){return se(e.target.value)}})}))},pLt=["+"," ","(",/[0-9]/,/[0-9]/,/[0-9]/,")"," ",/[0-9]/,/[0-9]/,/[0-9]/,"-",/[0-9]/,/[0-9]/,/[0-9]/,/[0-9]/],hLt=e.forwardRef(function(e,t){var r=e.inputRef,n=Z(e,["inputRef"]);return lt(V_,X({},n,{ref:function(e){"function"==typeof r&&r(e?e.inputElement:null)},mask:pLt,guide:!0,placeholderChar:" "}))});var fLt=function(e){var t=e.masked,r=e.errorMsg,n=e.inputSx,o=e.labelSx,a=Z(e,["masked","errorMsg","inputSx","labelSx"]);return lt(fk,X({},a,{variant:"outlined",error:!!r,helperText:r||null,slotProps:{input:X({sx:n},t?{inputComponent:hLt}:{}),inputLabel:{sx:o}}}))},mLt=function(t){var r,n=t.isDisplayOnly,o=void 0!==n&&n,a=t.required,i=void 0!==a&&a,s=t.requiredErrorText,l=void 0===s?"Phone is required":s,c=t.validationErrorText,u=void 0===c?"Invalid phone number":c,d=t.text,p=t.placeholderText,h=t.masked,f=void 0===h||h;t.multiLine;var m=t.backgroundColor,v=t.borderColor,y=t.textColor,g=void 0===y?"#000":y,b=t.fontSize,x=t.fontFamily,w=t.fontWeight;t.textAlign;var k=t.marginLeft,_=void 0===k?"0":k,C=t.marginTop,M=void 0===C?"0":C,S=t.marginRight,D=void 0===S?"0":S,O=t.marginBottom,P=void 0===O?"0":O,E=t.paddingLeft,j=void 0===E?"0":E,T=t.paddingTop,N=void 0===T?"0":T,R=t.paddingRight,F=void 0===R?"0":R,z=t.paddingBottom,I=void 0===z?"0":z,A=t.width,L=t.height,B=t.minHeight,V=t.maxHeight,H=t.minWidth,q=t.maxWidth,$=t.name,W=t.sourceDataModelField,U=t.configurationItemInfo,G=jN(),K=null==G?void 0:G.control,Y=!(!K||!$),Z=oqt().localStateObject,Q=lqt().stateConfig,J=bnt(),ee=Z||Q,te=W?null===(r=null==ee?void 0:ee[W])||void 0===r?void 0:r.value:void 0,re=W?null==J?void 0:J.getDmfValue(W):void 0,ne=e.useState(""),oe=ne[0],ae=ne[1],ie={required:!!i&&l,pattern:{value:/^\d{10}$/,message:u}};if(o){var se="";se=void 0!==re?String(null!=re?re:""):Y?G.watch($)||"":String(null!=te?te:"");var le=f?function(e){var t=(null!=e?e:"").replace(/\D+/g,"");if(!t)return"";var r="",n=0;return K_.forEach(function(e){"string"==typeof e?r+=e:n<t.length?(r+=t[n],n+=1):r+="_"}),r}(se):se,ce=le||p||"-";return ct("div",X({style:X(X(X(X(X(X({display:"inline-flex",flexDirection:"column",marginLeft:_,marginTop:M,marginRight:D,marginBottom:P},A&&{width:A}),L&&{height:L}),H&&{minWidth:H}),q&&{maxWidth:q}),B&&{minHeight:B}),V&&{maxHeight:V})},U,{children:[d&&lt(Pm,X({sx:{fontSize:b,fontFamily:x,fontWeight:w,color:g,marginLeft:0,marginBottom:"4px"}},{children:d})),lt(Ic,X({sx:{fontSize:b,fontFamily:x,fontWeight:w,color:g,paddingLeft:j,paddingTop:N,paddingRight:F,paddingBottom:I,backgroundColor:m,border:"1px solid ".concat(v||"#ccc"),borderRadius:"4px",minWidth:"120px"}},{children:ce}))]}))}var ue=X(X(X(X(X(X(X({backgroundColor:m,color:g,fontSize:b,fontFamily:x,fontWeight:w},A&&{width:A}),L&&{height:L}),H&&{minWidth:H}),q&&{maxWidth:q}),B&&{minHeight:B}),V&&{maxHeight:V}),{"& .MuiOutlinedInput-notchedOutline":{borderColor:v||"inherit"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:v||"inherit"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:v||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled .MuiOutlinedInput-notchedOutline":{borderColor:v||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled:hover .MuiOutlinedInput-notchedOutline":{borderColor:v||"inherit"}}),de={color:g,"&.Mui-focused":{color:g}},pe=X(X(X(X(X(X({marginLeft:_,marginTop:M,marginRight:D,marginBottom:P,width:"fit-content"},A&&{width:A}),L&&{height:L}),H&&{minWidth:H}),q&&{maxWidth:q}),B&&{minHeight:B}),V&&{maxHeight:V});return lt(hm,X({required:i,sx:X(X(X(X(X(X(X({},pe),A&&{width:A}),L&&{height:L}),H&&{minWidth:H}),q&&{maxWidth:q}),B&&{minHeight:B}),V&&{maxHeight:V})},U,Y?{children:lt(AN,{name:$,rules:ie,control:K,defaultValue:"",render:function(e){var t,r=e.field,n=e.fieldState;return lt(fLt,{masked:f,errorMsg:null===(t=n.error)||void 0===t?void 0:t.message,inputSx:ue,labelSx:de,label:d,placeholder:p,value:r.value||"",onChange:function(e){var t,n,o=(null!==(n=null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value)&&void 0!==n?n:"").toString().replace(/\D+/g,"");r.onChange(o)}})}})}:{children:lt(fLt,{masked:f,errorMsg:void 0,inputSx:ue,labelSx:de,label:d,placeholder:p,value:oe,onChange:function(e){var t,r,n=(null!==(r=null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value)&&void 0!==r?r:"").toString();ae(n.replace(/\D+/g,""))}})}))},vLt=function(t){var r=t.items,n=t.onTabChange,o=t.activeTabKey,a=t.isMobile,i=void 0!==a&&a,s=t.marginTop,l=t.marginRight,c=t.marginBottom,u=t.marginLeft,d=t.paddingTop,p=t.paddingRight,h=t.paddingBottom,f=t.paddingLeft,m=t.buttonPaddingTop,v=t.buttonPaddingRight,y=t.buttonPaddingBottom,g=t.buttonPaddingLeft,b=t.width,x=t.height,w=t.backgroundColor,k=t.borderRadius,_=t.elevation,C=void 0===_?1:_,M=t.gap,S=t.indicatorVisible,D=void 0===S||S,O=t.indicatorColor,P=t.lineWidth,E=void 0===P?"2px":P,j=t.orientation,T=void 0===j?"horizontal":j,N=t.activeTextColor,R=void 0===N?"#1976d2":N,F=t.inactiveTextColor,z=void 0===F?"#000":F,I=t.fontSize,A=t.fontWeight,L=t.fontFamily,B=t.wrapText,V=t.textAlign,H=t.iconName,q=t.iconColor,$=t.iconSize,W=t.iconPlacement,U=void 0===W?"left":W,G=t.hoverTextColor,K=t.itemBorder,Y=t.itemBorderRadius,Z=t.itemBackgroundColor,Q=t.itemSelectedBackgroundColor,J=t.itemHoverBackgroundColor,ee=t.selectedItemElevation,te=void 0===ee?0:ee,re=t.itemDisableRipple,ne=t.configurationItemInfo,oe=Qe(),ae=oqt(),ie=ae.isConfigurationMode,se=ae.onConfigurationItemClicked,le=ae.selectedConfigurationItemId,ce=e.useState(null),ue=ce[0],de=ce[1],pe=function(){return de(null)},he={marginTop:s,marginRight:l,marginBottom:c,marginLeft:u,paddingTop:d,paddingRight:p,paddingBottom:h,paddingLeft:f,width:b,height:x,backgroundColor:w,borderRadius:k,display:"flex",overflow:"visible !important"},fe=function(e){var t=e?R:z,r=e&&Q||Z;return{color:t,fontSize:I,fontWeight:A,fontFamily:L,textAlign:V,whiteSpace:B?"normal":"nowrap",border:K,borderRadius:Y,backgroundColor:r,boxShadow:e?oe.shadows[te]:void 0,paddingTop:m,paddingRight:v,paddingBottom:y,paddingLeft:g,"&:hover":{color:G||t,backgroundColor:J||r}}},me=function(e){null==n||n({newTabKey:e.tabKey,link:e.link})},ve=function(e){if(!ie)return{};var t=e.id===le,r={entityId:e.id,entity:"molecule_item",entityType:"tabs_item"};return{onClick:function(e){e.stopPropagation(),null==se||se(r,!1)},onDoubleClick:function(e){e.stopPropagation(),null==se||se(r,!0)},"data-organism-id":e.id,css:f$({theme:oe,selected:t})}};if(i)return ct(cl,X({elevation:C,style:he},ne,{children:[lt(yc,X({onClick:function(e){return de(e.currentTarget)}},{children:lt(mnt,{size:$,color:q,iconName:H})})),lt(ky,X({anchorEl:ue,open:Boolean(ue),onClose:pe},{children:r.map(function(e){var t=e.tabKey===o,r=fe(t);return ct(Dy,X({onClick:function(){me(e),pe()},sx:X(X({},r),{display:"flex",alignItems:"center"})},ve(e),{children:[e.iconName&&lt(mnt,{iconName:e.iconName,sx:{fontSize:I,color:t?R:z,mr:1}}),lt(nh,X({component:"span"},{children:e.label}))]}),e.id)})}))]}));var ye=r.findIndex(function(e){return e.tabKey===o});return lt(cl,X({elevation:C,style:he},ne,{children:lt(ck,X({value:ye<0?0:ye,onChange:function(e,t){return ie?null:me(r[t])},orientation:T,sx:{overflow:"visible","& .MuiTabs-flexContainer":{gap:M}},TabIndicatorProps:{style:D?{height:E,borderRadius:k,backgroundColor:O||R}:{display:"none"}}},{children:r.map(function(e){var t=e.tabKey===o,r=X(X({},fe(t)),{"&.Mui-selected":{color:t?R:z}});return lt(lw,X({label:e.label,disableRipple:re,sx:X(X({},r),{textTransform:"none"}),onClick:function(){return me(e)},iconPosition:"right"===U?"end":"start",icon:e.iconName?lt(mnt,{iconName:e.iconName,sx:{fontSize:I,color:t?R:z}}):void 0},ve(e)),e.id)})}))}))},yLt=function(t){var r,n,o,a,i=t.id,s=t.type,l=t.name,c=t.form,u=t.config;t.formData;var d=t.isMobile,p=t.children,h=t.tabsProps,f=t.properties,m=t.moleculeLibraryId,v=t.organismLibraryMoleculeId,y=Qe(),g=r_("xs"),b=d||g,x=oqt(),w=x.formId,k=x.isPreview,_=void 0!==k&&k,C=x.validations,M=x.submitHandler,S=x.isConfigurationMode,D=x.onConfigurationItemClicked,O=x.selectedConfigurationItemId,P=x.currentStyleProperties,E=x.currentContentProperties,j=x.onInternalNavigation;x.organismMetadata;var T=x.organismInfo,N=x.localState,R=lqt().stateConfig,F=k$().submitForm,z=pqt().forms,I=(null===(r=null==u?void 0:u.props)||void 0===r?void 0:r.dataCaptureName)||(null===(n=null==f?void 0:f.dataCapture)||void 0===n?void 0:n.dataCaptureName)||i,A=null===(o=null==f?void 0:f.dataCapture)||void 0===o?void 0:o.sourceDataModelFieldId,L=null===(a=null==f?void 0:f.dataCapture)||void 0===a?void 0:a.predefinedValue,B=O===i,V=nqt(),H=V.setActivePopUpById,q=V.setDrawerVisible,$=V.onCloseModal,W=V.onCloseDrawer,U=function(e){var t=e.stateListenerId,r=oqt().localStateObject,n=lqt().stateConfig,o=r||n,a=!0,i=!1;if(!t)return{isStateDisabled:i,isStateVisible:a};var s=(null==o?void 0:o[t])||{},l=s||{},c=l.visible,u=void 0===c||c,d=l.disabled,p=void 0!==d&&d;return t in o&&(a=Boolean(u),i=Boolean(p)),{isStateDisabled:i,isStateVisible:a,stateValue:s}}({stateListenerId:i}),G=U.isStateDisabled,K=U.isStateVisible,Y=e.useMemo(function(){return{entityType:s,entity:"molecule",entityName:l,entityId:i,organismLibraryMoleculeId:v,libraryEntityId:m}},[s,l,i,v,m]),ee=e.useCallback(function(e){null==e||e.stopPropagation(),D(Y,!1)},[D,Y]),te=e.useCallback(function(e){null==e||e.stopPropagation(),D(Y,!0)},[D,Y]),re=S?{onClick:ee,onDoubleClick:te,"data-configuration-id":i,css:f$({theme:y,selected:B})}:{},ne=S||G;if(!K)return null;return function(){var e,t,r,n,o,a,l,d,m;switch(s){case"simple_text":var v=v$(g={text:null==f?void 0:f.text},E,x=["text"],B).text,y=y$(null==u?void 0:u.props,P,B);return lt(fot,X({},y,{text:(null==v?void 0:v.text)||"",htmlElementId:i,configurationsItemInfo:re}));case"text":var g={text:null==f?void 0:f.text},x=Object.keys(g);v=v$(g,E,x,B).text,y=y$(null==u?void 0:u.props,P,B);return lt(hot,X({},v,y,{htmlElementId:i,configurationItemInfo:re}));case"consent":var k=v$(f,E,[],B);y=y$(null==u?void 0:u.props,P,B)||{};return lt(Nnt,X({},y,{htmlElementId:i,properties:k,configurationItemInfo:re}));case"signup_password_fields":g={text:null==f?void 0:f.text,subText:null==f?void 0:f.subText,placeholderText:null==f?void 0:f.placeholderText,subPlaceholderText:null==f?void 0:f.subPlaceholderText,validationText:null==f?void 0:f.validationText},x=Object.keys(g);var D=v$(g,E,x,B),V=y$(null==u?void 0:u.props,P,B),U=V.state,K=V.gap,Y=Z(V,["state","gap"]);return lt(Dot,{gap:K,inputProps:Y,validations:C||[],htmlElementId:i,validationState:U,overridesProperties:D,configurationItemInfo:re});case"stepper":var ee=y$(null==u?void 0:u.props,P,B),te=null==p?void 0:p.map(function(e){var t=O===e.id,r=e||{},n=r.properties,o=r.config,a=Z(r,["properties","config"]),i={title:null==n?void 0:n.title,subText:null==n?void 0:n.subText},s=Object.keys(i),l=v$(i,E,s,t),c=l.title,u=l.subText,d=y$(null==o?void 0:o.props,P,t);return X(X(X({},a),d),{title:(null==c?void 0:c.text)||"",subText:(null==u?void 0:u.text)||""})});return lt(tat,X({},ee,{items:te||[],isMobile:b,moleculeId:i,configurationItemInfo:re}));case"checklist":var oe=y$(null==u?void 0:u.props,P,B)||{},ae=null==p?void 0:p.map(function(e){var t,r,n,o,a,i=O===e.id,s=e||{},l=s.properties,c=s.config,u=Z(s,["properties","config"]);switch(e.type){case"checklist_item":var d={label:null==l?void 0:l.label,objectState:null==l?void 0:l.objectState},p=Object.keys(d),h=v$(d,E,p,i),f=y$(null==c?void 0:c.props,P,i)||{},m=(null===(t=h.label)||void 0===t?void 0:t.text)||"",v=!!(null===(r=h.objectState)||void 0===r?void 0:r.pmiObjectId);return X(X(X({},u),f),{type:"checklist_item",label:m,textColor:f.textColor||"#000",fontSize:f.fontSize||"14px",fontFamily:f.fontFamily||"inherit",fontWeight:f.fontWeight||"normal",textAlign:f.textAlign||"left",isSystemDriven:v,disabled:v,interacted:(null===(n=null==R?void 0:R[e.id])||void 0===n?void 0:n.interacted)||"unchecked"});case"divider_item":f=y$(null==c?void 0:c.props,P,i)||{};return X(X(X({},u),f),{type:"divider_item"});case"text_item":d={text:null==l?void 0:l.text},p=Object.keys(d),h=v$(d,E,p,i),f=y$(null==c?void 0:c.props,P,i)||{};var y=(null===(o=h.text)||void 0===o?void 0:o.text)||"";return X(X(X({},u),f),{type:"text_item",text:y});case"rich_text_item":d={text:null==l?void 0:l.text},p=Object.keys(d),h=v$(d,E,p,i),f=y$(null==c?void 0:c.props,P,i)||{},y=(null===(a=h.text)||void 0===a?void 0:a.text)||Bqt;return X(X(X({},u),f),{type:"rich_text_item",text:y});default:return X(X({},u),{type:e.type})}});return lt(jnt,X({},oe,{items:ae||[],moleculeId:i,configurationItemInfo:re}));case"accordion":var ie=y$(null==u?void 0:u.props,P,B);ae=null==p?void 0:p.map(function(e){var t=O===e.id,r=e||{},n=r.properties,o=r.config,a=Z(r,["properties","config"]),i={text:null==n?void 0:n.text,subText:null==n?void 0:n.subText,bodyText:null==n?void 0:n.bodyText},s=Object.keys(i),l=v$(i,E,s,t),c=l.text,u=l.subText,d=l.bodyText,p=y$(null==o?void 0:o.props,P,t);return X(X(X({},a),p),{text:(null==c?void 0:c.text)||"",subText:(null==u?void 0:u.text)||"",bodyText:(null==d?void 0:d.text)||""})});return lt(gat,X({},ie,{items:ae||[],moleculeId:i,configurationItemInfo:re}));case"menu":g={text:null==f?void 0:f.text,disabled:null==f?void 0:f.disabled},x=Object.keys(g);var se=v$(g,E,x,B),le=se.text,ce=se.disabled,ue=y$(null==u?void 0:u.props,P,B);ae=null==p?void 0:p.map(function(e){var t,r=O===e.id,n=e||{},o=n.properties,a=n.config,i=Z(n,["properties","config"]),s={disabled:o&&"disabled"in o?o.disabled:void 0,text:o&&"text"in o?o.text:void 0,link:o&&"link"in o?o.link:void 0},l=Object.keys(s),c=v$(s,E,l,r),u=c.text,d=c.disabled,p=c.link,h=y$(null==a?void 0:a.props,P,r);return X(X(X({},i),h),{disabled:(null==R?void 0:R[e.id])?null===(t=null==R?void 0:R[e.id])||void 0===t?void 0:t.disabled:(null==d?void 0:d.value)||(null==h?void 0:h.disabled)||!1,text:(null==u?void 0:u.text)||"Menu Item",link:p})});return lt(cLt,X({},ue,{items:ae||[],moleculeId:i,buttonText:(null==le?void 0:le.text)||"Open Menu",configurationItemInfo:re,buttonDisabled:(null==R?void 0:R[i])?null===(e=null==R?void 0:R[i])||void 0===e?void 0:e.disabled:(null==ce?void 0:ce.value)||(null==ue?void 0:ue.disabled)||!1}));case"tabs":y=y$(null==u?void 0:u.props,P,B);var de=null==p?void 0:p.map(function(e){var t=O===e.id,r=e||{},n=r.properties,o=r.config,a={label:null==n?void 0:n.label,link:null==n?void 0:n.link},i=Object.keys(a),s=v$(a,E,i,t),l=s.label,c=s.link,u=y$(null==o?void 0:o.props,P,t);return X(X({},u),{id:e.id,tabKey:P$(c)?D$(a$,null==c?void 0:c.internalLink):void 0,label:(null==l?void 0:l.text)||"",link:c})}),pe=null==h?void 0:h.tabs.map(function(e){var t=e.text,r=Z(e,["text"]);return X(X({},r),{label:t||""})}),he=Boolean(null==y?void 0:y.isTabsSystemDerived),fe=he?pe:de,me=(null==h?void 0:h.activeTabKey)||(null===(t=null==fe?void 0:fe[0])||void 0===t?void 0:t.tabKey)||"";return lt(vLt,X({},y,{items:fe||[],isMobile:b,moleculeId:i,activeTabKey:me,configurationItemInfo:re,onTabChange:S?void 0:function(e){var t,r=e.newTabKey,n=e.link;he?null===(t=null==h?void 0:h.onTabChange)||void 0===t||t.call(h,r):P$(n)?null==j||j({link:(null==n?void 0:n.internalLink)||""}):O$(null==n?void 0:n.externalLink)}}));case"divider":y=y$(null==u?void 0:u.props,P,B);return lt(uot,X({moleculeId:i,configurationItemInfo:re},y));case"link":g={text:null==f?void 0:f.text,link:null==f?void 0:f.link},x=Object.keys(g);var ve=v$(g,E,x,B),ye=(v=ve.text,ve.link);y=y$(null==u?void 0:u.props,P,B);return lt(_ot,X({moleculeId:i},y,{type:null==ye?void 0:ye.type,src:ne?void 0:j$(ye,_)||"",text:(null==v?void 0:v.text)||"",disabled:(null==y?void 0:y.disabled)||G,configurationItemInfo:re}));case"video":g={video:null==f?void 0:f.video,coverImage:null==f?void 0:f.coverImage},x=Object.keys(g);var ge=v$(g,E,x,B),be=ge.video,xe=ge.coverImage;y=y$(null==u?void 0:u.props,P,B);return lt(iat,X({},y,{moleculeId:i,poster:null===(r=null==xe?void 0:xe.imageFile)||void 0===r?void 0:r.url,src:null!==(a=null!==(n=null==be?void 0:be.videoSource)&&void 0!==n?n:null===(o=null==be?void 0:be.videoFile)||void 0===o?void 0:o.url)&&void 0!==a?a:"",configurationItemInfo:re}));case"badge":y=y$(null==u?void 0:u.props,P,B);return lt(ynt,X({},y,{configurationItemInfo:re}));case"alert":g={text:null==f?void 0:f.text,subText:null==f?void 0:f.subText},x=Object.keys(g);var we=v$(g,E,x,B),ke=(v=we.text,we.subText);y=y$(null==u?void 0:u.props,P,B);return lt(vnt,X({text:(null==v?void 0:v.text)||"",subText:(null==ke?void 0:ke.text)||""},y,{configurationItemInfo:re}));case"chip":g={text:null==f?void 0:f.text},x=Object.keys(g),v=v$(g,E,x,B).text,y=y$(null==u?void 0:u.props,P,B);return lt(Tnt,X({text:(null==v?void 0:v.text)||""},y,{configurationItemInfo:re}));case"email_display_field":case"email_input_field":g={text:null==f?void 0:f.text,placeholderText:null==f?void 0:f.placeholderText,required:null==f?void 0:f.required,requiredErrorText:null==f?void 0:f.requiredErrorText,validationErrorText:null==f?void 0:f.validationErrorText},x=Object.keys(g);var _e=v$(g,E,x,B),Ce=(v=_e.text,_e.placeholderText),Me=_e.required,Se=_e.requiredErrorText,De=_e.validationErrorText;y=y$(null==u?void 0:u.props,P,B);return lt(sLt,X({name:I,text:(null==v?void 0:v.text)||"",placeholderText:(null==Ce?void 0:Ce.text)||"",sourceDataModelField:A,required:null==Me?void 0:Me.value,isDisplayOnly:"email_display_field"===s,requiredErrorText:null==Se?void 0:Se.text,validationErrorText:null==De?void 0:De.text},y,{configurationItemInfo:re}));case"phone_number_display_field":case"phone_number_input_field":g={text:null==f?void 0:f.text,placeholderText:null==f?void 0:f.placeholderText,required:null==f?void 0:f.required,requiredErrorText:null==f?void 0:f.requiredErrorText,validationErrorText:null==f?void 0:f.validationErrorText},x=Object.keys(g);var Oe=v$(g,E,x,B);v=Oe.text,Ce=Oe.placeholderText,Me=Oe.required,Se=Oe.requiredErrorText,De=Oe.validationErrorText,y=y$(null==u?void 0:u.props,P,B);return lt(mLt,X({name:I,text:(null==v?void 0:v.text)||"",required:null==Me?void 0:Me.value,requiredErrorText:null==Se?void 0:Se.text,validationErrorText:null==De?void 0:De.text,placeholderText:(null==Ce?void 0:Ce.text)||"",sourceDataModelField:A,isDisplayOnly:"phone_number_display_field"===s},y,{configurationItemInfo:re}));case"numeric_display_field":case"numeric_input_field":g={text:null==f?void 0:f.text,placeholderText:null==f?void 0:f.placeholderText,required:null==f?void 0:f.required,requiredErrorText:null==f?void 0:f.requiredErrorText,validationErrorText:null==f?void 0:f.validationErrorText},x=Object.keys(g);var Pe=v$(g,E,x,B);v=Pe.text,Ce=Pe.placeholderText,Me=Pe.required,Se=Pe.requiredErrorText,De=Pe.validationErrorText,y=y$(null==u?void 0:u.props,P,B);return lt(dLt,X({name:I,text:(null==v?void 0:v.text)||"",required:null==Me?void 0:Me.value,isDisplayOnly:"numeric_display_field"===s,requiredErrorText:null==Se?void 0:Se.text,validationErrorText:null==De?void 0:De.text,placeholderText:(null==Ce?void 0:Ce.text)||"",sourceDataModelField:A},y,{configurationItemInfo:re}));case"currency_display_field":case"currency_input_field":g={text:null==f?void 0:f.text,placeholderText:null==f?void 0:f.placeholderText,required:null==f?void 0:f.required,requiredErrorText:null==f?void 0:f.requiredErrorText,validationErrorText:null==f?void 0:f.validationErrorText},x=Object.keys(g);var Ee=v$(g,E,x,B);v=Ee.text,Ce=Ee.placeholderText,Me=Ee.required,Se=Ee.requiredErrorText,De=Ee.validationErrorText,y=y$(null==u?void 0:u.props,P,B);return lt(oLt,X({name:I,text:(null==v?void 0:v.text)||"",required:null==Me?void 0:Me.value,isDisplayOnly:"currency_display_field"===s,requiredErrorText:null==Se?void 0:Se.text,validationErrorText:null==De?void 0:De.text,placeholderText:(null==Ce?void 0:Ce.text)||"",sourceDataModelField:A},y,{configurationItemInfo:re}));case"basic_text_display_field":case"basic_text_field":g={text:null==f?void 0:f.text,placeholderText:null==f?void 0:f.placeholderText,required:null==f?void 0:f.required,requiredErrorText:null==f?void 0:f.requiredErrorText,validationErrorText:null==f?void 0:f.validationErrorText},x=Object.keys(g);var je=v$(g,E,x,B);v=je.text,Ce=je.placeholderText,Me=je.required,Se=je.requiredErrorText,De=je.validationErrorText,y=y$(null==u?void 0:u.props,P,B);return lt(knt,X({name:I,text:(null==v?void 0:v.text)||"",required:null==Me?void 0:Me.value,isDisplayOnly:"basic_text_display_field"===s,requiredErrorText:null==Se?void 0:Se.text,validationErrorText:null==De?void 0:De.text,placeholderText:(null==Ce?void 0:Ce.text)||"",sourceDataModelField:A},y,{configurationItemInfo:re}));case"rating_display_field":case"rating":g={text:null==f?void 0:f.text,dataCapture:null==f?void 0:f.dataCapture,required:null==f?void 0:f.required,requiredErrorText:null==f?void 0:f.requiredErrorText,validationErrorText:null==f?void 0:f.validationErrorText},x=Object.keys(g);var Te=v$(g,E,x,B);v=Te.text,Me=Te.required,Se=Te.requiredErrorText,De=Te.validationErrorText,y=y$(null==u?void 0:u.props,P,B);return lt(Wot,X({name:I,text:(null==v?void 0:v.text)||"",required:null==Me?void 0:Me.value,requiredErrorText:null==Se?void 0:Se.text,validationErrorText:null==De?void 0:De.text,sourceDataModelField:A,isDisplayOnly:"rating_display_field"===s},y,{configurationItemInfo:re}));case"switch_display_field":case"switch":g={text:null==f?void 0:f.text,required:null==f?void 0:f.required,requiredErrorText:null==f?void 0:f.requiredErrorText,validationErrorText:null==f?void 0:f.validationErrorText},x=Object.keys(g);var Ne=v$(g,E,x,B);v=Ne.text,Me=Ne.required,Se=Ne.requiredErrorText,De=Ne.validationErrorText,y=y$(null==u?void 0:u.props,P,B);return lt(nat,X({name:I,moleculeId:i,text:(null==v?void 0:v.text)||"",required:null==Me?void 0:Me.value,isDisplayOnly:"switch_display_field"===s,requiredErrorText:null==Se?void 0:Se.text,validationErrorText:null==De?void 0:De.text,sourceDataModelField:A},y,{configurationItemInfo:re}));case"slider_display_field":case"slider":g={text:null==f?void 0:f.text,required:null==f?void 0:f.required,placeholderText:null==f?void 0:f.placeholderText,requiredErrorText:null==f?void 0:f.requiredErrorText,validationErrorText:null==f?void 0:f.validationErrorText},x=Object.keys(g);var Re=v$(g,E,x,B);v=Re.text,Me=Re.required,Se=Re.requiredErrorText,De=Re.validationErrorText,Ce=Re.placeholderText,y=y$(null==u?void 0:u.props,P,B);return lt(eat,X({name:I,text:(null==v?void 0:v.text)||"",required:null==Me?void 0:Me.value,isDisplayOnly:"slider_display_field"===s,requiredErrorText:null==Se?void 0:Se.text,validationErrorText:null==De?void 0:De.text,placeholderText:null==Ce?void 0:Ce.text,sourceDataModelField:A},y,{configurationItemInfo:re}));case"date_display_field":case"date_picker":g={text:null==f?void 0:f.text,required:null==f?void 0:f.required,placeholderText:null==f?void 0:f.placeholderText,requiredErrorText:null==f?void 0:f.requiredErrorText,validationErrorText:null==f?void 0:f.validationErrorText},x=Object.keys(g);var Fe=v$(g,E,x,B);v=Fe.text,Me=Fe.required,Ce=Fe.placeholderText,Se=Fe.requiredErrorText,De=Fe.validationErrorText,y=y$(null==u?void 0:u.props,P,B);return lt(OR,X({dateAdapter:Zq},{children:lt(cot,X({moleculeId:i,name:I,text:(null==v?void 0:v.text)||"",required:null==Me?void 0:Me.value,placeholderText:(null==Ce?void 0:Ce.text)||"",isDisplayOnly:"date_display_field"===s,requiredErrorText:null==Se?void 0:Se.text,validationErrorText:null==De?void 0:De.text,sourceDataModelField:A},y,{configurationItemInfo:re}))}));case"time_picker_display":case"time_picker":g={text:null==f?void 0:f.text,placeholderText:null==f?void 0:f.placeholderText,requiredErrorText:null==f?void 0:f.requiredErrorText,validationErrorText:null==f?void 0:f.validationErrorText,required:null==f?void 0:f.required},x=Object.keys(g);var ze=v$(g,E,x,B),Ie=(v=ze.text,Ce=ze.placeholderText,Se=ze.requiredErrorText,De=ze.validationErrorText,Me=ze.required,y$(null==u?void 0:u.props,P,B));return lt(OR,X({dateAdapter:Zq},{children:lt(aat,X({},Ie,{name:I,text:(null==v?void 0:v.text)||"",placeholderText:(null==Ce?void 0:Ce.text)||"",required:null==Me?void 0:Me.value,requiredErrorText:null==Se?void 0:Se.text,validationErrorText:null==De?void 0:De.text,isDisplayOnly:"time_picker_display"===s,sourceDataModelField:A,configurationItemInfo:re}))}));case"select_display_field":case"select":g={text:null==f?void 0:f.text,required:null==f?void 0:f.required,placeholderText:null==f?void 0:f.placeholderText,requiredErrorText:null==f?void 0:f.requiredErrorText,validationErrorText:null==f?void 0:f.validationErrorText},x=Object.keys(g);var Ae=v$(g,E,x,B),Le=(v=Ae.text,Me=Ae.required,Ce=Ae.placeholderText,Se=Ae.requiredErrorText,De=Ae.validationErrorText,y=y$(null==u?void 0:u.props,P,B),"select_display_field"===s);return lt(Uot,X({name:I,text:(null==v?void 0:v.text)||"",required:null==Me?void 0:Me.value,isDisplayOnly:Le,predefinedValue:L,placeholderText:(null==Ce?void 0:Ce.text)||"",requiredErrorText:null==Se?void 0:Se.text,validationErrorText:null==De?void 0:De.text,sourceDataModelField:A},y,{configurationItemInfo:re}));case"image":g={image:null==f?void 0:f.image,link:null==f?void 0:f.link},x=Object.keys(g);var Be=v$(g,E,x,B),Ve=Be.image,He=Be.link,qe=(y=y$(null==u?void 0:u.props,P,B),(null==Ve?void 0:Ve.imageSource)||(null===(l=null==Ve?void 0:Ve.imageFile)||void 0===l?void 0:l.url)||(null===(d=null==Ve?void 0:Ve.imageFile)||void 0===d?void 0:d.id)||"");return lt(dot,X({},y,{src:qe,onClick:function(){return P$(He)?null==j?void 0:j({link:(null==He?void 0:He.internalLink)||""}):O$(null==He?void 0:He.externalLink)},moleculeId:i,configurationItemInfo:re,properties:{image:Ve,link:He}}));case"button":g={text:null==f?void 0:f.text,action:null==f?void 0:f.action},x=Object.keys(g);var $e=v$(g,E,x,B),We=(v=$e.text,$e.action),Ue=(y=y$(null==u?void 0:u.props,P,B),(We&&We.action?We.action:We)||(f&&f.action&&f.action.action?f.action.action:null==f?void 0:f.action)),Ge=(null==Ue?void 0:Ue.type)||"link",Ke="navigate_to_create_form"!==Ge&&"navigate_to_edit_form"!==Ge&&"navigate_to_prepopulate_form"!==Ge&&"navigate_to_organism_with_rwo_context"!==Ge&&"navigate_to_page_with_rwo_context"!==Ge||!(null==Ue?void 0:Ue[Ge])?void 0:Ue[Ge],Ye=(null==Ke?void 0:Ke.link)||(null==Ue?void 0:Ue.link),Xe=null==Ue?void 0:Ue.popup,Ze=null==Ue?void 0:Ue.download,Qe=null==Ue?void 0:Ue.submit,Je=(null==Ke?void 0:Ke.targetFormId)||(null==Ue?void 0:Ue.targetFormId),et=(null==Ke?void 0:Ke.fieldMap)||(null==Ue?void 0:Ue.fieldMap),tt={link:function(){if(P$(Ye)){var e={};return(null==Ye?void 0:Ye.targetFormId)&&(e.organismId=String(null==Ye?void 0:Ye.targetFormId)),(null==Ye?void 0:Ye.rwoKey)&&(e.rwo=String(null==Ye?void 0:Ye.rwoKey)),void j({link:(null==Ye?void 0:Ye.internalLink)||"",query:e})}O$(null==Ye?void 0:Ye.externalLink)},popup:function(){(null==Xe?void 0:Xe.id)&&H(null==Xe?void 0:Xe.id)},drawer:function(){q(!0)},download:function(){return Ze?function(e,t){return void 0===e&&(e=""),void 0===t&&(t="Downloaded file"),Q(void 0,void 0,void 0,function(){var r,n,o,a;return J(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,fetch(e)];case 1:return[4,i.sent().blob()];case 2:return r=i.sent(),n=URL.createObjectURL(r),(o=document.createElement("a")).href=n,o.download=t,o.click(),URL.revokeObjectURL(n),[3,4];case 3:return a=i.sent(),wUt({message:"Failed to download the file: ".concat(a),type:"error"}),[3,4];case 4:return[2]}})})}(Ze.url,Ze.name):wUt({message:"File not found to download",type:"warning"})},submit:null==c?void 0:c.handleSubmit(function(e){return Q(void 0,void 0,void 0,function(){var t,r,n,o,a;return J(this,function(i){switch(i.label){case 0:return i.trys.push([0,6,,7]),w?M?[4,M({formId:w,data:e})]:[3,2]:[3,5];case 1:return i.sent(),[3,4];case 2:return(null==z?void 0:z.submit)?[4,F({formId:w,data:e})]:[3,4];case 3:i.sent(),i.label=4;case 4:(t=null===(o=null==Qe?void 0:Qe.onSuccess)||void 0===o?void 0:o.link)&&(P$(t)?(n={},(null==t?void 0:t.rwoKey)&&(n.rwo=String(null==t?void 0:t.rwoKey)),null==j||j({link:t.internalLink||"",query:n})):O$(t.externalLink)),c.reset(),i.label=5;case 5:return[3,7];case 6:return i.sent(),(r=null===(a=null==Qe?void 0:Qe.onError)||void 0===a?void 0:a.link)&&(P$(r)?(n={},(null==r?void 0:r.rwoKey)&&(n.rwo=String(null==r?void 0:r.rwoKey)),null==j||j({link:r.internalLink||"",query:n})):O$(r.externalLink)),[3,7];case 7:return[2]}})})}),reset:function(){return null==c?void 0:c.reset()},destroy:function(){null==c||c.reset(),null==$||$(),null==W||W()},navigate_to_create_form:function(){var e=(null==Ye?void 0:Ye.internalLink)||"";if(Je||e){var t=e||"?organismId=".concat(encodeURIComponent(String(Je)));null==j||j({link:t})}},navigate_to_edit_form:function(){var e=(null==Ye?void 0:Ye.internalLink)||"";if(Je||e){var t=(null==T?void 0:T.id)||"",r=(null==e?void 0:e.includes("?"))?"&":"?",n=e?"".concat(e).concat(r,"rwoRecordId=").concat(encodeURIComponent(String(t))):"?organismId=".concat(encodeURIComponent(String(Je)),"&rwoRecordId=").concat(encodeURIComponent(String(t))),o={};(null==Ye?void 0:Ye.rwoKey)&&(o.rwo=String(null==Ye?void 0:Ye.rwoKey)),null==j||j({link:n,query:o})}},navigate_to_prepopulate_form:function(){try{var e=(null==Ye?void 0:Ye.internalLink)||"";if(!Je&&!e)return;var t=Array.isArray(et)?et:[],r=Boolean((null==c?void 0:c.getValues)&&"function"==typeof c.getValues)?null==c?void 0:c.getValues():{},n={};R&&"object"==typeof R&&Object.entries(R).forEach(function(e){var t,r=e[0],o=e[1],a=null!==(t=null==o?void 0:o.value)&&void 0!==t?t:o;n[r]=a});var o=Object.keys(n).length>0?n:r,a={};t.filter(function(e){return(null==e?void 0:e.source)&&(null==e?void 0:e.destination)}).forEach(function(e){var t=function(e,t){if(e&&t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];for(var r=t.split("."),n=e,o=0;o<r.length;o+=1){if(null==n||"object"!=typeof n)return;n=n[r[o]]}return n}}(o,String(e.source));void 0!==t&&(a[String(e.destination)]=t)});var i=e||(Je?"?organismId=".concat(encodeURIComponent(String(Je))):""),s={};Je&&(s.organismId=String(Je)),null==j||j({link:i||e,state:{prefill:a,targetFormId:Je},query:s})}catch(e){}},navigate_to_organism_with_rwo_context:function(){var e,t,r=null==Ke?void 0:Ke.sourceDataModelFieldId,n=(null==Ke?void 0:Ke.targetOrganismIds)||[];if(!r||0===n.length)return console.error("❌ Action not properly configured:",{sourceDataModelFieldId:r,targetOrganismIds:n.length}),void wUt({message:"Navigate to Organism action is not properly configured",type:"error"});if(N&&N[r]){var o=N[r];t=String("object"==typeof o&&o&&"id"in o?o.id:o)}if(!t&&R&&"object"==typeof R)try{if(Object.prototype.hasOwnProperty.call(R,r)){var a=R[r];t=String("object"==typeof a&&a&&"id"in a?a.id:a||"")}else{var i=_$(R,r);t=String("object"==typeof i&&i&&"id"in i?i.id:i||"")}}catch(e){console.warn("Error accessing stateObject:",e)}if(console.log({rwoRecordId:t,formValues:null==c?void 0:c.getValues()}),!t&&c&&"function"==typeof c.getValues)try{var s=c.getValues();if(s&&"object"==typeof s)if(Object.prototype.hasOwnProperty.call(s,r)){a=s[r];t=String("object"==typeof a&&a&&"id"in a?a.id:a||"")}else{i=_$(s,r);t=String("object"==typeof i&&i&&"id"in i?i.id:i||"")}}catch(e){console.warn("Error accessing form values:",e)}!t&&r&&(t=String(r));var l={};if(t&&Array.isArray(n)&&n.length>0){var u={};n.forEach(function(e){u[e]||(u[e]={}),u[e].rwoRecordId=String(t),r&&(u[e][String(r)]=String(t))}),l.rwoContext=C$(u),l.rwoRecordId=String(t)}var d=new URL((null===(e=null===window||void 0===window?void 0:window.location)||void 0===e?void 0:e.href)||"/"),p=d.pathname;"function"==typeof j&&j({link:p,query:l,currentLocation:{pathname:d.pathname,search:d.search}})},navigate_to_page_with_rwo_context:function(){var e,t=null==Ke?void 0:Ke.internalLink,r=!1!==(null==Ke?void 0:Ke.includeRwoRecordId),n=Array.isArray(null==Ke?void 0:Ke.rwoContextMapping)?Ke.rwoContextMapping:[];if(!(null==t?void 0:t.internalLink))return console.error("❌ navigate_to_page_with_rwo_context: Missing internalLink"),void wUt({message:"Navigate to page action is not properly configured",type:"error"});var o=function(e){if(e&&"object"==typeof e){for(var t=0,r=["id","recordId","rwoRecordId","uuid"];t<r.length;t++){var n=r[t];if(e[n]){var o=e[n];return String("object"==typeof o&&o&&"id"in o?o.id:o)}}for(var a=0,i=Object.entries(e);a<i.length;a++){var s=i[a];if(s[0],"string"==typeof(o=s[1])&&o.length>0)return o;if("object"==typeof o&&o&&"id"in o)return String(o.id)}}};if(r&&(e=o(N)),!e&&r&&R&&(e=o(R)),!e&&r&&c&&"function"==typeof c.getValues)try{e=o(c.getValues())}catch(e){console.warn("Error accessing form values:",e)}var a=X(X(X({},N||{}),R||{}),c&&"function"==typeof c.getValues?c.getValues():{}),i=composeRwoParamsV2({includeRwoRecordId:r,recordId:e,mapping:n,contextSource:a}).query;"function"==typeof j&&j({link:t.internalLink,query:i})}};return lt(_nt,X({moleculeId:i,text:(null==v?void 0:v.text)||""},y,{disabled:(null==y?void 0:y.disabled)||G,onClick:null==tt?void 0:tt[Ge],configurationItemInfo:re,properties:{text:v,action:We}}));case"avatar":y=y$(null==u?void 0:u.props,P,B);return lt(bat,X({},y,{sourceDataModelField:A,configurationItemInfo:re}));case"calendar":y=y$(null==u?void 0:u.props,P,B);return lt(tLt,X({},y,{configurationItemInfo:re}));case"drawer":g={text:null==f?void 0:f.text,disabled:null==f?void 0:f.disabled},x=Object.keys(g);var rt=v$(g,E,x,B),nt=rt.text,ot=rt.disabled,at=y$(null==u?void 0:u.props,P,B);ae=null==p?void 0:p.map(function(e){var t,r,n,o,a,i,s,l,c,u=O===e.id,d=e||{},p=d.properties,h=d.config,f=Z(d,["properties","config"]),m={},v=[];switch(e.type){case"menu_item":var y=p;m={disabled:null==y?void 0:y.disabled,text:null==y?void 0:y.text,link:null==y?void 0:y.link},v=Object.keys(m);break;case"text_item":var g=p;m={text:null==g?void 0:g.text},v=Object.keys(m);break;case"rich_text_item":var b=p;m={text:null==b?void 0:b.text},v=Object.keys(m);break;case"image_item":var x=p;m={image:null==x?void 0:x.image,alt:null==x?void 0:x.alt,link:null==x?void 0:x.link},v=Object.keys(m);break;default:m={},v=[]}var w=v$(m,E,v,u),k=y$(null==h?void 0:h.props,P,u),_=X(X({},f),k);switch(e.type){case"menu_item":return X(X({},_),{disabled:(null==R?void 0:R[e.id])?null===(t=null==R?void 0:R[e.id])||void 0===t?void 0:t.disabled:(null===(r=null==w?void 0:w.disabled)||void 0===r?void 0:r.value)||(null==k?void 0:k.disabled)||!1,text:(null===(n=null==w?void 0:w.text)||void 0===n?void 0:n.text)||"Menu Item",link:null==w?void 0:w.link});case"text_item":return X(X({},_),{text:(null===(o=null==w?void 0:w.text)||void 0===o?void 0:o.text)||""});case"rich_text_item":return X(X({},_),{text:(null===(a=null==w?void 0:w.text)||void 0===a?void 0:a.text)||Bqt});case"image_item":var C=(null===(i=null==w?void 0:w.image)||void 0===i?void 0:i.imageSource)||(null===(l=null===(s=null==w?void 0:w.image)||void 0===s?void 0:s.imageFile)||void 0===l?void 0:l.url)||"";return X(X({},_),{src:C,alt:(null===(c=null==w?void 0:w.alt)||void 0===c?void 0:c.text)||"Drawer image",link:null==w?void 0:w.link});default:return _}});return lt(kot,X({},at,{items:ae||[],moleculeId:i,buttonText:(null==nt?void 0:nt.text)||(null==at?void 0:at.buttonText),buttonDisabled:(null==R?void 0:R[i])?null===(m=null==R?void 0:R[i])||void 0===m?void 0:m.disabled:(null==ot?void 0:ot.value)||(null==at?void 0:at.disabled)||!1,configurationItemInfo:re}));case"speed_dial":var it=y$(null==u?void 0:u.props,P,B);ae=null==p?void 0:p.map(function(e){var t=O===e.id,r=e||{},n=r.properties,o=r.config,a=Z(r,["properties","config"]),i={link:null==n?void 0:n.link,text:null==n?void 0:n.text},s=Object.keys(i),l=v$(i,E,s,t),c=y$(null==o?void 0:o.props,P,t);return X(X({},a),{config:{props:X(X(X({},null==o?void 0:o.props),c),{tooltipText:(null==c?void 0:c.tooltipText)||""})},properties:{link:(null==l?void 0:l.link)||(null==n?void 0:n.link),text:(null==l?void 0:l.text)||(null==n?void 0:n.text)}})});return lt(yat,X({},it,{items:ae||[],moleculeId:i,configurationItemInfo:re}));case"checkbox":case"checkbox_display":g={label:null==f?void 0:f.label,required:null==f?void 0:f.required,requiredErrorText:null==f?void 0:f.requiredErrorText,validationErrorText:null==f?void 0:f.validationErrorText},x=Object.keys(g);var ct=v$(g,E,x,B),ut=ct.label;Me=ct.required,Se=ct.requiredErrorText,De=ct.validationErrorText,y=y$(null==u?void 0:u.props,P,B);return lt(hat,X({name:I,moleculeId:i,label:(null==ut?void 0:ut.text)||"",required:null==Me?void 0:Me.value,requiredErrorText:null==Se?void 0:Se.text,validationErrorText:null==De?void 0:De.text,sourceDataModelField:A,isDisplayOnly:"checkbox_display"===s},y,{configurationItemInfo:re}));case"binary_radio_buttons":case"binary_radio_buttons_display":g={confirmText:null==f?void 0:f.confirmText,rejectText:null==f?void 0:f.rejectText,required:null==f?void 0:f.required,requiredErrorText:null==f?void 0:f.requiredErrorText,validationErrorText:null==f?void 0:f.validationErrorText},x=Object.keys(g);var dt=v$(g,E,x,B),pt=dt.confirmText,ht=dt.rejectText;Me=dt.required,Se=dt.requiredErrorText,De=dt.validationErrorText,y=y$(null==u?void 0:u.props,P,B);return lt(pat,X({name:I,moleculeId:i,confirmText:(null==pt?void 0:pt.text)||"Yes",rejectText:(null==ht?void 0:ht.text)||"No",required:null==Me?void 0:Me.value,requiredErrorText:null==Se?void 0:Se.text,validationErrorText:null==De?void 0:De.text,sourceDataModelField:A,isDisplayOnly:"binary_radio_buttons_display"===s},y,{configurationItemInfo:re}));case"date_calendar":case"date_calendar_display":g={required:null==f?void 0:f.required,requiredErrorText:null==f?void 0:f.requiredErrorText,validationErrorText:null==f?void 0:f.validationErrorText},x=Object.keys(g);var ft=v$(g,E,x,B);Me=ft.required,Se=ft.requiredErrorText,De=ft.validationErrorText,Ie=y$(null==u?void 0:u.props,P,B);return lt(Hnt,X({},Ie,{name:I,required:null==Me?void 0:Me.value,requiredErrorText:null==Se?void 0:Se.text,validationErrorText:null==De?void 0:De.text,isDisplayOnly:"date_calendar_display"===s,sourceDataModelField:A,configurationItemInfo:re}));default:return lt(st,{children:"There is no such type of molecule yet."})}}()},gLt={},bLt={},xLt={},wLt={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;e.default={animating:!1,autoplaying:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,dragging:!1,edgeDragged:!1,initialized:!1,lazyLoadedList:[],listHeight:null,listWidth:null,scrolling:!1,slideCount:null,slideHeight:null,slideWidth:null,swipeLeft:null,swiped:!1,swiping:!1,touchObject:{startX:0,startY:0,curX:0,curY:0},trackStyle:{},trackWidth:0,targetSlide:0}}(wLt);var kLt=/^\s+|\s+$/g,_Lt=/^[-+]0x[0-9a-f]+$/i,CLt=/^0b[01]+$/i,MLt=/^0o[0-7]+$/i,SLt=parseInt,DLt="object"==typeof ne&&ne&&ne.Object===Object&&ne,OLt="object"==typeof self&&self&&self.Object===Object&&self,PLt=DLt||OLt||Function("return this")(),ELt=Object.prototype.toString,jLt=Math.max,TLt=Math.min,NLt=function(){return PLt.Date.now()};function RLt(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function FLt(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==ELt.call(e)}(e))return NaN;if(RLt(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=RLt(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(kLt,"");var r=CLt.test(e);return r||MLt.test(e)?SLt(e.slice(2),r?2:8):_Lt.test(e)?NaN:+e}var zLt=function(e,t,r){var n,o,a,i,s,l,c=0,u=!1,d=!1,p=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function h(t){var r=n,a=o;return n=o=void 0,c=t,i=e.apply(a,r)}function f(e){var r=e-l;return void 0===l||r>=t||r<0||d&&e-c>=a}function m(){var e=NLt();if(f(e))return v(e);s=setTimeout(m,function(e){var r=t-(e-l);return d?TLt(r,a-(e-c)):r}(e))}function v(e){return s=void 0,p&&n?h(e):(n=o=void 0,i)}function y(){var e=NLt(),r=f(e);if(n=arguments,o=this,l=e,r){if(void 0===s)return function(e){return c=e,s=setTimeout(m,t),u?h(e):i}(l);if(d)return s=setTimeout(m,t),h(l)}return void 0===s&&(s=setTimeout(m,t)),i}return t=FLt(t)||0,RLt(r)&&(u=!!r.leading,a=(d="maxWait"in r)?jLt(FLt(r.maxWait)||0,t):a,p="trailing"in r?!!r.trailing:p),y.cancel=function(){void 0!==s&&clearTimeout(s),c=0,n=l=o=s=void 0},y.flush=function(){return void 0===s?i:v(NLt())},y},ILt={exports:{}};
9638
+ */function Ust(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(null==e||e(n),!1===r||!n.defaultPrevented)return null==t?void 0:t(n)}}function Gst(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function Kst(...e){return t=>{let r=!1;const n=e.map(e=>{const n=Gst(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():Gst(e[t],null)}}}}function Yst(...e){return s.useCallback(Kst(...e),e)}function Xst(e,r=[]){let n=[];const o=()=>{const t=n.map(e=>s.createContext(e));return function(r){const n=(null==r?void 0:r[e])||t;return s.useMemo(()=>({[`__scope${e}`]:{...r,[e]:n}}),[r,n])}};return o.scopeName=e,[function(r,o){const a=s.createContext(o),i=n.length;n=[...n,o];const l=r=>{var n;const{scope:o,children:l,...c}=r,u=(null==(n=null==o?void 0:o[e])?void 0:n[i])||a,d=s.useMemo(()=>c,Object.values(c));return t.jsx(u.Provider,{value:d,children:l})};return l.displayName=r+"Provider",[l,function(t,n){var l;const c=(null==(l=null==n?void 0:n[e])?void 0:l[i])||a,u=s.useContext(c);if(u)return u;if(void 0!==o)return o;throw new Error(`\`${t}\` must be used within \`${r}\``)}]},Zst(o,...r)]}function Zst(...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 s.useMemo(()=>({[`__scope${t.scopeName}`]:n}),[n])}};return r.scopeName=t.scopeName,r}var Qst=null!=globalThis&&globalThis.document?s.useLayoutEffect:()=>{},Jst=s[" useId ".trim().toString()]||(()=>{}),elt=0;function tlt(e){const[t,r]=s.useState(Jst());return Qst(()=>{r(e=>e??String(elt++))},[e]),t?`radix-${t}`:""}var rlt=s[" useInsertionEffect ".trim().toString()]||Qst;function nlt({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,a,i]=function({defaultProp:e,onChange:t}){const[r,n]=s.useState(e),o=s.useRef(r),a=s.useRef(t);return rlt(()=>{a.current=t},[t]),s.useEffect(()=>{var e;o.current!==r&&(null==(e=a.current)||e.call(a,r),o.current=r)},[r,o]),[r,n,a]}({defaultProp:t,onChange:r}),l=void 0!==e,c=l?e:o;{const t=s.useRef(void 0!==e);s.useEffect(()=>{const e=t.current;e!==l&&console.warn(`${n} is changing from ${e?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. 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=l},[l,n])}const u=s.useCallback(t=>{var r;if(l){const n=function(e){return"function"==typeof e}(t)?t(e):t;n!==e&&(null==(r=i.current)||r.call(i,n))}else a(t)},[l,e,a,i]);return[c,u]}function olt(e){const r=ilt(e),n=s.forwardRef((e,n)=>{const{children:o,...a}=e,i=s.Children.toArray(o),l=i.find(clt);if(l){const e=l.props.children,o=i.map(t=>t===l?s.Children.count(e)>1?s.Children.only(null):s.isValidElement(e)?e.props.children:null:t);return t.jsx(r,{...a,ref:n,children:s.isValidElement(e)?s.cloneElement(e,void 0,o):null})}return t.jsx(r,{...a,ref:n,children:o})});return n.displayName=`${e}.Slot`,n}var alt=olt("Slot");function ilt(e){const t=s.forwardRef((e,t)=>{const{children:r,...n}=e;if(s.isValidElement(r)){const e=function(e){var t,r;let n=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,o=n&&"isReactWarning"in n&&n.isReactWarning;return o?e.ref:(n=null==(r=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:r.get,o=n&&"isReactWarning"in n&&n.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}(r),o=function(e,t){const r={...t};for(const n in t){const o=e[n],a=t[n];/^on[A-Z]/.test(n)?o&&a?r[n]=(...e)=>{const t=a(...e);return o(...e),t}:o&&(r[n]=o):"style"===n?r[n]={...o,...a}:"className"===n&&(r[n]=[o,a].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==s.Fragment&&(o.ref=t?Kst(t,e):e),s.cloneElement(r,o)}return s.Children.count(r)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var slt=Symbol("radix.slottable");function llt(e){const r=({children:e})=>t.jsx(t.Fragment,{children:e});return r.displayName=`${e}.Slottable`,r.__radixId=slt,r}function clt(e){return s.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===slt}var ult=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,r)=>{const n=olt(`Primitive.${r}`),o=s.forwardRef((e,o)=>{const{asChild:a,...i}=e,s=a?n:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),t.jsx(s,{...i,ref:o})});return o.displayName=`Primitive.${r}`,{...e,[r]:o}},{});function dlt(e,t){e&&d.flushSync(()=>e.dispatchEvent(t))}function plt(e){const t=s.useRef(e);return s.useEffect(()=>{t.current=e}),s.useMemo(()=>(...e)=>{var r;return null==(r=t.current)?void 0:r.call(t,...e)},[])}var hlt,flt="dismissableLayer.update",mlt="dismissableLayer.pointerDownOutside",vlt="dismissableLayer.focusOutside",ylt=s.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),glt=s.forwardRef((e,r)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:l,onDismiss:c,...u}=e,d=s.useContext(ylt),[p,h]=s.useState(null),f=(null==p?void 0:p.ownerDocument)??(null==globalThis?void 0:globalThis.document),[,m]=s.useState({}),v=Yst(r,e=>h(e)),y=Array.from(d.layers),[g]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=y.indexOf(g),x=p?y.indexOf(p):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,k=x>=b,_=function(e,t=(null==globalThis?void 0:globalThis.document)){const r=plt(e),n=s.useRef(!1),o=s.useRef(()=>{});return s.useEffect(()=>{const e=e=>{if(e.target&&!n.current){let n=function(){wlt(mlt,r,a,{discrete:!0})};const a={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=n,t.addEventListener("click",o.current,{once:!0})):n()}else t.removeEventListener("click",o.current);n.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}(e=>{const t=e.target,r=[...d.branches].some(e=>e.contains(t));!k||r||(null==a||a(e),null==l||l(e),e.defaultPrevented||null==c||c())},f),C=function(e,t=(null==globalThis?void 0:globalThis.document)){const r=plt(e),n=s.useRef(!1);return s.useEffect(()=>{const e=e=>{e.target&&!n.current&&wlt(vlt,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))||(null==i||i(e),null==l||l(e),e.defaultPrevented||null==c||c())},f);return function(e,t=(null==globalThis?void 0:globalThis.document)){const r=plt(e);s.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&&(null==o||o(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))},f),s.useEffect(()=>{if(p)return n&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(hlt=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),xlt(),()=>{n&&1===d.layersWithOutsidePointerEventsDisabled.size&&(f.body.style.pointerEvents=hlt)}},[p,f,n,d]),s.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),xlt())},[p,d]),s.useEffect(()=>{const e=()=>m({});return document.addEventListener(flt,e),()=>document.removeEventListener(flt,e)},[]),t.jsx(ult.div,{...u,ref:v,style:{pointerEvents:w?k?"auto":"none":void 0,...e.style},onFocusCapture:Ust(e.onFocusCapture,C.onFocusCapture),onBlurCapture:Ust(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:Ust(e.onPointerDownCapture,_.onPointerDownCapture)})});glt.displayName="DismissableLayer";var blt=s.forwardRef((e,r)=>{const n=s.useContext(ylt),o=s.useRef(null),a=Yst(r,o);return s.useEffect(()=>{const e=o.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),t.jsx(ult.div,{...e,ref:a})});function xlt(){const e=new CustomEvent(flt);document.dispatchEvent(e)}function wlt(e,t,r,{discrete:n}){const o=r.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?dlt(o,a):o.dispatchEvent(a)}blt.displayName="DismissableLayerBranch";var klt="focusScope.autoFocusOnMount",_lt="focusScope.autoFocusOnUnmount",Clt={bubbles:!1,cancelable:!0},Mlt=s.forwardRef((e,r)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...l}=e,[c,u]=s.useState(null),d=plt(a),p=plt(i),h=s.useRef(null),f=Yst(r,e=>u(e)),m=s.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;s.useEffect(()=>{if(o){let e=function(e){if(m.paused||!c)return;const t=e.target;c.contains(t)?h.current=t:Plt(h.current,{select:!0})},t=function(e){if(m.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||Plt(h.current,{select:!0}))},r=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&Plt(c)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const n=new MutationObserver(r);return c&&n.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),n.disconnect()}}},[o,c,m.paused]),s.useEffect(()=>{if(c){Elt.add(m);const e=document.activeElement;if(!c.contains(e)){const t=new CustomEvent(klt,Clt);c.addEventListener(klt,d),c.dispatchEvent(t),t.defaultPrevented||(function(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Plt(n,{select:t}),document.activeElement!==r)return}(function(e){return e.filter(e=>"A"!==e.tagName)}(Slt(c)),{select:!0}),document.activeElement===e&&Plt(c))}return()=>{c.removeEventListener(klt,d),setTimeout(()=>{const t=new CustomEvent(_lt,Clt);c.addEventListener(_lt,p),c.dispatchEvent(t),t.defaultPrevented||Plt(e??document.body,{select:!0}),c.removeEventListener(_lt,p),Elt.remove(m)},0)}}},[c,d,p,m]);const v=s.useCallback(e=>{if(!n&&!o||m.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,r=document.activeElement;if(t&&r){const t=e.currentTarget,[o,a]=function(e){const t=Slt(e),r=Dlt(t,e),n=Dlt(t.reverse(),e);return[r,n]}(t);o&&a?e.shiftKey||r!==a?e.shiftKey&&r===o&&(e.preventDefault(),n&&Plt(a,{select:!0})):(e.preventDefault(),n&&Plt(o,{select:!0})):r===t&&e.preventDefault()}},[n,o,m.paused]);return t.jsx(ult.div,{tabIndex:-1,...l,ref:f,onKeyDown:v})});function Slt(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 Dlt(e,t){for(const r of e)if(!Olt(r,{upTo:t}))return r}function Olt(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 Plt(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()}}Mlt.displayName="FocusScope";var Elt=function(){let e=[];return{add(t){const r=e[0];t!==r&&(null==r||r.pause()),e=jlt(e,t),e.unshift(t)},remove(t){var r;e=jlt(e,t),null==(r=e[0])||r.resume()}}}();function jlt(e,t){const r=[...e],n=r.indexOf(t);return-1!==n&&r.splice(n,1),r}var Tlt=s.forwardRef((e,r)=>{var n;const{container:o,...a}=e,[i,l]=s.useState(!1);Qst(()=>l(!0),[]);const c=o||i&&(null==(n=null==globalThis?void 0:globalThis.document)?void 0:n.body);return c?u.default.createPortal(t.jsx(ult.div,{...a,ref:r}),c):null});Tlt.displayName="Portal";var Nlt=e=>{const{present:t,children:r}=e,n=function(e){const[t,r]=s.useState(),n=s.useRef(null),o=s.useRef(e),a=s.useRef("none"),i=e?"mounted":"unmounted",[l,c]=function(e,t){return s.useReducer((e,r)=>t[e][r]??e,e)}(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return s.useEffect(()=>{const e=Rlt(n.current);a.current="mounted"===l?e:"none"},[l]),Qst(()=>{const t=n.current,r=o.current;if(r!==e){const n=a.current,i=Rlt(t);e?c("MOUNT"):"none"===i||"none"===(null==t?void 0:t.display)?c("UNMOUNT"):c(r&&n!==i?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),Qst(()=>{if(t){let e;const r=t.ownerDocument.defaultView??window,i=a=>{const i=Rlt(n.current).includes(a.animationName);if(a.target===t&&i&&(c("ANIMATION_END"),!o.current)){const n=t.style.animationFillMode;t.style.animationFillMode="forwards",e=r.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=n)})}},s=e=>{e.target===t&&(a.current=Rlt(n.current))};return t.addEventListener("animationstart",s),t.addEventListener("animationcancel",i),t.addEventListener("animationend",i),()=>{r.clearTimeout(e),t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",i),t.removeEventListener("animationend",i)}}c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:s.useCallback(e=>{n.current=e?getComputedStyle(e):null,r(e)},[])}}(t),o="function"==typeof r?r({present:n.isPresent}):s.Children.only(r),a=Yst(n.ref,function(e){var t,r;let n=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,o=n&&"isReactWarning"in n&&n.isReactWarning;return o?e.ref:(n=null==(r=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:r.get,o=n&&"isReactWarning"in n&&n.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}(o));return"function"==typeof r||n.isPresent?s.cloneElement(o,{ref:a}):null};function Rlt(e){return(null==e?void 0:e.animationName)||"none"}Nlt.displayName="Presence";var Flt=0;function zlt(){s.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ilt()),document.body.insertAdjacentElement("beforeend",e[1]??Ilt()),Flt++,()=>{1===Flt&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Flt--}},[])}function Ilt(){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 Alt=function(){return Alt=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Alt.apply(this,arguments)};function Llt(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 o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}function Blt(e,t,r){if(r||2===arguments.length)for(var n,o=0,a=t.length;o<a;o++)(n||!(o in t))&&(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}var Vlt="right-scroll-bar-position",Hlt="width-before-scroll-bar";function qlt(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var $lt=typeof window<"u"?s.useLayoutEffect:s.useEffect,Wlt=new WeakMap;function Ult(t,r){var n=function(t,r){var n=e.useState(function(){return{value:t,callback:r,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=r,n.facade}(null,function(e){return t.forEach(function(t){return qlt(t,e)})});return $lt(function(){var e=Wlt.get(n);if(e){var r=new Set(e),o=new Set(t),a=n.current;r.forEach(function(e){o.has(e)||qlt(e,null)}),o.forEach(function(e){r.has(e)||qlt(e,a)})}Wlt.set(n,t)},[t]),n}function Glt(e){return e}function Klt(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=Glt);var r=[],n=!1,o={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 o=t(e,n);return r.push(o),function(){r=r.filter(function(e){return e!==o})}},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 o=r;r=[],o.forEach(e),t=r}var a=function(){var r=t;t=[],r.forEach(e)},i=function(){return Promise.resolve().then(a)};i(),r={push:function(e){t.push(e),i()},filter:function(e){return t=t.filter(e),r}}}};return o}(null);return t.options=Alt({async:!0,ssr:!1},e),t}var Ylt=function(e){var t=e.sideCar,r=Llt(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 s.createElement(n,Alt({},r))};function Xlt(e,t){return e.useMedium(t),Ylt}Ylt.isSideCarExport=!0;var Zlt=Klt(),Qlt=function(){},Jlt=s.forwardRef(function(e,t){var r=s.useRef(null),n=s.useState({onScrollCapture:Qlt,onWheelCapture:Qlt,onTouchMoveCapture:Qlt}),o=n[0],a=n[1],i=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,p=e.shards,h=e.sideCar,f=e.noRelative,m=e.noIsolation,v=e.inert,y=e.allowPinchZoom,g=e.as,b=void 0===g?"div":g,x=e.gapMode,w=Llt(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=h,_=Ult([r,t]),C=Alt(Alt({},w),o);return s.createElement(s.Fragment,null,d&&s.createElement(k,{sideCar:Zlt,removeScrollBar:u,shards:p,noRelative:f,noIsolation:m,inert:v,setCallbacks:a,allowPinchZoom:!!y,lockRef:r,gapMode:x}),i?s.cloneElement(s.Children.only(l),Alt(Alt({},C),{ref:_})):s.createElement(b,Alt({},C,{className:c,ref:_}),l))});Jlt.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Jlt.classNames={fullWidth:Hlt,zeroRight:Vlt};function ect(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var tct=function(){var e=0,t=null;return{add:function(r){0==e&&(t=ect())&&(function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}(t,r),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},rct=function(){var e=function(){var e=tct();return function(t,r){s.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}}();return function(t){var r=t.styles,n=t.dynamic;return e(r,n),null}},nct={left:0,top:0,right:0,gap:0},oct=function(e){return parseInt(e||"",10)||0},act=function(e){if(void 0===e&&(e="margin"),typeof window>"u")return nct;var t=function(e){var t=window.getComputedStyle(document.body),r=t["padding"===e?"paddingLeft":"marginLeft"],n=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[oct(r),oct(n),oct(o)]}(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])}},ict=rct(),sct="data-scroll-locked",lct=function(e,t,r,n){var o=e.left,a=e.top,i=e.right,s=e.gap;return void 0===r&&(r="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(n,";\n padding-right: ").concat(s,"px ").concat(n,";\n }\n body[").concat(sct,"] {\n overflow: hidden ").concat(n,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(n,";"),"margin"===r&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(a,"px;\n padding-right: ").concat(i,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(s,"px ").concat(n,";\n "),"padding"===r&&"padding-right: ".concat(s,"px ").concat(n,";")].filter(Boolean).join(""),"\n }\n \n .").concat(Vlt," {\n right: ").concat(s,"px ").concat(n,";\n }\n \n .").concat(Hlt," {\n margin-right: ").concat(s,"px ").concat(n,";\n }\n \n .").concat(Vlt," .").concat(Vlt," {\n right: 0 ").concat(n,";\n }\n \n .").concat(Hlt," .").concat(Hlt," {\n margin-right: 0 ").concat(n,";\n }\n \n body[").concat(sct,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n }\n")},cct=function(){var e=parseInt(document.body.getAttribute(sct)||"0",10);return isFinite(e)?e:0},uct=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=void 0===n?"margin":n;s.useEffect(function(){return document.body.setAttribute(sct,(cct()+1).toString()),function(){var e=cct()-1;e<=0?document.body.removeAttribute(sct):document.body.setAttribute(sct,e.toString())}},[]);var a=s.useMemo(function(){return act(o)},[o]);return s.createElement(ict,{styles:lct(a,!t,o,r?"":"!important")})},dct=!1;if(typeof window<"u")try{var pct=Object.defineProperty({},"passive",{get:function(){return dct=!0,!0}});window.addEventListener("test",pct,pct),window.removeEventListener("test",pct,pct)}catch{dct=!1}var hct=!!dct&&{passive:!1},fct=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])},mct=function(e,t){var r=t.ownerDocument,n=t;do{if(typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host),vct(e,n)){var o=yct(e,n);if(o[1]>o[2])return!0}n=n.parentNode}while(n&&n!==r.body);return!1},vct=function(e,t){return"v"===e?function(e){return fct(e,"overflowY")}(t):function(e){return fct(e,"overflowX")}(t)},yct=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)},gct=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},bct=function(e){return[e.deltaX,e.deltaY]},xct=function(e){return e&&"current"in e?e.current:e},wct=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},kct=0,_ct=[];function Cct(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Mct=Xlt(Zlt,function(e){var t=s.useRef([]),r=s.useRef([0,0]),n=s.useRef(),o=s.useState(kct++)[0],a=s.useState(rct)[0],i=s.useRef(e);s.useEffect(function(){i.current=e},[e]),s.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=Blt([e.lockRef.current],(e.shards||[]).map(xct),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=s.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!i.current.allowPinchZoom;var o,a=gct(e),s=r.current,l="deltaX"in e?e.deltaX:s[0]-a[0],c="deltaY"in e?e.deltaY:s[1]-a[1],u=e.target,d=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var p=mct(d,u);if(!p)return!0;if(p?o=d:(o="v"===d?"h":"v",p=mct(d,u)),!p)return!1;if(!n.current&&"changedTouches"in e&&(l||c)&&(n.current=o),!o)return!0;var h=n.current||o;return function(e,t,r,n){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),a=o*n,i=r.target,s=t.contains(i),l=!1,c=a>0,u=0,d=0;do{if(!i)break;var p=yct(e,i),h=p[0],f=p[1]-p[2]-o*h;(h||f)&&vct(e,i)&&(u+=f,d+=h);var m=i.parentNode;i=m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE?m.host:m}while(!s&&i!==document.body||s&&(t.contains(i)||t===i));return(c&&Math.abs(u)<1||!c&&Math.abs(d)<1)&&(l=!0),l}(h,t,e,"h"===h?l:c)},[]),c=s.useCallback(function(e){var r=e;if(_ct.length&&_ct[_ct.length-1]===a){var n="deltaY"in r?bct(r):gct(r),o=t.current.filter(function(e){return e.name===r.type&&(e.target===r.target||r.target===e.shadowParent)&&function(e,t){return e[0]===t[0]&&e[1]===t[1]}(e.delta,n)})[0];if(o&&o.should)return void(r.cancelable&&r.preventDefault());if(!o){var s=(i.current.shards||[]).map(xct).filter(Boolean).filter(function(e){return e.contains(r.target)});(s.length>0?l(r,s[0]):!i.current.noIsolation)&&r.cancelable&&r.preventDefault()}}},[]),u=s.useCallback(function(e,r,n,o){var a={name:e,delta:r,target:n,should:o,shadowParent:Cct(n)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=s.useCallback(function(e){r.current=gct(e),n.current=void 0},[]),p=s.useCallback(function(t){u(t.type,bct(t),t.target,l(t,e.lockRef.current))},[]),h=s.useCallback(function(t){u(t.type,gct(t),t.target,l(t,e.lockRef.current))},[]);s.useEffect(function(){return _ct.push(a),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:h}),document.addEventListener("wheel",c,hct),document.addEventListener("touchmove",c,hct),document.addEventListener("touchstart",d,hct),function(){_ct=_ct.filter(function(e){return e!==a}),document.removeEventListener("wheel",c,hct),document.removeEventListener("touchmove",c,hct),document.removeEventListener("touchstart",d,hct)}},[]);var f=e.removeScrollBar,m=e.inert;return s.createElement(s.Fragment,null,m?s.createElement(a,{styles:wct(o)}):null,f?s.createElement(uct,{noRelative:e.noRelative,gapMode:e.gapMode}):null)});var Sct=s.forwardRef(function(e,t){return s.createElement(Jlt,Alt({},e,{ref:t,sideCar:Mct}))});Sct.classNames=Jlt.classNames;var Dct=new WeakMap,Oct=new WeakMap,Pct={},Ect=0,jct=function(e){return e&&(e.host||jct(e.parentNode))},Tct=function(e,t,r,n){var o=function(e,t){return t.map(function(t){if(e.contains(t))return t;var r=jct(t);return r&&e.contains(r)?r:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(e){return!!e})}(t,Array.isArray(e)?e:[e]);Pct[r]||(Pct[r]=new WeakMap);var a=Pct[r],i=[],s=new Set,l=new Set(o),c=function(e){!e||s.has(e)||(s.add(e),c(e.parentNode))};o.forEach(c);var u=function(e){!e||l.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(n),o=null!==t&&"false"!==t,l=(Dct.get(e)||0)+1,c=(a.get(e)||0)+1;Dct.set(e,l),a.set(e,c),i.push(e),1===l&&o&&Oct.set(e,!0),1===c&&e.setAttribute(r,"true"),o||e.setAttribute(n,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return u(t),s.clear(),Ect++,function(){i.forEach(function(e){var t=Dct.get(e)-1,o=a.get(e)-1;Dct.set(e,t),a.set(e,o),t||(Oct.has(e)||e.removeAttribute(n),Oct.delete(e)),o||e.removeAttribute(r)}),--Ect||(Dct=new WeakMap,Dct=new WeakMap,Oct=new WeakMap,Pct={})}},Nct=function(e,t,r){void 0===r&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=function(e){return typeof document>"u"?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),Tct(n,o,r,"aria-hidden")):function(){return null}},Rct="Dialog",[Fct,zct]=Xst(Rct),[Ict,Act]=Fct(Rct),Lct=e=>{const{__scopeDialog:r,children:n,open:o,defaultOpen:a,onOpenChange:i,modal:l=!0}=e,c=s.useRef(null),u=s.useRef(null),[d,p]=nlt({prop:o,defaultProp:a??!1,onChange:i,caller:Rct});return t.jsx(Ict,{scope:r,triggerRef:c,contentRef:u,contentId:tlt(),titleId:tlt(),descriptionId:tlt(),open:d,onOpenChange:p,onOpenToggle:s.useCallback(()=>p(e=>!e),[p]),modal:l,children:n})};Lct.displayName=Rct;var Bct="DialogTrigger",Vct=s.forwardRef((e,r)=>{const{__scopeDialog:n,...o}=e,a=Act(Bct,n),i=Yst(r,a.triggerRef);return t.jsx(ult.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":sut(a.open),...o,ref:i,onClick:Ust(e.onClick,a.onOpenToggle)})});Vct.displayName=Bct;var Hct="DialogPortal",[qct,$ct]=Fct(Hct,{forceMount:void 0}),Wct=e=>{const{__scopeDialog:r,forceMount:n,children:o,container:a}=e,i=Act(Hct,r);return t.jsx(qct,{scope:r,forceMount:n,children:s.Children.map(o,e=>t.jsx(Nlt,{present:n||i.open,children:t.jsx(Tlt,{asChild:!0,container:a,children:e})}))})};Wct.displayName=Hct;var Uct="DialogOverlay",Gct=s.forwardRef((e,r)=>{const n=$ct(Uct,e.__scopeDialog),{forceMount:o=n.forceMount,...a}=e,i=Act(Uct,e.__scopeDialog);return i.modal?t.jsx(Nlt,{present:o||i.open,children:t.jsx(Yct,{...a,ref:r})}):null});Gct.displayName=Uct;var Kct=olt("DialogOverlay.RemoveScroll"),Yct=s.forwardRef((e,r)=>{const{__scopeDialog:n,...o}=e,a=Act(Uct,n);return t.jsx(Sct,{as:Kct,allowPinchZoom:!0,shards:[a.contentRef],children:t.jsx(ult.div,{"data-state":sut(a.open),...o,ref:r,style:{pointerEvents:"auto",...o.style}})})}),Xct="DialogContent",Zct=s.forwardRef((e,r)=>{const n=$ct(Xct,e.__scopeDialog),{forceMount:o=n.forceMount,...a}=e,i=Act(Xct,e.__scopeDialog);return t.jsx(Nlt,{present:o||i.open,children:i.modal?t.jsx(Qct,{...a,ref:r}):t.jsx(Jct,{...a,ref:r})})});Zct.displayName=Xct;var Qct=s.forwardRef((e,r)=>{const n=Act(Xct,e.__scopeDialog),o=s.useRef(null),a=Yst(r,n.contentRef,o);return s.useEffect(()=>{const e=o.current;if(e)return Nct(e)},[]),t.jsx(eut,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ust(e.onCloseAutoFocus,e=>{var t;e.preventDefault(),null==(t=n.triggerRef.current)||t.focus()}),onPointerDownOutside:Ust(e.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:Ust(e.onFocusOutside,e=>e.preventDefault())})}),Jct=s.forwardRef((e,r)=>{const n=Act(Xct,e.__scopeDialog),o=s.useRef(!1),a=s.useRef(!1);return t.jsx(eut,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{var r,i;null==(r=e.onCloseAutoFocus)||r.call(e,t),t.defaultPrevented||(o.current||null==(i=n.triggerRef.current)||i.focus(),t.preventDefault()),o.current=!1,a.current=!1},onInteractOutside:t=>{var r,i;null==(r=e.onInteractOutside)||r.call(e,t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(a.current=!0));const s=t.target;(null==(i=n.triggerRef.current)?void 0:i.contains(s))&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&a.current&&t.preventDefault()}})}),eut=s.forwardRef((e,r)=>{const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:i,...l}=e,c=Act(Xct,n),u=s.useRef(null),d=Yst(r,u);return zlt(),t.jsxs(t.Fragment,{children:[t.jsx(Mlt,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:i,children:t.jsx(glt,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":sut(c.open),...l,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),t.jsxs(t.Fragment,{children:[t.jsx(dut,{titleId:c.titleId}),t.jsx(put,{contentRef:u,descriptionId:c.descriptionId})]})]})}),tut="DialogTitle",rut=s.forwardRef((e,r)=>{const{__scopeDialog:n,...o}=e,a=Act(tut,n);return t.jsx(ult.h2,{id:a.titleId,...o,ref:r})});rut.displayName=tut;var nut="DialogDescription",out=s.forwardRef((e,r)=>{const{__scopeDialog:n,...o}=e,a=Act(nut,n);return t.jsx(ult.p,{id:a.descriptionId,...o,ref:r})});out.displayName=nut;var aut="DialogClose",iut=s.forwardRef((e,r)=>{const{__scopeDialog:n,...o}=e,a=Act(aut,n);return t.jsx(ult.button,{type:"button",...o,ref:r,onClick:Ust(e.onClick,()=>a.onOpenChange(!1))})});function sut(e){return e?"open":"closed"}iut.displayName=aut;var lut="DialogTitleWarning",[cut,uut]=function(e,r){const n=s.createContext(r),o=e=>{const{children:r,...o}=e,a=s.useMemo(()=>o,Object.values(o));return t.jsx(n.Provider,{value:a,children:r})};return o.displayName=e+"Provider",[o,function(t){const o=s.useContext(n);if(o)return o;if(void 0!==r)return r;throw new Error(`\`${t}\` must be used within \`${e}\``)}]}(lut,{contentName:Xct,titleName:tut,docsSlug:"dialog"}),dut=({titleId:e})=>{const t=uut(lut),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 s.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},put=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${uut("DialogDescriptionWarning").contentName}}.`;return s.useEffect(()=>{var n;const o=null==(n=e.current)?void 0:n.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},hut=Lct,fut=Vct,mut=Wct,vut=Gct,yut=Zct,gut=rut,but=out,xut=iut;function wut(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=wut(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function kut(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=wut(e))&&(n&&(n+=" "),n+=t);return n}const _ut=e=>{const t=Dut(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:e=>{const r=e.split("-");return""===r[0]&&1!==r.length&&r.shift(),Cut(r,t)||Sut(e)},getConflictingClassGroupIds:(e,t)=>{const o=r[e]||[];return t&&n[e]?[...o,...n[e]]:o}}},Cut=(e,t)=>{var r;if(0===e.length)return t.classGroupId;const n=e[0],o=t.nextPart.get(n),a=o?Cut(e.slice(1),o):void 0;if(a)return a;if(0===t.validators.length)return;const i=e.join("-");return null==(r=t.validators.find(({validator:e})=>e(i)))?void 0:r.classGroupId},Mut=/^\[(.+)\]$/,Sut=e=>{if(Mut.test(e)){const t=Mut.exec(e)[1],r=null==t?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Dut=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return jut(Object.entries(e.classGroups),r).forEach(([e,r])=>{Out(r,n,e,t)}),n},Out=(e,t,r,n)=>{e.forEach(e=>{if("string"==typeof e){return void((""===e?t:Put(t,e)).classGroupId=r)}if("function"==typeof e)return Eut(e)?void Out(e(n),t,r,n):void t.validators.push({validator:e,classGroupId:r});Object.entries(e).forEach(([e,o])=>{Out(o,Put(t,e),r,n)})})},Put=(e,t)=>{let r=e;return t.split("-").forEach(e=>{r.nextPart.has(e)||r.nextPart.set(e,{nextPart:new Map,validators:[]}),r=r.nextPart.get(e)}),r},Eut=e=>e.isThemeGetter,jut=(e,t)=>t?e.map(([e,r])=>{const n=r.map(e=>"string"==typeof e?t+e:"object"==typeof e?Object.fromEntries(Object.entries(e).map(([e,r])=>[t+e,r])):e);return[e,n]}):e,Tut=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const o=(o,a)=>{r.set(o,a),t++,t>e&&(t=0,n=r,r=new Map)};return{get(e){let t=r.get(e);return void 0!==t?t:void 0!==(t=n.get(e))?(o(e,t),t):void 0},set(e,t){r.has(e)?r.set(e,t):o(e,t)}}},Nut=e=>{const{separator:t,experimentalParseClassName:r}=e,n=1===t.length,o=t[0],a=t.length,i=e=>{const r=[];let i,s=0,l=0;for(let c=0;c<e.length;c++){let u=e[c];if(0===s){if(u===o&&(n||e.slice(c,c+a)===t)){r.push(e.slice(l,c)),l=c+a;continue}if("/"===u){i=c;continue}}"["===u?s++:"]"===u&&s--}const c=0===r.length?e:e.substring(l),u=c.startsWith("!");return{modifiers:r,hasImportantModifier:u,baseClassName:u?c.substring(1):c,maybePostfixModifierPosition:i&&i>l?i-l:void 0}};return r?e=>r({className:e,parseClassName:i}):i},Rut=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(e=>{"["===e[0]?(t.push(...r.sort(),e),r=[]):r.push(e)}),t.push(...r.sort()),t},Fut=/\s+/;function zut(){let e,t,r=0,n="";for(;r<arguments.length;)(e=arguments[r++])&&(t=Iut(e))&&(n&&(n+=" "),n+=t);return n}const Iut=e=>{if("string"==typeof e)return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Iut(e[n]))&&(r&&(r+=" "),r+=t);return r};function Aut(e,...t){let r,n,o,a=function(s){const l=t.reduce((e,t)=>t(e),e());return r=(e=>({cache:Tut(e.cacheSize),parseClassName:Nut(e),..._ut(e)}))(l),n=r.cache.get,o=r.cache.set,a=i,i(s)};function i(e){const t=n(e);if(t)return t;const a=((e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o}=t,a=[],i=e.trim().split(Fut);let s="";for(let e=i.length-1;e>=0;e-=1){const t=i[e],{modifiers:l,hasImportantModifier:c,baseClassName:u,maybePostfixModifierPosition:d}=r(t);let p=!!d,h=n(p?u.substring(0,d):u);if(!h){if(!p){s=t+(s.length>0?" "+s:s);continue}if(h=n(u),!h){s=t+(s.length>0?" "+s:s);continue}p=!1}const f=Rut(l).join(":"),m=c?f+"!":f,v=m+h;if(a.includes(v))continue;a.push(v);const y=o(h,p);for(let e=0;e<y.length;++e){const t=y[e];a.push(m+t)}s=t+(s.length>0?" "+s:s)}return s})(e,r);return o(e,a),a}return function(){return a(zut.apply(null,arguments))}}const Lut=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},But=/^\[(?:([a-z-]+):)?(.+)\]$/i,Vut=/^\d+\/\d+$/,Hut=new Set(["px","full","screen"]),qut=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,$ut=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Wut=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Uut=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Gut=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Kut=e=>Xut(e)||Hut.has(e)||Vut.test(e),Yut=e=>cdt(e,"length",udt),Xut=e=>!!e&&!Number.isNaN(Number(e)),Zut=e=>cdt(e,"number",Xut),Qut=e=>!!e&&Number.isInteger(Number(e)),Jut=e=>e.endsWith("%")&&Xut(e.slice(0,-1)),edt=e=>But.test(e),tdt=e=>qut.test(e),rdt=new Set(["length","size","percentage"]),ndt=e=>cdt(e,rdt,ddt),odt=e=>cdt(e,"position",ddt),adt=new Set(["image","url"]),idt=e=>cdt(e,adt,hdt),sdt=e=>cdt(e,"",pdt),ldt=()=>!0,cdt=(e,t,r)=>{const n=But.exec(e);return!!n&&(n[1]?"string"==typeof t?n[1]===t:t.has(n[1]):r(n[2]))},udt=e=>$ut.test(e)&&!Wut.test(e),ddt=()=>!1,pdt=e=>Uut.test(e),hdt=e=>Gut.test(e),fdt=()=>{const e=Lut("colors"),t=Lut("spacing"),r=Lut("blur"),n=Lut("brightness"),o=Lut("borderColor"),a=Lut("borderRadius"),i=Lut("borderSpacing"),s=Lut("borderWidth"),l=Lut("contrast"),c=Lut("grayscale"),u=Lut("hueRotate"),d=Lut("invert"),p=Lut("gap"),h=Lut("gradientColorStops"),f=Lut("gradientColorStopPositions"),m=Lut("inset"),v=Lut("margin"),y=Lut("opacity"),g=Lut("padding"),b=Lut("saturate"),x=Lut("scale"),w=Lut("sepia"),k=Lut("skew"),_=Lut("space"),C=Lut("translate"),M=()=>["auto",edt,t],S=()=>[edt,t],D=()=>["",Kut,Yut],O=()=>["auto",Xut,edt],P=()=>["","0",edt],E=()=>[Xut,edt];return{cacheSize:500,separator:":",theme:{colors:[ldt],spacing:[Kut,Yut],blur:["none","",tdt,edt],brightness:E(),borderColor:[e],borderRadius:["none","","full",tdt,edt],borderSpacing:S(),borderWidth:D(),contrast:E(),grayscale:P(),hueRotate:E(),invert:P(),gap:S(),gradientColorStops:[e],gradientColorStopPositions:[Jut,Yut],inset:M(),margin:M(),opacity:E(),padding:S(),saturate:E(),scale:E(),sepia:P(),skew:E(),space:S(),translate:S()},classGroups:{aspect:[{aspect:["auto","square","video",edt]}],container:["container"],columns:[{columns:[tdt]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",edt]}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Qut,edt]}],basis:[{basis:M()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",edt]}],grow:[{grow:P()}],shrink:[{shrink:P()}],order:[{order:["first","last","none",Qut,edt]}],"grid-cols":[{"grid-cols":[ldt]}],"col-start-end":[{col:["auto",{span:["full",Qut,edt]},edt]}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":[ldt]}],"row-start-end":[{row:["auto",{span:[Qut,edt]},edt]}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",edt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",edt]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal","start","end","center","between","around","evenly","stretch"]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[g]}],px:[{px:[g]}],py:[{py:[g]}],ps:[{ps:[g]}],pe:[{pe:[g]}],pt:[{pt:[g]}],pr:[{pr:[g]}],pb:[{pb:[g]}],pl:[{pl:[g]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[_]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[_]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",edt,t]}],"min-w":[{"min-w":[edt,t,"min","max","fit"]}],"max-w":[{"max-w":[edt,t,"none","full","min","max","fit","prose",{screen:[tdt]},tdt]}],h:[{h:[edt,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[edt,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[edt,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[edt,t,"auto","min","max","fit"]}],"font-size":[{text:["base",tdt,Yut]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Zut]}],"font-family":[{font:[ldt]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",edt]}],"line-clamp":[{"line-clamp":["none",Xut,Zut]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Kut,edt]}],"list-image":[{"list-image":["none",edt]}],"list-style-type":[{list:["none","disc","decimal",edt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","none","wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Kut,Yut]}],"underline-offset":[{"underline-offset":["auto",Kut,edt]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",edt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",edt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",odt]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",ndt]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},idt]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[f]}],"gradient-via-pos":[{via:[f]}],"gradient-to-pos":[{to:[f]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:["solid","dashed","dotted","double","none","hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:["solid","dashed","dotted","double","none"]}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["","solid","dashed","dotted","double","none"]}],"outline-offset":[{"outline-offset":[Kut,edt]}],"outline-w":[{outline:[Kut,Yut]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:D()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[Kut,Yut]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",tdt,sdt]}],"shadow-color":[{shadow:[ldt]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",tdt,edt]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[b]}],sepia:[{sepia:[w]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[w]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",edt]}],duration:[{duration:E()}],ease:[{ease:["linear","in","out","in-out",edt]}],delay:[{delay:E()}],animate:[{animate:["none","spin","ping","pulse","bounce",edt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[Qut,edt]}],"translate-x":[{"translate-x":[C]}],"translate-y":[{"translate-y":[C]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",edt]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",edt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",edt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Kut,Yut,Zut]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},mdt=Aut(fdt);function vdt(...e){return mdt(kut(e))}const ydt=hut,gdt=fut,bdt=mut,xdt=s.forwardRef(({className:e,...r},n)=>t.jsx(vut,{ref:n,className:vdt("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...r}));xdt.displayName=vut.displayName;const wdt=s.forwardRef(({className:e,children:r,...n},o)=>t.jsxs(bdt,{children:[t.jsx(xdt,{}),t.jsxs(yut,{ref:o,className:vdt("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[r,t.jsxs(xut,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[t.jsx(Wst,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));wdt.displayName=yut.displayName;const kdt=({className:e,...r})=>t.jsx("div",{className:vdt("flex flex-col space-y-1.5 text-center sm:text-left",e),...r});kdt.displayName="DialogHeader";const _dt=({className:e,...r})=>t.jsx("div",{className:vdt("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...r});_dt.displayName="DialogFooter";const Cdt=s.forwardRef(({className:e,...r},n)=>t.jsx(gut,{ref:n,className:vdt("text-lg font-semibold leading-none tracking-tight",e),...r}));Cdt.displayName=gut.displayName;const Mdt=s.forwardRef(({className:e,...r},n)=>t.jsx(but,{ref:n,className:vdt("text-sm text-muted-foreground",e),...r}));Mdt.displayName=but.displayName;const Sdt=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,Ddt=kut,Odt=(e,t)=>r=>{var n;if(null==(null==t?void 0:t.variants))return Ddt(e,null==r?void 0:r.class,null==r?void 0:r.className);const{variants:o,defaultVariants:a}=t,i=Object.keys(o).map(e=>{const t=null==r?void 0:r[e],n=null==a?void 0:a[e];if(null===t)return null;const i=Sdt(t)||Sdt(n);return o[e][i]}),s=r&&Object.entries(r).reduce((e,t)=>{let[r,n]=t;return void 0===n||(e[r]=n),e},{}),l=null==t||null===(n=t.compoundVariants)||void 0===n?void 0:n.reduce((e,t)=>{let{class:r,className:n,...o}=t;return Object.entries(o).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...a,...s}[t]):{...a,...s}[t]===r})?[...e,r,n]:e},[]);return Ddt(e,i,l,null==r?void 0:r.class,null==r?void 0:r.className)},Pdt=Odt("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Edt=s.forwardRef(({className:e,variant:r,size:n,asChild:o=!1,...a},i)=>t.jsx(o?alt:"button",{className:vdt(Pdt({variant:r,size:n,className:e})),ref:i,...a}));Edt.displayName="Button";const jdt=({translations:e,children:r,isDisabled:n=!1})=>r?t.jsx(gdt,{asChild:!0,disabled:n,children:r}):t.jsx(gdt,{asChild:!0,children:t.jsxs(Edt,{variant:"default",size:"sm",className:"w-full gap-0 sm:w-auto text-xs sm:text-sm",disabled:n,children:[t.jsx(_st,{className:"h-3 w-3 sm:h-4 sm:w-4 mr-1 sm:mr-2"}),e.addEvent]})});var Tdt="AlertDialog",[Ndt,Rdt]=Xst(Tdt,[zct]),Fdt=zct(),zdt=e=>{const{__scopeAlertDialog:r,...n}=e,o=Fdt(r);return t.jsx(hut,{...o,...n,modal:!0})};zdt.displayName=Tdt;var Idt=s.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...o}=e,a=Fdt(n);return t.jsx(fut,{...a,...o,ref:r})});Idt.displayName="AlertDialogTrigger";var Adt=e=>{const{__scopeAlertDialog:r,...n}=e,o=Fdt(r);return t.jsx(mut,{...o,...n})};Adt.displayName="AlertDialogPortal";var Ldt=s.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...o}=e,a=Fdt(n);return t.jsx(vut,{...a,...o,ref:r})});Ldt.displayName="AlertDialogOverlay";var Bdt="AlertDialogContent",[Vdt,Hdt]=Ndt(Bdt),qdt=llt("AlertDialogContent"),$dt=s.forwardRef((e,r)=>{const{__scopeAlertDialog:n,children:o,...a}=e,i=Fdt(n),l=s.useRef(null),c=Yst(r,l),u=s.useRef(null);return t.jsx(cut,{contentName:Bdt,titleName:Wdt,docsSlug:"alert-dialog",children:t.jsx(Vdt,{scope:n,cancelRef:u,children:t.jsxs(yut,{role:"alertdialog",...i,...a,ref:c,onOpenAutoFocus:Ust(a.onOpenAutoFocus,e=>{var t;e.preventDefault(),null==(t=u.current)||t.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[t.jsx(qdt,{children:o}),t.jsx(Qdt,{contentRef:l})]})})})});$dt.displayName=Bdt;var Wdt="AlertDialogTitle",Udt=s.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...o}=e,a=Fdt(n);return t.jsx(gut,{...a,...o,ref:r})});Udt.displayName=Wdt;var Gdt="AlertDialogDescription",Kdt=s.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...o}=e,a=Fdt(n);return t.jsx(but,{...a,...o,ref:r})});Kdt.displayName=Gdt;var Ydt=s.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...o}=e,a=Fdt(n);return t.jsx(xut,{...a,...o,ref:r})});Ydt.displayName="AlertDialogAction";var Xdt="AlertDialogCancel",Zdt=s.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...o}=e,{cancelRef:a}=Hdt(Xdt,n),i=Fdt(n),s=Yst(r,a);return t.jsx(xut,{...i,...o,ref:s})});Zdt.displayName=Xdt;var Qdt=({contentRef:e})=>{const t=`\`${Bdt}\` requires a description for the component to be accessible for screen reader users.\n\nYou can add a description to the \`${Bdt}\` by passing a \`${Gdt}\` 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 \`${Bdt}\`. 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 s.useEffect(()=>{var r;document.getElementById(null==(r=e.current)?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Jdt=Ldt,ept=$dt,tpt=Ydt,rpt=Zdt,npt=Udt,opt=Kdt;const apt=zdt,ipt=Idt,spt=Adt,lpt=s.forwardRef(({className:e,...r},n)=>t.jsx(Jdt,{className:vdt("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...r,ref:n}));lpt.displayName=Jdt.displayName;const cpt=s.forwardRef(({className:e,...r},n)=>t.jsxs(spt,{children:[t.jsx(lpt,{}),t.jsx(ept,{ref:n,className:vdt("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r})]}));cpt.displayName=ept.displayName;const upt=({className:e,...r})=>t.jsx("div",{className:vdt("flex flex-col space-y-2 text-center sm:text-left",e),...r});upt.displayName="AlertDialogHeader";const dpt=({className:e,...r})=>t.jsx("div",{className:vdt("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...r});dpt.displayName="AlertDialogFooter";const ppt=s.forwardRef(({className:e,...r},n)=>t.jsx(npt,{ref:n,className:vdt("text-lg font-semibold",e),...r}));ppt.displayName=npt.displayName;const hpt=s.forwardRef(({className:e,...r},n)=>t.jsx(opt,{ref:n,className:vdt("text-sm text-muted-foreground",e),...r}));hpt.displayName=opt.displayName;const fpt=s.forwardRef(({className:e,...r},n)=>t.jsx(tpt,{ref:n,className:vdt(Pdt(),e),...r}));fpt.displayName=tpt.displayName;const mpt=s.forwardRef(({className:e,...r},n)=>t.jsx(rpt,{ref:n,className:vdt(Pdt({variant:"outline"}),"mt-2 sm:mt-0",e),...r}));mpt.displayName=rpt.displayName;var vpt=function(){return vpt=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},vpt.apply(this,arguments)};function ypt(e,t,r){for(var n,o=0,a=t.length;o<a;o++)(n||!(o in t))&&(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}function gpt(e){return"multiple"===e.mode}function bpt(e){return"range"===e.mode}function xpt(e){return"single"===e.mode}var wpt={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};var kpt=Object.freeze({__proto__:null,formatCaption:function(e,t){return Vit(e,"LLLL y",t)},formatDay:function(e,t){return Vit(e,"d",t)},formatMonthCaption:function(e,t){return Vit(e,"LLLL",t)},formatWeekNumber:function(e){return"".concat(e)},formatWeekdayName:function(e,t){return Vit(e,"cccccc",t)},formatYearCaption:function(e,t){return Vit(e,"yyyy",t)}}),_pt=Object.freeze({__proto__:null,labelDay:function(e,t,r){return Vit(e,"do MMMM (EEEE)",r)},labelMonthDropdown:function(){return"Month: "},labelNext:function(){return"Go to next month"},labelPrevious:function(){return"Go to previous month"},labelWeekNumber:function(e){return"Week n. ".concat(e)},labelWeekday:function(e,t){return Vit(e,"cccc",t)},labelYearDropdown:function(){return"Year: "}});var Cpt=e.createContext(void 0);function Mpt(e){var r,n,o=e.initialProps,a={captionLayout:"buttons",classNames:wpt,formatters:kpt,labels:_pt,locale:fit,modifiersClassNames:{},modifiers:{},numberOfMonths:1,styles:{},today:new Date,mode:"default"},i=function(e){var t=e.fromYear,r=e.toYear,n=e.fromMonth,o=e.toMonth,a=e.fromDate,i=e.toDate;return n?a=tit(n):t&&(a=new Date(t,0,1)),o?i=Jat(o):r&&(i=new Date(r,11,31)),{fromDate:a?Bat(a):void 0,toDate:i?Bat(i):void 0}}(o),s=i.fromDate,l=i.toDate,c=null!==(r=o.captionLayout)&&void 0!==r?r:a.captionLayout;"buttons"!==c&&(!s||!l)&&(c="buttons"),(xpt(o)||gpt(o)||bpt(o))&&(n=o.onSelect);var u=vpt(vpt(vpt({},a),o),{captionLayout:c,classNames:vpt(vpt({},a.classNames),o.classNames),components:vpt({},o.components),formatters:vpt(vpt({},a.formatters),o.formatters),fromDate:s,labels:vpt(vpt({},a.labels),o.labels),mode:o.mode||a.mode,modifiers:vpt(vpt({},a.modifiers),o.modifiers),modifiersClassNames:vpt(vpt({},a.modifiersClassNames),o.modifiersClassNames),onSelect:n,styles:vpt(vpt({},a.styles),o.styles),toDate:l});return t.jsx(Cpt.Provider,{value:u,children:e.children})}function Spt(){var t=e.useContext(Cpt);if(!t)throw new Error("useDayPicker must be used within a DayPickerProvider.");return t}function Dpt(e){var r=Spt(),n=r.locale,o=r.classNames,a=r.styles,i=r.formatters.formatCaption;return t.jsx("div",{className:o.caption_label,style:a.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:i(e.displayMonth,{locale:n})})}function Opt(e){return t.jsx("svg",vpt({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:t.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function Ppt(e){var r,n,o=e.onChange,a=e.value,i=e.children,s=e.caption,l=e.className,c=e.style,u=Spt(),d=null!==(n=null===(r=u.components)||void 0===r?void 0:r.IconDropdown)&&void 0!==n?n:Opt;return t.jsxs("div",{className:l,style:c,children:[t.jsx("span",{className:u.classNames.vhidden,children:e["aria-label"]}),t.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:u.classNames.dropdown,style:u.styles.dropdown,value:a,onChange:o,children:i}),t.jsxs("div",{className:u.classNames.caption_label,style:u.styles.caption_label,"aria-hidden":"true",children:[s,t.jsx(d,{className:u.classNames.dropdown_icon,style:u.styles.dropdown_icon})]})]})}function Ept(e){var r,n=Spt(),o=n.fromDate,a=n.toDate,i=n.styles,s=n.locale,l=n.formatters.formatMonthCaption,c=n.classNames,u=n.components,d=n.labels.labelMonthDropdown;if(!o)return t.jsx(t.Fragment,{});if(!a)return t.jsx(t.Fragment,{});var p=[];if(Kit(o,a))for(var h=tit(o),f=o.getMonth();f<=a.getMonth();f++)p.push(ist(h,f));else for(h=tit(new Date),f=0;f<=11;f++)p.push(ist(h,f));var m=null!==(r=null==u?void 0:u.Dropdown)&&void 0!==r?r:Ppt;return t.jsx(m,{name:"months","aria-label":d(),className:c.dropdown_month,style:i.dropdown_month,onChange:function(t){var r=Number(t.target.value),n=ist(tit(e.displayMonth),r);e.onChange(n)},value:e.displayMonth.getMonth(),caption:l(e.displayMonth,{locale:s}),children:p.map(function(e){return t.jsx("option",{value:e.getMonth(),children:l(e,{locale:s})},e.getMonth())})})}function jpt(e){var r,n=e.displayMonth,o=Spt(),a=o.fromDate,i=o.toDate,s=o.locale,l=o.styles,c=o.classNames,u=o.components,d=o.formatters.formatYearCaption,p=o.labels.labelYearDropdown,h=[];if(!a)return t.jsx(t.Fragment,{});if(!i)return t.jsx(t.Fragment,{});for(var f=a.getFullYear(),m=i.getFullYear(),v=f;v<=m;v++)h.push(cst(nit(new Date),v));var y=null!==(r=null==u?void 0:u.Dropdown)&&void 0!==r?r:Ppt;return t.jsx(y,{name:"years","aria-label":p(),className:c.dropdown_year,style:l.dropdown_year,onChange:function(t){var r=cst(tit(n),Number(t.target.value));e.onChange(r)},value:n.getFullYear(),caption:d(n,{locale:s}),children:h.map(function(e){return t.jsx("option",{value:e.getFullYear(),children:d(e,{locale:s})},e.getFullYear())})})}function Tpt(){var t=Spt(),r=function(e){var t=e.month,r=e.defaultMonth,n=e.today,o=t||r||n||new Date,a=e.toDate,i=e.fromDate,s=e.numberOfMonths,l=void 0===s?1:s;return a&&Yat(a,o)<0&&(o=Eat(a,-1*(l-1))),i&&Yat(o,i)<0&&(o=i),tit(o)}(t),n=function(t,r){var n=e.useState(t),o=n[0];return[void 0===r?o:r,n[1]]}(r,t.month),o=n[0],a=n[1];return[o,function(e){var r;if(!t.disableNavigation){var n=tit(e);a(n),null===(r=t.onMonthChange)||void 0===r||r.call(t,n)}}]}var Npt=e.createContext(void 0);function Rpt(e){var r=Spt(),n=Tpt(),o=n[0],a=n[1],i=function(e,t){for(var r=t.reverseMonths,n=t.numberOfMonths,o=tit(e),a=Yat(tit(Eat(o,n)),o),i=[],s=0;s<a;s++){var l=Eat(o,s);i.push(l)}return r&&(i=i.reverse()),i}(o,r),s=function(e,t){if(!t.disableNavigation){var r=t.toDate,n=t.pagedNavigation,o=t.numberOfMonths,a=void 0===o?1:o,i=n?a:1,s=tit(e);if(!r)return Eat(s,i);if(!(Yat(r,e)<a))return Eat(s,i)}}(o,r),l=function(e,t){if(!t.disableNavigation){var r=t.fromDate,n=t.pagedNavigation,o=t.numberOfMonths,a=n?void 0===o?1:o:1,i=tit(e);if(!r)return Eat(i,-a);if(!(Yat(i,r)<=0))return Eat(i,-a)}}(o,r),c=function(e){return i.some(function(t){return Git(e,t)})},u={currentMonth:o,displayMonths:i,goToMonth:a,goToDate:function(e,t){c(e)||(t&&Uit(e,t)?a(Eat(e,1+-1*r.numberOfMonths)):a(e))},previousMonth:l,nextMonth:s,isDateDisplayed:c};return t.jsx(Npt.Provider,{value:u,children:e.children})}function Fpt(){var t=e.useContext(Npt);if(!t)throw new Error("useNavigation must be used within a NavigationProvider");return t}function zpt(e){var r,n=Spt(),o=n.classNames,a=n.styles,i=n.components,s=Fpt().goToMonth,l=function(t){s(Eat(t,e.displayIndex?-e.displayIndex:0))},c=null!==(r=null==i?void 0:i.CaptionLabel)&&void 0!==r?r:Dpt,u=t.jsx(c,{id:e.id,displayMonth:e.displayMonth});return t.jsxs("div",{className:o.caption_dropdowns,style:a.caption_dropdowns,children:[t.jsx("div",{className:o.vhidden,children:u}),t.jsx(Ept,{onChange:l,displayMonth:e.displayMonth}),t.jsx(jpt,{onChange:l,displayMonth:e.displayMonth})]})}function Ipt(e){return t.jsx("svg",vpt({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:t.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function Apt(e){return t.jsx("svg",vpt({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:t.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var Lpt=e.forwardRef(function(e,r){var n=Spt(),o=n.classNames,a=n.styles,i=[o.button_reset,o.button];e.className&&i.push(e.className);var s=i.join(" "),l=vpt(vpt({},a.button_reset),a.button);return e.style&&Object.assign(l,e.style),t.jsx("button",vpt({},e,{ref:r,type:"button",className:s,style:l}))});function Bpt(e){var r,n,o=Spt(),a=o.dir,i=o.locale,s=o.classNames,l=o.styles,c=o.labels,u=c.labelPrevious,d=c.labelNext,p=o.components;if(!e.nextMonth&&!e.previousMonth)return t.jsx(t.Fragment,{});var h=u(e.previousMonth,{locale:i}),f=[s.nav_button,s.nav_button_previous].join(" "),m=d(e.nextMonth,{locale:i}),v=[s.nav_button,s.nav_button_next].join(" "),y=null!==(r=null==p?void 0:p.IconRight)&&void 0!==r?r:Apt,g=null!==(n=null==p?void 0:p.IconLeft)&&void 0!==n?n:Ipt;return t.jsxs("div",{className:s.nav,style:l.nav,children:[!e.hidePrevious&&t.jsx(Lpt,{name:"previous-month","aria-label":h,className:f,style:l.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:"rtl"===a?t.jsx(y,{className:s.nav_icon,style:l.nav_icon}):t.jsx(g,{className:s.nav_icon,style:l.nav_icon})}),!e.hideNext&&t.jsx(Lpt,{name:"next-month","aria-label":m,className:v,style:l.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:"rtl"===a?t.jsx(g,{className:s.nav_icon,style:l.nav_icon}):t.jsx(y,{className:s.nav_icon,style:l.nav_icon})})]})}function Vpt(e){var r=Spt().numberOfMonths,n=Fpt(),o=n.previousMonth,a=n.nextMonth,i=n.goToMonth,s=n.displayMonths,l=s.findIndex(function(t){return Git(e.displayMonth,t)}),c=0===l,u=l===s.length-1,d=r>1&&(c||!u),p=r>1&&(u||!c);return t.jsx(Bpt,{displayMonth:e.displayMonth,hideNext:d,hidePrevious:p,nextMonth:a,previousMonth:o,onPreviousClick:function(){o&&i(o)},onNextClick:function(){a&&i(a)}})}function Hpt(e){var r,n,o=Spt(),a=o.classNames,i=o.disableNavigation,s=o.styles,l=o.captionLayout,c=o.components,u=null!==(r=null==c?void 0:c.CaptionLabel)&&void 0!==r?r:Dpt;return n=i?t.jsx(u,{id:e.id,displayMonth:e.displayMonth}):"dropdown"===l?t.jsx(zpt,{displayMonth:e.displayMonth,id:e.id}):"dropdown-buttons"===l?t.jsxs(t.Fragment,{children:[t.jsx(zpt,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),t.jsx(Vpt,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):t.jsxs(t.Fragment,{children:[t.jsx(u,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),t.jsx(Vpt,{displayMonth:e.displayMonth,id:e.id})]}),t.jsx("div",{className:a.caption,style:s.caption,children:n})}function qpt(e){var r=Spt(),n=r.footer,o=r.styles,a=r.classNames.tfoot;return n?t.jsx("tfoot",{className:a,style:o.tfoot,children:t.jsx("tr",{children:t.jsx("td",{colSpan:8,children:n})})}):t.jsx(t.Fragment,{})}function $pt(){var e=Spt(),r=e.classNames,n=e.styles,o=e.showWeekNumber,a=e.locale,i=e.weekStartsOn,s=e.ISOWeek,l=e.formatters.formatWeekdayName,c=e.labels.labelWeekday,u=function(e,t,r){for(var n=r?Aat(new Date):Iat(new Date,{locale:e,weekStartsOn:t}),o=[],a=0;a<7;a++){var i=Pat(n,a);o.push(i)}return o}(a,i,s);return t.jsxs("tr",{style:n.head_row,className:r.head_row,children:[o&&t.jsx("td",{style:n.head_cell,className:r.head_cell}),u.map(function(e,o){return t.jsx("th",{scope:"col",className:r.head_cell,style:n.head_cell,"aria-label":c(e,{locale:a}),children:l(e,{locale:a})},o)})]})}function Wpt(){var e,r=Spt(),n=r.classNames,o=r.styles,a=r.components,i=null!==(e=null==a?void 0:a.HeadRow)&&void 0!==e?e:$pt;return t.jsx("thead",{style:o.head,className:n.head,children:t.jsx(i,{})})}function Upt(e){var r=Spt(),n=r.locale,o=r.formatters.formatDay;return t.jsx(t.Fragment,{children:o(e.date,{locale:n})})}var Gpt=e.createContext(void 0);function Kpt(e){if(!gpt(e.initialProps)){return t.jsx(Gpt.Provider,{value:{selected:void 0,modifiers:{disabled:[]}},children:e.children})}return t.jsx(Ypt,{initialProps:e.initialProps,children:e.children})}function Ypt(e){var r=e.initialProps,n=e.children,o=r.selected,a=r.min,i=r.max,s={disabled:[]};o&&s.disabled.push(function(e){var t=i&&o.length>i-1,r=o.some(function(t){return Gat(t,e)});return!(!t||r)});var l={selected:o,onDayClick:function(e,t,n){var s,l;if((null===(s=r.onDayClick)||void 0===s||s.call(r,e,t,n),!!(!t.selected||!a||(null==o?void 0:o.length)!==a))&&!!(t.selected||!i||(null==o?void 0:o.length)!==i)){var c=o?ypt([],o):[];if(t.selected){var u=c.findIndex(function(t){return Gat(e,t)});c.splice(u,1)}else c.push(e);null===(l=r.onSelect)||void 0===l||l.call(r,c,e,t,n)}},modifiers:s};return t.jsx(Gpt.Provider,{value:l,children:n})}function Xpt(){var t=e.useContext(Gpt);if(!t)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return t}var Zpt,Qpt=e.createContext(void 0);function Jpt(e){if(!bpt(e.initialProps)){return t.jsx(Qpt.Provider,{value:{selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}},children:e.children})}return t.jsx(eht,{initialProps:e.initialProps,children:e.children})}function eht(e){var r=e.initialProps,n=e.children,o=r.selected,a=o||{},i=a.from,s=a.to,l=r.min,c=r.max,u={range_start:[],range_end:[],range_middle:[],disabled:[]};if(i?(u.range_start=[i],s?(u.range_end=[s],Gat(i,s)||(u.range_middle=[{after:i,before:s}])):u.range_end=[i]):s&&(u.range_start=[s],u.range_end=[s]),l&&(i&&!s&&u.disabled.push({after:Xit(i,l-1),before:Pat(i,l-1)}),i&&s&&u.disabled.push({after:i,before:Pat(i,l-1)}),!i&&s&&u.disabled.push({after:Xit(s,l-1),before:Pat(s,l-1)})),c){if(i&&!s&&(u.disabled.push({before:Pat(i,1-c)}),u.disabled.push({after:Pat(i,c-1)})),i&&s){var d=c-(Hat(s,i)+1);u.disabled.push({before:Xit(i,d)}),u.disabled.push({after:Pat(s,d)})}!i&&s&&(u.disabled.push({before:Pat(s,1-c)}),u.disabled.push({after:Pat(s,c-1)}))}return t.jsx(Qpt.Provider,{value:{selected:o,onDayClick:function(e,t,n){var a,i;null===(a=r.onDayClick)||void 0===a||a.call(r,e,t,n);var s=function(e,t){var r=t||{},n=r.from,o=r.to;return n&&o?Gat(o,e)&&Gat(n,e)?void 0:Gat(o,e)?{from:o,to:void 0}:Gat(n,e)?void 0:Wit(n,e)?{from:e,to:o}:{from:n,to:e}:o?Wit(e,o)?{from:o,to:e}:{from:e,to:o}:n?Uit(e,n)?{from:e,to:n}:{from:n,to:e}:{from:e,to:void 0}}(e,o);null===(i=r.onSelect)||void 0===i||i.call(r,s,e,t,n)},modifiers:u},children:n})}function tht(){var t=e.useContext(Qpt);if(!t)throw new Error("useSelectRange must be used within a SelectRangeProvider");return t}function rht(e){return Array.isArray(e)?ypt([],e):void 0!==e?[e]:[]}!function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"}(Zpt||(Zpt={}));var nht=Zpt.Selected,oht=Zpt.Disabled,aht=Zpt.Hidden,iht=Zpt.Today,sht=Zpt.RangeEnd,lht=Zpt.RangeMiddle,cht=Zpt.RangeStart,uht=Zpt.Outside;var dht=e.createContext(void 0);function pht(e){var r=Spt(),n=function(e,t,r){var n,o=((n={})[nht]=rht(e.selected),n[oht]=rht(e.disabled),n[aht]=rht(e.hidden),n[iht]=[e.today],n[sht]=[],n[lht]=[],n[cht]=[],n[uht]=[],n);return e.fromDate&&o[oht].push({before:e.fromDate}),e.toDate&&o[oht].push({after:e.toDate}),gpt(e)?o[oht]=o[oht].concat(t.modifiers[oht]):bpt(e)&&(o[oht]=o[oht].concat(r.modifiers[oht]),o[cht]=r.modifiers[cht],o[lht]=r.modifiers[lht],o[sht]=r.modifiers[sht]),o}(r,Xpt(),tht()),o=function(e){var t={};return Object.entries(e).forEach(function(e){var r=e[0],n=e[1];t[r]=rht(n)}),t}(r.modifiers),a=vpt(vpt({},n),o);return t.jsx(dht.Provider,{value:a,children:e.children})}function hht(){var t=e.useContext(dht);if(!t)throw new Error("useModifiers must be used within a ModifiersProvider");return t}function fht(e,t){return t.some(function(t){if("boolean"==typeof t)return t;if(function(e){return Kat(e)}(t))return Gat(e,t);if(function(e){return Array.isArray(e)&&e.every(Kat)}(t))return t.includes(e);if(function(e){return!(!e||"object"!=typeof e||!("from"in e))}(t))return function(e,t){var r,n=t.from,o=t.to;return n&&o?(Hat(o,n)<0&&(n=(r=[o,n])[0],o=r[1]),Hat(e,n)>=0&&Hat(o,e)>=0):o?Gat(o,e):!!n&&Gat(n,e)}(e,t);if(function(e){return!(!e||"object"!=typeof e||!("dayOfWeek"in e))}(t))return t.dayOfWeek.includes(e.getDay());if(function(e){return!!(e&&"object"==typeof e&&"before"in e&&"after"in e)}(t)){var r=Hat(t.before,e)>0,n=Hat(t.after,e)<0;return Wit(t.before,t.after)?n&&r:r||n}return function(e){return!(!e||"object"!=typeof e||!("after"in e))}(t)?Hat(e,t.after)>0:function(e){return!(!e||"object"!=typeof e||!("before"in e))}(t)?Hat(t.before,e)>0:"function"==typeof t&&t(e)})}function mht(e,t,r){var n=Object.keys(t).reduce(function(r,n){var o=t[n];return fht(e,o)&&r.push(n),r},[]),o={};return n.forEach(function(e){return o[e]=!0}),r&&!Git(e,r)&&(o.outside=!0),o}function vht(e,t){var r=t.moveBy,n=t.direction,o=t.context,a=t.modifiers,i=t.retry,s=void 0===i?{count:0,lastFocused:e}:i,l=o.weekStartsOn,c=o.fromDate,u=o.toDate,d=o.locale,p={day:Pat,week:qat,month:Eat,year:$at,startOfWeek:function(e){return o.ISOWeek?Aat(e):Iat(e,{locale:d,weekStartsOn:l})},endOfWeek:function(e){return o.ISOWeek?ait(e):oit(e,{locale:d,weekStartsOn:l})}}[r](e,"after"===n?1:-1);"before"===n&&c?p=Wat([c,p]):"after"===n&&u&&(p=Uat([u,p]));var h=!0;if(a){var f=mht(p,a);h=!f.disabled&&!f.hidden}return h?p:s.count>365?s.lastFocused:vht(p,{moveBy:r,direction:n,context:o,modifiers:a,retry:vpt(vpt({},s),{count:s.count+1})})}var yht=e.createContext(void 0);function ght(r){var n=Fpt(),o=hht(),a=e.useState(),i=a[0],s=a[1],l=e.useState(),c=l[0],u=l[1],d=function(e,t){for(var r,n,o=tit(e[0]),a=Jat(e[e.length-1]),i=o;i<=a;){var s=mht(i,t);if(s.disabled||s.hidden)i=Pat(i,1);else{if(s.selected)return i;s.today&&!n&&(n=i),r||(r=i),i=Pat(i,1)}}return n||r}(n.displayMonths,o),p=i??(c&&n.isDateDisplayed(c))?c:d,h=function(e){s(e)},f=Spt(),m=function(e,t){if(i){var r=vht(i,{moveBy:e,direction:t,context:f,modifiers:o});Gat(i,r)||(n.goToDate(r,i),h(r))}},v={focusedDay:i,focusTarget:p,blur:function(){u(i),s(void 0)},focus:h,focusDayAfter:function(){return m("day","after")},focusDayBefore:function(){return m("day","before")},focusWeekAfter:function(){return m("week","after")},focusWeekBefore:function(){return m("week","before")},focusMonthBefore:function(){return m("month","before")},focusMonthAfter:function(){return m("month","after")},focusYearBefore:function(){return m("year","before")},focusYearAfter:function(){return m("year","after")},focusStartOfWeek:function(){return m("startOfWeek","before")},focusEndOfWeek:function(){return m("endOfWeek","after")}};return t.jsx(yht.Provider,{value:v,children:r.children})}function bht(){var t=e.useContext(yht);if(!t)throw new Error("useFocusContext must be used within a FocusProvider");return t}var xht=e.createContext(void 0);function wht(e){if(!xpt(e.initialProps)){return t.jsx(xht.Provider,{value:{selected:void 0},children:e.children})}return t.jsx(kht,{initialProps:e.initialProps,children:e.children})}function kht(e){var r=e.initialProps,n=e.children,o={selected:r.selected,onDayClick:function(e,t,n){var o,a,i;null===(o=r.onDayClick)||void 0===o||o.call(r,e,t,n),!t.selected||r.required?null===(i=r.onSelect)||void 0===i||i.call(r,e,e,t,n):null===(a=r.onSelect)||void 0===a||a.call(r,void 0,e,t,n)}};return t.jsx(xht.Provider,{value:o,children:n})}function _ht(){var t=e.useContext(xht);if(!t)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return t}function Cht(e,t){var r=[e.classNames.day];return Object.keys(t).forEach(function(t){var n=e.modifiersClassNames[t];if(n)r.push(n);else if(function(e){return Object.values(Zpt).includes(e)}(t)){var o=e.classNames["day_".concat(t)];o&&r.push(o)}}),r}function Mht(r,n,o){var a,i,s,l=Spt(),c=bht(),u=function(e,t){return mht(e,hht(),t)}(r,n),d=function(e,t){var r=Spt(),n=_ht(),o=Xpt(),a=tht(),i=bht(),s=i.focusDayAfter,l=i.focusDayBefore,c=i.focusWeekAfter,u=i.focusWeekBefore,d=i.blur,p=i.focus,h=i.focusMonthBefore,f=i.focusMonthAfter,m=i.focusYearBefore,v=i.focusYearAfter,y=i.focusStartOfWeek,g=i.focusEndOfWeek;return{onClick:function(i){var s,l,c,u;xpt(r)?null===(s=n.onDayClick)||void 0===s||s.call(n,e,t,i):gpt(r)?null===(l=o.onDayClick)||void 0===l||l.call(o,e,t,i):bpt(r)?null===(c=a.onDayClick)||void 0===c||c.call(a,e,t,i):null===(u=r.onDayClick)||void 0===u||u.call(r,e,t,i)},onFocus:function(n){var o;p(e),null===(o=r.onDayFocus)||void 0===o||o.call(r,e,t,n)},onBlur:function(n){var o;d(),null===(o=r.onDayBlur)||void 0===o||o.call(r,e,t,n)},onKeyDown:function(n){var o;switch(n.key){case"ArrowLeft":n.preventDefault(),n.stopPropagation(),"rtl"===r.dir?s():l();break;case"ArrowRight":n.preventDefault(),n.stopPropagation(),"rtl"===r.dir?l():s();break;case"ArrowDown":n.preventDefault(),n.stopPropagation(),c();break;case"ArrowUp":n.preventDefault(),n.stopPropagation(),u();break;case"PageUp":n.preventDefault(),n.stopPropagation(),n.shiftKey?m():h();break;case"PageDown":n.preventDefault(),n.stopPropagation(),n.shiftKey?v():f();break;case"Home":n.preventDefault(),n.stopPropagation(),y();break;case"End":n.preventDefault(),n.stopPropagation(),g()}null===(o=r.onDayKeyDown)||void 0===o||o.call(r,e,t,n)},onKeyUp:function(n){var o;null===(o=r.onDayKeyUp)||void 0===o||o.call(r,e,t,n)},onMouseEnter:function(n){var o;null===(o=r.onDayMouseEnter)||void 0===o||o.call(r,e,t,n)},onMouseLeave:function(n){var o;null===(o=r.onDayMouseLeave)||void 0===o||o.call(r,e,t,n)},onPointerEnter:function(n){var o;null===(o=r.onDayPointerEnter)||void 0===o||o.call(r,e,t,n)},onPointerLeave:function(n){var o;null===(o=r.onDayPointerLeave)||void 0===o||o.call(r,e,t,n)},onTouchCancel:function(n){var o;null===(o=r.onDayTouchCancel)||void 0===o||o.call(r,e,t,n)},onTouchEnd:function(n){var o;null===(o=r.onDayTouchEnd)||void 0===o||o.call(r,e,t,n)},onTouchMove:function(n){var o;null===(o=r.onDayTouchMove)||void 0===o||o.call(r,e,t,n)},onTouchStart:function(n){var o;null===(o=r.onDayTouchStart)||void 0===o||o.call(r,e,t,n)}}}(r,u),p=function(){var e=Spt(),t=_ht(),r=Xpt(),n=tht();return xpt(e)?t.selected:gpt(e)?r.selected:bpt(e)?n.selected:void 0}(),h=!(!l.onDayClick&&"default"===l.mode);e.useEffect(function(){var e;u.outside||c.focusedDay&&h&&Gat(c.focusedDay,r)&&(null===(e=o.current)||void 0===e||e.focus())},[c.focusedDay,r,o,h,u.outside]);var f=Cht(l,u).join(" "),m=function(e,t){var r=vpt({},e.styles.day);return Object.keys(t).forEach(function(t){var n;r=vpt(vpt({},r),null===(n=e.modifiersStyles)||void 0===n?void 0:n[t])}),r}(l,u),v=!!(u.outside&&!l.showOutsideDays||u.hidden),y=null!==(s=null===(i=l.components)||void 0===i?void 0:i.DayContent)&&void 0!==s?s:Upt,g={style:m,className:f,children:t.jsx(y,{date:r,displayMonth:n,activeModifiers:u}),role:"gridcell"},b=c.focusTarget&&Gat(c.focusTarget,r)&&!u.outside,x=c.focusedDay&&Gat(c.focusedDay,r),w=vpt(vpt(vpt({},g),((a={disabled:u.disabled,role:"gridcell"})["aria-selected"]=u.selected,a.tabIndex=x||b?0:-1,a)),d);return{isButton:h,isHidden:v,activeModifiers:u,selectedDays:p,buttonProps:w,divProps:g}}function Sht(r){var n=e.useRef(null),o=Mht(r.date,r.displayMonth,n);return o.isHidden?t.jsx("div",{role:"gridcell"}):o.isButton?t.jsx(Lpt,vpt({name:"day",ref:n},o.buttonProps)):t.jsx("div",vpt({},o.divProps))}function Dht(e){var r=e.number,n=e.dates,o=Spt(),a=o.onWeekNumberClick,i=o.styles,s=o.classNames,l=o.locale,c=o.labels.labelWeekNumber,u=(0,o.formatters.formatWeekNumber)(Number(r),{locale:l});if(!a)return t.jsx("span",{className:s.weeknumber,style:i.weeknumber,children:u});var d=c(Number(r),{locale:l});return t.jsx(Lpt,{name:"week-number","aria-label":d,className:s.weeknumber,style:i.weeknumber,onClick:function(e){a(r,n,e)},children:u})}function Oht(e){var r,n,o,a=Spt(),i=a.styles,s=a.classNames,l=a.showWeekNumber,c=a.components,u=null!==(r=null==c?void 0:c.Day)&&void 0!==r?r:Sht,d=null!==(n=null==c?void 0:c.WeekNumber)&&void 0!==n?n:Dht;return l&&(o=t.jsx("td",{className:s.cell,style:i.cell,children:t.jsx(d,{number:e.weekNumber,dates:e.dates})})),t.jsxs("tr",{className:s.row,style:i.row,children:[o,e.dates.map(function(r){return t.jsx("td",{className:s.cell,style:i.cell,role:"presentation",children:t.jsx(u,{displayMonth:e.displayMonth,date:r})},function(e){return Math.trunc(+Dat(e)/1e3)}(r))})]})}function Pht(e,t,r){for(var n=null!=r&&r.ISOWeek?ait(t):oit(t,r),o=null!=r&&r.ISOWeek?Aat(e):Iat(e,r),a=Hat(n,o),i=[],s=0;s<=a;s++)i.push(Pat(o,s));var l=i.reduce(function(e,t){var n=null!=r&&r.ISOWeek?mit(t):yit(t,r),o=e.find(function(e){return e.weekNumber===n});return o?(o.dates.push(t),e):(e.push({weekNumber:n,dates:[t]}),e)},[]);return l}function Eht(e){var r,n,o,a=Spt(),i=a.locale,s=a.classNames,l=a.styles,c=a.hideHead,u=a.fixedWeeks,d=a.components,p=a.weekStartsOn,h=a.firstWeekContainsDate,f=a.ISOWeek,m=function(e,t){var r=Pht(tit(e),Jat(e),t);if(null!=t&&t.useFixedWeeks){var n=$it(e,t);if(n<6){var o=r[r.length-1],a=o.dates[o.dates.length-1],i=qat(a,6-n),s=Pht(qat(a,1),i,t);r.push.apply(r,s)}}return r}(e.displayMonth,{useFixedWeeks:!!u,ISOWeek:f,locale:i,weekStartsOn:p,firstWeekContainsDate:h}),v=null!==(r=null==d?void 0:d.Head)&&void 0!==r?r:Wpt,y=null!==(n=null==d?void 0:d.Row)&&void 0!==n?n:Oht,g=null!==(o=null==d?void 0:d.Footer)&&void 0!==o?o:qpt;return t.jsxs("table",{id:e.id,className:s.table,style:l.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!c&&t.jsx(v,{}),t.jsx("tbody",{className:s.tbody,style:l.tbody,children:m.map(function(r){return t.jsx(y,{displayMonth:e.displayMonth,dates:r.dates,weekNumber:r.weekNumber},r.weekNumber)})}),t.jsx(g,{displayMonth:e.displayMonth})]})}var jht=typeof window<"u"&&window.document&&window.document.createElement?e.useLayoutEffect:e.useEffect,Tht=!1,Nht=0;function Rht(){return"react-day-picker-".concat(++Nht)}function Fht(r){var n,o,a=Spt(),i=a.dir,s=a.classNames,l=a.styles,c=a.components,u=Fpt().displayMonths,d=function(t){var r,n=t??(Tht?Rht():null),o=e.useState(n),a=o[0],i=o[1];return jht(function(){null===a&&i(Rht())},[]),e.useEffect(function(){!1===Tht&&(Tht=!0)},[]),null!==(r=t??a)&&void 0!==r?r:void 0}(a.id?"".concat(a.id,"-").concat(r.displayIndex):void 0),p=a.id?"".concat(a.id,"-grid-").concat(r.displayIndex):void 0,h=[s.month],f=l.month,m=0===r.displayIndex,v=r.displayIndex===u.length-1,y=!m&&!v;"rtl"===i&&(v=(n=[m,v])[0],m=n[1]),m&&(h.push(s.caption_start),f=vpt(vpt({},f),l.caption_start)),v&&(h.push(s.caption_end),f=vpt(vpt({},f),l.caption_end)),y&&(h.push(s.caption_between),f=vpt(vpt({},f),l.caption_between));var g=null!==(o=null==c?void 0:c.Caption)&&void 0!==o?o:Hpt;return t.jsxs("div",{className:h.join(" "),style:f,children:[t.jsx(g,{id:d,displayMonth:r.displayMonth,displayIndex:r.displayIndex}),t.jsx(Eht,{id:p,"aria-labelledby":d,displayMonth:r.displayMonth})]},r.displayIndex)}function zht(e){var r=Spt(),n=r.classNames,o=r.styles;return t.jsx("div",{className:n.months,style:o.months,children:e.children})}function Iht(r){var n,o,a=r.initialProps,i=Spt(),s=bht(),l=Fpt(),c=e.useState(!1),u=c[0],d=c[1];e.useEffect(function(){i.initialFocus&&s.focusTarget&&(u||(s.focus(s.focusTarget),d(!0)))},[i.initialFocus,u,s.focus,s.focusTarget,s]);var p=[i.classNames.root,i.className];i.numberOfMonths>1&&p.push(i.classNames.multiple_months),i.showWeekNumber&&p.push(i.classNames.with_weeknumber);var h=vpt(vpt({},i.styles.root),i.style),f=Object.keys(a).filter(function(e){return e.startsWith("data-")}).reduce(function(e,t){var r;return vpt(vpt({},e),((r={})[t]=a[t],r))},{}),m=null!==(o=null===(n=a.components)||void 0===n?void 0:n.Months)&&void 0!==o?o:zht;return t.jsx("div",vpt({className:p.join(" "),style:h,dir:i.dir,id:i.id,nonce:a.nonce,title:a.title,lang:a.lang},f,{children:t.jsx(m,{children:l.displayMonths.map(function(e,r){return t.jsx(Fht,{displayIndex:r,displayMonth:e},r)})})}))}function Aht(e){var r=e.children,n=function(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 o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(e,["children"]);return t.jsx(Mpt,{initialProps:n,children:t.jsx(Rpt,{children:t.jsx(wht,{initialProps:n,children:t.jsx(Kpt,{initialProps:n,children:t.jsx(Jpt,{initialProps:n,children:t.jsx(pht,{children:t.jsx(ght,{children:r})})})})})})})}function Lht(e){return t.jsx(Aht,vpt({},e,{children:t.jsx(Iht,{initialProps:e})}))}function Bht({className:e,classNames:r,showOutsideDays:n=!0,...o}){return t.jsx(Lht,{showOutsideDays:n,className:vdt("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:vdt(Pdt({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:vdt(Pdt({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:bg-accent/50 aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...r},components:{IconLeft:({className:e,...r})=>t.jsx(Ost,{className:vdt("h-4 w-4",e),...r}),IconRight:({className:e,...r})=>t.jsx(Pst,{className:vdt("h-4 w-4",e),...r})},...o})}Bht.displayName="Calendar";var Vht=e=>"checkbox"===e.type,Hht=e=>e instanceof Date,qht=e=>null==e;const $ht=e=>"object"==typeof e;var Wht=e=>!qht(e)&&!Array.isArray(e)&&$ht(e)&&!Hht(e),Uht=e=>Wht(e)&&e.target?Vht(e.target)?e.target.checked:e.target.value:e,Ght=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),Kht=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Yht(e){let t;const r=Array.isArray(e),n=typeof FileList<"u"&&e instanceof FileList;if(e instanceof Date)t=new Date(e);else{if(Kht&&(e instanceof Blob||n)||!r&&!Wht(e))return e;if(t=r?[]:{},r||(e=>{const t=e.constructor&&e.constructor.prototype;return Wht(t)&&t.hasOwnProperty("isPrototypeOf")})(e))for(const r in e)e.hasOwnProperty(r)&&(t[r]=Yht(e[r]));else t=e}return t}var Xht=e=>/^\w*$/.test(e),Zht=e=>void 0===e,Qht=e=>Array.isArray(e)?e.filter(Boolean):[],Jht=e=>Qht(e.replace(/["|']|\]/g,"").split(/\.|\[/)),eft=(e,t,r)=>{if(!t||!Wht(e))return r;const n=(Xht(t)?[t]:Jht(t)).reduce((e,t)=>qht(e)?e:e[t],e);return Zht(n)||n===e?Zht(e[t])?r:e[t]:n},tft=e=>"boolean"==typeof e,rft=(e,t,r)=>{let n=-1;const o=Xht(t)?[t]:Jht(t),a=o.length,i=a-1;for(;++n<a;){const t=o[n];let a=r;if(n!==i){const r=e[t];a=Wht(r)||Array.isArray(r)?r:isNaN(+o[n+1])?{}:[]}if("__proto__"===t||"constructor"===t||"prototype"===t)return;e[t]=a,e=e[t]}};const nft="blur",oft="focusout",aft="change",ift="onBlur",sft="onChange",lft="onSubmit",cft="onTouched",uft="all",dft="max",pft="min",hft="maxLength",fft="minLength",mft="pattern",vft="required",yft="validate",gft=l.default.createContext(null);gft.displayName="HookFormContext";const bft=()=>l.default.useContext(gft);var xft=(e,t,r,n=!0)=>{const o={defaultValues:t._defaultValues};for(const a in e)Object.defineProperty(o,a,{get:()=>{const o=a;return t._proxyFormState[o]!==uft&&(t._proxyFormState[o]=!n||uft),r&&(r[o]=!0),e[o]}});return o};const wft=typeof window<"u"?s.useLayoutEffect:s.useEffect;var kft=e=>"string"==typeof e,_ft=(e,t,r,n,o)=>kft(e)?(n&&t.watch.add(e),eft(r,e,o)):Array.isArray(e)?e.map(e=>(n&&t.watch.add(e),eft(r,e))):(n&&(t.watchAll=!0),r);function Cft(e){const t=bft(),{name:r,disabled:n,control:o=t.control,shouldUnregister:a}=e,i=Ght(o._names.array,r),s=function(e){const t=bft(),{control:r=t.control,name:n,defaultValue:o,disabled:a,exact:i}=e||{},s=l.default.useRef(o),[c,u]=l.default.useState(r._getWatch(n,s.current));return wft(()=>r._subscribe({name:n,formState:{values:!0},exact:i,callback:e=>!a&&u(_ft(n,r._names,e.values||r._formValues,!1,s.current))}),[n,r,a,i]),l.default.useEffect(()=>r._removeUnmounted()),c}({control:o,name:r,defaultValue:eft(o._formValues,r,eft(o._defaultValues,r,e.defaultValue)),exact:!0}),c=function(e){const t=bft(),{control:r=t.control,disabled:n,name:o,exact:a}=e||{},[i,s]=l.default.useState(r._formState),c=l.default.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return wft(()=>r._subscribe({name:o,formState:c.current,exact:a,callback:e=>{!n&&s({...r._formState,...e})}}),[o,n,a]),l.default.useEffect(()=>{c.current.isValid&&r._setValid(!0)},[r]),l.default.useMemo(()=>xft(i,r,c.current,!1),[i,r])}({control:o,name:r,exact:!0}),u=l.default.useRef(e),d=l.default.useRef(o.register(r,{...e.rules,value:s,...tft(e.disabled)?{disabled:e.disabled}:{}})),p=l.default.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!eft(c.errors,r)},isDirty:{enumerable:!0,get:()=>!!eft(c.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!eft(c.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!eft(c.validatingFields,r)},error:{enumerable:!0,get:()=>eft(c.errors,r)}}),[c,r]),h=l.default.useCallback(e=>d.current.onChange({target:{value:Uht(e),name:r},type:aft}),[r]),f=l.default.useCallback(()=>d.current.onBlur({target:{value:eft(o._formValues,r),name:r},type:nft}),[r,o._formValues]),m=l.default.useCallback(e=>{const t=eft(o._fields,r);t&&e&&(t._f.ref={focus:()=>e.focus&&e.focus(),select:()=>e.select&&e.select(),setCustomValidity:t=>e.setCustomValidity(t),reportValidity:()=>e.reportValidity()})},[o._fields,r]),v=l.default.useMemo(()=>({name:r,value:s,...tft(n)||c.disabled?{disabled:c.disabled||n}:{},onChange:h,onBlur:f,ref:m}),[r,n,c.disabled,h,f,m,s]);return l.default.useEffect(()=>{const e=o._options.shouldUnregister||a;o.register(r,{...u.current.rules,...tft(u.current.disabled)?{disabled:u.current.disabled}:{}});const t=(e,t)=>{const r=eft(o._fields,e);r&&r._f&&(r._f.mount=t)};if(t(r,!0),e){const e=Yht(eft(o._options.defaultValues,r));rft(o._defaultValues,r,e),Zht(eft(o._formValues,r))&&rft(o._formValues,r,e)}return!i&&o.register(r),()=>{(i?e&&!o._state.action:e)?o.unregister(r):t(r,!1)}},[r,o,i,a]),l.default.useEffect(()=>{o._setDisabledField({disabled:n,name:r})},[n,r,o]),l.default.useMemo(()=>({field:v,formState:c,fieldState:p}),[v,c,p])}const Mft=e=>e.render(Cft(e));var Sft=(e,t,r,n,o)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:o||!0}}:{},Dft=e=>Array.isArray(e)?e:[e],Oft=()=>{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=[]}}},Pft=e=>qht(e)||!$ht(e);function Eft(e,t,r=new WeakSet){if(Pft(e)||Pft(t))return e===t;if(Hht(e)&&Hht(t))return e.getTime()===t.getTime();const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const a of n){const n=e[a];if(!o.includes(a))return!1;if("ref"!==a){const e=t[a];if(Hht(n)&&Hht(e)||Wht(n)&&Wht(e)||Array.isArray(n)&&Array.isArray(e)?!Eft(n,e,r):n!==e)return!1}}return!0}var jft=e=>Wht(e)&&!Object.keys(e).length,Tft=e=>"file"===e.type,Nft=e=>"function"==typeof e,Rft=e=>{if(!Kht)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Fft=e=>"select-multiple"===e.type,zft=e=>"radio"===e.type,Ift=e=>Rft(e)&&e.isConnected;function Aft(e,t){const r=Array.isArray(t)?t:Xht(t)?[t]:Jht(t),n=1===r.length?e:function(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=Zht(e)?n++:e[t[n++]];return e}(e,r),o=r.length-1,a=r[o];return n&&delete n[a],0!==o&&(Wht(n)&&jft(n)||Array.isArray(n)&&function(e){for(const t in e)if(e.hasOwnProperty(t)&&!Zht(e[t]))return!1;return!0}(n))&&Aft(e,r.slice(0,-1)),e}var Lft=e=>{for(const t in e)if(Nft(e[t]))return!0;return!1};function Bft(e,t={}){const r=Array.isArray(e);if(Wht(e)||r)for(const r in e)Array.isArray(e[r])||Wht(e[r])&&!Lft(e[r])?(t[r]=Array.isArray(e[r])?[]:{},Bft(e[r],t[r])):qht(e[r])||(t[r]=!0);return t}function Vft(e,t,r){const n=Array.isArray(e);if(Wht(e)||n)for(const n in e)Array.isArray(e[n])||Wht(e[n])&&!Lft(e[n])?Zht(t)||Pft(r[n])?r[n]=Array.isArray(e[n])?Bft(e[n],[]):{...Bft(e[n])}:Vft(e[n],qht(t)?{}:t[n],r[n]):r[n]=!Eft(e[n],t[n]);return r}var Hft=(e,t)=>Vft(e,t,Bft(t));const qft={value:!1,isValid:!1},$ft={value:!0,isValid:!0};var Wft=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&&!Zht(e[0].attributes.value)?Zht(e[0].value)||""===e[0].value?$ft:{value:e[0].value,isValid:!0}:$ft:qft}return qft},Uft=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Zht(e)?e:t?""===e?NaN:e&&+e:r&&kft(e)?new Date(e):n?n(e):e;const Gft={isValid:!1,value:null};var Kft=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,Gft):Gft;function Yft(e){const t=e.ref;return Tft(t)?t.files:zft(t)?Kft(e.refs).value:Fft(t)?[...t.selectedOptions].map(({value:e})=>e):Vht(t)?Wft(e.refs).value:Uft(Zht(t.value)?e.ref.value:t.value,e)}var Xft=e=>e instanceof RegExp,Zft=e=>Zht(e)?e:Xft(e)?e.source:Wht(e)?Xft(e.value)?e.value.source:e.value:e,Qft=e=>({isOnSubmit:!e||e===lft,isOnBlur:e===ift,isOnChange:e===sft,isOnAll:e===uft,isOnTouch:e===cft});const Jft="AsyncFunction";var emt=e=>!!e&&!!e.validate&&!!(Nft(e.validate)&&e.validate.constructor.name===Jft||Wht(e.validate)&&Object.values(e.validate).find(e=>e.constructor.name===Jft)),tmt=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))));const rmt=(e,t,r,n)=>{for(const o of r||Object.keys(e)){const r=eft(e,o);if(r){const{_f:e,...a}=r;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],o)&&!n)return!0;if(e.ref&&t(e.ref,e.name)&&!n)return!0;if(rmt(a,t))break}else if(Wht(a)&&rmt(a,t))break}}};function nmt(e,t,r){const n=eft(e,r);if(n||Xht(r))return{error:n,name:r};const o=r.split(".");for(;o.length;){const n=o.join("."),a=eft(t,n),i=eft(e,n);if(a&&!Array.isArray(a)&&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};o.pop()}return{name:r}}var omt=(e,t,r)=>{const n=Dft(eft(e,r));return rft(n,"root",t[r]),rft(e,r,n),e},amt=e=>kft(e);function imt(e,t,r="validate"){if(amt(e)||Array.isArray(e)&&e.every(amt)||tft(e)&&!e)return{type:r,message:amt(e)?e:"",ref:t}}var smt=e=>Wht(e)&&!Xft(e)?e:{value:e,message:""},lmt=async(e,t,r,n,o,a)=>{const{ref:i,refs:s,required:l,maxLength:c,minLength:u,min:d,max:p,pattern:h,validate:f,name:m,valueAsNumber:v,mount:y}=e._f,g=eft(r,m);if(!y||t.has(m))return{};const b=s?s[0]:i,x=e=>{o&&b.reportValidity&&(b.setCustomValidity(tft(e)?"":e||""),b.reportValidity())},w={},k=zft(i),_=Vht(i),C=k||_,M=(v||Tft(i))&&Zht(i.value)&&Zht(g)||Rft(i)&&""===i.value||""===g||Array.isArray(g)&&!g.length,S=Sft.bind(null,m,n,w),D=(e,t,r,n=hft,o=fft)=>{const a=e?t:r;w[m]={type:e?n:o,message:a,ref:i,...S(e?n:o,a)}};if(a?!Array.isArray(g)||!g.length:l&&(!C&&(M||qht(g))||tft(g)&&!g||_&&!Wft(s).isValid||k&&!Kft(s).isValid)){const{value:e,message:t}=amt(l)?{value:!!l,message:l}:smt(l);if(e&&(w[m]={type:vft,message:t,ref:b,...S(vft,t)},!n))return x(t),w}if(!(M||qht(d)&&qht(p))){let e,t;const r=smt(p),o=smt(d);if(qht(g)||isNaN(g)){const n=i.valueAsDate||new Date(g),a=e=>new Date((new Date).toDateString()+" "+e),s="time"==i.type,l="week"==i.type;kft(r.value)&&g&&(e=s?a(g)>a(r.value):l?g>r.value:n>new Date(r.value)),kft(o.value)&&g&&(t=s?a(g)<a(o.value):l?g<o.value:n<new Date(o.value))}else{const n=i.valueAsNumber||g&&+g;qht(r.value)||(e=n>r.value),qht(o.value)||(t=n<o.value)}if((e||t)&&(D(!!e,r.message,o.message,dft,pft),!n))return x(w[m].message),w}if((c||u)&&!M&&(kft(g)||a&&Array.isArray(g))){const e=smt(c),t=smt(u),r=!qht(e.value)&&g.length>+e.value,o=!qht(t.value)&&g.length<+t.value;if((r||o)&&(D(r,e.message,t.message),!n))return x(w[m].message),w}if(h&&!M&&kft(g)){const{value:e,message:t}=smt(h);if(Xft(e)&&!g.match(e)&&(w[m]={type:mft,message:t,ref:i,...S(mft,t)},!n))return x(t),w}if(f)if(Nft(f)){const e=imt(await f(g,r),b);if(e&&(w[m]={...e,...S(yft,e.message)},!n))return x(e.message),w}else if(Wht(f)){let e={};for(const t in f){if(!jft(e)&&!n)break;const o=imt(await f[t](g,r),b,t);o&&(e={...o,...S(t,o.message)},x(o.message),n&&(w[m]=e))}if(!jft(e)&&(w[m]={ref:b,...e},!n))return w}return x(!0),w};const cmt={mode:lft,reValidateMode:sft,shouldFocusError:!0};function umt(e={}){let t,r={...cmt,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Nft(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1},o={},a=(Wht(r.defaultValues)||Wht(r.values))&&Yht(r.defaultValues||r.values)||{},i=r.shouldUnregister?{}:Yht(a),s={action:!1,mount:!1,watch:!1},l={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let d={...u};const p={array:Oft(),state:Oft()},h=r.criteriaMode===uft,f=async e=>{if(!r.disabled&&(u.isValid||d.isValid||e)){const e=r.resolver?jft((await b()).errors):await x(o,!0);e!==n.isValid&&p.state.next({isValid:e})}},m=(e,t)=>{!r.disabled&&(u.isValidating||u.validatingFields||d.isValidating||d.validatingFields)&&((e||Array.from(l.mount)).forEach(e=>{e&&(t?rft(n.validatingFields,e,t):Aft(n.validatingFields,e))}),p.state.next({validatingFields:n.validatingFields,isValidating:!jft(n.validatingFields)}))},v=(e,t,r,n)=>{const l=eft(o,e);if(l){const o=eft(i,e,Zht(r)?eft(a,e):r);Zht(o)||n&&n.defaultChecked||t?rft(i,e,t?o:Yft(l._f)):_(e,o),s.mount&&f()}},y=(e,t,o,i,s)=>{let l=!1,c=!1;const h={name:e};if(!r.disabled){if(!o||i){(u.isDirty||d.isDirty)&&(c=n.isDirty,n.isDirty=h.isDirty=w(),l=c!==h.isDirty);const r=Eft(eft(a,e),t);c=!!eft(n.dirtyFields,e),r?Aft(n.dirtyFields,e):rft(n.dirtyFields,e,!0),h.dirtyFields=n.dirtyFields,l=l||(u.dirtyFields||d.dirtyFields)&&c!==!r}if(o){const t=eft(n.touchedFields,e);t||(rft(n.touchedFields,e,o),h.touchedFields=n.touchedFields,l=l||(u.touchedFields||d.touchedFields)&&t!==o)}l&&s&&p.state.next(h)}return l?h:{}},g=(e,o,a,i)=>{const s=eft(n.errors,e),l=(u.isValid||d.isValid)&&tft(o)&&n.isValid!==o;if(r.delayError&&a?(t=(e=>t=>{clearTimeout(c),c=setTimeout(e,t)})(()=>((e,t)=>{rft(n.errors,e,t),p.state.next({errors:n.errors})})(e,a)),t(r.delayError)):(clearTimeout(c),t=null,a?rft(n.errors,e,a):Aft(n.errors,e)),(a?!Eft(s,a):s)||!jft(i)||l){const t={...i,...l&&tft(o)?{isValid:o}:{},errors:n.errors,name:e};n={...n,...t},p.state.next(t)}},b=async e=>{m(e,!0);const t=await r.resolver(i,r.context,((e,t,r,n)=>{const o={};for(const r of e){const e=eft(t,r);e&&rft(o,r,e._f)}return{criteriaMode:r,names:[...e],fields:o,shouldUseNativeValidation:n}})(e||l.mount,o,r.criteriaMode,r.shouldUseNativeValidation));return m(e),t},x=async(e,t,o={valid:!0})=>{for(const a in e){const s=e[a];if(s){const{_f:e,...c}=s;if(e){const c=l.array.has(e.name),d=s._f&&emt(s._f);d&&u.validatingFields&&m([a],!0);const p=await lmt(s,l.disabled,i,h,r.shouldUseNativeValidation&&!t,c);if(d&&u.validatingFields&&m([a]),p[e.name]&&(o.valid=!1,t))break;!t&&(eft(p,e.name)?c?omt(n.errors,p,e.name):rft(n.errors,e.name,p[e.name]):Aft(n.errors,e.name))}!jft(c)&&await x(c,t,o)}}return o.valid},w=(e,t)=>!r.disabled&&(e&&t&&rft(i,e,t),!Eft(P(),a)),k=(e,t,r)=>_ft(e,l,{...s.mount?i:Zht(t)?a:kft(e)?{[e]:t}:t},r,t),_=(e,t,r={})=>{const n=eft(o,e);let a=t;if(n){const r=n._f;r&&(!r.disabled&&rft(i,e,Uft(t,r)),a=Rft(r.ref)&&qht(t)?"":t,Fft(r.ref)?[...r.ref.options].forEach(e=>e.selected=a.includes(e.value)):r.refs?Vht(r.ref)?r.refs.forEach(e=>{(!e.defaultChecked||!e.disabled)&&(Array.isArray(a)?e.checked=!!a.find(t=>t===e.value):e.checked=a===e.value||!!a)}):r.refs.forEach(e=>e.checked=e.value===a):Tft(r.ref)?r.ref.value="":(r.ref.value=a,r.ref.type||p.state.next({name:e,values:Yht(i)})))}(r.shouldDirty||r.shouldTouch)&&y(e,a,r.shouldTouch,r.shouldDirty,!0),r.shouldValidate&&O(e)},C=(e,t,r)=>{for(const n in t){if(!t.hasOwnProperty(n))return;const a=t[n],i=e+"."+n,s=eft(o,i);(l.array.has(e)||Wht(a)||s&&!s._f)&&!Hht(a)?C(i,a,r):_(i,a,r)}},M=(e,t,r={})=>{const c=eft(o,e),h=l.array.has(e),f=Yht(t);rft(i,e,f),h?(p.array.next({name:e,values:Yht(i)}),(u.isDirty||u.dirtyFields||d.isDirty||d.dirtyFields)&&r.shouldDirty&&p.state.next({name:e,dirtyFields:Hft(a,i),isDirty:w(e,f)})):!c||c._f||qht(f)?_(e,f,r):C(e,f,r),tmt(e,l)&&p.state.next({...n}),p.state.next({name:s.mount?e:void 0,values:Yht(i)})},S=async e=>{s.mount=!0;const a=e.target;let c=a.name,v=!0;const w=eft(o,c),k=e=>{v=Number.isNaN(e)||Hht(e)&&isNaN(e.getTime())||Eft(e,eft(i,c,e))},_=Qft(r.mode),C=Qft(r.reValidateMode);if(w){let s,M;const S=a.type?Yft(w._f):Uht(e),D=e.type===nft||e.type===oft,P=!(e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate))(w._f)&&!r.resolver&&!eft(n.errors,c)&&!w._f.deps||((e,t,r,n,o)=>!o.isOnAll&&(!r&&o.isOnTouch?!(t||e):(r?n.isOnBlur:o.isOnBlur)?!e:!(r?n.isOnChange:o.isOnChange)||e))(D,eft(n.touchedFields,c),n.isSubmitted,C,_),E=tmt(c,l,D);rft(i,c,S),D?(w._f.onBlur&&w._f.onBlur(e),t&&t(0)):w._f.onChange&&w._f.onChange(e);const j=y(c,S,D),T=!jft(j)||E;if(!D&&p.state.next({name:c,type:e.type,values:Yht(i)}),P)return(u.isValid||d.isValid)&&("onBlur"===r.mode?D&&f():D||f()),T&&p.state.next({name:c,...E?{}:j});if(!D&&E&&p.state.next({...n}),r.resolver){const{errors:e}=await b([c]);if(k(S),v){const t=nmt(n.errors,o,c),r=nmt(e,o,t.name||c);s=r.error,c=r.name,M=jft(e)}}else m([c],!0),s=(await lmt(w,l.disabled,i,h,r.shouldUseNativeValidation))[c],m([c]),k(S),v&&(s?M=!1:(u.isValid||d.isValid)&&(M=await x(o,!0)));v&&(w._f.deps&&O(w._f.deps),g(c,M,s,j))}},D=(e,t)=>{if(eft(n.errors,t)&&e.focus)return e.focus(),1},O=async(e,t={})=>{let a,i;const s=Dft(e);if(r.resolver){const t=await(async e=>{const{errors:t}=await b(e);if(e)for(const r of e){const e=eft(t,r);e?rft(n.errors,r,e):Aft(n.errors,r)}else n.errors=t;return t})(Zht(e)?e:s);a=jft(t),i=e?!s.some(e=>eft(t,e)):a}else e?(i=(await Promise.all(s.map(async e=>{const t=eft(o,e);return await x(t&&t._f?{[e]:t}:t)}))).every(Boolean),(i||n.isValid)&&f()):i=a=await x(o);return p.state.next({...!kft(e)||(u.isValid||d.isValid)&&a!==n.isValid?{}:{name:e},...r.resolver||!e?{isValid:a}:{},errors:n.errors}),t.shouldFocus&&!i&&rmt(o,D,e?s:l.mount),i},P=e=>{const t={...s.mount?i:a};return Zht(e)?t:kft(e)?eft(t,e):e.map(e=>eft(t,e))},E=(e,t)=>({invalid:!!eft((t||n).errors,e),isDirty:!!eft((t||n).dirtyFields,e),error:eft((t||n).errors,e),isValidating:!!eft(n.validatingFields,e),isTouched:!!eft((t||n).touchedFields,e)}),j=(e,t,r)=>{const a=(eft(o,e,{_f:{}})._f||{}).ref,i=eft(n.errors,e)||{},{ref:s,message:l,type:c,...u}=i;rft(n.errors,e,{...u,...t,ref:a}),p.state.next({name:e,errors:n.errors,isValid:!1}),r&&r.shouldFocus&&a&&a.focus&&a.focus()},T=e=>p.state.subscribe({next:t=>{((e,t,r)=>!e||!t||e===t||Dft(e).some(e=>e&&(r?e===t:e.startsWith(t)||t.startsWith(e))))(e.name,t.name,e.exact)&&((e,t,r,n)=>{r(e);const{name:o,...a}=e;return jft(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(e=>t[e]===(!n||uft))})(t,e.formState||u,B,e.reRenderRoot)&&e.callback({values:{...i},...n,...t})}}).unsubscribe,N=(e,t={})=>{for(const s of e?Dft(e):l.mount)l.mount.delete(s),l.array.delete(s),t.keepValue||(Aft(o,s),Aft(i,s)),!t.keepError&&Aft(n.errors,s),!t.keepDirty&&Aft(n.dirtyFields,s),!t.keepTouched&&Aft(n.touchedFields,s),!t.keepIsValidating&&Aft(n.validatingFields,s),!r.shouldUnregister&&!t.keepDefaultValue&&Aft(a,s);p.state.next({values:Yht(i)}),p.state.next({...n,...t.keepDirty?{isDirty:w()}:{}}),!t.keepIsValid&&f()},R=({disabled:e,name:t})=>{(tft(e)&&s.mount||e||l.disabled.has(t))&&(e?l.disabled.add(t):l.disabled.delete(t))},F=(e,t={})=>{let n=eft(o,e);const i=tft(t.disabled)||tft(r.disabled);return rft(o,e,{...n||{},_f:{...n&&n._f?n._f:{ref:{name:e}},name:e,mount:!0,...t}}),l.mount.add(e),n?R({disabled:tft(t.disabled)?t.disabled:r.disabled,name:e}):v(e,!0,t.value),{...i?{disabled:t.disabled||r.disabled}:{},...r.progressive?{required:!!t.required,min:Zft(t.min),max:Zft(t.max),minLength:Zft(t.minLength),maxLength:Zft(t.maxLength),pattern:Zft(t.pattern)}:{},name:e,onChange:S,onBlur:S,ref:i=>{if(i){F(e,t),n=eft(o,e);const r=Zht(i.value)&&i.querySelectorAll&&i.querySelectorAll("input,select,textarea")[0]||i,s=(e=>zft(e)||Vht(e))(r),l=n._f.refs||[];if(s?l.find(e=>e===r):r===n._f.ref)return;rft(o,e,{_f:{...n._f,...s?{refs:[...l.filter(Ift),r,...Array.isArray(eft(a,e))?[{}]:[]],ref:{type:r.type,name:e}}:{ref:r}}}),v(e,!1,void 0,r)}else n=eft(o,e,{}),n._f&&(n._f.mount=!1),(r.shouldUnregister||t.shouldUnregister)&&(!Ght(l.array,e)||!s.action)&&l.unMount.add(e)}}},z=()=>r.shouldFocusError&&rmt(o,D,l.mount),I=(e,t)=>async a=>{let s;a&&(a.preventDefault&&a.preventDefault(),a.persist&&a.persist());let c=Yht(i);if(p.state.next({isSubmitting:!0}),r.resolver){const{errors:e,values:t}=await b();n.errors=e,c=Yht(t)}else await x(o);if(l.disabled.size)for(const e of l.disabled)Aft(c,e);if(Aft(n.errors,"root"),jft(n.errors)){p.state.next({errors:{}});try{await e(c,a)}catch(e){s=e}}else t&&await t({...n.errors},a),z(),setTimeout(z);if(p.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:jft(n.errors)&&!s,submitCount:n.submitCount+1,errors:n.errors}),s)throw s},A=(e,t={})=>{const c=e?Yht(e):a,d=Yht(c),h=jft(e),f=h?a:d;if(t.keepDefaultValues||(a=c),!t.keepValues){if(t.keepDirtyValues){const e=new Set([...l.mount,...Object.keys(Hft(a,i))]);for(const t of Array.from(e))eft(n.dirtyFields,t)?rft(f,t,eft(i,t)):M(t,eft(f,t))}else{if(Kht&&Zht(e))for(const e of l.mount){const t=eft(o,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(Rft(e)){const t=e.closest("form");if(t){t.reset();break}}}}if(t.keepFieldsRef)for(const e of l.mount)M(e,eft(f,e));else o={}}i=r.shouldUnregister?t.keepDefaultValues?Yht(a):{}:Yht(f),p.array.next({values:{...f}}),p.state.next({values:{...f}})}l={mount:t.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!u.isValid||!!t.keepIsValid||!!t.keepDirtyValues,s.watch=!!r.shouldUnregister,p.state.next({submitCount:t.keepSubmitCount?n.submitCount:0,isDirty:!h&&(t.keepDirty?n.isDirty:!(!t.keepDefaultValues||Eft(e,a))),isSubmitted:!!t.keepIsSubmitted&&n.isSubmitted,dirtyFields:h?{}:t.keepDirtyValues?t.keepDefaultValues&&i?Hft(a,i):n.dirtyFields:t.keepDefaultValues&&e?Hft(a,e):t.keepDirty?n.dirtyFields:{},touchedFields:t.keepTouched?n.touchedFields:{},errors:t.keepErrors?n.errors:{},isSubmitSuccessful:!!t.keepIsSubmitSuccessful&&n.isSubmitSuccessful,isSubmitting:!1})},L=(e,t)=>A(Nft(e)?e(i):e,t),B=e=>{n={...n,...e}},V={control:{register:F,unregister:N,getFieldState:E,handleSubmit:I,setError:j,_subscribe:T,_runSchema:b,_focusError:z,_getWatch:k,_getDirty:w,_setValid:f,_setFieldArray:(e,t=[],l,c,h=!0,f=!0)=>{if(c&&l&&!r.disabled){if(s.action=!0,f&&Array.isArray(eft(o,e))){const t=l(eft(o,e),c.argA,c.argB);h&&rft(o,e,t)}if(f&&Array.isArray(eft(n.errors,e))){const t=l(eft(n.errors,e),c.argA,c.argB);h&&rft(n.errors,e,t),((e,t)=>{!Qht(eft(e,t)).length&&Aft(e,t)})(n.errors,e)}if((u.touchedFields||d.touchedFields)&&f&&Array.isArray(eft(n.touchedFields,e))){const t=l(eft(n.touchedFields,e),c.argA,c.argB);h&&rft(n.touchedFields,e,t)}(u.dirtyFields||d.dirtyFields)&&(n.dirtyFields=Hft(a,i)),p.state.next({name:e,isDirty:w(e,t),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else rft(i,e,t)},_setDisabledField:R,_setErrors:e=>{n.errors=e,p.state.next({errors:n.errors,isValid:!1})},_getFieldArray:e=>Qht(eft(s.mount?i:a,e,r.shouldUnregister?eft(a,e,[]):[])),_reset:A,_resetDefaultValues:()=>Nft(r.defaultValues)&&r.defaultValues().then(e=>{L(e,r.resetOptions),p.state.next({isLoading:!1})}),_removeUnmounted:()=>{for(const e of l.unMount){const t=eft(o,e);t&&(t._f.refs?t._f.refs.every(e=>!Ift(e)):!Ift(t._f.ref))&&N(e)}l.unMount=new Set},_disableForm:e=>{tft(e)&&(p.state.next({disabled:e}),rmt(o,(t,r)=>{const n=eft(o,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:p,_proxyFormState:u,get _fields(){return o},get _formValues(){return i},get _state(){return s},set _state(e){s=e},get _defaultValues(){return a},get _names(){return l},set _names(e){l=e},get _formState(){return n},get _options(){return r},set _options(e){r={...r,...e}}},subscribe:e=>(s.mount=!0,d={...d,...e.formState},T({...e,formState:d})),trigger:O,register:F,handleSubmit:I,watch:(e,t)=>Nft(e)?p.state.subscribe({next:r=>e(k(void 0,t),r)}):k(e,t,!0),setValue:M,getValues:P,reset:L,resetField:(e,t={})=>{eft(o,e)&&(Zht(t.defaultValue)?M(e,Yht(eft(a,e))):(M(e,t.defaultValue),rft(a,e,Yht(t.defaultValue))),t.keepTouched||Aft(n.touchedFields,e),t.keepDirty||(Aft(n.dirtyFields,e),n.isDirty=t.defaultValue?w(e,Yht(eft(a,e))):w()),t.keepError||(Aft(n.errors,e),u.isValid&&f()),p.state.next({...n}))},clearErrors:e=>{e&&Dft(e).forEach(e=>Aft(n.errors,e)),p.state.next({errors:e?n.errors:{}})},unregister:N,setError:j,setFocus:(e,t={})=>{const r=eft(o,e),n=r&&r._f;if(n){const e=n.refs?n.refs[0]:n.ref;e.focus&&(e.focus(),t.shouldSelect&&Nft(e.select)&&e.select())}},getFieldState:E};return{...V,formControl:V}}var dmt=s.forwardRef((e,r)=>t.jsx(ult.label,{...e,ref:r,onMouseDown:t=>{var r;t.target.closest("button, input, select, textarea")||(null==(r=e.onMouseDown)||r.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));dmt.displayName="Label";var pmt=dmt;const hmt=Odt("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),fmt=s.forwardRef(({className:e,...r},n)=>t.jsx(pmt,{ref:n,className:vdt(hmt(),e),...r}));fmt.displayName=pmt.displayName;const mmt=e=>{const{children:t,...r}=e;return l.default.createElement(gft.Provider,{value:r},t)},vmt=s.createContext({}),ymt=({...e})=>t.jsx(vmt.Provider,{value:{name:e.name},children:t.jsx(Mft,{...e})}),gmt=()=>{const e=s.useContext(vmt),t=s.useContext(bmt),{getFieldState:r,formState:n}=bft(),o=r(e.name,n);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:a}=t;return{id:a,name:e.name,formItemId:`${a}-form-item`,formDescriptionId:`${a}-form-item-description`,formMessageId:`${a}-form-item-message`,...o}},bmt=s.createContext({}),xmt=s.forwardRef(({className:e,...r},n)=>{const o=s.useId();return t.jsx(bmt.Provider,{value:{id:o},children:t.jsx("div",{ref:n,className:vdt("space-y-2",e),...r})})});xmt.displayName="FormItem";const wmt=s.forwardRef(({className:e,...r},n)=>{const{error:o,formItemId:a}=gmt();return t.jsx(fmt,{ref:n,className:vdt(o&&"text-destructive",e),htmlFor:a,...r})});wmt.displayName="FormLabel";const kmt=s.forwardRef(({...e},r)=>{const{error:n,formItemId:o,formDescriptionId:a,formMessageId:i}=gmt();return t.jsx(alt,{ref:r,id:o,"aria-describedby":n?`${a} ${i}`:`${a}`,"aria-invalid":!!n,...e})});kmt.displayName="FormControl";const _mt=s.forwardRef(({className:e,...r},n)=>{const{formDescriptionId:o}=gmt();return t.jsx("p",{ref:n,id:o,className:vdt("text-sm text-muted-foreground",e),...r})});_mt.displayName="FormDescription";const Cmt=s.forwardRef(({className:e,children:r,...n},o)=>{const{error:a,formMessageId:i}=gmt(),s=a?String(null==a?void 0:a.message):r;return s?t.jsx("p",{ref:o,id:i,className:vdt("text-sm font-medium text-destructive",e),...n,children:s}):null});Cmt.displayName="FormMessage";const Mmt=s.forwardRef(({className:e,type:r,...n},o)=>t.jsx("input",{type:r,className:vdt("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:o,...n}));Mmt.displayName="Input";const Smt=["top","right","bottom","left"],Dmt=Math.min,Omt=Math.max,Pmt=Math.round,Emt=Math.floor,jmt=e=>({x:e,y:e}),Tmt={left:"right",right:"left",bottom:"top",top:"bottom"},Nmt={start:"end",end:"start"};function Rmt(e,t,r){return Omt(e,Dmt(t,r))}function Fmt(e,t){return"function"==typeof e?e(t):e}function zmt(e){return e.split("-")[0]}function Imt(e){return e.split("-")[1]}function Amt(e){return"x"===e?"y":"x"}function Lmt(e){return"y"===e?"height":"width"}const Bmt=new Set(["top","bottom"]);function Vmt(e){return Bmt.has(zmt(e))?"y":"x"}function Hmt(e){return Amt(Vmt(e))}function qmt(e){return e.replace(/start|end/g,e=>Nmt[e])}const $mt=["left","right"],Wmt=["right","left"],Umt=["top","bottom"],Gmt=["bottom","top"];function Kmt(e,t,r,n){const o=Imt(e);let a=function(e,t,r){switch(e){case"top":case"bottom":return r?t?Wmt:$mt:t?$mt:Wmt;case"left":case"right":return t?Umt:Gmt;default:return[]}}(zmt(e),"start"===r,n);return o&&(a=a.map(e=>e+"-"+o),t&&(a=a.concat(a.map(qmt)))),a}function Ymt(e){return e.replace(/left|right|bottom|top/g,e=>Tmt[e])}function Xmt(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 Zmt(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function Qmt(e,t,r){let{reference:n,floating:o}=e;const a=Vmt(t),i=Hmt(t),s=Lmt(i),l=zmt(t),c="y"===a,u=n.x+n.width/2-o.width/2,d=n.y+n.height/2-o.height/2,p=n[s]/2-o[s]/2;let h;switch(l){case"top":h={x:u,y:n.y-o.height};break;case"bottom":h={x:u,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:d};break;case"left":h={x:n.x-o.width,y:d};break;default:h={x:n.x,y:n.y}}switch(Imt(t)){case"start":h[i]-=p*(r&&c?-1:1);break;case"end":h[i]+=p*(r&&c?-1:1)}return h}async function Jmt(e,t){var r;void 0===t&&(t={});const{x:n,y:o,platform:a,rects:i,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:h=0}=Fmt(t,e),f=Xmt(h),m=s[p?"floating"===d?"reference":"floating":d],v=Zmt(await a.getClippingRect({element:null==(r=await(null==a.isElement?void 0:a.isElement(m)))||r?m:m.contextElement||await(null==a.getDocumentElement?void 0:a.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),y="floating"===d?{x:n,y:o,width:i.floating.width,height:i.floating.height}:i.reference,g=await(null==a.getOffsetParent?void 0:a.getOffsetParent(s.floating)),b=await(null==a.isElement?void 0:a.isElement(g))&&await(null==a.getScale?void 0:a.getScale(g))||{x:1,y:1},x=Zmt(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:g,strategy:l}):y);return{top:(v.top-x.top+f.top)/b.y,bottom:(x.bottom-v.bottom+f.bottom)/b.y,left:(v.left-x.left+f.left)/b.x,right:(x.right-v.right+f.right)/b.x}}function evt(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function tvt(e){return Smt.some(t=>e[t]>=0)}const rvt=new Set(["left","top"]);function nvt(){return typeof window<"u"}function ovt(e){return svt(e)?(e.nodeName||"").toLowerCase():"#document"}function avt(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function ivt(e){var t;return null==(t=(svt(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function svt(e){return!!nvt()&&(e instanceof Node||e instanceof avt(e).Node)}function lvt(e){return!!nvt()&&(e instanceof Element||e instanceof avt(e).Element)}function cvt(e){return!!nvt()&&(e instanceof HTMLElement||e instanceof avt(e).HTMLElement)}function uvt(e){return!(!nvt()||typeof ShadowRoot>"u")&&(e instanceof ShadowRoot||e instanceof avt(e).ShadowRoot)}const dvt=new Set(["inline","contents"]);function pvt(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=Cvt(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!dvt.has(o)}const hvt=new Set(["table","td","th"]);function fvt(e){return hvt.has(ovt(e))}const mvt=[":popover-open",":modal"];function vvt(e){return mvt.some(t=>{try{return e.matches(t)}catch{return!1}})}const yvt=["transform","translate","scale","rotate","perspective"],gvt=["transform","translate","scale","rotate","perspective","filter"],bvt=["paint","layout","strict","content"];function xvt(e){const t=wvt(),r=lvt(e)?Cvt(e):e;return yvt.some(e=>!!r[e]&&"none"!==r[e])||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||gvt.some(e=>(r.willChange||"").includes(e))||bvt.some(e=>(r.contain||"").includes(e))}function wvt(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const kvt=new Set(["html","body","#document"]);function _vt(e){return kvt.has(ovt(e))}function Cvt(e){return avt(e).getComputedStyle(e)}function Mvt(e){return lvt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Svt(e){if("html"===ovt(e))return e;const t=e.assignedSlot||e.parentNode||uvt(e)&&e.host||ivt(e);return uvt(t)?t.host:t}function Dvt(e){const t=Svt(e);return _vt(t)?e.ownerDocument?e.ownerDocument.body:e.body:cvt(t)&&pvt(t)?t:Dvt(t)}function Ovt(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);const o=Dvt(e),a=o===(null==(n=e.ownerDocument)?void 0:n.body),i=avt(o);if(a){const e=Pvt(i);return t.concat(i,i.visualViewport||[],pvt(o)?o:[],e&&r?Ovt(e):[])}return t.concat(o,Ovt(o,[],r))}function Pvt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Evt(e){const t=Cvt(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=cvt(e),a=o?e.offsetWidth:r,i=o?e.offsetHeight:n,s=Pmt(r)!==a||Pmt(n)!==i;return s&&(r=a,n=i),{width:r,height:n,$:s}}function jvt(e){return lvt(e)?e:e.contextElement}function Tvt(e){const t=jvt(e);if(!cvt(t))return jmt(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:a}=Evt(t);let i=(a?Pmt(r.width):r.width)/n,s=(a?Pmt(r.height):r.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!s||!Number.isFinite(s))&&(s=1),{x:i,y:s}}const Nvt=jmt(0);function Rvt(e){const t=avt(e);return wvt()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Nvt}function Fvt(e,t,r,n){void 0===t&&(t=!1),void 0===r&&(r=!1);const o=e.getBoundingClientRect(),a=jvt(e);let i=jmt(1);t&&(n?lvt(n)&&(i=Tvt(n)):i=Tvt(e));const s=function(e,t,r){return void 0===t&&(t=!1),!(!r||t&&r!==avt(e))&&t}(a,r,n)?Rvt(a):jmt(0);let l=(o.left+s.x)/i.x,c=(o.top+s.y)/i.y,u=o.width/i.x,d=o.height/i.y;if(a){const e=avt(a),t=n&&lvt(n)?avt(n):n;let r=e,o=Pvt(r);for(;o&&n&&t!==r;){const e=Tvt(o),t=o.getBoundingClientRect(),n=Cvt(o),a=t.left+(o.clientLeft+parseFloat(n.paddingLeft))*e.x,i=t.top+(o.clientTop+parseFloat(n.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=a,c+=i,r=avt(o),o=Pvt(r)}}return Zmt({width:u,height:d,x:l,y:c})}function zvt(e,t){const r=Mvt(e).scrollLeft;return t?t.left+r:Fvt(ivt(e)).left+r}function Ivt(e,t,r){void 0===r&&(r=!1);const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-(r?0:zvt(e,n)),y:n.top+t.scrollTop}}const Avt=new Set(["absolute","fixed"]);function Lvt(e,t,r){let n;if("viewport"===t)n=function(e,t){const r=avt(e),n=ivt(e),o=r.visualViewport;let a=n.clientWidth,i=n.clientHeight,s=0,l=0;if(o){a=o.width,i=o.height;const e=wvt();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:a,height:i,x:s,y:l}}(e,r);else if("document"===t)n=function(e){const t=ivt(e),r=Mvt(e),n=e.ownerDocument.body,o=Omt(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),a=Omt(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+zvt(e);const s=-r.scrollTop;return"rtl"===Cvt(n).direction&&(i+=Omt(t.clientWidth,n.clientWidth)-o),{width:o,height:a,x:i,y:s}}(ivt(e));else if(lvt(t))n=function(e,t){const r=Fvt(e,!0,"fixed"===t),n=r.top+e.clientTop,o=r.left+e.clientLeft,a=cvt(e)?Tvt(e):jmt(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:o*a.x,y:n*a.y}}(t,r);else{const r=Rvt(e);n={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Zmt(n)}function Bvt(e,t){const r=Svt(e);return!(r===t||!lvt(r)||_vt(r))&&("fixed"===Cvt(r).position||Bvt(r,t))}function Vvt(e,t){const r=t.get(e);if(r)return r;let n=Ovt(e,[],!1).filter(e=>lvt(e)&&"body"!==ovt(e)),o=null;const a="fixed"===Cvt(e).position;let i=a?Svt(e):e;for(;lvt(i)&&!_vt(i);){const t=Cvt(i),r=xvt(i);!r&&"fixed"===t.position&&(o=null),(a?!r&&!o:!r&&"static"===t.position&&o&&Avt.has(o.position)||pvt(i)&&!r&&Bvt(e,i))?n=n.filter(e=>e!==i):o=t,i=Svt(i)}return t.set(e,n),n}function Hvt(e,t,r){const n=cvt(t),o=ivt(t),a="fixed"===r,i=Fvt(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=jmt(0);function c(){l.x=zvt(o)}if(n||!n&&!a)if(("body"!==ovt(t)||pvt(o))&&(s=Mvt(t)),n){const e=Fvt(t,!0,a,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&c();a&&!n&&o&&c();const u=!o||n||a?jmt(0):Ivt(o,s);return{x:i.left+s.scrollLeft-l.x-u.x,y:i.top+s.scrollTop-l.y-u.y,width:i.width,height:i.height}}function qvt(e){return"static"===Cvt(e).position}function $vt(e,t){if(!cvt(e)||"fixed"===Cvt(e).position)return null;if(t)return t(e);let r=e.offsetParent;return ivt(e)===r&&(r=r.ownerDocument.body),r}function Wvt(e,t){const r=avt(e);if(vvt(e))return r;if(!cvt(e)){let t=Svt(e);for(;t&&!_vt(t);){if(lvt(t)&&!qvt(t))return t;t=Svt(t)}return r}let n=$vt(e,t);for(;n&&fvt(n)&&qvt(n);)n=$vt(n,t);return n&&_vt(n)&&qvt(n)&&!xvt(n)?r:n||function(e){let t=Svt(e);for(;cvt(t)&&!_vt(t);){if(xvt(t))return t;if(vvt(t))return null;t=Svt(t)}return null}(e)||r}const Uvt={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const a="fixed"===o,i=ivt(n),s=!!t&&vvt(t.floating);if(n===i||s&&a)return r;let l={scrollLeft:0,scrollTop:0},c=jmt(1);const u=jmt(0),d=cvt(n);if((d||!d&&!a)&&(("body"!==ovt(n)||pvt(i))&&(l=Mvt(n)),cvt(n))){const e=Fvt(n);c=Tvt(n),u.x=e.x+n.clientLeft,u.y=e.y+n.clientTop}const p=!i||d||a?jmt(0):Ivt(i,l,!0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+u.x+p.x,y:r.y*c.y-l.scrollTop*c.y+u.y+p.y}},getDocumentElement:ivt,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const a=[..."clippingAncestors"===r?vvt(t)?[]:Vvt(t,this._c):[].concat(r),n],i=a[0],s=a.reduce((e,r)=>{const n=Lvt(t,r,o);return e.top=Omt(n.top,e.top),e.right=Dmt(n.right,e.right),e.bottom=Dmt(n.bottom,e.bottom),e.left=Omt(n.left,e.left),e},Lvt(t,i,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:Wvt,getElementRects:async function(e){const t=this.getOffsetParent||Wvt,r=this.getDimensions,n=await r(e.floating);return{reference:Hvt(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}=Evt(e);return{width:t,height:r}},getScale:Tvt,isElement:lvt,isRTL:function(e){return"rtl"===Cvt(e).direction}};function Gvt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Kvt(e,t,r,n){void 0===n&&(n={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=n,c=jvt(e),u=o||a?[...c?Ovt(c):[],...Ovt(t)]:[];u.forEach(e=>{o&&e.addEventListener("scroll",r,{passive:!0}),a&&e.addEventListener("resize",r)});const d=c&&s?function(e,t){let r,n=null;const o=ivt(e);function a(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return function i(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),a();const c=e.getBoundingClientRect(),{left:u,top:d,width:p,height:h}=c;if(s||t(),!p||!h)return;const f={rootMargin:-Emt(d)+"px "+-Emt(o.clientWidth-(u+p))+"px "+-Emt(o.clientHeight-(d+h))+"px "+-Emt(u)+"px",threshold:Omt(0,Dmt(1,l))||1};let m=!0;function v(t){const n=t[0].intersectionRatio;if(n!==l){if(!m)return i();n?i(!1,n):r=setTimeout(()=>{i(!1,1e-7)},1e3)}1===n&&!Gvt(c,e.getBoundingClientRect())&&i(),m=!1}try{n=new IntersectionObserver(v,{...f,root:o.ownerDocument})}catch{n=new IntersectionObserver(v,f)}n.observe(e)}(!0),a}(c,r):null;let p=-1,h=null;i&&(h=new ResizeObserver(e=>{let[n]=e;n&&n.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),r()}),c&&!l&&h.observe(c),h.observe(t));let f,m=l?Fvt(e):null;return l&&function t(){const n=Fvt(e);m&&!Gvt(m,n)&&r(),m=n,f=requestAnimationFrame(t)}(),r(),()=>{var e;u.forEach(e=>{o&&e.removeEventListener("scroll",r),a&&e.removeEventListener("resize",r)}),null==d||d(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(f)}}const Yvt=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:a,placement:i,middlewareData:s}=t,l=await async function(e,t){const{placement:r,platform:n,elements:o}=e,a=await(null==n.isRTL?void 0:n.isRTL(o.floating)),i=zmt(r),s=Imt(r),l="y"===Vmt(r),c=rvt.has(i)?-1:1,u=a&&l?-1:1,d=Fmt(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:f}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof f&&(h="end"===s?-1*f:f),l?{x:h*u,y:p*c}:{x:p*c,y:h*u}}(t,e);return i===(null==(r=s.offset)?void 0:r.placement)&&null!=(n=s.arrow)&&n.alignmentOffset?{}:{x:o+l.x,y:a+l.y,data:{...l,placement:i}}}}},Xvt=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:s={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...l}=Fmt(e,t),c={x:r,y:n},u=await Jmt(t,l),d=Vmt(zmt(o)),p=Amt(d);let h=c[p],f=c[d];if(a){const e="y"===p?"bottom":"right";h=Rmt(h+u["y"===p?"top":"left"],h,h-u[e])}if(i){const e="y"===d?"bottom":"right";f=Rmt(f+u["y"===d?"top":"left"],f,f-u[e])}const m=s.fn({...t,[p]:h,[d]:f});return{...m,data:{x:m.x-r,y:m.y-n,enabled:{[p]:a,[d]:i}}}}}},Zvt=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:a,rects:i,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:m=!0,...v}=Fmt(e,t);if(null!=(r=a.arrow)&&r.alignmentOffset)return{};const y=zmt(o),g=Vmt(s),b=zmt(s)===s,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=p||(b||!m?[Ymt(s)]:function(e){const t=Ymt(e);return[qmt(e),t,qmt(t)]}(s)),k="none"!==f;!p&&k&&w.push(...Kmt(s,m,f,x));const _=[s,...w],C=await Jmt(t,v),M=[];let S=(null==(n=a.flip)?void 0:n.overflows)||[];if(u&&M.push(C[y]),d){const e=function(e,t,r){void 0===r&&(r=!1);const n=Imt(e),o=Hmt(e),a=Lmt(o);let i="x"===o?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=Ymt(i)),[i,Ymt(i)]}(o,i,x);M.push(C[e[0]],C[e[1]])}if(S=[...S,{placement:o,overflows:M}],!M.every(e=>e<=0)){var D,O;const e=((null==(D=a.flip)?void 0:D.index)||0)+1,t=_[e];if(t&&("alignment"!==d||g===Vmt(t)||S.every(e=>e.overflows[0]>0&&Vmt(e.placement)===g)))return{data:{index:e,overflows:S},reset:{placement:t}};let r=null==(O=S.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:O.placement;if(!r)switch(h){case"bestFit":{var P;const e=null==(P=S.filter(e=>{if(k){const t=Vmt(e.placement);return t===g||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:P[0];e&&(r=e);break}case"initialPlacement":r=s}if(o!==r)return{reset:{placement:r}}}return{}}}},Qvt=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:a,platform:i,elements:s}=t,{apply:l=()=>{},...c}=Fmt(e,t),u=await Jmt(t,c),d=zmt(o),p=Imt(o),h="y"===Vmt(o),{width:f,height:m}=a.floating;let v,y;"top"===d||"bottom"===d?(v=d,y=p===(await(null==i.isRTL?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(y=d,v="end"===p?"top":"bottom");const g=m-u.top-u.bottom,b=f-u.left-u.right,x=Dmt(m-u[v],g),w=Dmt(f-u[y],b),k=!t.middlewareData.shift;let _=x,C=w;if(null!=(r=t.middlewareData.shift)&&r.enabled.x&&(C=b),null!=(n=t.middlewareData.shift)&&n.enabled.y&&(_=g),k&&!p){const e=Omt(u.left,0),t=Omt(u.right,0),r=Omt(u.top,0),n=Omt(u.bottom,0);h?C=f-2*(0!==e||0!==t?e+t:Omt(u.left,u.right)):_=m-2*(0!==r||0!==n?r+n:Omt(u.top,u.bottom))}await l({...t,availableWidth:C,availableHeight:_});const M=await i.getDimensions(s.floating);return f!==M.width||m!==M.height?{reset:{rects:!0}}:{}}}},Jvt=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=Fmt(e,t);switch(n){case"referenceHidden":{const e=evt(await Jmt(t,{...o,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:tvt(e)}}}case"escaped":{const e=evt(await Jmt(t,{...o,altBoundary:!0}),r.floating);return{data:{escapedOffsets:e,escaped:tvt(e)}}}default:return{}}}}},eyt=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:a,platform:i,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=Fmt(e,t)||{};if(null==c)return{};const d=Xmt(u),p={x:r,y:n},h=Hmt(o),f=Lmt(h),m=await i.getDimensions(c),v="y"===h,y=v?"top":"left",g=v?"bottom":"right",b=v?"clientHeight":"clientWidth",x=a.reference[f]+a.reference[h]-p[h]-a.floating[f],w=p[h]-a.reference[h],k=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c));let _=k?k[b]:0;(!_||!await(null==i.isElement?void 0:i.isElement(k)))&&(_=s.floating[b]||a.floating[f]);const C=x/2-w/2,M=_/2-m[f]/2-1,S=Dmt(d[y],M),D=Dmt(d[g],M),O=S,P=_-m[f]-D,E=_/2-m[f]/2+C,j=Rmt(O,E,P),T=!l.arrow&&null!=Imt(o)&&E!==j&&a.reference[f]/2-(E<O?S:D)-m[f]/2<0,N=T?E<O?E-O:E-P:0;return{[h]:p[h]+N,data:{[h]:j,centerOffset:E-j-N,...T&&{alignmentOffset:N}},reset:T}}}),tyt=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:a,middlewareData:i}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=Fmt(e,t),u={x:r,y:n},d=Vmt(o),p=Amt(d);let h=u[p],f=u[d];const m=Fmt(s,t),v="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const e="y"===p?"height":"width",t=a.reference[p]-a.floating[e]+v.mainAxis,r=a.reference[p]+a.reference[e]-v.mainAxis;h<t?h=t:h>r&&(h=r)}if(c){var y,g;const e="y"===p?"width":"height",t=rvt.has(zmt(o)),r=a.reference[d]-a.floating[e]+(t&&(null==(y=i.offset)?void 0:y[d])||0)+(t?0:v.crossAxis),n=a.reference[d]+a.reference[e]+(t?0:(null==(g=i.offset)?void 0:g[d])||0)-(t?v.crossAxis:0);f<r?f=r:f>n&&(f=n)}return{[p]:h,[d]:f}}}},ryt=(e,t,r)=>{const n=new Map,o={platform:Uvt,...r},a={...o.platform,_c:n};return(async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:a=[],platform:i}=r,s=a.filter(Boolean),l=await(null==i.isRTL?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=Qmt(c,n,l),p=n,h={},f=0;for(let r=0;r<s.length;r++){const{name:a,fn:m}=s[r],{x:v,y:y,data:g,reset:b}=await m({x:u,y:d,initialPlacement:n,placement:p,strategy:o,middlewareData:h,rects:c,platform:i,elements:{reference:e,floating:t}});u=v??u,d=y??d,h={...h,[a]:{...h[a],...g}},b&&f<=50&&(f++,"object"==typeof b&&(b.placement&&(p=b.placement),b.rects&&(c=!0===b.rects?await i.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:u,y:d}=Qmt(c,p,l))),r=-1)}return{x:u,y:d,placement:p,strategy:o,middlewareData:h}})(e,t,{...o,platform:a})};var nyt=typeof document<"u"?e.useLayoutEffect:function(){};function oyt(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,o;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(!oyt(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;0!==n--;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;0!==n--;){const r=o[n];if(!("_owner"===r&&e.$$typeof||oyt(e[r],t[r])))return!1}return!0}return e!=e&&t!=t}function ayt(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function iyt(e,t){const r=ayt(e);return Math.round(t*r)/r}function syt(e){const t=s.useRef(e);return nyt(()=>{t.current=e}),t}const lyt=e=>({name:"arrow",options:e,fn(t){const{element:r,padding:n}="function"==typeof e?e(t):e;return r&&function(e){return{}.hasOwnProperty.call(e,"current")}(r)?null!=r.current?eyt({element:r.current,padding:n}).fn(t):{}:r?eyt({element:r,padding:n}).fn(t):{}}}),cyt=(e,t)=>({...Yvt(e),options:[e,t]}),uyt=(e,t)=>({...Xvt(e),options:[e,t]}),dyt=(e,t)=>({...tyt(e),options:[e,t]}),pyt=(e,t)=>({...Zvt(e),options:[e,t]}),hyt=(e,t)=>({...Qvt(e),options:[e,t]}),fyt=(e,t)=>({...Jvt(e),options:[e,t]}),myt=(e,t)=>({...lyt(e),options:[e,t]});var vyt=s.forwardRef((e,r)=>{const{children:n,width:o=10,height:a=5,...i}=e;return t.jsx(ult.svg,{...i,ref:r,width:o,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:t.jsx("polygon",{points:"0,0 30,0 15,10"})})});vyt.displayName="Arrow";var yyt=vyt;function gyt(e){const[t,r]=s.useState(void 0);return Qst(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;const n=t[0];let o,a;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,a=t.blockSize}else o=e.offsetWidth,a=e.offsetHeight;r({width:o,height:a})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}var byt="Popper",[xyt,wyt]=Xst(byt),[kyt,_yt]=xyt(byt),Cyt=e=>{const{__scopePopper:r,children:n}=e,[o,a]=s.useState(null);return t.jsx(kyt,{scope:r,anchor:o,onAnchorChange:a,children:n})};Cyt.displayName=byt;var Myt="PopperAnchor",Syt=s.forwardRef((e,r)=>{const{__scopePopper:n,virtualRef:o,...a}=e,i=_yt(Myt,n),l=s.useRef(null),c=Yst(r,l);return s.useEffect(()=>{i.onAnchorChange((null==o?void 0:o.current)||l.current)}),o?null:t.jsx(ult.div,{...a,ref:c})});Syt.displayName=Myt;var Dyt="PopperContent",[Oyt,Pyt]=xyt(Dyt),Eyt=s.forwardRef((e,r)=>{var n,o,a,i,l,c;const{__scopePopper:u,side:p="bottom",sideOffset:h=0,align:f="center",alignOffset:m=0,arrowPadding:v=0,avoidCollisions:y=!0,collisionBoundary:g=[],collisionPadding:b=0,sticky:x="partial",hideWhenDetached:w=!1,updatePositionStrategy:k="optimized",onPlaced:_,...C}=e,M=_yt(Dyt,u),[S,D]=s.useState(null),O=Yst(r,e=>D(e)),[P,E]=s.useState(null),j=gyt(P),T=(null==j?void 0:j.width)??0,N=(null==j?void 0:j.height)??0,R=p+("center"!==f?"-"+f:""),F="number"==typeof b?b:{top:0,right:0,bottom:0,left:0,...b},z=Array.isArray(g)?g:[g],I=z.length>0,A={padding:F,boundary:z.filter(Ryt),altBoundary:I},{refs:L,floatingStyles:B,placement:V,isPositioned:H,middlewareData:q}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:a,floating:i}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[p,h]=s.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[f,m]=s.useState(n);oyt(f,n)||m(n);const[v,y]=s.useState(null),[g,b]=s.useState(null),x=s.useCallback(e=>{e!==C.current&&(C.current=e,y(e))},[]),w=s.useCallback(e=>{e!==M.current&&(M.current=e,b(e))},[]),k=a||v,_=i||g,C=s.useRef(null),M=s.useRef(null),S=s.useRef(p),D=null!=c,O=syt(c),P=syt(o),E=syt(u),j=s.useCallback(()=>{if(!C.current||!M.current)return;const e={placement:t,strategy:r,middleware:f};P.current&&(e.platform=P.current),ryt(C.current,M.current,e).then(e=>{const t={...e,isPositioned:!1!==E.current};T.current&&!oyt(S.current,t)&&(S.current=t,d.flushSync(()=>{h(t)}))})},[f,t,r,P,E]);nyt(()=>{!1===u&&S.current.isPositioned&&(S.current.isPositioned=!1,h(e=>({...e,isPositioned:!1})))},[u]);const T=s.useRef(!1);nyt(()=>(T.current=!0,()=>{T.current=!1}),[]),nyt(()=>{if(k&&(C.current=k),_&&(M.current=_),k&&_){if(O.current)return O.current(k,_,j);j()}},[k,_,j,O,D]);const N=s.useMemo(()=>({reference:C,floating:M,setReference:x,setFloating:w}),[x,w]),R=s.useMemo(()=>({reference:k,floating:_}),[k,_]),F=s.useMemo(()=>{const e={position:r,left:0,top:0};if(!R.floating)return e;const t=iyt(R.floating,p.x),n=iyt(R.floating,p.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",...ayt(R.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,l,R.floating,p.x,p.y]);return s.useMemo(()=>({...p,update:j,refs:N,elements:R,floatingStyles:F}),[p,j,N,R,F])}({strategy:"fixed",placement:R,whileElementsMounted:(...e)=>Kvt(...e,{animationFrame:"always"===k}),elements:{reference:M.anchor},middleware:[cyt({mainAxis:h+N,alignmentAxis:m}),y&&uyt({mainAxis:!0,crossAxis:!1,limiter:"partial"===x?dyt():void 0,...A}),y&&pyt({...A}),hyt({...A,apply:({elements:e,rects:t,availableWidth:r,availableHeight:n})=>{const{width:o,height:a}=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",`${o}px`),i.setProperty("--radix-popper-anchor-height",`${a}px`)}}),P&&myt({element:P,padding:v}),Fyt({arrowWidth:T,arrowHeight:N}),w&&fyt({strategy:"referenceHidden",...A})]}),[$,W]=zyt(V),U=plt(_);Qst(()=>{H&&(null==U||U())},[H,U]);const G=null==(n=q.arrow)?void 0:n.x,K=null==(o=q.arrow)?void 0:o.y,Y=0!==(null==(a=q.arrow)?void 0:a.centerOffset),[X,Z]=s.useState();return Qst(()=>{S&&Z(window.getComputedStyle(S).zIndex)},[S]),t.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...B,transform:H?B.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:X,"--radix-popper-transform-origin":[null==(i=q.transformOrigin)?void 0:i.x,null==(l=q.transformOrigin)?void 0:l.y].join(" "),...(null==(c=q.hide)?void 0:c.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:t.jsx(Oyt,{scope:u,placedSide:$,onArrowChange:E,arrowX:G,arrowY:K,shouldHideArrow:Y,children:t.jsx(ult.div,{"data-side":$,"data-align":W,...C,ref:O,style:{...C.style,animation:H?void 0:"none"}})})})});Eyt.displayName=Dyt;var jyt="PopperArrow",Tyt={top:"bottom",right:"left",bottom:"top",left:"right"},Nyt=s.forwardRef(function(e,r){const{__scopePopper:n,...o}=e,a=Pyt(jyt,n),i=Tyt[a.placedSide];return t.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:t.jsx(yyt,{...o,ref:r,style:{...o.style,display:"block"}})})});function Ryt(e){return null!==e}Nyt.displayName=jyt;var Fyt=e=>({name:"transformOrigin",options:e,fn(t){var r,n,o;const{placement:a,rects:i,middlewareData:s}=t,l=0!==(null==(r=s.arrow)?void 0:r.centerOffset),c=l?0:e.arrowWidth,u=l?0:e.arrowHeight,[d,p]=zyt(a),h={start:"0%",center:"50%",end:"100%"}[p],f=((null==(n=s.arrow)?void 0:n.x)??0)+c/2,m=((null==(o=s.arrow)?void 0:o.y)??0)+u/2;let v="",y="";return"bottom"===d?(v=l?h:`${f}px`,y=-u+"px"):"top"===d?(v=l?h:`${f}px`,y=`${i.floating.height+u}px`):"right"===d?(v=-u+"px",y=l?h:`${m}px`):"left"===d&&(v=`${i.floating.width+u}px`,y=l?h:`${m}px`),{data:{x:v,y:y}}}});function zyt(e){const[t,r="center"]=e.split("-");return[t,r]}var Iyt=Cyt,Ayt=Syt,Lyt=Eyt,Byt=Nyt,Vyt="Popover",[Hyt,qyt]=Xst(Vyt,[wyt]),$yt=wyt(),[Wyt,Uyt]=Hyt(Vyt),Gyt=e=>{const{__scopePopover:r,children:n,open:o,defaultOpen:a,onOpenChange:i,modal:l=!1}=e,c=$yt(r),u=s.useRef(null),[d,p]=s.useState(!1),[h,f]=nlt({prop:o,defaultProp:a??!1,onChange:i,caller:Vyt});return t.jsx(Iyt,{...c,children:t.jsx(Wyt,{scope:r,contentId:tlt(),triggerRef:u,open:h,onOpenChange:f,onOpenToggle:s.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:d,onCustomAnchorAdd:s.useCallback(()=>p(!0),[]),onCustomAnchorRemove:s.useCallback(()=>p(!1),[]),modal:l,children:n})})};Gyt.displayName=Vyt;var Kyt="PopoverAnchor",Yyt=s.forwardRef((e,r)=>{const{__scopePopover:n,...o}=e,a=Uyt(Kyt,n),i=$yt(n),{onCustomAnchorAdd:l,onCustomAnchorRemove:c}=a;return s.useEffect(()=>(l(),()=>c()),[l,c]),t.jsx(Ayt,{...i,...o,ref:r})});Yyt.displayName=Kyt;var Xyt="PopoverTrigger",Zyt=s.forwardRef((e,r)=>{const{__scopePopover:n,...o}=e,a=Uyt(Xyt,n),i=$yt(n),s=Yst(r,a.triggerRef),l=t.jsx(ult.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":dgt(a.open),...o,ref:s,onClick:Ust(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?l:t.jsx(Ayt,{asChild:!0,...i,children:l})});Zyt.displayName=Xyt;var Qyt="PopoverPortal",[Jyt,egt]=Hyt(Qyt,{forceMount:void 0}),tgt=e=>{const{__scopePopover:r,forceMount:n,children:o,container:a}=e,i=Uyt(Qyt,r);return t.jsx(Jyt,{scope:r,forceMount:n,children:t.jsx(Nlt,{present:n||i.open,children:t.jsx(Tlt,{asChild:!0,container:a,children:o})})})};tgt.displayName=Qyt;var rgt="PopoverContent",ngt=s.forwardRef((e,r)=>{const n=egt(rgt,e.__scopePopover),{forceMount:o=n.forceMount,...a}=e,i=Uyt(rgt,e.__scopePopover);return t.jsx(Nlt,{present:o||i.open,children:i.modal?t.jsx(agt,{...a,ref:r}):t.jsx(igt,{...a,ref:r})})});ngt.displayName=rgt;var ogt=olt("PopoverContent.RemoveScroll"),agt=s.forwardRef((e,r)=>{const n=Uyt(rgt,e.__scopePopover),o=s.useRef(null),a=Yst(r,o),i=s.useRef(!1);return s.useEffect(()=>{const e=o.current;if(e)return Nct(e)},[]),t.jsx(Sct,{as:ogt,allowPinchZoom:!0,children:t.jsx(sgt,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ust(e.onCloseAutoFocus,e=>{var t;e.preventDefault(),i.current||null==(t=n.triggerRef.current)||t.focus()}),onPointerDownOutside:Ust(e.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey,n=2===t.button||r;i.current=n},{checkForDefaultPrevented:!1}),onFocusOutside:Ust(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),igt=s.forwardRef((e,r)=>{const n=Uyt(rgt,e.__scopePopover),o=s.useRef(!1),a=s.useRef(!1);return t.jsx(sgt,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{var r,i;null==(r=e.onCloseAutoFocus)||r.call(e,t),t.defaultPrevented||(o.current||null==(i=n.triggerRef.current)||i.focus(),t.preventDefault()),o.current=!1,a.current=!1},onInteractOutside:t=>{var r,i;null==(r=e.onInteractOutside)||r.call(e,t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(a.current=!0));const s=t.target;(null==(i=n.triggerRef.current)?void 0:i.contains(s))&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&a.current&&t.preventDefault()}})}),sgt=s.forwardRef((e,r)=>{const{__scopePopover:n,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:d,...p}=e,h=Uyt(rgt,n),f=$yt(n);return zlt(),t.jsx(Mlt,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:i,children:t.jsx(glt,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:d,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>h.onOpenChange(!1),children:t.jsx(Lyt,{"data-state":dgt(h.open),role:"dialog",id:h.contentId,...f,...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)"}})})})}),lgt="PopoverClose",cgt=s.forwardRef((e,r)=>{const{__scopePopover:n,...o}=e,a=Uyt(lgt,n);return t.jsx(ult.button,{type:"button",...o,ref:r,onClick:Ust(e.onClick,()=>a.onOpenChange(!1))})});cgt.displayName=lgt;var ugt=s.forwardRef((e,r)=>{const{__scopePopover:n,...o}=e,a=$yt(n);return t.jsx(Byt,{...a,...o,ref:r})});function dgt(e){return e?"open":"closed"}ugt.displayName="PopoverArrow";var pgt=tgt,hgt=ngt;const fgt=Gyt,mgt=Zyt,vgt=s.forwardRef(({className:e,align:r="center",sideOffset:n=4,...o},a)=>t.jsx(pgt,{children:t.jsx(hgt,{ref:a,align:r,sideOffset:n,className:vdt("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));function ygt(e){const r=e+"CollectionProvider",[n,o]=Xst(r),[a,i]=n(r,{collectionRef:{current:null},itemMap:new Map}),s=e=>{const{scope:r,children:n}=e,o=l.default.useRef(null),i=l.default.useRef(new Map).current;return t.jsx(a,{scope:r,itemMap:i,collectionRef:o,children:n})};s.displayName=r;const c=e+"CollectionSlot",u=olt(c),d=l.default.forwardRef((e,r)=>{const{scope:n,children:o}=e,a=Yst(r,i(c,n).collectionRef);return t.jsx(u,{ref:a,children:o})});d.displayName=c;const p=e+"CollectionItemSlot",h="data-radix-collection-item",f=olt(p),m=l.default.forwardRef((e,r)=>{const{scope:n,children:o,...a}=e,s=l.default.useRef(null),c=Yst(r,s),u=i(p,n);return l.default.useEffect(()=>(u.itemMap.set(s,{ref:s,...a}),()=>{u.itemMap.delete(s)})),t.jsx(f,{[h]:"",ref:c,children:o})});return m.displayName=p,[{Provider:s,Slot:d,ItemSlot:m},function(t){const r=i(e+"CollectionConsumer",t);return l.default.useCallback(()=>{const e=r.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${h}]`));return Array.from(r.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[r.collectionRef,r.itemMap])},o]}vgt.displayName=hgt.displayName;var ggt=s.createContext(void 0);function bgt(e){const t=s.useContext(ggt);return e||t||"ltr"}var xgt="rovingFocusGroup.onEntryFocus",wgt={bubbles:!1,cancelable:!0},kgt="RovingFocusGroup",[_gt,Cgt,Mgt]=ygt(kgt),[Sgt,Dgt]=Xst(kgt,[Mgt]),[Ogt,Pgt]=Sgt(kgt),Egt=s.forwardRef((e,r)=>t.jsx(_gt.Provider,{scope:e.__scopeRovingFocusGroup,children:t.jsx(_gt.Slot,{scope:e.__scopeRovingFocusGroup,children:t.jsx(jgt,{...e,ref:r})})}));Egt.displayName=kgt;var jgt=s.forwardRef((e,r)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:a=!1,dir:i,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:p=!1,...h}=e,f=s.useRef(null),m=Yst(r,f),v=bgt(i),[y,g]=nlt({prop:l,defaultProp:c??null,onChange:u,caller:kgt}),[b,x]=s.useState(!1),w=plt(d),k=Cgt(n),_=s.useRef(!1),[C,M]=s.useState(0);return s.useEffect(()=>{const e=f.current;if(e)return e.addEventListener(xgt,w),()=>e.removeEventListener(xgt,w)},[w]),t.jsx(Ogt,{scope:n,orientation:o,dir:v,loop:a,currentTabStopId:y,onItemFocus:s.useCallback(e=>g(e),[g]),onItemShiftTab:s.useCallback(()=>x(!0),[]),onFocusableItemAdd:s.useCallback(()=>M(e=>e+1),[]),onFocusableItemRemove:s.useCallback(()=>M(e=>e-1),[]),children:t.jsx(ult.div,{tabIndex:b||0===C?-1:0,"data-orientation":o,...h,ref:m,style:{outline:"none",...e.style},onMouseDown:Ust(e.onMouseDown,()=>{_.current=!0}),onFocus:Ust(e.onFocus,e=>{const t=!_.current;if(e.target===e.currentTarget&&t&&!b){const t=new CustomEvent(xgt,wgt);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=k().filter(e=>e.focusable);Fgt([e.find(e=>e.active),e.find(e=>e.id===y),...e].filter(Boolean).map(e=>e.ref.current),p)}}_.current=!1}),onBlur:Ust(e.onBlur,()=>x(!1))})})}),Tgt="RovingFocusGroupItem",Ngt=s.forwardRef((e,r)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:a=!1,tabStopId:i,children:l,...c}=e,u=tlt(),d=i||u,p=Pgt(Tgt,n),h=p.currentTabStopId===d,f=Cgt(n),{onFocusableItemAdd:m,onFocusableItemRemove:v,currentTabStopId:y}=p;return s.useEffect(()=>{if(o)return m(),()=>v()},[o,m,v]),t.jsx(_gt.ItemSlot,{scope:n,id:d,focusable:o,active:a,children:t.jsx(ult.span,{tabIndex:h?0:-1,"data-orientation":p.orientation,...c,ref:r,onMouseDown:Ust(e.onMouseDown,e=>{o?p.onItemFocus(d):e.preventDefault()}),onFocus:Ust(e.onFocus,()=>p.onItemFocus(d)),onKeyDown:Ust(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void p.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,r){const n=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,r);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(n)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(n)))return Rgt[n]}(e,p.orientation,p.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let r=f().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(()=>Fgt(r))}}),children:"function"==typeof l?l({isCurrentTabStop:h,hasTabStop:null!=y}):l})})});Ngt.displayName=Tgt;var Rgt={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Fgt(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}var zgt=Egt,Igt=Ngt;function Agt(e){const t=s.useRef({value:e,previous:e});return s.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Lgt="Radio",[Bgt,Vgt]=Xst(Lgt),[Hgt,qgt]=Bgt(Lgt),$gt=s.forwardRef((e,r)=>{const{__scopeRadio:n,name:o,checked:a=!1,required:i,disabled:l,value:c="on",onCheck:u,form:d,...p}=e,[h,f]=s.useState(null),m=Yst(r,e=>f(e)),v=s.useRef(!1),y=!h||(d||!!h.closest("form"));return t.jsxs(Hgt,{scope:n,checked:a,disabled:l,children:[t.jsx(ult.button,{type:"button",role:"radio","aria-checked":a,"data-state":Kgt(a),"data-disabled":l?"":void 0,disabled:l,value:c,...p,ref:m,onClick:Ust(e.onClick,e=>{a||null==u||u(),y&&(v.current=e.isPropagationStopped(),v.current||e.stopPropagation())})}),y&&t.jsx(Ggt,{control:h,bubbles:!v.current,name:o,value:c,checked:a,required:i,disabled:l,form:d,style:{transform:"translateX(-100%)"}})]})});$gt.displayName=Lgt;var Wgt="RadioIndicator",Ugt=s.forwardRef((e,r)=>{const{__scopeRadio:n,forceMount:o,...a}=e,i=qgt(Wgt,n);return t.jsx(Nlt,{present:o||i.checked,children:t.jsx(ult.span,{"data-state":Kgt(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:r})})});Ugt.displayName=Wgt;var Ggt=s.forwardRef(({__scopeRadio:e,control:r,checked:n,bubbles:o=!0,...a},i)=>{const l=s.useRef(null),c=Yst(l,i),u=Agt(n),d=gyt(r);return s.useEffect(()=>{const e=l.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:o});r.call(e,n),e.dispatchEvent(t)}},[u,n,o]),t.jsx(ult.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...a,tabIndex:-1,ref:c,style:{...a.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function Kgt(e){return e?"checked":"unchecked"}Ggt.displayName="RadioBubbleInput";var Ygt=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Xgt="RadioGroup",[Zgt,Qgt]=Xst(Xgt,[Dgt,Vgt]),Jgt=Dgt(),ebt=Vgt(),[tbt,rbt]=Zgt(Xgt),nbt=s.forwardRef((e,r)=>{const{__scopeRadioGroup:n,name:o,defaultValue:a,value:i,required:s=!1,disabled:l=!1,orientation:c,dir:u,loop:d=!0,onValueChange:p,...h}=e,f=Jgt(n),m=bgt(u),[v,y]=nlt({prop:i,defaultProp:a??null,onChange:p,caller:Xgt});return t.jsx(tbt,{scope:n,name:o,required:s,disabled:l,value:v,onValueChange:y,children:t.jsx(zgt,{asChild:!0,...f,orientation:c,dir:m,loop:d,children:t.jsx(ult.div,{role:"radiogroup","aria-required":s,"aria-orientation":c,"data-disabled":l?"":void 0,dir:m,...h,ref:r})})})});nbt.displayName=Xgt;var obt="RadioGroupItem",abt=s.forwardRef((e,r)=>{const{__scopeRadioGroup:n,disabled:o,...a}=e,i=rbt(obt,n),l=i.disabled||o,c=Jgt(n),u=ebt(n),d=s.useRef(null),p=Yst(r,d),h=i.value===a.value,f=s.useRef(!1);return s.useEffect(()=>{const e=e=>{Ygt.includes(e.key)&&(f.current=!0)},t=()=>f.current=!1;return document.addEventListener("keydown",e),document.addEventListener("keyup",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("keyup",t)}},[]),t.jsx(Igt,{asChild:!0,...c,focusable:!l,active:h,children:t.jsx($gt,{disabled:l,required:i.required,checked:h,...u,...a,name:i.name,ref:p,onCheck:()=>i.onValueChange(a.value),onKeyDown:Ust(e=>{"Enter"===e.key&&e.preventDefault()}),onFocus:Ust(a.onFocus,()=>{var e;f.current&&(null==(e=d.current)||e.click())})})})});abt.displayName=obt;var ibt=s.forwardRef((e,r)=>{const{__scopeRadioGroup:n,...o}=e,a=ebt(n);return t.jsx(Ugt,{...a,...o,ref:r})});ibt.displayName="RadioGroupIndicator";var sbt=nbt,lbt=abt,cbt=ibt;const ubt=s.forwardRef(({className:e,...r},n)=>t.jsx(sbt,{className:vdt("grid gap-2",e),...r,ref:n}));ubt.displayName=sbt.displayName;const dbt=s.forwardRef(({className:e,...r},n)=>t.jsx(lbt,{ref:n,className:vdt("aspect-square h-4 w-4 rounded-full border border-primary text-primary shadow focus:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),...r,children:t.jsx(cbt,{className:"flex items-center justify-center",children:t.jsx(Nst,{className:"h-3.5 w-3.5 fill-primary"})})}));dbt.displayName=lbt.displayName;const pbt=s.forwardRef(({className:e,...r},n)=>t.jsx("textarea",{className:vdt("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...r}));pbt.displayName="Textarea";const hbt=(e,t,r)=>{if(e&&"reportValidity"in e){const n=eft(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},fbt=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?hbt(n.ref,r,e):n.refs&&n.refs.forEach(t=>hbt(t,r,e))}},mbt=(e,t)=>{t.shouldUseNativeValidation&&fbt(e,t);const r={};for(const n in e){const o=eft(t.fields,n),a=Object.assign(e[n]||{},{ref:o&&o.ref});if(vbt(t.names||Object.keys(e),n)){const e=Object.assign({},eft(r,n));rft(e,"root",a),rft(r,n,e)}else rft(r,n,a)}return r},vbt=(e,t)=>e.some(e=>e.startsWith(t+"."));var ybt=function(e,t){for(var r={};e.length;){var n=e[0],o=n.code,a=n.message,i=n.path.join(".");if(!r[i])if("unionErrors"in n){var s=n.unionErrors[0].errors[0];r[i]={message:s.message,type:s.code}}else r[i]={message:a,type:o};if("unionErrors"in n&&n.unionErrors.forEach(function(t){return t.errors.forEach(function(t){return e.push(t)})}),t){var l=r[i].types,c=l&&l[n.code];r[i]=Sft(i,t,r,o,c?[].concat(c,n.message):n.message)}e.shift()}return r},gbt=function(e,t,r){return void 0===r&&(r={}),function(n,o,a){try{return Promise.resolve(function(o,i){try{var s=Promise.resolve(e["sync"===r.mode?"parse":"parseAsync"](n,t)).then(function(e){return a.shouldUseNativeValidation&&fbt({},a),{errors:{},values:r.raw?n:e}})}catch(e){return i(e)}return s&&s.then?s.then(void 0,i):s}(0,function(e){if(function(e){return Array.isArray(null==e?void 0:e.errors)}(e))return{values:{},errors:mbt(ybt(e.errors,!a.shouldUseNativeValidation&&"all"===a.criteriaMode),a)};throw e}))}catch(e){return Promise.reject(e)}}};const bbt=e.createContext({});function xbt(t){const r=e.useRef(null);return null===r.current&&(r.current=t()),r.current}const wbt=e.createContext(null),kbt=e.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class _bt extends s.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){const e=this.props.sizeRef.current;e.height=t.offsetHeight||0,e.width=t.offsetWidth||0,e.top=t.offsetTop,e.left=t.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function Cbt({children:r,isPresent:n}){const o=e.useId(),a=e.useRef(null),i=e.useRef({width:0,height:0,top:0,left:0}),{nonce:l}=e.useContext(kbt);return e.useInsertionEffect(()=>{const{width:e,height:t,top:r,left:s}=i.current;if(n||!a.current||!e||!t)return;a.current.dataset.motionPopId=o;const c=document.createElement("style");return l&&(c.nonce=l),document.head.appendChild(c),c.sheet&&c.sheet.insertRule(`\n [data-motion-pop-id="${o}"] {\n position: absolute !important;\n width: ${e}px !important;\n height: ${t}px !important;\n top: ${r}px !important;\n left: ${s}px !important;\n }\n `),()=>{document.head.removeChild(c)}},[n]),t.jsx(_bt,{isPresent:n,childRef:a,sizeRef:i,children:s.cloneElement(r,{ref:a})})}const Mbt=({children:r,initial:n,isPresent:o,onExitComplete:a,custom:i,presenceAffectsLayout:l,mode:c})=>{const u=xbt(Sbt),d=e.useId(),p=e.useCallback(e=>{u.set(e,!0);for(const e of u.values())if(!e)return;a&&a()},[u,a]),h=e.useMemo(()=>({id:d,initial:n,isPresent:o,custom:i,onExitComplete:p,register:e=>(u.set(e,!1),()=>u.delete(e))}),l?[Math.random(),p]:[o,p]);return e.useMemo(()=>{u.forEach((e,t)=>u.set(t,!1))},[o]),s.useEffect(()=>{!o&&!u.size&&a&&a()},[o]),"popLayout"===c&&(r=t.jsx(Cbt,{isPresent:o,children:r})),t.jsx(wbt.Provider,{value:h,children:r})};function Sbt(){return new Map}function Dbt(t=!0){const r=e.useContext(wbt);if(null===r)return[!0,null];const{isPresent:n,onExitComplete:o,register:a}=r,i=e.useId();e.useEffect(()=>{t&&a(i)},[t]);const s=e.useCallback(()=>t&&o&&o(i),[i,o,t]);return!n&&o?[!1,s]:[!0]}const Obt=e=>e.key||"";function Pbt(t){const r=[];return e.Children.forEach(t,t=>{e.isValidElement(t)&&r.push(t)}),r}const Ebt=typeof window<"u",jbt=Ebt?e.useLayoutEffect:e.useEffect,Tbt=({children:r,custom:n,initial:o=!0,onExitComplete:a,presenceAffectsLayout:i=!0,mode:s="sync",propagate:l=!1})=>{const[c,u]=Dbt(l),d=e.useMemo(()=>Pbt(r),[r]),p=l&&!c?[]:d.map(Obt),h=e.useRef(!0),f=e.useRef(d),m=xbt(()=>new Map),[v,y]=e.useState(d),[g,b]=e.useState(d);jbt(()=>{h.current=!1,f.current=d;for(let e=0;e<g.length;e++){const t=Obt(g[e]);p.includes(t)?m.delete(t):!0!==m.get(t)&&m.set(t,!1)}},[g,p.length,p.join("-")]);const x=[];if(d!==v){let e=[...d];for(let t=0;t<g.length;t++){const r=g[t],n=Obt(r);p.includes(n)||(e.splice(t,0,r),x.push(r))}return"wait"===s&&x.length&&(e=x),b(Pbt(e)),void y(d)}"production"!==process.env.NODE_ENV&&"wait"===s&&g.length>1&&console.warn('You\'re attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.');const{forceRender:w}=e.useContext(bbt);return t.jsx(t.Fragment,{children:g.map(e=>{const r=Obt(e),v=!(l&&!c)&&(d===g||p.includes(r));return t.jsx(Mbt,{isPresent:v,initial:!(h.current&&!o)&&void 0,custom:v?void 0:n,presenceAffectsLayout:i,mode:s,onExitComplete:v?void 0:()=>{if(!m.has(r))return;m.set(r,!0);let e=!0;m.forEach(t=>{t||(e=!1)}),e&&(null==w||w(),b(f.current),l&&(null==u||u()),a&&a())},children:e},r)})})},Nbt=e=>e;let Rbt=Nbt,Fbt=Nbt;function zbt(e){let t;return()=>(void 0===t&&(t=e()),t)}"production"!==process.env.NODE_ENV&&(Rbt=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},Fbt=(e,t)=>{if(!e)throw new Error(t)});const Ibt=(e,t,r)=>{const n=t-e;return 0===n?1:(r-e)/n},Abt=e=>1e3*e,Lbt=e=>e/1e3,Bbt=!1;const Vbt=["read","resolveKeyframes","update","preRender","render","postRender"];function Hbt(e,t){let r=!1,n=!0;const o={delta:0,timestamp:0,isProcessing:!1},a=()=>r=!0,i=Vbt.reduce((e,t)=>(e[t]=function(e){let t=new Set,r=new Set,n=!1,o=!1;const a=new WeakSet;let i={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(l.schedule(t),e()),t(i)}const l={schedule:(e,o=!1,i=!1)=>{const s=i&&n?t:r;return o&&a.add(e),s.has(e)||s.add(e),e},cancel:e=>{r.delete(e),a.delete(e)},process:e=>{i=e,n?o=!0:(n=!0,[t,r]=[r,t],t.forEach(s),t.clear(),n=!1,o&&(o=!1,l.process(e)))}};return l}(a),e),{}),{read:s,resolveKeyframes:l,update:c,preRender:u,render:d,postRender:p}=i,h=()=>{const a=performance.now();r=!1,o.delta=n?1e3/60:Math.max(Math.min(a-o.timestamp,40),1),o.timestamp=a,o.isProcessing=!0,s.process(o),l.process(o),c.process(o),u.process(o),d.process(o),p.process(o),o.isProcessing=!1,r&&t&&(n=!1,e(h))};return{schedule:Vbt.reduce((t,a)=>{const s=i[a];return t[a]=(t,a=!1,i=!1)=>(r||(r=!0,n=!0,o.isProcessing||e(h)),s.schedule(t,a,i)),t},{}),cancel:e=>{for(let t=0;t<Vbt.length;t++)i[Vbt[t]].cancel(e)},state:o,steps:i}}const{schedule:qbt,cancel:$bt,state:Wbt,steps:Ubt}=Hbt(typeof requestAnimationFrame<"u"?requestAnimationFrame:Nbt,!0),Gbt=e.createContext({strict:!1}),Kbt={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Ybt={};for(const e in Kbt)Ybt[e]={isEnabled:t=>Kbt[e].some(e=>!!t[e])};const Xbt=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Zbt(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Xbt.has(e)}let Qbt=e=>!Zbt(e);try{!function(e){e&&(Qbt=t=>t.startsWith("on")?!Zbt(t):e(t))}(require("@emotion/is-prop-valid").default)}catch{}const Jbt=new Set;function ext(e,t,r){e||Jbt.has(t)||(console.warn(t),Jbt.add(t))}function txt(e){if(typeof Proxy>"u")return e;const t=new Map;return new Proxy((...t)=>("production"!==process.env.NODE_ENV&&ext(!1,"motion() is deprecated. Use motion.create() instead."),e(...t)),{get:(r,n)=>"create"===n?e:(t.has(n)||t.set(n,e(n)),t.get(n))})}const rxt=e.createContext({});function nxt(e){return"string"==typeof e||Array.isArray(e)}function oxt(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}const axt=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ixt=["initial",...axt];function sxt(e){return oxt(e.animate)||ixt.some(t=>nxt(e[t]))}function lxt(e){return!(!sxt(e)&&!e.variants)}function cxt(t){const{initial:r,animate:n}=function(e,t){if(sxt(e)){const{initial:t,animate:r}=e;return{initial:!1===t||nxt(t)?t:void 0,animate:nxt(r)?r:void 0}}return!1!==e.inherit?t:{}}(t,e.useContext(rxt));return e.useMemo(()=>({initial:r,animate:n}),[uxt(r),uxt(n)])}function uxt(e){return Array.isArray(e)?e.join(" "):e}const dxt=Symbol.for("motionComponentSymbol");function pxt(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function hxt(t,r,n){return e.useCallback(e=>{e&&t.onMount&&t.onMount(e),r&&(e?r.mount(e):r.unmount()),n&&("function"==typeof n?n(e):pxt(n)&&(n.current=e))},[r])}const fxt=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),mxt="data-"+fxt("framerAppearId"),{schedule:vxt}=Hbt(queueMicrotask,!1),yxt=e.createContext({});function gxt(t,r,n,o,a){var i,s;const{visualElement:l}=e.useContext(rxt),c=e.useContext(Gbt),u=e.useContext(wbt),d=e.useContext(kbt).reducedMotion,p=e.useRef(null);o=o||c.renderer,!p.current&&o&&(p.current=o(t,{visualState:r,parent:l,props:n,presenceContext:u,blockInitialAnimation:!!u&&!1===u.initial,reducedMotionConfig:d}));const h=p.current,f=e.useContext(yxt);h&&!h.projection&&a&&("html"===h.type||"svg"===h.type)&&function(e,t,r,n){const{layoutId:o,layout:a,drag:i,dragConstraints:s,layoutScroll:l,layoutRoot:c}=t;e.projection=new r(e.latestValues,t["data-framer-portal-id"]?void 0:bxt(e.parent)),e.projection.setOptions({layoutId:o,layout:a,alwaysMeasureLayout:!!i||s&&pxt(s),visualElement:e,animationType:"string"==typeof a?a:"both",initialPromotionConfig:n,layoutScroll:l,layoutRoot:c})}(p.current,n,a,f);const m=e.useRef(!1);e.useInsertionEffect(()=>{h&&m.current&&h.update(n,u)});const v=n[mxt],y=e.useRef(!!v&&!(null!==(i=window.MotionHandoffIsComplete)&&void 0!==i&&i.call(window,v))&&(null===(s=window.MotionHasOptimisedAnimation)||void 0===s?void 0:s.call(window,v)));return jbt(()=>{h&&(m.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),vxt.render(h.render),y.current&&h.animationState&&h.animationState.animateChanges())}),e.useEffect(()=>{h&&(!y.current&&h.animationState&&h.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var e;null===(e=window.MotionHandoffMarkAsComplete)||void 0===e||e.call(window,v)}),y.current=!1))}),h}function bxt(e){if(e)return!1!==e.options.allowProjection?e.projection:bxt(e.parent)}function xxt({preloadedFeatures:r,createVisualElement:n,useRender:o,useVisualState:a,Component:i}){var s,l;function c(s,l){let c;const u={...e.useContext(kbt),...s,layoutId:wxt(s)},{isStatic:d}=u,p=cxt(s),h=a(s,d);if(!d&&Ebt){!function(t,r){const n=e.useContext(Gbt).strict;if("production"!==process.env.NODE_ENV&&r&&n){const e="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";t.ignoreStrict?Rbt(!1,e):Fbt(!1,e)}}(u,r);const t=function(e){const{drag:t,layout:r}=Ybt;if(!t&&!r)return{};const n={...t,...r};return{MeasureLayout:null!=t&&t.isEnabled(e)||null!=r&&r.isEnabled(e)?n.MeasureLayout:void 0,ProjectionNode:n.ProjectionNode}}(u);c=t.MeasureLayout,p.visualElement=gxt(i,h,u,n,t.ProjectionNode)}return t.jsxs(rxt.Provider,{value:p,children:[c&&p.visualElement?t.jsx(c,{visualElement:p.visualElement,...u}):null,o(i,s,hxt(h,p.visualElement,l),h,d,p.visualElement)]})}r&&function(e){for(const t in e)Ybt[t]={...Ybt[t],...e[t]}}(r),c.displayName=`motion.${"string"==typeof i?i:`create(${null!==(l=null!==(s=i.displayName)&&void 0!==s?s:i.name)&&void 0!==l?l:""})`}`;const u=e.forwardRef(c);return u[dxt]=i,u}function wxt({layoutId:t}){const r=e.useContext(bbt).id;return r&&void 0!==t?r+"-"+t:t}const kxt=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function _xt(e){return"string"==typeof e&&!e.includes("-")&&!!(kxt.indexOf(e)>-1||/[A-Z]/u.test(e))}function Cxt(e){const t=[{},{}];return null==e||e.values.forEach((e,r)=>{t[0][r]=e.get(),t[1][r]=e.getVelocity()}),t}function Mxt(e,t,r,n){if("function"==typeof t){const[o,a]=Cxt(n);t=t(void 0!==r?r:e.custom,o,a)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){const[o,a]=Cxt(n);t=t(void 0!==r?r:e.custom,o,a)}return t}const Sxt=e=>Array.isArray(e),Dxt=e=>Sxt(e)?e[e.length-1]||0:e,Oxt=e=>!(!e||!e.getVelocity);function Pxt(e){const t=Oxt(e)?e.get():e;return(e=>!!(e&&"object"==typeof e&&e.mix&&e.toValue))(t)?t.toValue():t}const Ext=t=>(r,n)=>{const o=e.useContext(rxt),a=e.useContext(wbt),i=()=>function({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:r},n,o,a){const i={latestValues:jxt(n,o,a,e),renderState:t()};return r&&(i.onMount=e=>r({props:n,current:e,...i}),i.onUpdate=e=>r(e)),i}(t,r,o,a);return n?i():xbt(i)};function jxt(e,t,r,n){const o={},a=n(e,{});for(const e in a)o[e]=Pxt(a[e]);let{initial:i,animate:s}=e;const l=sxt(e),c=lxt(e);t&&c&&!l&&!1!==e.inherit&&(void 0===i&&(i=t.initial),void 0===s&&(s=t.animate));let u=!!r&&!1===r.initial;u=u||!1===i;const d=u?s:i;if(d&&"boolean"!=typeof d&&!oxt(d)){const t=Array.isArray(d)?d:[d];for(let r=0;r<t.length;r++){const n=Mxt(e,t[r]);if(n){const{transitionEnd:e,transition:t,...r}=n;for(const e in r){let t=r[e];if(Array.isArray(t)){t=t[u?t.length-1:0]}null!==t&&(o[e]=t)}for(const t in e)o[t]=e[t]}}}return o}const Txt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Nxt=new Set(Txt),Rxt=e=>t=>"string"==typeof t&&t.startsWith(e),Fxt=Rxt("--"),zxt=Rxt("var(--"),Ixt=e=>!!zxt(e)&&Axt.test(e.split("/*")[0].trim()),Axt=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Lxt=(e,t)=>t&&"number"==typeof e?t.transform(e):e,Bxt=(e,t,r)=>r>t?t:r<e?e:r,Vxt={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},Hxt={...Vxt,transform:e=>Bxt(0,1,e)},qxt={...Vxt,default:1},$xt=e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),Wxt=$xt("deg"),Uxt=$xt("%"),Gxt=$xt("px"),Kxt=$xt("vh"),Yxt=$xt("vw"),Xxt={...Uxt,parse:e=>Uxt.parse(e)/100,transform:e=>Uxt.transform(100*e)},Zxt={borderWidth:Gxt,borderTopWidth:Gxt,borderRightWidth:Gxt,borderBottomWidth:Gxt,borderLeftWidth:Gxt,borderRadius:Gxt,radius:Gxt,borderTopLeftRadius:Gxt,borderTopRightRadius:Gxt,borderBottomRightRadius:Gxt,borderBottomLeftRadius:Gxt,width:Gxt,maxWidth:Gxt,height:Gxt,maxHeight:Gxt,top:Gxt,right:Gxt,bottom:Gxt,left:Gxt,padding:Gxt,paddingTop:Gxt,paddingRight:Gxt,paddingBottom:Gxt,paddingLeft:Gxt,margin:Gxt,marginTop:Gxt,marginRight:Gxt,marginBottom:Gxt,marginLeft:Gxt,backgroundPositionX:Gxt,backgroundPositionY:Gxt},Qxt={rotate:Wxt,rotateX:Wxt,rotateY:Wxt,rotateZ:Wxt,scale:qxt,scaleX:qxt,scaleY:qxt,scaleZ:qxt,skew:Wxt,skewX:Wxt,skewY:Wxt,distance:Gxt,translateX:Gxt,translateY:Gxt,translateZ:Gxt,x:Gxt,y:Gxt,z:Gxt,perspective:Gxt,transformPerspective:Gxt,opacity:Hxt,originX:Xxt,originY:Xxt,originZ:Gxt},Jxt={...Vxt,transform:Math.round},ewt={...Zxt,...Qxt,zIndex:Jxt,size:Gxt,fillOpacity:Hxt,strokeOpacity:Hxt,numOctaves:Jxt},twt={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},rwt=Txt.length;function nwt(e,t,r){const{style:n,vars:o,transformOrigin:a}=e;let i=!1,s=!1;for(const e in t){const r=t[e];if(Nxt.has(e))i=!0;else if(Fxt(e))o[e]=r;else{const t=Lxt(r,ewt[e]);e.startsWith("origin")?(s=!0,a[e]=t):n[e]=t}}if(t.transform||(i||r?n.transform=function(e,t,r){let n="",o=!0;for(let a=0;a<rwt;a++){const i=Txt[a],s=e[i];if(void 0===s)continue;let l=!0;if(l="number"==typeof s?s===(i.startsWith("scale")?1:0):0===parseFloat(s),!l||r){const e=Lxt(s,ewt[i]);l||(o=!1,n+=`${twt[i]||i}(${e}) `),r&&(t[i]=e)}}return n=n.trim(),r?n=r(t,o?"":n):o&&(n="none"),n}(t,e.transform,r):n.transform&&(n.transform="none")),s){const{originX:e="50%",originY:t="50%",originZ:r=0}=a;n.transformOrigin=`${e} ${t} ${r}`}}const owt={offset:"stroke-dashoffset",array:"stroke-dasharray"},awt={offset:"strokeDashoffset",array:"strokeDasharray"};function iwt(e,t,r){return"string"==typeof e?e:Gxt.transform(t+r*e)}function swt(e,{attrX:t,attrY:r,attrScale:n,originX:o,originY:a,pathLength:i,pathSpacing:s=1,pathOffset:l=0,...c},u,d){if(nwt(e,c,d),u)return void(e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox));e.attrs=e.style,e.style={};const{attrs:p,style:h,dimensions:f}=e;p.transform&&(f&&(h.transform=p.transform),delete p.transform),f&&(void 0!==o||void 0!==a||h.transform)&&(h.transformOrigin=function(e,t,r){return`${iwt(t,e.x,e.width)} ${iwt(r,e.y,e.height)}`}(f,void 0!==o?o:.5,void 0!==a?a:.5)),void 0!==t&&(p.x=t),void 0!==r&&(p.y=r),void 0!==n&&(p.scale=n),void 0!==i&&function(e,t,r=1,n=0,o=!0){e.pathLength=1;const a=o?owt:awt;e[a.offset]=Gxt.transform(-n);const i=Gxt.transform(t),s=Gxt.transform(r);e[a.array]=`${i} ${s}`}(p,i,s,l,!1)}const lwt=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),cwt=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),uwt=e=>"string"==typeof e&&"svg"===e.toLowerCase();function dwt(e,{style:t,vars:r},n,o){Object.assign(e.style,t,o&&o.getProjectionStyles(n));for(const t in r)e.style.setProperty(t,r[t])}const pwt=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function hwt(e,t,r,n){dwt(e,t,void 0,n);for(const r in t.attrs)e.setAttribute(pwt.has(r)?r:fxt(r),t.attrs[r])}const fwt={};function mwt(e,{layout:t,layoutId:r}){return Nxt.has(e)||e.startsWith("origin")||(t||void 0!==r)&&(!!fwt[e]||"opacity"===e)}function vwt(e,t,r){var n;const{style:o}=e,a={};for(const i in o)(Oxt(o[i])||t.style&&Oxt(t.style[i])||mwt(i,e)||void 0!==(null===(n=null==r?void 0:r.getValue(i))||void 0===n?void 0:n.liveStyle))&&(a[i]=o[i]);return a}function ywt(e,t,r){const n=vwt(e,t,r);for(const r in e)if(Oxt(e[r])||Oxt(t[r])){n[-1!==Txt.indexOf(r)?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r]=e[r]}return n}const gwt=["x","y","width","height","cx","cy","r"],bwt={useVisualState:Ext({scrapeMotionValuesFromProps:ywt,createRenderState:cwt,onUpdate:({props:e,prevProps:t,current:r,renderState:n,latestValues:o})=>{if(!r)return;let a=!!e.drag;if(!a)for(const e in o)if(Nxt.has(e)){a=!0;break}if(!a)return;let i=!t;if(t)for(let r=0;r<gwt.length;r++){const n=gwt[r];e[n]!==t[n]&&(i=!0)}i&&qbt.read(()=>{(function(e,t){try{t.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}})(r,n),qbt.render(()=>{swt(n,o,uwt(r.tagName),e.transformTemplate),hwt(r,n)})})}})},xwt={useVisualState:Ext({scrapeMotionValuesFromProps:vwt,createRenderState:lwt})};function wwt(e,t,r){for(const n in t)!Oxt(t[n])&&!mwt(n,r)&&(e[n]=t[n])}function kwt(t,r){const n={};return wwt(n,t.style||{},t),Object.assign(n,function({transformTemplate:t},r){return e.useMemo(()=>{const e={style:{},transform:{},transformOrigin:{},vars:{}};return nwt(e,r,t),Object.assign({},e.vars,e.style)},[r])}(t,r)),n}function _wt(e,t){const r={},n=kwt(e,t);return e.drag&&!1!==e.dragListener&&(r.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=n,r}function Cwt(t,r,n,o){const a=e.useMemo(()=>{const e={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return swt(e,r,uwt(o),t.transformTemplate),{...e.attrs,style:{...e.style}}},[r]);if(t.style){const e={};wwt(e,t.style,t),a.style={...e,...a.style}}return a}function Mwt(t=!1){return(r,n,o,{latestValues:a},i)=>{const s=(_xt(r)?Cwt:_wt)(n,a,i,r),l=function(e,t,r){const n={};for(const o in e)"values"===o&&"object"==typeof e.values||(Qbt(o)||!0===r&&Zbt(o)||!t&&!Zbt(o)||e.draggable&&o.startsWith("onDrag"))&&(n[o]=e[o]);return n}(n,"string"==typeof r,t),c=r!==e.Fragment?{...l,...s,ref:o}:{},{children:u}=n,d=e.useMemo(()=>Oxt(u)?u.get():u,[u]);return e.createElement(r,{...c,children:d})}}function Swt(e,t){return function(r,{forwardMotionProps:n}={forwardMotionProps:!1}){return xxt({..._xt(r)?bwt:xwt,preloadedFeatures:e,useRender:Mwt(n),createVisualElement:t,Component:r})}}function Dwt(e,t){if(!Array.isArray(t))return!1;const r=t.length;if(r!==e.length)return!1;for(let n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}function Owt(e,t,r){const n=e.getProps();return Mxt(n,t,void 0!==r?r:n.custom,e)}const Pwt=zbt(()=>void 0!==window.ScrollTimeline);class Ewt{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>"finished"in e?e.finished:e))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let r=0;r<this.animations.length;r++)this.animations[r][e]=t}attachTimeline(e,t){const r=this.animations.map(r=>Pwt()&&r.attachTimeline?r.attachTimeline(e):"function"==typeof t?t(r):void 0);return()=>{r.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let t=0;t<this.animations.length;t++)e=Math.max(e,this.animations[t].duration);return e}runAll(e){this.animations.forEach(t=>t[e]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class jwt extends Ewt{then(e,t){return Promise.all(this.animations).then(e).catch(t)}}function Twt(e,t){return e?e[t]||e.default||e:void 0}const Nwt=2e4;function Rwt(e){let t=0;let r=e.next(t);for(;!r.done&&t<Nwt;)t+=50,r=e.next(t);return t>=Nwt?1/0:t}function Fwt(e){return"function"==typeof e}function zwt(e,t){e.timeline=t,e.onfinish=null}const Iwt=e=>Array.isArray(e)&&"number"==typeof e[0],Awt={linearEasing:void 0};function Lwt(e,t){const r=zbt(e);return()=>{var e;return null!==(e=Awt[t])&&void 0!==e?e:r()}}const Bwt=Lwt(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Vwt=(e,t,r=10)=>{let n="";const o=Math.max(Math.round(t/r),2);for(let t=0;t<o;t++)n+=e(Ibt(0,o-1,t))+", ";return`linear(${n.substring(0,n.length-2)})`};function Hwt(e){return!!("function"==typeof e&&Bwt()||!e||"string"==typeof e&&(e in $wt||Bwt())||Iwt(e)||Array.isArray(e)&&e.every(Hwt))}const qwt=([e,t,r,n])=>`cubic-bezier(${e}, ${t}, ${r}, ${n})`,$wt={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:qwt([0,.65,.55,1]),circOut:qwt([.55,0,1,.45]),backIn:qwt([.31,.01,.66,-.59]),backOut:qwt([.33,1.53,.69,.99])};function Wwt(e,t){if(e)return"function"==typeof e&&Bwt()?Vwt(e,t):Iwt(e)?qwt(e):Array.isArray(e)?e.map(e=>Wwt(e,t)||$wt.easeOut):$wt[e]}const Uwt={x:!1,y:!1};function Gwt(){return Uwt.x||Uwt.y}function Kwt(e,t){const r=function(e){if(e instanceof Element)return[e];if("string"==typeof e){const t=document.querySelectorAll(e);return t?Array.from(t):[]}return Array.from(e)}(e),n=new AbortController;return[r,{passive:!0,...t,signal:n.signal},()=>n.abort()]}function Ywt(e){return t=>{"touch"===t.pointerType||Gwt()||e(t)}}const Xwt=(e,t)=>!!t&&(e===t||Xwt(e,t.parentElement)),Zwt=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary,Qwt=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const Jwt=new WeakSet;function ekt(e){return t=>{"Enter"===t.key&&e(t)}}function tkt(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}function rkt(e){return Zwt(e)&&!Gwt()}function nkt(e,t,r={}){const[n,o,a]=Kwt(e,r),i=e=>{const n=e.currentTarget;if(!rkt(e)||Jwt.has(n))return;Jwt.add(n);const a=t(e),i=(e,t)=>{window.removeEventListener("pointerup",s),window.removeEventListener("pointercancel",l),rkt(e)&&Jwt.has(n)&&(Jwt.delete(n),"function"==typeof a&&a(e,{success:t}))},s=e=>{i(e,r.useGlobalTarget||Xwt(n,e.target))},l=e=>{i(e,!1)};window.addEventListener("pointerup",s,o),window.addEventListener("pointercancel",l,o)};return n.forEach(e=>{!function(e){return Qwt.has(e.tagName)||-1!==e.tabIndex}(e)&&null===e.getAttribute("tabindex")&&(e.tabIndex=0),(r.useGlobalTarget?window:e).addEventListener("pointerdown",i,o),e.addEventListener("focus",e=>((e,t)=>{const r=e.currentTarget;if(!r)return;const n=ekt(()=>{if(Jwt.has(r))return;tkt(r,"down");const e=ekt(()=>{tkt(r,"up")});r.addEventListener("keyup",e,t),r.addEventListener("blur",()=>tkt(r,"cancel"),t)});r.addEventListener("keydown",n,t),r.addEventListener("blur",()=>r.removeEventListener("keydown",n),t)})(e,o),o)}),a}const okt=new Set(["width","height","top","left","right","bottom",...Txt]);let akt;function ikt(){akt=void 0}const skt={now:()=>(void 0===akt&&skt.set(Wbt.isProcessing||Bbt?Wbt.timestamp:performance.now()),akt),set:e=>{akt=e,queueMicrotask(ikt)}};function lkt(e,t){-1===e.indexOf(t)&&e.push(t)}function ckt(e,t){const r=e.indexOf(t);r>-1&&e.splice(r,1)}class ukt{constructor(){this.subscriptions=[]}add(e){return lkt(this.subscriptions,e),()=>ckt(this.subscriptions,e)}notify(e,t,r){const n=this.subscriptions.length;if(n)if(1===n)this.subscriptions[0](e,t,r);else for(let o=0;o<n;o++){const n=this.subscriptions[o];n&&n(e,t,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function dkt(e,t){return t?e*(1e3/t):0}class pkt{constructor(e,t={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(e,t=!0)=>{const r=skt.now();this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),t&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=skt.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=(e=>!isNaN(parseFloat(e)))(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return"production"!==process.env.NODE_ENV&&ext(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new ukt);const r=this.events[e].add(t);return"change"===e?()=>{r(),qbt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)}setWithVelocity(e,t,r){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=skt.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return dkt(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function hkt(e,t){return new pkt(e,t)}function fkt(e,t,r){e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,hkt(r))}function mkt(e,t){const r=e.getValue("willChange");if(function(e){return!(!Oxt(e)||!e.add)}(r))return r.add(t)}function vkt(e){return e.props[mxt]}const ykt=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e;function gkt(e,t,r,n){if(e===t&&r===n)return Nbt;const o=t=>function(e,t,r,n,o){let a,i,s=0;do{i=t+(r-t)/2,a=ykt(i,n,o)-e,a>0?r=i:t=i}while(Math.abs(a)>1e-7&&++s<12);return i}(t,0,1,e,r);return e=>0===e||1===e?e:ykt(o(e),t,n)}const bkt=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,xkt=e=>t=>1-e(1-t),wkt=gkt(.33,1.53,.69,.99),kkt=xkt(wkt),_kt=bkt(kkt),Ckt=e=>(e*=2)<1?.5*kkt(e):.5*(2-Math.pow(2,-10*(e-1))),Mkt=e=>1-Math.sin(Math.acos(e)),Skt=xkt(Mkt),Dkt=bkt(Mkt),Okt=e=>/^0[^.\s]+$/u.test(e);function Pkt(e){return"number"==typeof e?0===e:null===e||("none"===e||"0"===e||Okt(e))}const Ekt=e=>Math.round(1e5*e)/1e5,jkt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const Tkt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Nkt=(e,t)=>r=>!!("string"==typeof r&&Tkt.test(r)&&r.startsWith(e)||t&&!function(e){return null==e}(r)&&Object.prototype.hasOwnProperty.call(r,t)),Rkt=(e,t,r)=>n=>{if("string"!=typeof n)return n;const[o,a,i,s]=n.match(jkt);return{[e]:parseFloat(o),[t]:parseFloat(a),[r]:parseFloat(i),alpha:void 0!==s?parseFloat(s):1}},Fkt={...Vxt,transform:e=>Math.round((e=>Bxt(0,255,e))(e))},zkt={test:Nkt("rgb","red"),parse:Rkt("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:n=1})=>"rgba("+Fkt.transform(e)+", "+Fkt.transform(t)+", "+Fkt.transform(r)+", "+Ekt(Hxt.transform(n))+")"};const Ikt={test:Nkt("#"),parse:function(e){let t="",r="",n="",o="";return e.length>5?(t=e.substring(1,3),r=e.substring(3,5),n=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),r=e.substring(2,3),n=e.substring(3,4),o=e.substring(4,5),t+=t,r+=r,n+=n,o+=o),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:o?parseInt(o,16)/255:1}},transform:zkt.transform},Akt={test:Nkt("hsl","hue"),parse:Rkt("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:n=1})=>"hsla("+Math.round(e)+", "+Uxt.transform(Ekt(t))+", "+Uxt.transform(Ekt(r))+", "+Ekt(Hxt.transform(n))+")"},Lkt={test:e=>zkt.test(e)||Ikt.test(e)||Akt.test(e),parse:e=>zkt.test(e)?zkt.parse(e):Akt.test(e)?Akt.parse(e):Ikt.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?zkt.transform(e):Akt.transform(e)},Bkt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const Vkt="number",Hkt="color",qkt=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function $kt(e){const t=e.toString(),r=[],n={color:[],number:[],var:[]},o=[];let a=0;const i=t.replace(qkt,e=>(Lkt.test(e)?(n.color.push(a),o.push(Hkt),r.push(Lkt.parse(e))):e.startsWith("var(")?(n.var.push(a),o.push("var"),r.push(e)):(n.number.push(a),o.push(Vkt),r.push(parseFloat(e))),++a,"${}")).split("${}");return{values:r,split:i,indexes:n,types:o}}function Wkt(e){return $kt(e).values}function Ukt(e){const{split:t,types:r}=$kt(e),n=t.length;return e=>{let o="";for(let a=0;a<n;a++)if(o+=t[a],void 0!==e[a]){const t=r[a];o+=t===Vkt?Ekt(e[a]):t===Hkt?Lkt.transform(e[a]):e[a]}return o}}const Gkt=e=>"number"==typeof e?0:e;const Kkt={test:function(e){var t,r;return isNaN(e)&&"string"==typeof e&&((null===(t=e.match(jkt))||void 0===t?void 0:t.length)||0)+((null===(r=e.match(Bkt))||void 0===r?void 0:r.length)||0)>0},parse:Wkt,createTransformer:Ukt,getAnimatableNone:function(e){const t=Wkt(e);return Ukt(e)(t.map(Gkt))}},Ykt=new Set(["brightness","contrast","saturate","opacity"]);function Xkt(e){const[t,r]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[n]=r.match(jkt)||[];if(!n)return e;const o=r.replace(n,"");let a=Ykt.has(t)?1:0;return n!==r&&(a*=100),t+"("+a+o+")"}const Zkt=/\b([a-z-]*)\(.*?\)/gu,Qkt={...Kkt,getAnimatableNone:e=>{const t=e.match(Zkt);return t?t.map(Xkt).join(" "):e}},Jkt={...ewt,color:Lkt,backgroundColor:Lkt,outlineColor:Lkt,fill:Lkt,stroke:Lkt,borderColor:Lkt,borderTopColor:Lkt,borderRightColor:Lkt,borderBottomColor:Lkt,borderLeftColor:Lkt,filter:Qkt,WebkitFilter:Qkt},e_t=e=>Jkt[e];function t_t(e,t){let r=e_t(e);return r!==Qkt&&(r=Kkt),r.getAnimatableNone?r.getAnimatableNone(t):void 0}const r_t=new Set(["auto","none","0"]);const n_t=e=>e===Vxt||e===Gxt,o_t=(e,t)=>parseFloat(e.split(", ")[t]),a_t=(e,t)=>(r,{transform:n})=>{if("none"===n||!n)return 0;const o=n.match(/^matrix3d\((.+)\)$/u);if(o)return o_t(o[1],t);{const t=n.match(/^matrix\((.+)\)$/u);return t?o_t(t[1],e):0}},i_t=new Set(["x","y","z"]),s_t=Txt.filter(e=>!i_t.has(e));const l_t={width:({x:e},{paddingLeft:t="0",paddingRight:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),height:({y:e},{paddingTop:t="0",paddingBottom:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:a_t(4,13),y:a_t(5,14)};l_t.translateX=l_t.x,l_t.translateY=l_t.y;const c_t=new Set;let u_t=!1,d_t=!1;function p_t(){if(d_t){const e=Array.from(c_t).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),r=new Map;t.forEach(e=>{const t=function(e){const t=[];return s_t.forEach(r=>{const n=e.getValue(r);void 0!==n&&(t.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),t}(e);t.length&&(r.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();const t=r.get(e);t&&t.forEach(([t,r])=>{var n;null===(n=e.getValue(t))||void 0===n||n.set(r)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)})}d_t=!1,u_t=!1,c_t.forEach(e=>e.complete()),c_t.clear()}function h_t(){c_t.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(d_t=!0)})}class f_t{constructor(e,t,r,n,o,a=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=r,this.motionValue=n,this.element=o,this.isAsync=a}scheduleResolve(){this.isScheduled=!0,this.isAsync?(c_t.add(this),u_t||(u_t=!0,qbt.read(h_t),qbt.resolveKeyframes(p_t))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:r,motionValue:n}=this;for(let o=0;o<e.length;o++)if(null===e[o])if(0===o){const o=null==n?void 0:n.get(),a=e[e.length-1];if(void 0!==o)e[0]=o;else if(r&&t){const n=r.readValue(t,a);null!=n&&(e[0]=n)}void 0===e[0]&&(e[0]=a),n&&void 0===o&&n.set(e[0])}else e[o]=e[o-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),c_t.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,c_t.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const m_t=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),v_t=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function y_t(e,t,r=1){Fbt(r<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[n,o]=function(e){const t=v_t.exec(e);if(!t)return[,];const[,r,n,o]=t;return[`--${r??n}`,o]}(e);if(!n)return;const a=window.getComputedStyle(t).getPropertyValue(n);if(a){const e=a.trim();return m_t(e)?parseFloat(e):e}return Ixt(o)?y_t(o,t,r+1):o}const g_t=e=>t=>t.test(e),b_t=[Vxt,Gxt,Uxt,Wxt,Yxt,Kxt,{test:e=>"auto"===e,parse:e=>e}],x_t=e=>b_t.find(g_t(e));class w_t extends f_t{constructor(e,t,r,n,o){super(e,t,r,n,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:r}=this;if(!t||!t.current)return;super.readKeyframes();for(let r=0;r<e.length;r++){let n=e[r];if("string"==typeof n&&(n=n.trim(),Ixt(n))){const o=y_t(n,t.current);void 0!==o&&(e[r]=o),r===e.length-1&&(this.finalKeyframe=n)}}if(this.resolveNoneKeyframes(),!okt.has(r)||2!==e.length)return;const[n,o]=e,a=x_t(n),i=x_t(o);if(a!==i)if(n_t(a)&&n_t(i))for(let t=0;t<e.length;t++){const r=e[t];"string"==typeof r&&(e[t]=parseFloat(r))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:t}=this,r=[];for(let t=0;t<e.length;t++)Pkt(e[t])&&r.push(t);r.length&&function(e,t,r){let n,o=0;for(;o<e.length&&!n;){const t=e[o];"string"==typeof t&&!r_t.has(t)&&$kt(t).values.length&&(n=e[o]),o++}if(n&&r)for(const o of t)e[o]=t_t(r,n)}(e,r,t)}measureInitialState(){const{element:e,unresolvedKeyframes:t,name:r}=this;if(!e||!e.current)return;"height"===r&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=l_t[r](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;const n=t[t.length-1];void 0!==n&&e.getValue(r,n).jump(n,!1)}measureEndState(){var e;const{element:t,name:r,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const o=t.getValue(r);o&&o.jump(this.measuredOrigin,!1);const a=n.length-1,i=n[a];n[a]=l_t[r](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==i&&void 0===this.finalKeyframe&&(this.finalKeyframe=i),!(null===(e=this.removedTransforms)||void 0===e)&&e.length&&this.removedTransforms.forEach(([e,r])=>{t.getValue(e).set(r)}),this.resolveNoneKeyframes()}}const k_t=(e,t)=>"zIndex"!==t&&!("number"!=typeof e&&!Array.isArray(e)&&("string"!=typeof e||!Kkt.test(e)&&"0"!==e||e.startsWith("url(")));const __t=e=>null!==e;function C_t(e,{repeat:t,repeatType:r="loop"},n){const o=e.filter(__t),a=t&&"loop"!==r&&t%2==1?0:o.length-1;return a&&void 0!==n?n:o[a]}class M_t{constructor({autoplay:e=!0,delay:t=0,type:r="keyframes",repeat:n=0,repeatDelay:o=0,repeatType:a="loop",...i}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=skt.now(),this.options={autoplay:e,delay:t,type:r,repeat:n,repeatDelay:o,repeatType:a,...i},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&(h_t(),p_t()),this._resolved}onKeyframesResolved(e,t){this.resolvedAt=skt.now(),this.hasAttemptedResolve=!0;const{name:r,type:n,velocity:o,delay:a,onComplete:i,onUpdate:s,isGenerator:l}=this.options;if(!l&&!function(e,t,r,n){const o=e[0];if(null===o)return!1;if("display"===t||"visibility"===t)return!0;const a=e[e.length-1],i=k_t(o,t),s=k_t(a,t);return Rbt(i===s,`You are trying to animate ${t} from "${o}" to "${a}". ${o} is not an animatable value - to enable this animation set ${o} to a value animatable to ${a} via the \`style\` property.`),!(!i||!s)&&(function(e){const t=e[0];if(1===e.length)return!0;for(let r=0;r<e.length;r++)if(e[r]!==t)return!0}(e)||("spring"===r||Fwt(r))&&n)}(e,r,n,o)){if(!a)return s&&s(C_t(e,this.options,t)),i&&i(),void this.resolveFinishedPromise();this.options.duration=0}const c=this.initPlayback(e,t);!1!==c&&(this._resolved={keyframes:e,finalKeyframe:t,...c},this.onPostResolved())}onPostResolved(){}then(e,t){return this.currentFinishedPromise.then(e,t)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}const S_t=(e,t,r)=>e+(t-e)*r;function D_t(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function O_t(e,t){return r=>r>0?t:e}const P_t=(e,t,r)=>{const n=e*e,o=r*(t*t-n)+n;return o<0?0:Math.sqrt(o)},E_t=[Ikt,zkt,Akt];function j_t(e){const t=(e=>E_t.find(t=>t.test(e)))(e);if(Rbt(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let r=t.parse(e);return t===Akt&&(r=function({hue:e,saturation:t,lightness:r,alpha:n}){e/=360,r/=100;let o=0,a=0,i=0;if(t/=100){const n=r<.5?r*(1+t):r+t-r*t,s=2*r-n;o=D_t(s,n,e+1/3),a=D_t(s,n,e),i=D_t(s,n,e-1/3)}else o=a=i=r;return{red:Math.round(255*o),green:Math.round(255*a),blue:Math.round(255*i),alpha:n}}(r)),r}const T_t=(e,t)=>{const r=j_t(e),n=j_t(t);if(!r||!n)return O_t(e,t);const o={...r};return e=>(o.red=P_t(r.red,n.red,e),o.green=P_t(r.green,n.green,e),o.blue=P_t(r.blue,n.blue,e),o.alpha=S_t(r.alpha,n.alpha,e),zkt.transform(o))},N_t=(e,t)=>r=>t(e(r)),R_t=(...e)=>e.reduce(N_t),F_t=new Set(["none","hidden"]);function z_t(e,t){return r=>S_t(e,t,r)}function I_t(e){return"number"==typeof e?z_t:"string"==typeof e?Ixt(e)?O_t:Lkt.test(e)?T_t:B_t:Array.isArray(e)?A_t:"object"==typeof e?Lkt.test(e)?T_t:L_t:O_t}function A_t(e,t){const r=[...e],n=r.length,o=e.map((e,r)=>I_t(e)(e,t[r]));return e=>{for(let t=0;t<n;t++)r[t]=o[t](e);return r}}function L_t(e,t){const r={...e,...t},n={};for(const o in r)void 0!==e[o]&&void 0!==t[o]&&(n[o]=I_t(e[o])(e[o],t[o]));return e=>{for(const t in n)r[t]=n[t](e);return r}}const B_t=(e,t)=>{const r=Kkt.createTransformer(t),n=$kt(e),o=$kt(t);return n.indexes.var.length===o.indexes.var.length&&n.indexes.color.length===o.indexes.color.length&&n.indexes.number.length>=o.indexes.number.length?F_t.has(e)&&!o.values.length||F_t.has(t)&&!n.values.length?function(e,t){return F_t.has(e)?r=>r<=0?e:t:r=>r>=1?t:e}(e,t):R_t(A_t(function(e,t){var r;const n=[],o={color:0,var:0,number:0};for(let a=0;a<t.values.length;a++){const i=t.types[a],s=e.indexes[i][o[i]],l=null!==(r=e.values[s])&&void 0!==r?r:0;n[a]=l,o[i]++}return n}(n,o),o.values),r):(Rbt(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),O_t(e,t))};function V_t(e,t,r){return"number"==typeof e&&"number"==typeof t&&"number"==typeof r?S_t(e,t,r):I_t(e)(e,t)}function H_t(e,t,r){const n=Math.max(t-5,0);return dkt(r-e(n),t-n)}const q_t=100,$_t=10,W_t=1,U_t=0,G_t=800,K_t=.3,Y_t=.3,X_t={granular:.01,default:2},Z_t={granular:.005,default:.5},Q_t=.01,J_t=10,eCt=.05,tCt=1,rCt=.001;function nCt({duration:e=G_t,bounce:t=K_t,velocity:r=U_t,mass:n=W_t}){let o,a;Rbt(e<=Abt(J_t),"Spring duration must be 10 seconds or less");let i=1-t;i=Bxt(eCt,tCt,i),e=Bxt(Q_t,J_t,Lbt(e)),i<1?(o=t=>{const n=t*i,o=n*e,a=n-r,s=aCt(t,i),l=Math.exp(-o);return rCt-a/s*l},a=t=>{const n=t*i*e,a=n*r+r,s=Math.pow(i,2)*Math.pow(t,2)*e,l=Math.exp(-n),c=aCt(Math.pow(t,2),i);return(-o(t)+rCt>0?-1:1)*((a-s)*l)/c}):(o=t=>Math.exp(-t*e)*((t-r)*e+1)-rCt,a=t=>Math.exp(-t*e)*(e*e*(r-t)));const s=function(e,t,r){let n=r;for(let r=1;r<oCt;r++)n-=e(n)/t(n);return n}(o,a,5/e);if(e=Abt(e),isNaN(s))return{stiffness:q_t,damping:$_t,duration:e};{const t=Math.pow(s,2)*n;return{stiffness:t,damping:2*i*Math.sqrt(n*t),duration:e}}}const oCt=12;function aCt(e,t){return e*Math.sqrt(1-t*t)}const iCt=["duration","bounce"],sCt=["stiffness","damping","mass"];function lCt(e,t){return t.some(t=>void 0!==e[t])}function cCt(e=Y_t,t=K_t){const r="object"!=typeof e?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:n,restDelta:o}=r;const a=r.keyframes[0],i=r.keyframes[r.keyframes.length-1],s={done:!1,value:a},{stiffness:l,damping:c,mass:u,duration:d,velocity:p,isResolvedFromDuration:h}=function(e){let t={velocity:U_t,stiffness:q_t,damping:$_t,mass:W_t,isResolvedFromDuration:!1,...e};if(!lCt(e,sCt)&&lCt(e,iCt))if(e.visualDuration){const r=e.visualDuration,n=2*Math.PI/(1.2*r),o=n*n,a=2*Bxt(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:W_t,stiffness:o,damping:a}}else{const r=nCt(e);t={...t,...r,mass:W_t},t.isResolvedFromDuration=!0}return t}({...r,velocity:-Lbt(r.velocity||0)}),f=p||0,m=c/(2*Math.sqrt(l*u)),v=i-a,y=Lbt(Math.sqrt(l/u)),g=Math.abs(v)<5;let b;if(n||(n=g?X_t.granular:X_t.default),o||(o=g?Z_t.granular:Z_t.default),m<1){const e=aCt(y,m);b=t=>{const r=Math.exp(-m*y*t);return i-r*((f+m*y*v)/e*Math.sin(e*t)+v*Math.cos(e*t))}}else if(1===m)b=e=>i-Math.exp(-y*e)*(v+(f+y*v)*e);else{const e=y*Math.sqrt(m*m-1);b=t=>{const r=Math.exp(-m*y*t),n=Math.min(e*t,300);return i-r*((f+m*y*v)*Math.sinh(n)+e*v*Math.cosh(n))/e}}const x={calculatedDuration:h&&d||null,next:e=>{const t=b(e);if(h)s.done=e>=d;else{let r=0;m<1&&(r=0===e?Abt(f):H_t(b,e,t));const a=Math.abs(r)<=n,l=Math.abs(i-t)<=o;s.done=a&&l}return s.value=s.done?i:t,s},toString:()=>{const e=Math.min(Rwt(x),Nwt),t=Vwt(t=>x.next(e*t).value,e,30);return e+"ms "+t}};return x}function uCt({keyframes:e,velocity:t=0,power:r=.8,timeConstant:n=325,bounceDamping:o=10,bounceStiffness:a=500,modifyTarget:i,min:s,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],p={done:!1,value:d},h=e=>void 0===s?l:void 0===l||Math.abs(s-e)<Math.abs(l-e)?s:l;let f=r*t;const m=d+f,v=void 0===i?m:i(m);v!==m&&(f=v-d);const y=e=>-f*Math.exp(-e/n),g=e=>v+y(e),b=e=>{const t=y(e),r=g(e);p.done=Math.abs(t)<=c,p.value=p.done?v:r};let x,w;const k=e=>{(e=>void 0!==s&&e<s||void 0!==l&&e>l)(p.value)&&(x=e,w=cCt({keyframes:[p.value,h(p.value)],velocity:H_t(g,e,p.value),damping:o,stiffness:a,restDelta:c,restSpeed:u}))};return k(0),{calculatedDuration:null,next:e=>{let t=!1;return!w&&void 0===x&&(t=!0,b(e),k(e)),void 0!==x&&e>=x?w.next(e-x):(!t&&b(e),p)}}}const dCt=gkt(.42,0,1,1),pCt=gkt(0,0,.58,1),hCt=gkt(.42,0,.58,1),fCt={linear:Nbt,easeIn:dCt,easeInOut:hCt,easeOut:pCt,circIn:Mkt,circInOut:Dkt,circOut:Skt,backIn:kkt,backInOut:_kt,backOut:wkt,anticipate:Ckt},mCt=e=>{if(Iwt(e)){Fbt(4===e.length,"Cubic bezier arrays must contain four numerical values.");const[t,r,n,o]=e;return gkt(t,r,n,o)}return"string"==typeof e?(Fbt(void 0!==fCt[e],`Invalid easing type '${e}'`),fCt[e]):e};function vCt(e,t,{clamp:r=!0,ease:n,mixer:o}={}){const a=e.length;if(Fbt(a===t.length,"Both input and output ranges must be the same length"),1===a)return()=>t[0];if(2===a&&t[0]===t[1])return()=>t[1];const i=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=function(e,t,r){const n=[],o=r||V_t,a=e.length-1;for(let r=0;r<a;r++){let a=o(e[r],e[r+1]);if(t){const e=Array.isArray(t)?t[r]||Nbt:t;a=R_t(e,a)}n.push(a)}return n}(t,n,o),l=s.length,c=r=>{if(i&&r<e[0])return t[0];let n=0;if(l>1)for(;n<e.length-2&&!(r<e[n+1]);n++);const o=Ibt(e[n],e[n+1],r);return s[n](o)};return r?t=>c(Bxt(e[0],e[a-1],t)):c}function yCt(e){const t=[0];return function(e,t){const r=e[e.length-1];for(let n=1;n<=t;n++){const o=Ibt(0,t,n);e.push(S_t(r,1,o))}}(t,e.length-1),t}function gCt(e,t){return e.map(()=>t||hCt).splice(0,e.length-1)}function bCt({duration:e=300,keyframes:t,times:r,ease:n="easeInOut"}){const o=(e=>Array.isArray(e)&&"number"!=typeof e[0])(n)?n.map(mCt):mCt(n),a={done:!1,value:t[0]},i=function(e,t){return e.map(e=>e*t)}(r&&r.length===t.length?r:yCt(t),e),s=vCt(i,t,{ease:Array.isArray(o)?o:gCt(t,o)});return{calculatedDuration:e,next:t=>(a.value=s(t),a.done=t>=e,a)}}const xCt=e=>{const t=({timestamp:t})=>e(t);return{start:()=>qbt.update(t,!0),stop:()=>$bt(t),now:()=>Wbt.isProcessing?Wbt.timestamp:skt.now()}},wCt={decay:uCt,inertia:uCt,tween:bCt,keyframes:bCt,spring:cCt},kCt=e=>e/100;class _Ct extends M_t{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:e}=this.options;e&&e()};const{name:t,motionValue:r,element:n,keyframes:o}=this.options,a=(null==n?void 0:n.KeyframeResolver)||f_t;this.resolver=new a(o,(e,t)=>this.onKeyframesResolved(e,t),t,r,n),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(e){const{type:t="keyframes",repeat:r=0,repeatDelay:n=0,repeatType:o,velocity:a=0}=this.options,i=Fwt(t)?t:wCt[t]||bCt;let s,l;i!==bCt&&"number"!=typeof e[0]&&("production"!==process.env.NODE_ENV&&Fbt(2===e.length,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${e}`),s=R_t(kCt,V_t(e[0],e[1])),e=[0,100]);const c=i({...this.options,keyframes:e});"mirror"===o&&(l=i({...this.options,keyframes:[...e].reverse(),velocity:-a})),null===c.calculatedDuration&&(c.calculatedDuration=Rwt(c));const{calculatedDuration:u}=c,d=u+n;return{generator:c,mirroredGenerator:l,mapPercentToKeyframes:s,calculatedDuration:u,resolvedDuration:d,totalDuration:d*(r+1)-n}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&e?this.state=this.pendingPlayState:this.pause()}tick(e,t=!1){const{resolved:r}=this;if(!r){const{keyframes:e}=this.options;return{done:!0,value:e[e.length-1]}}const{finalKeyframe:n,generator:o,mirroredGenerator:a,mapPercentToKeyframes:i,keyframes:s,calculatedDuration:l,totalDuration:c,resolvedDuration:u}=r;if(null===this.startTime)return o.next(0);const{delay:d,repeat:p,repeatType:h,repeatDelay:f,onUpdate:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-c/this.speed,this.startTime)),t?this.currentTime=e:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const v=this.currentTime-d*(this.speed>=0?1:-1),y=this.speed>=0?v<0:v>c;this.currentTime=Math.max(v,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=c);let g=this.currentTime,b=o;if(p){const e=Math.min(this.currentTime,c)/u;let t=Math.floor(e),r=e%1;!r&&e>=1&&(r=1),1===r&&t--,t=Math.min(t,p+1),!!(t%2)&&("reverse"===h?(r=1-r,f&&(r-=f/u)):"mirror"===h&&(b=a)),g=Bxt(0,1,r)*u}const x=y?{done:!1,value:s[0]}:b.next(g);i&&(x.value=i(x.value));let{done:w}=x;!y&&null!==l&&(w=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const k=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return k&&void 0!==n&&(x.value=C_t(s,this.options,n)),m&&m(x.value),k&&this.finish(),x}get duration(){const{resolved:e}=this;return e?Lbt(e.calculatedDuration):0}get time(){return Lbt(this.currentTime)}set time(e){e=Abt(e),this.currentTime=e,null!==this.holdTime||0===this.speed?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=Lbt(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:e=xCt,onPlay:t,startTime:r}=this.options;this.driver||(this.driver=e(e=>this.tick(e))),t&&t();const n=this.driver.now();null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=n):this.startTime=r??this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;this._resolved?(this.state="paused",this.holdTime=null!==(e=this.currentTime)&&void 0!==e?e:0):this.pendingPlayState="paused"}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}const CCt=new Set(["opacity","clipPath","filter","transform"]);function MCt(e,t,r,{delay:n=0,duration:o=300,repeat:a=0,repeatType:i="loop",ease:s="easeInOut",times:l}={}){const c={[t]:r};l&&(c.offset=l);const u=Wwt(s,o);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:n,duration:o,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:a+1,direction:"reverse"===i?"alternate":"normal"})}const SCt=zbt(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));const DCt={anticipate:Ckt,backInOut:_kt,circInOut:Dkt};class OCt extends M_t{constructor(e){super(e);const{name:t,motionValue:r,element:n,keyframes:o}=this.options;this.resolver=new w_t(o,(e,t)=>this.onKeyframesResolved(e,t),t,r,n),this.resolver.scheduleResolve()}initPlayback(e,t){let{duration:r=300,times:n,ease:o,type:a,motionValue:i,name:s,startTime:l}=this.options;if(!i.owner||!i.owner.current)return!1;if("string"==typeof o&&Bwt()&&function(e){return e in DCt}(o)&&(o=DCt[o]),function(e){return Fwt(e.type)||"spring"===e.type||!Hwt(e.ease)}(this.options)){const{onComplete:t,onUpdate:i,motionValue:s,element:l,...c}=this.options,u=function(e,t){const r=new _Ct({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let n={done:!1,value:e[0]};const o=[];let a=0;for(;!n.done&&a<2e4;)n=r.sample(a),o.push(n.value),a+=10;return{times:void 0,keyframes:o,duration:a-10,ease:"linear"}}(e,c);1===(e=u.keyframes).length&&(e[1]=e[0]),r=u.duration,n=u.times,o=u.ease,a="keyframes"}const c=MCt(i.owner.current,s,e,{...this.options,duration:r,times:n,ease:o});return c.startTime=l??this.calcStartTime(),this.pendingTimeline?(zwt(c,this.pendingTimeline),this.pendingTimeline=void 0):c.onfinish=()=>{const{onComplete:r}=this.options;i.set(C_t(e,this.options,t)),r&&r(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:r,times:n,type:a,ease:o,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:t}=e;return Lbt(t)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:t}=e;return Lbt(t.currentTime||0)}set time(e){const{resolved:t}=this;if(!t)return;const{animation:r}=t;r.currentTime=Abt(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:t}=e;return t.playbackRate}set speed(e){const{resolved:t}=this;if(!t)return;const{animation:r}=t;r.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:t}=e;return t.playState}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:t}=e;return t.startTime}attachTimeline(e){if(this._resolved){const{resolved:t}=this;if(!t)return Nbt;const{animation:r}=t;zwt(r,e)}else this.pendingTimeline=e;return Nbt}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:t}=e;"finished"===t.playState&&this.updateFinishedPromise(),t.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:t}=e;t.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:t,keyframes:r,duration:n,type:o,ease:a,times:i}=e;if("idle"===t.playState||"finished"===t.playState)return;if(this.time){const{motionValue:e,onUpdate:t,onComplete:s,element:l,...c}=this.options,u=new _Ct({...c,keyframes:r,duration:n,type:o,ease:a,times:i,isGenerator:!0}),d=Abt(this.time);e.setWithVelocity(u.sample(d-10).value,u.sample(d).value,10)}const{onStop:s}=this.options;s&&s(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:t,name:r,repeatDelay:n,repeatType:o,damping:a,type:i}=e;if(!(t&&t.owner&&t.owner.current instanceof HTMLElement))return!1;const{onUpdate:s,transformTemplate:l}=t.owner.getProps();return SCt()&&r&&CCt.has(r)&&!s&&!l&&!n&&"mirror"!==o&&0!==a&&"inertia"!==i}}const PCt={type:"spring",stiffness:500,damping:25,restSpeed:10},ECt={type:"keyframes",duration:.8},jCt={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},TCt=(e,{keyframes:t})=>t.length>2?ECt:Nxt.has(e)?e.startsWith("scale")?(e=>({type:"spring",stiffness:550,damping:0===e?2*Math.sqrt(550):30,restSpeed:10}))(t[1]):PCt:jCt;const NCt=(e,t,r,n={},o,a)=>i=>{const s=Twt(n,e)||{},l=s.delay||n.delay||0;let{elapsed:c=0}=n;c-=Abt(l);let u={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:t.getVelocity(),...s,delay:-c,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{i(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:o};(function({when:e,delay:t,delayChildren:r,staggerChildren:n,staggerDirection:o,repeat:a,repeatType:i,repeatDelay:s,from:l,elapsed:c,...u}){return!!Object.keys(u).length})(s)||(u={...u,...TCt(e,u)}),u.duration&&(u.duration=Abt(u.duration)),u.repeatDelay&&(u.repeatDelay=Abt(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let d=!1;if((!1===u.type||0===u.duration&&!u.repeatDelay)&&(u.duration=0,0===u.delay&&(d=!0)),d&&!a&&void 0!==t.get()){const e=C_t(u.keyframes,s);if(void 0!==e)return qbt.update(()=>{u.onUpdate(e),u.onComplete()}),new jwt([])}return!a&&OCt.supports(u)?new OCt(u):new _Ct(u)};function RCt({protectedKeys:e,needsAnimating:t},r){const n=e.hasOwnProperty(r)&&!0!==t[r];return t[r]=!1,n}function FCt(e,t,{delay:r=0,transitionOverride:n,type:o}={}){var a;let{transition:i=e.getDefaultTransition(),transitionEnd:s,...l}=t;n&&(i=n);const c=[],u=o&&e.animationState&&e.animationState.getState()[o];for(const t in l){const n=e.getValue(t,null!==(a=e.latestValues[t])&&void 0!==a?a:null),o=l[t];if(void 0===o||u&&RCt(u,t))continue;const s={delay:r,...Twt(i||{},t)};let d=!1;if(window.MotionHandoffAnimation){const r=vkt(e);if(r){const e=window.MotionHandoffAnimation(r,t,qbt);null!==e&&(s.startTime=e,d=!0)}}mkt(e,t),n.start(NCt(t,n,o,e.shouldReduceMotion&&okt.has(t)?{type:!1}:s,e,d));const p=n.animation;p&&c.push(p)}return s&&Promise.all(c).then(()=>{qbt.update(()=>{s&&function(e,t){const r=Owt(e,t);let{transitionEnd:n={},transition:o={},...a}=r||{};a={...a,...n};for(const t in a)fkt(e,t,Dxt(a[t]))}(e,s)})}),c}function zCt(e,t,r={}){var n;const o=Owt(e,t,"exit"===r.type?null===(n=e.presenceContext)||void 0===n?void 0:n.custom:void 0);let{transition:a=e.getDefaultTransition()||{}}=o||{};r.transitionOverride&&(a=r.transitionOverride);const i=o?()=>Promise.all(FCt(e,o,r)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(n=0)=>{const{delayChildren:o=0,staggerChildren:i,staggerDirection:s}=a;return function(e,t,r=0,n=0,o=1,a){const i=[],s=(e.variantChildren.size-1)*n,l=1===o?(e=0)=>e*n:(e=0)=>s-e*n;return Array.from(e.variantChildren).sort(ICt).forEach((e,n)=>{e.notify("AnimationStart",t),i.push(zCt(e,t,{...a,delay:r+l(n)}).then(()=>e.notify("AnimationComplete",t)))}),Promise.all(i)}(e,t,o+n,i,s,r)}:()=>Promise.resolve(),{when:l}=a;if(l){const[e,t]="beforeChildren"===l?[i,s]:[s,i];return e().then(()=>t())}return Promise.all([i(),s(r.delay)])}function ICt(e,t){return e.sortNodePosition(t)}const ACt=ixt.length;function LCt(e){if(!e)return;if(!e.isControllingVariants){const t=e.parent&&LCt(e.parent)||{};return void 0!==e.props.initial&&(t.initial=e.props.initial),t}const t={};for(let r=0;r<ACt;r++){const n=ixt[r],o=e.props[n];(nxt(o)||!1===o)&&(t[n]=o)}return t}const BCt=[...axt].reverse(),VCt=axt.length;function HCt(e){return t=>Promise.all(t.map(({animation:t,options:r})=>function(e,t,r={}){let n;if(e.notify("AnimationStart",t),Array.isArray(t)){const o=t.map(t=>zCt(e,t,r));n=Promise.all(o)}else if("string"==typeof t)n=zCt(e,t,r);else{const o="function"==typeof t?Owt(e,t,r.custom):t;n=Promise.all(FCt(e,o,r))}return n.then(()=>{e.notify("AnimationComplete",t)})}(e,t,r)))}function qCt(e){let t=HCt(e),r=UCt(),n=!0;const o=t=>(r,n)=>{var o;const a=Owt(e,n,"exit"===t?null===(o=e.presenceContext)||void 0===o?void 0:o.custom:void 0);if(a){const{transition:e,transitionEnd:t,...n}=a;r={...r,...n,...t}}return r};function a(a){const{props:i}=e,s=LCt(e.parent)||{},l=[],c=new Set;let u={},d=1/0;for(let t=0;t<VCt;t++){const p=BCt[t],h=r[p],f=void 0!==i[p]?i[p]:s[p],m=nxt(f),v=p===a?h.isActive:null;!1===v&&(d=t);let y=f===s[p]&&f!==i[p]&&m;if(y&&n&&e.manuallyAnimateOnMount&&(y=!1),h.protectedKeys={...u},!h.isActive&&null===v||!f&&!h.prevProp||oxt(f)||"boolean"==typeof f)continue;const g=$Ct(h.prevProp,f);let b=g||p===a&&h.isActive&&!y&&m||t>d&&m,x=!1;const w=Array.isArray(f)?f:[f];let k=w.reduce(o(p),{});!1===v&&(k={});const{prevResolvedValues:_={}}=h,C={..._,...k},M=t=>{b=!0,c.has(t)&&(x=!0,c.delete(t)),h.needsAnimating[t]=!0;const r=e.getValue(t);r&&(r.liveStyle=!1)};for(const e in C){const t=k[e],r=_[e];if(u.hasOwnProperty(e))continue;let n=!1;n=Sxt(t)&&Sxt(r)?!Dwt(t,r):t!==r,n?null!=t?M(e):c.add(e):void 0!==t&&c.has(e)?M(e):h.protectedKeys[e]=!0}h.prevProp=f,h.prevResolvedValues=k,h.isActive&&(u={...u,...k}),n&&e.blockInitialAnimation&&(b=!1),b&&(!y||!g||x)&&l.push(...w.map(e=>({animation:e,options:{type:p}})))}if(c.size){const t={};c.forEach(r=>{const n=e.getBaseTarget(r),o=e.getValue(r);o&&(o.liveStyle=!0),t[r]=n??null}),l.push({animation:t})}let p=!!l.length;return n&&(!1===i.initial||i.initial===i.animate)&&!e.manuallyAnimateOnMount&&(p=!1),n=!1,p?t(l):Promise.resolve()}return{animateChanges:a,setActive:function(t,n){var o;if(r[t].isActive===n)return Promise.resolve();null===(o=e.variantChildren)||void 0===o||o.forEach(e=>{var r;return null===(r=e.animationState)||void 0===r?void 0:r.setActive(t,n)}),r[t].isActive=n;const i=a(t);for(const e in r)r[e].protectedKeys={};return i},setAnimateFunction:function(r){t=r(e)},getState:()=>r,reset:()=>{r=UCt(),n=!0}}}function $Ct(e,t){return"string"==typeof t?t!==e:!!Array.isArray(t)&&!Dwt(t,e)}function WCt(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function UCt(){return{animate:WCt(!0),whileInView:WCt(),whileHover:WCt(),whileTap:WCt(),whileDrag:WCt(),whileFocus:WCt(),exit:WCt()}}class GCt{constructor(e){this.isMounted=!1,this.node=e}update(){}}let KCt=0;const YCt={animation:{Feature:class extends GCt{constructor(e){super(e),e.animationState||(e.animationState=qCt(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();oxt(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),null===(e=this.unmountControls)||void 0===e||e.call(this)}}},exit:{Feature:class extends GCt{constructor(){super(...arguments),this.id=KCt++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;const n=this.node.animationState.setActive("exit",!e);t&&!e&&n.then(()=>t(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}}};function XCt(e,t,r,n={passive:!0}){return e.addEventListener(t,r,n),()=>e.removeEventListener(t,r)}function ZCt(e){return{point:{x:e.pageX,y:e.pageY}}}function QCt(e,t,r,n){return XCt(e,t,(e=>t=>Zwt(t)&&e(t,ZCt(t)))(r),n)}const JCt=(e,t)=>Math.abs(e-t);class eMt{constructor(e,t,{transformPagePoint:r,contextWindow:n,dragSnapToOrigin:o=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const e=nMt(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,r=function(e,t){const r=JCt(e.x,t.x),n=JCt(e.y,t.y);return Math.sqrt(r**2+n**2)}(e.offset,{x:0,y:0})>=3;if(!t&&!r)return;const{point:n}=e,{timestamp:o}=Wbt;this.history.push({...n,timestamp:o});const{onStart:a,onMove:i}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),i&&i(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=tMt(t,this.transformPagePoint),qbt.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();const{onEnd:r,onSessionEnd:n,resumeAnimation:o}=this.handlers;if(this.dragSnapToOrigin&&o&&o(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const a=nMt("pointercancel"===e.type?this.lastMoveEventInfo:tMt(t,this.transformPagePoint),this.history);this.startEvent&&r&&r(e,a),n&&n(e,a)},!Zwt(e))return;this.dragSnapToOrigin=o,this.handlers=t,this.transformPagePoint=r,this.contextWindow=n||window;const a=tMt(ZCt(e),this.transformPagePoint),{point:i}=a,{timestamp:s}=Wbt;this.history=[{...i,timestamp:s}];const{onSessionStart:l}=t;l&&l(e,nMt(a,this.history)),this.removeListeners=R_t(QCt(this.contextWindow,"pointermove",this.handlePointerMove),QCt(this.contextWindow,"pointerup",this.handlePointerUp),QCt(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),$bt(this.updatePoint)}}function tMt(e,t){return t?{point:t(e.point)}:e}function rMt(e,t){return{x:e.x-t.x,y:e.y-t.y}}function nMt({point:e},t){return{point:e,delta:rMt(e,aMt(t)),offset:rMt(e,oMt(t)),velocity:iMt(t,.1)}}function oMt(e){return e[0]}function aMt(e){return e[e.length-1]}function iMt(e,t){if(e.length<2)return{x:0,y:0};let r=e.length-1,n=null;const o=aMt(e);for(;r>=0&&(n=e[r],!(o.timestamp-n.timestamp>Abt(t)));)r--;if(!n)return{x:0,y:0};const a=Lbt(o.timestamp-n.timestamp);if(0===a)return{x:0,y:0};const i={x:(o.x-n.x)/a,y:(o.y-n.y)/a};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function sMt(e){return e.max-e.min}function lMt(e,t,r,n=.5){e.origin=n,e.originPoint=S_t(t.min,t.max,e.origin),e.scale=sMt(r)/sMt(t),e.translate=S_t(r.min,r.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function cMt(e,t,r,n){lMt(e.x,t.x,r.x,n?n.originX:void 0),lMt(e.y,t.y,r.y,n?n.originY:void 0)}function uMt(e,t,r){e.min=r.min+t.min,e.max=e.min+sMt(t)}function dMt(e,t,r){e.min=t.min-r.min,e.max=e.min+sMt(t)}function pMt(e,t,r){dMt(e.x,t.x,r.x),dMt(e.y,t.y,r.y)}function hMt(e,t,r){return{min:void 0!==t?e.min+t:void 0,max:void 0!==r?e.max+r-(e.max-e.min):void 0}}function fMt(e,t){let r=t.min-e.min,n=t.max-e.max;return t.max-t.min<e.max-e.min&&([r,n]=[n,r]),{min:r,max:n}}const mMt=.35;function vMt(e,t,r){return{min:yMt(e,t),max:yMt(e,r)}}function yMt(e,t){return"number"==typeof e?e:e[t]||0}const gMt=()=>({x:{min:0,max:0},y:{min:0,max:0}});function bMt(e){return[e("x"),e("y")]}function xMt({top:e,left:t,right:r,bottom:n}){return{x:{min:t,max:r},y:{min:e,max:n}}}function wMt(e){return void 0===e||1===e}function kMt({scale:e,scaleX:t,scaleY:r}){return!wMt(e)||!wMt(t)||!wMt(r)}function _Mt(e){return kMt(e)||CMt(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function CMt(e){return MMt(e.x)||MMt(e.y)}function MMt(e){return e&&"0%"!==e}function SMt(e,t,r){return r+t*(e-r)}function DMt(e,t,r,n,o){return void 0!==o&&(e=SMt(e,o,n)),SMt(e,r,n)+t}function OMt(e,t=0,r=1,n,o){e.min=DMt(e.min,t,r,n,o),e.max=DMt(e.max,t,r,n,o)}function PMt(e,{x:t,y:r}){OMt(e.x,t.translate,t.scale,t.originPoint),OMt(e.y,r.translate,r.scale,r.originPoint)}const EMt=.999999999999,jMt=1.0000000000001;function TMt(e,t){e.min=e.min+t,e.max=e.max+t}function NMt(e,t,r,n,o=.5){OMt(e,t,r,S_t(e.min,e.max,o),n)}function RMt(e,t){NMt(e.x,t.x,t.scaleX,t.scale,t.originX),NMt(e.y,t.y,t.scaleY,t.scale,t.originY)}function FMt(e,t){return xMt(function(e,t){if(!t)return e;const r=t({x:e.left,y:e.top}),n=t({x:e.right,y:e.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}(e.getBoundingClientRect(),t))}const zMt=({current:e})=>e?e.ownerDocument.defaultView:null,IMt=new WeakMap;class AMt{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=e}start(e,{snapToCursor:t=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&!1===r.isPresent)return;const{dragSnapToOrigin:n}=this.getProps();this.panSession=new eMt(e,{onSessionStart:e=>{const{dragSnapToOrigin:r}=this.getProps();r?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(ZCt(e).point)},onStart:(e,t)=>{const{drag:r,dragPropagation:n,onDragStart:o}=this.getProps();if(r&&!n&&(this.openDragLock&&this.openDragLock(),this.openDragLock=function(e){return"x"===e||"y"===e?Uwt[e]?null:(Uwt[e]=!0,()=>{Uwt[e]=!1}):Uwt.x||Uwt.y?null:(Uwt.x=Uwt.y=!0,()=>{Uwt.x=Uwt.y=!1})}(r),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),bMt(e=>{let t=this.getAxisMotionValue(e).get()||0;if(Uxt.test(t)){const{projection:r}=this.visualElement;if(r&&r.layout){const n=r.layout.layoutBox[e];n&&(t=sMt(n)*(parseFloat(t)/100))}}this.originPoint[e]=t}),o&&qbt.postRender(()=>o(e,t)),mkt(this.visualElement,"transform");const{animationState:a}=this.visualElement;a&&a.setActive("whileDrag",!0)},onMove:(e,t)=>{const{dragPropagation:r,dragDirectionLock:n,onDirectionLock:o,onDrag:a}=this.getProps();if(!r&&!this.openDragLock)return;const{offset:i}=t;if(n&&null===this.currentDirection)return this.currentDirection=function(e,t=10){let r=null;return Math.abs(e.y)>t?r="y":Math.abs(e.x)>t&&(r="x"),r}(i),void(null!==this.currentDirection&&o&&o(this.currentDirection));this.updateAxis("x",t.point,i),this.updateAxis("y",t.point,i),this.visualElement.render(),a&&a(e,t)},onSessionEnd:(e,t)=>this.stop(e,t),resumeAnimation:()=>bMt(e=>{var t;return"paused"===this.getAnimationState(e)&&(null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.play())})},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:n,contextWindow:zMt(this.visualElement)})}stop(e,t){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:n}=t;this.startAnimation(n);const{onDragEnd:o}=this.getProps();o&&qbt.postRender(()=>o(e,t))}cancel(){this.isDragging=!1;const{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,r){const{drag:n}=this.getProps();if(!r||!LMt(e,n,this.currentDirection))return;const o=this.getAxisMotionValue(e);let a=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(a=function(e,{min:t,max:r},n){return void 0!==t&&e<t?e=n?S_t(t,e,n.min):Math.max(e,t):void 0!==r&&e>r&&(e=n?S_t(r,e,n.max):Math.min(e,r)),e}(a,this.constraints[e],this.elastic[e])),o.set(a)}resolveConstraints(){var e;const{dragConstraints:t,dragElastic:r}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout,o=this.constraints;t&&pxt(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(e,{top:t,left:r,bottom:n,right:o}){return{x:hMt(e.x,r,o),y:hMt(e.y,t,n)}}(n.layoutBox,t),this.elastic=function(e=mMt){return!1===e?e=0:!0===e&&(e=mMt),{x:vMt(e,"left","right"),y:vMt(e,"top","bottom")}}(r),o!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&bMt(e=>{!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=function(e,t){const r={};return void 0!==t.min&&(r.min=t.min-e.min),void 0!==t.max&&(r.max=t.max-e.min),r}(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!pxt(e))return!1;const r=e.current;Fbt(null!==r,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:n}=this.visualElement;if(!n||!n.layout)return!1;const o=function(e,t,r){const n=FMt(e,r),{scroll:o}=t;return o&&(TMt(n.x,o.offset.x),TMt(n.y,o.offset.y)),n}(r,n.root,this.visualElement.getTransformPagePoint());let a=function(e,t){return{x:fMt(e.x,t.x),y:fMt(e.y,t.y)}}(n.layout.layoutBox,o);if(t){const e=t(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(a));this.hasMutatedConstraints=!!e,e&&(a=xMt(e))}return a}startAnimation(e){const{drag:t,dragMomentum:r,dragElastic:n,dragTransition:o,dragSnapToOrigin:a,onDragTransitionEnd:i}=this.getProps(),s=this.constraints||{},l=bMt(i=>{if(!LMt(i,t,this.currentDirection))return;let l=s&&s[i]||{};a&&(l={min:0,max:0});const c=n?200:1e6,u=n?40:1e7,d={type:"inertia",velocity:r?e[i]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...o,...l};return this.startAxisValueAnimation(i,d)});return Promise.all(l).then(i)}startAxisValueAnimation(e,t){const r=this.getAxisMotionValue(e);return mkt(this.visualElement,e),r.start(NCt(e,r,0,t,this.visualElement,!1))}stopAnimation(){bMt(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){bMt(e=>{var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.pause()})}getAnimationState(e){var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.state}getAxisMotionValue(e){const t=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps();return r[t]||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){bMt(t=>{const{drag:r}=this.getProps();if(!LMt(t,r,this.currentDirection))return;const{projection:n}=this.visualElement,o=this.getAxisMotionValue(t);if(n&&n.layout){const{min:r,max:a}=n.layout.layoutBox[t];o.set(e[t]-S_t(r,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:r}=this.visualElement;if(!pxt(t)||!r||!this.constraints)return;this.stopAnimation();const n={x:0,y:0};bMt(e=>{const t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){const r=t.get();n[e]=function(e,t){let r=.5;const n=sMt(e),o=sMt(t);return o>n?r=Ibt(t.min,t.max-n,e.min):n>o&&(r=Ibt(e.min,e.max-o,t.min)),Bxt(0,1,r)}({min:r,max:r},this.constraints[e])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),bMt(t=>{if(!LMt(t,e,null))return;const r=this.getAxisMotionValue(t),{min:o,max:a}=this.constraints[t];r.set(S_t(o,a,n[t]))})}addListeners(){if(!this.visualElement.current)return;IMt.set(this.visualElement,this);const e=QCt(this.visualElement.current,"pointerdown",e=>{const{drag:t,dragListener:r=!0}=this.getProps();t&&r&&this.start(e)}),t=()=>{const{dragConstraints:e}=this.getProps();pxt(e)&&e.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,n=r.addEventListener("measure",t);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),qbt.read(t);const o=XCt(window,"resize",()=>this.scalePositionWithinConstraints()),a=r.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(bMt(t=>{const r=this.getAxisMotionValue(t);r&&(this.originPoint[t]+=e[t].translate,r.set(r.get()+e[t].translate))}),this.visualElement.render())});return()=>{o(),e(),n(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:r=!1,dragPropagation:n=!1,dragConstraints:o=!1,dragElastic:a=mMt,dragMomentum:i=!0}=e;return{...e,drag:t,dragDirectionLock:r,dragPropagation:n,dragConstraints:o,dragElastic:a,dragMomentum:i}}}function LMt(e,t,r){return!(!0!==t&&t!==e||null!==r&&r!==e)}const BMt=e=>(t,r)=>{e&&qbt.postRender(()=>e(t,r))};const VMt={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function HMt(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const qMt={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!Gxt.test(e))return e;e=parseFloat(e)}return`${HMt(e,t.target.x)}% ${HMt(e,t.target.y)}%`}},$Mt={correct:(e,{treeScale:t,projectionDelta:r})=>{const n=e,o=Kkt.parse(e);if(o.length>5)return n;const a=Kkt.createTransformer(e),i="number"!=typeof o[0]?1:0,s=r.x.scale*t.x,l=r.y.scale*t.y;o[0+i]/=s,o[1+i]/=l;const c=S_t(s,l,.5);return"number"==typeof o[2+i]&&(o[2+i]/=c),"number"==typeof o[3+i]&&(o[3+i]/=c),a(o)}};class WMt extends e.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:r,layoutId:n}=this.props,{projection:o}=e;(function(e){Object.assign(fwt,e)})(GMt),o&&(t.group&&t.group.add(o),r&&r.register&&n&&r.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),VMt.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:r,drag:n,isPresent:o}=this.props,a=r.projection;return a&&(a.isPresent=o,n||e.layoutDependency!==t||void 0===t?a.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?a.promote():a.relegate()||qbt.postRender(()=>{const e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),vxt.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:r}=this.props,{projection:n}=e;n&&(n.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(n),r&&r.deregister&&r.deregister(n))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function UMt(r){const[n,o]=Dbt(),a=e.useContext(bbt);return t.jsx(WMt,{...r,layoutGroup:a,switchLayoutGroup:e.useContext(yxt),isPresent:n,safeToRemove:o})}const GMt={borderRadius:{...qMt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:qMt,borderTopRightRadius:qMt,borderBottomLeftRadius:qMt,borderBottomRightRadius:qMt,boxShadow:$Mt};const KMt=(e,t)=>e.depth-t.depth;class YMt{constructor(){this.children=[],this.isDirty=!1}add(e){lkt(this.children,e),this.isDirty=!0}remove(e){ckt(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(KMt),this.isDirty=!1,this.children.forEach(e)}}const XMt=["TopLeft","TopRight","BottomLeft","BottomRight"],ZMt=XMt.length,QMt=e=>"string"==typeof e?parseFloat(e):e,JMt=e=>"number"==typeof e||Gxt.test(e);function eSt(e,t){return void 0!==e[t]?e[t]:e.borderRadius}const tSt=nSt(0,.5,Skt),rSt=nSt(.5,.95,Nbt);function nSt(e,t,r){return n=>n<e?0:n>t?1:r(Ibt(e,t,n))}function oSt(e,t){e.min=t.min,e.max=t.max}function aSt(e,t){oSt(e.x,t.x),oSt(e.y,t.y)}function iSt(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function sSt(e,t,r,n,o){return e=SMt(e-=t,1/r,n),void 0!==o&&(e=SMt(e,1/o,n)),e}function lSt(e,t,[r,n,o],a,i){!function(e,t=0,r=1,n=.5,o,a=e,i=e){if(Uxt.test(t)&&(t=parseFloat(t),t=S_t(i.min,i.max,t/100)-i.min),"number"!=typeof t)return;let s=S_t(a.min,a.max,n);e===a&&(s-=t),e.min=sSt(e.min,t,r,s,o),e.max=sSt(e.max,t,r,s,o)}(e,t[r],t[n],t[o],t.scale,a,i)}const cSt=["x","scaleX","originX"],uSt=["y","scaleY","originY"];function dSt(e,t,r,n){lSt(e.x,t,cSt,r?r.x:void 0,n?n.x:void 0),lSt(e.y,t,uSt,r?r.y:void 0,n?n.y:void 0)}function pSt(e){return 0===e.translate&&1===e.scale}function hSt(e){return pSt(e.x)&&pSt(e.y)}function fSt(e,t){return e.min===t.min&&e.max===t.max}function mSt(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function vSt(e,t){return mSt(e.x,t.x)&&mSt(e.y,t.y)}function ySt(e){return sMt(e.x)/sMt(e.y)}function gSt(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class bSt{constructor(){this.members=[]}add(e){lkt(this.members,e),e.scheduleRender()}remove(e){if(ckt(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){const t=this.members.findIndex(t=>e===t);if(0===t)return!1;let r;for(let e=t;e>=0;e--){const t=this.members[e];if(!1!==t.isPresent){r=t;break}}return!!r&&(this.promote(r),!0)}promote(e,t){const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.instance&&r.scheduleRender(),e.scheduleRender(),e.resumeFrom=r,t&&(e.resumeFrom.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:n}=e.options;!1===n&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:t,resumingFrom:r}=e;t.onExitComplete&&t.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const xSt={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},wSt=typeof window<"u"&&void 0!==window.MotionDebug,kSt=["","X","Y","Z"],_St={visibility:"hidden"};let CSt=0;function MSt(e,t,r,n){const{latestValues:o}=t;o[e]&&(r[e]=o[e],t.setStaticValue(e,0),n&&(n[e]=0))}function SSt(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const r=vkt(t);if(window.MotionHasOptimisedAnimation(r,"transform")){const{layout:t,layoutId:n}=e.options;window.MotionCancelOptimisedAnimation(r,"transform",qbt,!(t||n))}const{parent:n}=e;n&&!n.hasCheckedOptimisedAppear&&SSt(n)}function DSt({attachResizeListener:e,defaultParent:t,measureScroll:r,checkIsScrollRoot:n,resetTransform:o}){return class{constructor(e={},r=(null==t?void 0:t())){this.id=CSt++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,wSt&&(xSt.totalNodes=xSt.resolvedTargetDeltas=xSt.recalculatedProjection=0),this.nodes.forEach(ESt),this.nodes.forEach(ISt),this.nodes.forEach(ASt),this.nodes.forEach(jSt),wSt&&window.MotionDebug.record(xSt)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=r?r.root||r:this,this.path=r?[...r.path,r]:[],this.parent=r,this.depth=r?r.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new YMt)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new ukt),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){const r=this.eventHandlers.get(e);r&&r.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t,r=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=function(e){return e instanceof SVGElement&&"svg"!==e.tagName}(t),this.instance=t;const{layoutId:n,layout:o,visualElement:a}=this.options;if(a&&!a.current&&a.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),r&&(o||n)&&(this.isLayoutDirty=!0),e){let r;const n=()=>this.root.updateBlockedByResize=!1;e(t,()=>{this.root.updateBlockedByResize=!0,r&&r(),r=function(e,t){const r=skt.now(),n=({timestamp:o})=>{const a=o-r;a>=t&&($bt(n),e(a-t))};return qbt.read(n,!0),()=>$bt(n)}(n,250),VMt.hasAnimatedSinceResize&&(VMt.hasAnimatedSinceResize=!1,this.nodes.forEach(zSt))})}n&&this.root.registerSharedNode(n,this),!1!==this.options.animate&&a&&(n||o)&&this.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t,hasRelativeTargetChanged:r,layout:n})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||a.getDefaultTransition()||$St,{onLayoutAnimationStart:i,onLayoutAnimationComplete:s}=a.getProps(),l=!this.targetLayout||!vSt(this.targetLayout,n)||r,c=!t&&r;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||c||t&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(e,c);const t={...Twt(o,"layout"),onPlay:i,onComplete:s};(a.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t)}else t||zSt(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=n})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,$bt(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(LSt),this.animationId++)}getTransformTemplate(){const{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&SSt(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){const t=this.path[e];t.shouldResetTransform=!0,t.updateScroll("snapshot"),t.options.layoutRoot&&t.willUpdate(!1)}const{layoutId:t,layout:r}=this.options;if(void 0===t&&!r)return;const n=this.getTransformTemplate();this.prevTransformTemplateValue=n?n(this.latestValues,""):void 0,this.updateSnapshot(),e&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(NSt);this.isUpdating||this.nodes.forEach(RSt),this.isUpdating=!1,this.nodes.forEach(FSt),this.nodes.forEach(OSt),this.nodes.forEach(PSt),this.clearAllSnapshots();const e=skt.now();Wbt.delta=Bxt(0,1e3/60,e-Wbt.timestamp),Wbt.timestamp=e,Wbt.isProcessing=!0,Ubt.update.process(Wbt),Ubt.preRender.process(Wbt),Ubt.render.process(Wbt),Wbt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,vxt.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(TSt),this.sharedNodes.forEach(BSt)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,qbt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){qbt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!(this.instance&&(this.updateScroll(),this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty)))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();const e=this.layout;this.layout=this.measure(!1),this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:t}=this.options;t&&t.notify("LayoutMeasure",this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e="measure"){let t=!(!this.options.layoutScroll||!this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t){const t=n(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:r(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!o)return;const e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!hSt(this.projectionDelta),r=this.getTransformTemplate(),n=r?r(this.latestValues,""):void 0,a=n!==this.prevTransformTemplateValue;e&&(t||_Mt(this.latestValues)||a)&&(o(this.instance,n),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){const t=this.measurePageBox();let r=this.removeElementScroll(t);return e&&(r=this.removeTransform(r)),function(e){GSt(e.x),GSt(e.y)}(r),{animationId:this.root.animationId,measuredBox:t,layoutBox:r,latestValues:{},source:this.id}}measurePageBox(){var e;const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const r=t.measureViewportBox();if(!(null===(e=this.scroll)||void 0===e?void 0:e.wasRoot)&&!this.path.some(YSt)){const{scroll:e}=this.root;e&&(TMt(r.x,e.offset.x),TMt(r.y,e.offset.y))}return r}removeElementScroll(e){var t;const r={x:{min:0,max:0},y:{min:0,max:0}};if(aSt(r,e),null!==(t=this.scroll)&&void 0!==t&&t.wasRoot)return r;for(let t=0;t<this.path.length;t++){const n=this.path[t],{scroll:o,options:a}=n;n!==this.root&&o&&a.layoutScroll&&(o.wasRoot&&aSt(r,e),TMt(r.x,o.offset.x),TMt(r.y,o.offset.y))}return r}applyTransform(e,t=!1){const r={x:{min:0,max:0},y:{min:0,max:0}};aSt(r,e);for(let e=0;e<this.path.length;e++){const n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&RMt(r,{x:-n.scroll.offset.x,y:-n.scroll.offset.y}),_Mt(n.latestValues)&&RMt(r,n.latestValues)}return _Mt(this.latestValues)&&RMt(r,this.latestValues),r}removeTransform(e){const t={x:{min:0,max:0},y:{min:0,max:0}};aSt(t,e);for(let e=0;e<this.path.length;e++){const r=this.path[e];if(!r.instance||!_Mt(r.latestValues))continue;kMt(r.latestValues)&&r.updateSnapshot();const n=gMt();aSt(n,r.measurePageBox()),dSt(t,r.latestValues,r.snapshot?r.snapshot.layoutBox:void 0,n)}return _Mt(this.latestValues)&&dSt(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:void 0===e.crossfade||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Wbt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){var t;const r=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=r.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=r.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=r.isSharedProjectionDirty);const n=!!this.resumingFrom||this!==r;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||null!==(t=this.parent)&&void 0!==t&&t.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:o,layoutId:a}=this.options;if(this.layout&&(o||a)){if(this.resolvedRelativeTargetAt=Wbt.timestamp,!this.targetDelta&&!this.relativeTarget){const e=this.getClosestProjectingParent();e&&e.layout&&1!==this.animationProgress?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},pMt(this.relativeTargetOrigin,this.layout.layoutBox,e.layout.layoutBox),aSt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(this.relativeTarget||this.targetDelta){if(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),function(e,t,r){uMt(e.x,t.x,r.x),uMt(e.y,t.y,r.y)}(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):aSt(this.target,this.layout.layoutBox),PMt(this.target,this.targetDelta)):aSt(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const e=this.getClosestProjectingParent();e&&!!e.resumingFrom==!!this.resumingFrom&&!e.options.layoutScroll&&e.target&&1!==this.animationProgress?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},pMt(this.relativeTargetOrigin,this.target,e.target),aSt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}wSt&&xSt.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(this.parent&&!kMt(this.parent.latestValues)&&!CMt(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!(!(this.relativeTarget||this.targetDelta||this.options.layoutRoot)||!this.layout)}calcProjection(){var e;const t=this.getLead(),r=!!this.resumingFrom||this!==t;let n=!0;if((this.isProjectionDirty||!(null===(e=this.parent)||void 0===e)&&e.isProjectionDirty)&&(n=!1),r&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===Wbt.timestamp&&(n=!1),n)return;const{layout:o,layoutId:a}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!o&&!a)return;aSt(this.layoutCorrected,this.layout.layoutBox);const i=this.treeScale.x,s=this.treeScale.y;(function(e,t,r,n=!1){const o=r.length;if(!o)return;let a,i;t.x=t.y=1;for(let s=0;s<o;s++){a=r[s],i=a.projectionDelta;const{visualElement:o}=a.options;o&&o.props.style&&"contents"===o.props.style.display||(n&&a.options.layoutScroll&&a.scroll&&a!==a.root&&RMt(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),i&&(t.x*=i.x.scale,t.y*=i.y.scale,PMt(e,i)),n&&_Mt(a.latestValues)&&RMt(e,a.latestValues))}t.x<jMt&&t.x>EMt&&(t.x=1),t.y<jMt&&t.y>EMt&&(t.y=1)})(this.layoutCorrected,this.treeScale,this.path,r),t.layout&&!t.target&&(1!==this.treeScale.x||1!==this.treeScale.y)&&(t.target=t.layout.layoutBox,t.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:l}=t;l?(this.projectionDelta&&this.prevProjectionDelta?(iSt(this.prevProjectionDelta.x,this.projectionDelta.x),iSt(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),cMt(this.projectionDelta,this.layoutCorrected,l,this.latestValues),(this.treeScale.x!==i||this.treeScale.y!==s||!gSt(this.projectionDelta.x,this.prevProjectionDelta.x)||!gSt(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),wSt&&xSt.recalculatedProjection++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){var t;if(null===(t=this.options.visualElement)||void 0===t||t.scheduleRender(),e){const e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(e,t=!1){const r=this.snapshot,n=r?r.latestValues:{},o={...this.latestValues},a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;const i={x:{min:0,max:0},y:{min:0,max:0}},s=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),c=!l||l.members.length<=1,u=!(!s||c||!0!==this.options.crossfade||this.path.some(qSt));let d;this.animationProgress=0,this.mixTargetDelta=t=>{const r=t/1e3;VSt(a.x,e.x,r),VSt(a.y,e.y,r),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(pMt(i,this.layout.layoutBox,this.relativeParent.layout.layoutBox),function(e,t,r,n){HSt(e.x,t.x,r.x,n),HSt(e.y,t.y,r.y,n)}(this.relativeTarget,this.relativeTargetOrigin,i,r),d&&function(e,t){return fSt(e.x,t.x)&&fSt(e.y,t.y)}(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),aSt(d,this.relativeTarget)),s&&(this.animationValues=o,function(e,t,r,n,o,a){o?(e.opacity=S_t(0,void 0!==r.opacity?r.opacity:1,tSt(n)),e.opacityExit=S_t(void 0!==t.opacity?t.opacity:1,0,rSt(n))):a&&(e.opacity=S_t(void 0!==t.opacity?t.opacity:1,void 0!==r.opacity?r.opacity:1,n));for(let o=0;o<ZMt;o++){const a=`border${XMt[o]}Radius`;let i=eSt(t,a),s=eSt(r,a);void 0===i&&void 0===s||(i||(i=0),s||(s=0),0===i||0===s||JMt(i)===JMt(s)?(e[a]=Math.max(S_t(QMt(i),QMt(s),n),0),(Uxt.test(s)||Uxt.test(i))&&(e[a]+="%")):e[a]=s)}(t.rotate||r.rotate)&&(e.rotate=S_t(t.rotate||0,r.rotate||0,n))}(o,n,this.latestValues,r,u,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=r},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&($bt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=qbt.update(()=>{VMt.hasAnimatedSinceResize=!0,this.currentAnimation=function(e,t,r){const n=Oxt(e)?e:hkt(e);return n.start(NCt("",n,t,r)),n.animation}(0,1e3,{...e,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const e=this.getLead();let{targetWithTransforms:t,target:r,layout:n,latestValues:o}=e;if(t&&r&&n){if(this!==e&&this.layout&&n&&KSt(this.options.animationType,this.layout.layoutBox,n.layoutBox)){r=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const t=sMt(this.layout.layoutBox.x);r.x.min=e.target.x.min,r.x.max=r.x.min+t;const n=sMt(this.layout.layoutBox.y);r.y.min=e.target.y.min,r.y.max=r.y.min+n}aSt(t,r),RMt(t,o),cMt(this.projectionDeltaWithTransform,this.layoutCorrected,t,o)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new bSt),this.sharedNodes.get(e).add(t);const r=t.options.initialPromotionConfig;t.promote({transition:r?r.transition:void 0,preserveFollowOpacity:r&&r.shouldPreserveFollowOpacity?r.shouldPreserveFollowOpacity(t):void 0})}isLead(){const e=this.getStack();return!e||e.lead===this}getLead(){var e;const{layoutId:t}=this.options;return t&&(null===(e=this.getStack())||void 0===e?void 0:e.lead)||this}getPrevLead(){var e;const{layoutId:t}=this.options;return t?null===(e=this.getStack())||void 0===e?void 0:e.prevLead:void 0}getStack(){const{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:r}={}){const n=this.getStack();n&&n.promote(this,r),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){const e=this.getStack();return!!e&&e.relegate(this)}resetSkewAndRotation(){const{visualElement:e}=this.options;if(!e)return;let t=!1;const{latestValues:r}=e;if((r.z||r.rotate||r.rotateX||r.rotateY||r.rotateZ||r.skewX||r.skewY)&&(t=!0),!t)return;const n={};r.z&&MSt("z",e,n,this.animationValues);for(let t=0;t<kSt.length;t++)MSt(`rotate${kSt[t]}`,e,n,this.animationValues),MSt(`skew${kSt[t]}`,e,n,this.animationValues);e.render();for(const t in n)e.setStaticValue(t,n[t]),this.animationValues&&(this.animationValues[t]=n[t]);e.scheduleRender()}getProjectionStyles(e){var t,r;if(!this.instance||this.isSVG)return;if(!this.isVisible)return _St;const n={visibility:""},o=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,n.opacity="",n.pointerEvents=Pxt(null==e?void 0:e.pointerEvents)||"",n.transform=o?o(this.latestValues,""):"none",n;const a=this.getLead();if(!this.projectionDelta||!this.layout||!a.target){const t={};return this.options.layoutId&&(t.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,t.pointerEvents=Pxt(null==e?void 0:e.pointerEvents)||""),this.hasProjected&&!_Mt(this.latestValues)&&(t.transform=o?o({},""):"none",this.hasProjected=!1),t}const i=a.animationValues||a.latestValues;this.applyTransformsToTarget(),n.transform=function(e,t,r){let n="";const o=e.x.translate/t.x,a=e.y.translate/t.y,i=(null==r?void 0:r.z)||0;if((o||a||i)&&(n=`translate3d(${o}px, ${a}px, ${i}px) `),(1!==t.x||1!==t.y)&&(n+=`scale(${1/t.x}, ${1/t.y}) `),r){const{transformPerspective:e,rotate:t,rotateX:o,rotateY:a,skewX:i,skewY:s}=r;e&&(n=`perspective(${e}px) ${n}`),t&&(n+=`rotate(${t}deg) `),o&&(n+=`rotateX(${o}deg) `),a&&(n+=`rotateY(${a}deg) `),i&&(n+=`skewX(${i}deg) `),s&&(n+=`skewY(${s}deg) `)}const s=e.x.scale*t.x,l=e.y.scale*t.y;return(1!==s||1!==l)&&(n+=`scale(${s}, ${l})`),n||"none"}(this.projectionDeltaWithTransform,this.treeScale,i),o&&(n.transform=o(i,n.transform));const{x:s,y:l}=this.projectionDelta;n.transformOrigin=`${100*s.origin}% ${100*l.origin}% 0`,a.animationValues?n.opacity=a===this?null!==(r=null!==(t=i.opacity)&&void 0!==t?t:this.latestValues.opacity)&&void 0!==r?r:1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:n.opacity=a===this?void 0!==i.opacity?i.opacity:"":void 0!==i.opacityExit?i.opacityExit:0;for(const e in fwt){if(void 0===i[e])continue;const{correct:t,applyTo:r}=fwt[e],o="none"===n.transform?i[e]:t(i[e],a);if(r){const e=r.length;for(let t=0;t<e;t++)n[r[t]]=o}else n[e]=o}return this.options.layoutId&&(n.pointerEvents=a===this?Pxt(null==e?void 0:e.pointerEvents)||"":"none"),n}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>{var t;return null===(t=e.currentAnimation)||void 0===t?void 0:t.stop()}),this.root.nodes.forEach(NSt),this.root.sharedNodes.clear()}}}function OSt(e){e.updateLayout()}function PSt(e){var t;const r=(null===(t=e.resumeFrom)||void 0===t?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&r&&e.hasListeners("didUpdate")){const{layoutBox:t,measuredBox:n}=e.layout,{animationType:o}=e.options,a=r.source!==e.layout.source;"size"===o?bMt(e=>{const n=a?r.measuredBox[e]:r.layoutBox[e],o=sMt(n);n.min=t[e].min,n.max=n.min+o}):KSt(o,r.layoutBox,t)&&bMt(n=>{const o=a?r.measuredBox[n]:r.layoutBox[n],i=sMt(t[n]);o.max=o.min+i,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[n].max=e.relativeTarget[n].min+i)});const i={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};cMt(i,t,r.layoutBox);const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};a?cMt(s,e.applyTransform(n,!0),r.measuredBox):cMt(s,t,r.layoutBox);const l=!hSt(i);let c=!1;if(!e.resumeFrom){const n=e.getClosestProjectingParent();if(n&&!n.resumeFrom){const{snapshot:o,layout:a}=n;if(o&&a){const i={x:{min:0,max:0},y:{min:0,max:0}};pMt(i,r.layoutBox,o.layoutBox);const s={x:{min:0,max:0},y:{min:0,max:0}};pMt(s,t,a.layoutBox),vSt(i,s)||(c=!0),n.options.layoutRoot&&(e.relativeTarget=s,e.relativeTargetOrigin=i,e.relativeParent=n)}}}e.notifyListeners("didUpdate",{layout:t,snapshot:r,delta:s,layoutDelta:i,hasLayoutChanged:l,hasRelativeTargetChanged:c})}else if(e.isLead()){const{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function ESt(e){wSt&&xSt.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function jSt(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function TSt(e){e.clearSnapshot()}function NSt(e){e.clearMeasurements()}function RSt(e){e.isLayoutDirty=!1}function FSt(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function zSt(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function ISt(e){e.resolveTargetDelta()}function ASt(e){e.calcProjection()}function LSt(e){e.resetSkewAndRotation()}function BSt(e){e.removeLeadSnapshot()}function VSt(e,t,r){e.translate=S_t(t.translate,0,r),e.scale=S_t(t.scale,1,r),e.origin=t.origin,e.originPoint=t.originPoint}function HSt(e,t,r,n){e.min=S_t(t.min,r.min,n),e.max=S_t(t.max,r.max,n)}function qSt(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}const $St={duration:.45,ease:[.4,0,.1,1]},WSt=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),USt=WSt("applewebkit/")&&!WSt("chrome/")?Math.round:Nbt;function GSt(e){e.min=USt(e.min),e.max=USt(e.max)}function KSt(e,t,r){return"position"===e||"preserve-aspect"===e&&!function(e,t,r){return Math.abs(e-t)<=r}(ySt(t),ySt(r),.2)}function YSt(e){var t;return e!==e.root&&(null===(t=e.scroll)||void 0===t?void 0:t.wasRoot)}const XSt=DSt({attachResizeListener:(e,t)=>XCt(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ZSt={current:void 0},QSt=DSt({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!ZSt.current){const e=new XSt({});e.mount(window),e.setOptions({layoutScroll:!0}),ZSt.current=e}return ZSt.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>"fixed"===window.getComputedStyle(e).position}),JSt={pan:{Feature:class extends GCt{constructor(){super(...arguments),this.removePointerDownListener=Nbt}onPointerDown(e){this.session=new eMt(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:zMt(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:r,onPanEnd:n}=this.node.getProps();return{onSessionStart:BMt(e),onStart:BMt(t),onMove:r,onEnd:(e,t)=>{delete this.session,n&&qbt.postRender(()=>n(e,t))}}}mount(){this.removePointerDownListener=QCt(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends GCt{constructor(e){super(e),this.removeGroupControls=Nbt,this.removeListeners=Nbt,this.controls=new AMt(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Nbt}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:QSt,MeasureLayout:UMt}};function eDt(e,t,r){const{props:n}=e;e.animationState&&n.whileHover&&e.animationState.setActive("whileHover","Start"===r);const o=n["onHover"+r];o&&qbt.postRender(()=>o(t,ZCt(t)))}function tDt(e,t,r){const{props:n}=e;e.animationState&&n.whileTap&&e.animationState.setActive("whileTap","Start"===r);const o=n["onTap"+("End"===r?"":r)];o&&qbt.postRender(()=>o(t,ZCt(t)))}const rDt=new WeakMap,nDt=new WeakMap,oDt=e=>{const t=rDt.get(e.target);t&&t(e)},aDt=e=>{e.forEach(oDt)};function iDt(e,t,r){const n=function({root:e,...t}){const r=e||document;nDt.has(r)||nDt.set(r,{});const n=nDt.get(r),o=JSON.stringify(t);return n[o]||(n[o]=new IntersectionObserver(aDt,{root:e,...t})),n[o]}(t);return rDt.set(e,r),n.observe(e),()=>{rDt.delete(e),n.unobserve(e)}}const sDt={some:0,all:1};const lDt={inView:{Feature:class extends GCt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:t,margin:r,amount:n="some",once:o}=e,a={root:t?t.current:void 0,rootMargin:r,threshold:"number"==typeof n?n:sDt[n]};return iDt(this.node.current,a,e=>{const{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,o&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);const{onViewportEnter:r,onViewportLeave:n}=this.node.getProps(),a=t?r:n;a&&a(e)})}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}(e,t))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends GCt{mount(){const{current:e}=this.node;e&&(this.unmount=nkt(e,e=>(tDt(this.node,e,"Start"),(e,{success:t})=>tDt(this.node,e,t?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends GCt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=R_t(XCt(this.node.current,"focus",()=>this.onFocus()),XCt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends GCt{mount(){const{current:e}=this.node;e&&(this.unmount=function(e,t,r={}){const[n,o,a]=Kwt(e,r),i=Ywt(e=>{const{target:r}=e,n=t(e);if("function"!=typeof n||!r)return;const a=Ywt(e=>{n(e),r.removeEventListener("pointerleave",a)});r.addEventListener("pointerleave",a,o)});return n.forEach(e=>{e.addEventListener("pointerenter",i,o)}),a}(e,e=>(eDt(this.node,e,"Start"),e=>eDt(this.node,e,"End"))))}unmount(){}}}},cDt={layout:{ProjectionNode:QSt,MeasureLayout:UMt}},uDt={current:null},dDt={current:!1};const pDt=[...b_t,Lkt,Kkt],hDt=new WeakMap;const fDt=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class mDt{scrapeMotionValuesFromProps(e,t,r){return{}}constructor({parent:e,props:t,presenceContext:r,reducedMotionConfig:n,blockInitialAnimation:o,visualState:a},i={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=f_t,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const e=skt.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,qbt.render(this.render,!1,!0))};const{latestValues:s,renderState:l,onUpdate:c}=a;this.onUpdate=c,this.latestValues=s,this.baseTarget={...s},this.initialValues=t.initial?{...s}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=n,this.options=i,this.blockInitialAnimation=!!o,this.isControllingVariants=sxt(t),this.isVariantNode=lxt(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!(!e||!e.current);const{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(const e in d){const t=d[e];void 0!==s[e]&&Oxt(t)&&t.set(s[e],!1)}}mount(e){this.current=e,hDt.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),dDt.current||function(){if(dDt.current=!0,Ebt)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>uDt.current=e.matches;e.addListener(t),t()}else uDt.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||uDt.current),"production"!==process.env.NODE_ENV&&ext(!0!==this.shouldReduceMotion,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){hDt.delete(this.current),this.projection&&this.projection.unmount(),$bt(this.notifyUpdate),$bt(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}bindToMotionValue(e,t){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const r=Nxt.has(e),n=t.on("change",t=>{this.latestValues[e]=t,this.props.onUpdate&&qbt.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),o=t.on("renderRequest",this.scheduleRender);let a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{n(),o(),a&&a(),t.owner&&t.stop()})}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}updateFeatures(){let e="animation";for(e in Ybt){const t=Ybt[e];if(!t)continue;const{isEnabled:r,Feature:n}=t;if(!this.features[e]&&n&&r(this.props)&&(this.features[e]=new n(this)),this.features[e]){const t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<fDt.length;t++){const r=fDt[t];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const n=e["on"+r];n&&(this.propEventSubscriptions[r]=this.on(r,n))}this.prevMotionValues=function(e,t,r){for(const n in t){const o=t[n],a=r[n];if(Oxt(o))e.addValue(n,o),"development"===process.env.NODE_ENV&&ext("11.18.2"===o.version,`Attempting to mix Motion versions ${o.version} with 11.18.2 may not work as expected.`);else if(Oxt(a))e.addValue(n,hkt(o,{owner:e}));else if(a!==o)if(e.hasValue(n)){const t=e.getValue(n);!0===t.liveStyle?t.jump(o):t.hasAnimated||t.set(o)}else{const t=e.getStaticValue(n);e.addValue(n,hkt(void 0!==t?t:o,{owner:e}))}}for(const n in r)void 0===t[n]&&e.removeValue(n);return t}(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){const r=this.values.get(e);t!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return void 0===r&&void 0!==t&&(r=hkt(null===t?void 0:t,{owner:this}),this.addValue(e,r)),r}readValue(e,t){var r;let n=void 0===this.latestValues[e]&&this.current?null!==(r=this.getBaseTargetFromProps(this.props,e))&&void 0!==r?r:this.readValueFromInstance(this.current,e,this.options):this.latestValues[e];return null!=n&&("string"==typeof n&&(m_t(n)||Okt(n))?n=parseFloat(n):!(e=>pDt.find(g_t(e)))(n)&&Kkt.test(t)&&(n=t_t(e,t)),this.setBaseTarget(e,Oxt(n)?n.get():n)),Oxt(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;const{initial:r}=this.props;let n;if("string"==typeof r||"object"==typeof r){const o=Mxt(this.props,r,null===(t=this.presenceContext)||void 0===t?void 0:t.custom);o&&(n=o[e])}if(r&&void 0!==n)return n;const o=this.getBaseTargetFromProps(this.props,e);return void 0===o||Oxt(o)?void 0!==this.initialValues[e]&&void 0===n?void 0:this.baseTarget[e]:o}on(e,t){return this.events[e]||(this.events[e]=new ukt),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class vDt extends mDt{constructor(){super(...arguments),this.KeyframeResolver=w_t}sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:r}){delete t[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Oxt(e)&&(this.childSubscription=e.on("change",e=>{this.current&&(this.current.textContent=`${e}`)}))}}class yDt extends vDt{constructor(){super(...arguments),this.type="html",this.renderInstance=dwt}readValueFromInstance(e,t){if(Nxt.has(t)){const e=e_t(t);return e&&e.default||0}{const r=function(e){return window.getComputedStyle(e)}(e),n=(Fxt(t)?r.getPropertyValue(t):r[t])||0;return"string"==typeof n?n.trim():n}}measureInstanceViewportBox(e,{transformPagePoint:t}){return FMt(e,t)}build(e,t,r){nwt(e,t,r.transformTemplate)}scrapeMotionValuesFromProps(e,t,r){return vwt(e,t,r)}}class gDt extends vDt{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=gMt}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Nxt.has(t)){const e=e_t(t);return e&&e.default||0}return t=pwt.has(t)?t:fxt(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,r){return ywt(e,t,r)}build(e,t,r){swt(e,t,this.isSVGTag,r.transformTemplate)}renderInstance(e,t,r,n){hwt(e,t,0,n)}mount(e){this.isSVGTag=uwt(e.tagName),super.mount(e)}}const bDt=(t,r)=>_xt(t)?new gDt(r):new yDt(r,{allowProjection:t!==e.Fragment}),xDt=txt(Swt({...YCt,...lDt,...JSt,...cDt},bDt));var wDt=Array(12).fill(0),kDt=({visible:e,className:t})=>l.default.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},l.default.createElement("div",{className:"sonner-spinner"},wDt.map((e,t)=>l.default.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${t}`})))),_Dt=l.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},l.default.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),CDt=l.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},l.default.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),MDt=l.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},l.default.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),SDt=l.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},l.default.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),DDt=l.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},l.default.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),l.default.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),ODt=1,PDt=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:r,...n}=e,o="number"==typeof(null==e?void 0:e.id)||(null==(t=e.id)?void 0:t.length)>0?e.id:ODt++,a=this.toasts.find(e=>e.id===o),i=void 0===e.dismissible||e.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),a?this.toasts=this.toasts.map(t=>t.id===o?(this.publish({...t,...e,id:o,title:r}),{...t,...e,id:o,dismissible:i,title:r}):t):this.addToast({title:r,...n,dismissible:i,id:o}),o},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let r;void 0!==t.loading&&(r=this.create({...t,promise:e,type:"loading",message:t.loading,description:"function"!=typeof t.description?t.description:void 0}));let n,o=e instanceof Promise?e:e(),a=void 0!==r,i=o.then(async e=>{if(n=["resolve",e],l.default.isValidElement(e))a=!1,this.create({id:r,type:"default",message:e});else if(EDt(e)&&!e.ok){a=!1;let n="function"==typeof t.error?await t.error(`HTTP error! status: ${e.status}`):t.error,o="function"==typeof t.description?await t.description(`HTTP error! status: ${e.status}`):t.description;this.create({id:r,type:"error",message:n,description:o})}else if(void 0!==t.success){a=!1;let n="function"==typeof t.success?await t.success(e):t.success,o="function"==typeof t.description?await t.description(e):t.description;this.create({id:r,type:"success",message:n,description:o})}}).catch(async e=>{if(n=["reject",e],void 0!==t.error){a=!1;let n="function"==typeof t.error?await t.error(e):t.error,o="function"==typeof t.description?await t.description(e):t.description;this.create({id:r,type:"error",message:n,description:o})}}).finally(()=>{var e;a&&(this.dismiss(r),r=void 0),null==(e=t.finally)||e.call(t)}),s=()=>new Promise((e,t)=>i.then(()=>"reject"===n[0]?t(n[1]):e(n[1])).catch(t));return"string"!=typeof r&&"number"!=typeof r?{unwrap:s}:Object.assign(r,{unwrap:s})},this.custom=(e,t)=>{let r=(null==t?void 0:t.id)||ODt++;return this.create({jsx:e(r),id:r,...t}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},EDt=e=>e&&"object"==typeof e&&"ok"in e&&"boolean"==typeof e.ok&&"status"in e&&"number"==typeof e.status,jDt=(e,t)=>{let r=(null==t?void 0:t.id)||ODt++;return PDt.addToast({title:e,...t,id:r}),r},TDt=Object.assign(jDt,{success:PDt.success,info:PDt.info,warning:PDt.warning,error:PDt.error,custom:PDt.custom,message:PDt.message,promise:PDt.promise,dismiss:PDt.dismiss,loading:PDt.loading},{getHistory:()=>PDt.toasts,getToasts:()=>PDt.getActiveToasts()});function NDt(e){return void 0!==e.label}!function(e,{insertAt:t}={}){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===t&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}(':where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}\n');var RDt=3,FDt=14;function zDt(...e){return e.filter(Boolean).join(" ")}var IDt=t=>{var r,n,o,a,i,s,c,u,d,p,h;let{invert:f,toast:m,unstyled:v,interacting:y,setHeights:g,visibleToasts:b,heights:x,index:w,toasts:k,expanded:_,removeToast:C,defaultRichColors:M,closeButton:S,style:D,cancelButtonStyle:O,actionButtonStyle:P,className:E="",descriptionClassName:j="",duration:T,position:N,gap:R,loadingIcon:F,expandByDefault:z,classNames:I,icons:A,closeButtonAriaLabel:L="Close toast",pauseWhenPageIsHidden:B}=t,[V,H]=l.default.useState(null),[q,$]=l.default.useState(null),[W,U]=l.default.useState(!1),[G,K]=l.default.useState(!1),[Y,X]=l.default.useState(!1),[Z,Q]=l.default.useState(!1),[J,ee]=l.default.useState(!1),[te,re]=l.default.useState(0),[ne,oe]=l.default.useState(0),ae=l.default.useRef(m.duration||T||4e3),ie=l.default.useRef(null),se=l.default.useRef(null),le=0===w,ce=w+1<=b,ue=m.type,de=!1!==m.dismissible,pe=m.className||"",he=m.descriptionClassName||"",fe=l.default.useMemo(()=>x.findIndex(e=>e.toastId===m.id)||0,[x,m.id]),me=l.default.useMemo(()=>{var e;return null!=(e=m.closeButton)?e:S},[m.closeButton,S]),ve=l.default.useMemo(()=>m.duration||T||4e3,[m.duration,T]),ye=l.default.useRef(0),ge=l.default.useRef(0),be=l.default.useRef(0),xe=l.default.useRef(null),[we,ke]=N.split("-"),_e=l.default.useMemo(()=>x.reduce((e,t,r)=>r>=fe?e:e+t.height,0),[x,fe]),Ce=(()=>{let[e,t]=l.default.useState(document.hidden);return l.default.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",e),()=>window.removeEventListener("visibilitychange",e)},[]),e})(),Me=m.invert||f,Se="loading"===ue;ge.current=l.default.useMemo(()=>fe*R+_e,[fe,_e]),l.default.useEffect(()=>{ae.current=ve},[ve]),l.default.useEffect(()=>{U(!0)},[]),l.default.useEffect(()=>{let e=se.current;if(e){let t=e.getBoundingClientRect().height;return oe(t),g(e=>[{toastId:m.id,height:t,position:m.position},...e]),()=>g(e=>e.filter(e=>e.toastId!==m.id))}},[g,m.id]),l.default.useLayoutEffect(()=>{if(!W)return;let e=se.current,t=e.style.height;e.style.height="auto";let r=e.getBoundingClientRect().height;e.style.height=t,oe(r),g(e=>e.find(e=>e.toastId===m.id)?e.map(e=>e.toastId===m.id?{...e,height:r}:e):[{toastId:m.id,height:r,position:m.position},...e])},[W,m.title,m.description,g,m.id]);let De=l.default.useCallback(()=>{K(!0),re(ge.current),g(e=>e.filter(e=>e.toastId!==m.id)),setTimeout(()=>{C(m)},200)},[m,C,g,ge]);return l.default.useEffect(()=>{if(m.promise&&"loading"===ue||m.duration===1/0||"loading"===m.type)return;let e;return _||y||B&&Ce?(()=>{if(be.current<ye.current){let e=(new Date).getTime()-ye.current;ae.current=ae.current-e}be.current=(new Date).getTime()})():ae.current!==1/0&&(ye.current=(new Date).getTime(),e=setTimeout(()=>{var e;null==(e=m.onAutoClose)||e.call(m,m),De()},ae.current)),()=>clearTimeout(e)},[_,y,m,ue,B,Ce,De]),l.default.useEffect(()=>{m.delete&&De()},[De,m.delete]),l.default.createElement("li",{tabIndex:0,ref:se,className:zDt(E,pe,null==I?void 0:I.toast,null==(r=null==m?void 0:m.classNames)?void 0:r.toast,null==I?void 0:I.default,null==I?void 0:I[ue],null==(n=null==m?void 0:m.classNames)?void 0:n[ue]),"data-sonner-toast":"","data-rich-colors":null!=(o=m.richColors)?o:M,"data-styled":!(m.jsx||m.unstyled||v),"data-mounted":W,"data-promise":!!m.promise,"data-swiped":J,"data-removed":G,"data-visible":ce,"data-y-position":we,"data-x-position":ke,"data-index":w,"data-front":le,"data-swiping":Y,"data-dismissible":de,"data-type":ue,"data-invert":Me,"data-swipe-out":Z,"data-swipe-direction":q,"data-expanded":!!(_||z&&W),style:{"--index":w,"--toasts-before":w,"--z-index":k.length-w,"--offset":`${G?te:ge.current}px`,"--initial-height":z?"auto":`${ne}px`,...D,...m.style},onDragEnd:()=>{X(!1),H(null),xe.current=null},onPointerDown:e=>{Se||!de||(ie.current=new Date,re(ge.current),e.target.setPointerCapture(e.pointerId),"BUTTON"!==e.target.tagName&&(X(!0),xe.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{var e,t,r,n;if(Z||!de)return;xe.current=null;let o=Number((null==(e=se.current)?void 0:e.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),a=Number((null==(t=se.current)?void 0:t.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),i=(new Date).getTime()-(null==(r=ie.current)?void 0:r.getTime()),s="x"===V?o:a,l=Math.abs(s)/i;if(Math.abs(s)>=20||l>.11)return re(ge.current),null==(n=m.onDismiss)||n.call(m,m),$("x"===V?o>0?"right":"left":a>0?"down":"up"),De(),Q(!0),void ee(!1);X(!1),H(null)},onPointerMove:e=>{var r,n,o,a;if(!xe.current||!de||(null==(r=window.getSelection())?void 0:r.toString().length)>0)return;let i=e.clientY-xe.current.y,s=e.clientX-xe.current.x,l=null!=(n=t.swipeDirections)?n:function(e){let[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}(N);!V&&(Math.abs(s)>1||Math.abs(i)>1)&&H(Math.abs(s)>Math.abs(i)?"x":"y");let c={x:0,y:0};"y"===V?(l.includes("top")||l.includes("bottom"))&&(l.includes("top")&&i<0||l.includes("bottom")&&i>0)&&(c.y=i):"x"===V&&(l.includes("left")||l.includes("right"))&&(l.includes("left")&&s<0||l.includes("right")&&s>0)&&(c.x=s),(Math.abs(c.x)>0||Math.abs(c.y)>0)&&ee(!0),null==(o=se.current)||o.style.setProperty("--swipe-amount-x",`${c.x}px`),null==(a=se.current)||a.style.setProperty("--swipe-amount-y",`${c.y}px`)}},me&&!m.jsx?l.default.createElement("button",{"aria-label":L,"data-disabled":Se,"data-close-button":!0,onClick:Se||!de?()=>{}:()=>{var e;De(),null==(e=m.onDismiss)||e.call(m,m)},className:zDt(null==I?void 0:I.closeButton,null==(a=null==m?void 0:m.classNames)?void 0:a.closeButton)},null!=(i=null==A?void 0:A.close)?i:DDt):null,m.jsx||e.isValidElement(m.title)?m.jsx?m.jsx:"function"==typeof m.title?m.title():m.title:l.default.createElement(l.default.Fragment,null,ue||m.icon||m.promise?l.default.createElement("div",{"data-icon":"",className:zDt(null==I?void 0:I.icon,null==(s=null==m?void 0:m.classNames)?void 0:s.icon)},m.promise||"loading"===m.type&&!m.icon?m.icon||(null!=A&&A.loading?l.default.createElement("div",{className:zDt(null==I?void 0:I.loader,null==(Oe=null==m?void 0:m.classNames)?void 0:Oe.loader,"sonner-loader"),"data-visible":"loading"===ue},A.loading):F?l.default.createElement("div",{className:zDt(null==I?void 0:I.loader,null==(Pe=null==m?void 0:m.classNames)?void 0:Pe.loader,"sonner-loader"),"data-visible":"loading"===ue},F):l.default.createElement(kDt,{className:zDt(null==I?void 0:I.loader,null==(Ee=null==m?void 0:m.classNames)?void 0:Ee.loader),visible:"loading"===ue})):null,"loading"!==m.type?m.icon||(null==A?void 0:A[ue])||(e=>{switch(e){case"success":return _Dt;case"info":return MDt;case"warning":return CDt;case"error":return SDt;default:return null}})(ue):null):null,l.default.createElement("div",{"data-content":"",className:zDt(null==I?void 0:I.content,null==(c=null==m?void 0:m.classNames)?void 0:c.content)},l.default.createElement("div",{"data-title":"",className:zDt(null==I?void 0:I.title,null==(u=null==m?void 0:m.classNames)?void 0:u.title)},"function"==typeof m.title?m.title():m.title),m.description?l.default.createElement("div",{"data-description":"",className:zDt(j,he,null==I?void 0:I.description,null==(d=null==m?void 0:m.classNames)?void 0:d.description)},"function"==typeof m.description?m.description():m.description):null),e.isValidElement(m.cancel)?m.cancel:m.cancel&&NDt(m.cancel)?l.default.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||O,onClick:e=>{var t,r;NDt(m.cancel)&&de&&(null==(r=(t=m.cancel).onClick)||r.call(t,e),De())},className:zDt(null==I?void 0:I.cancelButton,null==(p=null==m?void 0:m.classNames)?void 0:p.cancelButton)},m.cancel.label):null,e.isValidElement(m.action)?m.action:m.action&&NDt(m.action)?l.default.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||P,onClick:e=>{var t,r;NDt(m.action)&&(null==(r=(t=m.action).onClick)||r.call(t,e),!e.defaultPrevented&&De())},className:zDt(null==I?void 0:I.actionButton,null==(h=null==m?void 0:m.classNames)?void 0:h.actionButton)},m.action.label):null));var Oe,Pe,Ee};function ADt(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return"auto"!==e&&e?e:window.getComputedStyle(document.documentElement).direction}function LDt(e,t){let r={};return[e,t].forEach((e,t)=>{let n=1===t,o=n?"--mobile-offset":"--offset",a=n?"16px":"32px";function i(e){["top","right","bottom","left"].forEach(t=>{r[`${o}-${t}`]="number"==typeof e?`${e}px`:e})}"number"==typeof e||"string"==typeof e?i(e):"object"==typeof e?["top","right","bottom","left"].forEach(t=>{void 0===e[t]?r[`${o}-${t}`]=a:r[`${o}-${t}`]="number"==typeof e[t]?`${e[t]}px`:e[t]}):i(a)}),r}e.forwardRef(function(e,t){let{invert:r,position:n="bottom-right",hotkey:o=["altKey","KeyT"],expand:a,closeButton:i,className:s,offset:c,mobileOffset:d,theme:p="light",richColors:h,duration:f,style:m,visibleToasts:v=RDt,toastOptions:y,dir:g=ADt(),gap:b=FDt,loadingIcon:x,icons:w,containerAriaLabel:k="Notifications",pauseWhenPageIsHidden:_}=e,[C,M]=l.default.useState([]),S=l.default.useMemo(()=>Array.from(new Set([n].concat(C.filter(e=>e.position).map(e=>e.position)))),[C,n]),[D,O]=l.default.useState([]),[P,E]=l.default.useState(!1),[j,T]=l.default.useState(!1),[N,R]=l.default.useState("system"!==p?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),F=l.default.useRef(null),z=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),I=l.default.useRef(null),A=l.default.useRef(!1),L=l.default.useCallback(e=>{M(t=>{var r;return null!=(r=t.find(t=>t.id===e.id))&&r.delete||PDt.dismiss(e.id),t.filter(({id:t})=>t!==e.id)})},[]);return l.default.useEffect(()=>PDt.subscribe(e=>{e.dismiss?M(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t)):setTimeout(()=>{u.default.flushSync(()=>{M(t=>{let r=t.findIndex(t=>t.id===e.id);return-1!==r?[...t.slice(0,r),{...t[r],...e},...t.slice(r+1)]:[e,...t]})})})}),[]),l.default.useEffect(()=>{if("system"!==p)return void R(p);if("system"===p&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?R("dark"):R("light")),typeof window>"u")return;let e=window.matchMedia("(prefers-color-scheme: dark)");try{e.addEventListener("change",({matches:e})=>{R(e?"dark":"light")})}catch{e.addListener(({matches:e})=>{try{R(e?"dark":"light")}catch(e){console.error(e)}})}},[p]),l.default.useEffect(()=>{C.length<=1&&E(!1)},[C]),l.default.useEffect(()=>{let e=e=>{var t,r;o.every(t=>e[t]||e.code===t)&&(E(!0),null==(t=F.current)||t.focus()),"Escape"===e.code&&(document.activeElement===F.current||null!=(r=F.current)&&r.contains(document.activeElement))&&E(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[o]),l.default.useEffect(()=>{if(F.current)return()=>{I.current&&(I.current.focus({preventScroll:!0}),I.current=null,A.current=!1)}},[F.current]),l.default.createElement("section",{ref:t,"aria-label":`${k} ${z}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},S.map((t,n)=>{var o;let[u,p]=t.split("-");return C.length?l.default.createElement("ol",{key:t,dir:"auto"===g?ADt():g,tabIndex:-1,ref:F,className:s,"data-sonner-toaster":!0,"data-theme":N,"data-y-position":u,"data-lifted":P&&C.length>1&&!a,"data-x-position":p,style:{"--front-toast-height":`${(null==(o=D[0])?void 0:o.height)||0}px`,"--width":"356px","--gap":`${b}px`,...m,...LDt(c,d)},onBlur:e=>{A.current&&!e.currentTarget.contains(e.relatedTarget)&&(A.current=!1,I.current&&(I.current.focus({preventScroll:!0}),I.current=null))},onFocus:e=>{e.target instanceof HTMLElement&&"false"===e.target.dataset.dismissible||A.current||(A.current=!0,I.current=e.relatedTarget)},onMouseEnter:()=>E(!0),onMouseMove:()=>E(!0),onMouseLeave:()=>{j||E(!1)},onDragEnd:()=>E(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&"false"===e.target.dataset.dismissible||T(!0)},onPointerUp:()=>T(!1)},C.filter(e=>!e.position&&0===n||e.position===t).map((n,o)=>{var s,c;return l.default.createElement(IDt,{key:n.id,icons:w,index:o,toast:n,defaultRichColors:h,duration:null!=(s=null==y?void 0:y.duration)?s:f,className:null==y?void 0:y.className,descriptionClassName:null==y?void 0:y.descriptionClassName,invert:r,visibleToasts:v,closeButton:null!=(c=null==y?void 0:y.closeButton)?c:i,interacting:j,position:t,style:null==y?void 0:y.style,unstyled:null==y?void 0:y.unstyled,classNames:null==y?void 0:y.classNames,cancelButtonStyle:null==y?void 0:y.cancelButtonStyle,actionButtonStyle:null==y?void 0:y.actionButtonStyle,removeToast:L,toasts:C.filter(e=>e.position==n.position),heights:D.filter(e=>e.position==n.position),setHeights:O,expandByDefault:a,gap:b,loadingIcon:x,expanded:P,pauseWhenPageIsHidden:_,swipeDirections:e.swipeDirections})})):null}))});const BDt=({open:e,editType:r,onEditTypeChange:n,onConfirm:o,onClose:a,translations:i})=>t.jsx(apt,{open:e,children:t.jsxs(cpt,{className:"max-w-[425px]",children:[t.jsxs(upt,{children:[t.jsxs(ppt,{className:"flex items-center",children:[t.jsx(_st,{className:"mr-2 h-5 w-5 text-primary"}),i.editRecurringEventTitle]}),t.jsx(hpt,{className:"text-left",children:i.editRecurringEventDescription}),t.jsx("div",{className:"h-2"}),t.jsx("div",{className:"mt-4 space-y-4",children:t.jsx(ubt,{defaultValue:"all",value:r,onValueChange:e=>n(e),children:t.jsx("div",{className:"space-y-4",children:[{value:"single",label:i.editThisOccurrence,description:i.editThisOccurrenceDescription},{value:"future",label:i.editThisAndFuture,description:i.editThisAndFutureDescription},{value:"all",label:i.editAllOccurrences,description:i.editAllOccurrencesDescription}].map(e=>t.jsxs("div",{className:"flex space-x-4",children:[t.jsx(dbt,{value:e.value,id:`edit-${e.value}`}),t.jsxs(fmt,{htmlFor:`edit-${e.value}`,className:"flex flex-col flex-1 items-start cursor-pointer",children:[t.jsx("span",{className:"leading-none",children:e.label}),t.jsx("span",{className:"text-sm text-muted-foreground mt-1",children:e.description})]})]},e.value))})})}),t.jsx("div",{className:"h-2"})]}),t.jsxs(dpt,{children:[t.jsx(mpt,{onClick:a,children:i.cancel}),t.jsxs(fpt,{onClick:o,className:"w-full sm:w-auto",children:[t.jsx(_st,{className:"h-3 w-3 sm:h-4 sm:w-4 mr-1 sm:mr-2"}),i.save]})]})]})}),VDt=(e,t,r,n)=>{if(!n||!Yit(e,{start:t,end:r}))return!1;switch(n){case"daily":return!0;case"weekly":return qit(e)===qit(t);case"monthly":return e.getDate()===t.getDate();default:return!1}},HDt=e=>{if("string"!=typeof e||!e.includes("T"))return!1;const t=Zit(e);return!Number.isNaN(t.getTime())},qDt=e=>{if(HDt(e)){const t=Zit(e);return{hours:t.getUTCHours(),minutes:t.getUTCMinutes()}}const t=e.match(/^(\d{1,2}):(\d{2})(?::(\d{2}))?$/);if(t){return{hours:Math.min(23,Math.max(0,parseInt(t[1],10))),minutes:Math.min(59,Math.max(0,parseInt(t[2],10)))}}return{hours:0,minutes:0}},$Dt=(e,t)=>{const{hours:r,minutes:n}=qDt(t);return lst(sst(new Date(e),r),n)},WDt=e=>{const{hours:t,minutes:r}=qDt(e);return 60*t+r},UDt=(e,t)=>0===WDt(e)&&WDt(t)>=1439,GDt=e=>{const{hours:t,minutes:r}=qDt(e);return`${String(t).padStart(2,"0")}:${String(r).padStart(2,"0")}`};function KDt(e,[t,r]){return Math.min(r,Math.max(t,e))}var YDt=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"}),XDt=s.forwardRef((e,r)=>t.jsx(ult.span,{...e,ref:r,style:{...YDt,...e.style}}));XDt.displayName="VisuallyHidden";var ZDt=XDt,QDt=[" ","Enter","ArrowUp","ArrowDown"],JDt=[" ","Enter"],eOt="Select",[tOt,rOt,nOt]=ygt(eOt),[oOt,aOt]=Xst(eOt,[nOt,wyt]),iOt=wyt(),[sOt,lOt]=oOt(eOt),[cOt,uOt]=oOt(eOt),dOt=e=>{const{__scopeSelect:r,children:n,open:o,defaultOpen:a,onOpenChange:i,value:l,defaultValue:c,onValueChange:u,dir:d,name:p,autoComplete:h,disabled:f,required:m,form:v}=e,y=iOt(r),[g,b]=s.useState(null),[x,w]=s.useState(null),[k,_]=s.useState(!1),C=bgt(d),[M,S]=nlt({prop:o,defaultProp:a??!1,onChange:i,caller:eOt}),[D,O]=nlt({prop:l,defaultProp:c,onChange:u,caller:eOt}),P=s.useRef(null),E=!g||(v||!!g.closest("form")),[j,T]=s.useState(new Set),N=Array.from(j).map(e=>e.props.value).join(";");return t.jsx(Iyt,{...y,children:t.jsxs(sOt,{required:m,scope:r,trigger:g,onTriggerChange:b,valueNode:x,onValueNodeChange:w,valueNodeHasChildren:k,onValueNodeHasChildrenChange:_,contentId:tlt(),value:D,onValueChange:O,open:M,onOpenChange:S,dir:C,triggerPointerDownPosRef:P,disabled:f,children:[t.jsx(tOt.Provider,{scope:r,children:t.jsx(cOt,{scope:e.__scopeSelect,onNativeOptionAdd:s.useCallback(e=>{T(t=>new Set(t).add(e))},[]),onNativeOptionRemove:s.useCallback(e=>{T(t=>{const r=new Set(t);return r.delete(e),r})},[]),children:n})}),E?t.jsxs(JOt,{"aria-hidden":!0,required:m,tabIndex:-1,name:p,autoComplete:h,value:D,onChange:e=>O(e.target.value),disabled:f,form:v,children:[void 0===D?t.jsx("option",{value:""}):null,Array.from(j)]},N):null]})})};dOt.displayName=eOt;var pOt="SelectTrigger",hOt=s.forwardRef((e,r)=>{const{__scopeSelect:n,disabled:o=!1,...a}=e,i=iOt(n),l=lOt(pOt,n),c=l.disabled||o,u=Yst(r,l.onTriggerChange),d=rOt(n),p=s.useRef("touch"),[h,f,m]=tPt(e=>{const t=d().filter(e=>!e.disabled),r=t.find(e=>e.value===l.value),n=rPt(t,e,r);void 0!==n&&l.onValueChange(n.value)}),v=e=>{c||(l.onOpenChange(!0),m()),e&&(l.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return t.jsx(Ayt,{asChild:!0,...i,children:t.jsx(ult.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":ePt(l.value)?"":void 0,...a,ref:u,onClick:Ust(a.onClick,e=>{e.currentTarget.focus(),"mouse"!==p.current&&v(e)}),onPointerDown:Ust(a.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&&(v(e),e.preventDefault())}),onKeyDown:Ust(a.onKeyDown,e=>{const t=""!==h.current;!(e.ctrlKey||e.altKey||e.metaKey)&&1===e.key.length&&f(e.key),(!t||" "!==e.key)&&QDt.includes(e.key)&&(v(),e.preventDefault())})})})});hOt.displayName=pOt;var fOt="SelectValue",mOt=s.forwardRef((e,r)=>{const{__scopeSelect:n,className:o,style:a,children:i,placeholder:s="",...l}=e,c=lOt(fOt,n),{onValueNodeHasChildrenChange:u}=c,d=void 0!==i,p=Yst(r,c.onValueNodeChange);return Qst(()=>{u(d)},[u,d]),t.jsx(ult.span,{...l,ref:p,style:{pointerEvents:"none"},children:ePt(c.value)?t.jsx(t.Fragment,{children:s}):i})});mOt.displayName=fOt;var vOt=s.forwardRef((e,r)=>{const{__scopeSelect:n,children:o,...a}=e;return t.jsx(ult.span,{"aria-hidden":!0,...a,ref:r,children:o||"▼"})});vOt.displayName="SelectIcon";var yOt=e=>t.jsx(Tlt,{asChild:!0,...e});yOt.displayName="SelectPortal";var gOt="SelectContent",bOt=s.forwardRef((e,r)=>{const n=lOt(gOt,e.__scopeSelect),[o,a]=s.useState();if(Qst(()=>{a(new DocumentFragment)},[]),!n.open){const r=o;return r?d.createPortal(t.jsx(wOt,{scope:e.__scopeSelect,children:t.jsx(tOt.Slot,{scope:e.__scopeSelect,children:t.jsx("div",{children:e.children})})}),r):null}return t.jsx(COt,{...e,ref:r})});bOt.displayName=gOt;var xOt=10,[wOt,kOt]=oOt(gOt),_Ot=olt("SelectContent.RemoveScroll"),COt=s.forwardRef((e,r)=>{const{__scopeSelect:n,position:o="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:i,onPointerDownOutside:l,side:c,sideOffset:u,align:d,alignOffset:p,arrowPadding:h,collisionBoundary:f,collisionPadding:m,sticky:v,hideWhenDetached:y,avoidCollisions:g,...b}=e,x=lOt(gOt,n),[w,k]=s.useState(null),[_,C]=s.useState(null),M=Yst(r,e=>k(e)),[S,D]=s.useState(null),[O,P]=s.useState(null),E=rOt(n),[j,T]=s.useState(!1),N=s.useRef(!1);s.useEffect(()=>{if(w)return Nct(w)},[w]),zlt();const R=s.useCallback(e=>{const[t,...r]=E().map(e=>e.ref.current),[n]=r.slice(-1),o=document.activeElement;for(const r of e)if(r===o||(null==r||r.scrollIntoView({block:"nearest"}),r===t&&_&&(_.scrollTop=0),r===n&&_&&(_.scrollTop=_.scrollHeight),null==r||r.focus(),document.activeElement!==o))return},[E,_]),F=s.useCallback(()=>R([S,w]),[R,S,w]);s.useEffect(()=>{j&&F()},[j,F]);const{onOpenChange:z,triggerPointerDownPosRef:I}=x;s.useEffect(()=>{if(w){let e={x:0,y:0};const t=t=>{var r,n;e={x:Math.abs(Math.round(t.pageX)-((null==(r=I.current)?void 0:r.x)??0)),y:Math.abs(Math.round(t.pageY)-((null==(n=I.current)?void 0:n.y)??0))}},r=r=>{e.x<=10&&e.y<=10?r.preventDefault():w.contains(r.target)||z(!1),document.removeEventListener("pointermove",t),I.current=null};return null!==I.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",r,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",r,{capture:!0})}}},[w,z,I]),s.useEffect(()=>{const e=()=>z(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[z]);const[A,L]=tPt(e=>{const t=E().filter(e=>!e.disabled),r=t.find(e=>e.ref.current===document.activeElement),n=rPt(t,e,r);n&&setTimeout(()=>n.ref.current.focus())}),B=s.useCallback((e,t,r)=>{const n=!N.current&&!r;(void 0!==x.value&&x.value===t||n)&&(D(e),n&&(N.current=!0))},[x.value]),V=s.useCallback(()=>null==w?void 0:w.focus(),[w]),H=s.useCallback((e,t,r)=>{const n=!N.current&&!r;(void 0!==x.value&&x.value===t||n)&&P(e)},[x.value]),q="popper"===o?SOt:MOt,$=q===SOt?{side:c,sideOffset:u,align:d,alignOffset:p,arrowPadding:h,collisionBoundary:f,collisionPadding:m,sticky:v,hideWhenDetached:y,avoidCollisions:g}:{};return t.jsx(wOt,{scope:n,content:w,viewport:_,onViewportChange:C,itemRefCallback:B,selectedItem:S,onItemLeave:V,itemTextRefCallback:H,focusSelectedItem:F,selectedItemText:O,position:o,isPositioned:j,searchRef:A,children:t.jsx(Sct,{as:_Ot,allowPinchZoom:!0,children:t.jsx(Mlt,{asChild:!0,trapped:x.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:Ust(a,e=>{var t;null==(t=x.trigger)||t.focus({preventScroll:!0}),e.preventDefault()}),children:t.jsx(glt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:t.jsx(q,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:e=>e.preventDefault(),...b,...$,onPlaced:()=>T(!0),ref:M,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:Ust(b.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),!t&&1===e.key.length&&L(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=E().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(()=>R(t)),e.preventDefault()}})})})})})})});COt.displayName="SelectContentImpl";var MOt=s.forwardRef((e,r)=>{const{__scopeSelect:n,onPlaced:o,...a}=e,i=lOt(gOt,n),l=kOt(gOt,n),[c,u]=s.useState(null),[d,p]=s.useState(null),h=Yst(r,e=>p(e)),f=rOt(n),m=s.useRef(!1),v=s.useRef(!0),{viewport:y,selectedItem:g,selectedItemText:b,focusSelectedItem:x}=l,w=s.useCallback(()=>{if(i.trigger&&i.valueNode&&c&&d&&y&&g&&b){const e=i.trigger.getBoundingClientRect(),t=d.getBoundingClientRect(),r=i.valueNode.getBoundingClientRect(),n=b.getBoundingClientRect();if("rtl"!==i.dir){const o=n.left-t.left,a=r.left-o,i=e.left-a,s=e.width+i,l=Math.max(s,t.width),u=window.innerWidth-xOt,d=KDt(a,[xOt,Math.max(xOt,u-l)]);c.style.minWidth=s+"px",c.style.left=d+"px"}else{const o=t.right-n.right,a=window.innerWidth-r.right-o,i=window.innerWidth-e.right-a,s=e.width+i,l=Math.max(s,t.width),u=window.innerWidth-xOt,d=KDt(a,[xOt,Math.max(xOt,u-l)]);c.style.minWidth=s+"px",c.style.right=d+"px"}const a=f(),s=window.innerHeight-2*xOt,l=y.scrollHeight,u=window.getComputedStyle(d),p=parseInt(u.borderTopWidth,10),h=parseInt(u.paddingTop,10),v=parseInt(u.borderBottomWidth,10),x=p+h+l+parseInt(u.paddingBottom,10)+v,w=Math.min(5*g.offsetHeight,x),k=window.getComputedStyle(y),_=parseInt(k.paddingTop,10),C=parseInt(k.paddingBottom,10),M=e.top+e.height/2-xOt,S=s-M,D=g.offsetHeight/2,O=p+h+(g.offsetTop+D),P=x-O;if(O<=M){const e=a.length>0&&g===a[a.length-1].ref.current;c.style.bottom="0px";const t=d.clientHeight-y.offsetTop-y.offsetHeight,r=O+Math.max(S,D+(e?C:0)+t+v);c.style.height=r+"px"}else{const e=a.length>0&&g===a[0].ref.current;c.style.top="0px";const t=Math.max(M,p+y.offsetTop+(e?_:0)+D)+P;c.style.height=t+"px",y.scrollTop=O-M+y.offsetTop}c.style.margin=`${xOt}px 0`,c.style.minHeight=w+"px",c.style.maxHeight=s+"px",null==o||o(),requestAnimationFrame(()=>m.current=!0)}},[f,i.trigger,i.valueNode,c,d,y,g,b,i.dir,o]);Qst(()=>w(),[w]);const[k,_]=s.useState();Qst(()=>{d&&_(window.getComputedStyle(d).zIndex)},[d]);const C=s.useCallback(e=>{e&&!0===v.current&&(w(),null==x||x(),v.current=!1)},[w,x]);return t.jsx(DOt,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:m,onScrollButtonChange:C,children:t.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:t.jsx(ult.div,{...a,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});MOt.displayName="SelectItemAlignedPosition";var SOt=s.forwardRef((e,r)=>{const{__scopeSelect:n,align:o="start",collisionPadding:a=xOt,...i}=e,s=iOt(n);return t.jsx(Lyt,{...s,...i,ref:r,align:o,collisionPadding:a,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)"}})});SOt.displayName="SelectPopperPosition";var[DOt,OOt]=oOt(gOt,{}),POt="SelectViewport",EOt=s.forwardRef((e,r)=>{const{__scopeSelect:n,nonce:o,...a}=e,i=kOt(POt,n),l=OOt(POt,n),c=Yst(r,i.onViewportChange),u=s.useRef(0);return t.jsxs(t.Fragment,{children:[t.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),t.jsx(tOt.Slot,{scope:n,children:t.jsx(ult.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:Ust(a.onScroll,e=>{const t=e.currentTarget,{contentWrapper:r,shouldExpandOnScrollRef:n}=l;if(null!=n&&n.current&&r){const e=Math.abs(u.current-t.scrollTop);if(e>0){const n=window.innerHeight-2*xOt,o=parseFloat(r.style.minHeight),a=parseFloat(r.style.height),i=Math.max(o,a);if(i<n){const o=i+e,a=Math.min(n,o),s=o-a;r.style.height=a+"px","0px"===r.style.bottom&&(t.scrollTop=s>0?s:0,r.style.justifyContent="flex-end")}}}u.current=t.scrollTop})})})]})});EOt.displayName=POt;var jOt="SelectGroup",[TOt,NOt]=oOt(jOt),ROt=s.forwardRef((e,r)=>{const{__scopeSelect:n,...o}=e,a=tlt();return t.jsx(TOt,{scope:n,id:a,children:t.jsx(ult.div,{role:"group","aria-labelledby":a,...o,ref:r})})});ROt.displayName=jOt;var FOt="SelectLabel",zOt=s.forwardRef((e,r)=>{const{__scopeSelect:n,...o}=e,a=NOt(FOt,n);return t.jsx(ult.div,{id:a.id,...o,ref:r})});zOt.displayName=FOt;var IOt="SelectItem",[AOt,LOt]=oOt(IOt),BOt=s.forwardRef((e,r)=>{const{__scopeSelect:n,value:o,disabled:a=!1,textValue:i,...l}=e,c=lOt(IOt,n),u=kOt(IOt,n),d=c.value===o,[p,h]=s.useState(i??""),[f,m]=s.useState(!1),v=Yst(r,e=>{var t;return null==(t=u.itemRefCallback)?void 0:t.call(u,e,o,a)}),y=tlt(),g=s.useRef("touch"),b=()=>{a||(c.onValueChange(o),c.onOpenChange(!1))};if(""===o)throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return t.jsx(AOt,{scope:n,value:o,disabled:a,textId:y,isSelected:d,onItemTextChange:s.useCallback(e=>{h(t=>t||((null==e?void 0:e.textContent)??"").trim())},[]),children:t.jsx(tOt.ItemSlot,{scope:n,value:o,disabled:a,textValue:p,children:t.jsx(ult.div,{role:"option","aria-labelledby":y,"data-highlighted":f?"":void 0,"aria-selected":d&&f,"data-state":d?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...l,ref:v,onFocus:Ust(l.onFocus,()=>m(!0)),onBlur:Ust(l.onBlur,()=>m(!1)),onClick:Ust(l.onClick,()=>{"mouse"!==g.current&&b()}),onPointerUp:Ust(l.onPointerUp,()=>{"mouse"===g.current&&b()}),onPointerDown:Ust(l.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:Ust(l.onPointerMove,e=>{var t;g.current=e.pointerType,a?null==(t=u.onItemLeave)||t.call(u):"mouse"===g.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ust(l.onPointerLeave,e=>{var t;e.currentTarget===document.activeElement&&(null==(t=u.onItemLeave)||t.call(u))}),onKeyDown:Ust(l.onKeyDown,e=>{var t;""!==(null==(t=u.searchRef)?void 0:t.current)&&" "===e.key||(JDt.includes(e.key)&&b()," "===e.key&&e.preventDefault())})})})})});BOt.displayName=IOt;var VOt="SelectItemText",HOt=s.forwardRef((e,r)=>{const{__scopeSelect:n,className:o,style:a,...i}=e,l=lOt(VOt,n),c=kOt(VOt,n),u=LOt(VOt,n),p=uOt(VOt,n),[h,f]=s.useState(null),m=Yst(r,e=>f(e),u.onItemTextChange,e=>{var t;return null==(t=c.itemTextRefCallback)?void 0:t.call(c,e,u.value,u.disabled)}),v=null==h?void 0:h.textContent,y=s.useMemo(()=>t.jsx("option",{value:u.value,disabled:u.disabled,children:v},u.value),[u.disabled,u.value,v]),{onNativeOptionAdd:g,onNativeOptionRemove:b}=p;return Qst(()=>(g(y),()=>b(y)),[g,b,y]),t.jsxs(t.Fragment,{children:[t.jsx(ult.span,{id:u.textId,...i,ref:m}),u.isSelected&&l.valueNode&&!l.valueNodeHasChildren?d.createPortal(i.children,l.valueNode):null]})});HOt.displayName=VOt;var qOt="SelectItemIndicator",$Ot=s.forwardRef((e,r)=>{const{__scopeSelect:n,...o}=e;return LOt(qOt,n).isSelected?t.jsx(ult.span,{"aria-hidden":!0,...o,ref:r}):null});$Ot.displayName=qOt;var WOt="SelectScrollUpButton",UOt=s.forwardRef((e,r)=>{const n=kOt(WOt,e.__scopeSelect),o=OOt(WOt,e.__scopeSelect),[a,i]=s.useState(!1),l=Yst(r,o.onScrollButtonChange);return Qst(()=>{if(n.viewport&&n.isPositioned){let e=function(){const e=t.scrollTop>0;i(e)};const t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),a?t.jsx(YOt,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});UOt.displayName=WOt;var GOt="SelectScrollDownButton",KOt=s.forwardRef((e,r)=>{const n=kOt(GOt,e.__scopeSelect),o=OOt(GOt,e.__scopeSelect),[a,i]=s.useState(!1),l=Yst(r,o.onScrollButtonChange);return Qst(()=>{if(n.viewport&&n.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,r=Math.ceil(t.scrollTop)<e;i(r)};const t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),a?t.jsx(YOt,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});KOt.displayName=GOt;var YOt=s.forwardRef((e,r)=>{const{__scopeSelect:n,onAutoScroll:o,...a}=e,i=kOt("SelectScrollButton",n),l=s.useRef(null),c=rOt(n),u=s.useCallback(()=>{null!==l.current&&(window.clearInterval(l.current),l.current=null)},[]);return s.useEffect(()=>()=>u(),[u]),Qst(()=>{var e;const t=c().find(e=>e.ref.current===document.activeElement);null==(e=null==t?void 0:t.ref.current)||e.scrollIntoView({block:"nearest"})},[c]),t.jsx(ult.div,{"aria-hidden":!0,...a,ref:r,style:{flexShrink:0,...a.style},onPointerDown:Ust(a.onPointerDown,()=>{null===l.current&&(l.current=window.setInterval(o,50))}),onPointerMove:Ust(a.onPointerMove,()=>{var e;null==(e=i.onItemLeave)||e.call(i),null===l.current&&(l.current=window.setInterval(o,50))}),onPointerLeave:Ust(a.onPointerLeave,()=>{u()})})}),XOt=s.forwardRef((e,r)=>{const{__scopeSelect:n,...o}=e;return t.jsx(ult.div,{"aria-hidden":!0,...o,ref:r})});XOt.displayName="SelectSeparator";var ZOt="SelectArrow",QOt=s.forwardRef((e,r)=>{const{__scopeSelect:n,...o}=e,a=iOt(n),i=lOt(ZOt,n),s=kOt(ZOt,n);return i.open&&"popper"===s.position?t.jsx(Byt,{...a,...o,ref:r}):null});QOt.displayName=ZOt;var JOt=s.forwardRef(({__scopeSelect:e,value:r,...n},o)=>{const a=s.useRef(null),i=Yst(o,a),l=Agt(r);return s.useEffect(()=>{const e=a.current;if(!e)return;const t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,"value").set;if(l!==r&&n){const t=new Event("change",{bubbles:!0});n.call(e,r),e.dispatchEvent(t)}},[l,r]),t.jsx(ult.select,{...n,style:{...YDt,...n.style},ref:i,defaultValue:r})});function ePt(e){return""===e||void 0===e}function tPt(e){const t=plt(e),r=s.useRef(""),n=s.useRef(0),o=s.useCallback(e=>{const o=r.current+e;t(o),function e(t){r.current=t,window.clearTimeout(n.current),""!==t&&(n.current=window.setTimeout(()=>e(""),1e3))}(o)},[t]),a=s.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return s.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,a]}function rPt(e,t,r){const n=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let a=function(e,t){return e.map((r,n)=>e[(t+n)%e.length])}(e,Math.max(o,0));1===n.length&&(a=a.filter(e=>e!==r));const i=a.find(e=>e.textValue.toLowerCase().startsWith(n.toLowerCase()));return i!==r?i:void 0}JOt.displayName="SelectBubbleInput";var nPt=hOt,oPt=vOt,aPt=yOt,iPt=bOt,sPt=EOt,lPt=zOt,cPt=BOt,uPt=HOt,dPt=$Ot,pPt=UOt,hPt=KOt,fPt=XOt;const mPt=dOt,vPt=mOt,yPt=s.forwardRef(({className:e,children:r,...n},o)=>t.jsxs(nPt,{ref:o,className:vdt("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[r,t.jsx(oPt,{asChild:!0,children:t.jsx(Dst,{className:"h-4 w-4 opacity-50"})})]}));yPt.displayName=nPt.displayName;const gPt=s.forwardRef(({className:e,...r},n)=>t.jsx(pPt,{ref:n,className:vdt("flex cursor-default items-center justify-center py-1",e),...r,children:t.jsx(Est,{className:"h-4 w-4"})}));gPt.displayName=pPt.displayName;const bPt=s.forwardRef(({className:e,...r},n)=>t.jsx(hPt,{ref:n,className:vdt("flex cursor-default items-center justify-center py-1",e),...r,children:t.jsx(Dst,{className:"h-4 w-4"})}));bPt.displayName=hPt.displayName;const xPt=s.forwardRef(({className:e,children:r,position:n="popper",...o},a)=>t.jsx(aPt,{children:t.jsxs(iPt,{ref:a,className:vdt("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","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",e),position:n,...o,children:[t.jsx(gPt,{}),t.jsx(sPt,{className:vdt("p-1","popper"===n&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r}),t.jsx(bPt,{})]})}));xPt.displayName=iPt.displayName;const wPt=s.forwardRef(({className:e,...r},n)=>t.jsx(lPt,{ref:n,className:vdt("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...r}));wPt.displayName=lPt.displayName;const kPt=s.forwardRef(({className:e,children:r,...n},o)=>t.jsxs(cPt,{ref:o,className:vdt("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(dPt,{children:t.jsx(Sst,{className:"h-4 w-4"})})}),t.jsx(uPt,{children:r})]}));kPt.displayName=cPt.displayName;const _Pt=s.forwardRef(({className:e,...r},n)=>t.jsx(fPt,{ref:n,className:vdt("-mx-1 my-1 h-px bg-muted",e),...r}));_Pt.displayName=fPt.displayName;var CPt="Switch",[MPt,SPt]=Xst(CPt),[DPt,OPt]=MPt(CPt),PPt=s.forwardRef((e,r)=>{const{__scopeSwitch:n,name:o,checked:a,defaultChecked:i,required:l,disabled:c,value:u="on",onCheckedChange:d,form:p,...h}=e,[f,m]=s.useState(null),v=Yst(r,e=>m(e)),y=s.useRef(!1),g=!f||(p||!!f.closest("form")),[b,x]=nlt({prop:a,defaultProp:i??!1,onChange:d,caller:CPt});return t.jsxs(DPt,{scope:n,checked:b,disabled:c,children:[t.jsx(ult.button,{type:"button",role:"switch","aria-checked":b,"aria-required":l,"data-state":NPt(b),"data-disabled":c?"":void 0,disabled:c,value:u,...h,ref:v,onClick:Ust(e.onClick,e=>{x(e=>!e),g&&(y.current=e.isPropagationStopped(),y.current||e.stopPropagation())})}),g&&t.jsx(TPt,{control:f,bubbles:!y.current,name:o,value:u,checked:b,required:l,disabled:c,form:p,style:{transform:"translateX(-100%)"}})]})});PPt.displayName=CPt;var EPt="SwitchThumb",jPt=s.forwardRef((e,r)=>{const{__scopeSwitch:n,...o}=e,a=OPt(EPt,n);return t.jsx(ult.span,{"data-state":NPt(a.checked),"data-disabled":a.disabled?"":void 0,...o,ref:r})});jPt.displayName=EPt;var TPt=s.forwardRef(({__scopeSwitch:e,control:r,checked:n,bubbles:o=!0,...a},i)=>{const l=s.useRef(null),c=Yst(l,i),u=Agt(n),d=gyt(r);return s.useEffect(()=>{const e=l.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:o});r.call(e,n),e.dispatchEvent(t)}},[u,n,o]),t.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...a,tabIndex:-1,ref:c,style:{...a.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function NPt(e){return e?"checked":"unchecked"}TPt.displayName="SwitchBubbleInput";var RPt=PPt,FPt=jPt;const zPt=s.forwardRef(({className:e,...r},n)=>t.jsx(RPt,{className:vdt("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...r,ref:n,children:t.jsx(FPt,{className:vdt("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));zPt.displayName=RPt.displayName;const IPt=({field:r,form:n,translations:o})=>{const[a,i]=e.useState(0),[s,l]=e.useState(""),[c,u]=e.useState({}),d=n.getValues("startDate"),p=n.getValues("endDate"),h=n.getValues("isRepeatingInterval")||"daily",f=eit({start:d,end:p}).filter(e=>{const t=h;return"daily"===t||("weekly"===t?e.getDay()===d.getDay():"monthly"===t&&e.getDate()===d.getDate())}),m=r.value||[],v=m.filter(e=>f.some(t=>Gat(e,t)));m.length!==v.length&&setTimeout(()=>{r.onChange(v)},0);const y=e=>e.length>=f.length;if("daily"===h)return t.jsx(Bht,{mode:"multiple",selected:r.value||[],onSelect:e=>{e&&y(e)?TDt.error(o.errorCannotExcludeAllDates||"Cannot exclude all dates in the range"):r.onChange(e||[])},fromDate:d,toDate:p,defaultMonth:d,className:"rounded-md border"});const g=f.reduce((e,t)=>{const r=Vit(t,"yyyy-MM");return e[r]||(e[r]=[]),e[r].push(t),e},{}),b=Object.entries(g).sort(([e],[t])=>e.localeCompare(t));if(0===Object.keys(c).length&&b.length>0){const e={};b.forEach(([t],r)=>{e[t]=0===r}),u(e)}const x=""===s.trim()?b:b.filter(e=>{const t=e[1][0];return`${o.monthNames[t.getMonth()]} ${Vit(t,"yyyy")}`.toLowerCase().includes(s.toLowerCase())}),w=Math.ceil(x.length/2),k=x.slice(2*a,2*(a+1));return t.jsxs("div",{className:"rounded-md p-1 w-[300px] overflow-y-auto",children:[t.jsx("div",{className:"text-center font-medium mb-2 text-sm",children:"weekly"===h?o.weeklyIntervalLabel.replace("{dayName}",o.fullDayNames[d.getDay()]).replace("{startDate}",`${Vit(d,"dd")} ${o.monthNames[d.getMonth()].slice(0,3)}`).replace("{endDate}",`${Vit(p,"dd")} ${o.monthNames[p.getMonth()].slice(0,3)} ${Vit(p,"yyyy")}`):o.monthlyIntervalLabel.replace("{dayOfMonth}",Vit(d,"do")).replace("{startDate}",o.monthNames[d.getMonth()].slice(0,3)).replace("{endDate}",`${o.monthNames[p.getMonth()].slice(0,3)} ${Vit(p,"yyyy")}`)}),t.jsxs("div",{className:"flex gap-2 mb-2",children:[t.jsx("div",{className:"flex-grow",children:t.jsx(Mmt,{type:"text",placeholder:o.searchMonthPlaceholder,value:s,onChange:e=>{l(e.target.value),i(0)},className:"h-7 text-xs"})}),x.length>0&&t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(Edt,{type:"button",variant:"outline",size:"sm",className:"h-7 w-7 p-0",onClick:()=>{i(e=>Math.max(e-1,0))},disabled:0===a,children:"←"}),t.jsxs("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:[a+1,"/",Math.max(1,w)]}),t.jsx(Edt,{type:"button",variant:"outline",size:"sm",className:"h-7 w-7 p-0",onClick:()=>{i(e=>Math.min(e+1,w-1))},disabled:a>=w-1,children:"→"})]})]}),0===f.length?t.jsx("div",{className:"text-center text-muted-foreground py-1 text-xs",children:o.noMatchingDates}):0===x.length?t.jsx("div",{className:"text-center text-muted-foreground py-1 text-xs",children:o.noSearchResults.replace("{query}",s)}):t.jsx("div",{children:k.map(([e,n])=>{const a=n[0],i=`${o.monthNames[a.getMonth()]} ${Vit(a,"yyyy")}`,s=c[e],l=n.filter(e=>v.some(t=>Gat(t,e))).length;return t.jsxs("div",{className:"mb-2 border rounded-md overflow-hidden",children:[t.jsxs("div",{className:"py-1 px-2 bg-muted flex justify-between items-center cursor-pointer text-xs",onClick:()=>(e=>{u(t=>({...t,[e]:!t[e]}))})(e),children:[t.jsxs("div",{className:"flex items-center",children:[t.jsx("span",{className:"mr-1 flex items-center justify-center w-4",children:s?t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:t.jsx("path",{d:"m6 9 6 6 6-6"})}):t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:t.jsx("path",{d:"m9 18 6-6-6-6"})})}),t.jsx("span",{className:"font-medium",children:i}),t.jsx("span",{className:"ml-1 text-muted-foreground",children:o.ofExcluded.replace("{count}",l.toString()).replace("{total}",n.length.toString())})]}),t.jsxs("div",{className:"flex gap-1",children:[t.jsx(Edt,{type:"button",variant:"outline",size:"sm",className:"h-5 text-[10px] px-1",onClick:e=>{e.stopPropagation(),(e=>{const t=v,n=e.filter(e=>!t.some(t=>Gat(t,e))),a=[...t,...n];y(a)?TDt.error(o.errorCannotExcludeAllDates||"Cannot exclude all dates in the range"):r.onChange(a)})(n)},children:o.selectAll}),t.jsx(Edt,{type:"button",variant:"outline",size:"sm",className:"h-5 text-[10px] px-1",onClick:e=>{e.stopPropagation(),(e=>{const t=v.filter(t=>!e.some(e=>Gat(e,t)));r.onChange(t)})(n)},disabled:0===l,children:o.clearAll})]})]}),s&&t.jsx("div",{className:"p-1 flex flex-wrap gap-1 bg-background",children:n.map(e=>{const n=v.some(t=>Gat(t,e));return t.jsx(Edt,{type:"button",variant:n?"default":"outline",className:"h-6 px-1 text-[10px]",onClick:()=>{const t=v;if(n)r.onChange(t.filter(t=>!Gat(t,e)));else{const n=[...t,e];if(y(n))return void TDt.error(o.errorCannotExcludeAllDates||"Cannot exclude all dates in the range");r.onChange(n)}},children:Vit(e,o.dateButtonFormat)},e.toISOString())})})]},e)})})]})},APt=({form:r,translations:n,showRepeatToggle:o})=>{const[a,i]=e.useState(!1);e.useState(()=>{const e=r.getValues("isRepeatingExcludedDates");e&&e.length>0&&i(!0)});return o?t.jsx(xDt.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.3},children:t.jsxs(xmt,{className:"flex flex-col rounded-lg border p-4 space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsxs(wmt,{className:"text-base flex items-center cursor-pointer",children:[t.jsx(Cst,{className:"mr-2 h-4 w-4 flex-shrink-0"}),t.jsx("span",{className:"leading-tight",children:n.repeatingEventQuestion})]}),t.jsx(Tbt,{mode:"wait",children:r.watch("isRepeating")&&t.jsx(xDt.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},transition:{duration:.2,ease:"easeInOut"},children:t.jsx(_mt,{className:"text-xs leading-normal max-w-[90%]",children:((e,t,r,o,a,i)=>{const s=e=>Vit(e,"MMM d"),l=n.fullDayNames[e.getDay()],c="enUS"===n.language?Vit(e,"do"):e.getDate().toString(),u=s(e),d=Kit(e,t)?s(t):Vit(t,"MMM d, yyyy"),p=`${GDt(r)} - ${GDt(o)}`;let h="";switch(a||"daily"){case"daily":h=n.repeatDailyDescription.replace("{timeRange}",p).replace("{startDate}",u).replace("{endDate}",d);break;case"weekly":h=n.repeatWeeklyDescription.replace("{dayName}",l).replace("{timeRange}",p).replace("{startDate}",u).replace("{endDate}",d);break;case"monthly":h=n.repeatMonthlyDescription.replace("{dayOfMonth}",c).replace("{timeRange}",p).replace("{startDate}",u).replace("{endDate}",d)}if(i&&i.length>0){const e=i.length;h+=` (${n.withExcludedDates.replace("{count}",e.toString()).replace("{s}",e>1?"s":"")})`}return h})(r.watch("startDate"),r.watch("endDate"),r.watch("startTime"),r.watch("endTime"),r.watch("isRepeatingInterval"),r.watch("isRepeatingExcludedDates"))})})})]}),t.jsx(ymt,{control:r.control,name:"isRepeating",render:({field:e})=>t.jsx(kmt,{children:t.jsx(zPt,{checked:e.value,onCheckedChange:t=>{e.onChange(t),t||(i(!1),r.setValue("isRepeatingExcludedDates",[]))},className:"flex-shrink-0"})})})]}),t.jsx(Tbt,{children:r.watch("isRepeating")&&t.jsx(xDt.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.15},children:t.jsxs("div",{className:"space-y-4",children:[t.jsx(ymt,{control:r.control,name:"isRepeatingInterval",render:({field:e})=>t.jsxs(mPt,{onValueChange:t=>{t!==e.value&&(r.setValue("isRepeatingExcludedDates",[]),i(!1)),e.onChange(t)},value:e.value||"daily",children:[t.jsx(kmt,{children:t.jsx(yPt,{className:"w-full",children:t.jsx(vPt,{})})}),t.jsxs(xPt,{children:[t.jsx(kPt,{value:"daily",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx(wst,{className:"mr-2 h-4 w-4"}),n.repeatDaily]})}),t.jsx(kPt,{value:"weekly",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx(Cst,{className:"mr-2 h-4 w-4"}),n.repeatWeekly]})}),t.jsx(kPt,{value:"monthly",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx(kst,{className:"mr-2 h-4 w-4"}),n.repeatMonthly]})})]})]})}),t.jsxs("div",{className:"flex items-center justify-between mt-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsxs(wmt,{className:"flex items-center text-sm cursor-pointer",children:[t.jsx(jst,{className:"mr-2 h-3 w-3"}),n.excludedDates]}),t.jsx(_mt,{className:"text-xs",children:n.excludedDatesDescription})]}),t.jsx(zPt,{checked:a,onCheckedChange:e=>{i(e),e||r.setValue("isRepeatingExcludedDates",[])},className:"flex-shrink-0"})]}),t.jsx(Tbt,{children:a&&t.jsx(xDt.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.05,ease:"easeInOut"},className:"mt-4",children:t.jsx(ymt,{control:r.control,name:"isRepeatingExcludedDates",render:({field:e})=>t.jsx(xmt,{children:t.jsxs("div",{className:"space-y-4",children:[t.jsxs(fgt,{children:[t.jsx(mgt,{asChild:!0,children:t.jsxs(Edt,{variant:"outline",className:"w-full justify-start text-left font-normal text-sm h-9",type:"button",children:[t.jsx(kst,{className:"mr-2 h-4 w-4"}),n.selectDatesToExclude]})}),t.jsx(vgt,{className:"w-auto p-0 max-w-[320px]",align:"start",children:t.jsx(IPt,{field:e,form:r,translations:n})})]}),t.jsx(Tbt,{children:"daily"===r.watch("isRepeatingInterval")&&t.jsxs(xDt.div,{initial:{opacity:0,height:0,overflow:"hidden"},animate:{opacity:1,height:"auto",overflow:"visible"},exit:{opacity:0,height:0,overflow:"hidden"},transition:{duration:.015,ease:"easeInOut"},className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsx(_mt,{className:"text-xs mb-0",children:n.skipDays}),t.jsx(Edt,{type:"button",variant:"destructive",size:"sm",className:"text-xs h-5 mr-3",disabled:!((r.watch("isRepeatingExcludedDates")||[]).length>0),onClick:()=>{r.setValue("isRepeatingExcludedDates",[])},children:n.clearAll})]}),t.jsx("div",{children:t.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:n.dayNames.map((e,o)=>{const a=o,i=r.watch("isRepeatingExcludedDates")||[],s=eit({start:r.getValues("startDate"),end:r.getValues("endDate")}).filter(e=>e.getDay()===a),l=s.length>0,c=l&&s.every(e=>i.some(t=>Gat(t,e)));return t.jsx(Edt,{type:"button",variant:c?"default":"outline",size:"sm",className:vdt("w-8 h-8 p-0 text-center flex items-center justify-center",0===a||6===a?"font-medium":"",l?"":"opacity-50 cursor-not-allowed"),disabled:!l,onClick:()=>{if(!l)return;const e=r.getValues("startDate"),t=r.getValues("endDate"),o=eit({start:e,end:t}),i=o.filter(e=>e.getDay()===a);let s=[...r.getValues("isRepeatingExcludedDates")||[]];if(c)s=s.filter(e=>!i.some(t=>Gat(t,e)));else{i.forEach(e=>{s.some(t=>Gat(t,e))||s.push(e)});const r="daily",a=o.filter(n=>VDt(n,e,t,r));if(s.length>=a.length)return void TDt.error(n.errorCannotExcludeAllDates)}r.setValue("isRepeatingExcludedDates",s)},children:e.charAt(0)},o)})})})]})}),e.value&&e.value.length>0&&t.jsx("div",{className:"flex flex-wrap gap-1 mt-2",children:e.value.map((r,n)=>t.jsxs(xDt.div,{className:"bg-secondary text-secondary-foreground rounded-md px-2 py-1 text-xs flex items-center",initial:{opacity:0,scale:.6,y:15,rotateX:-10},animate:{opacity:1,scale:1,y:0,rotateX:0},whileHover:{scale:1.05},transition:{type:"spring",stiffness:500,damping:30,delay:0},children:[Vit(r,"MMM d, yyyy"),t.jsxs(Edt,{type:"button",variant:"ghost",size:"sm",className:"h-4 w-4 p-0 ml-1",onClick:()=>{const t=[...e.value||[]];t.splice(n,1),e.onChange(t)},children:[t.jsx("span",{className:"sr-only",children:"Remove"}),"×"]})]},r.toISOString()))}),t.jsx(Cmt,{})]})})})})})]})})})]})}):null},LPt=e.forwardRef(({value:r,onChange:n,...o},a)=>{const i=e.useMemo(()=>GDt(r),[r]),s=e=>{const[t,r]=i.split(":").map(Number);let o=t,a=r;"up"===e?(a+=15,a>=60&&(a=0,o=(o+1)%24)):(a-=15,a<0&&(a=45,o=(o-1+24)%24));const s=`${String(o).padStart(2,"0")}:${String(a).padStart(2,"0")}`;n(s)};return t.jsxs("div",{className:"relative",children:[t.jsx(Mmt,{type:"time",ref:a,value:i,onChange:e=>n(e.target.value),...o,className:"pr-8"}),t.jsxs("div",{className:"absolute right-1 top-1 bottom-1 flex flex-col justify-center",children:[t.jsx(Edt,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4",onClick:()=>s("up"),children:t.jsx(Est,{className:"h-3 w-3"})}),t.jsx(Edt,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4",onClick:()=>s("down"),children:t.jsx(Dst,{className:"h-3 w-3"})})]})]})});function BPt(e){return function(e){return"[object Object]"===Object.prototype.toString.call(e)}(e)||Array.isArray(e)}function VPt(e,t){const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;return JSON.stringify(Object.keys(e.breakpoints||{}))===JSON.stringify(Object.keys(t.breakpoints||{}))&&r.every(r=>{const n=e[r],o=t[r];return"function"==typeof n?`${n}`==`${o}`:BPt(n)&&BPt(o)?VPt(n,o):n===o})}function HPt(e){return e.concat().sort((e,t)=>e.name>t.name?1:-1).map(e=>e.options)}function qPt(e){return"number"==typeof e}function $Pt(e){return"string"==typeof e}function WPt(e){return"boolean"==typeof e}function UPt(e){return"[object Object]"===Object.prototype.toString.call(e)}function GPt(e){return Math.abs(e)}function KPt(e){return Math.sign(e)}function YPt(e,t){return GPt(e-t)}function XPt(e){return tEt(e).map(Number)}function ZPt(e){return e[QPt(e)]}function QPt(e){return Math.max(0,e.length-1)}function JPt(e,t){return t===QPt(e)}function eEt(e,t=0){return Array.from(Array(e),(e,r)=>t+r)}function tEt(e){return Object.keys(e)}function rEt(e,t){return[e,t].reduce((e,t)=>(tEt(t).forEach(r=>{const n=e[r],o=t[r],a=UPt(n)&&UPt(o);e[r]=a?rEt(n,o):o}),e),{})}function nEt(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function oEt(){let e=[];const t={add:function(r,n,o,a={passive:!0}){let i;if("addEventListener"in r)r.addEventListener(n,o,a),i=()=>r.removeEventListener(n,o,a);else{const e=r;e.addListener(o),i=()=>e.removeListener(o)}return e.push(i),t},clear:function(){e=e.filter(e=>e())}};return t}function aEt(e,t,r,n){const o=oEt(),a=1e3/60;let i=null,s=0,l=0;function c(e){if(!l)return;i||(i=e,r(),r());const o=e-i;for(i=e,s+=o;s>=a;)r(),s-=a;n(s/a),l&&(l=t.requestAnimationFrame(c))}function u(){t.cancelAnimationFrame(l),i=null,s=0,l=0}return{init:function(){o.add(e,"visibilitychange",()=>{e.hidden&&(i=null,s=0)})},destroy:function(){u(),o.clear()},start:function(){l||(l=t.requestAnimationFrame(c))},stop:u,update:r,render:n}}function iEt(e=0,t=0){const r=GPt(e-t);function n(t){return t<e}function o(e){return e>t}function a(e){return n(e)||o(e)}return{length:r,max:t,min:e,constrain:function(r){return a(r)?n(r)?e:t:r},reachedAny:a,reachedMax:o,reachedMin:n,removeOffset:function(e){return r?e-r*Math.ceil((e-t)/r):e}}}function sEt(e,t,r){const{constrain:n}=iEt(0,e),o=e+1;let a=i(t);function i(e){return r?GPt((o+e)%o):n(e)}function s(){return a}function l(){return sEt(e,s(),r)}const c={get:s,set:function(e){return a=i(e),c},add:function(e){return l().set(s()+e)},clone:l};return c}function lEt(e,t,r,n,o,a,i,s,l,c,u,d,p,h,f,m,v,y,g){const{cross:b,direction:x}=e,w=["INPUT","SELECT","TEXTAREA"],k={passive:!1},_=oEt(),C=oEt(),M=iEt(50,225).constrain(h.measure(20)),S={mouse:300,touch:400},D={mouse:500,touch:600},O=f?43:25;let P=!1,E=0,j=0,T=!1,N=!1,R=!1,F=!1;function z(e){if(!nEt(e,n)&&e.touches.length>=2)return I(e);const t=a.readPoint(e),r=a.readPoint(e,b),i=YPt(t,E),l=YPt(r,j);if(!(N||F||e.cancelable&&(N=i>l,N)))return I(e);const u=a.pointerMove(e);i>m&&(R=!0),c.useFriction(.3).useDuration(.75),s.start(),o.add(x(u)),e.preventDefault()}function I(e){const t=u.byDistance(0,!1).index!==d.get(),r=a.pointerUp(e)*(f?D:S)[F?"mouse":"touch"],n=function(e,t){const r=d.add(-1*KPt(e)),n=u.byDistance(e,!f).distance;return f||GPt(e)<M?n:v&&t?.5*n:u.byIndex(r.get(),0).distance}(x(r),t),o=function(e,t){if(0===e||0===t||GPt(e)<=GPt(t))return 0;const r=YPt(GPt(e),GPt(t));return GPt(r/e)}(r,n),i=O-10*o,s=y+o/50;N=!1,T=!1,C.clear(),c.useDuration(i).useFriction(s),l.distance(n,!f),F=!1,p.emit("pointerUp")}function A(e){R&&(e.stopPropagation(),e.preventDefault(),R=!1)}return{init:function(e){if(!g)return;function s(s){(WPt(g)||g(e,s))&&function(e){const s=nEt(e,n);F=s,R=f&&s&&!e.buttons&&P,P=YPt(o.get(),i.get())>=2,(!s||0===e.button)&&(function(e){const t=e.nodeName||"";return w.includes(t)}(e.target)||(T=!0,a.pointerDown(e),c.useFriction(0).useDuration(0),o.set(i),function(){const e=F?r:t;C.add(e,"touchmove",z,k).add(e,"touchend",I).add(e,"mousemove",z,k).add(e,"mouseup",I)}(),E=a.readPoint(e),j=a.readPoint(e,b),p.emit("pointerDown")))}(s)}const l=t;_.add(l,"dragstart",e=>e.preventDefault(),k).add(l,"touchmove",()=>{},k).add(l,"touchend",()=>{}).add(l,"touchstart",s).add(l,"mousedown",s).add(l,"touchcancel",I).add(l,"contextmenu",I).add(l,"click",A,!0)},destroy:function(){_.clear(),C.clear()},pointerDown:function(){return T}}}function cEt(e,t){let r,n;function o(e){return e.timeStamp}function a(r,n){const o="client"+("x"===(n||e.scroll)?"X":"Y");return(nEt(r,t)?r:r.touches[0])[o]}return{pointerDown:function(e){return r=e,n=e,a(e)},pointerMove:function(e){const t=a(e)-a(n),i=o(e)-o(r)>170;return n=e,i&&(r=e),t},pointerUp:function(e){if(!r||!n)return 0;const t=a(n)-a(r),i=o(e)-o(r),s=o(e)-o(n)>170,l=t/i;return i&&!s&&GPt(l)>.1?l:0},readPoint:a}}function uEt(e,t,r,n,o,a,i){const s=[e].concat(n);let l,c,u=[],d=!1;function p(e){return o.measureSize(i.measure(e))}return{init:function(o){a&&(c=p(e),u=n.map(p),l=new ResizeObserver(r=>{(WPt(a)||a(o,r))&&function(r){for(const a of r){if(d)return;const r=a.target===e,i=n.indexOf(a.target),s=r?c:u[i];if(GPt(p(r?e:n[i])-s)>=.5){o.reInit(),t.emit("resize");break}}}(r)}),r.requestAnimationFrame(()=>{s.forEach(e=>l.observe(e))}))},destroy:function(){d=!0,l&&l.disconnect()}}}function dEt(e,t,r,n,o){const a=o.measure(10),i=o.measure(50),s=iEt(.1,.99);let l=!1;function c(){return!(l||!e.reachedAny(r.get())||!e.reachedAny(t.get()))}return{shouldConstrain:c,constrain:function(o){if(!c())return;const l=e.reachedMin(t.get())?"min":"max",u=GPt(e[l]-t.get()),d=r.get()-t.get(),p=s.constrain(u/i);r.subtract(d*p),!o&&GPt(d)<a&&(r.set(e.constrain(r.get())),n.useDuration(25).useBaseFriction())},toggleActive:function(e){l=!e}}}function pEt(e,t,r,n){const o=t.min+.1,a=t.max+.1,{reachedMin:i,reachedMax:s}=iEt(o,a);return{loop:function(t){if(!function(e){return 1===e?s(r.get()):-1===e&&i(r.get())}(t))return;const o=e*(-1*t);n.forEach(e=>e.add(o))}}}function hEt(e,t,r,n,o){const{reachedAny:a,removeOffset:i,constrain:s}=n;function l(e){return e.concat().sort((e,t)=>GPt(e)-GPt(t))[0]}function c(t,n){const o=[t,t+r,t-r];if(!e)return t;if(!n)return l(o);const a=o.filter(e=>KPt(e)===n);return a.length?l(a):ZPt(o)-r}return{byDistance:function(r,n){const l=o.get()+r,{index:u,distance:d}=function(r){const n=e?i(r):s(r),o=t.map((e,t)=>({diff:c(e-n,0),index:t})).sort((e,t)=>GPt(e.diff)-GPt(t.diff)),{index:a}=o[0];return{index:a,distance:n}}(l),p=!e&&a(l);return!n||p?{index:u,distance:r}:{index:u,distance:r+c(t[u]-d,0)}},byIndex:function(e,r){return{index:e,distance:c(t[e]-o.get(),r)}},shortcut:c}}function fEt(e,t,r,n,o,a,i,s){const l={passive:!0,capture:!0};let c=0;function u(e){"Tab"===e.code&&(c=(new Date).getTime())}return{init:function(d){s&&(a.add(document,"keydown",u,!1),t.forEach((t,u)=>{a.add(t,"focus",t=>{(WPt(s)||s(d,t))&&function(t){if((new Date).getTime()-c>10)return;i.emit("slideFocusStart"),e.scrollLeft=0;const a=r.findIndex(e=>e.includes(t));qPt(a)&&(o.useDuration(0),n.index(a,0),i.emit("slideFocus"))}(u)},l)}))}}}function mEt(e){let t=e;function r(e){return qPt(e)?e:e.get()}return{get:function(){return t},set:function(e){t=r(e)},add:function(e){t+=r(e)},subtract:function(e){t-=r(e)}}}function vEt(e,t){const r="x"===e.scroll?function(e){return`translate3d(${e}px,0px,0px)`}:function(e){return`translate3d(0px,${e}px,0px)`},n=t.style;let o=null,a=!1;return{clear:function(){a||(n.transform="",t.getAttribute("style")||t.removeAttribute("style"))},to:function(t){if(a)return;const i=function(e){return Math.round(100*e)/100}(e.direction(t));i!==o&&(n.transform=r(i),o=i)},toggleActive:function(e){a=!e}}}function yEt(e,t,r,n,o,a,i,s,l){const c=XPt(o),u=XPt(o).reverse(),d=function(){const e=i[0];return f(h(u,e),r,!1)}().concat(function(){const e=t-i[0]-1;return f(h(c,e),-r,!0)}());function p(e,t){return e.reduce((e,t)=>e-o[t],t)}function h(e,t){return e.reduce((e,r)=>p(e,t)>0?e.concat([r]):e,[])}function f(o,i,c){const u=function(e){return a.map((r,o)=>({start:r-n[o]+.5+e,end:r+t-.5+e}))}(i);return o.map(t=>{const n=c?0:-r,o=c?r:0,a=c?"end":"start",i=u[t][a];return{index:t,loopPoint:i,slideLocation:mEt(-1),translate:vEt(e,l[t]),target:()=>s.get()>i?n:o}})}return{canLoop:function(){return d.every(({index:e})=>p(c.filter(t=>t!==e),t)<=.1)},clear:function(){d.forEach(e=>e.translate.clear())},loop:function(){d.forEach(e=>{const{target:t,translate:r,slideLocation:n}=e,o=t();o!==n.get()&&(r.to(o),n.set(o))})},loopPoints:d}}function gEt(e,t,r){let n,o=!1;return{init:function(a){r&&(n=new MutationObserver(e=>{o||(WPt(r)||r(a,e))&&function(e){for(const r of e)if("childList"===r.type){a.reInit(),t.emit("slidesChanged");break}}(e)}),n.observe(e,{childList:!0}))},destroy:function(){n&&n.disconnect(),o=!0}}}function bEt(e,t,r,n){const o={};let a,i=null,s=null,l=!1;return{init:function(){a=new IntersectionObserver(e=>{l||(e.forEach(e=>{const r=t.indexOf(e.target);o[r]=e}),i=null,s=null,r.emit("slidesInView"))},{root:e.parentElement,threshold:n}),t.forEach(e=>a.observe(e))},destroy:function(){a&&a.disconnect(),l=!0},get:function(e=!0){if(e&&i)return i;if(!e&&s)return s;const t=function(e){return tEt(o).reduce((t,r)=>{const n=parseInt(r),{isIntersecting:a}=o[n];return(e&&a||!e&&!a)&&t.push(n),t},[])}(e);return e&&(i=t),e||(s=t),t}}}function xEt(e,t,r,n,o,a,i,s,l){const{startEdge:c,endEdge:u,direction:d}=e,p=qPt(r);return{groupSlides:function(e){return p?function(e,t){return XPt(e).filter(e=>e%t===0).map(r=>e.slice(r,r+t))}(e,r):function(e){return e.length?XPt(e).reduce((r,p,h)=>{const f=ZPt(r)||0,m=0===f,v=p===QPt(e),y=o[c]-a[f][c],g=o[c]-a[p][u],b=!n&&m?d(i):0,x=GPt(g-(!n&&v?d(s):0)-(y+b));return h&&x>t+l&&r.push(p),v&&r.push(e.length),r},[]).map((t,r,n)=>{const o=Math.max(n[r-1]||0);return e.slice(o,t)}):[]}(e)}}}function wEt(e,t,r,n,o,a,i){const{align:s,axis:l,direction:c,startIndex:u,loop:d,duration:p,dragFree:h,dragThreshold:f,inViewThreshold:m,slidesToScroll:v,skipSnaps:y,containScroll:g,watchResize:b,watchSlides:x,watchDrag:w,watchFocus:k}=a,_={measure:function(e){const{offsetTop:t,offsetLeft:r,offsetWidth:n,offsetHeight:o}=e;return{top:t,right:r+n,bottom:t+o,left:r,width:n,height:o}}},C=_.measure(t),M=r.map(_.measure),S=function(e,t){const r="rtl"===t,n="y"===e,o=!n&&r?-1:1;return{scroll:n?"y":"x",cross:n?"x":"y",startEdge:n?"top":r?"right":"left",endEdge:n?"bottom":r?"left":"right",measureSize:function(e){const{height:t,width:r}=e;return n?t:r},direction:function(e){return e*o}}}(l,c),D=S.measureSize(C),O=function(e){return{measure:function(t){return e*(t/100)}}}(D),P=function(e,t){const r={start:function(){return 0},center:function(e){return n(e)/2},end:n};function n(e){return t-e}return{measure:function(n,o){return $Pt(e)?r[e](n):e(t,n,o)}}}(s,D),E=!d&&!!g,j=d||!!g,{slideSizes:T,slideSizesWithGaps:N,startGap:R,endGap:F}=function(e,t,r,n,o,a){const{measureSize:i,startEdge:s,endEdge:l}=e,c=r[0]&&o,u=function(){if(!c)return 0;const e=r[0];return GPt(t[s]-e[s])}(),d=function(){if(!c)return 0;const e=a.getComputedStyle(ZPt(n));return parseFloat(e.getPropertyValue(`margin-${l}`))}(),p=r.map(i),h=r.map((e,t,r)=>{const n=!t,o=JPt(r,t);return n?p[t]+u:o?p[t]+d:r[t+1][s]-e[s]}).map(GPt);return{slideSizes:p,slideSizesWithGaps:h,startGap:u,endGap:d}}(S,C,M,r,j,o),z=xEt(S,D,v,d,C,M,R,F,2),{snaps:I,snapsAligned:A}=function(e,t,r,n,o){const{startEdge:a,endEdge:i}=e,{groupSlides:s}=o,l=s(n).map(e=>ZPt(e)[i]-e[0][a]).map(GPt).map(t.measure),c=n.map(e=>r[a]-e[a]).map(e=>-GPt(e)),u=s(c).map(e=>e[0]).map((e,t)=>e+l[t]);return{snaps:c,snapsAligned:u}}(S,P,C,M,z),L=-ZPt(I)+ZPt(N),{snapsContained:B,scrollContainLimit:V}=function(e,t,r,n,o){const a=iEt(-t+e,0),i=r.map((e,t)=>{const{min:n,max:o}=a,i=a.constrain(e),s=!t,c=JPt(r,t);return s?o:c||l(n,i)?n:l(o,i)?o:i}).map(e=>parseFloat(e.toFixed(3))),s=function(){const e=i[0],t=ZPt(i);return iEt(i.lastIndexOf(e),i.indexOf(t)+1)}();function l(e,t){return YPt(e,t)<=1}return{snapsContained:function(){if(t<=e+o)return[a.max];if("keepSnaps"===n)return i;const{min:r,max:l}=s;return i.slice(r,l)}(),scrollContainLimit:s}}(D,L,A,g,2),H=E?B:A,{limit:q}=function(e,t,r){const n=t[0];return{limit:iEt(r?n-e:ZPt(t),n)}}(L,H,d),$=sEt(QPt(H),u,d),W=$.clone(),U=XPt(r),G=aEt(n,o,()=>(({dragHandler:e,scrollBody:t,scrollBounds:r,options:{loop:n}})=>{n||r.constrain(e.pointerDown()),t.seek()})(se),e=>(({scrollBody:e,translate:t,location:r,offsetLocation:n,previousLocation:o,scrollLooper:a,slideLooper:i,dragHandler:s,animation:l,eventHandler:c,scrollBounds:u,options:{loop:d}},p)=>{const h=e.settled(),f=!u.shouldConstrain(),m=d?h:h&&f,v=m&&!s.pointerDown();v&&l.stop();const y=r.get()*p+o.get()*(1-p);n.set(y),d&&(a.loop(e.direction()),i.loop()),t.to(n.get()),v&&c.emit("settle"),m||c.emit("scroll")})(se,e)),K=H[$.get()],Y=mEt(K),X=mEt(K),Z=mEt(K),Q=mEt(K),J=function(e,t,r,n,o,a){let i=0,s=0,l=o,c=a,u=e.get(),d=0;function p(e){return l=e,f}function h(e){return c=e,f}const f={direction:function(){return s},duration:function(){return l},velocity:function(){return i},seek:function(){const t=n.get()-e.get();let o=0;return l?(r.set(e),i+=t/l,i*=c,u+=i,e.add(i),o=u-d):(i=0,r.set(n),e.set(n),o=t),s=KPt(o),d=u,f},settled:function(){return GPt(n.get()-t.get())<.001},useBaseFriction:function(){return h(a)},useBaseDuration:function(){return p(o)},useFriction:h,useDuration:p};return f}(Y,Z,X,Q,p,.68),ee=hEt(d,H,L,q,Q),te=function(e,t,r,n,o,a,i){function s(o){const s=o.distance,l=o.index!==t.get();a.add(s),s&&(n.duration()?e.start():(e.update(),e.render(1),e.update())),l&&(r.set(t.get()),t.set(o.index),i.emit("select"))}return{distance:function(e,t){s(o.byDistance(e,t))},index:function(e,r){const n=t.clone().set(e);s(o.byIndex(n.get(),r))}}}(G,$,W,J,ee,Q,i),re=function(e){const{max:t,length:r}=e;return{get:function(e){return r?(e-t)/-r:0}}}(q),ne=oEt(),oe=bEt(t,r,i,m),{slideRegistry:ae}=function(e,t,r,n,o,a){const{groupSlides:i}=o,{min:s,max:l}=n;return{slideRegistry:function(){const n=i(a),o=!e||"keepSnaps"===t;return 1===r.length?[a]:o?n:n.slice(s,l).map((e,t,r)=>{const n=!t,o=JPt(r,t);return n?eEt(ZPt(r[0])+1):o?eEt(QPt(a)-ZPt(r)[0]+1,ZPt(r)[0]):e})}()}}(E,g,H,V,z,U),ie=fEt(e,r,ae,te,J,ne,i,k),se={ownerDocument:n,ownerWindow:o,eventHandler:i,containerRect:C,slideRects:M,animation:G,axis:S,dragHandler:lEt(S,e,n,o,Q,cEt(S,o),Y,G,te,J,ee,$,i,O,h,f,y,.68,w),eventStore:ne,percentOfView:O,index:$,indexPrevious:W,limit:q,location:Y,offsetLocation:Z,previousLocation:X,options:a,resizeHandler:uEt(t,i,o,r,S,b,_),scrollBody:J,scrollBounds:dEt(q,Z,Q,J,O),scrollLooper:pEt(L,q,Z,[Y,Z,X,Q]),scrollProgress:re,scrollSnapList:H.map(re.get),scrollSnaps:H,scrollTarget:ee,scrollTo:te,slideLooper:yEt(S,D,L,T,N,I,H,Z,r),slideFocus:ie,slidesHandler:gEt(t,i,x),slidesInView:oe,slideIndexes:U,slideRegistry:ae,slidesToScroll:z,target:Q,translate:vEt(S,t)};return se}LPt.displayName="TimeInput";const kEt={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function _Et(e){function t(e,t){return rEt(e,t||{})}return{mergeOptions:t,optionsAtMedia:function(r){const n=r.breakpoints||{},o=tEt(n).filter(t=>e.matchMedia(t).matches).map(e=>n[e]).reduce((e,r)=>t(e,r),{});return t(r,o)},optionsMediaQueries:function(t){return t.map(e=>tEt(e.breakpoints||{})).reduce((e,t)=>e.concat(t),[]).map(e.matchMedia)}}}function CEt(e,t,r){const n=e.ownerDocument,o=n.defaultView,a=_Et(o),i=function(e){let t=[];return{init:function(r,n){return t=n.filter(({options:t})=>!1!==e.optionsAtMedia(t).active),t.forEach(t=>t.init(r,e)),n.reduce((e,t)=>Object.assign(e,{[t.name]:t}),{})},destroy:function(){t=t.filter(e=>e.destroy())}}}(a),s=oEt(),l=function(){let e,t={};function r(e){return t[e]||[]}const n={init:function(t){e=t},emit:function(t){return r(t).forEach(r=>r(e,t)),n},off:function(e,o){return t[e]=r(e).filter(e=>e!==o),n},on:function(e,o){return t[e]=r(e).concat([o]),n},clear:function(){t={}}};return n}(),{mergeOptions:c,optionsAtMedia:u,optionsMediaQueries:d}=a,{on:p,off:h,emit:f}=l,m=S;let v,y,g,b,x=!1,w=c(kEt,CEt.globalOptions),k=c(w),_=[];function C(t){const r=wEt(e,g,b,n,o,t,l);if(t.loop&&!r.slideLooper.canLoop()){return C(Object.assign({},t,{loop:!1}))}return r}function M(t,r){x||(w=c(w,t),k=u(w),_=r||_,function(){const{container:t,slides:r}=k;g=($Pt(t)?e.querySelector(t):t)||e.children[0];const n=$Pt(r)?g.querySelectorAll(r):r;b=[].slice.call(n||g.children)}(),v=C(k),d([w,..._.map(({options:e})=>e)]).forEach(e=>s.add(e,"change",S)),k.active&&(v.translate.to(v.location.get()),v.animation.init(),v.slidesInView.init(),v.slideFocus.init(E),v.eventHandler.init(E),v.resizeHandler.init(E),v.slidesHandler.init(E),v.options.loop&&v.slideLooper.loop(),g.offsetParent&&b.length&&v.dragHandler.init(E),y=i.init(E,_)))}function S(e,t){const r=P();D(),M(c({startIndex:r},e),t),l.emit("reInit")}function D(){v.dragHandler.destroy(),v.eventStore.clear(),v.translate.clear(),v.slideLooper.clear(),v.resizeHandler.destroy(),v.slidesHandler.destroy(),v.slidesInView.destroy(),v.animation.destroy(),i.destroy(),s.clear()}function O(e,t,r){!k.active||x||(v.scrollBody.useBaseFriction().useDuration(!0===t?0:k.duration),v.scrollTo.index(e,r||0))}function P(){return v.index.get()}const E={canScrollNext:function(){return v.index.add(1).get()!==P()},canScrollPrev:function(){return v.index.add(-1).get()!==P()},containerNode:function(){return g},internalEngine:function(){return v},destroy:function(){x||(x=!0,s.clear(),D(),l.emit("destroy"),l.clear())},off:h,on:p,emit:f,plugins:function(){return y},previousScrollSnap:function(){return v.indexPrevious.get()},reInit:m,rootNode:function(){return e},scrollNext:function(e){O(v.index.add(1).get(),e,-1)},scrollPrev:function(e){O(v.index.add(-1).get(),e,1)},scrollProgress:function(){return v.scrollProgress.get(v.offsetLocation.get())},scrollSnapList:function(){return v.scrollSnapList},scrollTo:O,selectedScrollSnap:P,slideNodes:function(){return b},slidesInView:function(){return v.slidesInView.get()},slidesNotInView:function(){return v.slidesInView.get(!1)}};return M(t,r),setTimeout(()=>l.emit("init"),0),E}function MEt(t={},r=[]){const n=e.useRef(t),o=e.useRef(r),[a,i]=e.useState(),[s,l]=e.useState(),c=e.useCallback(()=>{a&&a.reInit(n.current,o.current)},[a]);return e.useEffect(()=>{VPt(n.current,t)||(n.current=t,c())},[t,c]),e.useEffect(()=>{(function(e,t){if(e.length!==t.length)return!1;const r=HPt(e),n=HPt(t);return r.every((e,t)=>VPt(e,n[t]))})(o.current,r)||(o.current=r,c())},[r,c]),e.useEffect(()=>{if(typeof window<"u"&&window.document&&window.document.createElement&&s){CEt.globalOptions=MEt.globalOptions;const e=CEt(s,n.current,o.current);return i(e),()=>e.destroy()}i(void 0)},[s,i]),[l,a]}CEt.globalOptions=void 0,MEt.globalOptions=void 0;const SEt=s.createContext(null);function DEt(){const e=s.useContext(SEt);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}const OEt=s.forwardRef(({orientation:e="horizontal",opts:r,setApi:n,plugins:o,className:a,children:i,...l},c)=>{const[u,d]=MEt({...r,axis:"horizontal"===e?"x":"y"},o),[p,h]=s.useState(!1),[f,m]=s.useState(!1),v=s.useCallback(e=>{e&&(h(e.canScrollPrev()),m(e.canScrollNext()))},[]),y=s.useCallback(()=>{null==d||d.scrollPrev()},[d]),g=s.useCallback(()=>{null==d||d.scrollNext()},[d]),b=s.useCallback(e=>{"ArrowLeft"===e.key?(e.preventDefault(),y()):"ArrowRight"===e.key&&(e.preventDefault(),g())},[y,g]);return s.useEffect(()=>{!d||!n||n(d)},[d,n]),s.useEffect(()=>{if(d)return v(d),d.on("reInit",v),d.on("select",v),()=>{null==d||d.off("select",v)}},[d,v]),t.jsx(SEt.Provider,{value:{carouselRef:u,api:d,opts:r,orientation:e||("y"===(null==r?void 0:r.axis)?"vertical":"horizontal"),scrollPrev:y,scrollNext:g,canScrollPrev:p,canScrollNext:f},children:t.jsx("div",{ref:c,onKeyDownCapture:b,className:vdt("relative",a),role:"region","aria-roledescription":"carousel",...l,children:i})})});OEt.displayName="Carousel";const PEt=s.forwardRef(({className:e,...r},n)=>{const{carouselRef:o,orientation:a}=DEt();return t.jsx("div",{ref:o,className:"overflow-hidden",children:t.jsx("div",{ref:n,className:vdt("flex","horizontal"===a?"-ml-4":"-mt-4 flex-col",e),...r})})});PEt.displayName="CarouselContent";const EEt=s.forwardRef(({className:e,...r},n)=>{const{orientation:o}=DEt();return t.jsx("div",{ref:n,role:"group","aria-roledescription":"slide",className:vdt("min-w-0 shrink-0 grow-0 basis-full","horizontal"===o?"pl-4":"pt-4",e),...r})});EEt.displayName="CarouselItem";const jEt=s.forwardRef(({className:e,variant:r="outline",size:n="icon",...o},a)=>{const{orientation:i,scrollPrev:s,canScrollPrev:l}=DEt();return t.jsxs(Edt,{ref:a,variant:r,size:n,className:vdt("absolute h-8 w-8 rounded-full","horizontal"===i?"-left-12 top-1/2 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!l,onClick:s,...o,children:[t.jsx(gst,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Previous slide"})]})});jEt.displayName="CarouselPrevious";const TEt=s.forwardRef(({className:e,variant:r="outline",size:n="icon",...o},a)=>{const{orientation:i,scrollNext:s,canScrollNext:l}=DEt();return t.jsxs(Edt,{ref:a,variant:r,size:n,className:vdt("absolute h-8 w-8 rounded-full","horizontal"===i?"-right-12 top-1/2 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!l,onClick:s,...o,children:[t.jsx(bst,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Next slide"})]})});TEt.displayName="CarouselNext";const NEt=({form:e,translations:r})=>{const n=[{label:r.timePresetAllDay,start:"00:00",end:"23:59"},{label:r.timePresetEarlyMorning,start:"06:00",end:"09:00"},{label:r.timePresetMorning,start:"09:00",end:"12:00"},{label:r.timePresetLunch,start:"12:00",end:"13:00"},{label:r.timePresetEarlyAfternoon,start:"13:00",end:"15:00"},{label:r.timePresetLateAfternoon,start:"15:00",end:"17:00"},{label:r.timePresetEvening,start:"17:00",end:"20:00"},{label:r.timePresetNight,start:"20:00",end:"23:00"}];return t.jsx("div",{className:"pt-2 pb-1",children:t.jsxs(OEt,{className:"w-full max-w-xs mx-auto sm:px-0",children:[t.jsx(PEt,{className:"",children:n.map(r=>t.jsx(EEt,{className:"basis-1/3",children:t.jsx(xDt.div,{whileHover:{scale:1},whileTap:{scale:.95},children:t.jsx(Edt,{type:"button",variant:"outline",size:"sm",onClick:()=>(t=>{e.setValue("startTime",GDt(t.start)),e.setValue("endTime",GDt(t.end))})(r),className:vdt("w-full text-xs h-5 mx-auto flex",e.watch("startTime")===r.start&&e.watch("endTime")===r.end?"bg-primary text-primary-foreground":""),children:t.jsx("span",{className:"text-[10px] sm:text-xs",children:r.label})})})},r.label))}),t.jsx(jEt,{className:"flex",type:"button"}),t.jsx(TEt,{className:"flex",type:"button"})]})})};var REt,FEt;!function(e){e.assertEqual=e=>{},e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const r of e)t[r]=r;return t},e.getValidEnumValues=t=>{const r=e.objectKeys(t).filter(e=>"number"!=typeof t[t[e]]),n={};for(const e of r)n[e]=t[e];return e.objectValues(n)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},e.find=(e,t)=>{for(const r of e)if(t(r))return r},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(REt||(REt={})),(FEt||(FEt={})).mergeShapes=(e,t)=>({...e,...t});const zEt=REt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),IEt=e=>{switch(typeof e){case"undefined":return zEt.undefined;case"string":return zEt.string;case"number":return Number.isNaN(e)?zEt.nan:zEt.number;case"boolean":return zEt.boolean;case"function":return zEt.function;case"bigint":return zEt.bigint;case"symbol":return zEt.symbol;case"object":return Array.isArray(e)?zEt.array:null===e?zEt.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?zEt.promise:typeof Map<"u"&&e instanceof Map?zEt.map:typeof Set<"u"&&e instanceof Set?zEt.set:typeof Date<"u"&&e instanceof Date?zEt.date:zEt.object;default:return zEt.unknown}},AEt=REt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class LEt extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},r={_errors:[]},n=e=>{for(const o of e.issues)if("invalid_union"===o.code)o.unionErrors.map(n);else if("invalid_return_type"===o.code)n(o.returnTypeError);else if("invalid_arguments"===o.code)n(o.argumentsError);else if(0===o.path.length)r._errors.push(t(o));else{let e=r,n=0;for(;n<o.path.length;){const r=o.path[n];n===o.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(t(o))):e[r]=e[r]||{_errors:[]},e=e[r],n++}}};return n(this),r}static assert(e){if(!(e instanceof LEt))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,REt.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},r=[];for(const n of this.issues)if(n.path.length>0){const r=n.path[0];t[r]=t[r]||[],t[r].push(e(n))}else r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}LEt.create=e=>new LEt(e);const BEt=(e,t)=>{let r;switch(e.code){case AEt.invalid_type:r=e.received===zEt.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case AEt.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,REt.jsonStringifyReplacer)}`;break;case AEt.unrecognized_keys:r=`Unrecognized key(s) in object: ${REt.joinValues(e.keys,", ")}`;break;case AEt.invalid_union:r="Invalid input";break;case AEt.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${REt.joinValues(e.options)}`;break;case AEt.invalid_enum_value:r=`Invalid enum value. Expected ${REt.joinValues(e.options)}, received '${e.received}'`;break;case AEt.invalid_arguments:r="Invalid function arguments";break;case AEt.invalid_return_type:r="Invalid function return type";break;case AEt.invalid_date:r="Invalid date";break;case AEt.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:REt.assertNever(e.validation):r="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case AEt.too_small:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type||"bigint"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case AEt.too_big:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case AEt.custom:r="Invalid input";break;case AEt.invalid_intersection_types:r="Intersection results could not be merged";break;case AEt.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case AEt.not_finite:r="Number must be finite";break;default:r=t.defaultError,REt.assertNever(e)}return{message:r}};let VEt=BEt;function HEt(e,t){const r=VEt,n=(e=>{const{data:t,path:r,errorMaps:n,issueData:o}=e,a=[...r,...o.path||[]],i={...o,path:a};if(void 0!==o.message)return{...o,path:a,message:o.message};let s="";const l=n.filter(e=>!!e).slice().reverse();for(const e of l)s=e(i,{data:t,defaultError:s}).message;return{...o,path:a,message:s}})({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===BEt?void 0:BEt].filter(e=>!!e)});e.common.issues.push(n)}class qEt{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const n of t){if("aborted"===n.status)return $Et;"dirty"===n.status&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const e of t){const t=await e.key,n=await e.value;r.push({key:t,value:n})}return qEt.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const n of t){const{key:t,value:o}=n;if("aborted"===t.status||"aborted"===o.status)return $Et;"dirty"===t.status&&e.dirty(),"dirty"===o.status&&e.dirty(),"__proto__"!==t.value&&(typeof o.value<"u"||n.alwaysSet)&&(r[t.value]=o.value)}return{status:e.value,value:r}}}const $Et=Object.freeze({status:"aborted"}),WEt=e=>({status:"dirty",value:e}),UEt=e=>({status:"valid",value:e}),GEt=e=>"aborted"===e.status,KEt=e=>"dirty"===e.status,YEt=e=>"valid"===e.status,XEt=e=>typeof Promise<"u"&&e instanceof Promise;var ZEt;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(ZEt||(ZEt={}));class QEt{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const JEt=(e,t)=>{if(YEt(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new LEt(e.common.issues);return this._error=t,this._error}}};function ejt(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:o}=e;if(t&&(r||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:o}:{errorMap:(t,o)=>{const{message:a}=e;return"invalid_enum_value"===t.code?{message:a??o.defaultError}:typeof o.data>"u"?{message:a??n??o.defaultError}:"invalid_type"!==t.code?{message:o.defaultError}:{message:a??r??o.defaultError}},description:o}}class tjt{get description(){return this._def.description}_getType(e){return IEt(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:IEt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new qEt,ctx:{common:e.parent.common,data:e.data,parsedType:IEt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(XEt(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){const r={common:{issues:[],async:(null==t?void 0:t.async)??!1,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:IEt(e)},n=this._parseSync({data:e,path:r.path,parent:r});return JEt(r,n)}"~validate"(e){var t,r;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:IEt(e)};if(!this["~standard"].async)try{const t=this._parseSync({data:e,path:[],parent:n});return YEt(t)?{value:t.value}:{issues:n.common.issues}}catch(e){null!=(r=null==(t=null==e?void 0:e.message)?void 0:t.toLowerCase())&&r.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(e=>YEt(e)?{value:e.value}:{issues:n.common.issues})}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:IEt(e)},n=this._parse({data:e,path:r.path,parent:r}),o=await(XEt(n)?n:Promise.resolve(n));return JEt(r,o)}refine(e,t){const r=e=>"string"==typeof t||typeof t>"u"?{message:t}:"function"==typeof t?t(e):t;return this._refinement((t,n)=>{const o=e(t),a=()=>n.addIssue({code:AEt.custom,...r(t)});return typeof Promise<"u"&&o instanceof Promise?o.then(e=>!!e||(a(),!1)):!!o||(a(),!1)})}refinement(e,t){return this._refinement((r,n)=>!!e(r)||(n.addIssue("function"==typeof t?t(r,n):t),!1))}_refinement(e){return new Jjt({schema:this,typeName:lTt.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return eTt.create(this,this._def)}nullable(){return tTt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ajt.create(this)}promise(){return Qjt.create(this,this._def)}or(e){return Vjt.create([this,e],this._def)}and(e){return qjt.create(this,e,this._def)}transform(e){return new Jjt({...ejt(this._def),schema:this,typeName:lTt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new rTt({...ejt(this._def),innerType:this,defaultValue:t,typeName:lTt.ZodDefault})}brand(){return new aTt({typeName:lTt.ZodBranded,type:this,...ejt(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new nTt({...ejt(this._def),innerType:this,catchValue:t,typeName:lTt.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return iTt.create(this,e)}readonly(){return sTt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const rjt=/^c[^\s-]{8,}$/i,njt=/^[0-9a-z]+$/,ojt=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ajt=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,ijt=/^[a-z0-9_-]{21}$/i,sjt=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,ljt=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,cjt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let ujt;const djt=/^(?:(?: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])$/,pjt=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,hjt=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,fjt=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,mjt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,vjt=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,yjt="((\\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])))",gjt=new RegExp(`^${yjt}$`);function bjt(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`);return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function xjt(e){return new RegExp(`^${bjt(e)}$`)}function wjt(e){let t=`${yjt}T${bjt(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function kjt(e,t){return!(("v4"!==t&&t||!djt.test(e))&&("v6"!==t&&t||!hjt.test(e)))}function _jt(e,t){if(!sjt.test(e))return!1;try{const[r]=e.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return!("object"!=typeof o||null===o||"typ"in o&&"JWT"!==(null==o?void 0:o.typ)||!o.alg||t&&o.alg!==t)}catch{return!1}}function Cjt(e,t){return!(("v4"!==t&&t||!pjt.test(e))&&("v6"!==t&&t||!fjt.test(e)))}class Mjt extends tjt{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==zEt.string){const t=this._getOrReturnCtx(e);return HEt(t,{code:AEt.invalid_type,expected:zEt.string,received:t.parsedType}),$Et}const t=new qEt;let r;for(const n of this._def.checks)if("min"===n.kind)e.data.length<n.value&&(r=this._getOrReturnCtx(e,r),HEt(r,{code:AEt.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if("max"===n.kind)e.data.length>n.value&&(r=this._getOrReturnCtx(e,r),HEt(r,{code:AEt.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if("length"===n.kind){const o=e.data.length>n.value,a=e.data.length<n.value;(o||a)&&(r=this._getOrReturnCtx(e,r),o?HEt(r,{code:AEt.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):a&&HEt(r,{code:AEt.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),t.dirty())}else if("email"===n.kind)cjt.test(e.data)||(r=this._getOrReturnCtx(e,r),HEt(r,{validation:"email",code:AEt.invalid_string,message:n.message}),t.dirty());else if("emoji"===n.kind)ujt||(ujt=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),ujt.test(e.data)||(r=this._getOrReturnCtx(e,r),HEt(r,{validation:"emoji",code:AEt.invalid_string,message:n.message}),t.dirty());else if("uuid"===n.kind)ajt.test(e.data)||(r=this._getOrReturnCtx(e,r),HEt(r,{validation:"uuid",code:AEt.invalid_string,message:n.message}),t.dirty());else if("nanoid"===n.kind)ijt.test(e.data)||(r=this._getOrReturnCtx(e,r),HEt(r,{validation:"nanoid",code:AEt.invalid_string,message:n.message}),t.dirty());else if("cuid"===n.kind)rjt.test(e.data)||(r=this._getOrReturnCtx(e,r),HEt(r,{validation:"cuid",code:AEt.invalid_string,message:n.message}),t.dirty());else if("cuid2"===n.kind)njt.test(e.data)||(r=this._getOrReturnCtx(e,r),HEt(r,{validation:"cuid2",code:AEt.invalid_string,message:n.message}),t.dirty());else if("ulid"===n.kind)ojt.test(e.data)||(r=this._getOrReturnCtx(e,r),HEt(r,{validation:"ulid",code:AEt.invalid_string,message:n.message}),t.dirty());else if("url"===n.kind)try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),HEt(r,{validation:"url",code:AEt.invalid_string,message:n.message}),t.dirty()}else"regex"===n.kind?(n.regex.lastIndex=0,n.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),HEt(r,{validation:"regex",code:AEt.invalid_string,message:n.message}),t.dirty())):"trim"===n.kind?e.data=e.data.trim():"includes"===n.kind?e.data.includes(n.value,n.position)||(r=this._getOrReturnCtx(e,r),HEt(r,{code:AEt.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),t.dirty()):"toLowerCase"===n.kind?e.data=e.data.toLowerCase():"toUpperCase"===n.kind?e.data=e.data.toUpperCase():"startsWith"===n.kind?e.data.startsWith(n.value)||(r=this._getOrReturnCtx(e,r),HEt(r,{code:AEt.invalid_string,validation:{startsWith:n.value},message:n.message}),t.dirty()):"endsWith"===n.kind?e.data.endsWith(n.value)||(r=this._getOrReturnCtx(e,r),HEt(r,{code:AEt.invalid_string,validation:{endsWith:n.value},message:n.message}),t.dirty()):"datetime"===n.kind?wjt(n).test(e.data)||(r=this._getOrReturnCtx(e,r),HEt(r,{code:AEt.invalid_string,validation:"datetime",message:n.message}),t.dirty()):"date"===n.kind?gjt.test(e.data)||(r=this._getOrReturnCtx(e,r),HEt(r,{code:AEt.invalid_string,validation:"date",message:n.message}),t.dirty()):"time"===n.kind?xjt(n).test(e.data)||(r=this._getOrReturnCtx(e,r),HEt(r,{code:AEt.invalid_string,validation:"time",message:n.message}),t.dirty()):"duration"===n.kind?ljt.test(e.data)||(r=this._getOrReturnCtx(e,r),HEt(r,{validation:"duration",code:AEt.invalid_string,message:n.message}),t.dirty()):"ip"===n.kind?kjt(e.data,n.version)||(r=this._getOrReturnCtx(e,r),HEt(r,{validation:"ip",code:AEt.invalid_string,message:n.message}),t.dirty()):"jwt"===n.kind?_jt(e.data,n.alg)||(r=this._getOrReturnCtx(e,r),HEt(r,{validation:"jwt",code:AEt.invalid_string,message:n.message}),t.dirty()):"cidr"===n.kind?Cjt(e.data,n.version)||(r=this._getOrReturnCtx(e,r),HEt(r,{validation:"cidr",code:AEt.invalid_string,message:n.message}),t.dirty()):"base64"===n.kind?mjt.test(e.data)||(r=this._getOrReturnCtx(e,r),HEt(r,{validation:"base64",code:AEt.invalid_string,message:n.message}),t.dirty()):"base64url"===n.kind?vjt.test(e.data)||(r=this._getOrReturnCtx(e,r),HEt(r,{validation:"base64url",code:AEt.invalid_string,message:n.message}),t.dirty()):REt.assertNever(n);return{status:t.value,value:e.data}}_regex(e,t,r){return this.refinement(t=>e.test(t),{validation:t,code:AEt.invalid_string,...ZEt.errToObj(r)})}_addCheck(e){return new Mjt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ZEt.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ZEt.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ZEt.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ZEt.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...ZEt.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ZEt.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ZEt.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ZEt.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...ZEt.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...ZEt.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...ZEt.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ZEt.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...ZEt.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(null==e?void 0:e.precision)>"u"?null:null==e?void 0:e.precision,offset:(null==e?void 0:e.offset)??!1,local:(null==e?void 0:e.local)??!1,...ZEt.errToObj(null==e?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(null==e?void 0:e.precision)>"u"?null:null==e?void 0:e.precision,...ZEt.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...ZEt.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...ZEt.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...ZEt.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...ZEt.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...ZEt.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...ZEt.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...ZEt.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...ZEt.errToObj(t)})}nonempty(e){return this.min(1,ZEt.errToObj(e))}trim(){return new Mjt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Mjt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Mjt({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isCIDR(){return!!this._def.checks.find(e=>"cidr"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get isBase64url(){return!!this._def.checks.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function Sjt(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n;return Number.parseInt(e.toFixed(o).replace(".",""))%Number.parseInt(t.toFixed(o).replace(".",""))/10**o}Mjt.create=e=>new Mjt({checks:[],typeName:lTt.ZodString,coerce:(null==e?void 0:e.coerce)??!1,...ejt(e)});class Djt extends tjt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==zEt.number){const t=this._getOrReturnCtx(e);return HEt(t,{code:AEt.invalid_type,expected:zEt.number,received:t.parsedType}),$Et}let t;const r=new qEt;for(const n of this._def.checks)"int"===n.kind?REt.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),HEt(t,{code:AEt.invalid_type,expected:"integer",received:"float",message:n.message}),r.dirty()):"min"===n.kind?(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),HEt(t,{code:AEt.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty()):"max"===n.kind?(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),HEt(t,{code:AEt.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty()):"multipleOf"===n.kind?0!==Sjt(e.data,n.value)&&(t=this._getOrReturnCtx(e,t),HEt(t,{code:AEt.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):"finite"===n.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),HEt(t,{code:AEt.not_finite,message:n.message}),r.dirty()):REt.assertNever(n);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,ZEt.toString(t))}gt(e,t){return this.setLimit("min",e,!1,ZEt.toString(t))}lte(e,t){return this.setLimit("max",e,!0,ZEt.toString(t))}lt(e,t){return this.setLimit("max",e,!1,ZEt.toString(t))}setLimit(e,t,r,n){return new Djt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:ZEt.toString(n)}]})}_addCheck(e){return new Djt({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ZEt.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ZEt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ZEt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ZEt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ZEt.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:ZEt.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:ZEt.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ZEt.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ZEt.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>"int"===e.kind||"multipleOf"===e.kind&&REt.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}Djt.create=e=>new Djt({checks:[],typeName:lTt.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...ejt(e)});class Ojt extends tjt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==zEt.bigint)return this._getInvalidInput(e);let t;const r=new qEt;for(const n of this._def.checks)"min"===n.kind?(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),HEt(t,{code:AEt.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty()):"max"===n.kind?(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),HEt(t,{code:AEt.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty()):"multipleOf"===n.kind?e.data%n.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),HEt(t,{code:AEt.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):REt.assertNever(n);return{status:r.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return HEt(t,{code:AEt.invalid_type,expected:zEt.bigint,received:t.parsedType}),$Et}gte(e,t){return this.setLimit("min",e,!0,ZEt.toString(t))}gt(e,t){return this.setLimit("min",e,!1,ZEt.toString(t))}lte(e,t){return this.setLimit("max",e,!0,ZEt.toString(t))}lt(e,t){return this.setLimit("max",e,!1,ZEt.toString(t))}setLimit(e,t,r,n){return new Ojt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:ZEt.toString(n)}]})}_addCheck(e){return new Ojt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ZEt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ZEt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ZEt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ZEt.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:ZEt.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}Ojt.create=e=>new Ojt({checks:[],typeName:lTt.ZodBigInt,coerce:(null==e?void 0:e.coerce)??!1,...ejt(e)});class Pjt extends tjt{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==zEt.boolean){const t=this._getOrReturnCtx(e);return HEt(t,{code:AEt.invalid_type,expected:zEt.boolean,received:t.parsedType}),$Et}return UEt(e.data)}}Pjt.create=e=>new Pjt({typeName:lTt.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...ejt(e)});class Ejt extends tjt{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==zEt.date){const t=this._getOrReturnCtx(e);return HEt(t,{code:AEt.invalid_type,expected:zEt.date,received:t.parsedType}),$Et}if(Number.isNaN(e.data.getTime())){return HEt(this._getOrReturnCtx(e),{code:AEt.invalid_date}),$Et}const t=new qEt;let r;for(const n of this._def.checks)"min"===n.kind?e.data.getTime()<n.value&&(r=this._getOrReturnCtx(e,r),HEt(r,{code:AEt.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),t.dirty()):"max"===n.kind?e.data.getTime()>n.value&&(r=this._getOrReturnCtx(e,r),HEt(r,{code:AEt.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),t.dirty()):REt.assertNever(n);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Ejt({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:ZEt.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:ZEt.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}Ejt.create=e=>new Ejt({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:lTt.ZodDate,...ejt(e)});class jjt extends tjt{_parse(e){if(this._getType(e)!==zEt.symbol){const t=this._getOrReturnCtx(e);return HEt(t,{code:AEt.invalid_type,expected:zEt.symbol,received:t.parsedType}),$Et}return UEt(e.data)}}jjt.create=e=>new jjt({typeName:lTt.ZodSymbol,...ejt(e)});class Tjt extends tjt{_parse(e){if(this._getType(e)!==zEt.undefined){const t=this._getOrReturnCtx(e);return HEt(t,{code:AEt.invalid_type,expected:zEt.undefined,received:t.parsedType}),$Et}return UEt(e.data)}}Tjt.create=e=>new Tjt({typeName:lTt.ZodUndefined,...ejt(e)});class Njt extends tjt{_parse(e){if(this._getType(e)!==zEt.null){const t=this._getOrReturnCtx(e);return HEt(t,{code:AEt.invalid_type,expected:zEt.null,received:t.parsedType}),$Et}return UEt(e.data)}}Njt.create=e=>new Njt({typeName:lTt.ZodNull,...ejt(e)});class Rjt extends tjt{constructor(){super(...arguments),this._any=!0}_parse(e){return UEt(e.data)}}Rjt.create=e=>new Rjt({typeName:lTt.ZodAny,...ejt(e)});class Fjt extends tjt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return UEt(e.data)}}Fjt.create=e=>new Fjt({typeName:lTt.ZodUnknown,...ejt(e)});class zjt extends tjt{_parse(e){const t=this._getOrReturnCtx(e);return HEt(t,{code:AEt.invalid_type,expected:zEt.never,received:t.parsedType}),$Et}}zjt.create=e=>new zjt({typeName:lTt.ZodNever,...ejt(e)});class Ijt extends tjt{_parse(e){if(this._getType(e)!==zEt.undefined){const t=this._getOrReturnCtx(e);return HEt(t,{code:AEt.invalid_type,expected:zEt.void,received:t.parsedType}),$Et}return UEt(e.data)}}Ijt.create=e=>new Ijt({typeName:lTt.ZodVoid,...ejt(e)});class Ajt extends tjt{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==zEt.array)return HEt(t,{code:AEt.invalid_type,expected:zEt.array,received:t.parsedType}),$Et;if(null!==n.exactLength){const e=t.data.length>n.exactLength.value,o=t.data.length<n.exactLength.value;(e||o)&&(HEt(t,{code:e?AEt.too_big:AEt.too_small,minimum:o?n.exactLength.value:void 0,maximum:e?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),r.dirty())}if(null!==n.minLength&&t.data.length<n.minLength.value&&(HEt(t,{code:AEt.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),r.dirty()),null!==n.maxLength&&t.data.length>n.maxLength.value&&(HEt(t,{code:AEt.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((e,r)=>n.type._parseAsync(new QEt(t,e,t.path,r)))).then(e=>qEt.mergeArray(r,e));const o=[...t.data].map((e,r)=>n.type._parseSync(new QEt(t,e,t.path,r)));return qEt.mergeArray(r,o)}get element(){return this._def.type}min(e,t){return new Ajt({...this._def,minLength:{value:e,message:ZEt.toString(t)}})}max(e,t){return new Ajt({...this._def,maxLength:{value:e,message:ZEt.toString(t)}})}length(e,t){return new Ajt({...this._def,exactLength:{value:e,message:ZEt.toString(t)}})}nonempty(e){return this.min(1,e)}}function Ljt(e){if(e instanceof Bjt){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=eTt.create(Ljt(n))}return new Bjt({...e._def,shape:()=>t})}return e instanceof Ajt?new Ajt({...e._def,type:Ljt(e.element)}):e instanceof eTt?eTt.create(Ljt(e.unwrap())):e instanceof tTt?tTt.create(Ljt(e.unwrap())):e instanceof $jt?$jt.create(e.items.map(e=>Ljt(e))):e}Ajt.create=(e,t)=>new Ajt({type:e,minLength:null,maxLength:null,exactLength:null,typeName:lTt.ZodArray,...ejt(t)});class Bjt extends tjt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=REt.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==zEt.object){const t=this._getOrReturnCtx(e);return HEt(t,{code:AEt.invalid_type,expected:zEt.object,received:t.parsedType}),$Et}const{status:t,ctx:r}=this._processInputParams(e),{shape:n,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof zjt&&"strip"===this._def.unknownKeys))for(const e in r.data)o.includes(e)||a.push(e);const i=[];for(const e of o){const t=n[e],o=r.data[e];i.push({key:{status:"valid",value:e},value:t._parse(new QEt(r,o,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof zjt){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of a)i.push({key:{status:"valid",value:e},value:{status:"valid",value:r.data[e]}});else if("strict"===e)a.length>0&&(HEt(r,{code:AEt.unrecognized_keys,keys:a}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of a){const n=r.data[t];i.push({key:{status:"valid",value:t},value:e._parse(new QEt(r,n,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const e=[];for(const t of i){const r=await t.key,n=await t.value;e.push({key:r,value:n,alwaysSet:t.alwaysSet})}return e}).then(e=>qEt.mergeObjectSync(t,e)):qEt.mergeObjectSync(t,i)}get shape(){return this._def.shape()}strict(e){return ZEt.errToObj,new Bjt({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{var n,o;const a=(null==(o=(n=this._def).errorMap)?void 0:o.call(n,t,r).message)??r.defaultError;return"unrecognized_keys"===t.code?{message:ZEt.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new Bjt({...this._def,unknownKeys:"strip"})}passthrough(){return new Bjt({...this._def,unknownKeys:"passthrough"})}extend(e){return new Bjt({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Bjt({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:lTt.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Bjt({...this._def,catchall:e})}pick(e){const t={};for(const r of REt.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new Bjt({...this._def,shape:()=>t})}omit(e){const t={};for(const r of REt.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new Bjt({...this._def,shape:()=>t})}deepPartial(){return Ljt(this)}partial(e){const t={};for(const r of REt.objectKeys(this.shape)){const n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()}return new Bjt({...this._def,shape:()=>t})}required(e){const t={};for(const r of REt.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let e=this.shape[r];for(;e instanceof eTt;)e=e._def.innerType;t[r]=e}return new Bjt({...this._def,shape:()=>t})}keyof(){return Yjt(REt.objectKeys(this.shape))}}Bjt.create=(e,t)=>new Bjt({shape:()=>e,unknownKeys:"strip",catchall:zjt.create(),typeName:lTt.ZodObject,...ejt(t)}),Bjt.strictCreate=(e,t)=>new Bjt({shape:()=>e,unknownKeys:"strict",catchall:zjt.create(),typeName:lTt.ZodObject,...ejt(t)}),Bjt.lazycreate=(e,t)=>new Bjt({shape:e,unknownKeys:"strip",catchall:zjt.create(),typeName:lTt.ZodObject,...ejt(t)});class Vjt extends tjt{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map(async e=>{const r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}})).then(function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;const r=e.map(e=>new LEt(e.ctx.common.issues));return HEt(t,{code:AEt.invalid_union,unionErrors:r}),$Et});{let e;const n=[];for(const o of r){const r={...t,common:{...t.common,issues:[]},parent:null},a=o._parseSync({data:t.data,path:t.path,parent:r});if("valid"===a.status)return a;"dirty"===a.status&&!e&&(e={result:a,ctx:r}),r.common.issues.length&&n.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const o=n.map(e=>new LEt(e));return HEt(t,{code:AEt.invalid_union,unionErrors:o}),$Et}}get options(){return this._def.options}}function Hjt(e,t){const r=IEt(e),n=IEt(t);if(e===t)return{valid:!0,data:e};if(r===zEt.object&&n===zEt.object){const r=REt.objectKeys(t),n=REt.objectKeys(e).filter(e=>-1!==r.indexOf(e)),o={...e,...t};for(const r of n){const n=Hjt(e[r],t[r]);if(!n.valid)return{valid:!1};o[r]=n.data}return{valid:!0,data:o}}if(r===zEt.array&&n===zEt.array){if(e.length!==t.length)return{valid:!1};const r=[];for(let n=0;n<e.length;n++){const o=Hjt(e[n],t[n]);if(!o.valid)return{valid:!1};r.push(o.data)}return{valid:!0,data:r}}return r===zEt.date&&n===zEt.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}Vjt.create=(e,t)=>new Vjt({options:e,typeName:lTt.ZodUnion,...ejt(t)});class qjt extends tjt{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=(e,n)=>{if(GEt(e)||GEt(n))return $Et;const o=Hjt(e.value,n.value);return o.valid?((KEt(e)||KEt(n))&&t.dirty(),{status:t.value,value:o.data}):(HEt(r,{code:AEt.invalid_intersection_types}),$Et)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([e,t])=>n(e,t)):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}qjt.create=(e,t,r)=>new qjt({left:e,right:t,typeName:lTt.ZodIntersection,...ejt(r)});class $jt extends tjt{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==zEt.array)return HEt(r,{code:AEt.invalid_type,expected:zEt.array,received:r.parsedType}),$Et;if(r.data.length<this._def.items.length)return HEt(r,{code:AEt.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),$Et;!this._def.rest&&r.data.length>this._def.items.length&&(HEt(r,{code:AEt.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const n=[...r.data].map((e,t)=>{const n=this._def.items[t]||this._def.rest;return n?n._parse(new QEt(r,e,r.path,t)):null}).filter(e=>!!e);return r.common.async?Promise.all(n).then(e=>qEt.mergeArray(t,e)):qEt.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new $jt({...this._def,rest:e})}}$jt.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new $jt({items:e,typeName:lTt.ZodTuple,rest:null,...ejt(t)})};class Wjt extends tjt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==zEt.map)return HEt(r,{code:AEt.invalid_type,expected:zEt.map,received:r.parsedType}),$Et;const n=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([e,t],a)=>({key:n._parse(new QEt(r,e,r.path,[a,"key"])),value:o._parse(new QEt(r,t,r.path,[a,"value"]))}));if(r.common.async){const e=new Map;return Promise.resolve().then(async()=>{for(const r of a){const n=await r.key,o=await r.value;if("aborted"===n.status||"aborted"===o.status)return $Et;("dirty"===n.status||"dirty"===o.status)&&t.dirty(),e.set(n.value,o.value)}return{status:t.value,value:e}})}{const e=new Map;for(const r of a){const n=r.key,o=r.value;if("aborted"===n.status||"aborted"===o.status)return $Et;("dirty"===n.status||"dirty"===o.status)&&t.dirty(),e.set(n.value,o.value)}return{status:t.value,value:e}}}}Wjt.create=(e,t,r)=>new Wjt({valueType:t,keyType:e,typeName:lTt.ZodMap,...ejt(r)});class Ujt extends tjt{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==zEt.set)return HEt(r,{code:AEt.invalid_type,expected:zEt.set,received:r.parsedType}),$Et;const n=this._def;null!==n.minSize&&r.data.size<n.minSize.value&&(HEt(r,{code:AEt.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),null!==n.maxSize&&r.data.size>n.maxSize.value&&(HEt(r,{code:AEt.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const o=this._def.valueType;function a(e){const r=new Set;for(const n of e){if("aborted"===n.status)return $Et;"dirty"===n.status&&t.dirty(),r.add(n.value)}return{status:t.value,value:r}}const i=[...r.data.values()].map((e,t)=>o._parse(new QEt(r,e,r.path,t)));return r.common.async?Promise.all(i).then(e=>a(e)):a(i)}min(e,t){return new Ujt({...this._def,minSize:{value:e,message:ZEt.toString(t)}})}max(e,t){return new Ujt({...this._def,maxSize:{value:e,message:ZEt.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Ujt.create=(e,t)=>new Ujt({valueType:e,minSize:null,maxSize:null,typeName:lTt.ZodSet,...ejt(t)});class Gjt extends tjt{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Gjt.create=(e,t)=>new Gjt({getter:e,typeName:lTt.ZodLazy,...ejt(t)});class Kjt extends tjt{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return HEt(t,{received:t.data,code:AEt.invalid_literal,expected:this._def.value}),$Et}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Yjt(e,t){return new Xjt({values:e,typeName:lTt.ZodEnum,...ejt(t)})}Kjt.create=(e,t)=>new Kjt({value:e,typeName:lTt.ZodLiteral,...ejt(t)});class Xjt extends tjt{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),r=this._def.values;return HEt(t,{expected:REt.joinValues(r),received:t.parsedType,code:AEt.invalid_type}),$Et}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return HEt(t,{received:t.data,code:AEt.invalid_enum_value,options:r}),$Et}return UEt(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Xjt.create(e,{...this._def,...t})}exclude(e,t=this._def){return Xjt.create(this.options.filter(t=>!e.includes(t)),{...this._def,...t})}}Xjt.create=Yjt;class Zjt extends tjt{_parse(e){const t=REt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==zEt.string&&r.parsedType!==zEt.number){const e=REt.objectValues(t);return HEt(r,{expected:REt.joinValues(e),received:r.parsedType,code:AEt.invalid_type}),$Et}if(this._cache||(this._cache=new Set(REt.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const e=REt.objectValues(t);return HEt(r,{received:r.data,code:AEt.invalid_enum_value,options:e}),$Et}return UEt(e.data)}get enum(){return this._def.values}}Zjt.create=(e,t)=>new Zjt({values:e,typeName:lTt.ZodNativeEnum,...ejt(t)});class Qjt extends tjt{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==zEt.promise&&!1===t.common.async)return HEt(t,{code:AEt.invalid_type,expected:zEt.promise,received:t.parsedType}),$Et;const r=t.parsedType===zEt.promise?t.data:Promise.resolve(t.data);return UEt(r.then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Qjt.create=(e,t)=>new Qjt({type:e,typeName:lTt.ZodPromise,...ejt(t)});class Jjt extends tjt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===lTt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,o={addIssue:e=>{HEt(r,e),e.fatal?t.abort():t.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),"preprocess"===n.type){const e=n.transform(r.data,o);if(r.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return $Et;const n=await this._def.schema._parseAsync({data:e,path:r.path,parent:r});return"aborted"===n.status?$Et:"dirty"===n.status||"dirty"===t.value?WEt(n.value):n});{if("aborted"===t.value)return $Et;const n=this._def.schema._parseSync({data:e,path:r.path,parent:r});return"aborted"===n.status?$Et:"dirty"===n.status||"dirty"===t.value?WEt(n.value):n}}if("refinement"===n.type){const e=e=>{const t=n.refinement(e,o);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===r.common.async){const n=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===n.status?$Et:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(r=>"aborted"===r.status?$Et:("dirty"===r.status&&t.dirty(),e(r.value).then(()=>({status:t.value,value:r.value}))))}if("transform"===n.type){if(!1===r.common.async){const e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!YEt(e))return $Et;const a=n.transform(e.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(e=>YEt(e)?Promise.resolve(n.transform(e.value,o)).then(e=>({status:t.value,value:e})):$Et)}REt.assertNever(n)}}Jjt.create=(e,t,r)=>new Jjt({schema:e,typeName:lTt.ZodEffects,effect:t,...ejt(r)}),Jjt.createWithPreprocess=(e,t,r)=>new Jjt({schema:t,effect:{type:"preprocess",transform:e},typeName:lTt.ZodEffects,...ejt(r)});class eTt extends tjt{_parse(e){return this._getType(e)===zEt.undefined?UEt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}eTt.create=(e,t)=>new eTt({innerType:e,typeName:lTt.ZodOptional,...ejt(t)});class tTt extends tjt{_parse(e){return this._getType(e)===zEt.null?UEt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}tTt.create=(e,t)=>new tTt({innerType:e,typeName:lTt.ZodNullable,...ejt(t)});class rTt extends tjt{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===zEt.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}rTt.create=(e,t)=>new rTt({innerType:e,typeName:lTt.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...ejt(t)});class nTt extends tjt{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return XEt(n)?n.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new LEt(r.common.issues)},input:r.data})})):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new LEt(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}nTt.create=(e,t)=>new nTt({innerType:e,typeName:lTt.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...ejt(t)});class oTt extends tjt{_parse(e){if(this._getType(e)!==zEt.nan){const t=this._getOrReturnCtx(e);return HEt(t,{code:AEt.invalid_type,expected:zEt.nan,received:t.parsedType}),$Et}return{status:"valid",value:e.data}}}oTt.create=e=>new oTt({typeName:lTt.ZodNaN,...ejt(e)});class aTt extends tjt{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class iTt extends tjt{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?$Et:"dirty"===e.status?(t.dirty(),WEt(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})();{const e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?$Et:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new iTt({in:e,out:t,typeName:lTt.ZodPipeline})}}class sTt extends tjt{_parse(e){const t=this._def.innerType._parse(e),r=e=>(YEt(e)&&(e.value=Object.freeze(e.value)),e);return XEt(t)?t.then(e=>r(e)):r(t)}unwrap(){return this._def.innerType}}var lTt;sTt.create=(e,t)=>new sTt({innerType:e,typeName:lTt.ZodReadonly,...ejt(t)}),function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(lTt||(lTt={}));const cTt=Mjt.create,uTt=Pjt.create,dTt=Ejt.create;zjt.create;const pTt=Ajt.create,hTt=Bjt.create;Vjt.create,qjt.create,$jt.create;const fTt=Xjt.create;Qjt.create,eTt.create,tTt.create;const mTt=fTt(["daily","weekly","monthly"]),vTt=e=>{const t=cTt().refine(e=>(e=>/^([0-1]?\d|2[0-3]):[0-5]\d$/.test(e))(e)||HDt(e),e.validations.invalidTimeFormat);return hTt({id:cTt().optional(),title:cTt().min(1,e.validations.eventNameRequired),description:cTt().optional(),startDate:dTt(),endDate:dTt(),startTime:t,endTime:t,color:cTt().min(1,e.validations.colorRequired),isRepeating:uTt(),isRepeatingInterval:mTt.default("daily").optional(),isRepeatingExcludedDates:pTt(dTt()).optional(),resourceId:cTt().optional(),eventType:cTt().optional(),visibility:fTt(["public","private"]).optional()}).refine(e=>{if(e.isRepeating)return WDt(e.endTime)>=WDt(e.startTime);const t=$Dt(e.startDate,e.startTime);return $Dt(e.endDate,e.endTime)>t},{message:e.validations.endTimeBeforeStart,path:["endTime"]})},yTt=({event:r,onAddEvent:n,onUpdateEvent:o,onDeleteEvent:a,onClosePopup:i,open:s,dateFromViewClick:c,translations:u,resources:d})=>{const[p,h]=e.useState(!1),[f,m]=e.useState(!1),[v,y]=e.useState(!1),[g,b]=e.useState(!1),[x,w]=e.useState(!1),[k,_]=e.useState("single"),[C,M]=e.useState("all"),[S,D]=e.useState(!1),O=function(e={}){const t=l.default.useRef(void 0),r=l.default.useRef(void 0),[n,o]=l.default.useState({isDirty:!1,isValidating:!1,isLoading:Nft(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:Nft(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!Nft(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:r,...o}=umt(e);t.current={...o,formState:n}}const a=t.current.control;return a._options=e,wft(()=>{const e=a._subscribe({formState:a._proxyFormState,callback:()=>o({...a._formState}),reRenderRoot:!0});return o(e=>({...e,isReady:!0})),a._formState.isReady=!0,e},[a]),l.default.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),l.default.useEffect(()=>{e.mode&&(a._options.mode=e.mode),e.reValidateMode&&(a._options.reValidateMode=e.reValidateMode)},[a,e.mode,e.reValidateMode]),l.default.useEffect(()=>{e.errors&&(a._setErrors(e.errors),a._focusError())},[a,e.errors]),l.default.useEffect(()=>{e.shouldUnregister&&a._subjects.state.next({values:a._getWatch()})},[a,e.shouldUnregister]),l.default.useEffect(()=>{if(a._proxyFormState.isDirty){const e=a._getDirty();e!==n.isDirty&&a._subjects.state.next({isDirty:e})}},[a,n.isDirty]),l.default.useEffect(()=>{e.values&&!Eft(e.values,r.current)?(a._reset(e.values,{keepFieldsRef:!0,...a._options.resetOptions}),r.current=e.values,o(e=>({...e}))):a._resetDefaultValues()},[a,e.values]),l.default.useEffect(()=>{a._state.mount||(a._setValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),t.current.formState=xft(n,a),t.current}({resolver:gbt(vTt(u)),defaultValues:{id:(null==r?void 0:r.id)||"",title:(null==r?void 0:r.title)||"",description:(null==r?void 0:r.description)||"",startDate:(null==r?void 0:r.startDate)||new Date,endDate:(null==r?void 0:r.endDate)||new Date,startTime:(null==r?void 0:r.startTime)||"09:00",endTime:(null==r?void 0:r.endTime)||"10:00",color:(null==r?void 0:r.color)||"blue",isRepeating:(null==r?void 0:r.isRepeating)||!1,isRepeatingInterval:(null==r?void 0:r.isRepeatingInterval)||"daily",isRepeatingExcludedDates:(null==r?void 0:r.isRepeatingExcludedDates)||[]}});if(e.useEffect(()=>{const e=O.getValues("startDate"),t=O.getValues("endDate"),r=e.toDateString()===t.toDateString();m(!r)},[O,s]),e.useEffect(()=>{O.reset({title:(null==r?void 0:r.title)||"",description:(null==r?void 0:r.description)||"",startDate:(null==r?void 0:r.startDate)||new Date,endDate:(null==r?void 0:r.endDate)||new Date,startTime:(null==r?void 0:r.startTime)||"09:00",endTime:(null==r?void 0:r.endTime)||"10:00",color:(null==r?void 0:r.color)||"blue",isRepeating:(null==r?void 0:r.isRepeating)||!1,isRepeatingInterval:(null==r?void 0:r.isRepeatingInterval)||"daily",isRepeatingExcludedDates:(null==r?void 0:r.isRepeatingExcludedDates)||[],resourceId:null==r?void 0:r.resourceId})},[O,s,r]),e.useEffect(()=>{if(d&&0!==d.length&&!O.getValues("resourceId")){const e=null==r?void 0:r.color;if(e){const t=d.find(t=>t.color===e||t.id===e);t&&O.setValue("resourceId",t.id)}}},[d,r,O]),e.useEffect(()=>{const e=O.watch((e,{name:t})=>{if("startDate"===t||"endDate"===t){const t=e.startDate,r=e.endDate;t>r&&O.setValue("endDate",t);const n=t.toDateString()===r.toDateString();m(!n),n&&O.setValue("isRepeating",!1)}});return()=>e.unsubscribe()},[O]),!u)return console.error("Translations are required for PopupContent"),null;const P=async e=>{var t;h(!0);try{if(null==r||!r.id){const t={startDate:e.startDate,endDate:e.endDate,title:e.title,startTime:e.startTime,endTime:e.endTime,description:e.description,color:e.color,resourceId:e.resourceId,isRepeating:e.isRepeating,isRepeatingInterval:e.isRepeatingInterval||"daily",isRepeatingExcludedDates:e.isRepeatingExcludedDates||[]};return void await Promise.resolve(n(t))}if(!0!==r.isRepeating){console.log("Updating non-repeating event");const t={...r,startDate:e.startDate,endDate:e.endDate,title:e.title,startTime:e.startTime,endTime:e.endTime,description:e.description,color:e.color,resourceId:e.resourceId,isRepeating:e.isRepeating,isRepeatingInterval:e.isRepeatingInterval||"daily",isRepeatingExcludedDates:e.isRepeatingExcludedDates||[]};return void(o&&await Promise.resolve(o(t)))}const a=c||r.startDate||new Date;switch(C){case"single":{const t=new Date(a.getFullYear(),a.getMonth(),a.getDate()),i=(r.isRepeatingExcludedDates||[]).map(e=>{if(e instanceof Date)return new Date(e.getFullYear(),e.getMonth(),e.getDate());try{const t=new Date(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate())}catch{return null}}).filter(e=>null!==e),s=t.toDateString();if(!i.some(e=>e.toDateString()===s)){const e={...r,isRepeatingExcludedDates:[...i,t]};o&&await Promise.resolve(o(e))}const l={title:e.title,description:e.description,startDate:t,endDate:t,startTime:e.startTime,endTime:e.endTime,color:e.color,isRepeating:!1,isRepeatingInterval:"daily",isRepeatingExcludedDates:[]};await Promise.resolve(n(l));break}case"future":if(a.toDateString()===(null==(t=r.startDate)?void 0:t.toDateString())){const t={...r,...e};o&&await Promise.resolve(o(t))}else{const t=new Date(a);t.setDate(t.getDate()-1);const i={...r,endDate:t};o&&await Promise.resolve(o(i));const s={title:e.title,description:e.description,startDate:a,endDate:e.endDate,startTime:e.startTime,endTime:e.endTime,color:e.color,isRepeating:!0,isRepeatingInterval:e.isRepeatingInterval||"daily",isRepeatingExcludedDates:e.isRepeatingExcludedDates||[]};await Promise.resolve(n(s))}break;case"all":{const t={...r,...e};o&&await Promise.resolve(o(t));break}}}catch(e){console.error("Error saving event:",e),TDt.error("Error saving event")}finally{h(!1),null==i||i()}};return t.jsxs(wdt,{className:"sm:max-w-[425px] w-full max-h-[90vh] overflow-y-auto",children:[t.jsxs(kdt,{children:[t.jsxs(Cdt,{className:"text-lg sm:text-xl flex items-center",children:[t.jsx(_st,{className:"mr-2 h-5 w-5"}),null!=r&&r.id?u.editEvent:u.addEvent]}),t.jsx(Mdt,{className:"text-sm sm:text-base",children:null!=r&&r.id?u.editEventDescription:u.createEventDescription})]}),t.jsxs(mmt,{...O,children:[t.jsx(BDt,{open:S,onClose:()=>D(!1),editType:C,onEditTypeChange:e=>M(e),onConfirm:()=>{D(!1),O.handleSubmit(P)()},translations:u}),t.jsxs("form",{onSubmit:e=>{var t,n,o,a;if(e.preventDefault(),null!=r&&r.id&&!0===r.isRepeating){const e=O.getValues(),i=(null==(t=e.startDate)?void 0:t.getTime())!==(null==(n=r.startDate)?void 0:n.getTime()),s=(null==(o=e.endDate)?void 0:o.getTime())!==(null==(a=r.endDate)?void 0:a.getTime()),l=e.isRepeating!==r.isRepeating,c=e.isRepeatingInterval!==(r.isRepeatingInterval||"daily"),u=e.isRepeatingExcludedDates||[],d=r.isRepeatingExcludedDates||[],p=JSON.stringify(u),h=JSON.stringify(d);if(!(i||s||l||c||p!==h||S||e.title===r.title&&e.description===r.description&&e.color===r.color&&e.startTime===r.startTime&&e.endTime===r.endTime))return void D(!0)}O.handleSubmit(P)(e)},className:"space-y-4",children:[t.jsx(ymt,{control:O.control,name:"title",render:({field:e})=>t.jsxs(xmt,{children:[t.jsx(wmt,{children:u.eventTitle}),t.jsx(kmt,{children:t.jsx(Mmt,{placeholder:u.eventTitle,...e,autoFocus:!r})}),t.jsx(Cmt,{})]})}),t.jsx(ymt,{control:O.control,name:"description",render:({field:e})=>t.jsxs(xmt,{children:[t.jsx(wmt,{children:u.eventDescription}),t.jsx(kmt,{children:t.jsx(pbt,{placeholder:u.eventDescription,...e})}),t.jsx(Cmt,{})]})}),t.jsx(NEt,{form:O,translations:u}),t.jsxs("div",{className:"flex space-x-4",children:[t.jsx(ymt,{control:O.control,name:"startDate",render:({field:e})=>t.jsxs(xmt,{className:"flex-1",children:[t.jsx(wmt,{children:u.eventDate}),t.jsxs(fgt,{open:v,onOpenChange:y,children:[t.jsx(mgt,{asChild:!0,children:t.jsx(kmt,{children:t.jsxs(Edt,{variant:"outline",className:"w-full justify-start text-left font-normal",children:[t.jsx(kst,{className:"mr-2 h-4 w-4"}),e.value?Vit(e.value,"PPP"):t.jsx("span",{children:u.pickADate})]})})}),t.jsx(vgt,{className:"w-auto p-0",children:t.jsx(Bht,{mode:"single",selected:e.value,onSelect:t=>{e.onChange(t),y(!1)},defaultMonth:e.value||new Date})})]}),t.jsx(Cmt,{})]})}),t.jsx(ymt,{control:O.control,name:"startTime",render:({field:e})=>t.jsxs(xmt,{className:"flex-1",children:[t.jsx(wmt,{children:u.eventStartTime}),t.jsx(kmt,{children:t.jsx(LPt,{value:e.value,onChange:e.onChange})}),t.jsx(Cmt,{})]})})]}),t.jsxs("div",{className:"flex space-x-4",children:[t.jsx(ymt,{control:O.control,name:"endDate",render:({field:e})=>t.jsxs(xmt,{className:"flex-1",children:[t.jsx(wmt,{children:u.eventEndDate}),t.jsxs(fgt,{open:g,onOpenChange:b,children:[t.jsx(mgt,{asChild:!0,children:t.jsx(kmt,{children:t.jsxs(Edt,{variant:"outline",className:"w-full justify-start text-left font-normal",children:[t.jsx(kst,{className:"mr-2 h-4 w-4"}),e.value?Vit(e.value,"PPP"):t.jsx("span",{children:u.pickADate})]})})}),t.jsx(vgt,{className:"w-auto p-0",children:t.jsx(Bht,{mode:"single",selected:e.value,onSelect:t=>{if(!t)return;const r=O.getValues("startDate"),n=new Date(r.getFullYear(),r.getMonth(),r.getDate()),o=new Date(t.getFullYear(),t.getMonth(),t.getDate());o>n?(e.onChange(t),b(!1)):o<n?TDt.error(u.errorEndDateBeforeStart):(e.onChange(t),b(!1))},fromDate:O.getValues("startDate"),defaultMonth:e.value||new Date})})]}),t.jsx(Cmt,{})]})}),t.jsx(ymt,{control:O.control,name:"endTime",render:({field:e})=>t.jsxs(xmt,{className:"flex-1",children:[t.jsx(wmt,{children:u.eventEndTime}),t.jsx(kmt,{children:t.jsx(LPt,{value:e.value,onChange:e.onChange})}),t.jsx(Cmt,{})]})})]}),t.jsx(Tbt,{children:t.jsx(APt,{form:O,translations:u,showRepeatToggle:f})}),d&&d.length>0?t.jsx(ymt,{control:O.control,name:"resourceId",render:({field:e})=>t.jsxs(xmt,{children:[t.jsx(wmt,{children:"Resource"}),t.jsxs(mPt,{onValueChange:t=>{e.onChange(t);const r=null==d?void 0:d.find(e=>e.id===t);null!=r&&r.color&&O.setValue("color",r.color)},value:e.value,children:[t.jsx(kmt,{children:t.jsx(yPt,{children:t.jsx(vPt,{placeholder:"Select resource"})})}),t.jsx(xPt,{children:d.map(e=>t.jsx(kPt,{value:e.id,children:t.jsxs("div",{className:"flex items-center",children:[e.accentClass&&t.jsx("div",{className:`w-4 h-4 rounded mr-2 ${e.accentClass}`}),e.name]})},e.id))})]}),t.jsx(Cmt,{})]})}):null,t.jsxs(_dt,{className:"flex flex-col space-y-3 sm:space-y-0 sm:flex-row sm:justify-between items-center w-full",children:[(null==r?void 0:r.id)&&t.jsx("div",{className:"w-full sm:w-auto",children:t.jsxs(apt,{children:[t.jsx(ipt,{asChild:!0,children:t.jsx(Edt,{disabled:x,type:"button",variant:"destructive",size:"sm",className:"w-full gap-1 h-10 sm:w-auto bg-red-600 dark:bg-red-800 hover:bg-red-500 dark:hover:bg-red-900 text-xs sm:text-sm",children:x?t.jsxs(t.Fragment,{children:[t.jsx(Vst,{className:"h-4 w-4 animate-spin"}),u.deleting]}):t.jsxs(t.Fragment,{children:[t.jsx($st,{className:"h-4 w-4"}),u.delete]})})}),t.jsxs(cpt,{className:"max-w-[425px]",children:[t.jsxs(upt,{children:[t.jsxs(ppt,{className:"flex items-center",children:[t.jsx(jst,{className:"mr-2 h-5 w-5 text-red-500"}),null!=r&&r.isRepeating?u.repeatEventDeleteTitle:u.confirmDelete]}),t.jsx(hpt,{className:"text-left",children:null!=r&&r.isRepeating?u.repeatEventDeleteDescription:u.confirmDeleteDescription}),t.jsx("div",{className:"h-2"}),(null==r?void 0:r.isRepeating)&&t.jsx("div",{className:"mt-4 space-y-4",children:t.jsx(ubt,{defaultValue:"single",onValueChange:e=>_(e),children:t.jsx("div",{className:"space-y-4",children:[{value:"single",label:u.deleteThisOccurrence,description:u.deleteThisOccurrenceDescription},{value:"future",label:u.deleteThisAndFuture,description:u.deleteThisAndFutureDescription},{value:"all",label:u.deleteAllOccurrences,description:u.deleteAllOccurrencesDescription}].map(e=>t.jsxs("div",{className:"flex space-x-4",children:[t.jsx(dbt,{value:e.value,id:e.value}),t.jsxs(fmt,{htmlFor:e.value,className:"flex flex-col flex-1 items-start cursor-pointer",children:[t.jsx("span",{className:"leading-none",children:e.label}),t.jsx("span",{className:"text-sm text-muted-foreground mt-1",children:e.description})]})]},e.value))})})}),t.jsx("div",{className:"h-2"})]}),t.jsxs(dpt,{children:[t.jsx(mpt,{children:u.cancel}),t.jsxs(fpt,{onClick:async()=>{var e;if(null==r||!r.id)throw Error("Missing Event Id");w(!0);try{const t=c||r.startDate||new Date;if(!r.isRepeating||"all"===k)return void(a&&await Promise.resolve(a(r.id)));if("single"===k){const e=new Date(t.getFullYear(),t.getMonth(),t.getDate()),n=(r.isRepeatingExcludedDates||[]).map(e=>{if(e instanceof Date)return new Date(e.getFullYear(),e.getMonth(),e.getDate());try{const t=new Date(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate())}catch{return null}}).filter(e=>null!==e),a=e.toDateString(),i=n.some(e=>e.toDateString()===a)?n:[...n,e],s={...r,id:r.id,isRepeatingExcludedDates:i};o&&await Promise.resolve(o(s))}else if("future"===k)if(t.toDateString()===(null==(e=r.startDate)?void 0:e.toDateString()))a&&await Promise.resolve(a(r.id));else{const e=new Date(t);e.setDate(e.getDate()-1);const n={...r,id:r.id,endDate:e};o&&await Promise.resolve(o(n))}}finally{w(!1),null==i||i()}},className:"w-full sm:w-auto bg-red-600 dark:bg-red-800 hover:bg-red-500 dark:hover:bg-red-900 sm:text-sm dark:text-white",children:[t.jsx($st,{className:"h-3 w-3 sm:h-4 sm:w-4 mr-1 sm:mr-2"}),u.delete]})]})]})]})}),t.jsxs("div",{className:"flex flex-col sm:flex-row space-y-2 sm:space-y-0 sm:space-x-2 w-full",children:[t.jsx(Edt,{type:"button",variant:"outline",onClick:i,className:"w-full sm:w-1/2 text-xs sm:text-sm",children:u.cancel}),t.jsx(Edt,{type:"submit",className:"w-full sm:w-1/2 text-xs sm:text-sm",disabled:p,children:p?t.jsxs(t.Fragment,{children:[t.jsx(Vst,{className:"h-4 w-4 animate-spin"}),u.saving]}):u.save})]})]})]})]})]})},gTt=({event:r,onAddEvent:n,onUpdateEvent:o,onDeleteEvent:a,onClosePopup:i,onOpenChange:s,dateFromViewClick:l,children:c,isDisabled:u=!1,translations:d,resources:p})=>{const[h,f]=e.useState(!1),m=e=>{u||(f(e),null==s||s(e),e||null==i||i())};return t.jsxs(ydt,{open:h,onOpenChange:m,children:[t.jsx(jdt,{translations:d,isDisabled:u,children:c}),t.jsx(yTt,{event:r,onAddEvent:n,onUpdateEvent:o,onDeleteEvent:a,onClosePopup:()=>m(!1),dateFromViewClick:l,open:h,translations:d,resources:p})]})};function bTt(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],!(t.indexOf(r)>=0)&&(o[r]=e[r]);return o}var xTt=["color"],wTt=e.forwardRef(function(t,r){var n=t.color,o=void 0===n?"currentColor":n,a=bTt(t,xTt);return e.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:r}),e.createElement("path",{d:"M4.5 1C4.77614 1 5 1.22386 5 1.5V2H10V1.5C10 1.22386 10.2239 1 10.5 1C10.7761 1 11 1.22386 11 1.5V2H12.5C13.3284 2 14 2.67157 14 3.5V12.5C14 13.3284 13.3284 14 12.5 14H2.5C1.67157 14 1 13.3284 1 12.5V3.5C1 2.67157 1.67157 2 2.5 2H4V1.5C4 1.22386 4.22386 1 4.5 1ZM10 3V3.5C10 3.77614 10.2239 4 10.5 4C10.7761 4 11 3.77614 11 3.5V3H12.5C12.7761 3 13 3.22386 13 3.5V5H2V3.5C2 3.22386 2.22386 3 2.5 3H4V3.5C4 3.77614 4.22386 4 4.5 4C4.77614 4 5 3.77614 5 3.5V3H10ZM2 6V12.5C2 12.7761 2.22386 13 2.5 13H12.5C12.7761 13 13 12.7761 13 12.5V6H2ZM7 7.5C7 7.22386 7.22386 7 7.5 7C7.77614 7 8 7.22386 8 7.5C8 7.77614 7.77614 8 7.5 8C7.22386 8 7 7.77614 7 7.5ZM9.5 7C9.22386 7 9 7.22386 9 7.5C9 7.77614 9.22386 8 9.5 8C9.77614 8 10 7.77614 10 7.5C10 7.22386 9.77614 7 9.5 7ZM11 7.5C11 7.22386 11.2239 7 11.5 7C11.7761 7 12 7.22386 12 7.5C12 7.77614 11.7761 8 11.5 8C11.2239 8 11 7.77614 11 7.5ZM11.5 9C11.2239 9 11 9.22386 11 9.5C11 9.77614 11.2239 10 11.5 10C11.7761 10 12 9.77614 12 9.5C12 9.22386 11.7761 9 11.5 9ZM9 9.5C9 9.22386 9.22386 9 9.5 9C9.77614 9 10 9.22386 10 9.5C10 9.77614 9.77614 10 9.5 10C9.22386 10 9 9.77614 9 9.5ZM7.5 9C7.22386 9 7 9.22386 7 9.5C7 9.77614 7.22386 10 7.5 10C7.77614 10 8 9.77614 8 9.5C8 9.22386 7.77614 9 7.5 9ZM5 9.5C5 9.22386 5.22386 9 5.5 9C5.77614 9 6 9.22386 6 9.5C6 9.77614 5.77614 10 5.5 10C5.22386 10 5 9.77614 5 9.5ZM3.5 9C3.22386 9 3 9.22386 3 9.5C3 9.77614 3.22386 10 3.5 10C3.77614 10 4 9.77614 4 9.5C4 9.22386 3.77614 9 3.5 9ZM3 11.5C3 11.2239 3.22386 11 3.5 11C3.77614 11 4 11.2239 4 11.5C4 11.7761 3.77614 12 3.5 12C3.22386 12 3 11.7761 3 11.5ZM5.5 11C5.22386 11 5 11.2239 5 11.5C5 11.7761 5.22386 12 5.5 12C5.77614 12 6 11.7761 6 11.5C6 11.2239 5.77614 11 5.5 11ZM7 11.5C7 11.2239 7.22386 11 7.5 11C7.77614 11 8 11.2239 8 11.5C8 11.7761 7.77614 12 7.5 12C7.22386 12 7 11.7761 7 11.5ZM9.5 11C9.22386 11 9 11.2239 9 11.5C9 11.7761 9.22386 12 9.5 12C9.77614 12 10 11.7761 10 11.5C10 11.2239 9.77614 11 9.5 11Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))}),kTt=["color"],_Tt=e.forwardRef(function(t,r){var n=t.color,o=void 0===n?"currentColor":n,a=bTt(t,kTt);return e.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:r}),e.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:o,fillRule:"evenodd",clipRule:"evenodd"}))}),CTt=["color"],MTt=e.forwardRef(function(t,r){var n=t.color,o=void 0===n?"currentColor":n,a=bTt(t,CTt);return e.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:r}),e.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:o,fillRule:"evenodd",clipRule:"evenodd"}))}),STt=.999,DTt=/[\\\/_+.#"@\[\(\{&]/,OTt=/[\\\/_+.#"@\[\(\{&]/g,PTt=/[\s-]/,ETt=/[\s-]/g;function jTt(e,t,r,n,o,a,i){if(a===t.length)return o===e.length?1:.99;var s=`${o},${a}`;if(void 0!==i[s])return i[s];for(var l,c,u,d,p=n.charAt(a),h=r.indexOf(p,o),f=0;h>=0;)(l=jTt(e,t,r,n,h+1,a+1,i))>f&&(h===o?l*=1:DTt.test(e.charAt(h-1))?(l*=.8,(u=e.slice(o,h-1).match(OTt))&&o>0&&(l*=Math.pow(STt,u.length))):PTt.test(e.charAt(h-1))?(l*=.9,(d=e.slice(o,h-1).match(ETt))&&o>0&&(l*=Math.pow(STt,d.length))):(l*=.17,o>0&&(l*=Math.pow(STt,h-o))),e.charAt(h)!==t.charAt(a)&&(l*=.9999)),(l<.1&&r.charAt(h-1)===n.charAt(a+1)||n.charAt(a+1)===n.charAt(a)&&r.charAt(h-1)!==n.charAt(a))&&(.1*(c=jTt(e,t,r,n,h+1,a+2,i))>l&&(l=.1*c)),l>f&&(f=l),h=r.indexOf(p,h+1);return i[s]=f,f}function TTt(e){return e.toLowerCase().replace(ETt," ")}function NTt(e,t,r){return jTt(e=r&&r.length>0?""+(e+" "+r.join(" ")):e,t,TTt(e),TTt(t),0,0,{})}function RTt(){return RTt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},RTt.apply(null,arguments)}function FTt(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(null==e||e(n),!1===r||!n.defaultPrevented)return null==t?void 0:t(n)}}function zTt(...e){return t=>e.forEach(e=>function(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}(e,t))}function ITt(...t){return e.useCallback(zTt(...t),t)}function ATt(...t){const r=t[0];if(1===t.length)return r;const n=()=>{const n=t.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(t){const o=n.reduce((e,{useScope:r,scopeName:n})=>({...e,...r(t)[`__scope${n}`]}),{});return e.useMemo(()=>({[`__scope${r.scopeName}`]:o}),[o])}};return n.scopeName=r.scopeName,n}const LTt=null!=globalThis&&globalThis.document?e.useLayoutEffect:()=>{},BTt=s.useId||(()=>{});let VTt=0;function HTt(e){const[t,r]=s.useState(BTt());return LTt(()=>{r(e=>e??String(VTt++))},[e]),e||(t?`radix-${t}`:"")}function qTt(t){const r=e.useRef(t);return e.useEffect(()=>{r.current=t}),e.useMemo(()=>(...e)=>{var t;return null===(t=r.current)||void 0===t?void 0:t.call(r,...e)},[])}function $Tt({prop:t,defaultProp:r,onChange:n=()=>{}}){const[o,a]=function({defaultProp:t,onChange:r}){const n=e.useState(t),[o]=n,a=e.useRef(o),i=qTt(r);return e.useEffect(()=>{a.current!==o&&(i(o),a.current=o)},[o,a,i]),n}({defaultProp:r,onChange:n}),i=void 0!==t,s=i?t:o,l=qTt(n),c=e.useCallback(e=>{if(i){const r="function"==typeof e?e(t):e;r!==t&&l(r)}else a(e)},[i,t,a,l]);return[s,c]}const WTt=e.forwardRef((t,r)=>{const{children:n,...o}=t,a=e.Children.toArray(n),i=a.find(KTt);if(i){const t=i.props.children,n=a.map(r=>r===i?e.Children.count(t)>1?e.Children.only(null):e.isValidElement(t)?t.props.children:null:r);return e.createElement(UTt,RTt({},o,{ref:r}),e.isValidElement(t)?e.cloneElement(t,void 0,n):null)}return e.createElement(UTt,RTt({},o,{ref:r}),n)});WTt.displayName="Slot";const UTt=e.forwardRef((t,r)=>{const{children:n,...o}=t;return e.isValidElement(n)?e.cloneElement(n,{...YTt(o,n.props),ref:r?zTt(r,n.ref):n.ref}):e.Children.count(n)>1?e.Children.only(null):null});UTt.displayName="SlotClone";const GTt=({children:t})=>e.createElement(e.Fragment,null,t);function KTt(t){return e.isValidElement(t)&&t.type===GTt}function YTt(e,t){const r={...t};for(const n in t){const o=e[n],a=t[n];/^on[A-Z]/.test(n)?o&&a?r[n]=(...e)=>{a(...e),o(...e)}:o&&(r[n]=o):"style"===n?r[n]={...o,...a}:"className"===n&&(r[n]=[o,a].filter(Boolean).join(" "))}return{...e,...r}}const XTt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((t,r)=>{const n=e.forwardRef((t,n)=>{const{asChild:o,...a}=t,i=o?WTt:r;return e.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),e.createElement(i,RTt({},a,{ref:n}))});return n.displayName=`Primitive.${r}`,{...t,[r]:n}},{});const ZTt="dismissableLayer.update",QTt="dismissableLayer.pointerDownOutside",JTt="dismissableLayer.focusOutside";let eNt;const tNt=e.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),rNt=e.forwardRef((t,r)=>{var n;const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:l,onDismiss:c,...u}=t,d=e.useContext(tNt),[p,h]=e.useState(null),f=null!==(n=null==p?void 0:p.ownerDocument)&&void 0!==n?n:null==globalThis?void 0:globalThis.document,[,m]=e.useState({}),v=ITt(r,e=>h(e)),y=Array.from(d.layers),[g]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=y.indexOf(g),x=p?y.indexOf(p):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,k=x>=b,_=function(t,r=(null==globalThis?void 0:globalThis.document)){const n=qTt(t),o=e.useRef(!1),a=e.useRef(()=>{});return e.useEffect(()=>{const e=e=>{if(e.target&&!o.current){let t=function(){oNt(QTt,n,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(r.removeEventListener("click",a.current),a.current=t,r.addEventListener("click",a.current,{once:!0})):t()}else r.removeEventListener("click",a.current);o.current=!1},t=window.setTimeout(()=>{r.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(t),r.removeEventListener("pointerdown",e),r.removeEventListener("click",a.current)}},[r,n]),{onPointerDownCapture:()=>o.current=!0}}(e=>{const t=e.target,r=[...d.branches].some(e=>e.contains(t));!k||r||(null==i||i(e),null==l||l(e),e.defaultPrevented||null==c||c())},f),C=function(t,r=(null==globalThis?void 0:globalThis.document)){const n=qTt(t),o=e.useRef(!1);return e.useEffect(()=>{const e=e=>{e.target&&!o.current&&oNt(JTt,n,{originalEvent:e},{discrete:!1})};return r.addEventListener("focusin",e),()=>r.removeEventListener("focusin",e)},[r,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}(e=>{const t=e.target;[...d.branches].some(e=>e.contains(t))||(null==s||s(e),null==l||l(e),e.defaultPrevented||null==c||c())},f);return function(t,r=(null==globalThis?void 0:globalThis.document)){const n=qTt(t);e.useEffect(()=>{const e=e=>{"Escape"===e.key&&n(e)};return r.addEventListener("keydown",e),()=>r.removeEventListener("keydown",e)},[n,r])}(e=>{x===d.layers.size-1&&(null==a||a(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))},f),e.useEffect(()=>{if(p)return o&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(eNt=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),nNt(),()=>{o&&1===d.layersWithOutsidePointerEventsDisabled.size&&(f.body.style.pointerEvents=eNt)}},[p,f,o,d]),e.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),nNt())},[p,d]),e.useEffect(()=>{const e=()=>m({});return document.addEventListener(ZTt,e),()=>document.removeEventListener(ZTt,e)},[]),e.createElement(XTt.div,RTt({},u,{ref:v,style:{pointerEvents:w?k?"auto":"none":void 0,...t.style},onFocusCapture:FTt(t.onFocusCapture,C.onFocusCapture),onBlurCapture:FTt(t.onBlurCapture,C.onBlurCapture),onPointerDownCapture:FTt(t.onPointerDownCapture,_.onPointerDownCapture)}))});function nNt(){const e=new CustomEvent(ZTt);document.dispatchEvent(e)}function oNt(e,t,n,{discrete:o}){const a=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),o?function(e,t){e&&r.flushSync(()=>e.dispatchEvent(t))}(a,i):a.dispatchEvent(i)}const aNt="focusScope.autoFocusOnMount",iNt="focusScope.autoFocusOnUnmount",sNt={bubbles:!1,cancelable:!0},lNt=e.forwardRef((t,r)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...s}=t,[l,c]=e.useState(null),u=qTt(a),d=qTt(i),p=e.useRef(null),h=ITt(r,e=>c(e)),f=e.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;e.useEffect(()=>{if(o){let e=function(e){if(f.paused||!l)return;const t=e.target;l.contains(t)?p.current=t:pNt(p.current,{select:!0})},t=function(e){if(f.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||pNt(p.current,{select:!0}))},r=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&pNt(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()}}},[o,l,f.paused]),e.useEffect(()=>{if(l){hNt.add(f);const e=document.activeElement;if(!l.contains(e)){const t=new CustomEvent(aNt,sNt);l.addEventListener(aNt,u),l.dispatchEvent(t),t.defaultPrevented||(function(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(pNt(n,{select:t}),document.activeElement!==r)return}(function(e){return e.filter(e=>"A"!==e.tagName)}(cNt(l)),{select:!0}),document.activeElement===e&&pNt(l))}return()=>{l.removeEventListener(aNt,u),setTimeout(()=>{const t=new CustomEvent(iNt,sNt);l.addEventListener(iNt,d),l.dispatchEvent(t),t.defaultPrevented||pNt(e??document.body,{select:!0}),l.removeEventListener(iNt,d),hNt.remove(f)},0)}}},[l,u,d,f]);const m=e.useCallback(e=>{if(!n&&!o||f.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,r=document.activeElement;if(t&&r){const t=e.currentTarget,[o,a]=function(e){const t=cNt(e),r=uNt(t,e),n=uNt(t.reverse(),e);return[r,n]}(t);o&&a?e.shiftKey||r!==a?e.shiftKey&&r===o&&(e.preventDefault(),n&&pNt(a,{select:!0})):(e.preventDefault(),n&&pNt(o,{select:!0})):r===t&&e.preventDefault()}},[n,o,f.paused]);return e.createElement(XTt.div,RTt({tabIndex:-1},s,{ref:h,onKeyDown:m}))});function cNt(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 uNt(e,t){for(const r of e)if(!dNt(r,{upTo:t}))return r}function dNt(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 pNt(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()}}const hNt=function(){let e=[];return{add(t){const r=e[0];t!==r&&(null==r||r.pause()),e=fNt(e,t),e.unshift(t)},remove(t){var r;e=fNt(e,t),null===(r=e[0])||void 0===r||r.resume()}}}();function fNt(e,t){const r=[...e],n=r.indexOf(t);return-1!==n&&r.splice(n,1),r}const mNt=e.forwardRef((t,r)=>{var n;const{container:o=(null==globalThis||null===(n=globalThis.document)||void 0===n?void 0:n.body),...a}=t;return o?u.default.createPortal(e.createElement(XTt.div,RTt({},a,{ref:r})),o):null});const vNt=t=>{const{present:n,children:o}=t,a=function(t){const[n,o]=e.useState(),a=e.useRef({}),i=e.useRef(t),s=e.useRef("none"),l=t?"mounted":"unmounted",[c,u]=function(t,r){return e.useReducer((e,t)=>r[e][t]??e,t)}(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return e.useEffect(()=>{const e=yNt(a.current);s.current="mounted"===c?e:"none"},[c]),LTt(()=>{const e=a.current,r=i.current;if(r!==t){const n=s.current,o=yNt(e);t?u("MOUNT"):"none"===o||"none"===(null==e?void 0:e.display)?u("UNMOUNT"):u(r&&n!==o?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,u]),LTt(()=>{if(n){const e=e=>{const t=yNt(a.current).includes(e.animationName);e.target===n&&t&&r.flushSync(()=>u("ANIMATION_END"))},t=e=>{e.target===n&&(s.current=yNt(a.current))};return n.addEventListener("animationstart",t),n.addEventListener("animationcancel",e),n.addEventListener("animationend",e),()=>{n.removeEventListener("animationstart",t),n.removeEventListener("animationcancel",e),n.removeEventListener("animationend",e)}}u("ANIMATION_END")},[n,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:e.useCallback(e=>{e&&(a.current=getComputedStyle(e)),o(e)},[])}}(n),i="function"==typeof o?o({present:a.isPresent}):e.Children.only(o),s=ITt(a.ref,i.ref);return"function"==typeof o||a.isPresent?e.cloneElement(i,{ref:s}):null};function yNt(e){return(null==e?void 0:e.animationName)||"none"}vNt.displayName="Presence";let gNt=0;function bNt(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var xNt=Klt(),wNt=function(){},kNt=s.forwardRef(function(e,t){var r=s.useRef(null),n=s.useState({onScrollCapture:wNt,onWheelCapture:wNt,onTouchMoveCapture:wNt}),o=n[0],a=n[1],i=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,p=e.shards,h=e.sideCar,f=e.noIsolation,m=e.inert,v=e.allowPinchZoom,y=e.as,g=void 0===y?"div":y,b=Llt(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),x=h,w=Ult([r,t]),k=Alt(Alt({},b),o);return s.createElement(s.Fragment,null,d&&s.createElement(x,{sideCar:xNt,removeScrollBar:u,shards:p,noIsolation:f,inert:m,setCallbacks:a,allowPinchZoom:!!v,lockRef:r}),i?s.cloneElement(s.Children.only(l),Alt(Alt({},k),{ref:w})):s.createElement(g,Alt({},k,{className:c,ref:w}),l))});kNt.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},kNt.classNames={fullWidth:Hlt,zeroRight:Vlt};var _Nt=!1;if(typeof window<"u")try{var CNt=Object.defineProperty({},"passive",{get:function(){return _Nt=!0,!0}});window.addEventListener("test",CNt,CNt),window.removeEventListener("test",CNt,CNt)}catch{_Nt=!1}var MNt=!!_Nt&&{passive:!1},SNt=function(e,t){var r=window.getComputedStyle(e);return"hidden"!==r[t]&&!(r.overflowY===r.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===r[t])},DNt=function(e,t){var r=t;do{if(typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host),ONt(e,r)){var n=PNt(e,r);if(n[1]>n[2])return!0}r=r.parentNode}while(r&&r!==document.body);return!1},ONt=function(e,t){return"v"===e?function(e){return SNt(e,"overflowY")}(t):function(e){return SNt(e,"overflowX")}(t)},PNt=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)},ENt=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},jNt=function(e){return[e.deltaX,e.deltaY]},TNt=function(e){return e&&"current"in e?e.current:e},NNt=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},RNt=0,FNt=[];const zNt=Xlt(xNt,function(e){var t=s.useRef([]),r=s.useRef([0,0]),n=s.useRef(),o=s.useState(RNt++)[0],a=s.useState(function(){return rct()})[0],i=s.useRef(e);s.useEffect(function(){i.current=e},[e]),s.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=Blt([e.lockRef.current],(e.shards||[]).map(TNt),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=s.useCallback(function(e,t){if("touches"in e&&2===e.touches.length)return!i.current.allowPinchZoom;var o,a=ENt(e),s=r.current,l="deltaX"in e?e.deltaX:s[0]-a[0],c="deltaY"in e?e.deltaY:s[1]-a[1],u=e.target,d=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var p=DNt(d,u);if(!p)return!0;if(p?o=d:(o="v"===d?"h":"v",p=DNt(d,u)),!p)return!1;if(!n.current&&"changedTouches"in e&&(l||c)&&(n.current=o),!o)return!0;var h=n.current||o;return function(e,t,r,n){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),a=o*n,i=r.target,s=t.contains(i),l=!1,c=a>0,u=0,d=0;do{var p=PNt(e,i),h=p[0],f=p[1]-p[2]-o*h;(h||f)&&ONt(e,i)&&(u+=f,d+=h),i=i.parentNode}while(!s&&i!==document.body||s&&(t.contains(i)||t===i));return(c&&0===u||!c&&0===d)&&(l=!0),l}(h,t,e,"h"===h?l:c)},[]),c=s.useCallback(function(e){var r=e;if(FNt.length&&FNt[FNt.length-1]===a){var n="deltaY"in r?jNt(r):ENt(r),o=t.current.filter(function(e){return e.name===r.type&&e.target===r.target&&function(e,t){return e[0]===t[0]&&e[1]===t[1]}(e.delta,n)})[0];if(o&&o.should)return void(r.cancelable&&r.preventDefault());if(!o){var s=(i.current.shards||[]).map(TNt).filter(Boolean).filter(function(e){return e.contains(r.target)});(s.length>0?l(r,s[0]):!i.current.noIsolation)&&r.cancelable&&r.preventDefault()}}},[]),u=s.useCallback(function(e,r,n,o){var a={name:e,delta:r,target:n,should:o};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=s.useCallback(function(e){r.current=ENt(e),n.current=void 0},[]),p=s.useCallback(function(t){u(t.type,jNt(t),t.target,l(t,e.lockRef.current))},[]),h=s.useCallback(function(t){u(t.type,ENt(t),t.target,l(t,e.lockRef.current))},[]);s.useEffect(function(){return FNt.push(a),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:h}),document.addEventListener("wheel",c,MNt),document.addEventListener("touchmove",c,MNt),document.addEventListener("touchstart",d,MNt),function(){FNt=FNt.filter(function(e){return e!==a}),document.removeEventListener("wheel",c,MNt),document.removeEventListener("touchmove",c,MNt),document.removeEventListener("touchstart",d,MNt)}},[]);var f=e.removeScrollBar,m=e.inert;return s.createElement(s.Fragment,null,m?s.createElement(a,{styles:NNt(o)}):null,f?s.createElement(uct,{gapMode:"margin"}):null)});var INt=s.forwardRef(function(e,t){return s.createElement(kNt,Alt({},e,{ref:t,sideCar:zNt}))});INt.classNames=kNt.classNames;const ANt="Dialog",[LNt,BNt]=function(t,r=[]){let n=[];const o=()=>{const r=n.map(t=>e.createContext(t));return function(n){const o=(null==n?void 0:n[t])||r;return e.useMemo(()=>({[`__scope${t}`]:{...n,[t]:o}}),[n,o])}};return o.scopeName=t,[function(r,o){const a=e.createContext(o),i=n.length;function s(r){const{scope:n,children:o,...s}=r,l=(null==n?void 0:n[t][i])||a,c=e.useMemo(()=>s,Object.values(s));return e.createElement(l.Provider,{value:c},o)}return n=[...n,o],s.displayName=r+"Provider",[s,function(n,s){const l=(null==s?void 0:s[t][i])||a,c=e.useContext(l);if(c)return c;if(void 0!==o)return o;throw new Error(`\`${n}\` must be used within \`${r}\``)}]},ATt(o,...r)]}(ANt),[VNt,HNt]=LNt(ANt),qNt="DialogPortal",[$Nt,WNt]=LNt(qNt,{forceMount:void 0}),UNt="DialogOverlay",GNt=e.forwardRef((t,r)=>{const n=WNt(UNt,t.__scopeDialog),{forceMount:o=n.forceMount,...a}=t,i=HNt(UNt,t.__scopeDialog);return i.modal?e.createElement(vNt,{present:o||i.open},e.createElement(KNt,RTt({},a,{ref:r}))):null}),KNt=e.forwardRef((t,r)=>{const{__scopeDialog:n,...o}=t,a=HNt(UNt,n);return e.createElement(INt,{as:WTt,allowPinchZoom:!0,shards:[a.contentRef]},e.createElement(XTt.div,RTt({"data-state":eRt(a.open)},o,{ref:r,style:{pointerEvents:"auto",...o.style}})))}),YNt="DialogContent",XNt=e.forwardRef((t,r)=>{const n=WNt(YNt,t.__scopeDialog),{forceMount:o=n.forceMount,...a}=t,i=HNt(YNt,t.__scopeDialog);return e.createElement(vNt,{present:o||i.open},i.modal?e.createElement(ZNt,RTt({},a,{ref:r})):e.createElement(QNt,RTt({},a,{ref:r})))}),ZNt=e.forwardRef((t,r)=>{const n=HNt(YNt,t.__scopeDialog),o=e.useRef(null),a=ITt(r,n.contentRef,o);return e.useEffect(()=>{const e=o.current;if(e)return Nct(e)},[]),e.createElement(JNt,RTt({},t,{ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:FTt(t.onCloseAutoFocus,e=>{var t;e.preventDefault(),null===(t=n.triggerRef.current)||void 0===t||t.focus()}),onPointerDownOutside:FTt(t.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:FTt(t.onFocusOutside,e=>e.preventDefault())}))}),QNt=e.forwardRef((t,r)=>{const n=HNt(YNt,t.__scopeDialog),o=e.useRef(!1),a=e.useRef(!1);return e.createElement(JNt,RTt({},t,{ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{var r,i;(null===(r=t.onCloseAutoFocus)||void 0===r||r.call(t,e),e.defaultPrevented)||(o.current||null===(i=n.triggerRef.current)||void 0===i||i.focus(),e.preventDefault());o.current=!1,a.current=!1},onInteractOutside:e=>{var r,i;null===(r=t.onInteractOutside)||void 0===r||r.call(t,e),e.defaultPrevented||(o.current=!0,"pointerdown"===e.detail.originalEvent.type&&(a.current=!0));const s=e.target;(null===(i=n.triggerRef.current)||void 0===i?void 0:i.contains(s))&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&a.current&&e.preventDefault()}}))}),JNt=e.forwardRef((t,r)=>{const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:i,...s}=t,l=HNt(YNt,n),c=ITt(r,e.useRef(null));return e.useEffect(()=>{var e,t;const r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",null!==(e=r[0])&&void 0!==e?e:bNt()),document.body.insertAdjacentElement("beforeend",null!==(t=r[1])&&void 0!==t?t:bNt()),gNt++,()=>{1===gNt&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),gNt--}},[]),e.createElement(e.Fragment,null,e.createElement(lNt,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:i},e.createElement(rNt,RTt({role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":eRt(l.open)},s,{ref:c,onDismiss:()=>l.onOpenChange(!1)}))),!1)});function eRt(e){return e?"open":"closed"}const tRt=t=>{const{__scopeDialog:r,children:n,open:o,defaultOpen:a,onOpenChange:i,modal:s=!0}=t,l=e.useRef(null),c=e.useRef(null),[u=!1,d]=$Tt({prop:o,defaultProp:a,onChange:i});return e.createElement(VNt,{scope:r,triggerRef:l,contentRef:c,contentId:HTt(),titleId:HTt(),descriptionId:HTt(),open:u,onOpenChange:d,onOpenToggle:e.useCallback(()=>d(e=>!e),[d]),modal:s},n)},rRt=t=>{const{__scopeDialog:r,forceMount:n,children:o,container:a}=t,i=HNt(qNt,r);return e.createElement($Nt,{scope:r,forceMount:n},e.Children.map(o,t=>e.createElement(vNt,{present:n||i.open},e.createElement(mNt,{asChild:!0,container:a},t))))},nRt=GNt,oRt=XNt;var aRt='[cmdk-group=""]',iRt='[cmdk-group-items=""]',sRt='[cmdk-item=""]',lRt=`${sRt}:not([aria-disabled="true"])`,cRt="cmdk-item-select",uRt="data-value",dRt=(e,t,r)=>NTt(e,t,r),pRt=s.createContext(void 0),hRt=()=>s.useContext(pRt),fRt=s.createContext(void 0),mRt=()=>s.useContext(fRt),vRt=s.createContext(void 0),yRt=s.forwardRef((e,t)=>{let r=jRt(()=>{var t,r;return{search:"",value:null!=(r=null!=(t=e.value)?t:e.defaultValue)?r:"",filtered:{count:0,items:new Map,groups:new Set}}}),n=jRt(()=>new Set),o=jRt(()=>new Map),a=jRt(()=>new Map),i=jRt(()=>new Set),l=PRt(e),{label:c,children:u,value:d,onValueChange:p,filter:h,shouldFilter:f,loop:m,disablePointerSelection:v=!1,vimBindings:y=!0,...g}=e,b=s.useId(),x=s.useId(),w=s.useId(),k=s.useRef(null),_=FRt();ERt(()=>{if(void 0!==d){let e=d.trim();r.current.value=e,C.emit()}},[d]),ERt(()=>{_(6,E)},[]);let C=s.useMemo(()=>({subscribe:e=>(i.current.add(e),()=>i.current.delete(e)),snapshot:()=>r.current,setState:(e,t,n)=>{var o,a,i;if(!Object.is(r.current[e],t)){if(r.current[e]=t,"search"===e)P(),D(),_(1,O);else if("value"===e&&(n||_(5,E),void 0!==(null==(o=l.current)?void 0:o.value))){let e=t??"";return void(null==(i=(a=l.current).onValueChange)||i.call(a,e))}C.emit()}},emit:()=>{i.current.forEach(e=>e())}}),[]),M=s.useMemo(()=>({value:(e,t,n)=>{var o;t!==(null==(o=a.current.get(e))?void 0:o.value)&&(a.current.set(e,{value:t,keywords:n}),r.current.filtered.items.set(e,S(t,n)),_(2,()=>{D(),C.emit()}))},item:(e,t)=>(n.current.add(e),t&&(o.current.has(t)?o.current.get(t).add(e):o.current.set(t,new Set([e]))),_(3,()=>{P(),D(),r.current.value||O(),C.emit()}),()=>{a.current.delete(e),n.current.delete(e),r.current.filtered.items.delete(e);let t=j();_(4,()=>{P(),(null==t?void 0:t.getAttribute("id"))===e&&O(),C.emit()})}),group:e=>(o.current.has(e)||o.current.set(e,new Set),()=>{a.current.delete(e),o.current.delete(e)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],disablePointerSelection:v,listId:b,inputId:w,labelId:x,listInnerRef:k}),[]);function S(e,t){var n,o;let a=null!=(o=null==(n=l.current)?void 0:n.filter)?o:dRt;return e?a(e,r.current.search,t):0}function D(){if(!r.current.search||!1===l.current.shouldFilter)return;let e=r.current.filtered.items,t=[];r.current.filtered.groups.forEach(r=>{let n=o.current.get(r),a=0;n.forEach(t=>{let r=e.get(t);a=Math.max(r,a)}),t.push([r,a])});let n=k.current;T().sort((t,r)=>{var n,o;let a=t.getAttribute("id"),i=r.getAttribute("id");return(null!=(n=e.get(i))?n:0)-(null!=(o=e.get(a))?o:0)}).forEach(e=>{let t=e.closest(iRt);t?t.appendChild(e.parentElement===t?e:e.closest(`${iRt} > *`)):n.appendChild(e.parentElement===n?e:e.closest(`${iRt} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=k.current.querySelector(`${aRt}[${uRt}="${encodeURIComponent(e[0])}"]`);null==t||t.parentElement.appendChild(t)})}function O(){let e=T().find(e=>"true"!==e.getAttribute("aria-disabled")),t=null==e?void 0:e.getAttribute(uRt);C.setState("value",t||void 0)}function P(){var e,t,i,s;if(!r.current.search||!1===l.current.shouldFilter)return void(r.current.filtered.count=n.current.size);r.current.filtered.groups=new Set;let c=0;for(let o of n.current){let n=S(null!=(t=null==(e=a.current.get(o))?void 0:e.value)?t:"",null!=(s=null==(i=a.current.get(o))?void 0:i.keywords)?s:[]);r.current.filtered.items.set(o,n),n>0&&c++}for(let[e,t]of o.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=c}function E(){var e,t,r;let n=j();n&&((null==(e=n.parentElement)?void 0:e.firstChild)===n&&(null==(r=null==(t=n.closest(aRt))?void 0:t.querySelector('[cmdk-group-heading=""]'))||r.scrollIntoView({block:"nearest"})),n.scrollIntoView({block:"nearest"}))}function j(){var e;return null==(e=k.current)?void 0:e.querySelector(`${sRt}[aria-selected="true"]`)}function T(){var e;return Array.from(null==(e=k.current)?void 0:e.querySelectorAll(lRt))}function N(e){let t=T()[e];t&&C.setState("value",t.getAttribute(uRt))}function R(e){var t;let r=j(),n=T(),o=n.findIndex(e=>e===r),a=n[o+e];null!=(t=l.current)&&t.loop&&(a=o+e<0?n[n.length-1]:o+e===n.length?n[0]:n[o+e]),a&&C.setState("value",a.getAttribute(uRt))}function F(e){let t,r=j(),n=null==r?void 0:r.closest(aRt);for(;n&&!t;)n=e>0?DRt(n,aRt):ORt(n,aRt),t=null==n?void 0:n.querySelector(lRt);t?C.setState("value",t.getAttribute(uRt)):R(e)}let z=()=>N(T().length-1),I=e=>{e.preventDefault(),e.metaKey?z():e.altKey?F(1):R(1)},A=e=>{e.preventDefault(),e.metaKey?N(0):e.altKey?F(-1):R(-1)};return s.createElement(XTt.div,{ref:t,tabIndex:-1,...g,"cmdk-root":"",onKeyDown:e=>{var t;if(null==(t=g.onKeyDown)||t.call(g,e),!e.defaultPrevented)switch(e.key){case"n":case"j":y&&e.ctrlKey&&I(e);break;case"ArrowDown":I(e);break;case"p":case"k":y&&e.ctrlKey&&A(e);break;case"ArrowUp":A(e);break;case"Home":e.preventDefault(),N(0);break;case"End":e.preventDefault(),z();break;case"Enter":if(!e.nativeEvent.isComposing&&229!==e.keyCode){e.preventDefault();let t=j();if(t){let e=new Event(cRt);t.dispatchEvent(e)}}}}},s.createElement("label",{"cmdk-label":"",htmlFor:M.inputId,id:M.labelId,style:IRt},c),zRt(e,e=>s.createElement(fRt.Provider,{value:C},s.createElement(pRt.Provider,{value:M},e))))}),gRt=s.forwardRef((e,t)=>{var r,n;let o=s.useId(),a=s.useRef(null),i=s.useContext(vRt),l=hRt(),c=PRt(e),u=null!=(n=null==(r=c.current)?void 0:r.forceMount)?n:null==i?void 0:i.forceMount;ERt(()=>{if(!u)return l.item(o,null==i?void 0:i.id)},[u]);let d=RRt(o,a,[e.value,e.children,a],e.keywords),p=mRt(),h=NRt(e=>e.value&&e.value===d.current),f=NRt(e=>!(!u&&!1!==l.filter())||(!e.search||e.filtered.items.get(o)>0));function m(){var e,t;v(),null==(t=(e=c.current).onSelect)||t.call(e,d.current)}function v(){p.setState("value",d.current,!0)}if(s.useEffect(()=>{let t=a.current;if(t&&!e.disabled)return t.addEventListener(cRt,m),()=>t.removeEventListener(cRt,m)},[f,e.onSelect,e.disabled]),!f)return null;let{disabled:y,value:g,onSelect:b,forceMount:x,keywords:w,...k}=e;return s.createElement(XTt.div,{ref:TRt([a,t]),...k,id:o,"cmdk-item":"",role:"option","aria-disabled":!!y,"aria-selected":!!h,"data-disabled":!!y,"data-selected":!!h,onPointerMove:y||l.disablePointerSelection?void 0:v,onClick:y?void 0:m},e.children)}),bRt=s.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:o,...a}=e,i=s.useId(),l=s.useRef(null),c=s.useRef(null),u=s.useId(),d=hRt(),p=NRt(e=>!(!o&&!1!==d.filter())||(!e.search||e.filtered.groups.has(i)));ERt(()=>d.group(i),[]),RRt(i,l,[e.value,e.heading,c]);let h=s.useMemo(()=>({id:i,forceMount:o}),[o]);return s.createElement(XTt.div,{ref:TRt([l,t]),...a,"cmdk-group":"",role:"presentation",hidden:!p||void 0},r&&s.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},r),zRt(e,e=>s.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?u:void 0},s.createElement(vRt.Provider,{value:h},e))))}),xRt=s.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,o=s.useRef(null),a=NRt(e=>!e.search);return r||a?s.createElement(XTt.div,{ref:TRt([o,t]),...n,"cmdk-separator":"",role:"separator"}):null}),wRt=s.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,o=null!=e.value,a=mRt(),i=NRt(e=>e.search),l=NRt(e=>e.value),c=hRt(),u=s.useMemo(()=>{var e;let t=null==(e=c.listInnerRef.current)?void 0:e.querySelector(`${sRt}[${uRt}="${encodeURIComponent(l)}"]`);return null==t?void 0:t.getAttribute("id")},[]);return s.useEffect(()=>{null!=e.value&&a.setState("search",e.value)},[e.value]),s.createElement(XTt.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":u,id:c.inputId,type:"text",value:o?e.value:i,onChange:e=>{o||a.setState("search",e.target.value),null==r||r(e.target.value)}})}),kRt=s.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...o}=e,a=s.useRef(null),i=s.useRef(null),l=hRt();return s.useEffect(()=>{if(i.current&&a.current){let e,t=i.current,r=a.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)}}},[]),s.createElement(XTt.div,{ref:TRt([a,t]),...o,"cmdk-list":"",role:"listbox","aria-label":n,id:l.listId},zRt(e,e=>s.createElement("div",{ref:TRt([i,l.listInnerRef]),"cmdk-list-sizer":""},e)))}),_Rt=s.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:o,contentClassName:a,container:i,...l}=e;return s.createElement(tRt,{open:r,onOpenChange:n},s.createElement(rRt,{container:i},s.createElement(nRt,{"cmdk-overlay":"",className:o}),s.createElement(oRt,{"aria-label":e.label,"cmdk-dialog":"",className:a},s.createElement(yRt,{ref:t,...l}))))}),CRt=s.forwardRef((e,t)=>NRt(e=>0===e.filtered.count)?s.createElement(XTt.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),MRt=s.forwardRef((e,t)=>{let{progress:r,children:n,label:o="Loading...",...a}=e;return s.createElement(XTt.div,{ref:t,...a,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},zRt(e,e=>s.createElement("div",{"aria-hidden":!0},e)))}),SRt=Object.assign(yRt,{List:kRt,Item:gRt,Input:wRt,Group:bRt,Separator:xRt,Dialog:_Rt,Empty:CRt,Loading:MRt});function DRt(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function ORt(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function PRt(e){let t=s.useRef(e);return ERt(()=>{t.current=e}),t}var ERt=typeof window>"u"?s.useEffect:s.useLayoutEffect;function jRt(e){let t=s.useRef();return void 0===t.current&&(t.current=e()),t}function TRt(e){return t=>{e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}}function NRt(e){let t=mRt(),r=()=>e(t.snapshot());return s.useSyncExternalStore(t.subscribe,r,r)}function RRt(e,t,r,n=[]){let o=s.useRef(),a=hRt();return ERt(()=>{var i;let s=(()=>{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():o.current}})(),l=n.map(e=>e.trim());a.value(e,s,l),null==(i=t.current)||i.setAttribute(uRt,s),o.current=s}),o}var FRt=()=>{let[e,t]=s.useState(),r=jRt(()=>new Map);return ERt(()=>{r.current.forEach(e=>e()),r.current=new Map},[e]),(e,n)=>{r.current.set(e,n),t({})}};function zRt({asChild:e,children:t},r){return e&&s.isValidElement(t)?s.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 IRt={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const ARt=s.forwardRef(({className:e,...r},n)=>t.jsx(SRt,{ref:n,className:vdt("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...r}));ARt.displayName=SRt.displayName;const LRt=s.forwardRef(({className:e,...r},n)=>t.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[t.jsx(qst,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),t.jsx(SRt.Input,{ref:n,className:vdt("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...r})]}));LRt.displayName=SRt.Input.displayName;const BRt=s.forwardRef(({className:e,...r},n)=>t.jsx(SRt.List,{ref:n,className:vdt("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...r}));BRt.displayName=SRt.List.displayName;const VRt=s.forwardRef((e,r)=>t.jsx(SRt.Empty,{ref:r,className:"py-6 text-center text-sm",...e}));VRt.displayName=SRt.Empty.displayName;const HRt=s.forwardRef(({className:e,...r},n)=>t.jsx(SRt.Group,{ref:n,className:vdt("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...r}));HRt.displayName=SRt.Group.displayName;const qRt=s.forwardRef(({className:e,...r},n)=>t.jsx(SRt.Separator,{ref:n,className:vdt("-mx-1 h-px bg-border",e),...r}));qRt.displayName=SRt.Separator.displayName;const $Rt=s.forwardRef(({className:e,...r},n)=>t.jsx(SRt.Item,{ref:n,className:vdt("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...r}));$Rt.displayName=SRt.Item.displayName;const WRt=e=>{if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},URt=({day:e,weekday:r,translations:n})=>{const o=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].indexOf(r),a=n.dayNames[o];return t.jsxs("div",{className:"flex items-center w-full",children:[t.jsx("span",{className:"text-xs sm:text-sm text-muted-foreground italic whitespace-nowrap mr-1 sm:mr-2 pl-4",children:a}),t.jsxs("span",{className:"text-xs sm:text-sm font-medium truncate flex-grow text-center",children:[e,WRt(parseInt(e))]})]})};function GRt({className:e,selectedDate:r,onDateChange:n,isAnimating:o,direction:a,translations:i}){const[l,c]=s.useState(!1),u=s.useMemo(()=>(e=>eit({start:tit(e),end:Jat(e)}).map(e=>({dayNumber:Vit(e,"d"),weekday:Vit(e,"EEE"),value:Vit(e,"yyyy-MM-dd"),date:e})))(r),[r]),d=u.find(e=>Vit(e.date,"yyyy-MM-dd")===Vit(r,"yyyy-MM-dd"));return t.jsxs(fgt,{open:l,onOpenChange:c,children:[t.jsx(mgt,{asChild:!0,children:t.jsxs(Edt,{variant:"outline",role:"combobox","aria-expanded":l,"aria-label":i.selectDate,className:vdt("w-[120px] sm:w-[159px] justify-between border border-input bg-background hover:bg-accent hover:text-accent-foreground text-xs sm:text-sm p-2 sm:p-2",e),children:[t.jsx(Tbt,{mode:"wait",children:t.jsx(xDt.div,{initial:!!o&&{y:"down"===a?10:-10,opacity:0},animate:{y:0,opacity:1},exit:{y:"down"===a?-10:10,opacity:0},transition:{duration:.2},className:"w-full",children:d?t.jsx(URt,{day:d.dayNumber,weekday:d.weekday,translations:i}):t.jsx("span",{className:"text-xs sm:text-sm",children:i.selectDate})},null==d?void 0:d.value)}),t.jsx(_Tt,{className:"ml-1 sm:ml-2 h-4 w-4 sm:h-4 sm:w-4 shrink-0 opacity-50"})]})}),t.jsx(vgt,{className:"w-[120px] sm:w-[161px] p-0",children:t.jsxs(ARt,{children:[t.jsx(LRt,{placeholder:`${i.search} ${i.day.toLowerCase()}...`,className:"text-xs sm:text-sm"}),t.jsxs(BRt,{className:"max-h-[300px] overflow-y-auto",children:[t.jsx(VRt,{children:i.noEvents}),t.jsx(HRt,{children:u.map(e=>t.jsxs($Rt,{onSelect:()=>{n(e.date),c(!1)},className:"text-xs sm:text-sm",children:[t.jsx(URt,{day:e.dayNumber,weekday:e.weekday,translations:i}),t.jsx(MTt,{className:vdt("ml-auto h-4 w-4 sm:h-4 sm:w-4",(null==d?void 0:d.value)===e.value?"opacity-100":"opacity-0")})]},e.value))})]})]})})]})}function KRt({className:e,selectedMonth:r,onMonthChange:n,onDateChange:o,isAnimating:a,direction:i,translations:l,currentDate:c}){const[u,d]=s.useState(!1),p=l.monthNames.map(e=>({label:e,value:e.toLowerCase().slice(0,3)}));return t.jsxs(fgt,{open:u,onOpenChange:d,children:[t.jsx(mgt,{asChild:!0,children:t.jsxs(Edt,{variant:"outline",role:"combobox","aria-expanded":u,"aria-label":l.selectDate,className:vdt("w-[110px] sm:w-[151px] justify-center border border-input bg-background hover:bg-accent hover:text-accent-foreground text-xs sm:text-sm p-2 sm:p-2",e),children:[t.jsx(wTt,{className:"hidden sm:inline-block mr-2 h-4 w-4"}),t.jsx(Tbt,{mode:"wait",children:t.jsx(xDt.p,{className:"text-xs sm:text-sm flex-grow text-center",initial:!!a&&{y:"down"===i?10:-10,opacity:0},animate:{y:0,opacity:1},exit:{y:"down"===i?-10:10,opacity:0},transition:{duration:.2},children:r.label},r.value)}),t.jsx(_Tt,{className:"hidden sm:inline-block ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),t.jsx(vgt,{className:"w-[110px] sm:w-[151px] p-0",children:t.jsxs(ARt,{children:[t.jsx(LRt,{placeholder:l.search,className:"text-xs sm:text-sm"}),t.jsxs(BRt,{children:[t.jsx(VRt,{className:"text-xs sm:text-sm",children:l.noEvents}),t.jsx(HRt,{children:p.map(e=>t.jsxs($Rt,{onSelect:()=>(e=>{const t=c.getDate(),r=c.getFullYear(),a=p.findIndex(t=>t.value===e.value),i=new Date(r,a,t);i.getDate()!==t&&i.setMonth(a+1,0),n(e),o&&o(i),d(!1)})(e),className:"text-xs sm:text-sm",children:[e.label,t.jsx(MTt,{className:vdt("ml-auto h-4 w-4 sm:h-4 sm:w-4",r.value===e.value?"opacity-100":"opacity-0")})]},e.value))})]})]})})]})}function YRt({className:r,currentYear:n,onYearChange:o,onDateChange:a,currentDate:i,isAnimating:s,direction:l}){const[c,u]=e.useState(!1),[d,p]=e.useState(n),[h,f]=e.useState(n.toString());e.useEffect(()=>{p(n),f(n.toString())},[n]);const m=e=>{if(e>=1900&&e<=3100){const t=i.getDate(),r=i.getMonth(),n=new Date(e,r,t);n.getMonth()!==r&&n.setDate(0),p(e),f(e.toString()),o(e),a&&a(n)}},v=e=>{m(d+e)};return t.jsxs(fgt,{open:c,onOpenChange:u,children:[t.jsx(mgt,{asChild:!0,children:t.jsx(Edt,{variant:"outline",role:"combobox","aria-expanded":c,"aria-label":"Select a year",className:vdt("w-[70px] sm:w-[71px] justify-center border border-input bg-background hover:bg-accent hover:text-accent-foreground text-xs sm:text-sm p-2 sm:p-2",r),children:t.jsx(Tbt,{mode:"wait",children:t.jsx(xDt.p,{className:"text-xs sm:text-sm",initial:!!s&&{y:"down"===l?10:-10,opacity:0},animate:{y:0,opacity:1},exit:{y:"down"===l?-10:10,opacity:0},transition:{duration:.2},children:d},d)})})}),t.jsx(vgt,{className:"w-[90px] sm:w-[130px] p-2",children:t.jsxs("div",{className:"flex flex-col items-center",children:[t.jsx(Edt,{variant:"ghost",size:"sm",className:"w-full h-8",onClick:()=>v(1),children:t.jsx(Est,{className:"h-4 w-4 sm:h-4 sm:w-4"})}),t.jsx(Mmt,{type:"text",value:h,onChange:e=>{const t=e.target.value;f(t);const r=parseInt(t,10);!isNaN(r)&&r>=1900&&r<=2100&&m(r)},onBlur:()=>{h!==d.toString()&&f(d.toString())},className:"w-full text-center text-xs sm:text-sm h-8"}),t.jsx(Edt,{variant:"ghost",size:"sm",className:"w-full h-8",onClick:()=>v(-1),children:t.jsx(Dst,{className:"h-4 w-4 sm:h-4 sm:w-4"})})]})})]})}const XRt=({currentDate:e,currentView:r,handlePrevious:n,handleNext:o,lastUpdated:a,animationDirection:i,months:s,handleDayChange:l,handleMonthChange:c,handleYearChange:u,currentConfig:d})=>t.jsxs("div",{className:"flex items-center space-x-1 sm:space-x-2",children:[t.jsx(Edt,{variant:"ghost",onClick:n,size:"icon",className:"h-8 w-8 sm:h-10 sm:w-10",children:t.jsx(Ost,{className:"h-4 w-4"})}),t.jsxs(Tbt,{mode:"sync",children:["day"===r&&t.jsx(xDt.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:t.jsx(GRt,{translations:d.localization,className:"font-semibold text-sm sm:text-lg",selectedDate:e,onDateChange:l,isAnimating:"day"===a,direction:i})},"day-switcher"),"year"!==r&&t.jsx(xDt.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:t.jsx(KRt,{className:"font-semibold text-sm sm:text-lg",selectedMonth:s[e.getMonth()],onMonthChange:c,onDateChange:l,isAnimating:"month"===a,direction:i,translations:d.localization,currentDate:e})},"month-switcher"),t.jsx(xDt.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:t.jsx(YRt,{className:"font-semibold text-sm sm:text-lg",currentYear:e.getFullYear(),onYearChange:u,onDateChange:l,currentDate:e,isAnimating:"year"===a,direction:i})},"year-switcher")]}),t.jsx(Edt,{variant:"ghost",onClick:o,size:"icon",className:"h-8 w-8 sm:h-10 sm:w-10",children:t.jsx(Pst,{className:"h-4 w-4"})})]});var[ZRt,QRt]=Xst("Tooltip",[wyt]),JRt=wyt(),eFt="TooltipProvider",tFt=700,rFt="tooltip.open",[nFt,oFt]=ZRt(eFt),aFt=e=>{const{__scopeTooltip:r,delayDuration:n=tFt,skipDelayDuration:o=300,disableHoverableContent:a=!1,children:i}=e,l=s.useRef(!0),c=s.useRef(!1),u=s.useRef(0);return s.useEffect(()=>{const e=u.current;return()=>window.clearTimeout(e)},[]),t.jsx(nFt,{scope:r,isOpenDelayedRef:l,delayDuration:n,onOpen:s.useCallback(()=>{window.clearTimeout(u.current),l.current=!1},[]),onClose:s.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>l.current=!0,o)},[o]),isPointerInTransitRef:c,onPointerInTransitChange:s.useCallback(e=>{c.current=e},[]),disableHoverableContent:a,children:i})};aFt.displayName=eFt;var iFt="Tooltip",[sFt,lFt]=ZRt(iFt),cFt=e=>{const{__scopeTooltip:r,children:n,open:o,defaultOpen:a,onOpenChange:i,disableHoverableContent:l,delayDuration:c}=e,u=oFt(iFt,e.__scopeTooltip),d=JRt(r),[p,h]=s.useState(null),f=tlt(),m=s.useRef(0),v=l??u.disableHoverableContent,y=c??u.delayDuration,g=s.useRef(!1),[b,x]=nlt({prop:o,defaultProp:a??!1,onChange:e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(rFt))):u.onClose(),null==i||i(e)},caller:iFt}),w=s.useMemo(()=>b?g.current?"delayed-open":"instant-open":"closed",[b]),k=s.useCallback(()=>{window.clearTimeout(m.current),m.current=0,g.current=!1,x(!0)},[x]),_=s.useCallback(()=>{window.clearTimeout(m.current),m.current=0,x(!1)},[x]),C=s.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{g.current=!0,x(!0),m.current=0},y)},[y,x]);return s.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),t.jsx(Iyt,{...d,children:t.jsx(sFt,{scope:r,contentId:f,open:b,stateAttribute:w,trigger:p,onTriggerChange:h,onTriggerEnter:s.useCallback(()=>{u.isOpenDelayedRef.current?C():k()},[u.isOpenDelayedRef,C,k]),onTriggerLeave:s.useCallback(()=>{v?_():(window.clearTimeout(m.current),m.current=0)},[_,v]),onOpen:k,onClose:_,disableHoverableContent:v,children:n})})};cFt.displayName=iFt;var uFt="TooltipTrigger",dFt=s.forwardRef((e,r)=>{const{__scopeTooltip:n,...o}=e,a=lFt(uFt,n),i=oFt(uFt,n),l=JRt(n),c=Yst(r,s.useRef(null),a.onTriggerChange),u=s.useRef(!1),d=s.useRef(!1),p=s.useCallback(()=>u.current=!1,[]);return s.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),t.jsx(Ayt,{asChild:!0,...l,children:t.jsx(ult.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...o,ref:c,onPointerMove:Ust(e.onPointerMove,e=>{"touch"!==e.pointerType&&!d.current&&!i.isPointerInTransitRef.current&&(a.onTriggerEnter(),d.current=!0)}),onPointerLeave:Ust(e.onPointerLeave,()=>{a.onTriggerLeave(),d.current=!1}),onPointerDown:Ust(e.onPointerDown,()=>{a.open&&a.onClose(),u.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:Ust(e.onFocus,()=>{u.current||a.onOpen()}),onBlur:Ust(e.onBlur,a.onClose),onClick:Ust(e.onClick,a.onClose)})})});dFt.displayName=uFt;var[pFt,hFt]=ZRt("TooltipPortal",{forceMount:void 0}),fFt="TooltipContent",mFt=s.forwardRef((e,r)=>{const n=hFt(fFt,e.__scopeTooltip),{forceMount:o=n.forceMount,side:a="top",...i}=e,s=lFt(fFt,e.__scopeTooltip);return t.jsx(Nlt,{present:o||s.open,children:s.disableHoverableContent?t.jsx(xFt,{side:a,...i,ref:r}):t.jsx(vFt,{side:a,...i,ref:r})})}),vFt=s.forwardRef((e,r)=>{const n=lFt(fFt,e.__scopeTooltip),o=oFt(fFt,e.__scopeTooltip),a=s.useRef(null),i=Yst(r,a),[l,c]=s.useState(null),{trigger:u,onClose:d}=n,p=a.current,{onPointerInTransitChange:h}=o,f=s.useCallback(()=>{c(null),h(!1)},[h]),m=s.useCallback((e,t)=>{const r=e.currentTarget,n={x:e.clientX,y:e.clientY},o=function(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(r,n,o,a)){case a:return"left";case o:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}(n,r.getBoundingClientRect()),a=function(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r})}return n}(n,o),i=function(e){const{top:t,right:r,bottom:n,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:n},{x:o,y:n}]}(t.getBoundingClientRect()),s=function(e){const t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0),function(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const n=e[r];for(;t.length>=2;){const e=t[t.length-1],r=t[t.length-2];if(!((e.x-r.x)*(n.y-r.y)>=(e.y-r.y)*(n.x-r.x)))break;t.pop()}t.push(n)}t.pop();const r=[];for(let t=e.length-1;t>=0;t--){const n=e[t];for(;r.length>=2;){const e=r[r.length-1],t=r[r.length-2];if(!((e.x-t.x)*(n.y-t.y)>=(e.y-t.y)*(n.x-t.x)))break;r.pop()}r.push(n)}return r.pop(),1===t.length&&1===r.length&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}(t)}([...a,...i]);c(s),h(!0)},[h]);return s.useEffect(()=>()=>f(),[f]),s.useEffect(()=>{if(u&&p){const e=e=>m(e,p),t=e=>m(e,u);return u.addEventListener("pointerleave",e),p.addEventListener("pointerleave",t),()=>{u.removeEventListener("pointerleave",e),p.removeEventListener("pointerleave",t)}}},[u,p,m,f]),s.useEffect(()=>{if(l){const e=e=>{const t=e.target,r={x:e.clientX,y:e.clientY},n=(null==u?void 0:u.contains(t))||(null==p?void 0:p.contains(t)),o=!function(e,t){const{x:r,y:n}=e;let o=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){const i=t[e],s=t[a],l=i.x,c=i.y,u=s.x,d=s.y;c>n!=d>n&&r<(u-l)*(n-c)/(d-c)+l&&(o=!o)}return o}(r,l);n?f():o&&(f(),d())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}},[u,p,l,d,f]),t.jsx(xFt,{...e,ref:i})}),[yFt,gFt]=ZRt(iFt,{isInside:!1}),bFt=llt("TooltipContent"),xFt=s.forwardRef((e,r)=>{const{__scopeTooltip:n,children:o,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:l,...c}=e,u=lFt(fFt,n),d=JRt(n),{onClose:p}=u;return s.useEffect(()=>(document.addEventListener(rFt,p),()=>document.removeEventListener(rFt,p)),[p]),s.useEffect(()=>{if(u.trigger){const e=e=>{const t=e.target;null!=t&&t.contains(u.trigger)&&p()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}},[u.trigger,p]),t.jsx(glt,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:p,children:t.jsxs(Lyt,{"data-state":u.stateAttribute,...d,...c,ref:r,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[t.jsx(bFt,{children:o}),t.jsx(yFt,{scope:n,isInside:!0,children:t.jsx(ZDt,{id:u.contentId,role:"tooltip",children:a||o})})]})})});mFt.displayName=fFt;var wFt="TooltipArrow",kFt=s.forwardRef((e,r)=>{const{__scopeTooltip:n,...o}=e,a=JRt(n);return gFt(wFt,n).isInside?null:t.jsx(Byt,{...a,...o,ref:r})});kFt.displayName=wFt;var _Ft=mFt;const CFt=aFt,MFt=cFt,SFt=dFt,DFt=s.forwardRef(({className:e,sideOffset:r=4,...n},o)=>t.jsx(_Ft,{ref:o,sideOffset:r,className:vdt("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));DFt.displayName=_Ft.displayName;const OFt=({isListView:e,setIsListView:r,currentConfig:n})=>t.jsx(CFt,{children:t.jsxs(MFt,{children:[t.jsx(SFt,{asChild:!0,children:t.jsx(Edt,{variant:"outline",size:"sm",onClick:()=>r(!e),className:"flex items-center space-x-1 w-10 h-10 justify-center overflow-hidden",children:t.jsx(Tbt,{mode:"wait",children:t.jsx(xDt.div,{className:"flex items-center space-x-1",initial:{y:10,opacity:0},animate:{y:0,opacity:1},exit:{y:-10,opacity:0},transition:{duration:.15},children:e?t.jsx(Mst,{className:"h-4 w-4"}):t.jsx(Lst,{className:"h-4 w-4"})},e?"list":"calendar")})})}),t.jsx(DFt,{children:t.jsx("p",{children:e?n.localization.displayCalendar:n.localization.displayList})})]})});var PFt=["Enter"," "],EFt=["ArrowUp","PageDown","End"],jFt=["ArrowDown","PageUp","Home",...EFt],TFt={ltr:[...PFt,"ArrowRight"],rtl:[...PFt,"ArrowLeft"]},NFt={ltr:["ArrowLeft"],rtl:["ArrowRight"]},RFt="Menu",[FFt,zFt,IFt]=ygt(RFt),[AFt,LFt]=Xst(RFt,[IFt,wyt,Dgt]),BFt=wyt(),VFt=Dgt(),[HFt,qFt]=AFt(RFt),[$Ft,WFt]=AFt(RFt),UFt=e=>{const{__scopeMenu:r,open:n=!1,children:o,dir:a,onOpenChange:i,modal:l=!0}=e,c=BFt(r),[u,d]=s.useState(null),p=s.useRef(!1),h=plt(i),f=bgt(a);return s.useEffect(()=>{const e=()=>{p.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>p.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}},[]),t.jsx(Iyt,{...c,children:t.jsx(HFt,{scope:r,open:n,onOpenChange:h,content:u,onContentChange:d,children:t.jsx($Ft,{scope:r,onClose:s.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:p,dir:f,modal:l,children:o})})})};UFt.displayName=RFt;var GFt=s.forwardRef((e,r)=>{const{__scopeMenu:n,...o}=e,a=BFt(n);return t.jsx(Ayt,{...a,...o,ref:r})});GFt.displayName="MenuAnchor";var KFt="MenuPortal",[YFt,XFt]=AFt(KFt,{forceMount:void 0}),ZFt=e=>{const{__scopeMenu:r,forceMount:n,children:o,container:a}=e,i=qFt(KFt,r);return t.jsx(YFt,{scope:r,forceMount:n,children:t.jsx(Nlt,{present:n||i.open,children:t.jsx(Tlt,{asChild:!0,container:a,children:o})})})};ZFt.displayName=KFt;var QFt="MenuContent",[JFt,ezt]=AFt(QFt),tzt=s.forwardRef((e,r)=>{const n=XFt(QFt,e.__scopeMenu),{forceMount:o=n.forceMount,...a}=e,i=qFt(QFt,e.__scopeMenu),s=WFt(QFt,e.__scopeMenu);return t.jsx(FFt.Provider,{scope:e.__scopeMenu,children:t.jsx(Nlt,{present:o||i.open,children:t.jsx(FFt.Slot,{scope:e.__scopeMenu,children:s.modal?t.jsx(rzt,{...a,ref:r}):t.jsx(nzt,{...a,ref:r})})})})}),rzt=s.forwardRef((e,r)=>{const n=qFt(QFt,e.__scopeMenu),o=s.useRef(null),a=Yst(r,o);return s.useEffect(()=>{const e=o.current;if(e)return Nct(e)},[]),t.jsx(azt,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ust(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),nzt=s.forwardRef((e,r)=>{const n=qFt(QFt,e.__scopeMenu);return t.jsx(azt,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),ozt=olt("MenuContent.ScrollLock"),azt=s.forwardRef((e,r)=>{const{__scopeMenu:n,loop:o=!1,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:h,onInteractOutside:f,onDismiss:m,disableOutsideScroll:v,...y}=e,g=qFt(QFt,n),b=WFt(QFt,n),x=BFt(n),w=VFt(n),k=zFt(n),[_,C]=s.useState(null),M=s.useRef(null),S=Yst(r,M,g.onContentChange),D=s.useRef(0),O=s.useRef(""),P=s.useRef(0),E=s.useRef(null),j=s.useRef("right"),T=s.useRef(0),N=v?Sct:s.Fragment,R=v?{as:ozt,allowPinchZoom:!0}:void 0,F=e=>{var t,r;const n=O.current+e,o=k().filter(e=>!e.disabled),a=document.activeElement,i=null==(t=o.find(e=>e.ref.current===a))?void 0:t.textValue,s=function(e,t,r){const n=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let a=function(e,t){return e.map((r,n)=>e[(t+n)%e.length])}(e,Math.max(o,0));1===n.length&&(a=a.filter(e=>e!==r));const i=a.find(e=>e.toLowerCase().startsWith(n.toLowerCase()));return i!==r?i:void 0}(o.map(e=>e.textValue),n,i),l=null==(r=o.find(e=>e.textValue===s))?void 0:r.ref.current;(function e(t){O.current=t,window.clearTimeout(D.current),""!==t&&(D.current=window.setTimeout(()=>e(""),1e3))})(n),l&&setTimeout(()=>l.focus())};s.useEffect(()=>()=>window.clearTimeout(D.current),[]),zlt();const z=s.useCallback(e=>{var t,r;return j.current===(null==(t=E.current)?void 0:t.side)&&function(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return function(e,t){const{x:r,y:n}=e;let o=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){const i=t[e],s=t[a],l=i.x,c=i.y,u=s.x,d=s.y;c>n!=d>n&&r<(u-l)*(n-c)/(d-c)+l&&(o=!o)}return o}(r,t)}(e,null==(r=E.current)?void 0:r.area)},[]);return t.jsx(JFt,{scope:n,searchRef:O,onItemEnter:s.useCallback(e=>{z(e)&&e.preventDefault()},[z]),onItemLeave:s.useCallback(e=>{var t;z(e)||(null==(t=M.current)||t.focus(),C(null))},[z]),onTriggerLeave:s.useCallback(e=>{z(e)&&e.preventDefault()},[z]),pointerGraceTimerRef:P,onPointerGraceIntentChange:s.useCallback(e=>{E.current=e},[]),children:t.jsx(N,{...R,children:t.jsx(Mlt,{asChild:!0,trapped:a,onMountAutoFocus:Ust(i,e=>{var t;e.preventDefault(),null==(t=M.current)||t.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:t.jsx(glt,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:h,onInteractOutside:f,onDismiss:m,children:t.jsx(zgt,{asChild:!0,...w,dir:b.dir,orientation:"vertical",loop:o,currentTabStopId:_,onCurrentTabStopIdChange:C,onEntryFocus:Ust(u,e=>{b.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:t.jsx(Lyt,{role:"menu","aria-orientation":"vertical","data-state":jzt(g.open),"data-radix-menu-content":"",dir:b.dir,...x,...y,ref:S,style:{outline:"none",...y.style},onKeyDown:Ust(y.onKeyDown,e=>{const t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,r=e.ctrlKey||e.altKey||e.metaKey,n=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!r&&n&&F(e.key));const o=M.current;if(e.target!==o||!jFt.includes(e.key))return;e.preventDefault();const a=k().filter(e=>!e.disabled).map(e=>e.ref.current);EFt.includes(e.key)&&a.reverse(),function(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}(a)}),onBlur:Ust(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(D.current),O.current="")}),onPointerMove:Ust(e.onPointerMove,Rzt(e=>{const t=e.target,r=T.current!==e.clientX;if(e.currentTarget.contains(t)&&r){const t=e.clientX>T.current?"right":"left";j.current=t,T.current=e.clientX}}))})})})})})})});tzt.displayName=QFt;var izt=s.forwardRef((e,r)=>{const{__scopeMenu:n,...o}=e;return t.jsx(ult.div,{role:"group",...o,ref:r})});izt.displayName="MenuGroup";var szt=s.forwardRef((e,r)=>{const{__scopeMenu:n,...o}=e;return t.jsx(ult.div,{...o,ref:r})});szt.displayName="MenuLabel";var lzt="MenuItem",czt="menu.itemSelect",uzt=s.forwardRef((e,r)=>{const{disabled:n=!1,onSelect:o,...a}=e,i=s.useRef(null),l=WFt(lzt,e.__scopeMenu),c=ezt(lzt,e.__scopeMenu),u=Yst(r,i),d=s.useRef(!1);return t.jsx(dzt,{...a,ref:u,disabled:n,onClick:Ust(e.onClick,()=>{const e=i.current;if(!n&&e){const t=new CustomEvent(czt,{bubbles:!0,cancelable:!0});e.addEventListener(czt,e=>null==o?void 0:o(e),{once:!0}),dlt(e,t),t.defaultPrevented?d.current=!1:l.onClose()}}),onPointerDown:t=>{var r;null==(r=e.onPointerDown)||r.call(e,t),d.current=!0},onPointerUp:Ust(e.onPointerUp,e=>{var t;d.current||null==(t=e.currentTarget)||t.click()}),onKeyDown:Ust(e.onKeyDown,e=>{const t=""!==c.searchRef.current;n||t&&" "===e.key||PFt.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});uzt.displayName=lzt;var dzt=s.forwardRef((e,r)=>{const{__scopeMenu:n,disabled:o=!1,textValue:a,...i}=e,l=ezt(lzt,n),c=VFt(n),u=s.useRef(null),d=Yst(r,u),[p,h]=s.useState(!1),[f,m]=s.useState("");return s.useEffect(()=>{const e=u.current;e&&m((e.textContent??"").trim())},[i.children]),t.jsx(FFt.ItemSlot,{scope:n,disabled:o,textValue:a??f,children:t.jsx(Igt,{asChild:!0,...c,focusable:!o,children:t.jsx(ult.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...i,ref:d,onPointerMove:Ust(e.onPointerMove,Rzt(e=>{o?l.onItemLeave(e):(l.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ust(e.onPointerLeave,Rzt(e=>l.onItemLeave(e))),onFocus:Ust(e.onFocus,()=>h(!0)),onBlur:Ust(e.onBlur,()=>h(!1))})})})}),pzt=s.forwardRef((e,r)=>{const{checked:n=!1,onCheckedChange:o,...a}=e;return t.jsx(xzt,{scope:e.__scopeMenu,checked:n,children:t.jsx(uzt,{role:"menuitemcheckbox","aria-checked":Tzt(n)?"mixed":n,...a,ref:r,"data-state":Nzt(n),onSelect:Ust(a.onSelect,()=>null==o?void 0:o(!!Tzt(n)||!n),{checkForDefaultPrevented:!1})})})});pzt.displayName="MenuCheckboxItem";var hzt="MenuRadioGroup",[fzt,mzt]=AFt(hzt,{value:void 0,onValueChange:()=>{}}),vzt=s.forwardRef((e,r)=>{const{value:n,onValueChange:o,...a}=e,i=plt(o);return t.jsx(fzt,{scope:e.__scopeMenu,value:n,onValueChange:i,children:t.jsx(izt,{...a,ref:r})})});vzt.displayName=hzt;var yzt="MenuRadioItem",gzt=s.forwardRef((e,r)=>{const{value:n,...o}=e,a=mzt(yzt,e.__scopeMenu),i=n===a.value;return t.jsx(xzt,{scope:e.__scopeMenu,checked:i,children:t.jsx(uzt,{role:"menuitemradio","aria-checked":i,...o,ref:r,"data-state":Nzt(i),onSelect:Ust(o.onSelect,()=>{var e;return null==(e=a.onValueChange)?void 0:e.call(a,n)},{checkForDefaultPrevented:!1})})})});gzt.displayName=yzt;var bzt="MenuItemIndicator",[xzt,wzt]=AFt(bzt,{checked:!1}),kzt=s.forwardRef((e,r)=>{const{__scopeMenu:n,forceMount:o,...a}=e,i=wzt(bzt,n);return t.jsx(Nlt,{present:o||Tzt(i.checked)||!0===i.checked,children:t.jsx(ult.span,{...a,ref:r,"data-state":Nzt(i.checked)})})});kzt.displayName=bzt;var _zt=s.forwardRef((e,r)=>{const{__scopeMenu:n,...o}=e;return t.jsx(ult.div,{role:"separator","aria-orientation":"horizontal",...o,ref:r})});_zt.displayName="MenuSeparator";var Czt=s.forwardRef((e,r)=>{const{__scopeMenu:n,...o}=e,a=BFt(n);return t.jsx(Byt,{...a,...o,ref:r})});Czt.displayName="MenuArrow";var[Mzt,Szt]=AFt("MenuSub"),Dzt="MenuSubTrigger",Ozt=s.forwardRef((e,r)=>{const n=qFt(Dzt,e.__scopeMenu),o=WFt(Dzt,e.__scopeMenu),a=Szt(Dzt,e.__scopeMenu),i=ezt(Dzt,e.__scopeMenu),l=s.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=i,d={__scopeMenu:e.__scopeMenu},p=s.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return s.useEffect(()=>p,[p]),s.useEffect(()=>{const e=c.current;return()=>{window.clearTimeout(e),u(null)}},[c,u]),t.jsx(GFt,{asChild:!0,...d,children:t.jsx(dzt,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":a.contentId,"data-state":jzt(n.open),...e,ref:Kst(r,a.onTriggerChange),onClick:t=>{var r;null==(r=e.onClick)||r.call(e,t),!e.disabled&&!t.defaultPrevented&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ust(e.onPointerMove,Rzt(t=>{i.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!l.current&&(i.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{n.onOpenChange(!0),p()},100))})),onPointerLeave:Ust(e.onPointerLeave,Rzt(e=>{var t,r;p();const o=null==(t=n.content)?void 0:t.getBoundingClientRect();if(o){const t=null==(r=n.content)?void 0:r.dataset.side,a="right"===t,s=a?-5:5,l=o[a?"left":"right"],u=o[a?"right":"left"];i.onPointerGraceIntentChange({area:[{x:e.clientX+s,y:e.clientY},{x:l,y:o.top},{x:u,y:o.top},{x:u,y:o.bottom},{x:l,y:o.bottom}],side:t}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(e),e.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:Ust(e.onKeyDown,t=>{var r;const a=""!==i.searchRef.current;e.disabled||a&&" "===t.key||TFt[o.dir].includes(t.key)&&(n.onOpenChange(!0),null==(r=n.content)||r.focus(),t.preventDefault())})})})});Ozt.displayName=Dzt;var Pzt="MenuSubContent",Ezt=s.forwardRef((e,r)=>{const n=XFt(QFt,e.__scopeMenu),{forceMount:o=n.forceMount,...a}=e,i=qFt(QFt,e.__scopeMenu),l=WFt(QFt,e.__scopeMenu),c=Szt(Pzt,e.__scopeMenu),u=s.useRef(null),d=Yst(r,u);return t.jsx(FFt.Provider,{scope:e.__scopeMenu,children:t.jsx(Nlt,{present:o||i.open,children:t.jsx(FFt.Slot,{scope:e.__scopeMenu,children:t.jsx(azt,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:d,align:"start",side:"rtl"===l.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{var t;l.isUsingKeyboardRef.current&&(null==(t=u.current)||t.focus()),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:Ust(e.onFocusOutside,e=>{e.target!==c.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:Ust(e.onEscapeKeyDown,e=>{l.onClose(),e.preventDefault()}),onKeyDown:Ust(e.onKeyDown,e=>{var t;const r=e.currentTarget.contains(e.target),n=NFt[l.dir].includes(e.key);r&&n&&(i.onOpenChange(!1),null==(t=c.trigger)||t.focus(),e.preventDefault())})})})})})});function jzt(e){return e?"open":"closed"}function Tzt(e){return"indeterminate"===e}function Nzt(e){return Tzt(e)?"indeterminate":e?"checked":"unchecked"}function Rzt(e){return t=>"mouse"===t.pointerType?e(t):void 0}Ezt.displayName=Pzt;var Fzt=UFt,zzt=GFt,Izt=ZFt,Azt=tzt,Lzt=izt,Bzt=szt,Vzt=uzt,Hzt=pzt,qzt=vzt,$zt=gzt,Wzt=kzt,Uzt=_zt,Gzt=Czt,Kzt=Ozt,Yzt=Ezt,Xzt="DropdownMenu",[Zzt,Qzt]=Xst(Xzt,[LFt]),Jzt=LFt(),[eIt,tIt]=Zzt(Xzt),rIt=e=>{const{__scopeDropdownMenu:r,children:n,dir:o,open:a,defaultOpen:i,onOpenChange:l,modal:c=!0}=e,u=Jzt(r),d=s.useRef(null),[p,h]=nlt({prop:a,defaultProp:i??!1,onChange:l,caller:Xzt});return t.jsx(eIt,{scope:r,triggerId:tlt(),triggerRef:d,contentId:tlt(),open:p,onOpenChange:h,onOpenToggle:s.useCallback(()=>h(e=>!e),[h]),modal:c,children:t.jsx(Fzt,{...u,open:p,onOpenChange:h,dir:o,modal:c,children:n})})};rIt.displayName=Xzt;var nIt="DropdownMenuTrigger",oIt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,disabled:o=!1,...a}=e,i=tIt(nIt,n),s=Jzt(n);return t.jsx(zzt,{asChild:!0,...s,children:t.jsx(ult.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...a,ref:Kst(r,i.triggerRef),onPointerDown:Ust(e.onPointerDown,e=>{!o&&0===e.button&&!1===e.ctrlKey&&(i.onOpenToggle(),i.open||e.preventDefault())}),onKeyDown:Ust(e.onKeyDown,e=>{o||(["Enter"," "].includes(e.key)&&i.onOpenToggle(),"ArrowDown"===e.key&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())})})})});oIt.displayName=nIt;var aIt=e=>{const{__scopeDropdownMenu:r,...n}=e,o=Jzt(r);return t.jsx(Izt,{...o,...n})};aIt.displayName="DropdownMenuPortal";var iIt="DropdownMenuContent",sIt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=tIt(iIt,n),i=Jzt(n),l=s.useRef(!1);return t.jsx(Azt,{id:a.contentId,"aria-labelledby":a.triggerId,...i,...o,ref:r,onCloseAutoFocus:Ust(e.onCloseAutoFocus,e=>{var t;l.current||null==(t=a.triggerRef.current)||t.focus(),l.current=!1,e.preventDefault()}),onInteractOutside:Ust(e.onInteractOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey,n=2===t.button||r;(!a.modal||n)&&(l.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});sIt.displayName=iIt;var lIt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=Jzt(n);return t.jsx(Lzt,{...a,...o,ref:r})});lIt.displayName="DropdownMenuGroup";var cIt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=Jzt(n);return t.jsx(Bzt,{...a,...o,ref:r})});cIt.displayName="DropdownMenuLabel";var uIt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=Jzt(n);return t.jsx(Vzt,{...a,...o,ref:r})});uIt.displayName="DropdownMenuItem";var dIt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=Jzt(n);return t.jsx(Hzt,{...a,...o,ref:r})});dIt.displayName="DropdownMenuCheckboxItem";var pIt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=Jzt(n);return t.jsx(qzt,{...a,...o,ref:r})});pIt.displayName="DropdownMenuRadioGroup";var hIt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=Jzt(n);return t.jsx($zt,{...a,...o,ref:r})});hIt.displayName="DropdownMenuRadioItem";var fIt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=Jzt(n);return t.jsx(Wzt,{...a,...o,ref:r})});fIt.displayName="DropdownMenuItemIndicator";var mIt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=Jzt(n);return t.jsx(Uzt,{...a,...o,ref:r})});mIt.displayName="DropdownMenuSeparator";var vIt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=Jzt(n);return t.jsx(Gzt,{...a,...o,ref:r})});vIt.displayName="DropdownMenuArrow";var yIt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=Jzt(n);return t.jsx(Kzt,{...a,...o,ref:r})});yIt.displayName="DropdownMenuSubTrigger";var gIt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=Jzt(n);return t.jsx(Yzt,{...a,...o,ref:r,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});gIt.displayName="DropdownMenuSubContent";var bIt=aIt,xIt=sIt,wIt=cIt,kIt=uIt,_It=dIt,CIt=hIt,MIt=fIt,SIt=mIt,DIt=yIt,OIt=gIt;const PIt=rIt,EIt=oIt,jIt=s.forwardRef(({className:e,inset:r,children:n,...o},a)=>t.jsxs(DIt,{ref:a,className:vdt("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",r&&"pl-8",e),...o,children:[n,t.jsx(Pst,{className:"ml-auto"})]}));jIt.displayName=DIt.displayName;const TIt=s.forwardRef(({className:e,...r},n)=>t.jsx(OIt,{ref:n,className:vdt("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));TIt.displayName=OIt.displayName;const NIt=s.forwardRef(({className:e,sideOffset:r=4,...n},o)=>t.jsx(bIt,{children:t.jsx(xIt,{ref:o,sideOffset:r,className:vdt("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));NIt.displayName=xIt.displayName;const RIt=s.forwardRef(({className:e,inset:r,...n},o)=>t.jsx(kIt,{ref:o,className:vdt("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",r&&"pl-8",e),...n}));RIt.displayName=kIt.displayName;const FIt=s.forwardRef(({className:e,children:r,checked:n,...o},a)=>t.jsxs(_It,{ref:a,className:vdt("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...o,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(MIt,{children:t.jsx(Sst,{className:"h-4 w-4"})})}),r]}));FIt.displayName=_It.displayName;const zIt=s.forwardRef(({className:e,children:r,...n},o)=>t.jsxs(CIt,{ref:o,className:vdt("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(MIt,{children:t.jsx(Nst,{className:"h-2 w-2 fill-current"})})}),r]}));zIt.displayName=CIt.displayName;const IIt=s.forwardRef(({className:e,inset:r,...n},o)=>t.jsx(wIt,{ref:o,className:vdt("px-2 py-1.5 text-sm font-semibold",r&&"pl-8",e),...n}));IIt.displayName=wIt.displayName;const AIt=s.forwardRef(({className:e,...r},n)=>t.jsx(SIt,{ref:n,className:vdt("-mx-1 my-1 h-px bg-muted",e),...r}));AIt.displayName=SIt.displayName;const LIt=({isFilterOpen:e,setIsFilterOpen:r,resources:n,selectedResourceIds:o,toggleResourceSelection:a,currentConfig:i})=>n&&0!==n.length?t.jsxs(PIt,{open:e,onOpenChange:r,children:[t.jsx(EIt,{asChild:!0,children:t.jsx(Edt,{variant:"outline",size:"sm",className:"w-24 overflow-hidden",children:t.jsx(Tbt,{mode:"wait",children:t.jsxs(xDt.div,{className:"flex items-center space-x-1",initial:{y:10,opacity:0},animate:{y:0,opacity:1},exit:{y:-10,opacity:0},transition:{duration:.15},children:[t.jsx(zst,{className:"h-4 w-4 flex-shrink-0"}),t.jsx("span",{className:"text-xs font-medium",children:e?i.localization.filtering:i.localization.filter})]},e?"open":"closed")})})}),t.jsxs(NIt,{children:[t.jsx(IIt,{children:i.localization.filter}),t.jsx(AIt,{}),n.map(e=>t.jsx(FIt,{checked:o.includes(e.id),onCheckedChange:()=>a(e.id),onSelect:e=>{e.preventDefault()},children:t.jsxs("div",{className:"flex items-center",children:[e.accentClass&&t.jsx("div",{className:`w-4 h-4 rounded mr-2 ${e.accentClass}`}),e.name]})},e.id)),t.jsx(AIt,{}),t.jsx(Edt,{variant:"ghost",size:"sm",onClick:()=>r(!1),className:"w-full justify-center h-8 text-sm",children:i.localization.close})]})]}):null,BIt=({is24HourFormat:e,isTimeFormatChanging:r,toggleTimeFormat:n})=>t.jsx(Edt,{variant:"outline",size:"sm",onClick:n,disabled:r,className:"flex items-center space-x-1 w-20 justify-center overflow-hidden",children:t.jsx(Tbt,{mode:"wait",children:t.jsxs(xDt.div,{className:"flex items-center space-x-1",initial:{y:10,opacity:0},animate:{y:0,opacity:1},exit:{y:-10,opacity:0},transition:{duration:.15},children:[t.jsx(Rst,{className:"h-4 w-4 flex-shrink-0"}),t.jsx("span",{className:"text-xs font-medium",children:e?"24h":"12h"})]},e?"24h":"12h")})}),VIt=({handleTodayClick:e,isTodayDisabled:r,getTodayButtonText:n})=>t.jsx(Edt,{variant:"outline",size:"sm",onClick:e,disabled:r,className:"flex items-center space-x-1 w-28 h-10 justify-center overflow-hidden",children:t.jsx(Tbt,{mode:"wait",children:t.jsxs(xDt.div,{className:"flex items-center space-x-1",initial:{opacity:0},animate:{opacity:[0,1.05,1]},transition:{duration:.2,times:[0,.8,1]},children:[t.jsx(Mst,{className:"h-4 w-4 flex-shrink-0"}),t.jsx("span",{children:n()})]},n())})}),HIt=({currentView:e,setCurrentView:r,viewOptions:n,currentConfig:o})=>t.jsx("div",{className:"inline-flex items-center rounded-md border border-input bg-transparent p-1 w-full sm:w-[240px]",children:t.jsx(CFt,{children:n.map(n=>{const a=n.icon,i=e===n.value;return t.jsxs(MFt,{children:[t.jsx(SFt,{asChild:!0,children:t.jsx(xDt.div,{className:"relative flex-grow",initial:!1,animate:{flex:i?2:1},transition:{duration:.2},children:t.jsx(Edt,{variant:i?"secondary":"ghost",size:"sm",className:vdt("relative h-8 w-full overflow-hidden transition-colors",i?"bg-secondary text-secondary-foreground":"hover:bg-secondary/50 hover:text-secondary-foreground",!i&&"cursor-pointer"),onClick:()=>r(n.value),children:t.jsxs("div",{className:"flex items-center justify-center space-x-1 w-full",children:[t.jsx(a,{className:vdt("h-4 w-4 flex-shrink-0",i?"text-primary":"text-muted-foreground")}),t.jsx(Tbt,{children:i&&t.jsx(xDt.span,{className:"text-xs font-medium whitespace-nowrap overflow-hidden",initial:{opacity:0,width:0},animate:{opacity:1,width:"auto"},exit:{opacity:0,width:0},transition:{duration:.2},children:n.label})})]})})})}),t.jsx(DFt,{children:t.jsx("p",{children:`${o.localization.viewBy} ${n.label}`})})]},n.value)})})}),qIt=({currentDate:r,currentView:n,handlePrevious:o,handleNext:a,handleTodayClick:i,toggleTimeFormat:s,setCurrentView:l,isTimeFormatChanging:c,use24HourFormat:u,lastUpdated:d,animationDirection:p,months:h,handleDayChange:f,handleMonthChange:m,handleYearChange:v,currentConfig:y,onEventAdd:g,onEventDelete:b,isListView:x,setIsListView:w,resources:k,selectedResourceIds:_,setSelectedResourceIds:C})=>{const[M,S]=e.useState(!1);(({handleNext:t,handlePrevious:r})=>{const[n,o]=e.useState(0),[a,i]=e.useState(!1);e.useEffect(()=>{const e=e=>{if("ArrowLeft"===e.key||"ArrowRight"===e.key){e.preventDefault();const s=Date.now();!a&&s-n>200&&(i(!0),o(s),"ArrowLeft"===e.key?r():t())}},s=e=>{("ArrowLeft"===e.key||"ArrowRight"===e.key)&&i(!1)};return window.addEventListener("keydown",e),window.addEventListener("keyup",s),()=>{window.removeEventListener("keydown",e),window.removeEventListener("keyup",s)}},[t,r,a,n])})({handleNext:a,handlePrevious:o});const D=[{value:"day",label:y.localization.day,icon:Bst},{value:"week",label:y.localization.week,icon:Fst},{value:"month",label:y.localization.month,icon:Ist},{value:"year",label:y.localization.year,icon:Ast}];return t.jsxs("div",{className:"flex flex-col xl:flex-row justify-between items-center mb-4 space-y-2 sm:px-0",children:[t.jsx(XRt,{currentDate:r,currentView:n,handlePrevious:o,handleNext:a,lastUpdated:d,animationDirection:p,months:h,handleDayChange:f,handleMonthChange:m,handleYearChange:v,currentConfig:y}),t.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2 w-full sm:w-auto",children:[t.jsx(BIt,{is24HourFormat:u,isTimeFormatChanging:c,toggleTimeFormat:s}),t.jsx(LIt,{isFilterOpen:M,setIsFilterOpen:S,resources:k,selectedResourceIds:_,toggleResourceSelection:e=>{C(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},currentConfig:y}),t.jsx(VIt,{handleTodayClick:i,isTodayDisabled:(()=>{const e=new Date;switch(n){case"day":return Gat(r,e);case"week":return Gat(Iat(r,{weekStartsOn:u?1:0}),Iat(e,{weekStartsOn:u?1:0}));case"month":return Git(r,e);case"year":return r.getFullYear()===e.getFullYear();default:return!1}})(),getTodayButtonText:()=>{switch(n){case"day":default:return y.localization.today;case"week":return y.localization.thisWeek;case"month":return y.localization.thisMonth;case"year":return y.localization.thisYear}}}),t.jsx(OFt,{isListView:x,setIsListView:w,currentConfig:y}),t.jsx(HIt,{currentView:n,setCurrentView:l,viewOptions:D,currentConfig:y}),t.jsx(gTt,{translations:y.localization,event:(()=>{switch(n){case"day":default:return{startDate:r,endDate:r};case"week":return{startDate:Iat(r,{weekStartsOn:u?1:0}),endDate:oit(r,{weekStartsOn:u?1:0})}}})(),onAddEvent:g,onDeleteEvent:b,resources:k})]})]})},$It=({currentView:t,currentDate:r,onDateRangeChange:n,is24HourFormat:o})=>{const a=e.useRef(r),i=e.useRef(t),s=e.useCallback(()=>{let e,n;switch(t){case"day":default:e=Bat(r),n=Qat(r);break;case"week":e=Iat(r,{weekStartsOn:o?1:0}),n=oit(r,{weekStartsOn:o?1:0});break;case"month":e=tit(r),n=Jat(r);break;case"year":e=nit(r),n=rit(r)}return{startDate:e,endDate:n}},[t,r,o]),l=e.useCallback(()=>{if(t!==i.current)return!0;const e=a.current;switch(t){case"day":return!Gat(r,e);case"week":return!function(e,t,r){return+Iat(e,r)==+Iat(t,r)}(r,e,{weekStartsOn:o?1:0});case"month":return!Git(r,e);case"year":return!Kit(r,e);default:return!0}},[t,r,o]);e.useEffect(()=>{(async()=>{if(n&&l()){const{startDate:e,endDate:o}=s();await n(e,o),a.current=r,i.current=t}})()},[t,r,n,s,l])},WIt=s.forwardRef(({className:e,...r},n)=>t.jsx("div",{ref:n,className:vdt("rounded-lg border bg-card text-card-foreground shadow-sm",e),...r}));WIt.displayName="Card";const UIt=s.forwardRef(({className:e,...r},n)=>t.jsx("div",{ref:n,className:vdt("flex flex-col space-y-1.5 p-6",e),...r}));UIt.displayName="CardHeader";const GIt=s.forwardRef(({className:e,...r},n)=>t.jsx("div",{ref:n,className:vdt("text-2xl font-semibold leading-none tracking-tight",e),...r}));GIt.displayName="CardTitle";const KIt=s.forwardRef(({className:e,...r},n)=>t.jsx("div",{ref:n,className:vdt("text-sm text-muted-foreground",e),...r}));KIt.displayName="CardDescription";const YIt=s.forwardRef(({className:e,...r},n)=>t.jsx("div",{ref:n,className:vdt("p-6 pt-0",e),...r}));YIt.displayName="CardContent";const XIt=s.forwardRef(({className:e,...r},n)=>t.jsx("div",{ref:n,className:vdt("flex items-center p-6 pt-0",e),...r}));XIt.displayName="CardFooter";var ZIt="ScrollArea",[QIt,JIt]=Xst(ZIt),[eAt,tAt]=QIt(ZIt),rAt=s.forwardRef((e,r)=>{const{__scopeScrollArea:n,type:o="hover",dir:a,scrollHideDelay:i=600,...l}=e,[c,u]=s.useState(null),[d,p]=s.useState(null),[h,f]=s.useState(null),[m,v]=s.useState(null),[y,g]=s.useState(null),[b,x]=s.useState(0),[w,k]=s.useState(0),[_,C]=s.useState(!1),[M,S]=s.useState(!1),D=Yst(r,e=>u(e)),O=bgt(a);return t.jsx(eAt,{scope:n,type:o,dir:O,scrollHideDelay:i,scrollArea:c,viewport:d,onViewportChange:p,content:h,onContentChange:f,scrollbarX:m,onScrollbarXChange:v,scrollbarXEnabled:_,onScrollbarXEnabledChange:C,scrollbarY:y,onScrollbarYChange:g,scrollbarYEnabled:M,onScrollbarYEnabledChange:S,onCornerWidthChange:x,onCornerHeightChange:k,children:t.jsx(ult.div,{dir:O,...l,ref:D,style:{position:"relative","--radix-scroll-area-corner-width":b+"px","--radix-scroll-area-corner-height":w+"px",...e.style}})})});rAt.displayName=ZIt;var nAt="ScrollAreaViewport",oAt=s.forwardRef((e,r)=>{const{__scopeScrollArea:n,children:o,nonce:a,...i}=e,l=tAt(nAt,n),c=Yst(r,s.useRef(null),l.onViewportChange);return t.jsxs(t.Fragment,{children:[t.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:a}),t.jsx(ult.div,{"data-radix-scroll-area-viewport":"",...i,ref:c,style:{overflowX:l.scrollbarXEnabled?"scroll":"hidden",overflowY:l.scrollbarYEnabled?"scroll":"hidden",...e.style},children:t.jsx("div",{ref:l.onContentChange,style:{minWidth:"100%",display:"table"},children:o})})]})});oAt.displayName=nAt;var aAt="ScrollAreaScrollbar",iAt=s.forwardRef((e,r)=>{const{forceMount:n,...o}=e,a=tAt(aAt,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:l}=a,c="horizontal"===e.orientation;return s.useEffect(()=>(c?i(!0):l(!0),()=>{c?i(!1):l(!1)}),[c,i,l]),"hover"===a.type?t.jsx(sAt,{...o,ref:r,forceMount:n}):"scroll"===a.type?t.jsx(lAt,{...o,ref:r,forceMount:n}):"auto"===a.type?t.jsx(cAt,{...o,ref:r,forceMount:n}):"always"===a.type?t.jsx(uAt,{...o,ref:r}):null});iAt.displayName=aAt;var sAt=s.forwardRef((e,r)=>{const{forceMount:n,...o}=e,a=tAt(aAt,e.__scopeScrollArea),[i,l]=s.useState(!1);return s.useEffect(()=>{const e=a.scrollArea;let t=0;if(e){const r=()=>{window.clearTimeout(t),l(!0)},n=()=>{t=window.setTimeout(()=>l(!1),a.scrollHideDelay)};return e.addEventListener("pointerenter",r),e.addEventListener("pointerleave",n),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",r),e.removeEventListener("pointerleave",n)}}},[a.scrollArea,a.scrollHideDelay]),t.jsx(Nlt,{present:n||i,children:t.jsx(cAt,{"data-state":i?"visible":"hidden",...o,ref:r})})}),lAt=s.forwardRef((e,r)=>{const{forceMount:n,...o}=e,a=tAt(aAt,e.__scopeScrollArea),i="horizontal"===e.orientation,l=PAt(()=>u("SCROLL_END"),100),[c,u]=function(e,t){return s.useReducer((e,r)=>t[e][r]??e,e)}("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return s.useEffect(()=>{if("idle"===c){const e=window.setTimeout(()=>u("HIDE"),a.scrollHideDelay);return()=>window.clearTimeout(e)}},[c,a.scrollHideDelay,u]),s.useEffect(()=>{const e=a.viewport,t=i?"scrollLeft":"scrollTop";if(e){let r=e[t];const n=()=>{const n=e[t];r!==n&&(u("SCROLL"),l()),r=n};return e.addEventListener("scroll",n),()=>e.removeEventListener("scroll",n)}},[a.viewport,i,u,l]),t.jsx(Nlt,{present:n||"hidden"!==c,children:t.jsx(uAt,{"data-state":"hidden"===c?"hidden":"visible",...o,ref:r,onPointerEnter:Ust(e.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:Ust(e.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),cAt=s.forwardRef((e,r)=>{const n=tAt(aAt,e.__scopeScrollArea),{forceMount:o,...a}=e,[i,l]=s.useState(!1),c="horizontal"===e.orientation,u=PAt(()=>{if(n.viewport){const e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;l(c?e:t)}},10);return EAt(n.viewport,u),EAt(n.content,u),t.jsx(Nlt,{present:o||i,children:t.jsx(uAt,{"data-state":i?"visible":"hidden",...a,ref:r})})}),uAt=s.forwardRef((e,r)=>{const{orientation:n="vertical",...o}=e,a=tAt(aAt,e.__scopeScrollArea),i=s.useRef(null),l=s.useRef(0),[c,u]=s.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=_At(c.viewport,c.content),p={...o,sizes:c,onSizesChange:u,hasThumb:d>0&&d<1,onThumbChange:e=>i.current=e,onThumbPointerUp:()=>l.current=0,onThumbPointerDown:e=>l.current=e};function h(e,t){return function(e,t,r,n="ltr"){const o=CAt(r),a=o/2,i=t||a,s=o-i,l=r.scrollbar.paddingStart+i,c=r.scrollbar.size-r.scrollbar.paddingEnd-s,u=r.content-r.viewport,d="ltr"===n?[0,u]:[-1*u,0];return SAt([l,c],d)(e)}(e,l.current,c,t)}return"horizontal"===n?t.jsx(dAt,{...p,ref:r,onThumbPositionChange:()=>{if(a.viewport&&i.current){const e=MAt(a.viewport.scrollLeft,c,a.dir);i.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{a.viewport&&(a.viewport.scrollLeft=e)},onDragScroll:e=>{a.viewport&&(a.viewport.scrollLeft=h(e,a.dir))}}):"vertical"===n?t.jsx(pAt,{...p,ref:r,onThumbPositionChange:()=>{if(a.viewport&&i.current){const e=MAt(a.viewport.scrollTop,c);i.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{a.viewport&&(a.viewport.scrollTop=e)},onDragScroll:e=>{a.viewport&&(a.viewport.scrollTop=h(e))}}):null}),dAt=s.forwardRef((e,r)=>{const{sizes:n,onSizesChange:o,...a}=e,i=tAt(aAt,e.__scopeScrollArea),[l,c]=s.useState(),u=s.useRef(null),d=Yst(r,u,i.onScrollbarXChange);return s.useEffect(()=>{u.current&&c(getComputedStyle(u.current))},[u]),t.jsx(mAt,{"data-orientation":"horizontal",...a,ref:d,sizes:n,style:{bottom:0,left:"rtl"===i.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===i.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":CAt(n)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,r)=>{if(i.viewport){const n=i.viewport.scrollLeft+t.deltaX;e.onWheelScroll(n),DAt(n,r)&&t.preventDefault()}},onResize:()=>{u.current&&i.viewport&&l&&o({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:kAt(l.paddingLeft),paddingEnd:kAt(l.paddingRight)}})}})}),pAt=s.forwardRef((e,r)=>{const{sizes:n,onSizesChange:o,...a}=e,i=tAt(aAt,e.__scopeScrollArea),[l,c]=s.useState(),u=s.useRef(null),d=Yst(r,u,i.onScrollbarYChange);return s.useEffect(()=>{u.current&&c(getComputedStyle(u.current))},[u]),t.jsx(mAt,{"data-orientation":"vertical",...a,ref:d,sizes:n,style:{top:0,right:"ltr"===i.dir?0:void 0,left:"rtl"===i.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":CAt(n)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,r)=>{if(i.viewport){const n=i.viewport.scrollTop+t.deltaY;e.onWheelScroll(n),DAt(n,r)&&t.preventDefault()}},onResize:()=>{u.current&&i.viewport&&l&&o({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:kAt(l.paddingTop),paddingEnd:kAt(l.paddingBottom)}})}})}),[hAt,fAt]=QIt(aAt),mAt=s.forwardRef((e,r)=>{const{__scopeScrollArea:n,sizes:o,hasThumb:a,onThumbChange:i,onThumbPointerUp:l,onThumbPointerDown:c,onThumbPositionChange:u,onDragScroll:d,onWheelScroll:p,onResize:h,...f}=e,m=tAt(aAt,n),[v,y]=s.useState(null),g=Yst(r,e=>y(e)),b=s.useRef(null),x=s.useRef(""),w=m.viewport,k=o.content-o.viewport,_=plt(p),C=plt(u),M=PAt(h,10);function S(e){if(b.current){const t=e.clientX-b.current.left,r=e.clientY-b.current.top;d({x:t,y:r})}}return s.useEffect(()=>{const e=e=>{const t=e.target;(null==v?void 0:v.contains(t))&&_(e,k)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})},[w,v,k,_]),s.useEffect(C,[o,C]),EAt(v,M),EAt(m.content,M),t.jsx(hAt,{scope:n,scrollbar:v,hasThumb:a,onThumbChange:plt(i),onThumbPointerUp:plt(l),onThumbPositionChange:C,onThumbPointerDown:plt(c),children:t.jsx(ult.div,{...f,ref:g,style:{position:"absolute",...f.style},onPointerDown:Ust(e.onPointerDown,e=>{0===e.button&&(e.target.setPointerCapture(e.pointerId),b.current=v.getBoundingClientRect(),x.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),S(e))}),onPointerMove:Ust(e.onPointerMove,S),onPointerUp:Ust(e.onPointerUp,e=>{const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=x.current,m.viewport&&(m.viewport.style.scrollBehavior=""),b.current=null})})})}),vAt="ScrollAreaThumb",yAt=s.forwardRef((e,r)=>{const{forceMount:n,...o}=e,a=fAt(vAt,e.__scopeScrollArea);return t.jsx(Nlt,{present:n||a.hasThumb,children:t.jsx(gAt,{ref:r,...o})})}),gAt=s.forwardRef((e,r)=>{const{__scopeScrollArea:n,style:o,...a}=e,i=tAt(vAt,n),l=fAt(vAt,n),{onThumbPositionChange:c}=l,u=Yst(r,e=>l.onThumbChange(e)),d=s.useRef(void 0),p=PAt(()=>{d.current&&(d.current(),d.current=void 0)},100);return s.useEffect(()=>{const e=i.viewport;if(e){const t=()=>{if(p(),!d.current){const t=OAt(e,c);d.current=t,c()}};return c(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[i.viewport,p,c]),t.jsx(ult.div,{"data-state":l.hasThumb?"visible":"hidden",...a,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...o},onPointerDownCapture:Ust(e.onPointerDownCapture,e=>{const t=e.target.getBoundingClientRect(),r=e.clientX-t.left,n=e.clientY-t.top;l.onThumbPointerDown({x:r,y:n})}),onPointerUp:Ust(e.onPointerUp,l.onThumbPointerUp)})});yAt.displayName=vAt;var bAt="ScrollAreaCorner",xAt=s.forwardRef((e,r)=>{const n=tAt(bAt,e.__scopeScrollArea),o=!(!n.scrollbarX||!n.scrollbarY);return"scroll"!==n.type&&o?t.jsx(wAt,{...e,ref:r}):null});xAt.displayName=bAt;var wAt=s.forwardRef((e,r)=>{const{__scopeScrollArea:n,...o}=e,a=tAt(bAt,n),[i,l]=s.useState(0),[c,u]=s.useState(0),d=!(!i||!c);return EAt(a.scrollbarX,()=>{var e;const t=(null==(e=a.scrollbarX)?void 0:e.offsetHeight)||0;a.onCornerHeightChange(t),u(t)}),EAt(a.scrollbarY,()=>{var e;const t=(null==(e=a.scrollbarY)?void 0:e.offsetWidth)||0;a.onCornerWidthChange(t),l(t)}),d?t.jsx(ult.div,{...o,ref:r,style:{width:i,height:c,position:"absolute",right:"ltr"===a.dir?0:void 0,left:"rtl"===a.dir?0:void 0,bottom:0,...e.style}}):null});function kAt(e){return e?parseInt(e,10):0}function _At(e,t){const r=e/t;return isNaN(r)?0:r}function CAt(e){const t=_At(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function MAt(e,t,r="ltr"){const n=CAt(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-o,i=t.content-t.viewport,s=a-n,l=KDt(e,"ltr"===r?[0,i]:[-1*i,0]);return SAt([0,i],[0,s])(l)}function SAt(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 DAt(e,t){return e>0&&e<t}var OAt=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function o(){const a={left:e.scrollLeft,top:e.scrollTop},i=r.left!==a.left,s=r.top!==a.top;(i||s)&&t(),r=a,n=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(n)};function PAt(e,t){const r=plt(e),n=s.useRef(0);return s.useEffect(()=>()=>window.clearTimeout(n.current),[]),s.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function EAt(e,t){const r=plt(t);Qst(()=>{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 jAt=rAt,TAt=oAt,NAt=xAt;const RAt=s.forwardRef(({className:e,children:r,...n},o)=>t.jsxs(jAt,{ref:o,className:vdt("relative overflow-hidden",e),...n,children:[t.jsx(TAt,{className:"h-full w-full rounded-[inherit]",children:r}),t.jsx(FAt,{}),t.jsx(NAt,{})]}));RAt.displayName=jAt.displayName;const FAt=s.forwardRef(({className:e,orientation:r="vertical",...n},o)=>t.jsx(iAt,{ref:o,orientation:r,className:vdt("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 flex-col border-t border-t-transparent p-[1px]",e),...n,children:t.jsx(yAt,{className:"relative flex-1 rounded-full bg-border"})}));FAt.displayName=iAt.displayName;const zAt=(e,t)=>((e,t)=>{const{hours:r,minutes:n}=qDt(e),o=lst(sst(new Date,r),n);return t?Vit(o,"HH:mm"):Vit(o,"h:mm").toLowerCase()+Vit(o,"a").toLowerCase()})(e,t),IAt=(e,t,r)=>r?Vit(sst(e,t),"HH:mm"):Vit(sst(e,t),"h a").toLowerCase(),AAt=e=>{if(!e)return{};try{if(typeof window<"u"){const t=(new Option).style;if(t.color="",t.color=e,""!==t.color)return{backgroundColor:e}}}catch{}return{backgroundColor:e}},LAt=({className:e,style:r})=>t.jsx(xDt.div,{className:vdt("bg-gray-50 dark:bg-transparent rounded-md overflow-hidden relative",e),style:r,initial:{opacity:.4},animate:{opacity:[.4,.5,.4]},transition:{duration:2,repeat:1/0,ease:"easeInOut"},children:t.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-gray-200 dark:via-muted-foreground to-transparent skeleton-shimmer"})}),BAt=({filteredEvents:e,currentDate:r,hoverLineRef:n,hoverTimeRef:o,setClickedTime:a,currentConfig:i,isAddEventPopupOpen:s,onEventAdd:l,onEventUpdate:c,onEventDelete:u,is24HourFormat:d,clickedTime:p,currentTimeLineRef:h,currentTimeTop:f,isLoading:m,setIsAddEventPopupOpen:v,onDateRangeChange:y,resources:g})=>{var b,x;const w=e.filter(e=>e.isRepeating?(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>Gat(e,r)))&&VDt(r,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily"):e.endDate?Yit(r,{start:Bat(e.startDate),end:Qat(e.endDate)}):Gat(e.startDate,r)),k=Array.from({length:24},(e,t)=>t),_=(e,t)=>{if(e.isRepeating){const r=`${zAt(e.startTime,d)} - ${zAt(e.endTime,d)}`,n=Vit(e.startDate,"MMM d"),o=Vit(e.endDate||e.startDate,"MMM d"),a=Vit(t,"EEEE"),s=Vit(t,"do");switch(e.isRepeatingInterval||"daily"){case"daily":default:return i.localization.repeatDailyDescription.replace("{timeRange}",r).replace("{startDate}",n).replace("{endDate}",o);case"weekly":return i.localization.repeatWeeklyDescription.replace("{dayName}",a).replace("{timeRange}",r).replace("{startDate}",n).replace("{endDate}",o);case"monthly":return i.localization.repeatMonthlyDescription.replace("{dayOfMonth}",s).replace("{timeRange}",r).replace("{startDate}",n).replace("{endDate}",o)}}else if(e.endDate&&!Gat(e.startDate,e.endDate)){const r=Math.floor(Xat(Qat(e.endDate),Bat(e.startDate)))+1,n=Math.floor(Xat(Bat(t),Bat(e.startDate)))+1;return i.localization.dayXofY.replace("{x}",n.toString()).replace("{y}",r.toString())}return null},C=w.reduce((e,t)=>{const n=UDt(t.startTime,t.endTime),o=t.endDate&&!Gat(t.startDate,t.endDate);return t.isRepeating?n?e.repeatingFullDayEvents.push(t):e.regularEvents.push(t):o?Gat(t.startDate,r)?e.multiDayEvents.push({...t,isStart:!0}):Gat(t.endDate,r)?e.multiDayEvents.push({...t,isEnd:!0}):e.multiDayEvents.push({...t,isMiddle:!0}):n?e.fullDayEvents.push(t):e.regularEvents.push(t),e},{repeatingFullDayEvents:[],multiDayEvents:[],fullDayEvents:[],regularEvents:[]}),M=[...C.repeatingFullDayEvents,...C.multiDayEvents,...C.fullDayEvents],S=C.regularEvents,{sortedEvents:D,eventPositions:O,maxColumn:P}=(e=>{const t=e.sort((e,t)=>{const n=$Dt(r,e.startTime),o=$Dt(r,t.startTime);return n.getTime()-o.getTime()}),n={};let o=0;const a=(e,t)=>{const n=$Dt(r,e.startTime),o=$Dt(r,e.endTime),a=$Dt(r,t.startTime);return n<$Dt(r,t.endTime)&&a<o};return t.forEach((e,r)=>{let i=0,s=!1;for(let o=0;o<r;o++)a(e,t[o])&&(i=Math.max(i,n[t[o].id].column+1),s=!0);n[e.id]={column:i,span:1},s&&(o=Math.max(o,i))}),0===o?(t.forEach(e=>{n[e.id]={column:0,span:1}}),{sortedEvents:t,eventPositions:n,maxColumn:1}):(t.forEach(e=>{if(n[e.id].column<o){let r=1;for(;r+n[e.id].column<=o&&!t.some(t=>n[t.id].column===n[e.id].column+r&&a(e,t));)r++;n[e.id].span=r}}),{sortedEvents:t,eventPositions:n,maxColumn:o+1})})(S),E=({event:e,currentDate:r})=>t.jsx(gTt,{event:e,onAddEvent:l,onUpdateEvent:c,onDeleteEvent:u,dateFromViewClick:r,translations:i.localization,resources:g,children:t.jsxs("div",{className:vdt("px-2 py-1 rounded cursor-pointer","transition-colors duration-200","hover:bg-opacity-40","dark:hover:bg-opacity-40",(()=>{switch(e.isRepeatingInterval||"daily"){case"daily":default:return"border border-dashed border-opacity-50";case"weekly":case"monthly":return"border border-dotted border-opacity-50"}})(),"min-h-[44px]"),style:AAt(e.color),children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("div",{className:"text-xs font-semibold truncate",children:e.title||"Untitled Event"}),t.jsxs("div",{className:"text-xs font-medium",children:[zAt(e.startTime,d)," - ",zAt(e.endTime,d)]})]}),t.jsx("div",{className:"text-xs italic",children:_(e,r||new Date)}),e.description&&t.jsx("div",{className:"text-xs truncate mt-0.5",children:e.description})]})},e.id),j=({event:e,currentDate:r})=>t.jsx(gTt,{event:e,onAddEvent:l,onUpdateEvent:c,onDeleteEvent:u,dateFromViewClick:r,translations:i.localization,resources:g,children:t.jsxs("div",{className:vdt("px-2 py-1 rounded cursor-pointer","transition-colors duration-200","hover:bg-opacity-40 dark:hover:bg-opacity-40","min-h-[44px]",e.isStart&&["border-l-4","border-l-black/70 dark:border-l-white/50"],e.isEnd&&["border-r-4","border-r-black/70 dark:border-r-white/50"],e.isMiddle&&"border-x-0"),style:AAt(e.color),children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("div",{className:"text-xs font-semibold truncate",children:e.title||"Untitled Event"}),t.jsx("div",{className:"text-xs font-medium",children:e.isStart?`${i.localization.starts}: ${zAt(e.startTime,d)}`:e.isEnd?`${i.localization.ends}: ${zAt(e.endTime,d)}`:i.localization.allDay})]}),t.jsx("div",{className:"text-xs italic",children:_(e,r||new Date)}),e.description&&t.jsx("div",{className:"text-xs truncate mt-0.5",children:e.description})]})},e.id),T=({event:e})=>t.jsx(gTt,{event:e,onAddEvent:l,onUpdateEvent:c,onDeleteEvent:u,dateFromViewClick:r,translations:i.localization,resources:g,children:t.jsxs("div",{className:vdt("px-2 py-1 rounded cursor-pointer","transition-colors duration-200","hover:bg-opacity-40 dark:hover:bg-opacity-40","min-h-[44px]","border-l-4 border-r-4","border-black/70 dark:border-white/50"),style:AAt(e.color),children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("div",{className:"text-xs font-semibold truncate",children:e.title||"Untitled Event"}),t.jsx("div",{className:"text-xs font-medium",children:i.localization.allDay})]}),e.description&&t.jsx("div",{className:"text-xs truncate mt-0.5",children:e.description})]})},e.id),N=({event:e,currentDate:r,index:n})=>e.isRepeating?t.jsx(E,{event:e,currentDate:r,index:n}):e.endDate&&!Gat(e.startDate,e.endDate)?t.jsx(j,{event:e,currentDate:r,index:n}):t.jsx(T,{event:e,index:n});return t.jsxs(WIt,{className:"pb-4 pl-4 pr-4",children:[t.jsxs("div",{className:"sticky top-0 bg-background z-20 pt-4 pb-1",children:[t.jsx("h2",{className:"text-xl font-bold mb-4",children:`${i.localization.monthNames[r.getMonth()]} ${r.getDate()}, ${r.getFullYear()}`}),M.length>0&&t.jsxs("div",{className:"mb-4",children:[t.jsxs("h3",{className:"text-sm font-semibold mb-2",children:[i.localization.fullDayEvents," (",M.length,")"]}),M.map((e,n)=>t.jsx(xDt.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{delay:.05*n},className:"space-y-2 mb-1",children:t.jsx(N,{event:e,currentDate:r,index:n},e.id)},e.id))]})]}),t.jsx(RAt,{className:"px-4 h-[570px]",children:t.jsxs("div",{className:"relative mt-2 mb-2",children:[t.jsx("div",{className:"absolute left-0 w-16 z-10 bg-background",children:t.jsx(gTt,{translations:i.localization,onAddEvent:l,event:{startDate:r,endDate:r,startTime:p||Vit(new Date,"HH:mm"),endTime:p?Rat(Zit(`2000-01-01T${p}`),1).toTimeString().slice(0,5):Vit(Rat(new Date,1),"HH:mm")},resources:g,children:t.jsx("div",{onMouseMove:e=>{const t=e.currentTarget.getBoundingClientRect(),r=e.clientY-t.top;let a,i,s;if(e.ctrlKey){const e=15*Math.round(r/64*60/15);a=Math.floor(e/60),i=e%60,s=e/60*64}else a=Math.floor(r/64),i=Math.floor(r%64/64*60),s=r;const l=`${a.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}`;n.current&&(n.current.style.top=`${s}px`,n.current.style.display="block"),o.current&&(o.current.textContent=l)},onMouseLeave:()=>{n.current&&(n.current.style.display="none")},onClick:e=>{const t=e.currentTarget.getBoundingClientRect(),r=e.clientY-t.top,n=Math.floor(r/64),o=Math.floor(r%64/64*60),i=`${n.toString().padStart(2,"0")}:${o.toString().padStart(2,"0")}`;a(i)},children:k.map(e=>t.jsx("div",{className:"cursor-pointer h-16 pr-2 text-right text-sm text-muted-foreground",children:IAt(r,e,d)},`hour-${e}`))})})}),t.jsxs("div",{className:"ml-16 relative",onDoubleClick:e=>{if(s||!i.dayView.enableDoubleClickToAddEvent)return;const t=e.currentTarget.getBoundingClientRect(),n=e.clientY-t.top,o=Math.floor(n/(16/15)),a=Math.floor(o/60),c=o%60,u=`${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}`,d=`${(a+1).toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}`;l({title:"",startDate:r,endDate:r,startTime:u,endTime:d,color:"blue",isRepeating:!1})},children:[k.map(e=>t.jsx("div",{className:"h-16 border-t border-border"},e)),!(null!=(b=i.dayView)&&b.hideHoverLine)&&t.jsx("div",{ref:n,className:"absolute left-0 right-0 h-px bg-primary z-40 pointer-events-none",style:{display:"none"},children:t.jsx("span",{ref:o,className:"absolute left-0 transform -translate-x-full -translate-y-1/2 bg-primary text-primary-foreground text-xs px-1 rounded"})}),Gat(r,new Date)&&!(null!=(x=i.dayView)&&x.hideTimeline)&&t.jsx("div",{ref:h,className:"absolute left-0 right-0 h-px bg-red-500 z-30 pointer-events-none",style:{top:`${f}px`},children:t.jsx("span",{className:"absolute left-0 transform -translate-x-full -translate-y-1/2 bg-red-500 text-white text-xs px-1 rounded",children:Vit(new Date,"HH:mm")})}),m&&y&&Array.from({length:10}).map((e,r)=>t.jsx(LAt,{className:"absolute top-0 left-0 right-0 h-[3px] dark:h-[1px] animate-pulse bg-primary/20",style:{top:64*r+"px"}},r)),D.map((e,n)=>{const o=$Dt(r,e.startTime),a=$Dt(r,e.endTime),s=60*o.getHours()+o.getMinutes(),p=60*a.getHours()+a.getMinutes()-s,{column:h,span:f}=O[e.id],m=f/P*100,y=h/P*100,b=_(e,r);return t.jsx(gTt,{event:e,onAddEvent:l,onUpdateEvent:c,onDeleteEvent:u,onOpenChange:v,dateFromViewClick:r,translations:i.localization,resources:g,children:t.jsxs(xDt.div,{className:vdt("absolute px-2 py-1 rounded overflow-hidden cursor-pointer","transition-colors duration-200","hover:bg-opacity-40","dark:hover:bg-opacity-40",(()=>{if(!e.isRepeating)return"";switch(e.isRepeatingInterval||"daily"){case"daily":default:return"border border-dashed border-opacity-50";case"weekly":case"monthly":return"border border-dotted border-opacity-50"}})()),style:{...AAt(e.color),top:s*(16/15)+"px",height:`${Math.max(p*(16/15),24)}px`,left:`${y}%`,width:`${m}%`,zIndex:n+1},initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.1*n},children:[t.jsx("div",{className:"text-xs font-semibold truncate",children:e.title||i.localization.untitledEvent}),t.jsxs("div",{className:"text-xs",children:[zAt(e.startTime,d)," - ",zAt(e.endTime,d)]}),e.description&&t.jsx("div",{className:"text-xs font-semibold truncate",children:e.description}),b&&t.jsx("div",{className:"text-xs italic",children:b})]})},`${e.id}-${e.startTime}`)})]})]})})]})},VAt=({events:r,date:n,addEvent:o,updateEvent:a,onDelete:i,children:s,onOpenChange:l,preSelectedColor:c,is24HourFormat:u,translations:d,resources:p})=>{const[h,f]=e.useState(null),[m,v]=e.useState(!1),y=e=>{h&&(a(e),f(null))},g=e=>{const t=e.endDate&&!Gat(e.startDate,e.endDate),r=Gat(e.startDate,n),o=e.endDate&&Gat(e.endDate,n),a=t&&!r&&!o,i=e.isRepeating?vdt("border-2 dark:border border-dashed border-opacity-50",r&&"border-l-solid border-l-2 border-l-black/90 dark:border-l-white/50",o&&"border-r-solid border-r-2 border-r-black/70 dark:border-r-white/50",a&&"border-x-0"):vdt(r&&"border-l-4 border-l-black/70 dark:border-l-white/50",o&&"border-r-4 border-r-black/70 dark:border-r-white/50",a&&"border-x-0");return vdt("p-2 rounded cursor-pointer hover:opacity-80 transition-opacity w-full text-left","transition-colors duration-200","hover:bg-opacity-40","dark:hover:bg-opacity-40",i)},b=e=>{const t=Gat(e.startDate,n),r=e.endDate&&Gat(e.endDate,n);return!t||e.endDate&&!Gat(e.startDate,e.endDate)?t?`Starts ${zAt(e.startTime,u)}`:r?e.isRepeating?`Ends today (${zAt(e.startTime,u)} - ${zAt(e.endTime,u)})`:`Ends ${zAt(e.endTime,u)}`:e.isRepeating?`${zAt(e.startTime,u)} - ${zAt(e.endTime,u)}`:"All day":`${zAt(e.startTime,u)} - ${zAt(e.endTime,u)}`};return t.jsxs(ydt,{open:m,onOpenChange:v,children:[t.jsx(gdt,{asChild:!0,children:s}),t.jsxs(wdt,{className:"sm:max-w-[425px]",children:[t.jsx(kdt,{children:t.jsx(Cdt,{children:Vit(n,"MMMM d, yyyy")})}),t.jsx(RAt,{className:"h-[300px] mt-4",children:t.jsx("div",{className:"space-y-2 pr-4 flex flex-col items-center pl-6",children:r.sort((e,t)=>WDt(e.startTime)-WDt(t.startTime)).map(e=>t.jsx(gTt,{event:e,onAddEvent:o,onUpdateEvent:y,onDeleteEvent:i,onOpenChange:l,dateFromViewClick:n,translations:d,resources:p,children:t.jsxs("div",{className:g(e),style:AAt(e.color),onClick:()=>(e=>{f(e),v(!0)})(e),children:[e.title&&t.jsx("div",{className:"font-semibold truncate",children:e.title}),t.jsx("div",{className:"text-xs",children:b(e)}),e.description&&t.jsx("div",{className:"text-xs truncate mt-0.5",children:e.description})]})},e.id))})}),t.jsxs("div",{className:"mt-4 flex justify-between items-center",children:[t.jsx(gTt,{translations:d,event:{startDate:n,endDate:n,color:c},onAddEvent:o,dateFromViewClick:n,resources:p,children:t.jsxs(Edt,{variant:"outline",className:"flex-grow mr-2",children:[t.jsx(Tst,{className:"mr-2 h-4 w-4"}),d.addEvent]})}),t.jsx(Edt,{variant:"outline",onClick:()=>{f(null),v(!1)},children:"Close"})]})]})]})},HAt=({filteredEvents:e,currentDate:r,currentConfig:n,is24HourFormat:o,onEventAdd:a,onEventUpdate:i,onEventDelete:s,isLoading:l,hoverLineRef:c,hoverTimeRef:u,clickedTime:d,setClickedTime:p,currentTimeLineRef:h,currentTimeTop:f,isAddEventPopupOpen:m,setIsAddEventPopupOpen:v,onDateRangeChange:y,resources:g})=>{var b,x,w;const k=g??[],_=e.filter(e=>{const t=Bat(e.startDate),n=Bat(r);return e.isRepeating?(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>Gat(e,n)))&&VDt(n,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily"):e.endDate?Yit(n,{start:t,end:Qat(e.endDate)}):Gat(t,n)}),C=Array.from({length:24},(e,t)=>({hour:t,label:IAt(r,t,o)})),M=e=>{if(!e.isRepeating)return vdt(e.isStart&&"border-l-4 border-l-black/70 dark:border-l-white/50",e.isEnd&&"border-r-4 border-r-black/70 dark:border-r-white/50",e.isMiddle&&"border-x-0");switch(e.isRepeatingInterval||"daily"){case"daily":default:return"border border-dashed border-opacity-50";case"weekly":case"monthly":return"border border-dotted border-opacity-50"}},S=e=>{if(!e.isRepeating)return vdt(e.isStart&&"border-l-4 border-l-black/70 dark:border-l-white/50",e.isEnd&&"border-r-4 border-r-black/70 dark:border-r-white/50",e.isMiddle&&"border-x-0");switch(e.isRepeatingInterval||"daily"){case"daily":default:return"border border-dashed border-opacity-50";case"weekly":case"monthly":return"border border-dotted border-opacity-50"}};return t.jsx(WIt,{className:"",children:t.jsxs(RAt,{className:"h-[600px]",children:[t.jsxs("div",{className:"flex pl-2 pr-2",children:[t.jsxs("div",{className:"sticky left-0 z-30 w-16 bg-background border-r border-border h-full",children:[t.jsx("div",{className:"sticky top-0 z-[200] bg-background h-12 border-b border-border"}),t.jsx("div",{className:"sticky top-12 z-[200] bg-background h-[3.1rem] flex items-center justify-end pr-4 text-sm text-muted-foreground border-b border-border",children:n.localization.allDay}),t.jsx(gTt,{onAddEvent:a,onDeleteEvent:s,event:{startDate:r,endDate:r,startTime:d||Vit(new Date,"HH:mm"),endTime:Vit(Rat(d?Zit(`2000-01-01T${d}`):new Date,1),"HH:mm"),color:null!=k&&k.length?null==(b=k[0])?void 0:b.accentClass:void 0},translations:n.localization,resources:g,children:t.jsx("div",{onMouseMove:e=>{const t=e.currentTarget.getBoundingClientRect(),r=e.clientY-t.top,n=r+96;let o,a,i;if(e.ctrlKey){const e=15*Math.round(r/64*60/15);o=Math.floor(e/60),a=e%60,i=e/60*64+96}else o=Math.floor(r/64),a=Math.floor(r%64/64*60),i=n;o=Math.max(0,Math.min(23,o)),a=Math.max(0,Math.min(59,a));const s=`${o.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}`;c.current&&(c.current.style.top=`${i}px`,c.current.style.display="block"),u.current&&(u.current.textContent=s)},onMouseLeave:()=>{c.current&&(c.current.style.display="none")},onClick:e=>{const t=e.currentTarget.getBoundingClientRect(),r=e.clientY-t.top,n=Math.floor(r/64),o=Math.floor(r%64/64*60),a=`${n.toString().padStart(2,"0")}:${o.toString().padStart(2,"0")}`;p(a)},children:C.map(({hour:e,label:r})=>t.jsx("div",{className:"h-16 flex items-center justify-end pr-4 text-sm text-muted-foreground cursor-pointer",children:t.jsx("span",{className:"mt-[-46px]",children:r})},e))})})]}),t.jsx("div",{className:"flex-1 relative",children:t.jsxs("div",{className:"grid pb-4",style:{gridTemplateColumns:`repeat(${k.length}, 1fr)`},children:[!(null!=(x=n.dayView)&&x.hideHoverLine)&&t.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{zIndex:150},children:t.jsx("div",{ref:c,className:"absolute left-0 right-0 h-px bg-primary",style:{display:"none"},children:t.jsx("span",{ref:u,className:"absolute left-0 transform -translate-x-full -translate-y-1/2 bg-primary text-primary-foreground text-xs px-1 rounded"})})}),Gat(r,new Date)&&!(null!=(w=n.dayView)&&w.hideTimeline)&&t.jsx("div",{ref:h,className:"absolute left-0 right-0 h-px bg-red-500 pointer-events-none",style:{top:`${f}px`,zIndex:30},children:t.jsx("span",{className:"absolute left-0 transform -translate-x-full -translate-y-1/2 bg-red-500 text-white text-xs px-1 rounded",children:Vit(new Date,"HH:mm")})}),k.map(e=>{const c=_.filter(t=>t.resourceId===e.id),{allDayEvents:u,regularEvents:d}=(e=>e.reduce((e,t)=>{const n=UDt(t.startTime,t.endTime),o=t.endDate&&!Gat(t.startDate,t.endDate);return n?o?Gat(t.startDate,r)?e.allDayEvents.push({...t,isStart:!0}):Gat(t.endDate,r)?e.allDayEvents.push({...t,isEnd:!0}):e.allDayEvents.push({...t,isMiddle:!0}):e.allDayEvents.push(t):e.regularEvents.push(t),e},{allDayEvents:[],regularEvents:[]}))(c),{events:p,totalColumns:h}=(e=>{const t=e.map(e=>{const t=UDt(e.startTime,e.endTime),n=t?0:WDt(e.startTime),o=t?1440:WDt(e.endTime),a=e.endDate&&!Gat(e.startDate,e.endDate),i=a&&Gat(e.startDate,r),s=a&&Gat(e.endDate,r);return{...e,isAllDay:t,startMinutes:n,endMinutes:o,column:0,width:1,isStart:i,isEnd:s,isMiddle:a&&!i&&!s}}).sort((e,t)=>e.isAllDay&&!t.isAllDay?-1:!e.isAllDay&&t.isAllDay?1:e.startMinutes-t.startMinutes),n=[];return t.forEach(e=>{let r=0;for(;;){if(!t.some(t=>t.column===r&&e!==t&&!(e.startMinutes>=t.endMinutes||e.endMinutes<=t.startMinutes))){e.column=r,n[r]=(n[r]||0)+1;break}r++}}),t.forEach(e=>{let r=1,o=e.column+1;for(;o<n.length&&!t.some(t=>t.column===o&&!(e.startMinutes>=t.endMinutes||e.endMinutes<=t.startMinutes));)r++,o++;e.width=r}),{events:t,totalColumns:Math.max(...n.map((e,t)=>t+1),1)}})(d),f=(e,t)=>{const r=UDt(e.startTime,e.endTime);if(e.isRepeating&&!r){const r=Bat(e.startDate),o=Bat(e.endDate||e.startDate);let a,i;switch(e.isRepeatingInterval||"daily"){case"weekly":a=Math.floor(Xat(o,r)/7)+1,i=Math.floor(Xat(t,r)/7)+1;break;case"monthly":a=12*(o.getFullYear()-r.getFullYear())+o.getMonth()-r.getMonth()+1,i=12*(t.getFullYear()-r.getFullYear())+t.getMonth()-r.getMonth()+1;break;default:a=Xat(o,r)+1,i=Xat(t,r)+1}return n.localization.repeatXofY.replace("{x}",i.toString()).replace("{y}",a.toString())}};return t.jsxs("div",{className:"relative border-r border-border flex-1",children:[t.jsx("div",{className:"sticky top-0 z-50 bg-background h-12 flex items-center justify-center border-b border-border",children:t.jsxs("div",{className:"flex items-center space-x-2",children:[e.accentClass&&t.jsx("div",{className:vdt("w-3 h-3 rounded-full flex-shrink-0 hidden sm:block text-center",e.accentClass)}),t.jsx("div",{className:"max-w-[150px] sm:max-w-[200px]",children:t.jsxs("span",{className:"relative font-medium text-sm sm:text-base group",children:[t.jsxs("span",{className:"block truncate",children:[e.name,c.length>0&&` (${c.length})`]}),e.accentClass&&t.jsx("span",{className:vdt("absolute bottom-0 left-0 w-full h-[2px] sm:hidden",e.accentClass)})]})})]})}),t.jsx("div",{className:"sticky top-12 z-50 bg-background min-h-[50px] border-b border-border",children:u.length<=1?u.map(e=>t.jsx("div",{className:"px-1 py-0.5",children:t.jsx(gTt,{event:e,onAddEvent:a,onUpdateEvent:i,onDeleteEvent:s,dateFromViewClick:r,translations:n.localization,resources:g,children:t.jsx(xDt.div,{className:vdt("rounded px-2 py-1 mb-0.5 last:mb-0 cursor-pointer","hover:bg-opacity-40 dark:hover:bg-opacity-40 transition-colors",M(e)),style:AAt(e.color),initial:{opacity:0,y:-10},animate:{opacity:1,y:0},children:t.jsxs("div",{className:"max-w-28 md:max-w-48",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("div",{className:"text-xs font-semibold truncate",children:e.title||n.localization.untitledEvent}),t.jsx("div",{className:"text-xs font-medium truncate",children:e.isStart?`${n.localization.starts}: ${zAt(e.startTime,o)}`:e.isEnd?`${n.localization.ends}: ${zAt(e.endTime,o)}`:null})]}),e.description&&t.jsx("div",{className:"text-xs truncate mt-0.5",children:e.description}),f(e,r)&&t.jsx("div",{className:"text-xs italic",children:f(e,r)})]})})},e.id)})):t.jsx("div",{className:"px-1 py-0.5",children:t.jsx(VAt,{events:u,date:r,addEvent:a,updateEvent:i,is24HourFormat:o,onDelete:s,translations:n.localization,preSelectedColor:"",children:t.jsxs(xDt.div,{className:vdt("rounded px-2 py-1 cursor-pointer group","hover:bg-opacity-40 dark:hover:bg-opacity-40 transition-colors","border border-dashed border-opacity-50"),initial:{opacity:0,y:-10},animate:{opacity:1,y:0},children:[t.jsx("div",{className:"flex items-center justify-between",children:t.jsxs("span",{className:"text-xs font-medium",children:[u.length," ",n.localization.allDay]})}),t.jsxs("div",{className:"text-xs mt-0.5 truncate max-w-24 sm:max-w-44",children:[u.slice(0,3).map(e=>e.title||n.localization.untitledEvent).join(", "),u.length>3&&`, +${u.length-3} more`]})]})})})}),t.jsxs("div",{className:"relative",onDoubleClick:t=>((e,t)=>{if(m||!n.dayView.enableDoubleClickToAddEvent)return;const o=e.currentTarget.getBoundingClientRect(),i=e.clientY-o.top,s=Math.floor(i/(16/15)),l=Math.floor(s/60),c=s%60,u=`${l.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}`,d=`${(l+1).toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}`;a({title:"",startDate:r,endDate:r,startTime:u,endTime:d,color:t,isRepeating:!1})})(t,e.id),children:[C.map(({hour:e})=>t.jsx("div",{className:"h-16 border-b border-border"},e)),l&&y&&Array.from({length:10}).map((e,r)=>t.jsx(LAt,{className:"absolute left-0 right-0 h-[3px] dark:h-[1px] animate-pulse bg-primary/20",style:{top:64*r+"px"}},r)),t.jsx("div",{className:"absolute inset-0",children:p.map((e,l)=>{const c=e.column*(100/h),u=e.width*(100/h);return t.jsx(gTt,{event:e,onAddEvent:a,onUpdateEvent:i,onDeleteEvent:s,onOpenChange:v,dateFromViewClick:r,translations:n.localization,children:t.jsxs(xDt.div,{className:vdt("absolute px-2 py-1 rounded overflow-hidden cursor-pointer","transition-colors duration-200","hover:bg-opacity-40","dark:hover:bg-opacity-40",S(e)),style:{...AAt(e.color),top:e.startMinutes*(16/15)+"px",height:`${Math.max((e.endMinutes-e.startMinutes)*(16/15),24)}px`,left:`${c}%`,width:`${u}%`,zIndex:l+1},initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.1*l},children:[t.jsx("div",{className:"text-xs font-semibold truncate",children:e.title||n.localization.untitledEvent}),t.jsx("div",{className:"text-xs",children:e.isStart?`${n.localization.starts}: ${zAt(e.startTime,o)}`:e.isEnd?`${n.localization.ends}: ${zAt(e.endTime,o)}`:`${zAt(e.startTime,o)} - ${zAt(e.endTime,o)}`}),e.description&&t.jsx("div",{className:"text-xs truncate mt-0.5",children:e.description}),(e.isRepeating||e.isStart||e.isEnd||e.isMiddle)&&t.jsx("div",{className:"text-xs italic",children:f(e,r)})]})},e.id)})})]})]},e.id)})]})})]}),t.jsx(FAt,{orientation:"horizontal"})]})})},qAt=({filteredEvents:e,currentDate:r,currentConfig:n,isLoading:o,is24HourFormat:a,clickedTime:i,currentTimeTop:s,hoverLineRef:l,hoverTimeRef:c,currentTimeLineRef:u,setClickedTime:d,onEventAdd:p,onEventUpdate:h,onEventDelete:f,onDateRangeChange:m,isAddEventPopupOpen:v,setIsAddEventPopupOpen:y,resources:g})=>{var b;const x={filteredEvents:e,currentDate:r,currentConfig:n,is24HourFormat:a,onEventAdd:p,onEventUpdate:h,onEventDelete:f,hoverLineRef:l,hoverTimeRef:c,clickedTime:i,setClickedTime:d,currentTimeLineRef:u,currentTimeTop:s,isLoading:o,isAddEventPopupOpen:v,setIsAddEventPopupOpen:y,onDateRangeChange:m,resources:g};return t.jsx(t.Fragment,{children:"resource"===(null==(b=n.dayView)?void 0:b.viewType)?t.jsx(HAt,{...x}):t.jsx(BAt,{...x})})},$At=({filteredEvents:e,currentView:r,currentDate:n,listSearchTerm:o,setListSearchTerm:a,currentConfig:i,onEventUpdate:s,onEventDelete:l,onEventAdd:c,is24HourFormat:u,isLoading:d,resources:p})=>{let h,f;switch(r){case"day":default:h=Bat(n),f=Qat(n);break;case"week":h=Iat(n),f=oit(n);break;case"month":h=tit(n),f=Jat(n);break;case"year":h=nit(n),f=rit(n)}const m=e.filter(e=>{if(e.isRepeating){const t=()=>eit({start:h,end:f}).some(t=>(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>Gat(e,t)))&&VDt(t,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily"));return"day"===r?(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>Gat(e,n)))&&VDt(n,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily"):t()}if("day"===r){const t=Bat(e.startDate),r=Qat(e.endDate||e.startDate);return Yit(n,{start:t,end:r})}return Yit(e.startDate,{start:h,end:f})||e.endDate&&Yit(e.endDate,{start:h,end:f})}).filter(e=>e.title.toLowerCase().includes(o.toLowerCase())||e.description&&e.description.toLowerCase().includes(o.toLowerCase())).sort((e,t)=>function(e,t){const r=Dat(e),n=Dat(t),o=r.getTime()-n.getTime();return o<0?-1:o>0?1:o}(e.startDate,t.startDate));return t.jsxs(WIt,{className:"p-4",children:[t.jsx(xDt.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.3},className:"mb-4",children:t.jsxs("div",{className:"relative",children:[t.jsx(Tbt,{initial:!1,mode:"wait",children:o?t.jsx(xDt.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.2},className:"absolute left-2.5 top-[0.6rem] transform -translate-y-1/2 flex items-center justify-center",children:t.jsx(Edt,{variant:"ghost",size:"icon",className:"h-5 w-5 p-0",onClick:()=>a(""),children:t.jsx(Wst,{className:"h-4 w-4 text-muted-foreground"})})},"clearButton"):t.jsx(xDt.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.2},className:"absolute left-2.5 top-[0.75rem] transform -translate-y-1/2 flex items-center justify-center",children:t.jsx(qst,{className:"h-4 w-4 text-muted-foreground"})},"searchIcon")}),t.jsx(Mmt,{type:"text",placeholder:i.localization.searchEvents,value:o,onChange:e=>a(e.target.value),className:"pl-10 pr-4 py-2 w-full"})]})}),t.jsxs(RAt,{className:"h-[600px]",children:[t.jsx(Tbt,{initial:!0,children:m.map(e=>{const{dateInfo:r,isMultiDay:o,isOutOfRange:a,isRepeating:d}=(e=>{const t=Bat(e.startDate),r=Qat(e.endDate||e.startDate),n=!Gat(t,r),o=t<h||r>f,a=e.isRepeating;let s="";if(a&&(e.isRepeatingInterval,1)){const t=`${zAt(e.startTime,u)} - ${zAt(e.endTime,u)}`,r=Vit(e.startDate,"MMM d"),n=Vit(e.endDate||e.startDate,"MMM d, yyyy"),o=Vit(e.startDate,"EEEE"),a=Vit(e.startDate,"do");switch(e.isRepeatingInterval||"daily"){case"daily":s=i.localization.repeatDailyDescription.replace("{timeRange}",t).replace("{startDate}",r).replace("{endDate}",n);break;case"weekly":s=i.localization.repeatWeeklyDescription.replace("{dayName}",o).replace("{timeRange}",t).replace("{startDate}",r).replace("{endDate}",n);break;case"monthly":s=i.localization.repeatMonthlyDescription.replace("{dayOfMonth}",a).replace("{timeRange}",t).replace("{startDate}",r).replace("{endDate}",n)}}else s=`${Vit(t,"MMM d")}`,n&&(s+=` - ${Vit(r,"MMM d")}`);return{dateInfo:s,isMultiDay:n,isOutOfRange:o,isRepeating:a}})(e);return t.jsx(xDt.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,height:0},transition:{duration:.3},children:t.jsx(gTt,{event:e,onAddEvent:c,onUpdateEvent:s,onDeleteEvent:l,dateFromViewClick:n,translations:i.localization,resources:p,children:t.jsxs("div",{className:vdt("p-2 rounded-lg cursor-pointer mb-2","hover:opacity-80 transition-opacity",e.isRepeating&&"border border-dashed border-opacity-50"),style:AAt(e.color),children:[t.jsxs("div",{className:"flex justify-between items-center text-sm",children:[t.jsx("span",{className:"font-semibold",children:r}),t.jsxs("div",{className:"flex items-center space-x-2",children:[d&&t.jsx(CFt,{children:t.jsxs(MFt,{children:[t.jsx(SFt,{children:t.jsx(Hst,{className:"h-4 w-4"})}),t.jsx(DFt,{children:t.jsx("p",{children:i.localization.repeatingEvent})})]})}),o&&!d&&t.jsx(CFt,{children:t.jsxs(MFt,{children:[t.jsx(SFt,{children:t.jsx(Mst,{className:"h-4 w-4"})}),t.jsx(DFt,{children:t.jsx("p",{children:i.localization.multiDayEvent})})]})}),a&&t.jsx(CFt,{children:t.jsxs(MFt,{children:[t.jsx(SFt,{children:t.jsx(xst,{className:"h-4 w-4"})}),t.jsx(DFt,{children:t.jsx("p",{children:i.localization.extendsOutOfRange})})]})}),t.jsxs("span",{children:[zAt(e.startTime,u)," - ",zAt(e.endTime,u)]})]})]}),t.jsx("h3",{className:"text-lg font-bold mt-2",children:e.title||"Untitled Event"}),e.description&&t.jsx("p",{className:"mt-1 text-sm",children:e.description})]})})},e.id)})}),!d&&0===m.length&&t.jsx(xDt.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center text-muted-foreground py-8",children:o?i.localization.noEvents:`${i.localization.noEvents} ${i.localization[r]}`})]})]})},WAt=({filteredEvents:e,currentDate:r,currentConfig:n,is24HourFormat:o,setIsAddEventPopupOpen:a,isAddEventPopupOpen:i,setCurrentDate:s,setCurrentView:l,onEventUpdate:c,onEventDelete:u,onEventAdd:d,isLoading:p,onDateRangeChange:h,resources:f})=>{var m;const v=tit(r),y=Jat(r),g=null==(m=n.monthView)?void 0:m.showOnlyCurrentMonth,b=qit(v),x=new Date,w=n.localization.dayNames;let k,_;if(g)k=eit({start:v,end:y}),_=[...w.slice(b),...w.slice(0,b)];else{const e=o?1:0;k=eit({start:Iat(v,{weekStartsOn:e}),end:oit(y,{weekStartsOn:e})}),_=o?[...w.slice(1),w[0]]:w}return t.jsx(WIt,{className:"p-2 sm:p-4",children:t.jsx(RAt,{children:t.jsxs("div",{className:"grid grid-cols-7 gap-1 sm:gap-2",children:[_.map(e=>t.jsx("div",{className:"text-center font-medium text-xs sm:text-sm",children:e},e)),k.map(m=>{const v=Git(m,r);if(g&&!v)return t.jsx("div",{},m.toString());const y=e.filter(e=>e.isRepeating?(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>Gat(e,m)))&&VDt(m,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily"):Gat(e.startDate,m)||e.endDate&&Yit(m,{start:e.startDate,end:e.endDate})),b=((e,t)=>e.reduce((e,r)=>{const n=UDt(r.startTime,r.endTime),o=r.endDate&&!Gat(r.startDate,r.endDate);if(r.isRepeating){if(r.isRepeatingExcludedDates&&r.isRepeatingExcludedDates.some(e=>Gat(e,t)))return e;if(VDt(t,r.startDate,r.endDate||r.startDate,r.isRepeatingInterval||"daily")){let o;o="weekly"===r.isRepeatingInterval||"monthly"===r.isRepeatingInterval||Gat(r.startDate,t)?"start":r.endDate&&Gat(r.endDate,t)?"end":"middle",n?e.repeatingFullDayEvents.push({...r,position:o}):e.regularEvents.push({...r,position:o})}}else if(o){let n;Gat(r.startDate,t)?n="start":Gat(r.endDate,t)?n="end":Yit(t,{start:r.startDate,end:r.endDate})&&(n="middle"),n&&e.multiDayEvents.push({...r,position:n})}else n?e.fullDayEvents.push(r):e.regularEvents.push(r);return e},{repeatingFullDayEvents:[],multiDayEvents:[],fullDayEvents:[],regularEvents:[]}))(y,m),w=[...b.repeatingFullDayEvents,...b.multiDayEvents,...b.fullDayEvents],k=b.regularEvents,_=Gat(m,x);let C=[],M=0;return w.length>0?(C.push(w[0]),M=w.length-1+k.length):k.length>0&&(C.push(k[0]),M=k.length-1),M>0?C=C.slice(0,1):k.length>1&&C.length<2&&C.push(k[1]),t.jsxs("div",{className:vdt("p-1 sm:p-2 h-[80px] sm:h-[130px] border rounded relative group flex flex-col",!v&&!g&&"bg-muted/50"),onDoubleClick:()=>(e=>{i||n.monthView.enableDoubleClickToShiftViewToWeekly&&(s(e),l("week"))})(m),children:[t.jsx("div",{className:vdt("font-semibold mb-1 w-5 h-5 sm:w-6 sm:h-6 flex items-center justify-center text-xs sm:text-sm",_&&"bg-primary text-primary-foreground rounded-full"),children:Vit(m,"d")}),t.jsxs("div",{className:"flex-grow overflow-hidden",children:[p&&h&&t.jsx(LAt,{className:"absolute top-0 left-0 right-0 h-[2px] dark:h-[1px] animate-pulse bg-primary/20"}),C.map((e,r)=>((e,r,i)=>{const s="position"in e,l=s&&"start"===e.position,p=s&&"end"===e.position,h=s&&"middle"===e.position;return t.jsx(xDt.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{duration:.2,delay:.05*r},children:t.jsx(gTt,{event:e,onAddEvent:d,onUpdateEvent:c,onDeleteEvent:u,dateFromViewClick:i,onOpenChange:a,translations:n.localization,resources:f,children:t.jsxs("div",{className:vdt("p-1 text-[8px] h-10 sm:text-xs rounded mb-1 cursor-pointer","transition-colors duration-200","hover:bg-opacity-40","dark:hover:bg-opacity-40",(()=>{if(!e.isRepeating)return vdt(l&&"border-l-4 border-l-black/70 dark:border-l-white/50",p&&"border-r-4 border-r-black/70 dark:border-r-white/50",h&&"border-x-0");switch(e.isRepeatingInterval){case"daily":return vdt("border border-dashed border-opacity-50",l&&"border-l-solid border-l-2 border-l-black/70 dark:border-l-white/50",p&&"border-r-solid border-r-2 border-r-black/70 dark:border-r-white/50",h&&"border-x-0");case"weekly":case"monthly":return"border border-dotted border-opacity-50";default:return""}})()),style:AAt(e.color),children:[t.jsx("div",{className:"font-semibold truncate",children:e.title||"Untitled Event"}),!s&&t.jsxs("div",{className:"hidden sm:block truncate",children:[zAt(e.startTime,o)," - ",zAt(e.endTime,o)]}),s&&!e.isRepeating&&t.jsx("div",{className:"hidden sm:block truncate",children:e.description&&t.jsx("div",{className:"truncate",children:e.description})}),e.isRepeating&&t.jsxs("div",{className:"hidden sm:block truncate",children:[zAt(e.startTime,o)," - ",zAt(e.endTime,o)]})]})})},`${e.id}-${r}`)})(e,r,m)),0===y.length&&t.jsx(gTt,{translations:n.localization,onOpenChange:a,onAddEvent:d,event:{startDate:m,endDate:m},onDeleteEvent:u,resources:f,children:t.jsx(Edt,{variant:"ghost",size:"sm",className:"w-full h-1/2 text-[8px] sm:text-xs text-muted-foreground hover:text-foreground transition-opacity truncate px-0.5 sm:px-2 sm:opacity-0 sm:group-hover:opacity-100",children:t.jsx("span",{className:"hidden sm:inline ml-1",children:n.localization.addEvent})})})]}),M>0&&t.jsx(VAt,{translations:n.localization,events:y,date:m,addEvent:d,updateEvent:c,onDelete:u,is24HourFormat:o,onOpenChange:a,children:t.jsx(xDt.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{duration:.2},children:t.jsxs(Edt,{variant:"ghost",size:"sm",className:"w-full gap-1 text-[8px] sm:text-xs text-muted-foreground hover:text-foreground mt-auto sm:mt-1 truncate px-0.5 sm:px-2 h-5 sm:h-8",children:[t.jsxs("span",{children:["+",M]}),t.jsxs("span",{className:"hidden sm:inline",children:[" ",n.localization.more]})]})})}),1===y.length&&t.jsx(gTt,{translations:n.localization,onOpenChange:a,onAddEvent:d,event:{startDate:m},onDeleteEvent:u,resources:f,children:t.jsxs(Edt,{variant:"ghost",size:"sm",className:"w-full gap-1 text-[8px] sm:text-xs text-muted-foreground hover:text-foreground mt-auto sm:mt-1 sm:opacity-0 sm:group-hover:opacity-100 transition-opacity truncate px-0.5 sm:px-2 ",children:[t.jsx("span",{className:"font-bold",children:"+"}),t.jsx("span",{className:"hidden sm:inline",children:n.localization.addEvent})]})})]},m.toString())})]})})})},UAt=({filteredEvents:e,onEventUpdate:r,onEventDelete:n,onEventAdd:o,isLoading:a,currentDate:i,currentConfig:s,is24HourFormat:l,isAddEventPopupOpen:c,setCurrentDate:u,setCurrentView:d,setIsAddEventPopupOpen:p,onDateRangeChange:h,resources:f})=>{var m;const v=tit(i),y=Jat(i),g=null==(m=s.monthView)?void 0:m.showOnlyCurrentMonth,b=qit(v),x=new Date,w=s.localization.dayNames;let k,_;if(g)k=eit({start:v,end:y}),_=[...w.slice(b),...w.slice(0,b)];else{const e=l?1:0,t=Iat(v,{weekStartsOn:e}),r=oit(y,{weekStartsOn:e});k=eit({start:t,end:r}),_=l?[...w.slice(1),w[0]]:w}const C=Math.ceil(k.length/7);return t.jsx(WIt,{className:"p-2 sm:p-4",children:t.jsx(RAt,{children:t.jsxs("div",{className:"w-full",children:[t.jsx("div",{className:"grid grid-cols-7 border-b",children:_.map(e=>t.jsx("div",{className:"text-center font-medium text-xs sm:text-sm p-2",children:e},e))}),Array.from({length:C}).map((m,v)=>{const y=k.slice(7*v,7*(v+1));return t.jsx("div",{className:"grid grid-cols-7",children:y.map((m,v)=>{const y=Gat(m,x),b=Git(m,i),w=(t=>e.filter(e=>{if(e.isRepeating)return(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>Gat(e,t)))&&VDt(t,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily");const r=Bat(e.startDate),n=Qat(e.endDate||e.startDate);return Yit(t,{start:r,end:n})}).sort((e,t)=>new Date(e.startDate).getTime()+6e4*WDt(e.startTime)-(new Date(t.startDate).getTime()+6e4*WDt(t.startTime))))(m);return g&&!b?t.jsx("div",{},m.toString()):t.jsxs("div",{className:vdt("group min-h-[145px] border-b border-r p-1 relative","transition-colors duration-200",!b&&"bg-muted/50",0===v&&"border-l"),onDoubleClick:()=>(e=>{c||s.monthView.enableDoubleClickToShiftViewToWeekly&&(u(e),d("week"))})(m),children:[a&&h&&t.jsx(LAt,{className:"absolute top-0 left-0 right-0 h-[2px] dark:h-[1px] animate-pulse bg-primary/20"}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("div",{className:vdt("font-semibold w-6 h-6 flex items-center justify-center text-xs sm:text-sm rounded-full",y&&"bg-primary text-primary-foreground"),children:Vit(m,"d")}),t.jsx(gTt,{translations:s.localization,onOpenChange:p,onAddEvent:o,event:{startDate:m,endDate:m},dateFromViewClick:m,onDeleteEvent:n,resources:f,children:t.jsx(Edt,{variant:"ghost",size:"sm",className:"h-6 text-xs text-muted-foreground px-2 sm:opacity-0 sm:group-hover:opacity-100 transition-opacity",children:t.jsx("span",{className:"ml-1 hidden sm:inline",children:s.localization.addEvent})})})]}),t.jsxs("div",{className:"space-y-1 mt-1 overflow-y-auto",children:[w.slice(0,w.length>4?3:4).map((e,a)=>{const i=((e,t)=>{if(e.isRepeating){if("weekly"===e.isRepeatingInterval||"monthly"===e.isRepeatingInterval)return"single";const r=Gat(e.startDate,t),n=e.endDate&&Gat(e.endDate,t);return r&&n?"single":r?"start":n?"end":"middle"}const r=Gat(e.startDate,t),n=e.endDate&&Gat(e.endDate,t);return e.endDate?r&&n?"single":r?"start":n?"end":"middle":"single"})(e,m),c=((e,t)=>{if(!e.isRepeating)return vdt("start"===t&&"border-l-4 border-l-black/70 dark:border-l-white/50","end"===t&&"border-r-4 border-r-black/70 dark:border-r-white/50","middle"===t&&"border-x-0");switch(e.isRepeatingInterval||"daily"){case"daily":return vdt("border border-dashed border-opacity-50","start"===t&&"border-l-solid border-l-2 border-l-black/70 dark:border-l-white/50","end"===t&&"border-r-solid border-r-2 border-r-black/70 dark:border-r-white/50","middle"===t&&"border-x-0");case"weekly":case"monthly":return"border border-dotted border-opacity-50";default:return""}})(e,i),u=e.isRepeating||"single"===i||"start"===i&&!e.isRepeating||"end"===i&&!e.isRepeating;return t.jsx(xDt.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{duration:.2,delay:.05*a},children:t.jsx(gTt,{translations:s.localization,onAddEvent:o,onUpdateEvent:r,event:e,dateFromViewClick:m,onDeleteEvent:n,onOpenChange:p,resources:f,children:t.jsxs("div",{className:vdt("text-xs p-1 min-h-[24px] rounded cursor-pointer","hover:opacity-80 transition-opacity","flex items-center justify-between gap-1",c),style:AAt(e.color),children:[t.jsx("span",{className:"block overflow-hidden text-ellipsis whitespace-nowrap flex-1",children:e.title}),u&&t.jsx("span",{className:"text-[10px] opacity-75 whitespace-nowrap",children:e.isRepeating||"end"!==i?zAt(e.startTime,l):`ends ${zAt(e.endTime,l)}`})]})})},`${e.id}-${a}`)}),w.length>4&&t.jsx(VAt,{translations:s.localization,events:w,date:m,addEvent:o,updateEvent:r,onDelete:n,is24HourFormat:l,resources:f,onOpenChange:p,children:t.jsx(xDt.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{duration:.2},children:t.jsxs(Edt,{variant:"ghost",size:"sm",className:"w-full h-6 text-xs text-muted-foreground hover:text-foreground truncate px-2",children:["+",w.length-3," ",s.localization.more]})})})]})]},m.toString())})},v)})]})})})},GAt=({filteredEvents:e,currentDate:r,currentConfig:n,is24HourFormat:o,setIsAddEventPopupOpen:a,isAddEventPopupOpen:i,setCurrentDate:s,setCurrentView:l,onEventUpdate:c,onEventDelete:u,onEventAdd:d,isLoading:p,onDateRangeChange:h,resources:f})=>{var m;return t.jsx(t.Fragment,{children:"detailed"===(null==(m=n.monthView)?void 0:m.viewType)?t.jsx(UAt,{filteredEvents:e,currentDate:r,is24HourFormat:o,isAddEventPopupOpen:i,currentConfig:n,setCurrentDate:s,setCurrentView:l,onEventAdd:d,onEventUpdate:c,onEventDelete:u,setIsAddEventPopupOpen:a,isLoading:p,onDateRangeChange:h,resources:f}):t.jsx(WAt,{filteredEvents:e,currentDate:r,is24HourFormat:o,isAddEventPopupOpen:i,currentConfig:n,setCurrentDate:s,setCurrentView:l,onEventAdd:d,onEventUpdate:c,onEventDelete:u,setIsAddEventPopupOpen:a,isLoading:p,onDateRangeChange:h,resources:f})})},KAt=({filteredEvents:e,currentDate:r,is24HourFormat:n,hoverLineRef:o,hoverTimeRef:a,setClickedTime:i,clickedTime:s,isAddEventPopupOpen:l,currentConfig:c,setCurrentDate:u,setCurrentView:d,onEventUpdate:p,onEventDelete:h,onEventAdd:f,setIsAddEventPopupOpen:m,isLoading:v,currentTimeLineRef:y,currentTimeTop:g,onDateRangeChange:b,resources:x})=>{var w,k;const _=Iat(r,{weekStartsOn:n?1:0}),C=oit(r,{weekStartsOn:n?1:0}),M=eit({start:_,end:C}),S=Array.from({length:24},(e,t)=>t),D=yit(_,{weekStartsOn:n?1:0}),O=(e,t)=>{if(e.isRepeating)return(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>Gat(e,t)))&&VDt(t,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily");const r=Bat(e.startDate),n=Qat(e.endDate||e.startDate);return Yit(t,{start:r,end:n})},P=e.filter(e=>e.isRepeating?M.some(t=>VDt(t,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily")):Yit(e.startDate,{start:_,end:C})||e.endDate&&Yit(e.endDate,{start:_,end:C})),E=(e=>e.reduce((e,t)=>{const r=UDt(t.startTime,t.endTime),n=t.endDate&&!Gat(t.startDate,t.endDate);return t.isRepeating?r?e.repeatingFullDayEvents.push(t):e.regularEvents.push(t):n?e.multiDayEvents.push(t):r?e.fullDayEvents.push(t):e.regularEvents.push(t),e},{repeatingFullDayEvents:[],multiDayEvents:[],fullDayEvents:[],regularEvents:[]}))(P),j=[...E.repeatingFullDayEvents,...E.multiDayEvents,...E.fullDayEvents],T=({event:e,day:r})=>{var n,o,a;const i=e.endDate&&!Gat(e.startDate,e.endDate),s=Gat(e.startDate,r),l=e.endDate&&Gat(e.endDate,r),u=i&&!s&&!l;return t.jsx(gTt,{event:e,onAddEvent:f,onUpdateEvent:p,onDeleteEvent:h,dateFromViewClick:r,translations:c.localization,resources:x,children:t.jsxs("div",{className:vdt("px-2 py-1 rounded cursor-pointer","transition-colors duration-200","hover:bg-opacity-40 dark:hover:bg-opacity-40","min-h-[24px] text-xs",(()=>{if(!e.isRepeating)return vdt(s&&"border-l-4 border-l-black/70 dark:border-l-white/50",l&&"border-r-4 border-r-black/70 dark:border-r-white/50",u&&"border-x-0");switch(e.isRepeatingInterval||"daily"){case"daily":return vdt("border border-dashed border-opacity-50",s&&"border-l-solid border-l-2 border-l-black/70 dark:border-l-white/50",l&&"border-r-solid border-r-2 border-r-black/70 dark:border-r-white/50",u&&"border-x-0");case"weekly":case"monthly":return"border border-dotted border-opacity-50";default:return""}})()),style:AAt(e.color),children:[t.jsx("div",{className:"font-semibold truncate",children:e.title||"Untitled Event"}),e.description&&t.jsx("div",{className:"truncate",children:e.description}),e.isRepeating&&t.jsx("div",{className:"text-[10px] opacity-75",children:"daily"===e.isRepeatingInterval?null==(n=c.localization)?void 0:n.repeatDaily:"weekly"===e.isRepeatingInterval?null==(o=c.localization)?void 0:o.repeatWeekly:null==(a=c.localization)?void 0:a.repeatMonthly})]})},e.id)};return t.jsxs(WIt,{className:"p-4",children:[j.length>0&&t.jsxs("div",{className:"mb-4 relative z-20",children:[t.jsx("div",{className:"grid grid-cols-8 gap-0",children:M.map(e=>t.jsx("div",{className:"text-center text-xs font-semibold"},e.toString()))}),t.jsxs("div",{className:"grid grid-cols-8 gap-0 relative",children:[t.jsx("div",{className:"absolute left-0 top-0 bottom-2 w-[12.5%] flex items-center justify-center z-10",children:t.jsxs("div",{className:"text-xs truncate font-semibold whitespace-nowrap",children:[c.localization.fullDayEvents," (",j.length,")"]})}),j.map((e,r)=>t.jsxs(xDt.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{delay:.05*r},className:"col-span-8 grid grid-cols-8 gap-0 mb-1",children:[t.jsx("div",{className:"w-[12.5%]"}),M.map(r=>t.jsx("div",{className:"min-h-[24px] px-1",children:Yit(r,{start:e.startDate,end:e.endDate||e.startDate})&&t.jsx(T,{event:e,day:r})},`${e.id}-${r.toString()}`))]},e.id))]})]}),t.jsx(RAt,{className:"h-[600px]",children:t.jsxs("div",{className:"relative mb-2",children:[t.jsxs("div",{className:"grid grid-cols-8 gap-0",children:[t.jsx(gTt,{event:{startDate:_,endDate:C,startTime:s||Vit(new Date,"HH:mm"),endTime:Vit(Rat(s?Zit(`2000-01-01T${s}`):new Date,1),"HH:mm"),isRepeating:!0},onAddEvent:f,dateFromViewClick:_,translations:c.localization,children:t.jsxs("div",{className:"sticky top-0 left-0 z-30 bg-background",onMouseMove:e=>{const t=e.currentTarget.getBoundingClientRect(),r=e.clientY-t.top-48,n=Math.max(0,r);let i,s,l;if(e.ctrlKey){const e=15*Math.round(n/64*60/15);i=Math.floor(e/60),s=e%60,l=e/60*64}else i=Math.floor(n/64),s=Math.floor(n%64/64*60),l=n;const c=`${i.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}`;o.current&&(o.current.style.top=`${l+48}px`,o.current.style.display="block"),a.current&&(a.current.textContent=c)},onMouseLeave:()=>{o.current&&(o.current.style.display="none")},onClick:e=>{const t=e.currentTarget.getBoundingClientRect(),r=e.clientY-t.top-48,n=Math.max(0,r),o=Math.floor(n/64),a=Math.floor(n%64/64*60),s=`${o.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}`;i(s)},children:[t.jsx("div",{className:"sticky top-0 left-0 bg-background h-12 border-b border-r border-border flex items-center justify-center",children:t.jsxs("span",{className:"text-xs font-semibold text-muted-foreground bg-background",children:["Week ",D]})}),S.map(e=>t.jsx("div",{className:"cursor-pointer h-16 pr-2 text-center text-sm text-muted-foreground border-r border-border",children:IAt(r,e,n)},e))]})}),t.jsx("div",{className:"col-span-7 relative z-20",children:t.jsxs("div",{className:"grid grid-cols-7 gap-0",children:[M.map((e,r)=>{const o=E.regularEvents.filter(t=>O(t,e)),{sortedEvents:a,eventPositions:i,maxColumn:s}=((e,t)=>{const r=e.filter(e=>O(e,t)).sort((e,r)=>{const n=$Dt(t,e.startTime),o=$Dt(t,r.startTime);return n.getTime()-o.getTime()}),n={};let o=0;const a=(e,r)=>{const n=$Dt(t,e.startTime),o=$Dt(t,e.endTime),a=$Dt(t,r.startTime);return n<$Dt(t,r.endTime)&&a<o};return r.forEach((e,t)=>{let i=0,s=!1;for(let o=0;o<t;o++)a(e,r[o])&&(i=Math.max(i,n[r[o].id].column+1),s=!0);n[e.id]={column:i,span:1},s&&(o=Math.max(o,i))}),0===o?(r.forEach(e=>{n[e.id]={column:0,span:1}}),{sortedEvents:r,eventPositions:n,maxColumn:1}):(r.forEach(e=>{if(n[e.id].column<o){let t=1;for(;t+n[e.id].column<=o&&!r.some(r=>n[r.id].column===n[e.id].column+t&&a(e,r));)t++;n[e.id].span=t}}),{sortedEvents:r,eventPositions:n,maxColumn:o+1})})(o,e);return t.jsxs("div",{className:"relative",onDoubleClick:()=>(e=>{l||c.weekView.enableDoubleClickToShiftViewToDaily&&(u(e),d("day"))})(e),children:[t.jsx("div",{className:"sticky top-0 z-30 bg-background h-12 flex items-center justify-center border-b border-border",children:t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"text-xs font-semibold",children:c.localization.dayNames[e.getDay()].slice(0,3)}),t.jsx("div",{className:"text-sm "+(Gat(e,new Date)?"bg-primary text-primary-foreground rounded-full w-6 h-6 flex items-center justify-center mx-auto":""),children:Vit(e,"d")})]})}),t.jsxs("div",{className:"relative h-[calc(100%-3rem)]",children:[S.map((e,r)=>t.jsx("div",{className:vdt("h-16",0!==r&&"border-t border-border",r===S.length-1&&"border-b border-border")},e)),a.map((r,o)=>{const{top:a,height:l}=((e,t)=>{const r=$Dt(e.startDate,e.startTime),n=$Dt(e.endDate||e.startDate,e.endTime),o=Bat(t),a=Qat(t);let i,s;e.isRepeating?(i=lst(sst(t,r.getHours()),r.getMinutes()),s=lst(sst(t,n.getHours()),n.getMinutes())):(i=Wat([r,o]),s=Uat([n,a]));const l=i.getHours()+i.getMinutes()/60;return{top:64*l,height:64*(s.getHours()+s.getMinutes()/60-l)}})(r,e),{column:u,span:d}=i[r.id],v=d/s*100,y=u/s*100,g=((e,t)=>{var r,n,o,a,i,s;if(!e.isRepeating){if(e.endDate&&!Gat(e.startDate,e.endDate)){const r=Math.floor(Xat(Qat(e.endDate),Bat(e.startDate)))+1;return`Day ${Math.floor(Xat(Bat(t),Bat(e.startDate)))+1} of ${r}`}return null}switch(e.isRepeatingInterval||"daily"){case"daily":{const a=Math.floor(Xat($Dt(e.endDate||e.startDate,e.endTime),$Dt(e.startDate,e.startTime)))+1,i=eit({start:Bat(e.startDate),end:Bat(e.endDate||e.startDate)}),s=a-((null==(r=e.isRepeatingExcludedDates)?void 0:r.filter(e=>i.some(t=>Gat(t,e))).length)||0),l=eit({start:Bat(e.startDate),end:Bat(t)}),u=(null==(n=e.isRepeatingExcludedDates)?void 0:n.filter(e=>l.some(t=>Gat(t,e))).length)||0,d=Math.floor(Xat(Bat(t),Bat(e.startDate)))+1-u;return`${null==(o=c.localization)?void 0:o.repeatDaily} ${d} of ${s}`}case"weekly":{const e=qit(t),r=null==(a=c.localization)?void 0:a.dayNames[e];return`${null==(i=c.localization)?void 0:i.repeatWeekly} ${r}`}case"monthly":return`${null==(s=c.localization)?void 0:s.repeatMonthly} ${Vit(t,"do")}`;default:return null}})(r,e),b=Gat(r.startDate,e),w=r.endDate&&Gat(r.endDate,e);return t.jsx(gTt,{event:r,onAddEvent:f,onUpdateEvent:p,onDeleteEvent:h,onOpenChange:m,dateFromViewClick:e,translations:c.localization,resources:x,children:t.jsxs(xDt.div,{className:vdt("absolute px-1 py-1 rounded overflow-hidden cursor-pointer","transition-colors duration-200","hover:bg-opacity-40 dark:hover:bg-opacity-40",r.isRepeating&&"border border-dashed border-opacity-50",b&&"border-l-1 border-l-black/70 dark:border-l-white/30",w&&"border-r-1 border-r-black/70 dark:border-r-white/30"),style:{...AAt(r.color),top:`${a}px`,height:`${Math.max(l,24)}px`,left:`${y}%`,width:`${v}%`,zIndex:o+1},initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.1*o},children:[t.jsx("div",{className:"text-xs font-semibold truncate",children:r.title||"Untitled Event"}),t.jsxs("div",{className:"text-xs",children:[zAt(r.startTime,n)," - ",zAt(r.endTime,n)]}),g&&t.jsx("div",{className:"text-xs italic",children:g})]})},`${r.id}-${e.toISOString()}`)}),v&&b&&Array.from({length:10}).map((e,r)=>t.jsx(LAt,{className:"absolute top-0 left-0 right-0 h-[3px] dark:h-[1px] animate-pulse bg-primary/20",style:{top:64*r+"px"}},r))]}),r<M.length-1&&t.jsx("div",{className:"absolute top-12 right-0 w-px h-[calc(100%-3rem)] bg-border"})]},e.toString())}),t.jsx("div",{className:"absolute top-0 right-0 w-px h-full bg-border"})]})})]}),!(null!=(w=c.weekView)&&w.hideHoverLine)&&t.jsx("div",{ref:o,className:"absolute left-[12.5%] right-0 h-px bg-primary z-50 pointer-events-none",style:{display:"none"},children:t.jsx("span",{ref:a,className:"absolute left-0 transform -translate-x-full -translate-y-1/2 bg-primary text-primary-foreground text-xs px-1 rounded"})}),M.some(e=>Gat(e,new Date))&&!(null!=(k=c.weekView)&&k.hideTimeline)&&t.jsxs("div",{ref:y,className:"absolute left-[12.5%] right-0 h-px bg-red-500 z-40 pointer-events-none",style:{top:`${g+48}px`},children:[t.jsx("span",{className:"absolute left-0 transform -translate-x-full -translate-y-1/2 bg-red-500 text-white text-xs px-1 rounded",children:Vit(new Date,"HH:mm")}),M.map((e,r)=>Gat(e,new Date)&&t.jsx("div",{className:"absolute h-4 w-[1px] bg-red-500 transform -translate-y-1/2 opacity-75",style:{left:100/7*r+"%",boxShadow:"0 0 4px rgba(239, 68, 68, 0.5)"}},e.toString()))]})]})})]})},YAt=({filteredEvents:e,currentDate:r,currentConfig:n,is24HourFormat:o,onEventAdd:a,onEventUpdate:i,onEventDelete:s,isLoading:l,setCurrentDate:c,setCurrentView:u,isAddEventPopupOpen:d,setIsAddEventPopupOpen:p,onDateRangeChange:h,resources:f})=>{var m;const v=Iat(r,{weekStartsOn:o?1:0}),y=eit({start:v,end:oit(r,{weekStartsOn:o?1:0})}),g=yit(v,{weekStartsOn:o?1:0}),b=f??[],x=(e,t)=>e.isRepeating?(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>Gat(e,t)))&&VDt(t,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily"):e.endDate?Yit(t,{start:Bat(e.startDate),end:Qat(e.endDate)}):Gat(e.startDate,t),w=e=>{d||n.weekView.enableDoubleClickToShiftViewToDaily&&(c(e),u("day"))},k=(null==(m=n.weekView)?void 0:m.resourceDisplayMode)||"row",_=(e,r,l)=>{const c=((e,t)=>{if(e.isRepeating){if("weekly"===e.isRepeatingInterval||"monthly"===e.isRepeatingInterval)return"single";const r=Gat(e.startDate,t),n=e.endDate&&Gat(e.endDate,t);return r&&n?"single":r?"start":n?"end":"middle"}const r=Gat(e.startDate,t),n=e.endDate&&Gat(e.endDate,t);return e.endDate?r&&n?"single":r?"start":n?"end":"middle":"single"})(e,r),u=((e,t)=>{if(!e.isRepeating)return vdt("start"===t&&"border-l-4 border-l-black/70 dark:border-l-white/50","end"===t&&"border-r-4 border-r-black/70 dark:border-r-white/50","middle"===t&&"border-x-0");switch(e.isRepeatingInterval||"daily"){case"daily":return vdt("border border-dashed border-opacity-50","start"===t&&"border-l-solid border-l-2 border-l-black/70 dark:border-l-white/50","end"===t&&"border-r-solid border-r-2 border-r-black/70 dark:border-r-white/50","middle"===t&&"border-x-0");case"weekly":case"monthly":return"border border-dotted border-opacity-50";default:return""}})(e,c),d=UDt(e.startTime,e.endTime),h=e.isRepeating||"single"===c||!d&&"start"===c&&!e.isRepeating||!d&&"end"===c&&!e.isRepeating;return t.jsx(gTt,{event:e,onAddEvent:a,onUpdateEvent:i,onDeleteEvent:s,onOpenChange:p,dateFromViewClick:r,translations:n.localization,resources:f,children:t.jsxs(xDt.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{delay:.1*l},className:vdt("mb-1 last:mb-0 px-2 py-1 rounded cursor-pointer","transition-colors duration-200","hover:bg-opacity-50 dark:hover:bg-opacity-60","flex items-center justify-between gap-1",u),style:AAt(e.color),children:[t.jsx("span",{className:"block overflow-hidden text-ellipsis whitespace-nowrap flex-1 text-xs",children:e.title||n.localization.untitledEvent}),h&&t.jsx("span",{className:"text-[10px] opacity-75 whitespace-nowrap",children:e.isRepeating||"end"!==c?zAt(e.startTime,o):`ends ${zAt(e.endTime,o)}`})]})},e.id)},C=(e,r,l)=>e.length<=3?t.jsx(gTt,{event:{startDate:r,endDate:r,color:l},onAddEvent:e=>a({...e}),onOpenChange:p,translations:n.localization,children:t.jsxs(xDt.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"group",children:[t.jsx(Edt,{variant:"ghost",size:"sm",className:"w-full h-6 text-xs text-muted-foreground hover:text-foreground truncate px-2 md:hidden",children:"+"}),t.jsxs(Edt,{variant:"ghost",size:"sm",className:"w-full h-6 text-xs text-muted-foreground hover:text-foreground truncate px-2 hidden md:block opacity-0 group-hover:opacity-100 transition-opacity duration-200",children:["+ ",n.localization.addEvent]})]})}):t.jsx(VAt,{events:e,addEvent:a,updateEvent:i,onDelete:s,date:r,is24HourFormat:o,resources:f,preSelectedColor:"",translations:n.localization,children:t.jsx(xDt.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},children:t.jsxs(Edt,{variant:"ghost",size:"sm",className:"w-full h-6 text-xs text-muted-foreground hover:text-foreground truncate px-2",children:["+",e.length-3," ",n.localization.more]})})});return t.jsx(WIt,{className:"h-full flex flex-col overflow-hidden",children:t.jsxs(RAt,{className:"flex-1 h-[calc(100vh-200px)]",children:[t.jsx("div",{className:"min-w-[768px] relative",children:t.jsx("div",{className:"relative",children:"row"===k?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"sticky top-0 z-30 bg-background grid grid-cols-8 gap-0",style:{gridTemplateColumns:`90px repeat(${y.length}, minmax(120px, 1fr))`},children:[t.jsx("div",{className:"sticky left-0 z-30 bg-background border-b border-r border-border p-2 h-[50px] flex items-center justify-center",children:t.jsxs("div",{className:"text-xs font-semibold text-center text-muted-foreground",children:[t.jsx("span",{className:"truncate",children:"Week"})," ",g]})}),y.map(e=>t.jsx("div",{className:"border-b border-r border-border p-2 last:border-r-0 h-[50px] flex items-center justify-center",onDoubleClick:()=>w(e),children:t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"text-xs font-semibold",children:n.localization.dayNames[e.getDay()].slice(0,3)}),t.jsx("div",{className:vdt("text-sm",Gat(e,new Date)&&"bg-primary text-primary-foreground rounded-full w-6 h-6 flex items-center justify-center mx-auto"),children:Vit(e,"d")})]})},e.toString()))]}),b.map(r=>t.jsxs("div",{className:"grid gap-0",style:{gridTemplateColumns:`90px repeat(${y.length}, minmax(120px, 1fr))`},children:[t.jsx("div",{className:"sticky left-0 z-30 bg-background border-b border-r border-border p-2 flex items-center justify-center h-[125px]",children:t.jsxs("div",{className:"flex items-center space-x-2",children:[r.accentClass&&t.jsx("div",{className:vdt("w-4 h-4 md:w-5 md:h-5 rounded-full flex-shrink-0",r.accentClass)}),t.jsx("span",{className:"text-xs md:text-sm font-medium truncate max-w-[120px]",children:r.name})]})}),y.map(n=>{const o=e.filter(e=>e.resourceId===r.id&&x(e,n));return t.jsxs("div",{className:"border-b border-r border-border p-2 h-[125px] last:border-r-0 relative group overflow-hidden",onDoubleClick:()=>w(n),children:[t.jsxs("div",{className:"relative z-10 h-full flex flex-col",children:[t.jsx("div",{className:"flex-1 overflow-auto",children:o.slice(0,(o.length,3)).map((e,t)=>_(e,n,t))}),t.jsx("div",{className:"mt-auto",children:C(o,n,r.id)})]}),l&&h&&t.jsx(LAt,{className:"absolute top-0 left-0 right-0 h-[2px] dark:h-[1px] animate-pulse bg-primary/20"})]},`${r.id}-${n.toString()}`)})]},r.id))]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"sticky top-0 z-30 bg-background grid gap-0",style:{gridTemplateColumns:`90px repeat(${b.length}, minmax(120px, 1fr))`},children:[t.jsx("div",{className:"sticky left-0 z-30 bg-background border-b border-r border-border p-2 h-[50px] flex items-center justify-center",children:t.jsxs("div",{className:"text-xs font-semibold text-center text-muted-foreground",children:[t.jsx("span",{className:"truncate",children:"Week"})," ",g]})}),b.map(e=>t.jsx("div",{className:"border-b border-r border-border p-2 last:border-r-0 h-[50px] flex items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center justify-center",children:[e.accentClass&&t.jsx("div",{className:vdt("w-4 h-4 rounded-full",e.accentClass)}),t.jsx("div",{className:"text-xs font-medium mt-1 truncate max-w-[90px] text-center",children:e.name})]})},e.id))]}),y.map(r=>t.jsxs("div",{className:"grid gap-0",style:{gridTemplateColumns:`90px repeat(${b.length}, minmax(120px, 1fr))`},children:[t.jsxs("div",{className:"sticky left-0 z-30 bg-background border-b border-r border-border p-2 flex flex-col items-center justify-center h-[125px]",onDoubleClick:()=>w(r),children:[t.jsx("div",{className:"font-semibold text-sm",children:n.localization.dayNames[r.getDay()].slice(0,3)}),t.jsx("div",{className:vdt("text-base w-7 h-7 flex items-center justify-center",Gat(r,new Date)&&"bg-primary text-primary-foreground rounded-full"),children:Vit(r,"d")})]}),b.map(n=>{const o=e.filter(e=>e.resourceId===n.id&&x(e,r));return t.jsxs("div",{className:"border-b border-r border-border p-2 h-[125px] last:border-r-0 relative group overflow-hidden",onDoubleClick:()=>w(r),children:[t.jsxs("div",{className:"relative z-10 h-full flex flex-col",children:[t.jsx("div",{className:"flex-1 overflow-auto",children:o.slice(0,(o.length,3)).map((e,t)=>_(e,r,t))}),t.jsx("div",{className:"mt-auto",children:C(o,r,n.id)})]}),l&&h&&t.jsx(LAt,{className:"absolute top-0 left-0 right-0 h-[2px] dark:h-[1px] animate-pulse bg-primary/20"})]},`${r.toString()}-${n.id}`)})]},r.toString()))]})})}),t.jsx(FAt,{orientation:"horizontal"})]})})},XAt=({filteredEvents:e,currentDate:r,is24HourFormat:n,hoverLineRef:o,hoverTimeRef:a,setClickedTime:i,clickedTime:s,isAddEventPopupOpen:l,currentConfig:c,setCurrentDate:u,setCurrentView:d,onEventUpdate:p,onEventDelete:h,onEventAdd:f,setIsAddEventPopupOpen:m,isLoading:v,currentTimeLineRef:y,currentTimeTop:g,onDateRangeChange:b,resources:x})=>{var w;const k={filteredEvents:e,currentDate:r,currentConfig:c,is24HourFormat:n,onEventAdd:f,onEventUpdate:p,onEventDelete:h,isLoading:v,isAddEventPopupOpen:l,setIsAddEventPopupOpen:m,setCurrentDate:u,setCurrentView:d,onDateRangeChange:b,resources:x};return t.jsx(t.Fragment,{children:"resource"===(null==(w=c.weekView)?void 0:w.viewType)?t.jsx(YAt,{...k}):t.jsx(KAt,{...k,hoverLineRef:o,hoverTimeRef:a,setClickedTime:i,clickedTime:s,currentTimeLineRef:y,currentTimeTop:g})})},ZAt=({currentConfig:e,currentDate:r,filteredEvents:n,isAddEventPopupOpen:o,setCurrentDate:a,setCurrentView:i,is24HourFormat:s,isLoading:l,onEventAdd:c,onEventUpdate:u,onEventDelete:d,onDateRangeChange:p,resources:h})=>{const f=function(e){const t=Dat(e.start),r=Dat(e.end);let n=+t>+r;const o=n?+t:+r,a=n?r:t;a.setHours(0,0,0,0),a.setDate(1);const i=[];for(;+a<=o;)i.push(Dat(a)),a.setMonth(a.getMonth()+1);return n?i.reverse():i}({start:nit(r),end:rit(r)}),m=s?1:0,v=s?e.localization.dayNames.slice(1).concat(e.localization.dayNames[0]):e.localization.dayNames;return t.jsx(WIt,{className:"p-4",children:t.jsx(RAt,{children:t.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:[l&&p&&t.jsx(LAt,{className:"absolute top-0 left-0 right-0 h-[2px] dark:h-[1px] animate-pulse bg-primary/20"}),f.map(r=>{const l=tit(r),p=eit({start:l,end:Jat(r)}),f=(qit(l)-m+7)%7;return t.jsxs("div",{className:"border rounded p-2",onDoubleClick:()=>(t=>{o||e.yearView.enableDoubleClickToShiftViewToMonthly&&(a(t),i("month"))})(r),children:[t.jsx("h3",{className:"text-lg font-semibold mb-2 text-center",children:e.localization.monthNames[r.getMonth()]}),t.jsxs("div",{className:"grid grid-cols-7 gap-1",children:[v.map((e,n)=>t.jsxs("div",{className:"text-center text-xs text-muted-foreground",children:[t.jsx("span",{className:"hidden sm:inline",children:e}),t.jsx("span",{className:"sm:hidden",children:e.charAt(0)})]},`${r.toString()}-${e}-${n}`)),Array.from({length:f}).map((e,r)=>t.jsx("div",{className:"h-6 w-6"},`empty-start-${r}`)),p.map(r=>{const o=(e=>n.filter(t=>{if(t.isRepeating)return(!t.isRepeatingExcludedDates||!t.isRepeatingExcludedDates.some(t=>Gat(t,e)))&&VDt(e,t.startDate,t.endDate||t.startDate,t.isRepeatingInterval||"daily");const r=Bat(t.startDate),n=Qat(t.endDate||t.startDate);return Yit(e,{start:r,end:n})}).map(e=>AAt(e.color).backgroundColor))(r),a=Gat(r,new Date),i=n.filter(e=>{if(e.isRepeating)return(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>Gat(e,r)))&&VDt(r,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily");const t=Bat(e.startDate),n=Qat(e.endDate||e.startDate);return Yit(r,{start:t,end:n})});return t.jsx(VAt,{events:i,addEvent:c,updateEvent:u,onDelete:d,date:r,is24HourFormat:s,translations:e.localization,resources:h,children:t.jsx("div",{className:vdt("h-6 w-6 flex items-center justify-center text-xs cursor-pointer","text-foreground"),children:t.jsxs("div",{className:vdt("h-5 w-5 flex items-center justify-center rounded-full relative","transition-all duration-200 ease-in-out",a&&"bg-accent text-accent-foreground",o.length>0?"hover:scale-150 hover:z-10":"hover:bg-gray-200 dark:hover:bg-gray-700"),children:[o.length>0?t.jsx("div",{className:"absolute inset-0 rounded-full overflow-hidden",children:o.map((e,n)=>t.jsx("div",{className:"absolute inset-0",style:{backgroundColor:e,clipPath:`polygon(${n*(100/o.length)}% 0%, ${(n+1)*(100/o.length)}% 0%, ${(n+1)*(100/o.length)}% 100%, ${n*(100/o.length)}% 100%)`}},`${r.toString()}-${n}`))}):t.jsx("div",{className:"absolute inset-0 rounded-full transition-opacity opacity-0 hover:opacity-100 bg-gray-200 dark:bg-gray-700"}),t.jsx("time",{dateTime:Vit(r,"yyyy-MM-dd"),className:"relative z-10",children:Vit(r,"d")})]})})},r.toString())})]})]},r.toString())})]})})})},QAt=({currentView:r,isListView:n,animationDirection:o,currentDate:a,filteredEvents:i,listSearchTerm:s,setListSearchTerm:l,currentConfig:c,resources:u,onEventUpdate:d,onEventDelete:p,isLoading:h,onEventAdd:f,is24HourFormat:m,setCurrentDate:v,setCurrentView:y,onDateRangeChange:g})=>{const[b,x]=e.useState(!1),[w,k]=e.useState(null),_=e.useRef(null),C=e.useRef(null),M=e.useRef(null),S=(()=>{const[t,r]=e.useState(0);return e.useEffect(()=>{const e=()=>{const e=new Date,t=(60*e.getHours()+e.getMinutes())*(16/15);r(t)};e();const t=setInterval(e,6e4);return()=>clearInterval(t)},[]),t})();$It({currentView:r,currentDate:a,onDateRangeChange:g,is24HourFormat:m});const D={filteredEvents:i,currentDate:a,currentConfig:c,onEventUpdate:d,onEventDelete:p,onEventAdd:f,is24HourFormat:m,isLoading:h,resources:u},O={isAddEventPopupOpen:b,setIsAddEventPopupOpen:x,onDateRangeChange:g},P={hoverLineRef:_,hoverTimeRef:C},E={clickedTime:w,setClickedTime:k},j={currentTimeLineRef:M,currentTimeTop:S},T={setCurrentDate:v,setCurrentView:y};return t.jsx(Tbt,{mode:"wait",children:t.jsx(xDt.div,{initial:{opacity:0,y:"up"===o?-20:"down"===o?20:0},animate:{opacity:1,x:0,y:0},exit:{opacity:0,y:"up"===o?20:"down"===o?-20:0},transition:{duration:.1},className:"h-full",children:n?t.jsx($At,{...D,currentView:r,listSearchTerm:s,setListSearchTerm:l}):t.jsxs(t.Fragment,{children:["day"===r&&t.jsx(qAt,{...D,...O,...P,...E,...j}),"week"===r&&t.jsx(XAt,{...D,...O,...P,...E,...j,...T}),"month"===r&&t.jsx(GAt,{...D,...O,...T}),"year"===r&&t.jsx(ZAt,{...D,...O,...T})]})},`${r}-${a.toISOString()}`)})},JAt=({config:r,events:n,isLoading:o=!1,resources:a,onEventAdd:i,onEventUpdate:s,onEventDelete:l,onDateRangeChange:c})=>{const u={...pst,...r},d=ust({config:{defaultView:u.defaultView||"month",use24HourFormatByDefault:u.use24HourFormatByDefault||!1},translations:u.localization}),[p,h]=e.useState(!1),[f,m]=e.useState(""),[v,y]=e.useState([]),g=a&&a.length>0?n.filter(e=>{if(!v.length)return!0;if(e.resourceId)return v.includes(e.resourceId);if(e.color){const t=a.find(t=>t.color===e.color||t.id===e.color);return!!t&&v.includes(t.id)}return!1}):n,b=(()=>{const[t,r]=e.useState(!1);return e.useEffect(()=>{r("ontouchstart"in window||navigator.maxTouchPoints>0)},[]),t})(),x=Sat({onSwipedLeft:()=>d.handleNext(),onSwipedRight:()=>d.handlePrevious(),preventScrollOnSwipe:!1,trackMouse:!1,delta:{left:100,right:100},swipeDuration:150,touchEventOptions:{passive:!0},trackTouch:!0}),w={...d,currentConfig:u,onEventAdd:i,onEventDelete:l,isListView:p};return t.jsxs("div",{...b?x:{},children:[t.jsx(qIt,{...w,setIsListView:h,resources:a,selectedResourceIds:v,setSelectedResourceIds:y}),t.jsx(QAt,{...w,is24HourFormat:d.use24HourFormat,filteredEvents:g,listSearchTerm:f,setListSearchTerm:m,resources:a,onEventUpdate:s,isLoading:o,onDateRangeChange:c})]})};function eLt({config:t={},initialEvents:r=[],onEventAdd:n,onEventUpdate:o,onEventDelete:a,onDateRangeChange:i}){var s,l;const[c,u]=e.useState(r),[d,p]=e.useState(!1),h=e.useRef(null),f=e.useRef(null),m=(null==(s=t.calendarConfig)?void 0:s.localization)||dst,v=async(e,r)=>{var o;let a;try{a=n?await n(e):{...e,id:Date.now().toString()+Math.random().toString(36).substring(2,7)},u(e=>[...e,a]),f.current=a,r?TDt.success(m.eventRestored):TDt.success(m.eventAdded,{action:{label:m.undo,onClick:()=>g(a.id,!0)}})}catch(n){console.error("Error adding event:",n),TDt.error(m.failedToAddEvent,!1!==(null==(o=t.events)?void 0:o.allowUserRetryAfterFailure)?{action:{label:m.tryAgain,onClick:()=>v(e,r)}}:void 0)}},y=async(e,r)=>{var n;try{o&&await o(e),u(t=>t.map(t=>t.id===e.id?e:t)),r?TDt.success(m.eventRestored):TDt.success(m.eventUpdated,{action:{label:m.undo,onClick:()=>y(c.find(t=>t.id===e.id),!0)}})}catch(o){console.error("Error updating event:",o),TDt.error(m.failedToUpdateEvent,!1!==(null==(n=t.events)?void 0:n.allowUserRetryAfterFailure)?{action:{label:m.tryAgain,onClick:()=>y(e,r)}}:void 0)}},g=async(e,r)=>{var n;if(!e)return;const o=r?f.current:c.find(t=>t.id===e);if(o)try{a&&await a(e),u(t=>t.filter(t=>t.id!==e)),r?TDt.success(m.eventDeleted):TDt.success(m.eventDeleted,{action:{label:m.undo,onClick:()=>v(o,!0)}})}catch(o){console.error("Error deleting event:",o),TDt.error(m.failedToDeleteEvent,!1!==(null==(n=t.events)?void 0:n.allowUserRetryAfterFailure)?{action:{label:m.tryAgain,onClick:()=>g(e,r)}}:void 0)}else console.error(`Event with id ${e} not found`)},b=function(t,r,n){const o=e.useRef(),a=e.useRef(null),i=e.useCallback(()=>{var e;o.current&&(clearTimeout(o.current),o.current=void 0,null==(e=null==n?void 0:n.onCancel)||e.call(n),a.current&&(a.current(),a.current=null))},[n]);return e.useEffect(()=>()=>i(),[i]),e.useCallback((...e)=>{var s;return r?(i(),null==(s=null==n?void 0:n.onDebounce)||s.call(n),new Promise(n=>{a.current=n,o.current=setTimeout(async()=>{await t(...e),a.current=null,n()},r)})):t(...e)},[t,r,n,i])}(async(e,r)=>{var n;if(!i)return;h.current&&h.current.abort();const o=new AbortController;h.current=o;try{p(!0);const t=await i(e,r,o.signal);h.current===o&&u(e=>[...e,...t])}catch(o){if(o instanceof DOMException&&"AbortError"===o.name)return;console.error("Error fetching events:",o),TDt.error(m.failedToFetchEvents,!1!==(null==(n=t.events)?void 0:n.allowUserRetryAfterFailure)?{action:{label:m.tryAgain,onClick:()=>b(e,r)}}:void 0)}finally{h.current===o&&(p(!1),h.current=null)}},null==(l=t.events)?void 0:l.debounceTimeOnViewOrDateChange,{onDebounce:()=>{}});return{events:c,isLoading:d,addEvent:v,updateEvent:y,deleteEvent:g,onViewOrDateChange:b}}new Date((new Date).getFullYear(),(new Date).getMonth(),7),new Date((new Date).getFullYear(),(new Date).getMonth(),7),new Date((new Date).getFullYear(),(new Date).getMonth(),9),new Date((new Date).getFullYear(),(new Date).getMonth(),9),new Date((new Date).getFullYear(),(new Date).getMonth(),9),new Date((new Date).getFullYear(),(new Date).getMonth(),9),new Date((new Date).getFullYear(),(new Date).getMonth(),12),new Date((new Date).getFullYear(),(new Date).getMonth(),12),new Date((new Date).getFullYear(),(new Date).getMonth(),15),new Date((new Date).getFullYear(),(new Date).getMonth(),15),new Date((new Date).getFullYear(),(new Date).getMonth(),15),new Date((new Date).getFullYear(),(new Date).getMonth(),15),new Date((new Date).getFullYear(),(new Date).getMonth(),17),new Date((new Date).getFullYear(),(new Date).getMonth(),17),new Date((new Date).getFullYear(),(new Date).getMonth(),19),new Date((new Date).getFullYear(),(new Date).getMonth(),19),new Date((new Date).getFullYear(),(new Date).getMonth(),19),new Date((new Date).getFullYear(),(new Date).getMonth(),19),new Date((new Date).getFullYear(),(new Date).getMonth(),19),new Date((new Date).getFullYear(),(new Date).getMonth(),19),new Date((new Date).getFullYear(),(new Date).getMonth(),20),new Date((new Date).getFullYear(),(new Date).getMonth(),20),new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()+1),new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()+3),new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()),new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()),new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()),new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()),new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()),new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()),new Date((new Date).getFullYear(),(new Date).getMonth(),19),new Date((new Date).getFullYear(),(new Date).getMonth(),19),new Date((new Date).getFullYear(),(new Date).getMonth(),19),new Date((new Date).getFullYear(),(new Date).getMonth(),19),new Date((new Date).getFullYear(),(new Date).getMonth(),19),new Date((new Date).getFullYear(),(new Date).getMonth(),19),new Date((new Date).getFullYear(),(new Date).getMonth(),22),new Date((new Date).getFullYear(),(new Date).getMonth(),22),new Date((new Date).getFullYear(),(new Date).getMonth(),22),new Date((new Date).getFullYear(),(new Date).getMonth(),22),new Date((new Date).getFullYear(),(new Date).getMonth(),25),new Date((new Date).getFullYear(),(new Date).getMonth(),25),new Date((new Date).getFullYear(),(new Date).getMonth(),28),new Date((new Date).getFullYear(),(new Date).getMonth(),28),new Date((new Date).getFullYear(),(new Date).getMonth(),28),new Date((new Date).getFullYear(),(new Date).getMonth(),28),new Date((new Date).getFullYear(),(new Date).getMonth(),28),new Date((new Date).getFullYear(),(new Date).getMonth(),28),new Date((new Date).getFullYear(),(new Date).getMonth(),3),new Date((new Date).getFullYear(),(new Date).getMonth(),3),new Date((new Date).getFullYear(),(new Date).getMonth(),3),new Date((new Date).getFullYear(),(new Date).getMonth(),3),new Date((new Date).getFullYear(),(new Date).getMonth(),3),new Date((new Date).getFullYear(),(new Date).getMonth(),3),new Date((new Date).getFullYear(),(new Date).getMonth(),10),new Date((new Date).getFullYear(),(new Date).getMonth(),10),new Date((new Date).getFullYear(),(new Date).getMonth(),10),new Date((new Date).getFullYear(),(new Date).getMonth(),10),new Date((new Date).getFullYear(),(new Date).getMonth(),10),new Date((new Date).getFullYear(),(new Date).getMonth(),10),new Date((new Date).getFullYear(),(new Date).getMonth(),20),new Date((new Date).getFullYear(),(new Date).getMonth(),20),new Date((new Date).getFullYear(),(new Date).getMonth(),20),new Date((new Date).getFullYear(),(new Date).getMonth(),20),new Date((new Date).getFullYear(),(new Date).getMonth(),20),new Date((new Date).getFullYear(),(new Date).getMonth(),20),new Date((new Date).getFullYear(),(new Date).getMonth(),24),new Date((new Date).getFullYear(),(new Date).getMonth(),24),new Date((new Date).getFullYear(),(new Date).getMonth(),24),new Date((new Date).getFullYear(),(new Date).getMonth(),24),new Date((new Date).getFullYear(),(new Date).getMonth(),24),new Date((new Date).getFullYear(),(new Date).getMonth(),24),new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()-1),new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()+3);var tLt=function(e){var t=e.configurationItemInfo,r=Z(e,["configurationItemInfo"]),n=eLt({initialEvents:r.events||[],onEventAdd:function(e){return Q(void 0,void 0,void 0,function(){var t;return J(this,function(n){switch(n.label){case 0:return[4,null===(t=r.onEventCreate)||void 0===t?void 0:t.call(r,e)];case 1:return n.sent(),[2,X(X({},e),{id:Date.now().toString()})]}})})},onEventUpdate:function(e){return Q(void 0,void 0,void 0,function(){var t;return J(this,function(n){switch(n.label){case 0:return[4,null===(t=r.onEventUpdate)||void 0===t?void 0:t.call(r,e)];case 1:return n.sent(),[2,e]}})})},onEventDelete:r.onEventDelete,onDateRangeChange:r.onDateRangeChange}),o=n.events,a=n.isLoading,i=n.addEvent,s=n.updateEvent,l=n.deleteEvent,c=n.onViewOrDateChange;return lt(nh,X({sx:X({width:"100%",height:"100%"},r.css)},t,{className:"fec-wrapper"},{children:lt(JAt,{events:o,isLoading:a,config:r.config,onEventAdd:i,onEventUpdate:s,onEventDelete:l,onDateRangeChange:c})}))},rLt={exports:{}};const nLt={AED:"د.إ",AFN:"؋",ALL:"L",AMD:"֏",ANG:"ƒ",AOA:"Kz",ARS:"$",AUD:"$",AWG:"ƒ",AZN:"₼",BAM:"KM",BBD:"$",BDT:"৳",BGN:"лв",BHD:".د.ب",BIF:"FBu",BMD:"$",BND:"$",BOB:"$b",BOV:"BOV",BRL:"R$",BSD:"$",BTC:"₿",BTN:"Nu.",BWP:"P",BYN:"Br",BYR:"Br",BZD:"BZ$",CAD:"$",CDF:"FC",CHE:"CHE",CHF:"CHF",CHW:"CHW",CLF:"CLF",CLP:"$",CNH:"¥",CNY:"¥",COP:"$",COU:"COU",CRC:"₡",CUC:"$",CUP:"₱",CVE:"$",CZK:"Kč",DJF:"Fdj",DKK:"kr",DOP:"RD$",DZD:"دج",EEK:"kr",EGP:"£",ERN:"Nfk",ETB:"Br",ETH:"Ξ",EUR:"€",FJD:"$",FKP:"£",GBP:"£",GEL:"₾",GGP:"£",GHC:"₵",GHS:"GH₵",GIP:"£",GMD:"D",GNF:"FG",GTQ:"Q",GYD:"$",HKD:"$",HNL:"L",HRK:"kn",HTG:"G",HUF:"Ft",IDR:"Rp",ILS:"₪",IMP:"£",INR:"₹",IQD:"ع.د",IRR:"﷼",ISK:"kr",JEP:"£",JMD:"J$",JOD:"JD",JPY:"¥",KES:"KSh",KGS:"лв",KHR:"៛",KMF:"CF",KPW:"₩",KRW:"₩",KWD:"KD",KYD:"$",KZT:"₸",LAK:"₭",LBP:"£",LKR:"₨",LRD:"$",LSL:"M",LTC:"Ł",LTL:"Lt",LVL:"Ls",LYD:"LD",MAD:"MAD",MDL:"lei",MGA:"Ar",MKD:"ден",MMK:"K",MNT:"₮",MOP:"MOP$",MRO:"UM",MRU:"UM",MUR:"₨",MVR:"Rf",MWK:"MK",MXN:"$",MXV:"MXV",MYR:"RM",MZN:"MT",NAD:"$",NGN:"₦",NIO:"C$",NOK:"kr",NPR:"₨",NZD:"$",OMR:"﷼",PAB:"B/.",PEN:"S/.",PGK:"K",PHP:"₱",PKR:"₨",PLN:"zł",PYG:"Gs",QAR:"﷼",RMB:"¥",RON:"lei",RSD:"Дин.",RUB:"₽",RWF:"R₣",SAR:"﷼",SBD:"$",SCR:"₨",SDG:"ج.س.",SEK:"kr",SGD:"S$",SHP:"£",SLL:"Le",SOS:"S",SRD:"$",SSP:"£",STD:"Db",STN:"Db",SVC:"$",SYP:"£",SZL:"E",THB:"฿",TJS:"SM",TMT:"T",TND:"د.ت",TOP:"T$",TRL:"₤",TRY:"₺",TTD:"TT$",TVD:"$",TWD:"NT$",TZS:"TSh",UAH:"₴",UGX:"USh",USD:"$",UYI:"UYI",UYU:"$U",UYW:"UYW",UZS:"лв",VEF:"Bs",VES:"Bs.S",VND:"₫",VUV:"VT",WST:"WS$",XAF:"FCFA",XBT:"Ƀ",XCD:"$",XOF:"CFA",XPF:"₣",XSU:"Sucre",XUA:"XUA",YER:"﷼",ZAR:"R",ZMW:"ZK",ZWD:"Z$",ZWL:"$"};rLt.exports=function(e){if("string"!=typeof e)return;const t=e.toUpperCase();return Object.prototype.hasOwnProperty.call(nLt,t)?nLt[t]:void 0},rLt.exports.currencySymbolMap=nLt;var oLt=function(t){var r,n,o=t.required,a=void 0!==o&&o,i=t.requiredErrorText,s=void 0===i?"This field is required":i,l=t.validationErrorText,c=void 0===l?"Invalid numeric value":l,u=t.isDisplayOnly,d=void 0!==u&&u,p=t.backgroundColor,h=t.textAlign,f=void 0===h?"left":h,m=t.textColor,v=void 0===m?"inherit":m,y=t.fontSize,g=void 0===y?"16px":y,b=t.fontFamily,x=void 0===b?"inherit":b,w=t.fontWeight,k=void 0===w?"normal":w,_=t.borderColor,C=t.marginLeft,M=void 0===C?"0":C,S=t.marginTop,D=void 0===S?"0":S,O=t.marginRight,P=void 0===O?"0":O,E=t.marginBottom,j=void 0===E?"0":E,T=t.paddingLeft,N=void 0===T?"0":T,R=t.paddingTop,F=void 0===R?"0":R,z=t.paddingRight,I=void 0===z?"0":z,A=t.paddingBottom,L=void 0===A?"0":A,B=t.width,V=t.height,H=t.minHeight,q=t.maxHeight,$=t.minWidth,W=t.maxWidth,U=t.text,G=t.placeholderText,K=t.configurationItemInfo,Y=t.name,Z=t.numericPrecision,Q=void 0===Z?"1":Z,J=t.currency,ee=t.placement,te=void 0===ee?"left":ee,re=t.sourceDataModelField,ne=jN(),oe=null==ne?void 0:ne.control,ae=oqt().localStateObject,ie=lqt().stateConfig,se=bnt(),le=ae||ie,ce=e.useState(""),ue=ce[0],de=ce[1],pe=!!oe&&!!Y,he=re?null===(r=null==le?void 0:le[re])||void 0===r?void 0:r.value:void 0,fe=re?null==se?void 0:se.getDmfValue(re):void 0,me=Number.isFinite(+Q)&&+Q>0?+Q:1,ve=J?null!==(n=rLt.exports(J.toUpperCase()))&&void 0!==n?n:J.toUpperCase():"",ye={required:!!a&&s,pattern:{value:/^-?\d+(?:\.\d+)?$/,message:c}},ge=X(X(X(X(X(X(X({backgroundColor:p,color:v,fontSize:g,fontFamily:x,fontWeight:k},B&&{width:B}),V&&{height:V}),$&&{minWidth:$}),W&&{maxWidth:W}),H&&{minHeight:H}),q&&{maxHeight:q}),{"& .MuiOutlinedInput-root":{"& fieldset":{borderColor:_},"&:hover fieldset":{borderColor:_},"&.Mui-focused fieldset":{borderColor:_},"&.Mui-disabled fieldset":{borderColor:_}},"& .MuiOutlinedInput-input":{textAlign:f,paddingLeft:N,paddingTop:F,paddingRight:I,paddingBottom:L}}),be={color:v,"&.Mui-focused":{color:v}},xe=X(X(X(X(X(X({marginLeft:M,marginTop:D,marginRight:P,marginBottom:j,display:"inline-flex",flexDirection:"column"},B&&{width:B}),V&&{height:V}),$&&{minWidth:$}),W&&{maxWidth:W}),H&&{minHeight:H}),q&&{maxHeight:q}),we=ve?lt("span",X({style:{color:v,fontWeight:k}},{children:ve})):null;if(d){var ke=void 0!==fe?fe:pe?ne.watch(Y):he,_e=null!=ke?ke:"-";return ct(nh,X({sx:X(X(X(X(X(X(X({},xe),B&&{width:B}),V&&{height:V}),$&&{minWidth:$}),W&&{maxWidth:W}),H&&{minHeight:H}),q&&{maxHeight:q})},K,{children:[U&&lt(Pm,X({sx:{fontSize:g,fontFamily:x,fontWeight:k,color:v,marginLeft:0}},{children:U})),lt(Ic,X({sx:{fontSize:g,fontFamily:x,fontWeight:k,color:v,backgroundColor:p,paddingLeft:N,paddingTop:F,paddingRight:I,paddingBottom:L,border:"1px solid ".concat(_||"#ccc"),borderRadius:"4px",minWidth:"100px"}},{children:"left"===te?"".concat(ve).concat(_e):"".concat(_e).concat(ve)}))]}))}var Ce=function(e,t){return lt(fk,X({type:"number",label:U,required:a,placeholder:G,variant:"outlined",sx:X(X(X(X(X(X(X({},xe),B&&{width:B}),V&&{height:V}),$&&{minWidth:$}),W&&{maxWidth:W}),H&&{minHeight:H}),q&&{maxHeight:q}),inputProps:{step:me},slotProps:{input:{sx:ge,style:{textAlign:f}},inputLabel:{sx:be}},InputProps:{startAdornment:"left"===te&&we?lt(Qm,X({position:"start"},{children:we})):void 0,endAdornment:"right"===te&&we?lt(Qm,X({position:"end"},{children:we})):void 0},error:!!t,helperText:t||null},e,K))};return pe?lt(AN,{name:Y,rules:ye,control:oe,defaultValue:"",render:function(e){var t,r=e.field,n=e.fieldState;return Ce(r,null===(t=n.error)||void 0===t?void 0:t.message)}}):Ce({value:ue,onChange:function(e){return de(e.target.value)}})},aLt=e.forwardRef(function(e,t){var r=e.inputRef,n=Z(e,["inputRef"]);return lt(V_,X({},n,{ref:function(e){"function"==typeof r&&r(e?e.inputElement:null)},mask:Q_,guide:!0,placeholderChar:" "}))}),iLt=function(e){var t=e.masked,r=e.errorMsg,n=e.inputSx,o=e.labelSx,a=Z(e,["masked","errorMsg","inputSx","labelSx"]);return lt(fk,X({},a,{variant:"outlined",error:!!r,helperText:r||null,type:"text",slotProps:{input:X({sx:n},t?{inputComponent:aLt}:{}),inputLabel:{sx:o}}}))},sLt=function(t){var r,n=t.isDisplayOnly,o=void 0!==n&&n,a=t.required,i=void 0!==a&&a,s=t.requiredErrorText,l=void 0===s?"Email is required":s,c=t.validationErrorText,u=void 0===c?"Invalid email address":c,d=t.text,p=t.placeholderText,h=t.masked,f=void 0!==h&&h,m=t.multiLine,v=void 0!==m&&m,y=t.backgroundColor,g=t.borderColor,b=t.color,x=void 0===b?"inherit":b,w=t.fontSize,k=void 0===w?"16px":w,_=t.fontFamily,C=void 0===_?"inherit":_,M=t.fontWeight,S=void 0===M?"normal":M,D=t.textAlign,O=void 0===D?"left":D,P=t.marginLeft,E=void 0===P?"0":P,j=t.marginTop,T=void 0===j?"0":j,N=t.marginRight,R=void 0===N?"0":N,F=t.marginBottom,z=void 0===F?"0":F,I=t.paddingLeft,A=void 0===I?"0":I,L=t.paddingTop,B=void 0===L?"0":L,V=t.paddingRight,H=void 0===V?"0":V,q=t.paddingBottom,$=void 0===q?"0":q,W=t.width,U=t.height,G=t.minHeight,K=t.maxHeight,Y=t.minWidth,Z=t.maxWidth,Q=t.name,J=t.sourceDataModelField,ee=t.configurationItemInfo,te=jN(),re=null==te?void 0:te.control,ne=!(!re||!Q),oe=oqt().localStateObject,ae=lqt().stateConfig,ie=bnt(),se=oe||ae,le=J?null===(r=null==se?void 0:se[J])||void 0===r?void 0:r.value:void 0,ce=J?null==ie?void 0:ie.getDmfValue(J):void 0,ue=e.useState("");ue[0],ue[1];var de=e.useState(""),pe=de[0],he=de[1],fe={required:!!i&&l,pattern:{value:/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@(([^<>()[\]\\.,;:\s@"]+\.)+[^<>()[\]\\.,;:\s@"]{2,})$/,message:u}};if(o){var me=(void 0!==ce?String(null!=ce?ce:""):ne?te.watch(Q)||"":le||"")||p||"-";return ct("div",X({style:X(X(X({display:"inline-flex",flexDirection:"column",marginLeft:E,marginTop:T,marginRight:R,marginBottom:z},W&&{width:W}),U&&{height:U}),{minHeight:G,maxHeight:K,minWidth:Y,maxWidth:Z})},ee,{children:[d&&lt(Pm,X({sx:{fontSize:k,fontFamily:C,fontWeight:S,color:x,marginLeft:0,marginBottom:"4px"}},{children:d})),lt(Ic,X({sx:{fontSize:k,fontFamily:C,fontWeight:S,color:x,paddingLeft:A,paddingTop:B,paddingRight:H,paddingBottom:$,backgroundColor:y,border:"1px solid ".concat(g||"#ccc"),borderRadius:"4px",minWidth:"120px",textAlign:O}},{children:me}))]}))}var ve=X(X(X(X(X(X(X({backgroundColor:y,color:x,fontSize:k,fontFamily:C,fontWeight:S},W&&{width:W}),U&&{height:U}),Y&&{minWidth:Y}),Z&&{maxWidth:Z}),G&&{minHeight:G}),K&&{maxHeight:K}),{"& .MuiOutlinedInput-notchedOutline":{borderColor:g||"inherit"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:g||"inherit"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:g||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled .MuiOutlinedInput-notchedOutline":{borderColor:g||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled:hover .MuiOutlinedInput-notchedOutline":{borderColor:g||"inherit"},"& .MuiOutlinedInput-input":{textAlign:O,paddingLeft:A,paddingTop:B,paddingRight:H,paddingBottom:$}}),ye={color:x,"&.Mui-focused":{color:x}},ge=v?3:1,be=X(X(X(X(X(X({},W&&{width:W}),U&&{height:U}),Y&&{minWidth:Y}),Z&&{maxWidth:Z}),G&&{minHeight:G}),K&&{maxHeight:K});return lt("div",X({style:X(X(X({marginLeft:E,marginTop:T,marginRight:R,marginBottom:z},W&&{width:W}),U&&{height:U}),{minHeight:G,maxHeight:K,minWidth:Y,maxWidth:Z})},ne?{children:lt(AN,{name:Q,rules:fe,control:re,defaultValue:"",render:function(e){var t,r=e.field,n=e.fieldState;return lt(iLt,X({masked:f,required:i,errorMsg:null===(t=n.error)||void 0===t?void 0:t.message,inputSx:ve,labelSx:ye,sx:be,label:d,placeholder:p,multiline:v,minRows:ge,value:r.value||"",onChange:r.onChange},ee||{}))}})}:{children:lt(iLt,X({masked:f,required:i,errorMsg:void 0,inputSx:ve,labelSx:ye,sx:be,label:d,placeholder:p,multiline:v,minRows:ge,value:pe,onChange:function(e){return he(e.target.value)}},ee||{}))}))},lLt=function(e){return{justifyContent:e.textAlign||"flex-start",backgroundColor:e.backgroundColor,paddingTop:e.paddingTop,paddingRight:e.paddingRight,paddingBottom:e.paddingBottom,paddingLeft:e.paddingLeft}},cLt=function(t){var r,n=t.popover,o=void 0===n||n,a=t.items,i=t.marginTop,s=void 0===i?"0":i,l=t.marginRight,c=void 0===l?"0":l,u=t.marginBottom,d=void 0===u?"0":u,p=t.marginLeft,h=void 0===p?"0":p,f=t.paddingTop,m=void 0===f?"0":f,v=t.paddingRight,y=void 0===v?"0":v,g=t.paddingBottom,b=void 0===g?"0":g,x=t.paddingLeft,w=void 0===x?"0":x,k=t.cornerRadius,_=void 0===k?"4px":k,C=t.backgroundColor,M=void 0===C?"#fff":C,S=t.width,D=void 0===S?"100%":S,O=t.height,P=void 0===O?"auto":O,E=t.borderColor,j=void 0===E?"#ccc":E,T=t.borderWeight,N=void 0===T?"1px":T,R=t.buttonText,F=void 0===R?"Open Menu":R,z=t.buttonVariant,I=void 0===z?"contained":z,A=t.buttonTextColor,L=t.buttonFontSize,B=t.buttonFontWeight,V=t.buttonFontFamily,H=t.buttonDisabled,q=void 0!==H&&H,$=t.buttonGap,W=void 0===$?0:$,U=t.buttonStartIcon,G=t.buttonEndIcon,K=t.buttonCornerRadius,Y=void 0===K?"0":K,Z=t.buttonMarginTop,Q=void 0===Z?"0":Z,J=t.buttonMarginRight,ee=void 0===J?"0":J,te=t.buttonMarginBottom,re=void 0===te?"0":te,ne=t.buttonMarginLeft,oe=void 0===ne?"0":ne,ae=t.buttonPaddingTop,ie=void 0===ae?"0":ae,se=t.buttonPaddingRight,le=void 0===se?"0":se,ce=t.buttonPaddingBottom,ue=void 0===ce?"0":ce,de=t.buttonPaddingLeft,pe=void 0===de?"0":de,he=t.buttonIconOnly,fe=t.buttonElevation,me=t.buttonFillColor,ve=t.buttonFillColorDisabled,ye=t.buttonFillColorHover,ge=t.buttonFillColorPressed,be=t.buttonBorderColor,xe=t.buttonBorderColorDisabled,we=t.buttonBorderColorHover,ke=t.buttonBorderColorPressed,_e=t.buttonTextColorDisabled,Ce=t.buttonTextColorHover,Me=t.buttonTextColorPressed,Se=t.buttonColor,De=void 0===Se?"#1976d2":Se,Oe=t.anchorOriginVertical,Pe=void 0===Oe?"bottom":Oe,Ee=t.anchorOriginHorizontal,je=void 0===Ee?"left":Ee,Te=t.transformOriginVertical,Ne=void 0===Te?"top":Te,Re=t.transformOriginHorizontal,Fe=void 0===Re?"left":Re,ze=t.elevation,Ie=void 0===ze?3:ze,Ae=t.moleculeId,Le=t.configurationItemInfo,Be=Qe(),Ve=oqt(),He=Ve.isConfigurationMode,qe=Ve.selectedConfigurationItemId,$e=Ve.onConfigurationItemClicked,We=Ve.onInternalNavigation,Ue=e.useState(null),Ge=Ue[0],Ke=Ue[1],Ye=e.useState(!1),Xe=Ye[0],Ze=Ye[1],Je=Boolean(He&&(qe===Ae||a.some(function(e){return e.id===qe}))),et=function(){return Ze(!1)},tt=X({marginTop:s,marginRight:c,marginBottom:d,marginLeft:h,paddingTop:m,paddingRight:y,paddingBottom:b,paddingLeft:w},o?{display:"inline-block",zIndex:null===(r=null==Be?void 0:Be.zIndex)||void 0===r?void 0:r.drawer}:{width:D,height:P,backgroundColor:M,display:"block",overflow:"hidden",border:"".concat(N," solid ").concat(j),borderRadius:_});return o?ct(nh,{children:[lt(_nt,{ref:Ke,text:F,variant:I,moleculeId:Ae,textColor:A,fontSize:L,fontWeight:B,fontFamily:V,disabled:q,gap:W,startIcon:U,endIcon:G,onClick:function(){return Ze(!0)},marginTop:Q,marginRight:ee,marginBottom:re,marginLeft:oe,paddingTop:ie,paddingRight:le,paddingBottom:ue,paddingLeft:pe,borderRadius:Y,iconOnly:he,elevation:fe,fillColor:me||De,fillColorDisabled:ve,fillColorHover:ye,fillColorPressed:ge,borderColor:be,borderColorDisabled:xe,borderColorHover:we,borderColorPressed:ke,textColorDisabled:_e,textColorHover:Ce,textColorPressed:Me,configurationItemInfo:Le}),lt(ky,X({open:He?Je:Xe,variant:"menu",anchorEl:Ge,disablePortal:!0,disableScrollLock:!0,disableRestoreFocus:!0,disableEnforceFocus:!0,onClose:et,anchorOrigin:{vertical:Pe,horizontal:je},transformOrigin:{vertical:Ne,horizontal:Fe},elevation:Ie,slotProps:{paper:{sx:{backgroundColor:M}}},sx:tt},{children:a.map(function(e){var t=qe===e.id,r={entityId:e.id,entity:"molecule_item",entityType:"menu_item"},n=He?function(e){e.stopPropagation(),null==$e||$e(r,!1)}:void 0,o=He?function(e){e.stopPropagation(),null==$e||$e(r,!0)}:void 0,a=He?{onClick:n,onDoubleClick:o,"data-organism-id":e.id,css:f$({theme:Be,selected:t})}:{};return ct(Dy,X({sx:lLt(e),onClick:function(){var t,r;(null==e?void 0:e.link)&&(P$(e.link)?null==We||We({link:(null===(t=e.link)||void 0===t?void 0:t.internalLink)||""}):O$(null===(r=e.link)||void 0===r?void 0:r.externalLink)),et()},disabled:e.disabled},a,{children:[e.startIcon&&lt(mnt,{iconName:e.startIcon,color:e.textColor}),lt(Ic,X({sx:{ml:e.startIcon?1:0,mr:e.endIcon?1:0,color:e.textColor||"inherit",fontSize:e.fontSize||"inherit",fontWeight:e.fontWeight||"normal",fontFamily:e.fontFamily||"inherit",whiteSpace:e.wrap?"normal":"nowrap",width:"100%",textAlign:e.textAlign||"left"}},{children:e.text})),e.endIcon&&lt(mnt,{iconName:e.endIcon,color:e.textColor})]}),e.id)})}))]}):lt(cl,X({id:Ae,sx:tt,elevation:Ie},Le,{children:lt(Pv,X({disablePadding:!0},{children:a.map(function(e){var t=qe===e.id,r={entityId:e.id,entity:"molecule_item",entityType:"menu_item"},n=He?function(e){e.stopPropagation(),null==$e||$e(r,!1)}:void 0,o=He?function(e){e.stopPropagation(),null==$e||$e(r,!0)}:void 0,a=He?{onClick:n,onDoubleClick:o,"data-organism-id":e.id,css:f$({theme:Be,selected:t})}:{};return ct(Fv,X({disabled:e.disabled,sx:lLt(e),onClick:function(){var t,r;(null==e?void 0:e.link)&&(P$(e.link)?null==We||We({link:(null===(t=e.link)||void 0===t?void 0:t.internalLink)||""}):O$(null===(r=e.link)||void 0===r?void 0:r.externalLink))}},a,{children:[e.startIcon&&lt(mnt,{iconName:e.startIcon,color:e.textColor}),lt(Jv,{primary:lt(Ic,X({sx:{ml:e.startIcon?1:0,mr:e.endIcon?1:0,color:e.textColor||"inherit",fontSize:e.fontSize||"inherit",fontWeight:e.fontWeight||"normal",fontFamily:e.fontFamily||"inherit",whiteSpace:e.wrap?"normal":"nowrap",textAlign:e.textAlign||"left"}},{children:e.text}))}),e.endIcon&&lt(mnt,{iconName:e.endIcon,color:e.textColor})]}),e.id)})}))}))};var uLt=function(e){var t=e.errorMsg,r=e.stepValue,n=e.minValue,o=e.allowNegative,a=e.inputSx,i=e.labelSx,s=Z(e,["errorMsg","stepValue","minValue","allowNegative","inputSx","labelSx"]);return lt(fk,X({},s,{variant:"outlined",type:"number",error:!!t,helperText:t||null,inputProps:{step:r,min:o?void 0:n},slotProps:{input:{sx:a},inputLabel:{sx:i}}}))},dLt=function(t){var r,n=t.isDisplayOnly,o=void 0!==n&&n,a=t.required,i=void 0!==a&&a,s=t.requiredErrorText,l=void 0===s?"This field is required":s,c=t.validationErrorText,u=void 0===c?"Invalid numeric value":c,d=t.text,p=t.placeholderText,h=t.backgroundColor,f=t.borderColor,m=t.textColor,v=void 0===m?"#000":m,y=t.fontSize,g=t.fontFamily,b=t.fontWeight,x=t.allowNegative,w=void 0!==x&&x,k=t.numericPrecision,_=void 0===k?"1":k,C=t.name,M=t.sourceDataModelField,S=t.marginLeft,D=void 0===S?"0":S,O=t.marginTop,P=void 0===O?"0":O,E=t.marginRight,j=void 0===E?"0":E,T=t.marginBottom,N=void 0===T?"0":T,R=t.paddingLeft,F=void 0===R?"0":R,z=t.paddingTop,I=void 0===z?"0":z,A=t.paddingRight,L=void 0===A?"0":A,B=t.paddingBottom,V=void 0===B?"0":B,H=t.width,q=t.height,$=t.configurationItemInfo;t._textAlign;var W=t.minHeight,U=t.maxHeight,G=t.minWidth,K=t.maxWidth,Y=jN(),Z=null==Y?void 0:Y.control,Q=!(!Z||!C),J=oqt().localStateObject,ee=lqt().stateConfig,te=bnt(),re=J||ee,ne=M?null===(r=null==re?void 0:re[M])||void 0===r?void 0:r.value:void 0,oe=M?null==te?void 0:te.getDmfValue(M):void 0,ae=e.useState(""),ie=ae[0],se=ae[1],le=parseFloat(_),ce=w?void 0:0,ue={required:!!i&&l,pattern:{value:w?/^-?\d*(\.\d+)?$/:/^\d*(\.\d+)?$/,message:u}};if(w||(ue.min={value:0,message:"Value cannot be less than zero"}),o){var de="",pe=(de=void 0!==oe?String(null!=oe?oe:""):Q?Y.watch(C)||"":ne)?function(e,t,r){if(!e)return"";var n=parseFloat(e);if(Number.isNaN(n))return e;if(!r&&n<0)return"0";if(t){var o=(t.split(".")[1]||"").length;if(o>0)return n.toFixed(o)}return e}(de,_,w):p||"-";return ct("div",X({style:X(X(X(X(X(X({display:"inline-flex",flexDirection:"column",marginLeft:D,marginTop:P,marginRight:j,marginBottom:N},H&&{width:H}),q&&{height:q}),G&&{minWidth:G}),K&&{maxWidth:K}),W&&{minHeight:W}),U&&{maxHeight:U})},$,{children:[d&&lt(Pm,X({sx:{fontSize:y,fontFamily:g,fontWeight:b,color:v,marginBottom:"4px"}},{children:d})),lt(Ic,X({sx:{fontSize:y,fontFamily:g,fontWeight:b,color:v,paddingLeft:F,paddingTop:I,paddingRight:L,paddingBottom:V,backgroundColor:h,border:"1px solid ".concat(f||"#ccc"),borderRadius:"4px",minWidth:"60px"}},{children:pe}))]}))}var he=X(X(X(X(X(X(X({backgroundColor:h,color:v,fontSize:y,fontFamily:g,fontWeight:b},H&&{width:H}),q&&{height:q}),G&&{minWidth:G}),K&&{maxWidth:K}),W&&{minHeight:W}),U&&{maxHeight:U}),{"& .MuiOutlinedInput-notchedOutline":{borderColor:f||"inherit"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:f||"inherit"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:f||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled .MuiOutlinedInput-notchedOutline":{borderColor:f||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled:hover .MuiOutlinedInput-notchedOutline":{borderColor:f||"inherit"}}),fe={color:v,"&.Mui-focused":{color:v}},me=X(X(X(X(X(X({},H&&{width:H}),q&&{height:q}),G&&{minWidth:G}),K&&{maxWidth:K}),W&&{minHeight:W}),U&&{maxHeight:U});return lt(hm,X({required:i,sx:X(X(X(X(X(X({marginLeft:D,marginTop:P,marginRight:j,marginBottom:N,width:"fit-content"},H&&{width:H}),q&&{height:q}),G&&{minWidth:G}),K&&{maxWidth:K}),W&&{minHeight:W}),U&&{maxHeight:U})},$,Q?{children:lt(AN,{name:C,rules:ue,control:Z,defaultValue:"",render:function(e){var t,r=e.field,n=e.fieldState;return lt(uLt,{errorMsg:null===(t=n.error)||void 0===t?void 0:t.message,label:d,placeholder:p,stepValue:le,minValue:ce,allowNegative:w,inputSx:he,labelSx:fe,sx:me,value:r.value||"",onChange:function(e){return r.onChange(e.target.value)}})}})}:{children:lt(uLt,{errorMsg:void 0,label:d,placeholder:p,stepValue:le,minValue:ce,allowNegative:w,inputSx:he,labelSx:fe,sx:me,value:ie,onChange:function(e){return se(e.target.value)}})}))},pLt=["+"," ","(",/[0-9]/,/[0-9]/,/[0-9]/,")"," ",/[0-9]/,/[0-9]/,/[0-9]/,"-",/[0-9]/,/[0-9]/,/[0-9]/,/[0-9]/],hLt=e.forwardRef(function(e,t){var r=e.inputRef,n=Z(e,["inputRef"]);return lt(V_,X({},n,{ref:function(e){"function"==typeof r&&r(e?e.inputElement:null)},mask:pLt,guide:!0,placeholderChar:" "}))});var fLt=function(e){var t=e.masked,r=e.errorMsg,n=e.inputSx,o=e.labelSx,a=Z(e,["masked","errorMsg","inputSx","labelSx"]);return lt(fk,X({},a,{variant:"outlined",error:!!r,helperText:r||null,slotProps:{input:X({sx:n},t?{inputComponent:hLt}:{}),inputLabel:{sx:o}}}))},mLt=function(t){var r,n=t.isDisplayOnly,o=void 0!==n&&n,a=t.required,i=void 0!==a&&a,s=t.requiredErrorText,l=void 0===s?"Phone is required":s,c=t.validationErrorText,u=void 0===c?"Invalid phone number":c,d=t.text,p=t.placeholderText,h=t.masked,f=void 0===h||h;t.multiLine;var m=t.backgroundColor,v=t.borderColor,y=t.textColor,g=void 0===y?"#000":y,b=t.fontSize,x=t.fontFamily,w=t.fontWeight;t.textAlign;var k=t.marginLeft,_=void 0===k?"0":k,C=t.marginTop,M=void 0===C?"0":C,S=t.marginRight,D=void 0===S?"0":S,O=t.marginBottom,P=void 0===O?"0":O,E=t.paddingLeft,j=void 0===E?"0":E,T=t.paddingTop,N=void 0===T?"0":T,R=t.paddingRight,F=void 0===R?"0":R,z=t.paddingBottom,I=void 0===z?"0":z,A=t.width,L=t.height,B=t.minHeight,V=t.maxHeight,H=t.minWidth,q=t.maxWidth,$=t.name,W=t.sourceDataModelField,U=t.configurationItemInfo,G=jN(),K=null==G?void 0:G.control,Y=!(!K||!$),Z=oqt().localStateObject,Q=lqt().stateConfig,J=bnt(),ee=Z||Q,te=W?null===(r=null==ee?void 0:ee[W])||void 0===r?void 0:r.value:void 0,re=W?null==J?void 0:J.getDmfValue(W):void 0,ne=e.useState(""),oe=ne[0],ae=ne[1],ie={required:!!i&&l,pattern:{value:/^\d{10}$/,message:u}};if(o){var se="";se=void 0!==re?String(null!=re?re:""):Y?G.watch($)||"":String(null!=te?te:"");var le=f?function(e){var t=(null!=e?e:"").replace(/\D+/g,"");if(!t)return"";var r="",n=0;return K_.forEach(function(e){"string"==typeof e?r+=e:n<t.length?(r+=t[n],n+=1):r+="_"}),r}(se):se,ce=le||p||"-";return ct("div",X({style:X(X(X(X(X(X({display:"inline-flex",flexDirection:"column",marginLeft:_,marginTop:M,marginRight:D,marginBottom:P},A&&{width:A}),L&&{height:L}),H&&{minWidth:H}),q&&{maxWidth:q}),B&&{minHeight:B}),V&&{maxHeight:V})},U,{children:[d&&lt(Pm,X({sx:{fontSize:b,fontFamily:x,fontWeight:w,color:g,marginLeft:0,marginBottom:"4px"}},{children:d})),lt(Ic,X({sx:{fontSize:b,fontFamily:x,fontWeight:w,color:g,paddingLeft:j,paddingTop:N,paddingRight:F,paddingBottom:I,backgroundColor:m,border:"1px solid ".concat(v||"#ccc"),borderRadius:"4px",minWidth:"120px"}},{children:ce}))]}))}var ue=X(X(X(X(X(X(X({backgroundColor:m,color:g,fontSize:b,fontFamily:x,fontWeight:w},A&&{width:A}),L&&{height:L}),H&&{minWidth:H}),q&&{maxWidth:q}),B&&{minHeight:B}),V&&{maxHeight:V}),{"& .MuiOutlinedInput-notchedOutline":{borderColor:v||"inherit"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:v||"inherit"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:v||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled .MuiOutlinedInput-notchedOutline":{borderColor:v||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled:hover .MuiOutlinedInput-notchedOutline":{borderColor:v||"inherit"}}),de={color:g,"&.Mui-focused":{color:g}},pe=X(X(X(X(X(X({marginLeft:_,marginTop:M,marginRight:D,marginBottom:P,width:"fit-content"},A&&{width:A}),L&&{height:L}),H&&{minWidth:H}),q&&{maxWidth:q}),B&&{minHeight:B}),V&&{maxHeight:V});return lt(hm,X({required:i,sx:X(X(X(X(X(X(X({},pe),A&&{width:A}),L&&{height:L}),H&&{minWidth:H}),q&&{maxWidth:q}),B&&{minHeight:B}),V&&{maxHeight:V})},U,Y?{children:lt(AN,{name:$,rules:ie,control:K,defaultValue:"",render:function(e){var t,r=e.field,n=e.fieldState;return lt(fLt,{masked:f,errorMsg:null===(t=n.error)||void 0===t?void 0:t.message,inputSx:ue,labelSx:de,label:d,placeholder:p,value:r.value||"",onChange:function(e){var t,n,o=(null!==(n=null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value)&&void 0!==n?n:"").toString().replace(/\D+/g,"");r.onChange(o)}})}})}:{children:lt(fLt,{masked:f,errorMsg:void 0,inputSx:ue,labelSx:de,label:d,placeholder:p,value:oe,onChange:function(e){var t,r,n=(null!==(r=null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value)&&void 0!==r?r:"").toString();ae(n.replace(/\D+/g,""))}})}))},vLt=function(t){var r=t.items,n=t.onTabChange,o=t.activeTabKey,a=t.isMobile,i=void 0!==a&&a,s=t.marginTop,l=t.marginRight,c=t.marginBottom,u=t.marginLeft,d=t.paddingTop,p=t.paddingRight,h=t.paddingBottom,f=t.paddingLeft,m=t.buttonPaddingTop,v=t.buttonPaddingRight,y=t.buttonPaddingBottom,g=t.buttonPaddingLeft,b=t.width,x=t.height,w=t.backgroundColor,k=t.borderRadius,_=t.elevation,C=void 0===_?1:_,M=t.gap,S=t.indicatorVisible,D=void 0===S||S,O=t.indicatorColor,P=t.lineWidth,E=void 0===P?"2px":P,j=t.orientation,T=void 0===j?"horizontal":j,N=t.activeTextColor,R=void 0===N?"#1976d2":N,F=t.inactiveTextColor,z=void 0===F?"#000":F,I=t.fontSize,A=t.fontWeight,L=t.fontFamily,B=t.wrapText,V=t.textAlign,H=t.iconName,q=t.iconColor,$=t.iconSize,W=t.iconPlacement,U=void 0===W?"left":W,G=t.hoverTextColor,K=t.itemBorder,Y=t.itemBorderRadius,Z=t.itemBackgroundColor,Q=t.itemSelectedBackgroundColor,J=t.itemHoverBackgroundColor,ee=t.selectedItemElevation,te=void 0===ee?0:ee,re=t.itemDisableRipple,ne=t.configurationItemInfo,oe=Qe(),ae=oqt(),ie=ae.isConfigurationMode,se=ae.onConfigurationItemClicked,le=ae.selectedConfigurationItemId,ce=e.useState(null),ue=ce[0],de=ce[1],pe=function(){return de(null)},he={marginTop:s,marginRight:l,marginBottom:c,marginLeft:u,paddingTop:d,paddingRight:p,paddingBottom:h,paddingLeft:f,width:b,height:x,backgroundColor:w,borderRadius:k,display:"flex",overflow:"visible !important"},fe=function(e){var t=e?R:z,r=e&&Q||Z;return{color:t,fontSize:I,fontWeight:A,fontFamily:L,textAlign:V,whiteSpace:B?"normal":"nowrap",border:K,borderRadius:Y,backgroundColor:r,boxShadow:e?oe.shadows[te]:void 0,paddingTop:m,paddingRight:v,paddingBottom:y,paddingLeft:g,"&:hover":{color:G||t,backgroundColor:J||r}}},me=function(e){null==n||n({newTabKey:e.tabKey,link:e.link})},ve=function(e){if(!ie)return{};var t=e.id===le,r={entityId:e.id,entity:"molecule_item",entityType:"tabs_item"};return{onClick:function(e){e.stopPropagation(),null==se||se(r,!1)},onDoubleClick:function(e){e.stopPropagation(),null==se||se(r,!0)},"data-organism-id":e.id,css:f$({theme:oe,selected:t})}};if(i)return ct(cl,X({elevation:C,style:he},ne,{children:[lt(yc,X({onClick:function(e){return de(e.currentTarget)}},{children:lt(mnt,{size:$,color:q,iconName:H})})),lt(ky,X({anchorEl:ue,open:Boolean(ue),onClose:pe},{children:r.map(function(e){var t=e.tabKey===o,r=fe(t);return ct(Dy,X({onClick:function(){me(e),pe()},sx:X(X({},r),{display:"flex",alignItems:"center"})},ve(e),{children:[e.iconName&&lt(mnt,{iconName:e.iconName,sx:{fontSize:I,color:t?R:z,mr:1}}),lt(nh,X({component:"span"},{children:e.label}))]}),e.id)})}))]}));var ye=r.findIndex(function(e){return e.tabKey===o});return lt(cl,X({elevation:C,style:he},ne,{children:lt(ck,X({value:ye<0?0:ye,onChange:function(e,t){return ie?null:me(r[t])},orientation:T,sx:{overflow:"visible","& .MuiTabs-flexContainer":{gap:M}},TabIndicatorProps:{style:D?{height:E,borderRadius:k,backgroundColor:O||R}:{display:"none"}}},{children:r.map(function(e){var t=e.tabKey===o,r=X(X({},fe(t)),{"&.Mui-selected":{color:t?R:z}});return lt(lw,X({label:e.label,disableRipple:re,sx:X(X({},r),{textTransform:"none"}),onClick:function(){return me(e)},iconPosition:"right"===U?"end":"start",icon:e.iconName?lt(mnt,{iconName:e.iconName,sx:{fontSize:I,color:t?R:z}}):void 0},ve(e)),e.id)})}))}))},yLt=function(t){var r,n,o,a,i=t.id,s=t.type,l=t.name,c=t.form,u=t.config;t.formData;var d=t.isMobile,p=t.children,h=t.tabsProps,f=t.properties,m=t.moleculeLibraryId,v=t.organismLibraryMoleculeId,y=Qe(),g=r_("xs"),b=d||g,x=oqt(),w=x.formId,k=x.isPreview,_=void 0!==k&&k,C=x.validations,M=x.submitHandler,S=x.isConfigurationMode,D=x.onConfigurationItemClicked,O=x.selectedConfigurationItemId,P=x.currentStyleProperties,E=x.currentContentProperties,j=x.onInternalNavigation;x.organismMetadata;var T=x.organismInfo,N=x.localState,R=lqt().stateConfig,F=k$().submitForm,z=pqt().forms,I=(null===(r=null==u?void 0:u.props)||void 0===r?void 0:r.dataCaptureName)||(null===(n=null==f?void 0:f.dataCapture)||void 0===n?void 0:n.dataCaptureName)||i,A=null===(o=null==f?void 0:f.dataCapture)||void 0===o?void 0:o.sourceDataModelFieldId,L=null===(a=null==f?void 0:f.dataCapture)||void 0===a?void 0:a.predefinedValue,B=O===i,V=nqt(),H=V.setActivePopUpById,q=V.setDrawerVisible,$=V.onCloseModal,W=V.onCloseDrawer,U=function(e){var t=e.stateListenerId,r=oqt().localStateObject,n=lqt().stateConfig,o=r||n,a=!0,i=!1;if(!t)return{isStateDisabled:i,isStateVisible:a};var s=(null==o?void 0:o[t])||{},l=s||{},c=l.visible,u=void 0===c||c,d=l.disabled,p=void 0!==d&&d;return t in o&&(a=Boolean(u),i=Boolean(p)),{isStateDisabled:i,isStateVisible:a,stateValue:s}}({stateListenerId:i}),G=U.isStateDisabled,K=U.isStateVisible,Y=e.useMemo(function(){return{entityType:s,entity:"molecule",entityName:l,entityId:i,organismLibraryMoleculeId:v,libraryEntityId:m}},[s,l,i,v,m]),ee=e.useCallback(function(e){null==e||e.stopPropagation(),D(Y,!1)},[D,Y]),te=e.useCallback(function(e){null==e||e.stopPropagation(),D(Y,!0)},[D,Y]),re=S?{onClick:ee,onDoubleClick:te,"data-configuration-id":i,css:f$({theme:y,selected:B})}:{},ne=S||G;if(!K)return null;return function(){var e,t,r,n,o,a,l,d,m;switch(s){case"simple_text":var v=v$(g={text:null==f?void 0:f.text},E,x=["text"],B).text,y=y$(null==u?void 0:u.props,P,B);return lt(fot,X({},y,{text:(null==v?void 0:v.text)||"",htmlElementId:i,configurationsItemInfo:re}));case"text":var g={text:null==f?void 0:f.text},x=Object.keys(g);v=v$(g,E,x,B).text,y=y$(null==u?void 0:u.props,P,B);return lt(hot,X({},v,y,{htmlElementId:i,configurationItemInfo:re}));case"consent":var k=v$(f,E,[],B);y=y$(null==u?void 0:u.props,P,B)||{};return lt(Nnt,X({},y,{htmlElementId:i,properties:k,configurationItemInfo:re}));case"signup_password_fields":g={text:null==f?void 0:f.text,subText:null==f?void 0:f.subText,placeholderText:null==f?void 0:f.placeholderText,subPlaceholderText:null==f?void 0:f.subPlaceholderText,validationText:null==f?void 0:f.validationText},x=Object.keys(g);var D=v$(g,E,x,B),V=y$(null==u?void 0:u.props,P,B),U=V.state,K=V.gap,Y=Z(V,["state","gap"]);return lt(Dot,{gap:K,inputProps:Y,validations:C||[],htmlElementId:i,validationState:U,overridesProperties:D,configurationItemInfo:re});case"stepper":var ee=y$(null==u?void 0:u.props,P,B),te=null==p?void 0:p.map(function(e){var t=O===e.id,r=e||{},n=r.properties,o=r.config,a=Z(r,["properties","config"]),i={title:null==n?void 0:n.title,subText:null==n?void 0:n.subText},s=Object.keys(i),l=v$(i,E,s,t),c=l.title,u=l.subText,d=y$(null==o?void 0:o.props,P,t);return X(X(X({},a),d),{title:(null==c?void 0:c.text)||"",subText:(null==u?void 0:u.text)||""})});return lt(tat,X({},ee,{items:te||[],isMobile:b,moleculeId:i,configurationItemInfo:re}));case"checklist":var oe=y$(null==u?void 0:u.props,P,B)||{},ae=null==p?void 0:p.map(function(e){var t,r,n,o,a,i=O===e.id,s=e||{},l=s.properties,c=s.config,u=Z(s,["properties","config"]);switch(e.type){case"checklist_item":var d={label:null==l?void 0:l.label,objectState:null==l?void 0:l.objectState},p=Object.keys(d),h=v$(d,E,p,i),f=y$(null==c?void 0:c.props,P,i)||{},m=(null===(t=h.label)||void 0===t?void 0:t.text)||"",v=!!(null===(r=h.objectState)||void 0===r?void 0:r.pmiObjectId);return X(X(X({},u),f),{type:"checklist_item",label:m,textColor:f.textColor||"#000",fontSize:f.fontSize||"14px",fontFamily:f.fontFamily||"inherit",fontWeight:f.fontWeight||"normal",textAlign:f.textAlign||"left",isSystemDriven:v,disabled:v,interacted:(null===(n=null==R?void 0:R[e.id])||void 0===n?void 0:n.interacted)||"unchecked"});case"divider_item":f=y$(null==c?void 0:c.props,P,i)||{};return X(X(X({},u),f),{type:"divider_item"});case"text_item":d={text:null==l?void 0:l.text},p=Object.keys(d),h=v$(d,E,p,i),f=y$(null==c?void 0:c.props,P,i)||{};var y=(null===(o=h.text)||void 0===o?void 0:o.text)||"";return X(X(X({},u),f),{type:"text_item",text:y});case"rich_text_item":d={text:null==l?void 0:l.text},p=Object.keys(d),h=v$(d,E,p,i),f=y$(null==c?void 0:c.props,P,i)||{},y=(null===(a=h.text)||void 0===a?void 0:a.text)||Bqt;return X(X(X({},u),f),{type:"rich_text_item",text:y});default:return X(X({},u),{type:e.type})}});return lt(jnt,X({},oe,{items:ae||[],moleculeId:i,configurationItemInfo:re}));case"accordion":var ie=y$(null==u?void 0:u.props,P,B);ae=null==p?void 0:p.map(function(e){var t=O===e.id,r=e||{},n=r.properties,o=r.config,a=Z(r,["properties","config"]),i={text:null==n?void 0:n.text,subText:null==n?void 0:n.subText,bodyText:null==n?void 0:n.bodyText},s=Object.keys(i),l=v$(i,E,s,t),c=l.text,u=l.subText,d=l.bodyText,p=y$(null==o?void 0:o.props,P,t);return X(X(X({},a),p),{text:(null==c?void 0:c.text)||"",subText:(null==u?void 0:u.text)||"",bodyText:(null==d?void 0:d.text)||""})});return lt(gat,X({},ie,{items:ae||[],moleculeId:i,configurationItemInfo:re}));case"menu":g={text:null==f?void 0:f.text,disabled:null==f?void 0:f.disabled},x=Object.keys(g);var se=v$(g,E,x,B),le=se.text,ce=se.disabled,ue=y$(null==u?void 0:u.props,P,B);ae=null==p?void 0:p.map(function(e){var t,r=O===e.id,n=e||{},o=n.properties,a=n.config,i=Z(n,["properties","config"]),s={disabled:o&&"disabled"in o?o.disabled:void 0,text:o&&"text"in o?o.text:void 0,link:o&&"link"in o?o.link:void 0},l=Object.keys(s),c=v$(s,E,l,r),u=c.text,d=c.disabled,p=c.link,h=y$(null==a?void 0:a.props,P,r);return X(X(X({},i),h),{disabled:(null==R?void 0:R[e.id])?null===(t=null==R?void 0:R[e.id])||void 0===t?void 0:t.disabled:(null==d?void 0:d.value)||(null==h?void 0:h.disabled)||!1,text:(null==u?void 0:u.text)||"Menu Item",link:p})});return lt(cLt,X({},ue,{items:ae||[],moleculeId:i,buttonText:(null==le?void 0:le.text)||"Open Menu",configurationItemInfo:re,buttonDisabled:(null==R?void 0:R[i])?null===(e=null==R?void 0:R[i])||void 0===e?void 0:e.disabled:(null==ce?void 0:ce.value)||(null==ue?void 0:ue.disabled)||!1}));case"tabs":y=y$(null==u?void 0:u.props,P,B);var de=null==p?void 0:p.map(function(e){var t=O===e.id,r=e||{},n=r.properties,o=r.config,a={label:null==n?void 0:n.label,link:null==n?void 0:n.link},i=Object.keys(a),s=v$(a,E,i,t),l=s.label,c=s.link,u=y$(null==o?void 0:o.props,P,t);return X(X({},u),{id:e.id,tabKey:P$(c)?D$(a$,null==c?void 0:c.internalLink):void 0,label:(null==l?void 0:l.text)||"",link:c})}),pe=null==h?void 0:h.tabs.map(function(e){var t=e.text,r=Z(e,["text"]);return X(X({},r),{label:t||""})}),he=Boolean(null==y?void 0:y.isTabsSystemDerived),fe=he?pe:de,me=(null==h?void 0:h.activeTabKey)||(null===(t=null==fe?void 0:fe[0])||void 0===t?void 0:t.tabKey)||"";return lt(vLt,X({},y,{items:fe||[],isMobile:b,moleculeId:i,activeTabKey:me,configurationItemInfo:re,onTabChange:S?void 0:function(e){var t,r=e.newTabKey,n=e.link;he?null===(t=null==h?void 0:h.onTabChange)||void 0===t||t.call(h,r):P$(n)?null==j||j({link:(null==n?void 0:n.internalLink)||""}):O$(null==n?void 0:n.externalLink)}}));case"divider":y=y$(null==u?void 0:u.props,P,B);return lt(uot,X({moleculeId:i,configurationItemInfo:re},y));case"link":g={text:null==f?void 0:f.text,link:null==f?void 0:f.link},x=Object.keys(g);var ve=v$(g,E,x,B),ye=(v=ve.text,ve.link);y=y$(null==u?void 0:u.props,P,B);return lt(_ot,X({moleculeId:i},y,{type:null==ye?void 0:ye.type,src:ne?void 0:j$(ye,_)||"",text:(null==v?void 0:v.text)||"",disabled:(null==y?void 0:y.disabled)||G,configurationItemInfo:re}));case"video":g={video:null==f?void 0:f.video,coverImage:null==f?void 0:f.coverImage},x=Object.keys(g);var ge=v$(g,E,x,B),be=ge.video,xe=ge.coverImage;y=y$(null==u?void 0:u.props,P,B);return lt(iat,X({},y,{moleculeId:i,poster:null===(r=null==xe?void 0:xe.imageFile)||void 0===r?void 0:r.url,src:null!==(a=null!==(n=null==be?void 0:be.videoSource)&&void 0!==n?n:null===(o=null==be?void 0:be.videoFile)||void 0===o?void 0:o.url)&&void 0!==a?a:"",configurationItemInfo:re}));case"badge":y=y$(null==u?void 0:u.props,P,B);return lt(ynt,X({},y,{configurationItemInfo:re}));case"alert":g={text:null==f?void 0:f.text,subText:null==f?void 0:f.subText},x=Object.keys(g);var we=v$(g,E,x,B),ke=(v=we.text,we.subText);y=y$(null==u?void 0:u.props,P,B);return lt(vnt,X({text:(null==v?void 0:v.text)||"",subText:(null==ke?void 0:ke.text)||""},y,{configurationItemInfo:re}));case"chip":g={text:null==f?void 0:f.text},x=Object.keys(g),v=v$(g,E,x,B).text,y=y$(null==u?void 0:u.props,P,B);return lt(Tnt,X({text:(null==v?void 0:v.text)||""},y,{configurationItemInfo:re}));case"email_display_field":case"email_input_field":g={text:null==f?void 0:f.text,placeholderText:null==f?void 0:f.placeholderText,required:null==f?void 0:f.required,requiredErrorText:null==f?void 0:f.requiredErrorText,validationErrorText:null==f?void 0:f.validationErrorText},x=Object.keys(g);var _e=v$(g,E,x,B),Ce=(v=_e.text,_e.placeholderText),Me=_e.required,Se=_e.requiredErrorText,De=_e.validationErrorText;y=y$(null==u?void 0:u.props,P,B);return lt(sLt,X({name:I,text:(null==v?void 0:v.text)||"",placeholderText:(null==Ce?void 0:Ce.text)||"",sourceDataModelField:A,required:null==Me?void 0:Me.value,isDisplayOnly:"email_display_field"===s,requiredErrorText:null==Se?void 0:Se.text,validationErrorText:null==De?void 0:De.text},y,{configurationItemInfo:re}));case"phone_number_display_field":case"phone_number_input_field":g={text:null==f?void 0:f.text,placeholderText:null==f?void 0:f.placeholderText,required:null==f?void 0:f.required,requiredErrorText:null==f?void 0:f.requiredErrorText,validationErrorText:null==f?void 0:f.validationErrorText},x=Object.keys(g);var Oe=v$(g,E,x,B);v=Oe.text,Ce=Oe.placeholderText,Me=Oe.required,Se=Oe.requiredErrorText,De=Oe.validationErrorText,y=y$(null==u?void 0:u.props,P,B);return lt(mLt,X({name:I,text:(null==v?void 0:v.text)||"",required:null==Me?void 0:Me.value,requiredErrorText:null==Se?void 0:Se.text,validationErrorText:null==De?void 0:De.text,placeholderText:(null==Ce?void 0:Ce.text)||"",sourceDataModelField:A,isDisplayOnly:"phone_number_display_field"===s},y,{configurationItemInfo:re}));case"numeric_display_field":case"numeric_input_field":g={text:null==f?void 0:f.text,placeholderText:null==f?void 0:f.placeholderText,required:null==f?void 0:f.required,requiredErrorText:null==f?void 0:f.requiredErrorText,validationErrorText:null==f?void 0:f.validationErrorText},x=Object.keys(g);var Pe=v$(g,E,x,B);v=Pe.text,Ce=Pe.placeholderText,Me=Pe.required,Se=Pe.requiredErrorText,De=Pe.validationErrorText,y=y$(null==u?void 0:u.props,P,B);return lt(dLt,X({name:I,text:(null==v?void 0:v.text)||"",required:null==Me?void 0:Me.value,isDisplayOnly:"numeric_display_field"===s,requiredErrorText:null==Se?void 0:Se.text,validationErrorText:null==De?void 0:De.text,placeholderText:(null==Ce?void 0:Ce.text)||"",sourceDataModelField:A},y,{configurationItemInfo:re}));case"currency_display_field":case"currency_input_field":g={text:null==f?void 0:f.text,placeholderText:null==f?void 0:f.placeholderText,required:null==f?void 0:f.required,requiredErrorText:null==f?void 0:f.requiredErrorText,validationErrorText:null==f?void 0:f.validationErrorText},x=Object.keys(g);var Ee=v$(g,E,x,B);v=Ee.text,Ce=Ee.placeholderText,Me=Ee.required,Se=Ee.requiredErrorText,De=Ee.validationErrorText,y=y$(null==u?void 0:u.props,P,B);return lt(oLt,X({name:I,text:(null==v?void 0:v.text)||"",required:null==Me?void 0:Me.value,isDisplayOnly:"currency_display_field"===s,requiredErrorText:null==Se?void 0:Se.text,validationErrorText:null==De?void 0:De.text,placeholderText:(null==Ce?void 0:Ce.text)||"",sourceDataModelField:A},y,{configurationItemInfo:re}));case"basic_text_display_field":case"basic_text_field":g={text:null==f?void 0:f.text,placeholderText:null==f?void 0:f.placeholderText,required:null==f?void 0:f.required,requiredErrorText:null==f?void 0:f.requiredErrorText,validationErrorText:null==f?void 0:f.validationErrorText},x=Object.keys(g);var je=v$(g,E,x,B);v=je.text,Ce=je.placeholderText,Me=je.required,Se=je.requiredErrorText,De=je.validationErrorText,y=y$(null==u?void 0:u.props,P,B);return lt(knt,X({name:I,text:(null==v?void 0:v.text)||"",required:null==Me?void 0:Me.value,isDisplayOnly:"basic_text_display_field"===s,requiredErrorText:null==Se?void 0:Se.text,validationErrorText:null==De?void 0:De.text,placeholderText:(null==Ce?void 0:Ce.text)||"",sourceDataModelField:A},y,{configurationItemInfo:re}));case"rating_display_field":case"rating":g={text:null==f?void 0:f.text,dataCapture:null==f?void 0:f.dataCapture,required:null==f?void 0:f.required,requiredErrorText:null==f?void 0:f.requiredErrorText,validationErrorText:null==f?void 0:f.validationErrorText},x=Object.keys(g);var Te=v$(g,E,x,B);v=Te.text,Me=Te.required,Se=Te.requiredErrorText,De=Te.validationErrorText,y=y$(null==u?void 0:u.props,P,B);return lt(Wot,X({name:I,text:(null==v?void 0:v.text)||"",required:null==Me?void 0:Me.value,requiredErrorText:null==Se?void 0:Se.text,validationErrorText:null==De?void 0:De.text,sourceDataModelField:A,isDisplayOnly:"rating_display_field"===s},y,{configurationItemInfo:re}));case"switch_display_field":case"switch":g={text:null==f?void 0:f.text,required:null==f?void 0:f.required,requiredErrorText:null==f?void 0:f.requiredErrorText,validationErrorText:null==f?void 0:f.validationErrorText},x=Object.keys(g);var Ne=v$(g,E,x,B);v=Ne.text,Me=Ne.required,Se=Ne.requiredErrorText,De=Ne.validationErrorText,y=y$(null==u?void 0:u.props,P,B);return lt(nat,X({name:I,moleculeId:i,text:(null==v?void 0:v.text)||"",required:null==Me?void 0:Me.value,isDisplayOnly:"switch_display_field"===s,requiredErrorText:null==Se?void 0:Se.text,validationErrorText:null==De?void 0:De.text,sourceDataModelField:A},y,{configurationItemInfo:re}));case"slider_display_field":case"slider":g={text:null==f?void 0:f.text,required:null==f?void 0:f.required,placeholderText:null==f?void 0:f.placeholderText,requiredErrorText:null==f?void 0:f.requiredErrorText,validationErrorText:null==f?void 0:f.validationErrorText},x=Object.keys(g);var Re=v$(g,E,x,B);v=Re.text,Me=Re.required,Se=Re.requiredErrorText,De=Re.validationErrorText,Ce=Re.placeholderText,y=y$(null==u?void 0:u.props,P,B);return lt(eat,X({name:I,text:(null==v?void 0:v.text)||"",required:null==Me?void 0:Me.value,isDisplayOnly:"slider_display_field"===s,requiredErrorText:null==Se?void 0:Se.text,validationErrorText:null==De?void 0:De.text,placeholderText:null==Ce?void 0:Ce.text,sourceDataModelField:A},y,{configurationItemInfo:re}));case"date_display_field":case"date_picker":g={text:null==f?void 0:f.text,required:null==f?void 0:f.required,placeholderText:null==f?void 0:f.placeholderText,requiredErrorText:null==f?void 0:f.requiredErrorText,validationErrorText:null==f?void 0:f.validationErrorText},x=Object.keys(g);var Fe=v$(g,E,x,B);v=Fe.text,Me=Fe.required,Ce=Fe.placeholderText,Se=Fe.requiredErrorText,De=Fe.validationErrorText,y=y$(null==u?void 0:u.props,P,B);return lt(OR,X({dateAdapter:Zq},{children:lt(cot,X({moleculeId:i,name:I,text:(null==v?void 0:v.text)||"",required:null==Me?void 0:Me.value,placeholderText:(null==Ce?void 0:Ce.text)||"",isDisplayOnly:"date_display_field"===s,requiredErrorText:null==Se?void 0:Se.text,validationErrorText:null==De?void 0:De.text,sourceDataModelField:A},y,{configurationItemInfo:re}))}));case"time_picker_display":case"time_picker":g={text:null==f?void 0:f.text,placeholderText:null==f?void 0:f.placeholderText,requiredErrorText:null==f?void 0:f.requiredErrorText,validationErrorText:null==f?void 0:f.validationErrorText,required:null==f?void 0:f.required},x=Object.keys(g);var ze=v$(g,E,x,B),Ie=(v=ze.text,Ce=ze.placeholderText,Se=ze.requiredErrorText,De=ze.validationErrorText,Me=ze.required,y$(null==u?void 0:u.props,P,B));return lt(OR,X({dateAdapter:Zq},{children:lt(aat,X({},Ie,{name:I,text:(null==v?void 0:v.text)||"",placeholderText:(null==Ce?void 0:Ce.text)||"",required:null==Me?void 0:Me.value,requiredErrorText:null==Se?void 0:Se.text,validationErrorText:null==De?void 0:De.text,isDisplayOnly:"time_picker_display"===s,sourceDataModelField:A,configurationItemInfo:re}))}));case"select_display_field":case"select":g={text:null==f?void 0:f.text,required:null==f?void 0:f.required,placeholderText:null==f?void 0:f.placeholderText,requiredErrorText:null==f?void 0:f.requiredErrorText,validationErrorText:null==f?void 0:f.validationErrorText},x=Object.keys(g);var Ae=v$(g,E,x,B),Le=(v=Ae.text,Me=Ae.required,Ce=Ae.placeholderText,Se=Ae.requiredErrorText,De=Ae.validationErrorText,y=y$(null==u?void 0:u.props,P,B),"select_display_field"===s);return lt(Uot,X({name:I,text:(null==v?void 0:v.text)||"",required:null==Me?void 0:Me.value,isDisplayOnly:Le,predefinedValue:L,placeholderText:(null==Ce?void 0:Ce.text)||"",requiredErrorText:null==Se?void 0:Se.text,validationErrorText:null==De?void 0:De.text,sourceDataModelField:A},y,{configurationItemInfo:re}));case"image":g={image:null==f?void 0:f.image,link:null==f?void 0:f.link},x=Object.keys(g);var Be=v$(g,E,x,B),Ve=Be.image,He=Be.link,qe=(y=y$(null==u?void 0:u.props,P,B),(null==Ve?void 0:Ve.imageSource)||(null===(l=null==Ve?void 0:Ve.imageFile)||void 0===l?void 0:l.url)||(null===(d=null==Ve?void 0:Ve.imageFile)||void 0===d?void 0:d.id)||"");return lt(dot,X({},y,{src:qe,onClick:function(){return P$(He)?null==j?void 0:j({link:(null==He?void 0:He.internalLink)||""}):O$(null==He?void 0:He.externalLink)},moleculeId:i,configurationItemInfo:re,properties:{image:Ve,link:He}}));case"button":g={text:null==f?void 0:f.text,action:null==f?void 0:f.action},x=Object.keys(g);var $e=v$(g,E,x,B),We=(v=$e.text,$e.action),Ue=(y=y$(null==u?void 0:u.props,P,B),(We&&We.action?We.action:We)||(f&&f.action&&f.action.action?f.action.action:null==f?void 0:f.action)),Ge=(null==Ue?void 0:Ue.type)||"link",Ke="navigate_to_create_form"!==Ge&&"navigate_to_edit_form"!==Ge&&"navigate_to_prepopulate_form"!==Ge&&"navigate_to_organism_with_rwo_context"!==Ge&&"navigate_to_page_with_rwo_context"!==Ge||!(null==Ue?void 0:Ue[Ge])?void 0:Ue[Ge],Ye=(null==Ke?void 0:Ke.link)||(null==Ue?void 0:Ue.link),Xe=null==Ue?void 0:Ue.popup,Ze=null==Ue?void 0:Ue.download,Qe=null==Ue?void 0:Ue.submit,Je=(null==Ke?void 0:Ke.targetFormId)||(null==Ue?void 0:Ue.targetFormId),et=(null==Ke?void 0:Ke.fieldMap)||(null==Ue?void 0:Ue.fieldMap),tt={link:function(){if(P$(Ye)){var e={};return(null==Ye?void 0:Ye.targetFormId)&&(e.organismId=String(null==Ye?void 0:Ye.targetFormId)),(null==Ye?void 0:Ye.rwoKey)&&(e.rwo=String(null==Ye?void 0:Ye.rwoKey)),void j({link:(null==Ye?void 0:Ye.internalLink)||"",query:e})}O$(null==Ye?void 0:Ye.externalLink)},popup:function(){(null==Xe?void 0:Xe.id)&&H(null==Xe?void 0:Xe.id)},drawer:function(){q(!0)},download:function(){return Ze?function(e,t){return void 0===e&&(e=""),void 0===t&&(t="Downloaded file"),Q(void 0,void 0,void 0,function(){var r,n,o,a;return J(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,fetch(e)];case 1:return[4,i.sent().blob()];case 2:return r=i.sent(),n=URL.createObjectURL(r),(o=document.createElement("a")).href=n,o.download=t,o.click(),URL.revokeObjectURL(n),[3,4];case 3:return a=i.sent(),wUt({message:"Failed to download the file: ".concat(a),type:"error"}),[3,4];case 4:return[2]}})})}(Ze.url,Ze.name):wUt({message:"File not found to download",type:"warning"})},submit:null==c?void 0:c.handleSubmit(function(e){return Q(void 0,void 0,void 0,function(){var t,r,n,o,a;return J(this,function(i){switch(i.label){case 0:return i.trys.push([0,6,,7]),w?M?[4,M({formId:w,data:e})]:[3,2]:[3,5];case 1:return i.sent(),[3,4];case 2:return(null==z?void 0:z.submit)?[4,F({formId:w,data:e})]:[3,4];case 3:i.sent(),i.label=4;case 4:(t=null===(o=null==Qe?void 0:Qe.onSuccess)||void 0===o?void 0:o.link)&&(P$(t)?(n={},(null==t?void 0:t.rwoKey)&&(n.rwo=String(null==t?void 0:t.rwoKey)),null==j||j({link:t.internalLink||"",query:n})):O$(t.externalLink)),c.reset(),i.label=5;case 5:return[3,7];case 6:return i.sent(),(r=null===(a=null==Qe?void 0:Qe.onError)||void 0===a?void 0:a.link)&&(P$(r)?(n={},(null==r?void 0:r.rwoKey)&&(n.rwo=String(null==r?void 0:r.rwoKey)),null==j||j({link:r.internalLink||"",query:n})):O$(r.externalLink)),[3,7];case 7:return[2]}})})}),reset:function(){return null==c?void 0:c.reset()},destroy:function(){null==c||c.reset(),null==$||$(),null==W||W()},navigate_to_create_form:function(){var e=(null==Ye?void 0:Ye.internalLink)||"";if(Je||e){var t=e||"?organismId=".concat(encodeURIComponent(String(Je)));null==j||j({link:t})}},navigate_to_edit_form:function(){var e=(null==Ye?void 0:Ye.internalLink)||"";if(Je||e){var t=(null==T?void 0:T.id)||"",r=(null==e?void 0:e.includes("?"))?"&":"?",n=e?"".concat(e).concat(r,"rwoRecordId=").concat(encodeURIComponent(String(t))):"?organismId=".concat(encodeURIComponent(String(Je)),"&rwoRecordId=").concat(encodeURIComponent(String(t))),o={};(null==Ye?void 0:Ye.rwoKey)&&(o.rwo=String(null==Ye?void 0:Ye.rwoKey)),null==j||j({link:n,query:o})}},navigate_to_prepopulate_form:function(){try{var e=(null==Ye?void 0:Ye.internalLink)||"";if(!Je&&!e)return;var t=Array.isArray(et)?et:[],r=Boolean((null==c?void 0:c.getValues)&&"function"==typeof c.getValues)?null==c?void 0:c.getValues():{},n={};R&&"object"==typeof R&&Object.entries(R).forEach(function(e){var t,r=e[0],o=e[1],a=null!==(t=null==o?void 0:o.value)&&void 0!==t?t:o;n[r]=a});var o=Object.keys(n).length>0?n:r,a={};t.filter(function(e){return(null==e?void 0:e.source)&&(null==e?void 0:e.destination)}).forEach(function(e){var t=function(e,t){if(e&&t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];for(var r=t.split("."),n=e,o=0;o<r.length;o+=1){if(null==n||"object"!=typeof n)return;n=n[r[o]]}return n}}(o,String(e.source));void 0!==t&&(a[String(e.destination)]=t)});var i=e||(Je?"?organismId=".concat(encodeURIComponent(String(Je))):""),s={};Je&&(s.organismId=String(Je)),null==j||j({link:i||e,state:{prefill:a,targetFormId:Je},query:s})}catch(e){}},navigate_to_organism_with_rwo_context:function(){var e,t,r=null==Ke?void 0:Ke.sourceDataModelFieldId,n=(null==Ke?void 0:Ke.targetOrganismIds)||[];if(!r||0===n.length)return console.error("❌ Action not properly configured:",{sourceDataModelFieldId:r,targetOrganismIds:n.length}),void wUt({message:"Navigate to Organism action is not properly configured",type:"error"});if(N&&N[r]){var o=N[r];t=String("object"==typeof o&&o&&"id"in o?o.id:o)}if(!t&&R&&"object"==typeof R)try{if(Object.prototype.hasOwnProperty.call(R,r)){var a=R[r];t=String("object"==typeof a&&a&&"id"in a?a.id:a||"")}else{var i=_$(R,r);t=String("object"==typeof i&&i&&"id"in i?i.id:i||"")}}catch(e){console.warn("Error accessing stateObject:",e)}if(console.log({rwoRecordId:t,formValues:null==c?void 0:c.getValues()}),!t&&c&&"function"==typeof c.getValues)try{var s=c.getValues();if(s&&"object"==typeof s)if(Object.prototype.hasOwnProperty.call(s,r)){a=s[r];t=String("object"==typeof a&&a&&"id"in a?a.id:a||"")}else{i=_$(s,r);t=String("object"==typeof i&&i&&"id"in i?i.id:i||"")}}catch(e){console.warn("Error accessing form values:",e)}!t&&r&&(t=String(r));var l={};if(t&&Array.isArray(n)&&n.length>0){var u={};n.forEach(function(e){u[e]||(u[e]={}),u[e].rwoRecordId=String(t),r&&(u[e][String(r)]=String(t))}),l.rwoContext=C$(u)}var d=new URL((null===(e=null===window||void 0===window?void 0:window.location)||void 0===e?void 0:e.href)||"/"),p=d.pathname;"function"==typeof j&&j({link:p,query:l,currentLocation:{pathname:d.pathname,search:d.search}})},navigate_to_page_with_rwo_context:function(){var e,t=null==Ke?void 0:Ke.internalLink,r=!1!==(null==Ke?void 0:Ke.includeRwoRecordId),n=Array.isArray(null==Ke?void 0:Ke.rwoContextMapping)?Ke.rwoContextMapping:[];if(!(null==t?void 0:t.internalLink))return console.error("❌ navigate_to_page_with_rwo_context: Missing internalLink"),void wUt({message:"Navigate to page action is not properly configured",type:"error"});var o=function(e){if(e&&"object"==typeof e){for(var t=0,r=["id","recordId","rwoRecordId","uuid"];t<r.length;t++){var n=r[t];if(e[n]){var o=e[n];return String("object"==typeof o&&o&&"id"in o?o.id:o)}}for(var a=0,i=Object.entries(e);a<i.length;a++){var s=i[a];if(s[0],"string"==typeof(o=s[1])&&o.length>0)return o;if("object"==typeof o&&o&&"id"in o)return String(o.id)}}};if(r&&(e=o(N)),!e&&r&&R&&(e=o(R)),!e&&r&&c&&"function"==typeof c.getValues)try{e=o(c.getValues())}catch(e){console.warn("Error accessing form values:",e)}var a=X(X(X({},N||{}),R||{}),c&&"function"==typeof c.getValues?c.getValues():{}),i=composeRwoParamsV2({includeRwoRecordId:r,recordId:e,mapping:n,contextSource:a}).query;"function"==typeof j&&j({link:t.internalLink,query:i})}};return lt(_nt,X({moleculeId:i,text:(null==v?void 0:v.text)||""},y,{disabled:(null==y?void 0:y.disabled)||G,onClick:null==tt?void 0:tt[Ge],configurationItemInfo:re,properties:{text:v,action:We}}));case"avatar":y=y$(null==u?void 0:u.props,P,B);return lt(bat,X({},y,{sourceDataModelField:A,configurationItemInfo:re}));case"calendar":y=y$(null==u?void 0:u.props,P,B);return lt(tLt,X({},y,{configurationItemInfo:re}));case"drawer":g={text:null==f?void 0:f.text,disabled:null==f?void 0:f.disabled},x=Object.keys(g);var rt=v$(g,E,x,B),nt=rt.text,ot=rt.disabled,at=y$(null==u?void 0:u.props,P,B);ae=null==p?void 0:p.map(function(e){var t,r,n,o,a,i,s,l,c,u=O===e.id,d=e||{},p=d.properties,h=d.config,f=Z(d,["properties","config"]),m={},v=[];switch(e.type){case"menu_item":var y=p;m={disabled:null==y?void 0:y.disabled,text:null==y?void 0:y.text,link:null==y?void 0:y.link},v=Object.keys(m);break;case"text_item":var g=p;m={text:null==g?void 0:g.text},v=Object.keys(m);break;case"rich_text_item":var b=p;m={text:null==b?void 0:b.text},v=Object.keys(m);break;case"image_item":var x=p;m={image:null==x?void 0:x.image,alt:null==x?void 0:x.alt,link:null==x?void 0:x.link},v=Object.keys(m);break;default:m={},v=[]}var w=v$(m,E,v,u),k=y$(null==h?void 0:h.props,P,u),_=X(X({},f),k);switch(e.type){case"menu_item":return X(X({},_),{disabled:(null==R?void 0:R[e.id])?null===(t=null==R?void 0:R[e.id])||void 0===t?void 0:t.disabled:(null===(r=null==w?void 0:w.disabled)||void 0===r?void 0:r.value)||(null==k?void 0:k.disabled)||!1,text:(null===(n=null==w?void 0:w.text)||void 0===n?void 0:n.text)||"Menu Item",link:null==w?void 0:w.link});case"text_item":return X(X({},_),{text:(null===(o=null==w?void 0:w.text)||void 0===o?void 0:o.text)||""});case"rich_text_item":return X(X({},_),{text:(null===(a=null==w?void 0:w.text)||void 0===a?void 0:a.text)||Bqt});case"image_item":var C=(null===(i=null==w?void 0:w.image)||void 0===i?void 0:i.imageSource)||(null===(l=null===(s=null==w?void 0:w.image)||void 0===s?void 0:s.imageFile)||void 0===l?void 0:l.url)||"";return X(X({},_),{src:C,alt:(null===(c=null==w?void 0:w.alt)||void 0===c?void 0:c.text)||"Drawer image",link:null==w?void 0:w.link});default:return _}});return lt(kot,X({},at,{items:ae||[],moleculeId:i,buttonText:(null==nt?void 0:nt.text)||(null==at?void 0:at.buttonText),buttonDisabled:(null==R?void 0:R[i])?null===(m=null==R?void 0:R[i])||void 0===m?void 0:m.disabled:(null==ot?void 0:ot.value)||(null==at?void 0:at.disabled)||!1,configurationItemInfo:re}));case"speed_dial":var it=y$(null==u?void 0:u.props,P,B);ae=null==p?void 0:p.map(function(e){var t=O===e.id,r=e||{},n=r.properties,o=r.config,a=Z(r,["properties","config"]),i={link:null==n?void 0:n.link,text:null==n?void 0:n.text},s=Object.keys(i),l=v$(i,E,s,t),c=y$(null==o?void 0:o.props,P,t);return X(X({},a),{config:{props:X(X(X({},null==o?void 0:o.props),c),{tooltipText:(null==c?void 0:c.tooltipText)||""})},properties:{link:(null==l?void 0:l.link)||(null==n?void 0:n.link),text:(null==l?void 0:l.text)||(null==n?void 0:n.text)}})});return lt(yat,X({},it,{items:ae||[],moleculeId:i,configurationItemInfo:re}));case"checkbox":case"checkbox_display":g={label:null==f?void 0:f.label,required:null==f?void 0:f.required,requiredErrorText:null==f?void 0:f.requiredErrorText,validationErrorText:null==f?void 0:f.validationErrorText},x=Object.keys(g);var ct=v$(g,E,x,B),ut=ct.label;Me=ct.required,Se=ct.requiredErrorText,De=ct.validationErrorText,y=y$(null==u?void 0:u.props,P,B);return lt(hat,X({name:I,moleculeId:i,label:(null==ut?void 0:ut.text)||"",required:null==Me?void 0:Me.value,requiredErrorText:null==Se?void 0:Se.text,validationErrorText:null==De?void 0:De.text,sourceDataModelField:A,isDisplayOnly:"checkbox_display"===s},y,{configurationItemInfo:re}));case"binary_radio_buttons":case"binary_radio_buttons_display":g={confirmText:null==f?void 0:f.confirmText,rejectText:null==f?void 0:f.rejectText,required:null==f?void 0:f.required,requiredErrorText:null==f?void 0:f.requiredErrorText,validationErrorText:null==f?void 0:f.validationErrorText},x=Object.keys(g);var dt=v$(g,E,x,B),pt=dt.confirmText,ht=dt.rejectText;Me=dt.required,Se=dt.requiredErrorText,De=dt.validationErrorText,y=y$(null==u?void 0:u.props,P,B);return lt(pat,X({name:I,moleculeId:i,confirmText:(null==pt?void 0:pt.text)||"Yes",rejectText:(null==ht?void 0:ht.text)||"No",required:null==Me?void 0:Me.value,requiredErrorText:null==Se?void 0:Se.text,validationErrorText:null==De?void 0:De.text,sourceDataModelField:A,isDisplayOnly:"binary_radio_buttons_display"===s},y,{configurationItemInfo:re}));case"date_calendar":case"date_calendar_display":g={required:null==f?void 0:f.required,requiredErrorText:null==f?void 0:f.requiredErrorText,validationErrorText:null==f?void 0:f.validationErrorText},x=Object.keys(g);var ft=v$(g,E,x,B);Me=ft.required,Se=ft.requiredErrorText,De=ft.validationErrorText,Ie=y$(null==u?void 0:u.props,P,B);return lt(Hnt,X({},Ie,{name:I,required:null==Me?void 0:Me.value,requiredErrorText:null==Se?void 0:Se.text,validationErrorText:null==De?void 0:De.text,isDisplayOnly:"date_calendar_display"===s,sourceDataModelField:A,configurationItemInfo:re}));default:return lt(st,{children:"There is no such type of molecule yet."})}}()},gLt={},bLt={},xLt={},wLt={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;e.default={animating:!1,autoplaying:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,dragging:!1,edgeDragged:!1,initialized:!1,lazyLoadedList:[],listHeight:null,listWidth:null,scrolling:!1,slideCount:null,slideHeight:null,slideWidth:null,swipeLeft:null,swiped:!1,swiping:!1,touchObject:{startX:0,startY:0,curX:0,curY:0},trackStyle:{},trackWidth:0,targetSlide:0}}(wLt);var kLt=/^\s+|\s+$/g,_Lt=/^[-+]0x[0-9a-f]+$/i,CLt=/^0b[01]+$/i,MLt=/^0o[0-7]+$/i,SLt=parseInt,DLt="object"==typeof ne&&ne&&ne.Object===Object&&ne,OLt="object"==typeof self&&self&&self.Object===Object&&self,PLt=DLt||OLt||Function("return this")(),ELt=Object.prototype.toString,jLt=Math.max,TLt=Math.min,NLt=function(){return PLt.Date.now()};function RLt(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function FLt(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==ELt.call(e)}(e))return NaN;if(RLt(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=RLt(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(kLt,"");var r=CLt.test(e);return r||MLt.test(e)?SLt(e.slice(2),r?2:8):_Lt.test(e)?NaN:+e}var zLt=function(e,t,r){var n,o,a,i,s,l,c=0,u=!1,d=!1,p=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function h(t){var r=n,a=o;return n=o=void 0,c=t,i=e.apply(a,r)}function f(e){var r=e-l;return void 0===l||r>=t||r<0||d&&e-c>=a}function m(){var e=NLt();if(f(e))return v(e);s=setTimeout(m,function(e){var r=t-(e-l);return d?TLt(r,a-(e-c)):r}(e))}function v(e){return s=void 0,p&&n?h(e):(n=o=void 0,i)}function y(){var e=NLt(),r=f(e);if(n=arguments,o=this,l=e,r){if(void 0===s)return function(e){return c=e,s=setTimeout(m,t),u?h(e):i}(l);if(d)return s=setTimeout(m,t),h(l)}return void 0===s&&(s=setTimeout(m,t)),i}return t=FLt(t)||0,RLt(r)&&(u=!!r.leading,a=(d="maxWait"in r)?jLt(FLt(r.maxWait)||0,t):a,p="trailing"in r?!!r.trailing:p),y.cancel=function(){void 0!==s&&clearTimeout(s),c=0,n=l=o=s=void 0},y.flush=function(){return void 0===s?i:v(NLt())},y},ILt={exports:{}};
9639
9639
  /*!
9640
9640
  Copyright (c) 2018 Jed Watson.
9641
9641
  Licensed under the MIT License (MIT), see
@@ -9725,5 +9725,5 @@ var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toS
9725
9725
  * LICENSE.md file in the root directory of this source tree.
9726
9726
  *
9727
9727
  * @license MIT
9728
- */function Ktr(){return Ktr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ktr.apply(this,arguments)}function Ytr(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}const Xtr=["onClick","reloadDocument","replace","state","target","to"],Ztr=["aria-current","caseSensitive","className","end","style","to","children"];process.env.NODE_ENV;const Qtr=e.forwardRef(function(t,r){let{onClick:n,reloadDocument:o,replace:a=!1,state:i,target:s,to:l}=t,c=Ytr(t,Xtr),u=qtr(l),d=function(t,r){let{target:n,replace:o,state:a}=void 0===r?{}:r,i=Utr(),s=Wtr(),l=Gtr(t);return e.useCallback(e=>{if(!(0!==e.button||n&&"_self"!==n||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))){e.preventDefault();let r=!!o||Ntr(s)===Ntr(l);i(t,{replace:r,state:a})}},[s,i,l,o,a,n,t])}(l,{replace:a,state:i,target:s});return e.createElement("a",Ktr({},c,{href:u,onClick:function(e){n&&n(e),e.defaultPrevented||o||d(e)},ref:r,target:s}))});"production"!==process.env.NODE_ENV&&(Qtr.displayName="Link");const Jtr=e.forwardRef(function(t,r){let{"aria-current":n="page",caseSensitive:o=!1,className:a="",end:i=!1,style:s,to:l,children:c}=t,u=Ytr(t,Ztr),d=Wtr(),p=Gtr(l),h=d.pathname,f=p.pathname;o||(h=h.toLowerCase(),f=f.toLowerCase());let m,v=h===f||!i&&h.startsWith(f)&&"/"===h.charAt(f.length),y=v?n:void 0;m="function"==typeof a?a({isActive:v}):[a,v?"active":null].filter(Boolean).join(" ");let g="function"==typeof s?s({isActive:v}):s;return e.createElement(Qtr,Ktr({},u,{"aria-current":y,className:m,ref:r,style:g,to:l}),"function"==typeof c?c({isActive:v}):c)});function err(t){"production"!==process.env.NODE_ENV&&function(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(e){}}}("undefined"!=typeof URLSearchParams,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params\n\nIf you're unsure how to load polyfills, we recommend you check out https://polyfill.io/v3/ which provides some recommendations about how to load polyfills only for users that need them, instead of for every user.");let r=e.useRef(trr(t)),n=Wtr(),o=e.useMemo(()=>{let e=trr(n.search);for(let t of r.current.keys())e.has(t)||r.current.getAll(t).forEach(r=>{e.append(t,r)});return e},[n.search]),a=Utr();return[o,e.useCallback((e,t)=>{a("?"+trr(e),t)},[a])]}function trr(e){return void 0===e&&(e=""),new URLSearchParams("string"==typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(e=>[r,e]):[[r,n]])},[]))}"production"!==process.env.NODE_ENV&&(Jtr.displayName="NavLink");var rrr=function(t){var r=function(){try{return err()}catch(e){return[new URLSearchParams,function(){}]}}()[0];return e.useMemo(function(){var e=r.get("rwoContext")||"",n=r.get("rwoRecordId"),o=e?M$(e):null,a=null==o?void 0:o[t],i=(null==a?void 0:a.rwoRecordId)||n||void 0,s=X({},a);return null==s||delete s.rwoRecordId,{rwoRecordId:i,fieldValues:s,rawContext:a,getFieldValue:function(e){return null==s?void 0:s[e]}}},[r,t])},nrr=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,orr=function(e){return"string"==typeof e&&nrr.test(e)},arr=function(e){var t,r=e.tooltip,n=e.label,o=void 0===n?"Action":n,a=e.icon,i=e.variant,s=void 0===i?"outlined":i,l=e.color,c=void 0===l?"primary":l,u=e.size,d=void 0===u?"small":u,p=e.disabled,h=e.onClick,f="string"==typeof a?lt(fnt,{name:a,size:16}):a,m=null!==(t=null!=r?r:o)&&void 0!==t?t:"",v="contained"===s?{backgroundColor:"background.paper",border:"1px solid",borderColor:"divider","&:hover":{backgroundColor:"background.paper"}}:"outlined"===s?{border:"1px solid",borderColor:"divider"}:void 0;return lt(Gb,X({title:m,placement:"top"},{children:lt(yc,X({size:"small"===d?"small":"medium",color:c,disabled:Boolean(p),onClick:function(e){e.stopPropagation(),null==h||h()},"aria-label":m,sx:v,"data-action-button":"true"},{children:f}))}))},irr=function(e,t){var r=e[t];return r&&"object"==typeof r&&"value"in r?r.value:r},srr=function(e){var t=e.value,r=e.trueLabel,n=void 0===r?"Yes":r,o=e.falseLabel,a=void 0===o?"No":o,i=t;t&&"object"==typeof t&&"value"in t&&(i=t.value);var s="boolean"==typeof i?i:"string"==typeof i?["true","1","yes","y"].includes(i.toLowerCase()):Boolean(i);return lt(nh,X({sx:{display:"inline-flex",alignItems:"center"}},{children:lt(Gb,X({title:s?n:a,placement:"top"},{children:lt(nh,X({component:"span",sx:{display:"inline-flex"},"aria-label":s?"true":"false"},{children:s?lt(l_,{width:16,height:16,color:"#16A34A"}):lt(d_,{width:16,height:16,color:"#DC2626"})}))}))}))},lrr=function(e){var t=e.value,r=e.currency,n=void 0===r?"USD":r,o=e.locale,a=t;t&&"object"==typeof t&&"value"in t&&(a=t.value);var i="number"==typeof a?a:Number(null!=a?a:0);if(!Number.isFinite(i))return lt(st,{children:String(null!=a?a:"")});var s=new Intl.NumberFormat(null!=o?o:void 0,{style:"currency",currency:n,maximumFractionDigits:2});return lt(st,{children:s.format(i)})},crr=function(e){var t=e.value,r=e.formatString,n=void 0===r?"yyyy-MM-dd HH:mm":r,o=t;if(t&&"object"==typeof t&&"value"in t&&(o=t.value),null==o)return null;var a=o instanceof Date?o:new Date(o);return Number.isNaN(a.getTime())?lt(st,{children:String(o)}):lt(st,{children:$H(a,n)})},urr=function(e){var t=e.value,r=t;return t&&"object"==typeof t&&"value"in t&&(r=t.value),lt(st,{children:null==r?"":String(r)})},drr=function(e){var t=e.value,r=t;t&&"object"==typeof t&&"value"in t&&(r=t.value);var n=(null!=r?r:"").toString();return n?ct(nh,X({sx:{display:"inline-flex",alignItems:"center",gap:.5}},{children:[lt(b_,{size:16}),lt("a",X({href:"mailto:".concat(n),onClick:function(e){return e.stopPropagation()},"data-action-link":"true"},{children:n}))]})):null},prr=function(e){var t=e.value,r=t;t&&"object"==typeof t&&"value"in t&&(r=t.value);var n=null==r?"":String(r);if(!n)return null;var o=n.replace(/[^+\d]/g,"");return ct(nh,X({sx:{display:"inline-flex",alignItems:"center",gap:.5}},{children:[lt(g_,{size:16}),lt("a",X({href:"tel:".concat(o),onClick:function(e){return e.stopPropagation()},"data-action-link":"true"},{children:n}))]}))},hrr=function(e){var t=e.value,r=e.max,n=void 0===r?5:r,o=t;t&&"object"==typeof t&&"value"in t&&(o=t.value);var a="number"==typeof o?o:Number(null!=o?o:0),i=Number.isFinite(a)?Math.max(0,Math.min(n,Math.floor(a))):0;return lt(nh,X({sx:{display:"inline-flex",color:"#F59E0B"},"aria-label":"rating-".concat(i)},{children:Array.from({length:n}).map(function(e,t){return lt(n_,{width:16,height:16,color:t<i?"#F59E0B":"#D1D5DB"},t)})}))},frr={DefaultTextCell:urr,ActionButtonCell:arr,PredefinedActions:function(e){var t,r,n,o,a,i,s,l,c,u,d,p,h,f=e.actions,m=e.onEdit,v=e.onView,y=e.onDelete,g=e.size,b=void 0===g?"small":g,x=e.disabled;return ct(nh,X({sx:{display:"inline-flex",gap:(null!==(t=null==f?void 0:f.gap)&&void 0!==t?t:8)/16}},{children:[(null===(r=null==f?void 0:f.edit)||void 0===r?void 0:r.enabled)&&lt(arr,{tooltip:(null===(n=null==f?void 0:f.edit)||void 0===n?void 0:n.tooltip)||"Edit",variant:(null===(o=null==f?void 0:f.edit)||void 0===o?void 0:o.variant)||"outlined",icon:lt(fnt,{name:(null===(a=null==f?void 0:f.edit)||void 0===a?void 0:a.icon)||"Pencil",size:16}),onClick:m,size:b,disabled:Boolean(x)}),(null===(i=null==f?void 0:f.view)||void 0===i?void 0:i.enabled)&&lt(arr,{tooltip:(null===(s=null==f?void 0:f.view)||void 0===s?void 0:s.tooltip)||"View",variant:(null===(l=null==f?void 0:f.view)||void 0===l?void 0:l.variant)||"outlined",icon:lt(fnt,{name:(null===(c=null==f?void 0:f.view)||void 0===c?void 0:c.icon)||"Eye",size:16}),onClick:v,size:b,disabled:Boolean(x)}),(null===(u=null==f?void 0:f.delete)||void 0===u?void 0:u.enabled)&&lt(arr,{tooltip:(null===(d=null==f?void 0:f.delete)||void 0===d?void 0:d.tooltip)||"Delete",color:"error",variant:(null===(p=null==f?void 0:f.delete)||void 0===p?void 0:p.variant)||"outlined",icon:lt(fnt,{name:(null===(h=null==f?void 0:f.delete)||void 0===h?void 0:h.icon)||"Trash2",size:16}),onClick:y,size:b,disabled:Boolean(x)})]}))},ActionButtons:function(e){var t=e.buttons;return e.actions,lt(nh,X({sx:{display:"inline-flex",gap:1}},{children:null==t?void 0:t.map(function(e,t){return lt(arr,{tooltip:e.label,icon:e.icon,variant:"outlined",size:"small",onClick:e.onClick},e.id||t)})}))},DateCell:crr,BooleanIconCell:srr,EmailLinkCell:drr,PhoneLinkCell:prr,CurrencyCell:lrr,RatingCell:hrr},mrr=function(e){var t,r,n,o,a,i=e.value,s=e.mapping,l=i;i&&"object"==typeof i&&"value"in i&&(l=i.value);var c=null==s?void 0:s[l],u={default:{bg:"#E5E7EB",fg:"#000000"},success:{bg:"#D1FFDF",fg:"#000000"},error:{bg:"#FEE2E2",fg:"#000000"},warning:{bg:"#FEF3C7",fg:"#000000"},info:{bg:"#DBEAFE",fg:"#000000"}},d=null!==(r=u[null!==(t=null==c?void 0:c.color)&&void 0!==t?t:"default"])&&void 0!==r?r:u.default;return lt(Id,{size:"small",label:null!==(n=null==c?void 0:c.label)&&void 0!==n?n:l,sx:{height:24,borderRadius:8,px:1,fontSize:12,lineHeight:"24px",letterSpacing:"1px",bgcolor:null!==(o=null==c?void 0:c.bgColor)&&void 0!==o?o:d.bg,color:null!==(a=null==c?void 0:c.textColor)&&void 0!==a?a:d.fg,"& .MuiChip-label":{px:1,color:"inherit"}}})},vrr=function(e,t){var r,n;if(!e)return null;var o="component"===e.kind?e.id:e.field,a="component"===e.kind?e.componentRenderer:e.renderer,i=frr[a]||frr.DefaultTextCell,s="component"===e.kind?void 0:function(e,t){var r=e[t];return r&&"object"==typeof r&&"value"in r?r.value:r}(t,o);return lt(i,X({value:s,row:t},null!==(n=null!==(r=e.rendererProps)&&void 0!==r?r:e.componentProps)&&void 0!==n?n:{}))},yrr=function(e){var t,r,n,o,a,i,s,l,c,u,d,p,h=e.params,f=e.items,m=e.areas,v=e.layout,y=(null==h?void 0:h.row)||{},g=f&&f.length>0?f:[null==m?void 0:m.topLeft,null==m?void 0:m.topRight,null==m?void 0:m.bottomLeft,null==m?void 0:m.bottomRight].filter(Boolean);return lt(Im,X({role:"listitem",container:!0,columns:12,columnSpacing:v.gap,rowSpacing:v.verticalGap,sx:{alignItems:"center",width:"100%",p:null!==(r=null===(t=v.item)||void 0===t?void 0:t.padding)&&void 0!==r?r:void 0,px:null===(n=v.item)||void 0===n?void 0:n.paddingX,py:null===(o=v.item)||void 0===o?void 0:o.paddingY,mx:null===(a=v.item)||void 0===a?void 0:a.marginX,my:null===(i=v.item)||void 0===i?void 0:i.marginY,bgcolor:null!==(l=null===(s=v.item)||void 0===s?void 0:s.backgroundColor)&&void 0!==l?l:"transparent",border:(null===(c=v.item)||void 0===c?void 0:c.borderColor)?"1px solid ".concat(v.item.borderColor):void 0,borderRadius:null!==(d=null===(u=v.item)||void 0===u?void 0:u.borderRadius)&&void 0!==d?d:12,boxShadow:null===(p=v.item)||void 0===p?void 0:p.boxShadow}},{children:g.map(function(e){return lt(Im,X({size:"auto",sx:{minWidth:0,overflow:"hidden"}},{children:vrr(e,y)}),e.id)})}))},grr=function(e,t){var r,n;if(!e)return null;var o="component"===e.kind?e.id:e.field,a="component"===e.kind?e.componentRenderer:e.renderer,i=frr[a]||frr.DefaultTextCell,s="component"===e.kind?void 0:function(e,t){var r=e[t];return r&&"object"==typeof r&&"value"in r?r.value:r}(t,o);return lt(i,X({value:s,row:t},null!==(n=null!==(r=e.rendererProps)&&void 0!==r?r:e.componentProps)&&void 0!==n?n:{}))},brr=function(e){var t,r,n,o,a,i,s,l,c,u,d,p,h,f,m=e.params,v=e.cfgCols,y=e.layout,g=(null==m?void 0:m.row)||{},b={topLeft:v[0],topRight:v[1],bottomLeft:v[2],bottomRight:v[3]};return lt(nh,X({role:"listitem",sx:{width:"100%",height:"100%",boxSizing:"border-box",p:null!==(r=null===(t=y.item)||void 0===t?void 0:t.padding)&&void 0!==r?r:void 0,px:null===(n=y.item)||void 0===n?void 0:n.paddingX,py:null===(o=y.item)||void 0===o?void 0:o.paddingY,mx:null===(a=y.item)||void 0===a?void 0:a.marginX,my:null!==(s=null===(i=y.item)||void 0===i?void 0:i.marginY)&&void 0!==s?s:0,border:(null===(l=y.item)||void 0===l?void 0:l.borderColor)?"1px solid ".concat(y.item.borderColor):"1px solid #E5E7EB",borderRadius:null!==(u=null===(c=y.item)||void 0===c?void 0:c.borderRadius)&&void 0!==u?u:16,bgcolor:null!==(p=null===(d=y.item)||void 0===d?void 0:d.backgroundColor)&&void 0!==p?p:"background.paper",boxShadow:null!==(f=null===(h=y.item)||void 0===h?void 0:h.boxShadow)&&void 0!==f?f:"0 6px 16px rgba(17,24,39,0.06), 0 1px 2px rgba(17,24,39,0.03)",display:"flex",alignItems:"stretch"}},{children:ct(nh,X({sx:{display:"flex",alignItems:"center",gap:y.gap,width:"100%"}},{children:[ct(nh,X({sx:{flexGrow:1,minWidth:0}},{children:[lt(nh,X({"aria-label":"top-left",sx:{minWidth:0,overflow:"hidden"}},{children:lt(nh,X({component:"div",sx:{fontWeight:700,color:"#111827",letterSpacing:.2,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},{children:grr(b.topLeft,g)}))})),lt(nh,X({"aria-label":"bottom-left",sx:{minWidth:0,overflow:"hidden",mt:y.verticalGap}},{children:lt(nh,X({component:"div",sx:{fontSize:12,color:"#6B7280",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},{children:grr(b.bottomLeft,g)}))}))]})),ct(nh,X({sx:{display:"flex",flexDirection:"column",alignItems:"flex-end",justifyContent:"space-between",height:"100%",alignSelf:"stretch",flexShrink:0}},{children:[lt(nh,X({"aria-label":"top-right",sx:{color:"#111827",whiteSpace:"nowrap",fontWeight:600}},{children:grr(b.topRight,g)})),lt(nh,X({"aria-label":"bottom-right",sx:{mt:y.verticalGap}},{children:grr(b.bottomRight,g)}))]}))]}))}))},xrr=function(e,t,r){if(!(!e||!t||r<0||r>=t.length)){var n=t[r];if(n&&n.field)return function(e,t){if(e&&t){"development"===process.env.NODE_ENV&&console.log("Looking for field: ".concat(t),{row:e});var r=e[t];return r&&"object"==typeof r?"value"in r?r.value:"label"in r?r.label:"name"in r?r.name:"text"in r?r.text:"displayValue"in r?r.displayValue:"title"in r?r.title:r:r}}(e,n.field)}},wrr=function(e){var t=e.params,r=e.borderRadius,n=e.backgroundColor,o=e.borderColor,a=e.avatarBackgroundColor,i=e.avatarTextColor,s=e.stripeColor,l=e.titleColor,c=e.subtitleColor,u=e.companyColor,d=e.statusMapping,p=void 0===d?{Recruiting:{label:"Recruiting",color:"success"},Completed:{label:"Completed",color:"default"},Terminated:{label:"Terminated",color:"error"}}:d,h=e.columns,f=void 0===h?[]:h,m=(null==t?void 0:t.row)||{};"development"===process.env.NODE_ENV&&(console.log("StudyCard row data:",m),console.log("Available row fields:",Object.keys(m)),console.log("Columns configuration:",f));var v=xrr(m,f,0),y=xrr(m,f,1),g=xrr(m,f,2),b=xrr(m,f,3),x=xrr(m,f,4),w=v?String(v):"",k=y?String(y):"",_=g?String(g):"",C=b?String(b):"",M=x?String(x):"",S=_?function(e){var t,r;if(!e)return"";var n=e.trim().split(/\s+/).filter(Boolean);return 1===n.length?n[0].slice(0,2).toUpperCase():"".concat(null!==(t=n[0][0])&&void 0!==t?t:"").concat(null!==(r=n[1][0])&&void 0!==r?r:"").toUpperCase()||e.slice(0,2).toUpperCase()}(_):"??";return ct(nh,X({role:"listitem",sx:{width:"100%",height:"100%",boxSizing:"border-box",border:"1px solid ".concat(o||"#E5E7EB"),borderRadius:r||2,backgroundColor:n||"#FFFFFF",display:"flex",alignItems:"stretch",position:"relative",overflow:"hidden",minHeight:88}},{children:[lt(nh,{"aria-hidden":!0,sx:{width:6,alignSelf:"stretch",backgroundColor:s||"rgba(255, 174, 23, 0.25)",borderTopLeftRadius:r||2,borderBottomLeftRadius:r||2,marginRight:3}}),ct(nh,X({sx:{display:"flex",alignItems:"stretch",gap:2,width:"100%",paddingRight:3,paddingLeft:2,paddingTop:2,paddingBottom:2}},{children:[ct(nh,X({sx:{flexGrow:1,minWidth:0,display:"flex",flexDirection:"column",justifyContent:"center"}},{children:[ct(nh,X({sx:{display:"flex",alignItems:"center",gap:1,minWidth:0,marginBottom:1}},{children:[lt(Ic,X({sx:{fontWeight:700,color:l||"#111827",letterSpacing:"0.2px",fontSize:16,lineHeight:"24px",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{children:w||"No Title"})),lt(mrr,{value:k,mapping:p})]})),lt(Ic,X({sx:{color:c||"#6B7280",fontSize:12,lineHeight:"16px",letterSpacing:"0.2px",fontWeight:400,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{children:C||"No Subtitle"}))]})),ct(nh,X({sx:{display:"flex",alignItems:"flex-end",flexDirection:"column",justifyContent:"flex-end",height:"100%",flexShrink:0,minWidth:240,gap:1}},{children:[lt(zp,X({sx:{width:20,height:20,fontSize:11,fontWeight:500,backgroundColor:a||"#E6F6FF",color:i||"#0047B2",lineHeight:"20px",letterSpacing:"0.1px"},"aria-label":"avatar"},{children:S})),lt(Ic,X({sx:{color:u||"#111827",fontWeight:700,textAlign:"right",fontSize:12,lineHeight:"24px",letterSpacing:"0.2px",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{children:M||"No Company"}))]}))]}))]}))},krr=function(e,t){var r=e[t];return r&&"object"==typeof r&&"value"in r?r.value:r},_rr=function(e,t){var r,n;if(!e)return null;var o="component"===e.kind?e.id:e.field,a="component"===e.kind?e.componentRenderer:e.renderer,i=frr[a]||frr.DefaultTextCell,s="component"===e.kind?void 0:krr(t,o);return lt(i,X({value:s,row:t},null!==(n=null!==(r=e.rendererProps)&&void 0!==r?r:e.componentProps)&&void 0!==n?n:{}))},Crr=function(e,t){return e?"component"===e.kind?t:e.field:t},Mrr=function(e){var t=e.actionsColumn,r=e.row,n=e.borderColor,o=e.menuAnchorEl,a=e.isMenuOpen,i=e.handleMenuClose;return lt(ky,X({anchorEl:o,open:a,onClose:i,transformOrigin:{horizontal:"right",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"bottom"},PaperProps:{sx:{minWidth:160,boxShadow:"0px 4px 6px -1px rgba(0, 0, 0, 0.1), 0px 2px 4px -1px rgba(0, 0, 0, 0.06)",borderRadius:1,border:"1px solid ".concat(n)}}},{children:t&&"component"===t.kind?lt(Dy,X({sx:{padding:0,"&:hover":{backgroundColor:"transparent"}},onClick:function(e){e.target.closest("button")?e.stopPropagation():i()}},{children:lt(nh,X({sx:{width:"100%",padding:"8px 16px"},onClick:function(e){e.stopPropagation()}},{children:_rr(t,r)}))})):lt(Dy,X({disabled:!0,onClick:i},{children:lt(Ic,X({variant:"body2",color:"text.secondary"},{children:"No actions available"}))}))}))},Srr=function(t){var r,n,o,a,i,s,l,c,u,d,p,h,f,m=t.params,v=t.cfgCols,y=t.columns,g=t.config,b=t.onEdit,x=t.onDelete,w=t.onView,k=(null==m?void 0:m.row)||{},_=e.useState(null),C=_[0],M=_[1],S=Boolean(C),D=null==v?void 0:v[0];null==v||v[1];var O=null==v?void 0:v[2],P=null==v?void 0:v[3],E=null==v?void 0:v[4],j=null==v?void 0:v[5],T=(null==v?void 0:v.find(function(e){return"component"===e.kind}))||j,N="ActionButtons"===(null==T?void 0:T.componentRenderer)&&(null===(r=T.componentProps)||void 0===r?void 0:r.buttons)?X(X({},T),{componentProps:X(X({},T.componentProps),{actions:{edit:{enabled:!0,onClick:function(){return null==b?void 0:b(k)}},view:{enabled:!0,onClick:function(){return null==w?void 0:w(k)}},delete:{enabled:!0,onClick:function(){return null==x?void 0:x(k)}}},buttons:T.componentProps.buttons.map(function(e){return X(X({},e),{onClick:function(t){switch(t.stopPropagation(),e.id){case"edit":null==b||b(k);break;case"view":null==w||w(k);break;case"delete":null==x||x(k);break;default:console.log("Action clicked:",e.id,k)}}})})})}):T,R=Crr(O,null===(n=y[2])||void 0===n?void 0:n.field),F=R?String(null!==(o=krr(k,R))&&void 0!==o?o:""):"",z=null===(a=null==O?void 0:O.rendererProps)||void 0===a?void 0:a.mapping,I=Crr(D,null===(i=y[0])||void 0===i?void 0:i.field),A=function(e){var t,r,n=String(null!=e?e:"").trim();if(!n)return"";var o=n.split(/\s+/).filter(Boolean);return 1===o.length?o[0].slice(0,2).toUpperCase():"".concat(null!==(t=o[0][0])&&void 0!==t?t:"").concat(null!==(r=o[1][0])&&void 0!==r?r:"").toUpperCase()||n.slice(0,2).toUpperCase()}(I?krr(k,I):""),L=g||{},B=L.backgroundColor,V=L.borderColor,H=L.borderRadius,q=L.avatarBgColor,$=L.avatarTextColor,W=L.textColor,U=L.secondaryTextColor;return ct(st,{children:[lt(nh,X({role:"listitem",sx:{width:"100%",height:"100%",boxSizing:"border-box",border:"1px solid ".concat(V||"#E5E7EB"),borderRadius:H||1,backgroundColor:B||"#FFFFFF",display:"flex",alignItems:"stretch",position:"relative",overflow:"hidden",minHeight:88}},{children:ct(nh,X({sx:{display:"flex",alignItems:"stretch",gap:2,width:"100%",pr:3,pl:2,py:2}},{children:[lt(nh,X({sx:{display:"flex",alignItems:"center",flexShrink:0}},{children:lt(zp,X({sx:{width:28,height:28,fontSize:12,fontWeight:600,backgroundColor:q||"#E6F6FF",color:$||"#0047B2"},"aria-label":"avatar"},{children:A}))})),ct(nh,X({sx:{flexGrow:1,minWidth:0,display:"flex",flexDirection:"column",justifyContent:"center"}},{children:[ct(nh,X({sx:{display:"flex",alignItems:"center",gap:1,minWidth:0,mb:1}},{children:[lt(Ic,X({sx:{fontWeight:600,color:W||"#111827",letterSpacing:"-0.01em",fontSize:15,lineHeight:1.4,minWidth:0,flex:1}},{children:D?_rr(D,k):String(null!==(l=krr(k,(null===(s=y[0])||void 0===s?void 0:s.field)||""))&&void 0!==l?l:"")})),ct(nh,X({sx:{display:"flex",alignItems:"center",gap:1,flexShrink:0}},{children:[lt(mrr,{value:F,mapping:z}),lt(yc,X({size:"small",onClick:function(e){M(e.currentTarget)},sx:{color:U||"#6B7280",padding:.5,"&:hover":{backgroundColor:"rgba(0, 0, 0, 0.04)"}},"aria-label":"more actions"},{children:lt($ce,{size:16})}))]}))]})),ct(nh,X({sx:{display:"flex",alignItems:"center",gap:1,minWidth:0}},{children:[lt(Ic,X({sx:{color:U||"#6B7280",fontSize:12,lineHeight:1.3,letterSpacing:"0.01em",fontWeight:400,minWidth:0,flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{children:P?_rr(P,k):String(null!==(u=krr(k,(null===(c=y[3])||void 0===c?void 0:c.field)||""))&&void 0!==u?u:"")})),lt(Ic,X({sx:{color:U||"#6B7280",fontSize:12,lineHeight:1.3,letterSpacing:"0.01em",fontWeight:400,minWidth:0,flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{children:E?_rr(E,k):String(null!==(p=krr(k,(null===(d=y[4])||void 0===d?void 0:d.field)||""))&&void 0!==p?p:"")})),lt(Ic,X({sx:{color:W||"#111827",fontSize:12,lineHeight:1.3,letterSpacing:"0.01em",fontWeight:600,minWidth:0,flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",textAlign:"right"}},{children:j?_rr(j,k):String(null!==(f=krr(k,(null===(h=y[5])||void 0===h?void 0:h.field)||""))&&void 0!==f?f:"")}))]}))]}))]}))})),lt(Mrr,{actionsColumn:N,row:k,borderColor:V,menuAnchorEl:C,isMenuOpen:S,handleMenuClose:function(){M(null)}})]})},Drr=function(e,t){var r=e[t];return r&&"object"==typeof r&&"value"in r?r.value:r},Orr=function(e){var t,r,n,o,a,i,s,l,c,u,d,p,h,f,m,v,y,g,b,x,w,k=e.params,_=e.columns,C=e.layout,M=String(null!==(r=Drr(k.row,(null===(t=_[0])||void 0===t?void 0:t.field)||""))&&void 0!==r?r:""),S=String(null!==(o=Drr(k.row,(null===(n=_[1])||void 0===n?void 0:n.field)||""))&&void 0!==o?o:""),D=String(null!==(i=Drr(k.row,(null===(a=_[2])||void 0===a?void 0:a.field)||""))&&void 0!==i?i:"");return lt(nh,X({sx:{width:"100%",height:"100%",boxSizing:"border-box",p:null!==(l=null===(s=null==C?void 0:C.item)||void 0===s?void 0:s.padding)&&void 0!==l?l:void 0,px:null===(c=null==C?void 0:C.item)||void 0===c?void 0:c.paddingX,py:null===(u=null==C?void 0:C.item)||void 0===u?void 0:u.paddingY,mx:null===(d=null==C?void 0:C.item)||void 0===d?void 0:d.marginX,my:null!==(h=null===(p=null==C?void 0:C.item)||void 0===p?void 0:p.marginY)&&void 0!==h?h:0,border:(null===(f=null==C?void 0:C.item)||void 0===f?void 0:f.borderColor)?"1px solid ".concat(null===(m=null==C?void 0:C.item)||void 0===m?void 0:m.borderColor):"1px solid #E5E7EB",borderRadius:null!==(y=null===(v=null==C?void 0:C.item)||void 0===v?void 0:v.borderRadius)&&void 0!==y?y:"16px",bgcolor:null!==(b=null===(g=null==C?void 0:C.item)||void 0===g?void 0:g.backgroundColor)&&void 0!==b?b:"background.paper",boxShadow:null!==(w=null===(x=null==C?void 0:C.item)||void 0===x?void 0:x.boxShadow)&&void 0!==w?w:"0 6px 16px rgba(17,24,39,0.06), 0 1px 2px rgba(17,24,39,0.03)",display:"flex",alignItems:"stretch"}},{children:ct(lx,X({direction:"row",sx:{alignItems:"center",gap:2,width:"100%",height:"100%"}},{children:[ct(lx,X({sx:{flexGrow:1,minWidth:0}},{children:[lt(Ic,X({variant:"subtitle1",fontWeight:700,sx:{color:"#111827",letterSpacing:.2}},{children:M})),lt(Ic,X({variant:"body2",sx:{color:"#6B7280",mt:1}},{children:D}))]})),lt(nh,X({sx:{display:"flex",alignItems:"center",justifyContent:"flex-end"}},{children:lt(Ic,X({variant:"body2",sx:{color:"#111827",whiteSpace:"nowrap",fontWeight:600}},{children:S}))}))]}))}))},Prr=function(e,t){var r=e[t];return r&&"object"==typeof r&&"value"in r?r.value:r},Err=function(e){var t,r,n,o,a,i,s,l,c,u,d,p,h,f,m,v,y,g,b,x,w,k=e.params,_=e.columns,C=e.layout,M=String(null!==(r=Prr(k.row,(null===(t=_[0])||void 0===t?void 0:t.field)||""))&&void 0!==r?r:""),S=String(null!==(o=Prr(k.row,(null===(n=_[1])||void 0===n?void 0:n.field)||""))&&void 0!==o?o:""),D=String(null!==(i=Prr(k.row,(null===(a=_[2])||void 0===a?void 0:a.field)||""))&&void 0!==i?i:"");return lt(nh,X({sx:{width:"100%",height:"100%",boxSizing:"border-box",p:null!==(l=null===(s=null==C?void 0:C.item)||void 0===s?void 0:s.padding)&&void 0!==l?l:void 0,px:null===(c=null==C?void 0:C.item)||void 0===c?void 0:c.paddingX,py:null===(u=null==C?void 0:C.item)||void 0===u?void 0:u.paddingY,mx:null===(d=null==C?void 0:C.item)||void 0===d?void 0:d.marginX,my:null!==(h=null===(p=null==C?void 0:C.item)||void 0===p?void 0:p.marginY)&&void 0!==h?h:0,border:(null===(f=null==C?void 0:C.item)||void 0===f?void 0:f.borderColor)?"1px solid ".concat(null===(m=null==C?void 0:C.item)||void 0===m?void 0:m.borderColor):"1px solid #E5E7EB",borderRadius:null!==(y=null===(v=null==C?void 0:C.item)||void 0===v?void 0:v.borderRadius)&&void 0!==y?y:"16px",bgcolor:null!==(b=null===(g=null==C?void 0:C.item)||void 0===g?void 0:g.backgroundColor)&&void 0!==b?b:"background.paper",boxShadow:null!==(w=null===(x=null==C?void 0:C.item)||void 0===x?void 0:x.boxShadow)&&void 0!==w?w:"0 6px 16px rgba(17,24,39,0.06), 0 1px 2px rgba(17,24,39,0.03)",display:"flex",alignItems:"stretch"}},{children:ct(lx,X({direction:"row",sx:{alignItems:"center",height:"100%",gap:2,width:"100%"}},{children:[ct(lx,X({sx:{flexGrow:1,minWidth:0}},{children:[lt(Ic,X({variant:"subtitle1",fontWeight:700,sx:{color:"#111827",letterSpacing:.2}},{children:M})),lt(Ic,X({variant:"body2",sx:{color:"#6B7280",mt:1}},{children:D}))]})),ct(nh,X({sx:{display:"flex",flexDirection:"column",alignItems:"flex-end",justifyContent:"space-between",height:"100%",alignSelf:"stretch",flexShrink:0}},{children:[lt(Ic,X({variant:"body2",sx:{color:"#111827",whiteSpace:"nowrap",fontWeight:600}},{children:S})),lt("span",X({"aria-label":"checked",style:{color:"#111827",lineHeight:1}},{children:"✓"}))]}))]}))}))},jrr=function(e,t){return t?e.find(function(e){return("component"===e.kind?e.id:e.field)===t}):void 0},Trr=function(e,t){var r=e[t];return r&&"object"==typeof r&&"value"in r?r.value:r},Nrr=function(e,t,r){var n,o,a,i,s;if(!t)return null;var l="component"===t.kind?t.id:t.field,c=null!==(n=frr["component"===t.kind?t.componentRenderer:t.renderer])&&void 0!==n?n:frr.DefaultTextCell,u="component"===t.kind?void 0:Trr(r,l);return lt(c,X({value:u,row:r},null!==(a=null!==(o=t.rendererProps)&&void 0!==o?o:t.componentProps)&&void 0!==a?a:{},"component"===t.kind&&"PredefinedActions"===t.componentRenderer?{size:"compact"===e?"small":"medium",disabled:!orr(null==r?void 0:r.id),actions:null===(s=null!==(i=t.rendererProps)&&void 0!==i?i:t.componentProps)||void 0===s?void 0:s.actions,onEdit:function(){var e,n,o,a,i,s,l;try{var c=null===(n=null!==(e=t.rendererProps)&&void 0!==e?e:t.componentProps)||void 0===n?void 0:n.actions,u=(null==c?void 0:c.idField)||"id",d=Trr(r,u),p="string"==typeof d?d:String(null!=d?d:"");if(!(null===(o=null==c?void 0:c.edit)||void 0===o?void 0:o.enabled))return;var h=null===(i=null===(a=null==c?void 0:c.edit)||void 0===a?void 0:a.link)||void 0===i?void 0:i.internalLink;if(onInternalNavigation&&h){var f=h,m=f.length>0&&!f.endsWith("/"),v=null===(s=null==c?void 0:c.edit)||void 0===s?void 0:s.targetFormId;if(v&&(f="".concat(f).concat(m?"/":"","organismId=").concat(encodeURIComponent(v))),p){var y=f.length>0&&!f.endsWith("/");f="".concat(f).concat(y?"/":"","rwoRecordId=").concat(encodeURIComponent(p))}var g={};return v&&(g.organismId=v),p&&(g.rwoRecordId=p),void onInternalNavigation({link:f,query:g})}onAction&&onAction({action:{type:"edit_record",targetFormId:null===(l=null==c?void 0:c.edit)||void 0===l?void 0:l.targetFormId,idField:u},row:r})}catch(e){console.error("Error in list view edit action:",e)}},onView:function(){var e,n,o,a,i,s,l,c,u;try{var d=null===(n=null!==(e=t.rendererProps)&&void 0!==e?e:t.componentProps)||void 0===n?void 0:n.actions,p=(null==d?void 0:d.idField)||"id",h=Trr(r,p),f="string"==typeof h?h:String(null!=h?h:"");if(!(null===(o=null==d?void 0:d.view)||void 0===o?void 0:o.enabled))return;var m=(null===(i=null===(a=null==d?void 0:d.view)||void 0===a?void 0:a.link)||void 0===i?void 0:i.internalLink)||(null===(s=null==d?void 0:d.view)||void 0===s?void 0:s.routeKey);if(onInternalNavigation&&m){var v={},y=!1!==(null===(l=null==d?void 0:d.view)||void 0===l?void 0:l.includeRwoRecordId),g=Array.isArray(null===(c=null==d?void 0:d.view)||void 0===c?void 0:c.rwoContextMapping)?null===(u=null==d?void 0:d.view)||void 0===u?void 0:u.rwoContextMapping:[],b=S$({includeRwoRecordId:y,recordId:f||void 0,mapping:g,contextSource:r}).query;return Object.assign(v,b),f&&!v.rwoRecordId&&(v.rwoRecordId=f),void onInternalNavigation({link:m,query:v})}onAction&&onAction({action:null==d?void 0:d.view,row:r})}catch(e){console.error("Error in list view view action:",e)}},onDelete:function(){var e,n,o;try{var a=null===(n=null!==(e=t.rendererProps)&&void 0!==e?e:t.componentProps)||void 0===n?void 0:n.actions;if(!(null===(o=null==a?void 0:a.delete)||void 0===o?void 0:o.enabled))return;onAction&&onAction({action:null==a?void 0:a.delete,row:r})}catch(e){console.error("Error in list view delete action:",e)}}}:{}))},Rrr=function(e,t){if(!e)return"";var r,n="component"===e.kind?void 0:Trr(t,"component"===(r=e).kind?r.id:r.field);return null==n?"":String(n)},Frr=function(t,r){var n=t.organism,o=t.density;return t.onAction,oqt().onInternalNavigation,e.useMemo(function(){var e,t,a,i,s,l,c,u,d,p,h,f,m,v,y,g,b,x,w,k,_,C,M=(null==n?void 0:n.config)||{},S=(null===(e=null==M?void 0:M.dataRetrievalConfig)||void 0===e?void 0:e.columns)||[],D=(null===(t=null==M?void 0:M.view)||void 0===t?void 0:t.templateType)||""||"compact",O=(null===(i=null===(a=null==M?void 0:M.view)||void 0===a?void 0:a.list)||void 0===i?void 0:i.mapping)||(null===(l=null===(s=null==M?void 0:M.dataGrid)||void 0===s?void 0:s.list)||void 0===l?void 0:l.mapping)||{},P=(null===(u=null===(c=null==M?void 0:M.view)||void 0===c?void 0:c.list)||void 0===u?void 0:u.layout)||(null===(p=null===(d=null==M?void 0:M.dataGrid)||void 0===d?void 0:d.list)||void 0===p?void 0:p.layout)||{},E=function(e,t,r){var n=t.filter(function(e){return"component"!==e.kind}),o=t.filter(function(e){return"component"===e.kind});switch(e){case"fourItems":var a=t[0],i=t[1],s=t[2],l=t[3];return{topLeft:jrr(t,r.topLeftFieldId)||a,topRight:jrr(t,r.topRightFieldId)||i,bottomLeft:jrr(t,r.bottomLeftFieldId)||s,bottomRight:jrr(t,r.bottomRightFieldId)||l,meta:[],trailing:[]};case"titleSubtitleMeta":var c={primary:jrr(t,r.primaryFieldId)||n[0],secondary:jrr(t,r.secondaryFieldId)||n[1],meta:(r.metaFieldIds||[]).map(function(e){return jrr(t,e)}).filter(Boolean),trailing:(r.trailingComponentIds||[]).map(function(e){return jrr(t,e)}).filter(Boolean)};return c.meta&&0!==c.meta.length||(c.meta=n.slice(2,4)),c.trailing&&0!==c.trailing.length||(c.trailing=o),c;case"twoColumn":return c={primary:jrr(t,r.primaryFieldId)||n[0],secondary:jrr(t,r.secondaryFieldId)||n[1],meta:[],trailing:(r.trailingComponentIds||[]).map(function(e){return jrr(t,e)}).filter(Boolean)},c.trailing&&0!==c.trailing.length||(c.trailing=o),c;case"mediaLeft":return{primary:n[0],secondary:n[1],meta:n.slice(2,3),trailing:o};case"custom":return a=t[0],i=t[1],s=t[2],l=t[3],{topLeft:jrr(t,r.topLeftFieldId)||a,topRight:jrr(t,r.topRightFieldId)||i,bottomLeft:jrr(t,r.bottomLeftFieldId)||s,bottomRight:jrr(t,r.bottomRightFieldId)||l,meta:[],trailing:[]};default:var u=n[2];return{primary:n[0],secondary:n[1],meta:[],trailing:ee([u],o,!0).filter(Boolean)}}}(D,S,O),j=function(e,t){return{gap:"custom"===e&&Number.isFinite(t.gap)?t.gap:12,verticalGap:"custom"===e&&Number.isFinite(t.verticalGap)?t.verticalGap:4,trailingDirection:"custom"===e&&t.trailingDirection||"horizontal",templateColumns:"custom"===e&&t.templateColumns?t.templateColumns:"minmax(0,1fr) auto",item:"custom"===e?{padding:t.itemPadding,backgroundColor:t.itemBackgroundColor,borderColor:t.itemBorderColor,borderRadius:t.itemBorderRadius,boxShadow:t.itemBoxShadow}:void 0}}(D,P),T=(null===(f=null===(h=null==M?void 0:M.props)||void 0===h?void 0:h.listItem)||void 0===f?void 0:f.sx)||{},N=X(X({},j),{item:X(X({},j.item||{}),{padding:null!==(m=T.padding)&&void 0!==m?m:null===(v=j.item)||void 0===v?void 0:v.padding,paddingX:T.paddingX,paddingY:T.paddingY,marginX:T.marginX,marginY:T.marginY,backgroundColor:null!==(y=T.backgroundColor)&&void 0!==y?y:null===(g=j.item)||void 0===g?void 0:g.backgroundColor,borderColor:null!==(b=T.borderColor)&&void 0!==b?b:null===(x=j.item)||void 0===x?void 0:x.borderColor,borderRadius:null!==(w=T.borderRadius)&&void 0!==w?w:null===(k=j.item)||void 0===k?void 0:k.borderRadius,boxShadow:null!==(_=T.boxShadow)&&void 0!==_?_:null===(C=j.item)||void 0===C?void 0:C.boxShadow})}),R=function(e,t,r,n,o){var a,i,s=function(e){return e.map(function(e){return{field:e.field}})}(o);return"subjectCard"===e?{field:"listItem",renderCell:function(e){return lt(Srr,{params:e,cfgCols:n,columns:s,config:{backgroundColor:"#FFFFFF",borderColor:"#E5E7EB",borderRadius:1,avatarBgColor:"#E6F6FF",avatarTextColor:"#0047B2",textColor:"#111827",secondaryTextColor:"#6B7280"}})}}:"studyCard"===e?{field:"listItem",renderCell:function(e){var t,n,a,i,s,l;return lt(wrr,{params:e,borderRadius:null!==(n=null===(t=r.item)||void 0===t?void 0:t.borderRadius)&&void 0!==n?n:2,backgroundColor:null!==(i=null===(a=r.item)||void 0===a?void 0:a.backgroundColor)&&void 0!==i?i:"#FFFFFF",borderColor:null!==(l=null===(s=r.item)||void 0===s?void 0:s.borderColor)&&void 0!==l?l:"#E5E7EB",avatarBackgroundColor:"#E6F6FF",avatarTextColor:"#0047B2",stripeColor:"rgba(255, 174, 23, 0.25)",titleColor:"#111827",subtitleColor:"#6B7280",companyColor:"#111827",columns:o})}}:"custom"===e?Boolean((null==t?void 0:t.topLeft)||(null==t?void 0:t.topRight)||(null==t?void 0:t.bottomLeft)||(null==t?void 0:t.bottomRight)||(null==t?void 0:t.primary)||(null==t?void 0:t.secondary)||(null===(a=(null==t?void 0:t.meta)||[])||void 0===a?void 0:a.length)||(null===(i=(null==t?void 0:t.trailing)||[])||void 0===i?void 0:i.length))?{field:"listItem",renderCell:function(e){return lt(yrr,{params:e,areas:t,layout:{gap:r.gap,verticalGap:r.verticalGap,trailingDirection:r.trailingDirection,templateColumns:r.templateColumns,item:r.item}})}}:{field:"listItem",renderCell:function(e){return lt(Err,{params:e,columns:s})}}:"visitCard"===e?{field:"listItem",renderCell:function(e){return lt(Orr,{params:e,columns:s,layout:{item:r.item}})}}:"visitCardCheck"===e?{field:"listItem",renderCell:function(e){return lt(Err,{params:e,columns:s,layout:{item:r.item}})}}:"fourItems"===e?(n||[]).length>0?{field:"listItem",renderCell:function(e){return lt(brr,{params:e,cfgCols:n,columns:s,layout:{gap:r.gap,verticalGap:r.verticalGap,trailingDirection:r.trailingDirection,item:r.item}})}}:{field:"listItem",renderCell:function(e){return lt(Err,{params:e,columns:s})}}:"compact"===e||"mediaLeft"===e||"titleSubtitleMeta"===e||"twoColumn"===e?{field:"listItem",renderCell:function(e){return lt(Err,{params:e,columns:s,layout:{item:r.item}})}}:void 0}(D,E,N,S,r);return R||{field:"listItem",renderCell:function(e){var t,r,n,a,i,s=(null==e?void 0:e.row)||{},l=E.secondary?void 0:null!==(n=null!==(r=null!==(t=Trr(s,"email"))&&void 0!==t?t:Trr(s,"studyCode"))&&void 0!==r?r:Trr(s,"position"))&&void 0!==n?n:void 0,c=E.trailing&&E.trailing.length?void 0:null!==(i=null!==(a=Trr(s,"timeRange"))&&void 0!==a?a:Trr(s,"status"))&&void 0!==i?i:void 0;return ct("div",X({role:"listitem","aria-label":String([E.primary?Rrr(E.primary,s):void 0,E.secondary?Rrr(E.secondary,s):void 0].filter(Boolean).join(" — ")),style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:j.gap,width:"100%"}},{children:[ct("div",X({style:{minWidth:0,flex:1},"aria-label":"list-item-text"},{children:[E.primary?lt("div",X({style:{fontWeight:600,color:"#111827",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},{children:Nrr(o,E.primary,s)})):null,E.secondary||l?lt("div",X({style:{fontSize:12,color:"#6B7280",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},{children:E.secondary?"component"===E.secondary.kind?Nrr(o,E.secondary,s):Rrr(E.secondary,s):String(l)})):null,E.meta&&E.meta.length?lt("div",X({style:{marginTop:j.verticalGap,display:"inline-flex",gap:8,flexWrap:"wrap"},"aria-label":"list-item-meta"},{children:E.meta.map(function(e,t){return lt("span",X({style:{fontSize:11,color:"#374151",background:"#F3F4F6",borderRadius:10,padding:"2px 8px"}},{children:"component"===e.kind?Nrr(o,e,s):Rrr(e,s)}),t)})})):null]})),lt("div",X({"aria-label":"list-item-actions",style:"vertical"===j.trailingDirection?{display:"grid",justifyItems:"end",alignContent:"center",rowGap:8,height:"100%",flexShrink:0}:{display:"inline-flex",alignItems:"center",gap:8,flexShrink:0}},{children:E.trailing&&E.trailing.length||c?(E.trailing||[]).map(function(e,t){return lt("span",{children:"component"===e.kind?Nrr(o,e,s):Rrr(e,s)},"t-".concat(t))}).concat(E.trailing&&E.trailing.length?[]:c?[lt("span",X({style:{color:"#111827"}},{children:String(c)}),"fallback-trailing")]:[]):null}))]}))}}},[n,o,r])},zrr=function(e,t){var r=e[t];return r&&"object"==typeof r&&"value"in r?r.value:r},Irr=function(t){var r,o,a,i,s,l,c,u,d=(null===(r=null==t?void 0:t.organism)||void 0===r?void 0:r.id)||"",p=(null===(o=null==t?void 0:t.organism)||void 0===o?void 0:o.config)||{},h={columns:(null===(a=null==p?void 0:p.dataRetrievalConfig)||void 0===a?void 0:a.columns)||[],toolbar:(null==p?void 0:p.toolbar)||{}},f=(null==p?void 0:p.toolbar)||{},m=e.useState(""),v=m[0],y=m[1],g=e.useState(0),b=g[0],x=g[1],w=e.useState(25),k=w[0],_=w[1],C=e.useState({}),M=C[0],S=C[1],D=e.useState(null!==(l=null!==(s=null===(i=h.toolbar)||void 0===i?void 0:i.densityDefault)&&void 0!==s?s:null==f?void 0:f.densityDefault)&&void 0!==l?l:"comfortable"),O=D[0],P=D[1],E=e.useState(!1),j=E[0],T=E[1],N=rrr(d).rwoRecordId,R=function(t){var r,o,a,i,s,l=t.organismId,c=t.query,u=pqt().dataGrid,d=lqt().stateConfig,p=rrr(l).rwoRecordId,h=e.useMemo(function(){var e="data_grid:organism:".concat(l),t=null==d?void 0:d[e];return"number"==typeof t?t:0},[d,l]),f=e.useMemo(function(){return X(X({},c),{rwoRecordId:p||c.rwoRecordId})},[c,p]),m=n.useQuery({queryKey:[x$,l,f.page,f.pageSize,null!==(r=f.search)&&void 0!==r?r:"",JSON.stringify(null!==(o=f.quickFilters)&&void 0!==o?o:{}),null!==(a=f.rwoRecordId)&&void 0!==a?a:"",h],queryFn:function(){return Q(void 0,void 0,void 0,function(){var e,t,r;return J(this,function(n){switch(n.label){case 0:if(!u)throw new Error("DataGrid API not available");return[4,u.getOrganismData(l,f)];case 1:if(e=n.sent(),t=null==e?void 0:e.data,!(r=null==t?void 0:t.data)||"object"!=typeof r)throw new Error("Invalid data grid response");return[2,r]}})})},enabled:Boolean(u&&l),staleTime:6e4,gcTime:3e5}),v=m.data,y=m.isLoading,g=m.error,b=m.refetch;return{rows:null!==(i=null==v?void 0:v.rows)&&void 0!==i?i:[],total:null!==(s=null==v?void 0:v.total)&&void 0!==s?s:0,isLoading:y,error:g,refetch:b,refreshSignal:h}}({organismId:d,query:e.useMemo(function(){return X({page:b,pageSize:k,search:v,quickFilters:M},N?{rwoRecordId:N}:{})},[b,k,v,M,N])}),F=R.rows,z=R.total,I=R.isLoading,A=R.error,L=R.refetch,B=e.useMemo(function(){try{return(F||[]).some(function(e){return!orr(null==e?void 0:e.id)})}catch(e){return!1}},[F]),V=e.useMemo(function(){var e=Object.entries(M).flatMap(function(e){var t=e[0],r=e[1],n=Array.isArray(r)?r.filter(Boolean):[r].filter(Boolean);return 0===n.length?[]:[{field:t,operator:"isAnyOf",value:n}]});return{items:e,logicOperator:"and"}},[M]),H=h.toolbar&&Object.keys(h.toolbar).length?h.toolbar:f||{},q=!1!==(null==H?void 0:H.densityToggle),$=null!==(c=null==H?void 0:H.quickFilters)&&void 0!==c?c:[],W=!1!==(null==H?void 0:H.search),U=!1!==(null==H?void 0:H.exportCsv)&&!B,G=e.useMemo(function(){var e;return((null===(e=null==p?void 0:p.dataRetrievalConfig)||void 0===e?void 0:e.columns)||[]).map(function(e){return"".concat(("component"===e.kind?e.id:e.field)||"",":").concat(e.headerName||"",":").concat(e.width||"")}).join("|")},[p]),K=jtr(),Y=mat().isMobile,Z=(null===(u=null==p?void 0:p.view)||void 0===u?void 0:u.viewType)||"table",te="auto"===Z?Y?"list":"table":Z,re=function(t){var r,n=t.organism,o=t.density,a=t.onAction,i=t.apiRef,s=oqt().onInternalNavigation,l=mnt,c=(null==n?void 0:n.config)||{},u=(null===(r=null==c?void 0:c.dataRetrievalConfig)||void 0===r?void 0:r.columns)||[],d=e.useMemo(function(){return u.map(function(e){return"".concat(("component"===e.kind?e.id:e.field)||"",":").concat(e.headerName||"",":").concat(e.width||"")}).join("|")},[u]),p=e.useMemo(function(){return u.map(function(e){var t,r="component"===e.kind?"__component_".concat(e.id):e.field,n=null!==(t=frr["component"===e.kind?e.componentRenderer:e.renderer])&&void 0!==t?t:frr.DefaultTextCell,c="component"===e.kind&&"ActionButtonCell"===e.componentRenderer,u="component"===e.kind&&"PredefinedActions"===e.componentRenderer,d={field:r,headerName:e.headerName,width:e.width,sortable:Boolean(e.sortable),filterable:e.filterable,renderHeader:function(){return ct(nh,X({sx:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"}},{children:[ct(nh,X({sx:{display:"inline-flex",alignItems:"center",gap:.5}},{children:[e.titleIconName?lt(l,{iconName:e.titleIconName,size:14}):null,lt("span",{children:e.headerName})]})),e.filterable&&lt(yc,X({"aria-label":"open-filter-".concat(r),size:"small",onClick:function(e){var t,n;e.stopPropagation();try{null===(n=null===(t=i.current)||void 0===t?void 0:t.showFilterPanel)||void 0===n||n.call(t,r)}catch(e){}},sx:{ml:.5,color:"#9CA3AF","& svg":{display:"block"}}},{children:lt(l,{iconName:"filter",size:16})}))]}))},renderCell:function(t){var i,l,d,p=zrr(t.row,r);return lt(n,X({value:p,row:t.row},null!==(l=null!==(i=e.rendererProps)&&void 0!==i?i:e.componentProps)&&void 0!==l?l:{},c?{onClick:function(){return null==a?void 0:a({action:e.actionConfig,row:t.row})},disabled:!orr(zrr(t.row,"id"))}:{},u?{actions:null===(d=e.componentProps)||void 0===d?void 0:d.actions,size:"compact"===o?"small":"medium",disabled:!orr(zrr(t.row,"id")),onEdit:function(){var r,n,o,i,l,c,u,d,p,h,f,m,v,y=(null===(n=null===(r=e.componentProps)||void 0===r?void 0:r.actions)||void 0===n?void 0:n.idField)||"id",g=zrr(t.row,y),b="string"==typeof g?g:String(null!=g?g:""),x=(null===(o=e.rendererProps)||void 0===o?void 0:o.editLink)||(null===(u=null===(c=null===(l=null===(i=e.componentProps)||void 0===i?void 0:i.actions)||void 0===l?void 0:l.edit)||void 0===c?void 0:c.link)||void 0===u?void 0:u.internalLink);if(s&&x){var w=x,k=w.length>0&&!w.endsWith("/"),_=null===(h=null===(p=null===(d=e.componentProps)||void 0===d?void 0:d.actions)||void 0===p?void 0:p.edit)||void 0===h?void 0:h.targetFormId;if(_&&(w="".concat(w).concat(k?"/":"","organismId=").concat(encodeURIComponent(_))),b){var C=w.length>0&&!w.endsWith("/");w="".concat(w).concat(C?"/":"","rwoRecordId=").concat(encodeURIComponent(b))}var M={};return _&&(M.organismId=_),b&&(M.rwoRecordId=b),void s({link:w,query:M})}null==a||a({action:{type:"edit_record",targetFormId:null===(v=null===(m=null===(f=e.componentProps)||void 0===f?void 0:f.actions)||void 0===m?void 0:m.edit)||void 0===v?void 0:v.targetFormId,idField:y},row:t.row})},onView:function(){var r,n,o,i,l,c,u,d,p,h,f,m=(null===(n=null===(r=e.componentProps)||void 0===r?void 0:r.actions)||void 0===n?void 0:n.idField)||"id",v=zrr(t.row,m),y="string"==typeof v?v:String(null!=v?v:""),g=(null===(c=null===(l=null===(i=null===(o=e.componentProps)||void 0===o?void 0:o.actions)||void 0===i?void 0:i.view)||void 0===l?void 0:l.link)||void 0===c?void 0:c.internalLink)||(null===(p=null===(d=null===(u=e.componentProps)||void 0===u?void 0:u.actions)||void 0===d?void 0:d.view)||void 0===p?void 0:p.routeKey);if(s&&g){var b=g,x={},w=(null===(f=null===(h=e.componentProps)||void 0===h?void 0:h.actions)||void 0===f?void 0:f.view)||{},k=!1!==(null==w?void 0:w.includeRwoRecordId),_=Array.isArray(null==w?void 0:w.rwoContextMapping)?w.rwoContextMapping:[],C=S$({includeRwoRecordId:k,recordId:y||void 0,mapping:_,contextSource:t.row}).query;return Object.assign(x,C),y&&!x.rwoRecordId&&(x.rwoRecordId=y),void s({link:b,query:x})}null==a||a({action:{type:"view_record_details",routeKey:g||"",idField:m},row:t.row})},onDelete:function(){var r,n,o,i,s,l;return null==a?void 0:a({action:{type:"delete_record",apiKey:null!==(i=null===(o=null===(n=null===(r=e.componentProps)||void 0===r?void 0:r.actions)||void 0===n?void 0:n.delete)||void 0===o?void 0:o.apiKey)&&void 0!==i?i:"delete",idField:null===(l=null===(s=e.componentProps)||void 0===s?void 0:s.actions)||void 0===l?void 0:l.idField},row:t.row})}}:{}))}};return d})},[u,o,a,i,s,l]);return{columns:p,columnsKey:d}}({organism:t.organism,density:O,onAction:t.onAction,apiRef:K}),ne=function(t){var r,n=t.organism,o=t.density,a=t.onAction,i=(null==n?void 0:n.config)||{},s=(null===(r=null==i?void 0:i.dataRetrievalConfig)||void 0===r?void 0:r.columns)||[],l=e.useMemo(function(){return s.filter(function(e){return"component"!==e.kind}).map(function(e){var t;return{field:("component"===e.kind?e.id:e.field)||e.field||e.id,headerName:e.headerName||e.field||e.id,width:e.width||120,hide:!0,sortable:Boolean(e.sortable),filterable:Boolean(null===(t=e.filterable)||void 0===t||t)}})},[s]);return{hiddenColumns:l,listViewColumn:Frr({organism:n,density:o,onAction:a},l),columnsKey:e.useMemo(function(){return s.map(function(e){return"".concat(("component"===e.kind?e.id:e.field)||"",":").concat(e.headerName||"",":").concat(e.width||"")}).join("|")},[s])}}({organism:t.organism,density:O,onAction:t.onAction}),oe="table"===te?re.columns:ne.hiddenColumns;return{organismId:d,configuration:h,rows:F,total:z,isLoading:I,error:A,page:b,pageSize:k,search:v,quickFilters:M,density:O,showSearch:j,filterModel:V,densityToggle:q,quickFiltersCfg:$,showSearchControl:W,showExport:U,columnsKey:("table"===te?re.columnsKey:ne.columnsKey)||G,apiRef:K,columns:oe,listViewColumn:ne.listViewColumn,resolvedView:te,setPage:x,setPageSize:_,setSearch:y,setQuickFilter:function(e,t){S(function(r){var n=X({},r);if(""===t)return delete n[e],n;var o=n[e];if(Array.isArray(o))if(o.includes(t)){var a=o.filter(function(e){return e!==t});0===a.length?delete n[e]:n[e]=a}else n[e]=ee(ee([],o,!0),[t],!1);else o?o===t?delete n[e]:n[e]=[o,t]:n[e]=t;return n})},setDensity:P,setShowSearch:T,refetch:L}},Arr=function(e){var t=e.rows,r=e.total,n=e.isLoading,o=e.error,a=e.page,i=e.pageSize,s=e.density,l=e.filterModel,c=e.listViewColumn,u=e.hiddenColumns,d=e.columnsKey,p=e.apiRef,h=e.setPage,f=e.setPageSize,m=e.gridStyles;if(o)return null;var v=Number(null==m?void 0:m.rowHeight)||64,y=Number(null==m?void 0:m.rowGap),g=Number.isFinite(y)?y:8;return lt(Etr,{apiRef:p,rows:t.map(function(e,t){var r,n=(r=e["id"])&&"object"==typeof r&&null!==r&&"value"in r?r.value:r,o=null==n||""===n;return X(X({},e),{id:null!=n?n:"".concat(t),__unsafeRowId:o})}),columns:u,listView:!0,listViewColumn:c,filterModel:l,pagination:!0,paginationModel:{page:a,pageSize:i},onPaginationModelChange:function(e){h(e.page),f(e.pageSize)},density:s,loading:n,rowCount:r,paginationMode:"client",rowSelectionModel:{type:"include",ids:new Set},onRowSelectionModelChange:function(){},disableRowSelectionOnClick:!0,isRowSelectable:function(){return!1},onRowClick:function(e,t){t&&"object"==typeof t&&(t.defaultMuiPrevented=!0,"function"==typeof t.stopPropagation&&t.stopPropagation())},onCellClick:function(e,t){t&&"object"==typeof t&&(t.target.closest('[data-action-button="true"], [data-action-link="true"], button, [role="button"], .MuiButton-root, .MuiIconButton-root, a[href]')||(t.defaultMuiPrevented=!0,"function"==typeof t.stopPropagation&&t.stopPropagation()))},autoHeight:!1,getRowHeight:function(){return v},getRowSpacing:function(e){return{top:e.isFirstVisible?0:g,bottom:e.isLastVisible?0:g}},sx:X(X({},m),{border:"none","--DataGrid-rowBorderColor":"transparent","--DataGrid-rowHoverBackground":"transparent","--DataGrid-selectedRowBackground":"transparent","& .MuiDataGrid-withBorderColor":{borderColor:"transparent"},"& .MuiDataGrid-row":{borderBottom:"none",alignItems:"stretch"},"& .MuiDataGrid-row:hover":{backgroundColor:"transparent"},"& .MuiDataGrid-row.Mui-selected, & .MuiDataGrid-row.Mui-selected:hover":{backgroundColor:"transparent"},"& .MuiDataGrid-cell":{outline:"none"}}),slots:{noRowsOverlay:void 0},slotProps:{loadingOverlay:{variant:"linear-progress",noRowsVariant:"skeleton"}}},d)},Lrr=function(e){var t=e.rows,r=e.total,n=e.isLoading,o=e.error,a=e.page,i=e.pageSize,s=e.density,l=e.filterModel,c=e.columns,u=e.columnsKey,d=e.apiRef,p=e.setPage,h=e.setPageSize,f=e.gridStyles;return o?null:lt(Etr,{apiRef:d,rows:t.map(function(e,t){var r,n=(r=e["id"])&&"object"==typeof r&&null!==r&&"value"in r?r.value:r,o=null==n||""===n;return X(X({},e),{id:null!=n?n:"".concat(t),__unsafeRowId:o})}),columns:c,filterModel:l,pagination:!0,paginationModel:{page:a,pageSize:i},onPaginationModelChange:function(e){p(e.page),h(e.pageSize)},density:s,loading:n,rowCount:r,paginationMode:"client",disableRowSelectionOnClick:!0,autoHeight:!0,sx:f,slots:{noRowsOverlay:void 0},slotProps:{loadingOverlay:{variant:"linear-progress",noRowsVariant:"skeleton"}}},u)},Brr=function(e){var t,r,n,o,a,i=e.controlHeight,s=e.density,l=e.styles,c=e.setDensity,u=l||{};return lt(nh,X({sx:{background:null!==(t=u.backgroundColor)&&void 0!==t?t:"#F7F5FF",borderRadius:null!==(r=u.borderRadius)&&void 0!==r?r:3,px:1,py:.5,display:"inline-flex",alignItems:"center"}},{children:ct(Pk,X({size:"small",exclusive:!0,value:s,onChange:function(e,t){t&&c(t)},"aria-label":"table-density",sx:{"& .MuiToggleButton-root":{textTransform:"none",height:i,px:2,py:0,fontSize:14,lineHeight:1.2,borderRadius:"".concat(null!==(n=u.borderRadius)&&void 0!==n?n:10,"px"),border:"none",color:"#6B7280",background:"transparent"},"& .MuiToggleButton-root + .MuiToggleButton-root":{ml:1},"& .MuiToggleButton-root.Mui-selected":{fontWeight:700,color:null!==(o=u.selectedTextColor)&&void 0!==o?o:"#3F3F46",background:null!==(a=u.selectedBackgroundColor)&&void 0!==a?a:"#FFFFFF",border:"1px solid #E2E4EA",boxShadow:"0 2px 6px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06)"}}},{children:[lt(Ck,X({value:"compact","aria-label":"Compact"},{children:"Compact"})),lt(Ck,X({value:"comfortable","aria-label":"Comfortable"},{children:"Comfortable"}))]}))}))},Vrr=function(e){var t,r,n,o,a,i,s=e.controlHeight,l=e.styles,c=e.apiRef,u=mnt,d=l||{};return lt(yc,X({"aria-label":"export-csv",size:"small",onClick:function(){var e,t;return null===(t=null===(e=c.current)||void 0===e?void 0:e.exportDataAsCsv)||void 0===t?void 0:t.call(e)},sx:{display:"flex",alignItems:"center",justifyContent:"center",lineHeight:0,p:0,width:s,height:s,borderRadius:null!==(t=d.borderRadius)&&void 0!==t?t:2,background:null!==(r=d.backgroundColor)&&void 0!==r?r:"#FFFFFF",border:"1px solid ".concat(null!==(n=d.borderColor)&&void 0!==n?n:"#E2E4EA"),boxShadow:"0 2px 6px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04)",color:null!==(o=d.iconColor)&&void 0!==o?o:"#6C4CF5","& svg":{display:"block"},"&:hover":{background:null!==(a=d.backgroundColor)&&void 0!==a?a:"#FFFFFF",borderColor:null!==(i=d.borderColor)&&void 0!==i?i:"#D7DAE2",boxShadow:"0 3px 8px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.05)"}}},{children:lt(u,{iconName:"download",size:20})}))},Hrr=function(e){var t,r=e.controlHeight,n=e.quickFiltersCfg,o=e.quickFilters,a=e.styles,i=e.setQuickFilter,s=a||{};return n.length?lt(nh,X({sx:{minWidth:0,overflowX:"auto",pr:1,flexShrink:0}},{children:lt(nh,X({sx:{display:"inline-flex",alignItems:"center",gap:"".concat(null!==(t=s.chipGap)&&void 0!==t?t:8,"px"),px:"6px",py:"4px",borderRadius:"8px",background:"#FAFAFF",whiteSpace:"nowrap"}},{children:n.map(function(e){var t,n,a,l,c,u=o[e.columnField],d=Array.isArray(u)?u.includes(e.value):u===e.value,p=""===e.value,h=p&&(void 0===u||Array.isArray(u)&&0===u.length),f=e.color||s.chipBackgroundColor,m=s.selectedChipColor||f;return lt("button",X({"aria-label":e.label,"aria-pressed":p?h:d,onClick:function(){return i(e.columnField,e.value)},style:{height:r,padding:p?"0 14px":"0 12px",border:p||d||h?"1px solid ".concat(null!==(n=null!==(t=s.chipBorderColor)&&void 0!==t?t:f)&&void 0!==n?n:"#E5E7EB"):"none",borderRadius:p?null!==(a=s.chipBorderRadius)&&void 0!==a?a:10:d?null!==(l=s.chipBorderRadius)&&void 0!==l?l:10:0,background:p||d||h?d||h?null!=m?m:"#FFFFFF":null!=f?f:"#FFFFFF":"transparent",boxShadow:p&&h||!p&&d?"0 1px 2px rgba(0,0,0,0.06)":void 0,color:d?"#111827":null!==(c=s.chipTextColor)&&void 0!==c?c:"#6B7280",fontWeight:d||p&&h?700:500,fontSize:13,cursor:"pointer",transition:"transform 80ms ease, box-shadow 120ms ease"},onMouseDown:function(e){var t=e.currentTarget;t.style.transform="translateY(1px)",t.style.boxShadow=p?"0 0 0 rgba(0,0,0,0.0)":t.style.boxShadow||""},onMouseUp:function(e){e.currentTarget.style.transform="translateY(0)"}},{children:e.label}),e.label)})}))})):null},qrr=function(e){var t,r,n,o,a=e.controlHeight,i=e.searchWidth,s=e.search,l=e.showSearch,c=e.config,u=e.setSearch,d=e.setShowSearch,p=mnt,h=c||{};return lt(nh,X({sx:{width:l||Boolean(s)?"".concat(i,"px"):"".concat(a,"px"),transition:"width 250ms ease"}},{children:l||Boolean(s)?lt(fk,{"aria-label":"grid-search",size:"small",value:s,autoFocus:Boolean(h.autoFocus),onBlur:function(){s||d(!1)},onChange:function(e){return u(e.target.value)},placeholder:h.placeholder||"Search",fullWidth:!0,sx:{"& .MuiInputBase-root":{height:"".concat(a,"px"),borderRadius:h.borderRadius,background:h.backgroundColor},"& .MuiOutlinedInput-notchedOutline":{borderColor:h.borderColor},"& .MuiOutlinedInput-input":{py:0},"& .MuiInputAdornment-root svg":{transform:"translate(1px, 0.5px)"}},InputProps:{startAdornment:lt(Qm,X({position:"start"},{children:lt(p,{iconName:"search",size:16})}))}}):lt(nh,X({sx:{width:a,height:a}},{children:lt(yc,X({"aria-label":"open-search",size:"small",onClick:function(){return d(!0)},sx:{display:"grid",placeItems:"center",lineHeight:0,p:0,width:"100%",height:"100%",borderRadius:2,background:null!==(t=h.backgroundColor)&&void 0!==t?t:"#FFFFFF",border:"1px solid ".concat(null!==(r=h.borderColor)&&void 0!==r?r:"#E2E4EA"),boxShadow:"0 2px 6px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04)",color:"#6C4CF5","& svg":{display:"block",margin:0,transform:"translate(1px, 0.5px)"},"&:hover":{background:null!==(n=h.backgroundColor)&&void 0!==n?n:"#FFFFFF",borderColor:null!==(o=h.borderColor)&&void 0!==o?o:"#D7DAE2",boxShadow:"0 3px 8px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.05)"}}},{children:lt(p,{iconName:"search",size:20})}))}))}))},$rr=function(e){var t,r,n,o,a,i,s,l,c,u,d,p,h,f,m,v,y,g,b,x,w,k,_,C,M,S,D=e.cfgRoot,O=e.densityToggle,P=e.quickFiltersCfg,E=e.showSearchControl,j=e.showExport,T=e.search,N=e.showSearch,R=e.density,F=e.apiRef,z=e.quickFilters,I=e.setQuickFilter,A=e.setDensity,L=e.setSearch,B=e.setShowSearch,V=null!==(o=null===(n=null===(r=null===(t=null==D?void 0:D.props)||void 0===t?void 0:t.toolbarContainer)||void 0===r?void 0:r.sx)||void 0===n?void 0:n.controlHeight)&&void 0!==o?o:44,H=null!==(l=null===(s=null===(i=null===(a=null==D?void 0:D.props)||void 0===a?void 0:a.toolbarContainer)||void 0===i?void 0:i.sx)||void 0===s?void 0:s.searchWidth)&&void 0!==l?l:360,q=null!==(p=null===(d=null===(u=null===(c=null==D?void 0:D.props)||void 0===c?void 0:c.toolbarContainer)||void 0===u?void 0:u.sx)||void 0===d?void 0:d.marginTop)&&void 0!==p?p:1,$=null!==(v=null===(m=null===(f=null===(h=null==D?void 0:D.props)||void 0===h?void 0:h.toolbarContainer)||void 0===f?void 0:f.sx)||void 0===m?void 0:m.columnGap)&&void 0!==v?v:1,W=(null===(g=null===(y=null==D?void 0:D.props)||void 0===y?void 0:y.toolbarContainer)||void 0===g?void 0:g.sx)||{},U=(null===(x=null===(b=null==D?void 0:D.props)||void 0===b?void 0:b.quickFiltersGroup)||void 0===x?void 0:x.sx)||{},G=(null===(k=null===(w=null==D?void 0:D.props)||void 0===w?void 0:w.exportButton)||void 0===k?void 0:k.sx)||{},K=(null===(C=null===(_=null==D?void 0:D.props)||void 0===_?void 0:_.densityToggleContainer)||void 0===C?void 0:C.sx)||{},Y=(null===(M=null==D?void 0:D.toolbar)||void 0===M?void 0:M.searchControl)||{};return ct(nh,X({sx:{display:"grid",gridTemplateColumns:"auto 1fr auto",alignItems:"center",mt:q,columnGap:$}},{children:[lt(Hrr,{controlHeight:V,quickFiltersCfg:P,quickFilters:z,styles:U,setQuickFilter:I}),lt(nh,{}),ct(nh,X({sx:{display:"inline-flex",alignItems:"center",gap:null!==(S=W.gap)&&void 0!==S?S:1.5,flexShrink:0,justifySelf:"end",background:W.backgroundColor,border:W.borderColor?"1px solid ".concat(W.borderColor):void 0,borderRadius:W.borderRadius}},{children:[E&&lt(qrr,{controlHeight:V,searchWidth:H,search:T,showSearch:N,config:Y,setSearch:L,setShowSearch:B}),O&&lt(Brr,{controlHeight:V,density:R,styles:K,setDensity:A}),j&&lt(Vrr,{controlHeight:V,styles:G,apiRef:F})]}))]}))},Wrr=e.memo(function(e){var t,r,n,o,a,i,s=e.organism,l=e.onAction,c=e.errorState,u=Irr({organism:s,onAction:l}),d=u.rows,p=u.total,h=u.isLoading,f=u.error,m=u.page,v=u.pageSize,y=u.search,g=u.quickFilters,b=u.density,x=u.showSearch,w=u.filterModel,k=u.densityToggle,_=u.quickFiltersCfg,C=u.showSearchControl,M=u.showExport,S=u.columnsKey,D=u.setPage,O=u.setPageSize,P=u.setSearch,E=u.setQuickFilter,j=u.setDensity,T=u.setShowSearch,N=u.columns,R=u.listViewColumn,F=u.resolvedView,z=u.apiRef,I=(null==s?void 0:s.config)||{},A=(null===(r=null===(t=null==I?void 0:I.props)||void 0===t?void 0:t.rootContainer)||void 0===r?void 0:r.sx)||{},L=(null===(o=null===(n=null==I?void 0:I.props)||void 0===n?void 0:n.dataGridWrapper)||void 0===o?void 0:o.sx)||{},B=(null===(i=null===(a=null==I?void 0:I.props)||void 0===a?void 0:a.dataGrid)||void 0===i?void 0:i.sx)||{},V=N;return f?lt(st,{children:c?c(f):lt(Ic,X({color:"error"},{children:f.message}))}):lt(nh,X({sx:{background:null==A?void 0:A.backgroundColor,px:null==A?void 0:A.paddingX,py:null==A?void 0:A.paddingY,mx:null==A?void 0:A.marginX,my:null==A?void 0:A.marginY}},{children:ct(nh,X({sx:{background:L.backgroundColor,border:L.borderColor?"1px solid ".concat(L.borderColor):void 0,borderRadius:L.borderRadius,px:L.paddingX,py:L.paddingY,mx:L.marginX,my:L.marginY,boxShadow:L.boxShadow||("number"==typeof L.elevation&&L.elevation>0?"0 2px 6px rgba(0,0,0,0.06)":void 0)}},{children:[lt($rr,{cfgRoot:I,densityToggle:k,quickFiltersCfg:_,showSearchControl:C,showExport:M,search:y,showSearch:x,density:b,apiRef:z,quickFilters:g,setQuickFilter:E,setDensity:j,setSearch:P,setShowSearch:T}),lt(nh,X({mt:2},{children:"list"===F?lt(Arr,{rows:d,total:p,isLoading:h,error:f,page:m,pageSize:v,density:b,filterModel:w,listViewColumn:R,hiddenColumns:V,columnsKey:S,apiRef:z,setPage:D,setPageSize:O,gridStyles:X(X({minHeight:320},B),{background:null==B?void 0:B.backgroundColor,"& .MuiDataGrid-row:hover":{background:null==B?void 0:B.rowHoverColor}})}):lt(Lrr,{rows:d,total:p,isLoading:h,error:f,page:m,pageSize:v,density:b,filterModel:w,columns:V,columnsKey:S,apiRef:z,setPage:D,setPageSize:O,gridStyles:X(X({minHeight:320},B),{background:null==B?void 0:B.backgroundColor,"& .MuiDataGrid-columnHeaders":{background:null==B?void 0:B.headerBackgroundColor,"& .MuiDataGrid-columnHeaderTitle":{fontSize:null==B?void 0:B.headerFontSize}},"& .MuiDataGrid-row:hover":{background:null==B?void 0:B.rowHoverColor}})})}))]}))}))});Wrr.displayName="DataGridOrganism";var Urr=function(t,r,o){var a,i,s=pqt().calendar,l=e.useMemo(function(){return r?r.toISOString():void 0},[r]),c=e.useMemo(function(){return o?o.toISOString():void 0},[o]),u=n.useQuery({queryKey:[b$,t,null!=l?l:"",null!=c?c:""],queryFn:function(){return Q(void 0,void 0,void 0,function(){var e,n,a,i,l;return J(this,function(c){switch(c.label){case 0:if(!s)throw new Error("Calendar API not available");return[4,s.getOrganismData(t,{start:null!=r?r:new Date("1970-01-01"),end:null!=o?o:new Date("2100-12-31")})];case 1:if(e=c.sent(),n=null==e?void 0:e.data,!(a=null==n?void 0:n.data))throw new Error("Invalid calendar data response");return[2,{events:null!==(i=a.events)&&void 0!==i?i:[],resources:null!==(l=a.resources)&&void 0!==l?l:[]}]}})})},enabled:Boolean(s&&t),staleTime:3e5,gcTime:6e5}),d=u.data,p=u.isLoading,h=u.error,f=u.refetch;return{events:null!==(a=null==d?void 0:d.events)&&void 0!==a?a:[],resources:null!==(i=null==d?void 0:d.resources)&&void 0!==i?i:[],isLoading:p,error:h,refetch:f}},Grr=function(e){var t,r,n=null===(r=null===(t=null==e?void 0:e.row)||void 0===t?void 0:t.__rangesInfo)||void 0===r?void 0:r[String(null==e?void 0:e.field)];if(!n||!n.active)return null;var o=n.color||"#E8F5E9",a=0;switch(n.part){case"single":a=12;break;case"start":a="12px 0 0 12px";break;case"end":a="0 12px 12px 0";break;default:a=0}return lt("div",{title:n.title,"aria-label":n.title||"time-off",style:{width:"100%",height:"66%",margin:"auto 0",backgroundColor:o,borderRadius:a}})},Krr=function(e){var t,r=e.value,n=e.row,o=String(null!==(t=null!=r?r:null==n?void 0:n.name)&&void 0!==t?t:""),a=(null==n?void 0:n.subtitle)||void 0,i=(null==n?void 0:n.avatarUrl)||void 0,s=o.split(" ").map(function(e){return e[0]}).filter(Boolean).slice(0,2).join("").toUpperCase();return ct(nh,X({sx:{display:"flex",alignItems:"center",gap:1}},{children:[lt(zp,X({src:i,sx:{width:28,height:28,fontSize:12}},{children:s})),ct(nh,X({sx:{minWidth:0}},{children:[lt(Ic,X({variant:"body2",sx:{fontWeight:600,lineHeight:1.1},noWrap:!0},{children:o})),a&&lt(Ic,X({variant:"caption",sx:{color:"text.secondary"},noWrap:!0},{children:a}))]}))]}))},Yrr=e.memo(function(t){var r,n,o,a,i,s,l,c,u,d,p,h,f,m,v,y,g,b,x,w,k,_,C,M,S,D,O,P,E,j,T,N,R,F,z,I,A,L,B,V,H,q,$,W,U,G,K,Y,Z,Q,J,te,re,ne,oe,ae,ie,se,le,ce,ue,de=t.organism,pe=t.onAction,he=t.errorState,fe=function(t){var r,n,o,a,i,s,l,c=t.organism;t.onAction;var u=(null==c?void 0:c.id)||"",d=(null==c?void 0:c.config)||{},p=(null===(r=null==d?void 0:d.display)||void 0===r?void 0:r.timeline)||{startDate:(new Date).toISOString(),endDate:(new Date).toISOString(),granularity:"day",groupByMonth:!0,dayColumnWidth:40},h=e.useMemo(function(){return Uq($nt(p.startDate))},[p.startDate]),f=e.useState(h),m=f[0],v=f[1],y=e.useMemo(function(){return Uq(m)},[m]),g=e.useMemo(function(){return Gq(m)},[m]),b=e.useMemo(function(){return $H(m,"MMMM yyyy")},[m]),x=Urr(u,y,g),w=x.events,k=x.resources,_=x.isLoading,C=x.error,M=x.refetch,S=e.useState(""),D=S[0],O=S[1],P=e.useState(0),E=P[0],j=P[1],T=e.useState(25),N=T[0],R=T[1],F=e.useState({}),z=F[0],I=F[1],A=e.useState(null!==(o=null===(n=null==d?void 0:d.toolbar)||void 0===n?void 0:n.densityDefault)&&void 0!==o?o:"comfortable"),L=A[0],B=A[1],V=e.useState(!1),H=V[0],q=V[1],$=e.useMemo(function(){var e,t=null!==(e=p.dayColumnWidth)&&void 0!==e?e:36;return"comfortable"===L?t+12:t},[p.dayColumnWidth,L]),W=e.useMemo(function(){return qnt({start:y,end:g}).map(function(e){var t=$H(e,"yyyy-MM-dd"),r=$H(e,"EEE"),n=$H(e,"d"),o={field:t,headerName:n,width:$,sortable:!1,filterable:!1,resizable:!1,align:"center",renderCell:function(e){var t;if("__ooo__"===String(e.id)){var r=Number(null!==(t=e.value)&&void 0!==t?t:0);return lt("div",X({style:{display:"grid",placeItems:"center",width:"100%"}},{children:lt("span",X({style:{fontSize:12,color:"#6B7280"}},{children:r}))}))}return lt(Grr,X({},e))},renderHeader:function(){return ct("div",X({style:{display:"grid",placeItems:"center",lineHeight:1.05}},{children:[lt("div",X({style:{fontSize:11,color:"#6B7280"}},{children:r})),lt("div",X({style:{fontSize:13,fontWeight:600}},{children:n}))]}))},cellClassName:"CalDg--dayCell"};return o})},[y,g,$]),U=e.useMemo(function(){if(!p.groupByMonth)return[];var e=qnt({start:y,end:g}),t=[],r=null;return e.forEach(function(e){var n=$H(e,"yyyy-MM"),o=$H(e,"MMMM yyyy"),a=$H(e,"yyyy-MM-dd");r&&r.groupId===n||(r={groupId:n,headerName:o,children:[]},t.push(r)),r.children.push({field:a})}),t},[p.groupByMonth,y,g]),G=e.useMemo(function(){var e=z.status;if(e&&(!Array.isArray(e)||0!==e.length))return new Set(Array.isArray(e)?e:[e])},[z]),K=e.useMemo(function(){var e=qnt({start:y,end:g}).map(function(e){return $H(e,"yyyy-MM-dd")}),t={},r={},n=function(e){return e instanceof Date?e.toISOString():String(null!=e?e:"")};w.forEach(function(o){var a,i,s,l=String(null!==(a=o.resourceId)&&void 0!==a?a:"");if(l){var c=new Date(n(null!==(i=o.start)&&void 0!==i?i:o.startDate)),u=new Date(n(null!==(s=o.end)&&void 0!==s?s:o.endDate));if(!Number.isNaN(c.getTime())&&!Number.isNaN(u.getTime())){var d=(null==o?void 0:o.status)?String(o.status):void 0;if(!G||!d||G.has(d)){var p=qnt({start:c,end:u}).map(function(e){return $H(e,"yyyy-MM-dd")}).filter(function(t){return e.includes(t)});t[l]=t[l]||new Set,r[l]=r[l]||{},p.forEach(function(e,n){var a;t[l].add(e);var i=1===p.length?"single":0===n?"start":n===p.length-1?"end":"middle";r[l][e]={active:!0,part:i,color:null==o?void 0:o.color,title:String(null!==(a=null==o?void 0:o.title)&&void 0!==a?a:"Time off"),status:d}})}}}});var o=k.map(function(n,o){var a,i,s=String(null!==(a=n.id)&&void 0!==a?a:o),l=String(null!==(i=n.name)&&void 0!==i?i:""),c=t[s]||new Set,u=r[s]||{},d={id:s,name:l,__busyDays:c,__rangesInfo:u};return e.forEach(function(e){d[e]=c.has(e)?1:0}),d});return o},[k,w,y,g,G]),Y=e.useMemo(function(){return{field:"name",headerName:"Employees",width:220,pinned:"left",sortable:!1,filterable:!1,resizable:!1,renderCell:function(e){return lt(Krr,{value:e.value,row:e.row})}}},[]),Z=e.useMemo(function(){return ee([Y],W,!0)},[Y,W]),Q=e.useMemo(function(){var e=Object.entries(z).flatMap(function(e){var t=e[0],r=e[1],n=Array.isArray(r)?r.filter(Boolean):[r].filter(Boolean);return 0===n.length?[]:[{field:t,operator:"isAnyOf",value:n}]});return{items:e,logicOperator:"and"}},[z]),J=jtr(),te=e.useMemo(function(){return Z.map(function(e){var t;return"".concat(e.field,":").concat(null!==(t=e.width)&&void 0!==t?t:"")}).join("|")},[Z]),re=(null===(a=null==d?void 0:d.toolbar)||void 0===a?void 0:a.quickFilters)||[],ne=!1!==(null===(i=null==d?void 0:d.toolbar)||void 0===i?void 0:i.search),oe=!1!==(null===(s=null==d?void 0:d.toolbar)||void 0===s?void 0:s.densityToggle),ae=!1!==(null===(l=null==d?void 0:d.toolbar)||void 0===l?void 0:l.exportCsv),ie=$H(new Date,"yyyy-MM-dd"),se=e.useMemo(function(){var e=qnt({start:y,end:g}).map(function(e){return $H(e,"yyyy-MM-dd")}),t={};K.forEach(function(r){var n=r.__busyDays;e.forEach(function(e){var r,o;(null===(r=null==n?void 0:n.has)||void 0===r?void 0:r.call(n,e))&&(t[e]=(null!==(o=t[e])&&void 0!==o?o:0)+1)})});var r={id:"__ooo__",name:"Out of office:"};return e.forEach(function(e){var n;r[e]=null!==(n=t[e])&&void 0!==n?n:0}),[r]},[K,y,g]);return{rows:K,total:K.length,isLoading:_,error:C,currentMonth:m,page:E,pageSize:N,search:D,quickFilters:z,density:L,showSearch:H,filterModel:Q,densityToggle:oe,quickFiltersCfg:re,showSearchControl:ne,showExport:ae,columnsKey:te,apiRef:J,columns:Z,columnGroupingModel:U,monthLabel:b,getCellClassName:function(e){return String(e.field)===ie?"CalDg--today":""},pinnedTop:se,setPage:j,setPageSize:R,setSearch:O,setQuickFilter:function(e,t){I(function(r){var n=X({},r);if(""===t)return delete n[e],n;var o=n[e];if(Array.isArray(o))if(o.includes(t)){var a=o.filter(function(e){return e!==t});0===a.length?delete n[e]:n[e]=a}else n[e]=ee(ee([],o,!0),[t],!1);else o?o===t?delete n[e]:n[e]=[o,t]:n[e]=t;return n})},setDensity:B,setShowSearch:q,refetch:M,goPrevMonth:function(){return v(function(e){return UV(e,-1)})},goNextMonth:function(){return v(function(e){return UV(e,1)})},goToday:function(){return v(Uq(new Date))},goToMonth:function(e){return v(Uq(e))}}}({organism:de,onAction:pe}),me=fe.rows,ve=fe.total,ye=fe.isLoading,ge=fe.error,be=fe.page,xe=fe.pageSize,we=fe.search,ke=fe.quickFilters,_e=fe.density,Ce=fe.showSearch,Me=fe.filterModel,Se=fe.densityToggle,De=fe.quickFiltersCfg,Oe=fe.showSearchControl,Pe=fe.showExport,Ee=fe.columnsKey,je=fe.apiRef,Te=fe.columns,Ne=fe.columnGroupingModel,Re=fe.monthLabel,Fe=fe.getCellClassName,ze=fe.pinnedTop,Ie=fe.setPage,Ae=fe.setPageSize,Le=fe.setSearch,Be=fe.setQuickFilter,Ve=fe.setDensity,He=fe.setShowSearch,qe=fe.goPrevMonth,$e=fe.goNextMonth,We=fe.goToday,Ue=fe.goToMonth,Ge=fe.currentMonth,Ke=mnt,Ye=(null==de?void 0:de.config)||{},Xe=null!==(a=null===(o=null===(n=null===(r=null==Ye?void 0:Ye.props)||void 0===r?void 0:r.toolbarContainer)||void 0===n?void 0:n.sx)||void 0===o?void 0:o.controlHeight)&&void 0!==a?a:44,Ze=null!==(c=null===(l=null===(s=null===(i=null==Ye?void 0:Ye.props)||void 0===i?void 0:i.toolbarContainer)||void 0===s?void 0:s.sx)||void 0===l?void 0:l.searchWidth)&&void 0!==c?c:360,Qe=null!==(h=null===(p=null===(d=null===(u=null==Ye?void 0:Ye.props)||void 0===u?void 0:u.toolbarContainer)||void 0===d?void 0:d.sx)||void 0===p?void 0:p.marginTop)&&void 0!==h?h:1,Je=null!==(y=null===(v=null===(m=null===(f=null==Ye?void 0:Ye.props)||void 0===f?void 0:f.toolbarContainer)||void 0===m?void 0:m.sx)||void 0===v?void 0:v.columnGap)&&void 0!==y?y:1,et=(null===(b=null===(g=null==Ye?void 0:Ye.props)||void 0===g?void 0:g.toolbarContainer)||void 0===b?void 0:b.sx)||{},tt=(null===(w=null===(x=null==Ye?void 0:Ye.props)||void 0===x?void 0:x.quickFiltersGroup)||void 0===w?void 0:w.sx)||{},rt=(null===(_=null===(k=null==Ye?void 0:Ye.props)||void 0===k?void 0:k.exportButton)||void 0===_?void 0:_.sx)||{},nt=(null===(M=null===(C=null==Ye?void 0:Ye.props)||void 0===C?void 0:C.densityToggleContainer)||void 0===M?void 0:M.sx)||{},ot=(null===(D=null===(S=null==Ye?void 0:Ye.props)||void 0===S?void 0:S.dataGridWrapper)||void 0===D?void 0:D.sx)||{},at=(null===(O=null==Ye?void 0:Ye.toolbar)||void 0===O?void 0:O.searchControl)||{},it=Te.map(function(e){return X(X({},e),{resizable:!1})}),ut=e.useState(!1),dt=ut[0],pt=ut[1],ht=e.useState(null),ft=ht[0],mt=ht[1],vt={textTransform:"none",height:Xe,lineHeight:1.2,borderRadius:2,px:1.75,py:0,background:"#FFFFFF",border:"1px solid #E2E4EA",boxShadow:"0 2px 6px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04)","&:hover":{background:"#FFFFFF",borderColor:"#D7DAE2",boxShadow:"0 3px 8px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.05)"}},yt={lineHeight:0,p:0,width:Xe,height:Xe,borderRadius:2,background:"#FFFFFF",border:"1px solid #E2E4EA",boxShadow:"0 2px 6px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04)","&:hover":{background:"#FFFFFF",borderColor:"#D7DAE2",boxShadow:"0 3px 8px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.05)"}};return ge?lt(st,{children:he?he(ge):lt(Ic,X({color:"error"},{children:ge.message}))}):ct(nh,{children:[ct(nh,X({sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mt:1}},{children:[lt(Ic,X({variant:"h6",sx:{fontWeight:700}},{children:(null==de?void 0:de.name)||"Time Off Calendar"})),Se&&lt(nh,X({sx:{background:null!==(P=nt.backgroundColor)&&void 0!==P?P:"#F7F5FF",borderRadius:null!==(E=nt.borderRadius)&&void 0!==E?E:3,px:1,py:.5,display:"inline-flex",alignItems:"center"}},{children:ct(Pk,X({size:"small",exclusive:!0,value:_e,onChange:function(e,t){t&&Ve(t)},"aria-label":"table-density",sx:{"& .MuiToggleButton-root":{textTransform:"none",height:Xe,px:2,py:0,fontSize:14,lineHeight:1.2,borderRadius:"".concat(null!==(j=nt.borderRadius)&&void 0!==j?j:10,"px"),border:"none",color:"#6B7280",background:"transparent"},"& .MuiToggleButton-root + .MuiToggleButton-root":{ml:1},"& .MuiToggleButton-root.Mui-selected":{fontWeight:700,color:null!==(T=nt.selectedTextColor)&&void 0!==T?T:"#3F3F46",background:null!==(N=nt.selectedBackgroundColor)&&void 0!==N?N:"#FFFFFF",border:"1px solid #E2E4EA",boxShadow:"0 2px 6px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06)"}}},{children:[lt(Ck,X({value:"compact","aria-label":"Compact"},{children:"Compact"})),lt(Ck,X({value:"comfortable","aria-label":"Comfortable"},{children:"Comfortable"}))]}))}))]})),ct(nh,X({sx:{display:"grid",gridTemplateColumns:"auto 1fr auto",alignItems:"center",mt:Qe,columnGap:Je}},{children:[lt(nh,X({sx:{minWidth:0,overflowX:"auto",pr:1,flexShrink:0}},{children:De.length>0&&lt(nh,X({sx:{display:"inline-flex",alignItems:"center",gap:"".concat(null!==(R=tt.chipGap)&&void 0!==R?R:8,"px"),px:"6px",py:"4px",borderRadius:"8px",background:"#FAFAFF",whiteSpace:"nowrap"}},{children:De.map(function(e){var t,r,n,o,a=ke[e.columnField],i=Array.isArray(a)?a.includes(e.value):a===e.value,s=""===e.value,l=s&&(void 0===a||Array.isArray(a)&&0===a.length),c=(null==e?void 0:e.color)||tt.chipBackgroundColor,u=tt.selectedChipColor||c;return ct("button",X({"aria-label":e.label,"aria-pressed":s?l:i,onClick:function(){return Be(e.columnField,e.value)},style:{height:Xe,padding:s?"0 14px":"0 12px",border:s||i||l?"1px solid ".concat(null!==(r=null!==(t=tt.chipBorderColor)&&void 0!==t?t:c)&&void 0!==r?r:"#E2E4EA"):"none",borderRadius:null!==(n=tt.chipBorderRadius)&&void 0!==n?n:10,background:s||i||l?i||l?null!=u?u:"#FFFFFF":null!=c?c:"#FFFFFF":"transparent",boxShadow:s&&l||!s&&i?"0 1px 2px rgba(0,0,0,0.06)":void 0,color:i?"#111827":null!==(o=tt.chipTextColor)&&void 0!==o?o:"#6B7280",fontWeight:i||s&&l?700:500,fontSize:13,cursor:"pointer",transition:"transform 80ms ease, box-shadow 120ms ease",display:"inline-flex",alignItems:"center",gap:8},onMouseDown:function(e){var t=e.currentTarget;t.style.transform="translateY(1px)",t.style.boxShadow=s?"0 0 0 rgba(0,0,0,0.0)":t.style.boxShadow},onMouseUp:function(e){e.currentTarget.style.transform="translateY(0)"}},{children:[lt(Ke,{iconName:"check",size:16}),e.label]}),e.label)})}))})),lt(nh,X({sx:{display:"flex",alignItems:"center",justifyContent:"center"}},{children:ct(nh,X({sx:{display:"inline-flex",alignItems:"center",gap:1,px:1}},{children:[lt(yh,X({"aria-label":"today",size:"small",variant:"text",onClick:We,sx:vt},{children:"Today"})),lt(yc,X({"aria-label":"prev-month",size:"small",onClick:qe,sx:yt},{children:lt(Ke,{iconName:"chevron-left",size:16})})),lt(yh,X({"aria-label":"open-month-picker",size:"small",variant:"text",onClick:function(e){mt(e.currentTarget),pt(!0)},sx:vt},{children:lt(Ic,X({variant:"body2",sx:{fontWeight:600}},{children:Re.split(" ")[0]}))})),lt(yc,X({"aria-label":"next-month",size:"small",onClick:$e,sx:yt},{children:lt(Ke,{iconName:"chevron-right",size:16})}))]}))})),ct(nh,X({sx:{display:"inline-flex",alignItems:"center",gap:null!==(F=et.gap)&&void 0!==F?F:1.5,flexShrink:0,justifySelf:"end",background:et.backgroundColor,border:et.borderColor?"1px solid ".concat(et.borderColor):void 0,borderRadius:et.borderRadius}},{children:[Oe&&lt(nh,X({sx:{width:Ce||Boolean(we)?"".concat(Ze,"px"):"".concat(Xe,"px"),transition:"width 250ms ease"}},{children:Ce||Boolean(we)?lt(fk,{"aria-label":"grid-search",size:"small",value:we,autoFocus:Boolean(at.autoFocus),onBlur:function(){we||He(!1)},onChange:function(e){return Le(e.target.value)},placeholder:at.placeholder||"Search",fullWidth:!0,sx:{"& .MuiInputBase-root":{height:"".concat(Xe,"px"),borderRadius:at.borderRadius,background:at.backgroundColor},"& .MuiOutlinedInput-notchedOutline":{borderColor:at.borderColor},"& .MuiOutlinedInput-input":{py:0},"& .MuiInputAdornment-root svg":{transform:"translate(1px, 0.5px)"}},InputProps:{startAdornment:lt(Qm,X({position:"start"},{children:lt(Ke,{iconName:"search",size:16})}))}}):lt(nh,X({sx:{width:Xe,height:Xe}},{children:lt(yc,X({"aria-label":"open-search",size:"small",onClick:function(){return He(!0)},sx:{display:"grid",placeItems:"center",lineHeight:0,p:0,width:"100%",height:"100%",borderRadius:2,background:null!==(z=at.backgroundColor)&&void 0!==z?z:"#FFFFFF",border:"1px solid ".concat(null!==(I=at.borderColor)&&void 0!==I?I:"#E2E4EA"),boxShadow:"0 2px 6px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04)",color:"#6C4CF5","& svg":{display:"block",margin:0,transform:"translate(1px, 0.5px)"},"&:hover":{background:null!==(A=at.backgroundColor)&&void 0!==A?A:"#FFFFFF",borderColor:null!==(L=at.borderColor)&&void 0!==L?L:"#D7DAE2",boxShadow:"0 3px 8px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.05)"}}},{children:lt(Ke,{iconName:"search",size:20})}))}))})),Pe&&lt(yc,X({"aria-label":"export-csv",size:"small",onClick:function(){var e,t;return null===(t=null===(e=je.current)||void 0===e?void 0:e.exportDataAsCsv)||void 0===t?void 0:t.call(e)},sx:{display:"flex",alignItems:"center",justifyContent:"center",lineHeight:0,p:0,width:Xe,height:Xe,borderRadius:null!==(B=rt.borderRadius)&&void 0!==B?B:2,background:null!==(V=rt.backgroundColor)&&void 0!==V?V:"#FFFFFF",border:"1px solid ".concat(null!==(H=rt.borderColor)&&void 0!==H?H:"#E2E4EA"),boxShadow:"0 2px 6px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04)",color:null!==(q=rt.iconColor)&&void 0!==q?q:"#6C4CF5","& svg":{display:"block"},"&:hover":{background:null!==($=rt.backgroundColor)&&void 0!==$?$:"#FFFFFF",borderColor:null!==(W=rt.borderColor)&&void 0!==W?W:"#D7DAE2",boxShadow:"0 3px 8px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.05)"}}},{children:lt(Ke,{iconName:"download",size:20})}))]}))]})),ct(fy,X({open:dt,anchorEl:ft,onClose:function(){return pt(!1)},anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"}},{children:[lt(nh,X({sx:{p:2,pb:0}},{children:lt(Ic,X({variant:"h6",sx:{fontWeight:700,mb:1}},{children:Re}))})),lt(nh,X({sx:{p:1,pt:.5,display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:.5}},{children:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"].map(function(e,t){return lt("button",X({style:{padding:"8px 10px",borderRadius:10,border:"1px solid #E2E4EA",background:t===Ge.getMonth()?"#F3F0FF":"#FFFFFF",cursor:"pointer"},"aria-current":t===Ge.getMonth()?"date":void 0,onClick:function(){var e=new Date(Ge);e.setMonth(t),Ue(e),pt(!1)}},{children:lt("span",X({style:{fontWeight:t===Ge.getMonth()?700:500,color:t===Ge.getMonth()?"#6C4CF5":"#3F3F46"}},{children:e}))}),e)})}))]})),lt(nh,X({mt:2,sx:{background:ot.backgroundColor,border:ot.borderColor?"1px solid ".concat(ot.borderColor):void 0,borderRadius:ot.borderRadius,px:ot.paddingX,py:ot.paddingY,boxShadow:"number"==typeof ot.elevation&&ot.elevation>0?"0 2px 6px rgba(0,0,0,0.06)":void 0}},{children:lt(Etr,{apiRef:je,rows:me.map(function(e,t){var r,n=null==(null==e?void 0:e.id)||""===(null==e?void 0:e.id);return X(X({},e),{id:null!==(r=e.id)&&void 0!==r?r:"".concat(t),__unsafeRowId:n})}),columns:it,filterModel:Me,columnGroupingModel:Ne,getCellClassName:Fe,pinnedRows:{top:ze},pinnedColumns:{left:["name"]},pagination:!0,paginationModel:{page:be,pageSize:xe},onPaginationModelChange:function(e){Ie(e.page),Ae(e.pageSize)},density:"standard",loading:ye,rowCount:ve,paginationMode:"client",disableRowSelectionOnClick:!0,autoHeight:!0,rowHeight:null!==(Y=null===(K=null===(G=null===(U=null==Ye?void 0:Ye.props)||void 0===U?void 0:U.dataGrid)||void 0===G?void 0:G.sx)||void 0===K?void 0:K.rowHeight)&&void 0!==Y?Y:36,disableColumnMenu:!0,disableColumnSelector:!0,isCellEditable:function(){return!1},checkboxSelection:!1,sx:{minHeight:320,background:null===(J=null===(Q=null===(Z=null==Ye?void 0:Ye.props)||void 0===Z?void 0:Z.dataGrid)||void 0===Q?void 0:Q.sx)||void 0===J?void 0:J.backgroundColor,"& .MuiDataGrid-columnHeaders":{background:null===(ne=null===(re=null===(te=null==Ye?void 0:Ye.props)||void 0===te?void 0:te.dataGrid)||void 0===re?void 0:re.sx)||void 0===ne?void 0:ne.headerBackgroundColor,"& .MuiDataGrid-columnHeaderTitle":{fontSize:null===(ie=null===(ae=null===(oe=null==Ye?void 0:Ye.props)||void 0===oe?void 0:oe.dataGrid)||void 0===ae?void 0:ae.sx)||void 0===ie?void 0:ie.headerFontSize}},"& .MuiDataGrid-cell":{py:0,px:0},"& .CalDg--dayCell":{padding:0},"& .MuiDataGrid-row:hover":{background:null!==(ue=null===(ce=null===(le=null===(se=null==Ye?void 0:Ye.props)||void 0===se?void 0:se.dataGrid)||void 0===le?void 0:le.sx)||void 0===ce?void 0:ce.rowHoverColor)&&void 0!==ue?ue:"rgba(0,0,0,0.03)"},"& .CalDg--today":{background:"rgba(108, 76, 245, 0.06)"},"& .MuiDataGrid-cell:focus, & .MuiDataGrid-cell:focus-within":{outline:"none"}},slotProps:{loadingOverlay:{variant:"linear-progress",noRowsVariant:"skeleton"}}},Ee)}))]})});Yrr.displayName="CalendarDataGridOrganism";var Xrr={id:"eventBindings",tool:"calendarDataRetrieval",titleKey:"config.calendar.group.eventBindings",collapsible:!0,initiallyExpanded:!0,pathBase:"dataRetrievalConfig.bindings.event",toolConfig:{targets:[{captureName:"id",labelKey:"config.calendar.bindings.event.id"},{captureName:"title",labelKey:"config.calendar.bindings.event.title"},{captureName:"description",labelKey:"config.calendar.bindings.event.description"},{captureName:"startDate",labelKey:"config.calendar.bindings.event.startDate"},{captureName:"endDate",labelKey:"config.calendar.bindings.event.endDate"},{captureName:"startTime",labelKey:"config.calendar.bindings.event.startTime"},{captureName:"endTime",labelKey:"config.calendar.bindings.event.endTime"},{captureName:"status",labelKey:"config.calendar.bindings.event.status"},{captureName:"eventType",labelKey:"config.calendar.bindings.event.eventType"},{captureName:"resourceId",labelKey:"config.calendar.bindings.event.resourceId"},{captureName:"resourceName",labelKey:"config.calendar.bindings.event.resourceName"},{captureName:"visibility",labelKey:"config.calendar.bindings.event.visibility"},{captureName:"color",labelKey:"config.calendar.bindings.event.color"},{captureName:"isRepeating",labelKey:"config.calendar.bindings.event.isRepeating"},{captureName:"isRepeatingInterval",labelKey:"config.calendar.bindings.event.isRepeatingInterval"},{captureName:"isRepeatingExcludedDates",labelKey:"config.calendar.bindings.event.isRepeatingExcludedDates"},{captureName:"associatedEntityType",labelKey:"config.calendar.bindings.event.associatedEntityType"},{captureName:"associatedEntityId",labelKey:"config.calendar.bindings.event.associatedEntityId"},{captureName:"conferencingLink",labelKey:"config.calendar.bindings.event.conferencingLink"},{captureName:"meta[$index].token",labelKey:"config.calendar.bindings.event.meta.token"},{captureName:"meta[$index].dataFieldId",labelKey:"config.calendar.bindings.event.meta.fieldId"}]}},Zrr={id:"resourceBindings",tool:"calendarDataRetrieval",titleKey:"config.calendar.group.resourceBindings",collapsible:!0,initiallyExpanded:!1,pathBase:"dataRetrievalConfig.bindings.resource",toolConfig:{targets:[{captureName:"id",labelKey:"config.calendar.bindings.resource.id"},{captureName:"name",labelKey:"config.calendar.bindings.resource.name"},{captureName:"accentClass",labelKey:"config.calendar.bindings.resource.accentClass"},{captureName:"color",labelKey:"config.calendar.bindings.resource.color"},{captureName:"meta[$index].token",labelKey:"config.calendar.bindings.resource.meta.token"},{captureName:"meta[$index].dataFieldId",labelKey:"config.calendar.bindings.resource.meta.fieldId"}]}},Qrr={component:"CalendarDataGridOrganism",version:"1.0.0",toolGroups:[Xrr,Zrr,{id:"timeline",tool:"custom",titleKey:"config.calendarDataGrid.group.timeline",collapsible:!0,initiallyExpanded:!0,pathBase:"display.timeline",fields:[{type:"text",captureName:"startDate",labelKey:"config.calendarDataGrid.timeline.startDate"},{type:"text",captureName:"endDate",labelKey:"config.calendarDataGrid.timeline.endDate"},{type:"number",captureName:"dayColumnWidth",labelKey:"config.calendarDataGrid.timeline.dayWidth",defaultValue:40},{type:"switch",captureName:"groupByMonth",labelKey:"config.calendarDataGrid.timeline.groupByMonth",defaultValue:!0}]},hKt,iKt,mKt,fKt,cKt,uKt,dKt,sKt,lKt,pKt]},Jrr=function(e){var t=e.name,r=e.className,n=pnt[t];return n?lt(n,{className:r}):null},enr=function(t){var r,o,a,i,s,l=lqt().stateConfig,c=e.useRef(null),u=e.useState({}),d=u[0],p=u[1],h=d.start,f=d.end,m=(null===(r=null==t?void 0:t.organism)||void 0===r?void 0:r.id)||"",v=(null===(a=null===(o=null==t?void 0:t.organism)||void 0===o?void 0:o.config)||void 0===a?void 0:a.dataRetrievalConfig)||{},y=(null===(s=null===(i=null==t?void 0:t.organism)||void 0===i?void 0:i.config)||void 0===s?void 0:s.display)||{defaultView:"month",use24HourFormatByDefault:!1,colorMap:[],overlayIndicators:void 0},g=function(){var e,t;try{var r=err(),n=r[0],o=r[1];e=n,t=o}catch(r){e=new URLSearchParams,t=function(){}}return[e,t]}()[0],b=g.get("rwoContext")||"",x=g.get("rwoRecordId"),w=b?M$(b):null,k=null==w?void 0:w[m],_=(null==k?void 0:k.rwoRecordId)||x||void 0,C=e.useMemo(function(){var e="calendar:organism:".concat(m),t=null==l?void 0:l[e];return"number"==typeof t?t:0},[l,m]),M=function(t){var r,o,a,i=t.organismId,s=t.start,l=t.end,c=t.rwoRecordId,u=pqt().calendar,d=lqt().stateConfig,p=rrr(i).rwoRecordId,h=c||p,f=e.useMemo(function(){var e="calendar:organism:".concat(i),t=null==d?void 0:d[e];return"number"==typeof t?t:0},[d,i]),m=n.useQuery({queryKey:[b$,i,f,h],queryFn:function(){return Q(void 0,void 0,void 0,function(){var e,t,r,n,o,a;return J(this,function(c){switch(c.label){case 0:if(!u)throw new Error("Calendar API not available");return[4,u.getOrganismData(i,X({start:null!=s?s:new Date("1970-01-01"),end:null!=l?l:new Date("2100-12-31")},h?{rwoRecordId:h}:{}))];case 1:if(e=c.sent(),t=null==e?void 0:e.data,!(r=null==t?void 0:t.data))throw new Error("Invalid calendar data response");return[2,{events:null!==(n=r.events)&&void 0!==n?n:[],resources:null!==(o=r.resources)&&void 0!==o?o:[],overlays:null!==(a=r.overlays)&&void 0!==a?a:[]}]}})})},enabled:Boolean(u&&i),refetchOnMount:!0,refetchOnWindowFocus:!0,staleTime:3e5,gcTime:6e5}),v=m.data,y=m.isLoading,g=m.error,b=m.refetch;return{events:null!==(r=null==v?void 0:v.events)&&void 0!==r?r:[],resources:null!==(o=null==v?void 0:v.resources)&&void 0!==o?o:[],overlays:null!==(a=null==v?void 0:v.overlays)&&void 0!==a?a:[],isLoading:y,error:g,refetch:b,refreshSignal:f}}({organismId:m,start:h,end:f,rwoRecordId:_}),S=M.events,D=M.resources,O=M.overlays,P=M.isLoading,E=M.error,j=M.refetch,T=function(e){void 0===e&&(e={});var t=pqt().calendar,r=n.useQueryClient(),o=n.useMutation({mutationFn:function(e){var r=e.event;return Q(void 0,void 0,void 0,function(){var e;return J(this,function(n){switch(n.label){case 0:if(!t)throw new Error("Calendar API is not available. Please check your configuration.");n.label=1;case 1:return n.trys.push([1,3,,4]),[4,t.createEvent(r)];case 2:return[2,n.sent()];case 3:throw e=n.sent(),new Error("Failed to create calendar event: ".concat(e instanceof Error?e.message:"Unknown error"));case 4:return[2]}})})},onSuccess:function(t,n){var o;t&&(null===(o=e.onSuccess)||void 0===o||o.call(e,t,n)),r.invalidateQueries({queryKey:[b$]})},onError:function(t,r){var n;null===(n=e.onError)||void 0===n||n.call(e,t,r),console.error("Calendar event creation failed:",t)}});return{create:o.mutateAsync,isLoading:o.isPending,isError:o.isError,error:o.error,isSuccess:o.isSuccess,data:o.data}}(),N=T.create,R=T.isLoading,F=T.error,z=function(e){void 0===e&&(e={});var t=pqt().calendar,r=n.useQueryClient(),o=n.useMutation({mutationFn:function(e){var r=e.eventId;return Q(void 0,void 0,void 0,function(){var e;return J(this,function(n){switch(n.label){case 0:if(!t)throw new Error("Calendar API is not available. Please check your configuration.");if(!r)throw new Error("Event ID is required for deletion.");n.label=1;case 1:return n.trys.push([1,3,,4]),[4,t.deleteEvent(r)];case 2:return n.sent(),[2,{eventId:r}];case 3:throw e=n.sent(),new Error("Failed to delete calendar event: ".concat(e instanceof Error?e.message:"Unknown error"));case 4:return[2]}})})},onSuccess:function(t,n){var o;null===(o=e.onSuccess)||void 0===o||o.call(e,t,n),r.invalidateQueries({queryKey:[b$]})},onError:function(t,r){var n;null===(n=e.onError)||void 0===n||n.call(e,t,r),console.error("Failed to delete event ".concat(r.eventId,":"),t)}});return{delete:o.mutateAsync,isLoading:o.isPending,isError:o.isError,error:o.error,isSuccess:o.isSuccess,data:o.data}}(),I=z.delete,A=z.isLoading,L=z.error,B=function(e){void 0===e&&(e={});var t=pqt().calendar,r=n.useQueryClient(),o=n.useMutation({mutationFn:function(e){var r=e.event;return Q(void 0,void 0,void 0,function(){var e;return J(this,function(n){switch(n.label){case 0:if(!t)throw new Error("Calendar API is not available. Please check your configuration.");if(!r.id)throw new Error("Event ID is required for updates.");n.label=1;case 1:return n.trys.push([1,3,,4]),[4,t.updateEvent(r)];case 2:return[2,n.sent()];case 3:throw e=n.sent(),new Error("Failed to update calendar event: ".concat(e instanceof Error?e.message:"Unknown error"));case 4:return[2]}})})},onSuccess:function(t,n){var o;t&&(null===(o=e.onSuccess)||void 0===o||o.call(e,t,n)),r.invalidateQueries({queryKey:[b$]})},onError:function(t,r){var n;null===(n=e.onError)||void 0===n||n.call(e,t,r),console.error("Failed to update event ".concat(r.event.id,":"),t)}});return{update:o.mutateAsync,isLoading:o.isPending,isError:o.isError,error:o.error,isSuccess:o.isSuccess,data:o.data}}(),V=B.update,H=B.isLoading,q=B.error,$=function(e,t){if(e){if("string"==typeof e)return t[e];if("const"in e)return e.const;if("template"in e){var r=e.template;return e.tokens&&Object.entries(e.tokens).forEach(function(e){var n=e[0],o=e[1],a=t[o]||"";r=r.replace(new RegExp("{{".concat(n,"}}"),"g"),a)}),r}}},W=e.useMemo(function(){var e,t=null===(e=null==v?void 0:v.bindings)||void 0===e?void 0:e.resource;if(!t)return D;try{return D.map(function(e){var r,n,o,a,i,s;return{id:String(null!==(n=null!==(r=$(t.id,e))&&void 0!==r?r:e.id)&&void 0!==n?n:""),name:String(null!==(a=null!==(o=$(t.name,e))&&void 0!==o?o:e.name)&&void 0!==a?a:""),accentClass:null!==(i=$(t.accentClass,e))&&void 0!==i?i:e.accentClass,color:null!==(s=$(t.color,e))&&void 0!==s?s:e.color,meta:e.meta}})}catch(e){return D}},[D,v]),U=function(e){var r,n,o,a,i={},s=(null===(a=null===(o=null===(n=null===(r=null==t?void 0:t.organism)||void 0===r?void 0:r.config)||void 0===n?void 0:n.dataRetrievalConfig)||void 0===o?void 0:o.bindings)||void 0===a?void 0:a.event)||{};return Object.entries(s).forEach(function(t){var r=t[0],n=t[1];if("string"==typeof n){var o=function(e,t){return t.split(".").reduce(function(e,t){return null==e?void 0:e[t]},e)}(e,r);void 0!==o&&(i[n]=o)}}),i},G=pqt().calendar,K=eLt({initialEvents:S,onEventAdd:function(e){return Q(void 0,void 0,void 0,function(){var t,r,n,o,a;return J(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),t=U(e),[4,null===(a=null==G?void 0:G.createEvent)||void 0===a?void 0:a.call(G,{formId:m,data:t})];case 1:return(r=i.sent())?[2,r]:[4,N({event:X({},e)})];case 2:return n=i.sent(),[2,n||X(X({},e),{id:String(Date.now())})];case 3:return o=i.sent(),console.error("Failed to create event:",o),[2,X(X({},e),{id:String(Date.now())})];case 4:return[2]}})})},onEventUpdate:function(e){return Q(void 0,void 0,void 0,function(){var t,r,n,o;return J(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),t=U(e),[4,null===(o=null==G?void 0:G.updateEvent)||void 0===o?void 0:o.call(G,{formId:m,rwoRecordId:null==e?void 0:e.id,data:t})];case 1:return(r=a.sent())?[2,r]:[4,V({event:X({},e)})];case 2:return[2,a.sent()||e];case 3:return n=a.sent(),console.error("Failed to update event:",n),[2,e];case 4:return[2]}})})},onEventDelete:function(e){return Q(void 0,void 0,void 0,function(){var t;return J(this,function(r){switch(r.label){case 0:return r.trys.push([0,5,,6]),(null==v?void 0:v.onEventDelete)?[4,v.onEventDelete(e)]:[3,2];case 1:return r.sent(),[3,4];case 2:return[4,I({eventId:e})];case 3:r.sent(),r.label=4;case 4:return[3,6];case 5:return t=r.sent(),console.error("Failed to delete event:",t),[3,6];case 6:return[2]}})})},onDateRangeChange:function(e,t){return Q(void 0,void 0,void 0,function(){return J(this,function(r){return c.current={start:e,end:t},p({start:e,end:t}),[2,[]]})})}}),Y=K.events,Z=K.isLoading,ee=K.addEvent,te=K.updateEvent,re=K.deleteEvent,ne=K.onViewOrDateChange,oe=e.useRef(C);e.useEffect(function(){if(!E&&c.current&&C!==oe.current){oe.current=C;var e=c.current,t=e.start,r=e.end;ne(t,r)}},[C,ne,E]);var ae=e.useMemo(function(){return{defaultView:y.defaultView||"month",use24HourFormatByDefault:y.use24HourFormatByDefault||!1,overlayIndicators:(e=y.overlayIndicators,e?{maxPerCell:e.maxPerCell,statusClasses:e.statusClasses,showLegend:e.showLegend,icons:e.icons?Object.fromEntries(Object.entries(e.icons).map(function(e){var t=e[0],r=e[1];return[t,{className:r.className,priority:r.priority,showCountBadge:r.showCountBadge,icon:r.iconName?lt(Jrr,{name:r.iconName,className:r.className}):void 0}]})):void 0}:void 0)};var e},[y]);return{events:Y,resources:W,overlays:O,isLoading:P||Z||R||A||H,error:E||F||L||q,refreshSignal:C,calendarConfig:ae,onEventAdd:ee,onEventUpdate:te,onEventDelete:re,onDateRangeChange:ne,refetch:j}},tnr=e.memo(function(e){var t=enr(e),r=t.events,n=t.resources,o=t.isLoading,a=t.calendarConfig,i=t.onEventAdd,s=t.onEventUpdate,l=t.onEventDelete,c=t.onDateRangeChange;return lt(JAt,{events:r,resources:n,isLoading:o,config:a,onEventAdd:i,onEventUpdate:s,onEventDelete:l,onDateRangeChange:c})});tnr.displayName="CalendarOrganism";var rnr=function(e){var t,r=e.children,n=Z(e,["children"]);return X(X({},n),{items:null!==(t=null==r?void 0:r.map(function(e){return"molecule"===e.instance&&"consent"===e.type?e:"container"===e.instance?rnr(e):e}))&&void 0!==t?t:[]})},nnr={component:"CalendarOrganism",version:"2.0.0",toolGroups:[Xrr,Zrr,{id:"eventFormModal",tool:"custom",titleKey:"config.calendar.group.eventFormModal",collapsible:!0,initiallyExpanded:!0,pathBase:"dataRetrievalConfig.form.modal",fields:[{type:"icon",captureName:"titleIcon",labelKey:"config.calendar.form.modal.titleIcon"},{type:"text",captureName:"i18n.title",labelKey:"config.calendar.form.modal.i18n.title",defaultValue:"Schedule visit"},{type:"text",captureName:"i18n.description",labelKey:"config.calendar.form.modal.i18n.description"},{type:"text",captureName:"i18n.submitLabel",labelKey:"config.calendar.form.modal.i18n.submit",defaultValue:"Create"},{type:"text",captureName:"i18n.cancelLabel",labelKey:"config.calendar.form.modal.i18n.cancel",defaultValue:"Cancel"},{type:"number",captureName:"layout.columns",labelKey:"config.calendar.form.modal.layout.columns",defaultValue:2},{type:"array",captureName:"layout.order",labelKey:"config.calendar.form.modal.layout.order",allowAdd:!0,allowRemove:!0,allowReorder:!0,itemFields:[]}]},{id:"display",tool:"custom",titleKey:"config.calendar.group.display",collapsible:!0,initiallyExpanded:!0,pathBase:"display",fields:[{type:"select",captureName:"defaultView",labelKey:"config.calendar.display.defaultView",options:[{id:"day",labelKey:"config.calendar.display.view.day"},{id:"week",labelKey:"config.calendar.display.view.week"},{id:"month",labelKey:"config.calendar.display.view.month"},{id:"year",labelKey:"config.calendar.display.view.year"}],defaultValue:"month"},{type:"switch",captureName:"use24HourFormatByDefault",labelKey:"config.calendar.display.use24HourFormat",defaultValue:!1},{type:"number",captureName:"firstDayOfWeek",labelKey:"config.calendar.display.firstDayOfWeek",defaultValue:1},{type:"switch",captureName:"showWeekends",labelKey:"config.calendar.display.showWeekends",defaultValue:!0},{type:"number",captureName:"eventBorderRadius",labelKey:"config.calendar.display.eventBorderRadius",defaultValue:4},{type:"number",captureName:"minCellHeight",labelKey:"config.calendar.display.minCellHeight",defaultValue:32},{type:"select",captureName:"dayView.viewType",labelKey:"config.calendar.display.day.viewType",options:[{id:"regular",labelKey:"config.calendar.display.view.regular"},{id:"resource",labelKey:"config.calendar.display.view.resource"}],defaultValue:"regular"},{type:"switch",captureName:"dayView.hideHoverLine",labelKey:"config.calendar.display.day.hideHoverLine",defaultValue:!1},{type:"switch",captureName:"dayView.hideTimeline",labelKey:"config.calendar.display.day.hideTimeline",defaultValue:!1},{type:"switch",captureName:"dayView.enableDoubleClickToAddEvent",labelKey:"config.calendar.display.day.enableDoubleClickToAddEvent",defaultValue:!1},{type:"select",captureName:"weekView.viewType",labelKey:"config.calendar.display.week.viewType",options:[{id:"regular",labelKey:"config.calendar.display.view.regular"},{id:"resource",labelKey:"config.calendar.display.view.resource"}],defaultValue:"regular"},{type:"switch",captureName:"weekView.hideHoverLine",labelKey:"config.calendar.display.week.hideHoverLine",defaultValue:!1},{type:"switch",captureName:"weekView.hideTimeline",labelKey:"config.calendar.display.week.hideTimeline",defaultValue:!1},{type:"switch",captureName:"weekView.enableDoubleClickToShiftViewToDaily",labelKey:"config.calendar.display.week.enableDoubleClickToShiftViewToDaily",defaultValue:!1},{type:"select",captureName:"weekView.resourceDisplayMode",labelKey:"config.calendar.display.week.resourceDisplayMode",options:[{id:"row",labelKey:"config.calendar.display.week.resourceDisplayMode.row"},{id:"column",labelKey:"config.calendar.display.week.resourceDisplayMode.column"}],defaultValue:"row"},{type:"switch",captureName:"monthView.showOnlyCurrentMonth",labelKey:"config.calendar.display.month.showOnlyCurrentMonth",defaultValue:!1},{type:"select",captureName:"monthView.viewType",labelKey:"config.calendar.display.month.viewType",options:[{id:"basic",labelKey:"config.calendar.display.month.view.basic"},{id:"detailed",labelKey:"config.calendar.display.month.view.detailed"}],defaultValue:"basic"},{type:"switch",captureName:"monthView.enableDoubleClickToShiftViewToWeekly",labelKey:"config.calendar.display.month.enableDoubleClickToShiftViewToWeekly",defaultValue:!1},{type:"switch",captureName:"yearView.enableDoubleClickToShiftViewToMonthly",labelKey:"config.calendar.display.year.enableDoubleClickToShiftViewToMonthly",defaultValue:!1},{type:"color",captureName:"statusColors.tentative",labelKey:"config.calendar.status.tentative"},{type:"color",captureName:"statusColors.confirmed",labelKey:"config.calendar.status.confirmed"},{type:"color",captureName:"statusColors.completed",labelKey:"config.calendar.status.completed"},{type:"color",captureName:"statusColors.cancelled",labelKey:"config.calendar.status.cancelled"}]},{id:"overlays",tool:"custom",titleKey:"config.calendar.group.overlays",collapsible:!0,initiallyExpanded:!1,pathBase:"display.overlayIndicators",fields:[{type:"number",captureName:"maxPerCell",labelKey:"config.calendar.overlayIndicators.maxPerCell"},{type:"switch",captureName:"showLegend",labelKey:"config.calendar.overlayIndicators.showLegend",defaultValue:!1},{type:"text",captureName:"statusClasses.ok",labelKey:"config.calendar.overlayIndicators.status.ok"},{type:"text",captureName:"statusClasses.info",labelKey:"config.calendar.overlayIndicators.status.info"},{type:"text",captureName:"statusClasses.warning",labelKey:"config.calendar.overlayIndicators.status.warning"},{type:"text",captureName:"statusClasses.danger",labelKey:"config.calendar.overlayIndicators.status.danger"}]}]},onr={calendar:nnr,data_grid:vKt,calendar_data_grid:Qrr},anr={config:{isInitialized:!0},traits:{isDocker:!1,isCI:!1,machineId:null,projectId:"b28c94b2195c8ed259f0b415aaee3f39b0b2920a4537611499fa044956917a21",sessionId:"e6c76f882ba83eab20b67b618e67366a1ea6df7edfc7e16858aaa09f5954b7a3",anonymousId:"6c93d6e1c180e6b6bb382c3abcee40610d63bad23bdfc96ea9dc52a5eb06f242"}};function inr(e){return"__mui_x_telemetry_"+btoa(e)}function snr(e,t,r){try{if("undefined"!=typeof window&&window[e])return window[e].setItem(inr(t),r),!0}catch(e){}return!1}function lnr(e,t){try{if("undefined"!=typeof window&&window[e])return window[e].getItem(inr(t))}catch(e){}return null}function cnr(e){let t="";const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let n=0;for(;n<e;)t+=r.charAt(Math.floor(62*Math.random())),n+=1;return t}const unr="undefined"==typeof window||"test"===process.env.NODE_ENV?()=>{}:async()=>{const e="fingerprint";try{const t=lnr("localStorage",e);if(t)return JSON.parse(t);const r=await Promise.resolve().then(function(){return bor}),n=await r.load({monitoring:!1}),o=S({},(await n.get()).components);delete o.cookiesEnabled;const a=r.hashComponents(o),i=r.hashComponents(S({},function(e,t){return t.reduce((t,r)=>(t[r]=e[r],t),{})}(o,["fonts","audio","languages","deviceMemory","timezone","sessionStorage","localStorage","indexedDB","openDatabase","platform","canvas","vendor","vendorFlavors","colorGamut","forcedColors","monochrome","contrast","reducedMotion","math","videoCard","architecture"]))),s={fullHash:a,coreHash:i};return snr("localStorage",e,JSON.stringify(s)),s}catch(e){return null}};var dnr=Object.freeze({__proto__:null,default:async function(){return anr.traits.sessionId=function(){const e="session_id",t=lnr("sessionStorage",e);if(t)return t;const r=`sesid_${cnr(32)}`;return snr("sessionStorage",e,r)?r:`sestp_${cnr(32)}`}(),anr.config.isInitialized||(anr.traits.anonymousId=function(){const e="anonymous_id",t=lnr("localStorage",e);if(t)return t;const r=`anid_${cnr(32)}`;return snr("localStorage",e,r)?r:""}(),anr.config.isInitialized=!0),anr.traits.fingerprint||(anr.traits.fingerprint=await unr()),anr}}),pnr="3.4.2";function hnr(e,t){return new Promise(function(r){return setTimeout(r,e,t)})}function fnr(e){return!!e&&"function"==typeof e.then}function mnr(e,t){try{var r=e();fnr(r)?r.then(function(e){return t(!0,e)},function(e){return t(!1,e)}):t(!0,r)}catch(e){t(!1,e)}}function vnr(e,t,r){return void 0===r&&(r=16),Q(this,void 0,void 0,function(){var n,o,a,i;return J(this,function(s){switch(s.label){case 0:n=Array(e.length),o=Date.now(),a=0,s.label=1;case 1:return a<e.length?(n[a]=t(e[a],a),(i=Date.now())>=o+r?(o=i,[4,hnr(0)]):[3,3]):[3,4];case 2:s.sent(),s.label=3;case 3:return++a,[3,1];case 4:return[2,n]}})})}function ynr(e){e.then(void 0,function(){})}function gnr(e,t){e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]],t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var r=[0,0,0,0];return r[3]+=e[3]+t[3],r[2]+=r[3]>>>16,r[3]&=65535,r[2]+=e[2]+t[2],r[1]+=r[2]>>>16,r[2]&=65535,r[1]+=e[1]+t[1],r[0]+=r[1]>>>16,r[1]&=65535,r[0]+=e[0]+t[0],r[0]&=65535,[r[0]<<16|r[1],r[2]<<16|r[3]]}function bnr(e,t){e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]],t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var r=[0,0,0,0];return r[3]+=e[3]*t[3],r[2]+=r[3]>>>16,r[3]&=65535,r[2]+=e[2]*t[3],r[1]+=r[2]>>>16,r[2]&=65535,r[2]+=e[3]*t[2],r[1]+=r[2]>>>16,r[2]&=65535,r[1]+=e[1]*t[3],r[0]+=r[1]>>>16,r[1]&=65535,r[1]+=e[2]*t[2],r[0]+=r[1]>>>16,r[1]&=65535,r[1]+=e[3]*t[1],r[0]+=r[1]>>>16,r[1]&=65535,r[0]+=e[0]*t[3]+e[1]*t[2]+e[2]*t[1]+e[3]*t[0],r[0]&=65535,[r[0]<<16|r[1],r[2]<<16|r[3]]}function xnr(e,t){return 32===(t%=64)?[e[1],e[0]]:t<32?[e[0]<<t|e[1]>>>32-t,e[1]<<t|e[0]>>>32-t]:(t-=32,[e[1]<<t|e[0]>>>32-t,e[0]<<t|e[1]>>>32-t])}function wnr(e,t){return 0===(t%=64)?e:t<32?[e[0]<<t|e[1]>>>32-t,e[1]<<t]:[e[1]<<t-32,0]}function knr(e,t){return[e[0]^t[0],e[1]^t[1]]}function _nr(e){return e=knr(e,[0,e[0]>>>1]),e=knr(e=bnr(e,[4283543511,3981806797]),[0,e[0]>>>1]),e=knr(e=bnr(e,[3301882366,444984403]),[0,e[0]>>>1])}function Cnr(e,t){t=t||0;var r,n=(e=e||"").length%16,o=e.length-n,a=[0,t],i=[0,t],s=[0,0],l=[0,0],c=[2277735313,289559509],u=[1291169091,658871167];for(r=0;r<o;r+=16)s=[255&e.charCodeAt(r+4)|(255&e.charCodeAt(r+5))<<8|(255&e.charCodeAt(r+6))<<16|(255&e.charCodeAt(r+7))<<24,255&e.charCodeAt(r)|(255&e.charCodeAt(r+1))<<8|(255&e.charCodeAt(r+2))<<16|(255&e.charCodeAt(r+3))<<24],l=[255&e.charCodeAt(r+12)|(255&e.charCodeAt(r+13))<<8|(255&e.charCodeAt(r+14))<<16|(255&e.charCodeAt(r+15))<<24,255&e.charCodeAt(r+8)|(255&e.charCodeAt(r+9))<<8|(255&e.charCodeAt(r+10))<<16|(255&e.charCodeAt(r+11))<<24],s=xnr(s=bnr(s,c),31),a=gnr(a=xnr(a=knr(a,s=bnr(s,u)),27),i),a=gnr(bnr(a,[0,5]),[0,1390208809]),l=xnr(l=bnr(l,u),33),i=gnr(i=xnr(i=knr(i,l=bnr(l,c)),31),a),i=gnr(bnr(i,[0,5]),[0,944331445]);switch(s=[0,0],l=[0,0],n){case 15:l=knr(l,wnr([0,e.charCodeAt(r+14)],48));case 14:l=knr(l,wnr([0,e.charCodeAt(r+13)],40));case 13:l=knr(l,wnr([0,e.charCodeAt(r+12)],32));case 12:l=knr(l,wnr([0,e.charCodeAt(r+11)],24));case 11:l=knr(l,wnr([0,e.charCodeAt(r+10)],16));case 10:l=knr(l,wnr([0,e.charCodeAt(r+9)],8));case 9:l=bnr(l=knr(l,[0,e.charCodeAt(r+8)]),u),i=knr(i,l=bnr(l=xnr(l,33),c));case 8:s=knr(s,wnr([0,e.charCodeAt(r+7)],56));case 7:s=knr(s,wnr([0,e.charCodeAt(r+6)],48));case 6:s=knr(s,wnr([0,e.charCodeAt(r+5)],40));case 5:s=knr(s,wnr([0,e.charCodeAt(r+4)],32));case 4:s=knr(s,wnr([0,e.charCodeAt(r+3)],24));case 3:s=knr(s,wnr([0,e.charCodeAt(r+2)],16));case 2:s=knr(s,wnr([0,e.charCodeAt(r+1)],8));case 1:s=bnr(s=knr(s,[0,e.charCodeAt(r)]),c),a=knr(a,s=bnr(s=xnr(s,31),u))}return a=gnr(a=knr(a,[0,e.length]),i=knr(i,[0,e.length])),i=gnr(i,a),a=gnr(a=_nr(a),i=_nr(i)),i=gnr(i,a),("00000000"+(a[0]>>>0).toString(16)).slice(-8)+("00000000"+(a[1]>>>0).toString(16)).slice(-8)+("00000000"+(i[0]>>>0).toString(16)).slice(-8)+("00000000"+(i[1]>>>0).toString(16)).slice(-8)}function Mnr(e){return parseInt(e)}function Snr(e){return parseFloat(e)}function Dnr(e,t){return"number"==typeof e&&isNaN(e)?t:e}function Onr(e){return e.reduce(function(e,t){return e+(t?1:0)},0)}function Pnr(e,t){if(void 0===t&&(t=1),Math.abs(t)>=1)return Math.round(e/t)*t;var r=1/t;return Math.round(e*r)/r}function Enr(e){return e&&"object"==typeof e&&"message"in e?e:{message:e}}function jnr(e){return"function"!=typeof e}function Tnr(e,t,r){var n=Object.keys(e).filter(function(e){return!function(e,t){for(var r=0,n=e.length;r<n;++r)if(e[r]===t)return!0;return!1}(r,e)}),o=vnr(n,function(r){return function(e,t){var r=new Promise(function(r){var n=Date.now();mnr(e.bind(null,t),function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var o=Date.now()-n;if(!e[0])return r(function(){return{error:Enr(e[1]),duration:o}});var a=e[1];if(jnr(a))return r(function(){return{value:a,duration:o}});r(function(){return new Promise(function(e){var t=Date.now();mnr(a,function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var a=o+Date.now()-t;if(!r[0])return e({error:Enr(r[1]),duration:a});e({value:r[1],duration:a})})})})})});return ynr(r),function(){return r.then(function(e){return e()})}}(e[r],t)});return ynr(o),function(){return Q(this,void 0,void 0,function(){var e,t,r,a;return J(this,function(i){switch(i.label){case 0:return[4,o];case 1:return[4,vnr(i.sent(),function(e){var t=e();return ynr(t),t})];case 2:return e=i.sent(),[4,Promise.all(e)];case 3:for(t=i.sent(),r={},a=0;a<n.length;++a)r[n[a]]=t[a];return[2,r]}})})}}function Nnr(){var e=window,t=navigator;return Onr(["MSCSSMatrix"in e,"msSetImmediate"in e,"msIndexedDB"in e,"msMaxTouchPoints"in t,"msPointerEnabled"in t])>=4}function Rnr(){var e=window,t=navigator;return Onr(["msWriteProfilerMark"in e,"MSStream"in e,"msLaunchUri"in t,"msSaveBlob"in t])>=3&&!Nnr()}function Fnr(){var e=window,t=navigator;return Onr(["webkitPersistentStorage"in t,"webkitTemporaryStorage"in t,0===t.vendor.indexOf("Google"),"webkitResolveLocalFileSystemURL"in e,"BatteryManager"in e,"webkitMediaStream"in e,"webkitSpeechGrammar"in e])>=5}function znr(){var e=window,t=navigator;return Onr(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,0===t.vendor.indexOf("Apple"),"getStorageUpdates"in t,"WebKitMediaKeys"in e])>=4}function Inr(){var e=window;return Onr(["safari"in e,!("DeviceMotionEvent"in e),!("ongestureend"in e),!("standalone"in navigator)])>=3}function Anr(){var e,t,r=window;return Onr(["buildID"in navigator,"MozAppearance"in(null!==(t=null===(e=document.documentElement)||void 0===e?void 0:e.style)&&void 0!==t?t:{}),"onmozfullscreenchange"in r,"mozInnerScreenX"in r,"CSSMozDocumentRule"in r,"CanvasCaptureMediaStream"in r])>=4}function Lnr(){var e=document;return e.fullscreenElement||e.msFullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||null}function Bnr(){var e=Fnr(),t=Anr();if(!e&&!t)return!1;var r=window;return Onr(["onorientationchange"in r,"orientation"in r,e&&!("SharedWorker"in r),t&&/android/i.test(navigator.appVersion)])>=2}function Vnr(e){var t=new Error(e);return t.name=e,t}function Hnr(e,t,r){var n,o,a;return void 0===r&&(r=50),Q(this,void 0,void 0,function(){var i,s;return J(this,function(l){switch(l.label){case 0:i=document,l.label=1;case 1:return i.body?[3,3]:[4,hnr(r)];case 2:return l.sent(),[3,1];case 3:s=i.createElement("iframe"),l.label=4;case 4:return l.trys.push([4,,10,11]),[4,new Promise(function(e,r){var n=!1,o=function(){n=!0,e()};s.onload=o,s.onerror=function(e){n=!0,r(e)};var a=s.style;a.setProperty("display","block","important"),a.position="absolute",a.top="0",a.left="0",a.visibility="hidden",t&&"srcdoc"in s?s.srcdoc=t:s.src="about:blank",i.body.appendChild(s);var l=function(){var e,t;n||("complete"===(null===(t=null===(e=s.contentWindow)||void 0===e?void 0:e.document)||void 0===t?void 0:t.readyState)?o():setTimeout(l,10))};l()})];case 5:l.sent(),l.label=6;case 6:return(null===(o=null===(n=s.contentWindow)||void 0===n?void 0:n.document)||void 0===o?void 0:o.body)?[3,8]:[4,hnr(r)];case 7:return l.sent(),[3,6];case 8:return[4,e(s,s.contentWindow)];case 9:return[2,l.sent()];case 10:return null===(a=s.parentNode)||void 0===a||a.removeChild(s),[7];case 11:return[2]}})})}function qnr(e){for(var t=function(e){for(var t,r,n="Unexpected syntax '".concat(e,"'"),o=/^\s*([a-z-]*)(.*)$/i.exec(e),a=o[1]||void 0,i={},s=/([.:#][\w-]+|\[.+?\])/gi,l=function(e,t){i[e]=i[e]||[],i[e].push(t)};;){var c=s.exec(o[2]);if(!c)break;var u=c[0];switch(u[0]){case".":l("class",u.slice(1));break;case"#":l("id",u.slice(1));break;case"[":var d=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(u);if(!d)throw new Error(n);l(d[1],null!==(r=null!==(t=d[4])&&void 0!==t?t:d[5])&&void 0!==r?r:"");break;default:throw new Error(n)}}return[a,i]}(e),r=t[0],n=t[1],o=document.createElement(null!=r?r:"div"),a=0,i=Object.keys(n);a<i.length;a++){var s=i[a],l=n[s].join(" ");"style"===s?$nr(o.style,l):o.setAttribute(s,l)}return o}function $nr(e,t){for(var r=0,n=t.split(";");r<n.length;r++){var o=n[r],a=/^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(o);if(a){var i=a[1],s=a[2],l=a[4];e.setProperty(i,s,l||"")}}}var Wnr=["monospace","sans-serif","serif"],Unr=["sans-serif-thin","ARNO PRO","Agency FB","Arabic Typesetting","Arial Unicode MS","AvantGarde Bk BT","BankGothic Md BT","Batang","Bitstream Vera Sans Mono","Calibri","Century","Century Gothic","Clarendon","EUROSTILE","Franklin Gothic","Futura Bk BT","Futura Md BT","GOTHAM","Gill Sans","HELV","Haettenschweiler","Helvetica Neue","Humanst521 BT","Leelawadee","Letter Gothic","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Outlook","MS Reference Specialty","MS UI Gothic","MT Extra","MYRIAD PRO","Marlett","Meiryo UI","Microsoft Uighur","Minion Pro","Monotype Corsiva","PMingLiU","Pristina","SCRIPTINA","Segoe UI Light","Serifa","SimHei","Small Fonts","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","Vrinda","ZWAdobeF"];function Gnr(e){return e.toDataURL()}var Knr,Ynr;function Xnr(){var e=this;return function(){if(void 0===Ynr){var e=function(){var t=Znr();Qnr(t)?Ynr=setTimeout(e,2500):(Knr=t,Ynr=void 0)};e()}}(),function(){return Q(e,void 0,void 0,function(){var e;return J(this,function(t){switch(t.label){case 0:return Qnr(e=Znr())?Knr?[2,ee([],Knr,!0)]:Lnr()?[4,(r=document,(r.exitFullscreen||r.msExitFullscreen||r.mozCancelFullScreen||r.webkitExitFullscreen).call(r))]:[3,2]:[3,2];case 1:t.sent(),e=Znr(),t.label=2;case 2:return Qnr(e)||(Knr=e),[2,e]}var r})})}}function Znr(){var e=screen;return[Dnr(Snr(e.availTop),null),Dnr(Snr(e.width)-Snr(e.availWidth)-Dnr(Snr(e.availLeft),0),null),Dnr(Snr(e.height)-Snr(e.availHeight)-Dnr(Snr(e.availTop),0),null),Dnr(Snr(e.availLeft),null)]}function Qnr(e){for(var t=0;t<4;++t)if(e[t])return!1;return!0}function Jnr(e){var t;return Q(this,void 0,void 0,function(){var r,n,o,a,i,s,l;return J(this,function(c){switch(c.label){case 0:for(r=document,n=r.createElement("div"),o=new Array(e.length),a={},eor(n),l=0;l<e.length;++l)"DIALOG"===(i=qnr(e[l])).tagName&&i.show(),eor(s=r.createElement("div")),s.appendChild(i),n.appendChild(s),o[l]=i;c.label=1;case 1:return r.body?[3,3]:[4,hnr(50)];case 2:return c.sent(),[3,1];case 3:r.body.appendChild(n);try{for(l=0;l<e.length;++l)o[l].offsetParent||(a[e[l]]=!0)}finally{null===(t=n.parentNode)||void 0===t||t.removeChild(n)}return[2,a]}})})}function eor(e){e.style.setProperty("display","block","important")}function tor(e){return matchMedia("(inverted-colors: ".concat(e,")")).matches}function ror(e){return matchMedia("(forced-colors: ".concat(e,")")).matches}function nor(e){return matchMedia("(prefers-contrast: ".concat(e,")")).matches}function oor(e){return matchMedia("(prefers-reduced-motion: ".concat(e,")")).matches}function aor(e){return matchMedia("(dynamic-range: ".concat(e,")")).matches}var ior=Math,sor=function(){return 0};var lor={default:[],apple:[{font:"-apple-system-body"}],serif:[{fontFamily:"serif"}],sans:[{fontFamily:"sans-serif"}],mono:[{fontFamily:"monospace"}],min:[{fontSize:"1px"}],system:[{fontFamily:"system-ui"}]};var cor={fonts:function(){return Hnr(function(e,t){var r=t.document,n=r.body;n.style.fontSize="48px";var o=r.createElement("div"),a={},i={},s=function(e){var t=r.createElement("span"),n=t.style;return n.position="absolute",n.top="0",n.left="0",n.fontFamily=e,t.textContent="mmMwWLliI0O&1",o.appendChild(t),t},l=Wnr.map(s),c=function(){for(var e={},t=function(t){e[t]=Wnr.map(function(e){return function(e,t){return s("'".concat(e,"',").concat(t))}(t,e)})},r=0,n=Unr;r<n.length;r++){t(n[r])}return e}();n.appendChild(o);for(var u=0;u<Wnr.length;u++)a[Wnr[u]]=l[u].offsetWidth,i[Wnr[u]]=l[u].offsetHeight;return Unr.filter(function(e){return t=c[e],Wnr.some(function(e,r){return t[r].offsetWidth!==a[e]||t[r].offsetHeight!==i[e]});var t})})},domBlockers:function(e){var t=(void 0===e?{}:e).debug;return Q(this,void 0,void 0,function(){var e,r,n,o,a;return J(this,function(i){switch(i.label){case 0:return znr()||Bnr()?(s=atob,e={abpIndo:["#Iklan-Melayang","#Kolom-Iklan-728","#SidebarIklan-wrapper",'[title="ALIENBOLA" i]',s("I0JveC1CYW5uZXItYWRz")],abpvn:[".quangcao","#mobileCatfish",s("LmNsb3NlLWFkcw=="),'[id^="bn_bottom_fixed_"]',"#pmadv"],adBlockFinland:[".mainostila",s("LnNwb25zb3JpdA=="),".ylamainos",s("YVtocmVmKj0iL2NsaWNrdGhyZ2guYXNwPyJd"),s("YVtocmVmXj0iaHR0cHM6Ly9hcHAucmVhZHBlYWsuY29tL2FkcyJd")],adBlockPersian:["#navbar_notice_50",".kadr",'TABLE[width="140px"]',"#divAgahi",s("YVtocmVmXj0iaHR0cDovL2cxLnYuZndtcm0ubmV0L2FkLyJd")],adBlockWarningRemoval:["#adblock-honeypot",".adblocker-root",".wp_adblock_detect",s("LmhlYWRlci1ibG9ja2VkLWFk"),s("I2FkX2Jsb2NrZXI=")],adGuardAnnoyances:[".hs-sosyal","#cookieconsentdiv",'div[class^="app_gdpr"]',".as-oil",'[data-cypress="soft-push-notification-modal"]'],adGuardBase:[".BetterJsPopOverlay",s("I2FkXzMwMFgyNTA="),s("I2Jhbm5lcmZsb2F0MjI="),s("I2NhbXBhaWduLWJhbm5lcg=="),s("I0FkLUNvbnRlbnQ=")],adGuardChinese:[s("LlppX2FkX2FfSA=="),s("YVtocmVmKj0iLmh0aGJldDM0LmNvbSJd"),"#widget-quan",s("YVtocmVmKj0iLzg0OTkyMDIwLnh5eiJd"),s("YVtocmVmKj0iLjE5NTZobC5jb20vIl0=")],adGuardFrench:["#pavePub",s("LmFkLWRlc2t0b3AtcmVjdGFuZ2xl"),".mobile_adhesion",".widgetadv",s("LmFkc19iYW4=")],adGuardGerman:['aside[data-portal-id="leaderboard"]'],adGuardJapanese:["#kauli_yad_1",s("YVtocmVmXj0iaHR0cDovL2FkMi50cmFmZmljZ2F0ZS5uZXQvIl0="),s("Ll9wb3BJbl9pbmZpbml0ZV9hZA=="),s("LmFkZ29vZ2xl"),s("Ll9faXNib29zdFJldHVybkFk")],adGuardMobile:[s("YW1wLWF1dG8tYWRz"),s("LmFtcF9hZA=="),'amp-embed[type="24smi"]',"#mgid_iframe1",s("I2FkX2ludmlld19hcmVh")],adGuardRussian:[s("YVtocmVmXj0iaHR0cHM6Ly9hZC5sZXRtZWFkcy5jb20vIl0="),s("LnJlY2xhbWE="),'div[id^="smi2adblock"]',s("ZGl2W2lkXj0iQWRGb3hfYmFubmVyXyJd"),"#psyduckpockeball"],adGuardSocial:[s("YVtocmVmXj0iLy93d3cuc3R1bWJsZXVwb24uY29tL3N1Ym1pdD91cmw9Il0="),s("YVtocmVmXj0iLy90ZWxlZ3JhbS5tZS9zaGFyZS91cmw/Il0="),".etsy-tweet","#inlineShare",".popup-social"],adGuardSpanishPortuguese:["#barraPublicidade","#Publicidade","#publiEspecial","#queTooltip",".cnt-publi"],adGuardTrackingProtection:["#qoo-counter",s("YVtocmVmXj0iaHR0cDovL2NsaWNrLmhvdGxvZy5ydS8iXQ=="),s("YVtocmVmXj0iaHR0cDovL2hpdGNvdW50ZXIucnUvdG9wL3N0YXQucGhwIl0="),s("YVtocmVmXj0iaHR0cDovL3RvcC5tYWlsLnJ1L2p1bXAiXQ=="),"#top100counter"],adGuardTurkish:["#backkapat",s("I3Jla2xhbWk="),s("YVtocmVmXj0iaHR0cDovL2Fkc2Vydi5vbnRlay5jb20udHIvIl0="),s("YVtocmVmXj0iaHR0cDovL2l6bGVuemkuY29tL2NhbXBhaWduLyJd"),s("YVtocmVmXj0iaHR0cDovL3d3dy5pbnN0YWxsYWRzLm5ldC8iXQ==")],bulgarian:[s("dGQjZnJlZW5ldF90YWJsZV9hZHM="),"#ea_intext_div",".lapni-pop-over","#xenium_hot_offers"],easyList:[".yb-floorad",s("LndpZGdldF9wb19hZHNfd2lkZ2V0"),s("LnRyYWZmaWNqdW5reS1hZA=="),".textad_headline",s("LnNwb25zb3JlZC10ZXh0LWxpbmtz")],easyListChina:[s("LmFwcGd1aWRlLXdyYXBbb25jbGljayo9ImJjZWJvcy5jb20iXQ=="),s("LmZyb250cGFnZUFkdk0="),"#taotaole","#aafoot.top_box",".cfa_popup"],easyListCookie:[".ezmob-footer",".cc-CookieWarning","[data-cookie-number]",s("LmF3LWNvb2tpZS1iYW5uZXI="),".sygnal24-gdpr-modal-wrap"],easyListCzechSlovak:["#onlajny-stickers",s("I3Jla2xhbW5pLWJveA=="),s("LnJla2xhbWEtbWVnYWJvYXJk"),".sklik",s("W2lkXj0ic2tsaWtSZWtsYW1hIl0=")],easyListDutch:[s("I2FkdmVydGVudGll"),s("I3ZpcEFkbWFya3RCYW5uZXJCbG9jaw=="),".adstekst",s("YVtocmVmXj0iaHR0cHM6Ly94bHR1YmUubmwvY2xpY2svIl0="),"#semilo-lrectangle"],easyListGermany:["#SSpotIMPopSlider",s("LnNwb25zb3JsaW5rZ3J1ZW4="),s("I3dlcmJ1bmdza3k="),s("I3Jla2xhbWUtcmVjaHRzLW1pdHRl"),s("YVtocmVmXj0iaHR0cHM6Ly9iZDc0Mi5jb20vIl0=")],easyListItaly:[s("LmJveF9hZHZfYW5udW5jaQ=="),".sb-box-pubbliredazionale",s("YVtocmVmXj0iaHR0cDovL2FmZmlsaWF6aW9uaWFkcy5zbmFpLml0LyJd"),s("YVtocmVmXj0iaHR0cHM6Ly9hZHNlcnZlci5odG1sLml0LyJd"),s("YVtocmVmXj0iaHR0cHM6Ly9hZmZpbGlhemlvbmlhZHMuc25haS5pdC8iXQ==")],easyListLithuania:[s("LnJla2xhbW9zX3RhcnBhcw=="),s("LnJla2xhbW9zX251b3JvZG9z"),s("aW1nW2FsdD0iUmVrbGFtaW5pcyBza3lkZWxpcyJd"),s("aW1nW2FsdD0iRGVkaWt1b3RpLmx0IHNlcnZlcmlhaSJd"),s("aW1nW2FsdD0iSG9zdGluZ2FzIFNlcnZlcmlhaS5sdCJd")],estonian:[s("QVtocmVmKj0iaHR0cDovL3BheTRyZXN1bHRzMjQuZXUiXQ==")],fanboyAnnoyances:["#ac-lre-player",".navigate-to-top","#subscribe_popup",".newsletter_holder","#back-top"],fanboyAntiFacebook:[".util-bar-module-firefly-visible"],fanboyEnhancedTrackers:[".open.pushModal","#issuem-leaky-paywall-articles-zero-remaining-nag","#sovrn_container",'div[class$="-hide"][zoompage-fontsize][style="display: block;"]',".BlockNag__Card"],fanboySocial:["#FollowUs","#meteored_share","#social_follow",".article-sharer",".community__social-desc"],frellwitSwedish:[s("YVtocmVmKj0iY2FzaW5vcHJvLnNlIl1bdGFyZ2V0PSJfYmxhbmsiXQ=="),s("YVtocmVmKj0iZG9rdG9yLXNlLm9uZWxpbmsubWUiXQ=="),"article.category-samarbete",s("ZGl2LmhvbGlkQWRz"),"ul.adsmodern"],greekAdBlock:[s("QVtocmVmKj0iYWRtYW4ub3RlbmV0LmdyL2NsaWNrPyJd"),s("QVtocmVmKj0iaHR0cDovL2F4aWFiYW5uZXJzLmV4b2R1cy5nci8iXQ=="),s("QVtocmVmKj0iaHR0cDovL2ludGVyYWN0aXZlLmZvcnRobmV0LmdyL2NsaWNrPyJd"),"DIV.agores300","TABLE.advright"],hungarian:["#cemp_doboz",".optimonk-iframe-container",s("LmFkX19tYWlu"),s("W2NsYXNzKj0iR29vZ2xlQWRzIl0="),"#hirdetesek_box"],iDontCareAboutCookies:['.alert-info[data-block-track*="CookieNotice"]',".ModuleTemplateCookieIndicator",".o--cookies--container","#cookies-policy-sticky","#stickyCookieBar"],icelandicAbp:[s("QVtocmVmXj0iL2ZyYW1ld29yay9yZXNvdXJjZXMvZm9ybXMvYWRzLmFzcHgiXQ==")],latvian:[s("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiAxMjBweDsgaGVpZ2h0OiA0MHB4OyBvdmVyZmxvdzogaGlkZGVuOyBwb3NpdGlvbjogcmVsYXRpdmU7Il0="),s("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiA4OHB4OyBoZWlnaHQ6IDMxcHg7IG92ZXJmbG93OiBoaWRkZW47IHBvc2l0aW9uOiByZWxhdGl2ZTsiXQ==")],listKr:[s("YVtocmVmKj0iLy9hZC5wbGFuYnBsdXMuY28ua3IvIl0="),s("I2xpdmVyZUFkV3JhcHBlcg=="),s("YVtocmVmKj0iLy9hZHYuaW1hZHJlcC5jby5rci8iXQ=="),s("aW5zLmZhc3R2aWV3LWFk"),".revenue_unit_item.dable"],listeAr:[s("LmdlbWluaUxCMUFk"),".right-and-left-sponsers",s("YVtocmVmKj0iLmFmbGFtLmluZm8iXQ=="),s("YVtocmVmKj0iYm9vcmFxLm9yZyJd"),s("YVtocmVmKj0iZHViaXp6bGUuY29tL2FyLz91dG1fc291cmNlPSJd")],listeFr:[s("YVtocmVmXj0iaHR0cDovL3Byb21vLnZhZG9yLmNvbS8iXQ=="),s("I2FkY29udGFpbmVyX3JlY2hlcmNoZQ=="),s("YVtocmVmKj0id2Vib3JhbWEuZnIvZmNnaS1iaW4vIl0="),".site-pub-interstitiel",'div[id^="crt-"][data-criteo-id]'],officialPolish:["#ceneo-placeholder-ceneo-12",s("W2hyZWZePSJodHRwczovL2FmZi5zZW5kaHViLnBsLyJd"),s("YVtocmVmXj0iaHR0cDovL2Fkdm1hbmFnZXIudGVjaGZ1bi5wbC9yZWRpcmVjdC8iXQ=="),s("YVtocmVmXj0iaHR0cDovL3d3dy50cml6ZXIucGwvP3V0bV9zb3VyY2UiXQ=="),s("ZGl2I3NrYXBpZWNfYWQ=")],ro:[s("YVtocmVmXj0iLy9hZmZ0cmsuYWx0ZXgucm8vQ291bnRlci9DbGljayJd"),s("YVtocmVmXj0iaHR0cHM6Ly9ibGFja2ZyaWRheXNhbGVzLnJvL3Ryay9zaG9wLyJd"),s("YVtocmVmXj0iaHR0cHM6Ly9ldmVudC4ycGVyZm9ybWFudC5jb20vZXZlbnRzL2NsaWNrIl0="),s("YVtocmVmXj0iaHR0cHM6Ly9sLnByb2ZpdHNoYXJlLnJvLyJd"),'a[href^="/url/"]'],ruAd:[s("YVtocmVmKj0iLy9mZWJyYXJlLnJ1LyJd"),s("YVtocmVmKj0iLy91dGltZy5ydS8iXQ=="),s("YVtocmVmKj0iOi8vY2hpa2lkaWtpLnJ1Il0="),"#pgeldiz",".yandex-rtb-block"],thaiAds:["a[href*=macau-uta-popup]",s("I2Fkcy1nb29nbGUtbWlkZGxlX3JlY3RhbmdsZS1ncm91cA=="),s("LmFkczMwMHM="),".bumq",".img-kosana"],webAnnoyancesUltralist:["#mod-social-share-2","#social-tools",s("LmN0cGwtZnVsbGJhbm5lcg=="),".zergnet-recommend",".yt.btn-link.btn-md.btn"]},r=Object.keys(e),[4,Jnr((a=[]).concat.apply(a,r.map(function(t){return e[t]})))]):[2,void 0];case 1:return n=i.sent(),t&&function(e,t){for(var r="DOM blockers debug:\n```",n=0,o=Object.keys(e);n<o.length;n++){var a=o[n];r+="\n".concat(a,":");for(var i=0,s=e[a];i<s.length;i++){var l=s[i];r+="\n ".concat(t[l]?"🚫":"➡️"," ").concat(l)}}console.log("".concat(r,"\n```"))}(e,n),(o=r.filter(function(t){var r=e[t];return Onr(r.map(function(e){return n[e]}))>.6*r.length})).sort(),[2,o]}var s})})},fontPreferences:function(){return function(e,t){void 0===t&&(t=4e3);return Hnr(function(r,n){var o=n.document,a=o.body,i=a.style;i.width="".concat(t,"px"),i.webkitTextSizeAdjust=i.textSizeAdjust="none",Fnr()?a.style.zoom="".concat(1/n.devicePixelRatio):znr()&&(a.style.zoom="reset");var s=o.createElement("div");return s.textContent=ee([],Array(t/20|0),!0).map(function(){return"word"}).join(" "),a.appendChild(s),e(o,a)},'<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1">')}(function(e,t){for(var r={},n={},o=0,a=Object.keys(lor);o<a.length;o++){var i=a[o],s=lor[i],l=s[0],c=void 0===l?{}:l,u=s[1],d=void 0===u?"mmMwWLliI0fiflO&1":u,p=e.createElement("span");p.textContent=d,p.style.whiteSpace="nowrap";for(var h=0,f=Object.keys(c);h<f.length;h++){var m=f[h],v=c[m];void 0!==v&&(p.style[m]=v)}r[i]=p,t.appendChild(e.createElement("br")),t.appendChild(p)}for(var y=0,g=Object.keys(lor);y<g.length;y++){n[i=g[y]]=r[i].getBoundingClientRect().width}return n})},audio:function(){var e=window,t=e.OfflineAudioContext||e.webkitOfflineAudioContext;if(!t)return-2;if(znr()&&!Inr()&&!function(){var e=window;return Onr(["DOMRectList"in e,"RTCPeerConnectionIceEvent"in e,"SVGGeometryElement"in e,"ontransitioncancel"in e])>=3}())return-1;var r=new t(1,5e3,44100),n=r.createOscillator();n.type="triangle",n.frequency.value=1e4;var o=r.createDynamicsCompressor();o.threshold.value=-50,o.knee.value=40,o.ratio.value=12,o.attack.value=0,o.release.value=.25,n.connect(o),o.connect(r.destination),n.start(0);var a=function(e){var t=3,r=500,n=500,o=5e3,a=function(){},i=new Promise(function(i,s){var l=!1,c=0,u=0;e.oncomplete=function(e){return i(e.renderedBuffer)};var d=function(){setTimeout(function(){return s(Vnr("timeout"))},Math.min(n,u+o-Date.now()))},p=function(){try{var n=e.startRendering();switch(fnr(n)&&ynr(n),e.state){case"running":u=Date.now(),l&&d();break;case"suspended":document.hidden||c++,l&&c>=t?s(Vnr("suspended")):setTimeout(p,r)}}catch(e){s(e)}};p(),a=function(){l||(l=!0,u>0&&d())}});return[i,a]}(r),i=a[0],s=a[1],l=i.then(function(e){return function(e){for(var t=0,r=0;r<e.length;++r)t+=Math.abs(e[r]);return t}(e.getChannelData(0).subarray(4500))},function(e){if("timeout"===e.name||"suspended"===e.name)return-3;throw e});return ynr(l),function(){return s(),l}},screenFrame:function(){var e=this,t=Xnr();return function(){return Q(e,void 0,void 0,function(){var e,r;return J(this,function(n){switch(n.label){case 0:return[4,t()];case 1:return e=n.sent(),[2,[(r=function(e){return null===e?null:Pnr(e,10)})(e[0]),r(e[1]),r(e[2]),r(e[3])]]}})})}},osCpu:function(){return navigator.oscpu},languages:function(){var e,t=navigator,r=[],n=t.language||t.userLanguage||t.browserLanguage||t.systemLanguage;if(void 0!==n&&r.push([n]),Array.isArray(t.languages))Fnr()&&Onr([!("MediaSettingsRange"in(e=window)),"RTCEncodedAudioFrame"in e,""+e.Intl=="[object Intl]",""+e.Reflect=="[object Reflect]"])>=3||r.push(t.languages);else if("string"==typeof t.languages){var o=t.languages;o&&r.push(o.split(","))}return r},colorDepth:function(){return window.screen.colorDepth},deviceMemory:function(){return Dnr(Snr(navigator.deviceMemory),void 0)},screenResolution:function(){var e=screen,t=function(e){return Dnr(Mnr(e),null)},r=[t(e.width),t(e.height)];return r.sort().reverse(),r},hardwareConcurrency:function(){return Dnr(Mnr(navigator.hardwareConcurrency),void 0)},timezone:function(){var e,t=null===(e=window.Intl)||void 0===e?void 0:e.DateTimeFormat;if(t){var r=(new t).resolvedOptions().timeZone;if(r)return r}var n,o=(n=(new Date).getFullYear(),-Math.max(Snr(new Date(n,0,1).getTimezoneOffset()),Snr(new Date(n,6,1).getTimezoneOffset())));return"UTC".concat(o>=0?"+":"").concat(Math.abs(o))},sessionStorage:function(){try{return!!window.sessionStorage}catch(e){return!0}},localStorage:function(){try{return!!window.localStorage}catch(e){return!0}},indexedDB:function(){if(!Nnr()&&!Rnr())try{return!!window.indexedDB}catch(e){return!0}},openDatabase:function(){return!!window.openDatabase},cpuClass:function(){return navigator.cpuClass},platform:function(){var e=navigator.platform;return"MacIntel"===e&&znr()&&!Inr()?function(){if("iPad"===navigator.platform)return!0;var e=screen,t=e.width/e.height;return Onr(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,t>.65&&t<1.53])>=2}()?"iPad":"iPhone":e},plugins:function(){var e=navigator.plugins;if(e){for(var t=[],r=0;r<e.length;++r){var n=e[r];if(n){for(var o=[],a=0;a<n.length;++a){var i=n[a];o.push({type:i.type,suffixes:i.suffixes})}t.push({name:n.name,description:n.description,mimeTypes:o})}}return t}},canvas:function(){var e,t,r=!1,n=function(){var e=document.createElement("canvas");return e.width=1,e.height=1,[e,e.getContext("2d")]}(),o=n[0],a=n[1];if(function(e,t){return!(!t||!e.toDataURL)}(o,a)){r=function(e){return e.rect(0,0,10,10),e.rect(2,2,6,6),!e.isPointInPath(5,5,"evenodd")}(a),function(e,t){e.width=240,e.height=60,t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(100,1,62,20),t.fillStyle="#069",t.font='11pt "Times New Roman"';var r="Cwm fjordbank gly ".concat(String.fromCharCode(55357,56835));t.fillText(r,2,15),t.fillStyle="rgba(102, 204, 0, 0.2)",t.font="18pt Arial",t.fillText(r,4,45)}(o,a);var i=Gnr(o);i!==Gnr(o)?e=t="unstable":(t=i,function(e,t){e.width=122,e.height=110,t.globalCompositeOperation="multiply";for(var r=0,n=[["#f2f",40,40],["#2ff",80,40],["#ff2",60,80]];r<n.length;r++){var o=n[r],a=o[0],i=o[1],s=o[2];t.fillStyle=a,t.beginPath(),t.arc(i,s,40,0,2*Math.PI,!0),t.closePath(),t.fill()}t.fillStyle="#f9c",t.arc(60,60,60,0,2*Math.PI,!0),t.arc(60,60,20,0,2*Math.PI,!0),t.fill("evenodd")}(o,a),e=Gnr(o))}else e=t="";return{winding:r,geometry:e,text:t}},touchSupport:function(){var e,t=navigator,r=0;void 0!==t.maxTouchPoints?r=Mnr(t.maxTouchPoints):void 0!==t.msMaxTouchPoints&&(r=t.msMaxTouchPoints);try{document.createEvent("TouchEvent"),e=!0}catch(t){e=!1}return{maxTouchPoints:r,touchEvent:e,touchStart:"ontouchstart"in window}},vendor:function(){return navigator.vendor||""},vendorFlavors:function(){for(var e=[],t=0,r=["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"];t<r.length;t++){var n=r[t],o=window[n];o&&"object"==typeof o&&e.push(n)}return e.sort()},cookiesEnabled:function(){var e=document;try{e.cookie="cookietest=1; SameSite=Strict;";var t=-1!==e.cookie.indexOf("cookietest=");return e.cookie="cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT",t}catch(e){return!1}},colorGamut:function(){for(var e=0,t=["rec2020","p3","srgb"];e<t.length;e++){var r=t[e];if(matchMedia("(color-gamut: ".concat(r,")")).matches)return r}},invertedColors:function(){return!!tor("inverted")||!tor("none")&&void 0},forcedColors:function(){return!!ror("active")||!ror("none")&&void 0},monochrome:function(){if(matchMedia("(min-monochrome: 0)").matches){for(var e=0;e<=100;++e)if(matchMedia("(max-monochrome: ".concat(e,")")).matches)return e;throw new Error("Too high value")}},contrast:function(){return nor("no-preference")?0:nor("high")||nor("more")?1:nor("low")||nor("less")?-1:nor("forced")?10:void 0},reducedMotion:function(){return!!oor("reduce")||!oor("no-preference")&&void 0},hdr:function(){return!!aor("high")||!aor("standard")&&void 0},math:function(){var e,t=ior.acos||sor,r=ior.acosh||sor,n=ior.asin||sor,o=ior.asinh||sor,a=ior.atanh||sor,i=ior.atan||sor,s=ior.sin||sor,l=ior.sinh||sor,c=ior.cos||sor,u=ior.cosh||sor,d=ior.tan||sor,p=ior.tanh||sor,h=ior.exp||sor,f=ior.expm1||sor,m=ior.log1p||sor;return{acos:t(.12312423423423424),acosh:r(1e308),acoshPf:(e=1e154,ior.log(e+ior.sqrt(e*e-1))),asin:n(.12312423423423424),asinh:o(1),asinhPf:function(e){return ior.log(e+ior.sqrt(e*e+1))}(1),atanh:a(.5),atanhPf:function(e){return ior.log((1+e)/(1-e))/2}(.5),atan:i(.5),sin:s(-1e300),sinh:l(1),sinhPf:function(e){return ior.exp(e)-1/ior.exp(e)/2}(1),cos:c(10.000000000123),cosh:u(1),coshPf:function(e){return(ior.exp(e)+1/ior.exp(e))/2}(1),tan:d(-1e300),tanh:p(1),tanhPf:function(e){return(ior.exp(2*e)-1)/(ior.exp(2*e)+1)}(1),exp:h(1),expm1:f(1),expm1Pf:function(e){return ior.exp(e)-1}(1),log1p:m(10),log1pPf:function(e){return ior.log(1+e)}(10),powPI:function(e){return ior.pow(ior.PI,e)}(-100)}},videoCard:function(){var e,t=document.createElement("canvas"),r=null!==(e=t.getContext("webgl"))&&void 0!==e?e:t.getContext("experimental-webgl");if(r&&"getExtension"in r){var n=r.getExtension("WEBGL_debug_renderer_info");if(n)return{vendor:(r.getParameter(n.UNMASKED_VENDOR_WEBGL)||"").toString(),renderer:(r.getParameter(n.UNMASKED_RENDERER_WEBGL)||"").toString()}}},pdfViewerEnabled:function(){return navigator.pdfViewerEnabled},architecture:function(){var e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=1/0,e[0]=e[0]-e[0],t[3]}};function uor(e){var t=function(e){if(Bnr())return.4;if(znr())return Inr()?.5:.3;var t=e.platform.value||"";if(/^Win/.test(t))return.6;if(/^Mac/.test(t))return.5;return.7}(e),r=function(e){return Pnr(.99+.01*e,1e-4)}(t);return{score:t,comment:"$ if upgrade to Pro: https://fpjs.dev/pro".replace(/\$/g,"".concat(r))}}function dor(e){return JSON.stringify(e,function(e,t){return t instanceof Error?function(e){var t;return X({name:e.name,message:e.message,stack:null===(t=e.stack)||void 0===t?void 0:t.split("\n")},e)}(t):t},2)}function por(e){return Cnr(function(e){for(var t="",r=0,n=Object.keys(e).sort();r<n.length;r++){var o=n[r],a=e[o],i=a.error?"error":JSON.stringify(a.value);t+="".concat(t?"|":"").concat(o.replace(/([:|\\])/g,"\\$1"),":").concat(i)}return t}(e))}function hor(e){return void 0===e&&(e=50),function(e,t){void 0===t&&(t=1/0);var r=window.requestIdleCallback;return r?new Promise(function(e){return r.call(window,function(){return e()},{timeout:t})}):hnr(Math.min(e,t))}(e,2*e)}function mor(e,t){var r=Date.now();return{get:function(n){return Q(this,void 0,void 0,function(){var o,a,i;return J(this,function(s){switch(s.label){case 0:return o=Date.now(),[4,e()];case 1:return a=s.sent(),i=function(e){var t,r=uor(e);return{get visitorId(){return void 0===t&&(t=por(this.components)),t},set visitorId(e){t=e},confidence:r,components:e,version:pnr}}(a),(t||(null==n?void 0:n.debug))&&console.log("Copy the text below to get the debug data:\n\n```\nversion: ".concat(i.version,"\nuserAgent: ").concat(navigator.userAgent,"\ntimeBetweenLoadAndGet: ").concat(o-r,"\nvisitorId: ").concat(i.visitorId,"\ncomponents: ").concat(dor(a),"\n```")),[2,i]}})})}}}function vor(e){var t=void 0===e?{}:e,r=t.delayFallback,n=t.debug,o=t.monitoring,a=void 0===o||o;return Q(this,void 0,void 0,function(){var e;return J(this,function(t){switch(t.label){case 0:return a&&function(){if(!(window.__fpjs_d_m||Math.random()>=.001))try{var e=new XMLHttpRequest;e.open("get","https://m1.openfpcdn.io/fingerprintjs/v".concat(pnr,"/npm-monitoring"),!0),e.send()}catch(e){console.error(e)}}(),[4,hor(r)];case 1:return t.sent(),e=function(e){return Tnr(cor,e,[])}({debug:n}),[2,mor(e,n)]}})})}var yor={load:vor,hashComponents:por,componentsToDebugString:dor},gor=Cnr,bor=Object.freeze({__proto__:null,componentsToDebugString:dor,default:yor,getFullscreenElement:Lnr,getScreenFrame:Xnr,hashComponents:por,isAndroid:Bnr,isChromium:Fnr,isDesktopSafari:Inr,isEdgeHTML:Rnr,isGecko:Anr,isTrident:Nnr,isWebKit:znr,load:vor,loadSources:Tnr,murmurX64Hash128:gor,prepareForSources:hor,sources:cor,transformSource:function(e,t){var r=function(e){return jnr(e)?t(e):function(){var r=e();return fnr(r)?r.then(t):t(r)}};return function(t){var n=e(t);return fnr(n)?n.then(r):r(n)}},withIframe:Hnr});exports.AccountButtonContext=aqt,exports.AccountButtonProvider=iqt,exports.ActionButtonCell=arr,exports.AlertMolecule=vnt,exports.ApiContext=dqt,exports.ApiProvider=function(e){var t=e.api,r=e.children;return lt(dqt.Provider,X({value:t},{children:r}))},exports.AvatarTextCell=function(e){var t,r,n=e.row,o=e.avatarField,a=e.textField,i=String(null!==(t=irr(n,o))&&void 0!==t?t:"")||void 0,s=String(null!==(r=irr(n,a))&&void 0!==r?r:"");return ct(nh,X({sx:{display:"flex",alignItems:"center"}},{children:[lt(zp,{src:i,sx:{width:24,height:24,mr:1}}),lt(Ic,X({variant:"body2"},{children:s}))]}))},exports.BackgroundImage=$C,exports.BadgeMolecule=ynt,exports.BaseMolecule=yLt,exports.BaseTextButton=D_,exports.BasicTextField=knt,exports.BinaryRadioButtons=pat,exports.BooleanIconCell=srr,exports.Button=_nt,exports.ButtonActionsContext=GT,exports.ButtonActionsProvider=function(t){var r,n,o,a=t.children,i=t.popupProps,s=oqt().localStateObject,l=lqt().stateConfig,c=s||l,u=e.useState({}),d=u[0],p=u[1],h=e.useState(!1),f=h[0],m=h[1],v=e.useState(!1),y=v[0],g=v[1],b=e.useState(null),x=b[0],w=b[1],k=ZT().onStateChange,_=function(e){var t=null==i?void 0:i.find(function(t){return t.id===e});w(t||null),m(!0),k({id:e,type:"opened"})};e.useEffect(function(){null==i||i.forEach(function(e){var t;(null===(t=c[e.id])||void 0===t?void 0:t.visible)&&_(e.id)})},[c]);var C=function(e){w(null),m(!1),k({id:e,type:"closed"})},M=function(){g(!1)};lt(rqt,{item:d});var S=e.useMemo(function(){return{actionContent:d,setActionContent:p,isModalVisible:f,isDrawerVisible:y,setDrawerVisible:g,setActivePopUpById:_,onCloseDrawer:M,onCloseModal:C}},[d,p,f,y,g,_,M,C]),D=x||{},O=D.config,P=D.content;return ct(GT.Provider,X({value:S},{children:[x&&f&&ct(cat,X({size:null==O?void 0:O.size,open:f,onClose:function(){return C(x.id)},popupId:x.id,modalStyles:null==O?void 0:O.styles,withCloseIcon:null==O?void 0:O.withCloseIcon},{children:[null===(r=null==P?void 0:P.embedded)||void 0===r?void 0:r.map(function(e){var t;return lt(XT,X({initItems:null===(t=null==e?void 0:e.body)||void 0===t?void 0:t.items},{children:lt(rqt,{item:null==e?void 0:e.body},e.id)}))}),(null==P?void 0:P.isi)&&lt(rqt,{item:null===(o=null===(n=null==x?void 0:x.content)||void 0===n?void 0:n.isi)||void 0===o?void 0:o.body})]})),a]}))},exports.COMMUNICATION_LINK_DATA_TEXT=Lqt,exports.COMMUNICATION_LINK_DATA_URL=Aqt,exports.COMMUNICATION_LINK_ELEMENT_ID=zqt,exports.CalendarDataGridOrganism=Yrr,exports.CalendarOrganism=tnr,exports.CellRendererRegistry=frr,exports.Checkbox=hat,exports.Checklist=jnt,exports.ChipMolecule=Tnt,exports.Circle=T_,exports.CirclesWrapper=R_,exports.CircularIndicator=function(e){var t=e.activeColor,r=e.inactiveColor,n=Z(e,["activeColor","inactiveColor"]),o=(Qe()||mt).colors;return lt(F_,X({},n,{activeColor:o[t]||t,inactiveColor:o[r]||r}))},exports.CircularIndicatorStyledComponent=F_,exports.ConsentMolecule=Nnt,exports.Container=QHt,exports.ContainerRuntimeContext=gnt,exports.ContainerRuntimeContextProvider=xnt,exports.ContainerWrapper=h$,exports.ContentWrapper=function(t){var r=t.children,n=t.className,o=t.marginTop,a=void 0===o?"0px":o,i=t.marginLeft,s=void 0===i?"0px":i,l=t.marginRight,c=void 0===l?"0px":l,u=mat(),d=u.drawer,p=u.setDrawerContainerRef,h=e.useRef(null);e.useEffect(function(){return p&&p(h.current),function(){p&&p(null)}},[p]);var f=function(e){var t=parseFloat(e);return isNaN(t)?0:t},m=f(s),v="absolute"!==d.positionType&&"left"===d.position&&d.isOpen?"".concat(m+d.width,"px"):s,y=f(c),g="absolute"!==d.positionType&&"right"===d.position&&d.isOpen?"".concat(y+d.width,"px"):c;return lt(vat,X({ref:h,className:n,style:{marginTop:a,marginLeft:v,marginRight:g}},{children:r}))},exports.CurrencyCell=lrr,exports.CustomValidation=Int,exports.DataGridOrganism=Wrr,exports.DateCalendar=Hnt,exports.DateCell=crr,exports.DatePickerMolecule=cot,exports.DefaultTextCell=urr,exports.Divider=uot,exports.Drawer=kot,exports.EmailLinkCell=drr,exports.ErrorText=function(e){var t=e.text;return ct(st,{children:[lt(Rnt,{height:"XS"}),lt(Fnt,X({variant:"XS",color:"red"},{children:t}))]})},exports.FormOrganismItem=tqt,exports.FormStepContext=qHt,exports.FormStepContextProvider=$Ht,exports.HorizontalButtons=function(e){var t=e.onClick,r=e.disabled,n=e.buttonOptions,o=e.selectedButtonId,a=e.error,i=(null==n?void 0:n.slice(0,2))||[];return lt(z_,X({error:a,disabled:r},{children:i.map(function(e){var r=e.value,n=e.id;return lt(I_,X({isActive:n===o,onClick:function(){return t(n)}},{children:r}),n)})}))},exports.HorizontalPadding=zC,exports.Icon=L_,exports.IconButton=function(e){var t=e.name,r=e.color,n=e.onClick,o=e.disabled,a=e.activeOpacity,i=e.withoutOpacityEffect,s=Z(e,["name","color","onClick","disabled","activeOpacity","withoutOpacityEffect"]),l=(Qe()||mt).colors;return lt(P_,X({onClick:n,disabled:o,activeOpacity:a,withoutOpacityEffect:i},{children:lt(S_[t],X({},s,{color:l[r]||r}))}))},exports.IconRenderer=mnt,exports.IconWrapper=dat,exports.Image=dot,exports.Input=tC,exports.LayoutContext=fat,exports.LayoutProvider=function(t){var r=t.children,n=t.layoutPosition,o=void 0===n?"normal":n,a=t.drawerMaxWidthPercent,i=void 0===a?80:a,s=t.headerHeight,l=void 0===s?"0px":s,c=t.isMLR,u=void 0!==c&&c,d=t.isMobile,p=void 0!==d&&d,h=e.useState({width:0,position:"right",isOpen:!1,positionType:o}),f=h[0],m=h[1],v=e.useRef(null),y=e.useState(null),g=y[0],b=y[1],x=r_("xs"),w=p||x;e.useEffect(function(){m(function(e){return X(X({},e),{positionType:o})})},[o]),e.useEffect(function(){if(v.current){var e=function(){var e;if(f.isOpen){var t=(null===(e=v.current)||void 0===e?void 0:e.clientWidth)||0,r=Math.floor(t*(i/100));f.width>r&&m(function(e){return X(X({},e),{width:r})})}};e();var t=new ResizeObserver(function(){e()});return t.observe(v.current),function(){t&&t.disconnect()}}},[f.isOpen,f.width,i]);var k=e.useMemo(function(){return function(e){m(function(t){var r=void 0!==e.width?e.width:t.width;if(v.current&&(e.isOpen||t.isOpen)){var n=v.current.clientWidth,o=Math.floor(n*(i/100));r=Math.min(r,o)}var a=void 0!==e.positionType?e.positionType:t.positionType;return X(X(X({},t),e),{width:r,positionType:a})})}},[i]),_=e.useMemo(function(){return{drawer:f,updateDrawer:k,drawerContainerRef:g,setDrawerContainerRef:b,headerHeight:l,isMobile:w,isMLR:u}},[f,k,g,l,w,u]);return lt(fat.Provider,X({value:_},{children:lt("div",X({ref:v,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden"}},{children:r}))}))},exports.Link=_ot,exports.MATRIX_MESSAGE_DATA_ID=Iqt,exports.MATRIX_MESSAGE_ELEMENT_ID=Fqt,exports.MlrRichTextViewerContext=WT,exports.MlrRichTextViewerProvider=function(e){var t=e.children,r=e.isMLRReview,n=e.showAnnotations,o=e.annotationsList;return lt(WT.Provider,X({value:{isMLRReview:r,annotationsList:o,showAnnotations:n}},{children:t}))},exports.ModalWrapper=uat,exports.Organism=function(e){var t=e.organism;return lt(rqt,{item:rnr(t.body)})},exports.OrganismContext=KT,exports.OrganismContextProvider=XT,exports.OrganismItem=rqt,exports.PasswordSetup=Dot,exports.PdfDocument=function(t){var r=t.source,n=t.isMobile,a=void 0!==n&&n,i=t.customDocumentStyles,s=e.useState(0),l=s[0],c=s[1],u=e.useState(1),d=u[0],p=u[1],h=e.useState(null),f=h[0],m=h[1],v=i||{},y=v.pageWidth,g=void 0===y?a?342:856:y,b=v.pageHeight,x=f!==d;return lt(Lot,X({pageWidth:g,pageHeight:void 0===b?a?442:1108:b},{children:ct(Bot,X({customDocumentStyles:i},{children:[ct(o.Document,X({file:r,renderMode:"canvas",className:"document",onLoadSuccess:function(e){var t=e.numPages;c(t)},loading:lt(dc,{size:60})},{children:[x&&f?lt(o.Page,{pageNumber:f,renderTextLayer:!1,className:"custom-pdf"},f):null,lt(o.Page,{pageNumber:d,renderTextLayer:!1,className:"".concat(x?"loadingPage":"custom-pdf"),onRenderSuccess:function(){return m(d)}},d)]})),ct(Vot,{children:[lt(Hot,X({disable:d<=1,onClick:function(){return p(function(e){return e+(e<=1?0:-1)})},customDocumentStyles:i},{children:lt(L_,{name:"CaretLeft",size:33})})),lt(qot,{type:"number",size:"small",customDocumentStyles:i,onChange:function(e){var t=e.target.value,r=e.nativeEvent;return function(e,t){if(!Number.isNaN(e)){var r=Math.round(e);r>l?!Number.isNaN(t)&&t>0&&t<=l&&p(t):r<1||p(r)}}(+t,+((null==r?void 0:r.data)||""))},value:d}),lt(Hot,X({disabled:!0},{children:lt($ot,{})})),lt(Fnt,X({variant:"S",color:(null==i?void 0:i.pageNumberColor)||"white"},{children:l})),lt(Hot,X({disable:d>=l,onClick:function(){return p(function(e){return e+(e>=l?0:1)})},customDocumentStyles:i},{children:lt(L_,{name:"CaretRight"})}))]})]}))}))},exports.PhoneLinkCell=prr,exports.RadioButtons=function(e){var t=e.ref,r=e.name,n=e.value,o=e.options,a=e.onBlur,i=e.onChange,s=e.isRow,l=void 0!==s&&s,c=e.isError,u=void 0!==c&&c,d=e.disabled,p=void 0!==d&&d,h=e.isEditMode,f=void 0===h||h,m=e.isRichText,v=void 0!==m&&m,y=e.internalConfig,g=AC({internalConfig:y}).groupWrapperStyles;return lt(HC,X({ref:t,row:l,$isRow:l,name:r,value:n,onBlur:a,onChange:function(e){f&&(null==i||i(e.target.value))},$styles:g},{children:null==o?void 0:o.map(function(e){return lt(VC,{option:e,isError:u,disabled:p,isRichText:v,isEditMode:f,internalConfig:y},e.id)})}))},exports.RadioGroupWrapper=HC,exports.RatingCell=hrr,exports.RatingMolecule=Wot,exports.RegularImage=qC,exports.RichTextViewer=Vqt,exports.Select=function(t){var r=t.ref,n=t.onBlur,o=t.onChange,a=t.value,i=t.placeholder,s=t.options,l=void 0===s?[]:s,c=t.disabled,u=void 0!==c&&c,d=t.optionsPresentation,p=void 0!==d&&d,h=t.isError,f=t.isEditMode,m=void 0===f||f,v=t.selectInternalConfig,y=t.isRichText,g=void 0!==y&&y,b=e.useState(p),x=b[0],w=b[1],k=e.useState(a),_=k[0],C=k[1],M=null==l?void 0:l.find(function(e){return e.id===_});e.useEffect(function(){var e=function(){return!p&&w(!1)};return window.addEventListener("click",e),function(){return window.removeEventListener("click",e)}}),e.useEffect(function(){return w(p)},[p]),e.useEffect(function(){return C(a)},[a]);var S=function(e){return e===_};return lt(qqt,X({ref:r,tabIndex:0,onBlur:n,disabled:u,isEditMode:m,hasValue:!!M,isOpen:x,hasError:!!h,$styles:Uqt(v,!!M)},{children:ct("div",X({className:"select-wrapper"},{children:[ct("div",X({className:"select-input",onClick:function(e){p||(e.stopPropagation(),w(function(e){return!e}))}},{children:[M?g?lt(Vqt,{numberOfLines:1,value:M.label}):lt(Fnt,X({numberOfLines:1,variant:"M",color:"gray1"},{children:M.label})):lt(Fnt,X({numberOfLines:1,variant:"M",color:"gray3"},{children:i})),m&&lt("div",X({className:"icon-container"},{children:lt(L_,{name:"CaretDown"})}))]})),x&&m&&lt($qt,{children:l.map(function(e){var t=e.id,r=e.label;return lt(Wqt,X({$selected:S(t),onClick:function(){return function(e){C(e),null==o||o(e)}(t)}},{children:g?Hqt(JSON.parse(r)):r}),t)})})]}))}))},exports.SelectMolecule=Uot,exports.SliderMolecule=eat,exports.Spacer=Rnt,exports.SpeedDial=yat,exports.Spinner=Kqt,exports.StateContext=sqt,exports.StateContextProvider=function(t){var r=t.initStateConfig,n=t.children,o=t.stateHandler,a=t.authenticated,i=e.useMemo(function(){return{stateConfig:r,stateHandler:o,authenticated:a}},[r,o,a]);return lt(sqt.Provider,X({value:i},{children:n}))},exports.StatusChipCell=mrr,exports.Stepper=tat,exports.StyleWrapper=rKt,exports.SwitchMolecule=nat,exports.TextButton=O_,exports.TextMolecule=hot,exports.TextWrapper=Fnt,exports.TimePickerMolecule=aat,exports.Tooltip=function(t){var r=t.trigger,n=void 0===r?"hover":r,o=t.placement,a=void 0===o?"top":o,i=t.styles,s=Z(t,["trigger","placement","styles"]),l=e.useRef(null);return lt(rKt,X({ref:l,$styles:i},{children:lt(tKt,X({},s,{getTooltipContainer:function(){return l.current},trigger:n,placement:a}))}))},exports.TouchableOpacity=P_,exports.ValidationTag=oKt,exports.VerticalPadding=IC,exports.Video=iat,exports.ZealThemeProvider=function(e){return lt(hr,X({injectFirst:!0},{children:lt(et,X({theme:X(X({},t_),e.theme)},{children:ct(Fi,X({theme:X(X({},t_),e.theme)},{children:[lt(Qh,{}),lt(Pt,{styles:e_}),e.children]}))}))}))},exports.ZealUIModal=cat,exports.calendarConfiguratorDescriptor=nnr,exports.calendarDataGridConfiguratorDescriptor=Qrr,exports.containerConfiguratorsMap={},exports.dataGridConfiguratorDescriptor=vKt,exports.defaultTheme=mt,exports.fontWeight=[100,200,300,400,500,600,700,800,900],exports.fonts=["3XL","2XL","XL","L","M","S","XS"],exports.moleculeConfiguratorsMap={},exports.moleculeItemConfiguratorsMap={},exports.organismConfiguratorsMap=onr,exports.passwordValidationMapper=Cot,exports.richTextDefaultValue=Bqt,exports.seoTags=["h1","h2","h3","h4","h5","h6"],exports.sizings=["5XL","4XL","3XL","2XL","XL","L","M","S","XS",0],exports.toast=wUt,exports.toastStyles=Jk,exports.useAccountButtonContext=function(){return e.useContext(aqt)},exports.useApi=pqt,exports.useButtonActionsContext=nqt,exports.useCalendarDataGridData=Urr,exports.useContainerRuntime=bnt,exports.useDataGridOrganism=Irr,exports.useFormStepContext=cqt,exports.useLayoutContext=mat,exports.useMediaQuery=r_,exports.useMlrRichTextViewerContext=UT,exports.useOrganismContext=oqt,exports.useStateContext=lqt;
9728
+ */function Ktr(){return Ktr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ktr.apply(this,arguments)}function Ytr(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}const Xtr=["onClick","reloadDocument","replace","state","target","to"],Ztr=["aria-current","caseSensitive","className","end","style","to","children"];process.env.NODE_ENV;const Qtr=e.forwardRef(function(t,r){let{onClick:n,reloadDocument:o,replace:a=!1,state:i,target:s,to:l}=t,c=Ytr(t,Xtr),u=qtr(l),d=function(t,r){let{target:n,replace:o,state:a}=void 0===r?{}:r,i=Utr(),s=Wtr(),l=Gtr(t);return e.useCallback(e=>{if(!(0!==e.button||n&&"_self"!==n||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))){e.preventDefault();let r=!!o||Ntr(s)===Ntr(l);i(t,{replace:r,state:a})}},[s,i,l,o,a,n,t])}(l,{replace:a,state:i,target:s});return e.createElement("a",Ktr({},c,{href:u,onClick:function(e){n&&n(e),e.defaultPrevented||o||d(e)},ref:r,target:s}))});"production"!==process.env.NODE_ENV&&(Qtr.displayName="Link");const Jtr=e.forwardRef(function(t,r){let{"aria-current":n="page",caseSensitive:o=!1,className:a="",end:i=!1,style:s,to:l,children:c}=t,u=Ytr(t,Ztr),d=Wtr(),p=Gtr(l),h=d.pathname,f=p.pathname;o||(h=h.toLowerCase(),f=f.toLowerCase());let m,v=h===f||!i&&h.startsWith(f)&&"/"===h.charAt(f.length),y=v?n:void 0;m="function"==typeof a?a({isActive:v}):[a,v?"active":null].filter(Boolean).join(" ");let g="function"==typeof s?s({isActive:v}):s;return e.createElement(Qtr,Ktr({},u,{"aria-current":y,className:m,ref:r,style:g,to:l}),"function"==typeof c?c({isActive:v}):c)});function err(t){"production"!==process.env.NODE_ENV&&function(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(e){}}}("undefined"!=typeof URLSearchParams,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params\n\nIf you're unsure how to load polyfills, we recommend you check out https://polyfill.io/v3/ which provides some recommendations about how to load polyfills only for users that need them, instead of for every user.");let r=e.useRef(trr(t)),n=Wtr(),o=e.useMemo(()=>{let e=trr(n.search);for(let t of r.current.keys())e.has(t)||r.current.getAll(t).forEach(r=>{e.append(t,r)});return e},[n.search]),a=Utr();return[o,e.useCallback((e,t)=>{a("?"+trr(e),t)},[a])]}function trr(e){return void 0===e&&(e=""),new URLSearchParams("string"==typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(e=>[r,e]):[[r,n]])},[]))}"production"!==process.env.NODE_ENV&&(Jtr.displayName="NavLink");var rrr=function(t){var r=function(){try{return err()}catch(e){return[new URLSearchParams,function(){}]}}()[0];return e.useMemo(function(){var e=r.get("rwoContext")||"",n=r.get("rwoRecordId"),o=e?M$(e):null,a=null==o?void 0:o[t],i=(null==a?void 0:a.rwoRecordId)||n||void 0,s=X({},a);return null==s||delete s.rwoRecordId,{rwoRecordId:i,fieldValues:s,rawContext:a,getFieldValue:function(e){return null==s?void 0:s[e]}}},[r,t])},nrr=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,orr=function(e){return"string"==typeof e&&nrr.test(e)},arr=function(e){var t,r=e.tooltip,n=e.label,o=void 0===n?"Action":n,a=e.icon,i=e.variant,s=void 0===i?"outlined":i,l=e.color,c=void 0===l?"primary":l,u=e.size,d=void 0===u?"small":u,p=e.disabled,h=e.onClick,f="string"==typeof a?lt(fnt,{name:a,size:16}):a,m=null!==(t=null!=r?r:o)&&void 0!==t?t:"",v="contained"===s?{backgroundColor:"background.paper",border:"1px solid",borderColor:"divider","&:hover":{backgroundColor:"background.paper"}}:"outlined"===s?{border:"1px solid",borderColor:"divider"}:void 0;return lt(Gb,X({title:m,placement:"top"},{children:lt(yc,X({size:"small"===d?"small":"medium",color:c,disabled:Boolean(p),onClick:function(e){e.stopPropagation(),null==h||h()},"aria-label":m,sx:v,"data-action-button":"true"},{children:f}))}))},irr=function(e,t){var r=e[t];return r&&"object"==typeof r&&"value"in r?r.value:r},srr=function(e){var t=e.value,r=e.trueLabel,n=void 0===r?"Yes":r,o=e.falseLabel,a=void 0===o?"No":o,i=t;t&&"object"==typeof t&&"value"in t&&(i=t.value);var s="boolean"==typeof i?i:"string"==typeof i?["true","1","yes","y"].includes(i.toLowerCase()):Boolean(i);return lt(nh,X({sx:{display:"inline-flex",alignItems:"center"}},{children:lt(Gb,X({title:s?n:a,placement:"top"},{children:lt(nh,X({component:"span",sx:{display:"inline-flex"},"aria-label":s?"true":"false"},{children:s?lt(l_,{width:16,height:16,color:"#16A34A"}):lt(d_,{width:16,height:16,color:"#DC2626"})}))}))}))},lrr=function(e){var t=e.value,r=e.currency,n=void 0===r?"USD":r,o=e.locale,a=t;t&&"object"==typeof t&&"value"in t&&(a=t.value);var i="number"==typeof a?a:Number(null!=a?a:0);if(!Number.isFinite(i))return lt(st,{children:String(null!=a?a:"")});var s=new Intl.NumberFormat(null!=o?o:void 0,{style:"currency",currency:n,maximumFractionDigits:2});return lt(st,{children:s.format(i)})},crr=function(e){var t=e.value,r=e.formatString,n=void 0===r?"yyyy-MM-dd HH:mm":r,o=t;if(t&&"object"==typeof t&&"value"in t&&(o=t.value),null==o)return null;var a=o instanceof Date?o:new Date(o);return Number.isNaN(a.getTime())?lt(st,{children:String(o)}):lt(st,{children:$H(a,n)})},urr=function(e){var t=e.value,r=t;return t&&"object"==typeof t&&"value"in t&&(r=t.value),lt(st,{children:null==r?"":String(r)})},drr=function(e){var t=e.value,r=t;t&&"object"==typeof t&&"value"in t&&(r=t.value);var n=(null!=r?r:"").toString();return n?ct(nh,X({sx:{display:"inline-flex",alignItems:"center",gap:.5}},{children:[lt(b_,{size:16}),lt("a",X({href:"mailto:".concat(n),onClick:function(e){return e.stopPropagation()},"data-action-link":"true"},{children:n}))]})):null},prr=function(e){var t=e.value,r=t;t&&"object"==typeof t&&"value"in t&&(r=t.value);var n=null==r?"":String(r);if(!n)return null;var o=n.replace(/[^+\d]/g,"");return ct(nh,X({sx:{display:"inline-flex",alignItems:"center",gap:.5}},{children:[lt(g_,{size:16}),lt("a",X({href:"tel:".concat(o),onClick:function(e){return e.stopPropagation()},"data-action-link":"true"},{children:n}))]}))},hrr=function(e){var t=e.value,r=e.max,n=void 0===r?5:r,o=t;t&&"object"==typeof t&&"value"in t&&(o=t.value);var a="number"==typeof o?o:Number(null!=o?o:0),i=Number.isFinite(a)?Math.max(0,Math.min(n,Math.floor(a))):0;return lt(nh,X({sx:{display:"inline-flex",color:"#F59E0B"},"aria-label":"rating-".concat(i)},{children:Array.from({length:n}).map(function(e,t){return lt(n_,{width:16,height:16,color:t<i?"#F59E0B":"#D1D5DB"},t)})}))},frr={DefaultTextCell:urr,ActionButtonCell:arr,PredefinedActions:function(e){var t,r,n,o,a,i,s,l,c,u,d,p,h,f=e.actions,m=e.onEdit,v=e.onView,y=e.onDelete,g=e.size,b=void 0===g?"small":g,x=e.disabled;return ct(nh,X({sx:{display:"inline-flex",gap:(null!==(t=null==f?void 0:f.gap)&&void 0!==t?t:8)/16}},{children:[(null===(r=null==f?void 0:f.edit)||void 0===r?void 0:r.enabled)&&lt(arr,{tooltip:(null===(n=null==f?void 0:f.edit)||void 0===n?void 0:n.tooltip)||"Edit",variant:(null===(o=null==f?void 0:f.edit)||void 0===o?void 0:o.variant)||"outlined",icon:lt(fnt,{name:(null===(a=null==f?void 0:f.edit)||void 0===a?void 0:a.icon)||"Pencil",size:16}),onClick:m,size:b,disabled:Boolean(x)}),(null===(i=null==f?void 0:f.view)||void 0===i?void 0:i.enabled)&&lt(arr,{tooltip:(null===(s=null==f?void 0:f.view)||void 0===s?void 0:s.tooltip)||"View",variant:(null===(l=null==f?void 0:f.view)||void 0===l?void 0:l.variant)||"outlined",icon:lt(fnt,{name:(null===(c=null==f?void 0:f.view)||void 0===c?void 0:c.icon)||"Eye",size:16}),onClick:v,size:b,disabled:Boolean(x)}),(null===(u=null==f?void 0:f.delete)||void 0===u?void 0:u.enabled)&&lt(arr,{tooltip:(null===(d=null==f?void 0:f.delete)||void 0===d?void 0:d.tooltip)||"Delete",color:"error",variant:(null===(p=null==f?void 0:f.delete)||void 0===p?void 0:p.variant)||"outlined",icon:lt(fnt,{name:(null===(h=null==f?void 0:f.delete)||void 0===h?void 0:h.icon)||"Trash2",size:16}),onClick:y,size:b,disabled:Boolean(x)})]}))},ActionButtons:function(e){var t=e.buttons;return e.actions,lt(nh,X({sx:{display:"inline-flex",gap:1}},{children:null==t?void 0:t.map(function(e,t){return lt(arr,{tooltip:e.label,icon:e.icon,variant:"outlined",size:"small",onClick:e.onClick},e.id||t)})}))},DateCell:crr,BooleanIconCell:srr,EmailLinkCell:drr,PhoneLinkCell:prr,CurrencyCell:lrr,RatingCell:hrr},mrr=function(e){var t,r,n,o,a,i=e.value,s=e.mapping,l=i;i&&"object"==typeof i&&"value"in i&&(l=i.value);var c=null==s?void 0:s[l],u={default:{bg:"#E5E7EB",fg:"#000000"},success:{bg:"#D1FFDF",fg:"#000000"},error:{bg:"#FEE2E2",fg:"#000000"},warning:{bg:"#FEF3C7",fg:"#000000"},info:{bg:"#DBEAFE",fg:"#000000"}},d=null!==(r=u[null!==(t=null==c?void 0:c.color)&&void 0!==t?t:"default"])&&void 0!==r?r:u.default;return lt(Id,{size:"small",label:null!==(n=null==c?void 0:c.label)&&void 0!==n?n:l,sx:{height:24,borderRadius:8,px:1,fontSize:12,lineHeight:"24px",letterSpacing:"1px",bgcolor:null!==(o=null==c?void 0:c.bgColor)&&void 0!==o?o:d.bg,color:null!==(a=null==c?void 0:c.textColor)&&void 0!==a?a:d.fg,"& .MuiChip-label":{px:1,color:"inherit"}}})},vrr=function(e,t){var r,n;if(!e)return null;var o="component"===e.kind?e.id:e.field,a="component"===e.kind?e.componentRenderer:e.renderer,i=frr[a]||frr.DefaultTextCell,s="component"===e.kind?void 0:function(e,t){var r=e[t];return r&&"object"==typeof r&&"value"in r?r.value:r}(t,o);return lt(i,X({value:s,row:t},null!==(n=null!==(r=e.rendererProps)&&void 0!==r?r:e.componentProps)&&void 0!==n?n:{}))},yrr=function(e){var t,r,n,o,a,i,s,l,c,u,d,p,h=e.params,f=e.items,m=e.areas,v=e.layout,y=(null==h?void 0:h.row)||{},g=f&&f.length>0?f:[null==m?void 0:m.topLeft,null==m?void 0:m.topRight,null==m?void 0:m.bottomLeft,null==m?void 0:m.bottomRight].filter(Boolean);return lt(Im,X({role:"listitem",container:!0,columns:12,columnSpacing:v.gap,rowSpacing:v.verticalGap,sx:{alignItems:"center",width:"100%",p:null!==(r=null===(t=v.item)||void 0===t?void 0:t.padding)&&void 0!==r?r:void 0,px:null===(n=v.item)||void 0===n?void 0:n.paddingX,py:null===(o=v.item)||void 0===o?void 0:o.paddingY,mx:null===(a=v.item)||void 0===a?void 0:a.marginX,my:null===(i=v.item)||void 0===i?void 0:i.marginY,bgcolor:null!==(l=null===(s=v.item)||void 0===s?void 0:s.backgroundColor)&&void 0!==l?l:"transparent",border:(null===(c=v.item)||void 0===c?void 0:c.borderColor)?"1px solid ".concat(v.item.borderColor):void 0,borderRadius:null!==(d=null===(u=v.item)||void 0===u?void 0:u.borderRadius)&&void 0!==d?d:12,boxShadow:null===(p=v.item)||void 0===p?void 0:p.boxShadow}},{children:g.map(function(e){return lt(Im,X({size:"auto",sx:{minWidth:0,overflow:"hidden"}},{children:vrr(e,y)}),e.id)})}))},grr=function(e,t){var r,n;if(!e)return null;var o="component"===e.kind?e.id:e.field,a="component"===e.kind?e.componentRenderer:e.renderer,i=frr[a]||frr.DefaultTextCell,s="component"===e.kind?void 0:function(e,t){var r=e[t];return r&&"object"==typeof r&&"value"in r?r.value:r}(t,o);return lt(i,X({value:s,row:t},null!==(n=null!==(r=e.rendererProps)&&void 0!==r?r:e.componentProps)&&void 0!==n?n:{}))},brr=function(e){var t,r,n,o,a,i,s,l,c,u,d,p,h,f,m=e.params,v=e.cfgCols,y=e.layout,g=(null==m?void 0:m.row)||{},b={topLeft:v[0],topRight:v[1],bottomLeft:v[2],bottomRight:v[3]};return lt(nh,X({role:"listitem",sx:{width:"100%",height:"100%",boxSizing:"border-box",p:null!==(r=null===(t=y.item)||void 0===t?void 0:t.padding)&&void 0!==r?r:void 0,px:null===(n=y.item)||void 0===n?void 0:n.paddingX,py:null===(o=y.item)||void 0===o?void 0:o.paddingY,mx:null===(a=y.item)||void 0===a?void 0:a.marginX,my:null!==(s=null===(i=y.item)||void 0===i?void 0:i.marginY)&&void 0!==s?s:0,border:(null===(l=y.item)||void 0===l?void 0:l.borderColor)?"1px solid ".concat(y.item.borderColor):"1px solid #E5E7EB",borderRadius:null!==(u=null===(c=y.item)||void 0===c?void 0:c.borderRadius)&&void 0!==u?u:16,bgcolor:null!==(p=null===(d=y.item)||void 0===d?void 0:d.backgroundColor)&&void 0!==p?p:"background.paper",boxShadow:null!==(f=null===(h=y.item)||void 0===h?void 0:h.boxShadow)&&void 0!==f?f:"0 6px 16px rgba(17,24,39,0.06), 0 1px 2px rgba(17,24,39,0.03)",display:"flex",alignItems:"stretch"}},{children:ct(nh,X({sx:{display:"flex",alignItems:"center",gap:y.gap,width:"100%"}},{children:[ct(nh,X({sx:{flexGrow:1,minWidth:0}},{children:[lt(nh,X({"aria-label":"top-left",sx:{minWidth:0,overflow:"hidden"}},{children:lt(nh,X({component:"div",sx:{fontWeight:700,color:"#111827",letterSpacing:.2,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},{children:grr(b.topLeft,g)}))})),lt(nh,X({"aria-label":"bottom-left",sx:{minWidth:0,overflow:"hidden",mt:y.verticalGap}},{children:lt(nh,X({component:"div",sx:{fontSize:12,color:"#6B7280",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},{children:grr(b.bottomLeft,g)}))}))]})),ct(nh,X({sx:{display:"flex",flexDirection:"column",alignItems:"flex-end",justifyContent:"space-between",height:"100%",alignSelf:"stretch",flexShrink:0}},{children:[lt(nh,X({"aria-label":"top-right",sx:{color:"#111827",whiteSpace:"nowrap",fontWeight:600}},{children:grr(b.topRight,g)})),lt(nh,X({"aria-label":"bottom-right",sx:{mt:y.verticalGap}},{children:grr(b.bottomRight,g)}))]}))]}))}))},xrr=function(e,t,r){if(!(!e||!t||r<0||r>=t.length)){var n=t[r];if(n&&n.field)return function(e,t){if(e&&t){"development"===process.env.NODE_ENV&&console.log("Looking for field: ".concat(t),{row:e});var r=e[t];return r&&"object"==typeof r?"value"in r?r.value:"label"in r?r.label:"name"in r?r.name:"text"in r?r.text:"displayValue"in r?r.displayValue:"title"in r?r.title:r:r}}(e,n.field)}},wrr=function(e){var t=e.params,r=e.borderRadius,n=e.backgroundColor,o=e.borderColor,a=e.avatarBackgroundColor,i=e.avatarTextColor,s=e.stripeColor,l=e.titleColor,c=e.subtitleColor,u=e.companyColor,d=e.statusMapping,p=void 0===d?{Recruiting:{label:"Recruiting",color:"success"},Completed:{label:"Completed",color:"default"},Terminated:{label:"Terminated",color:"error"}}:d,h=e.columns,f=void 0===h?[]:h,m=(null==t?void 0:t.row)||{};"development"===process.env.NODE_ENV&&(console.log("StudyCard row data:",m),console.log("Available row fields:",Object.keys(m)),console.log("Columns configuration:",f));var v=xrr(m,f,0),y=xrr(m,f,1),g=xrr(m,f,2),b=xrr(m,f,3),x=xrr(m,f,4),w=v?String(v):"",k=y?String(y):"",_=g?String(g):"",C=b?String(b):"",M=x?String(x):"",S=_?function(e){var t,r;if(!e)return"";var n=e.trim().split(/\s+/).filter(Boolean);return 1===n.length?n[0].slice(0,2).toUpperCase():"".concat(null!==(t=n[0][0])&&void 0!==t?t:"").concat(null!==(r=n[1][0])&&void 0!==r?r:"").toUpperCase()||e.slice(0,2).toUpperCase()}(_):"??";return ct(nh,X({role:"listitem",sx:{width:"100%",height:"100%",boxSizing:"border-box",border:"1px solid ".concat(o||"#E5E7EB"),borderRadius:r||2,backgroundColor:n||"#FFFFFF",display:"flex",alignItems:"stretch",position:"relative",overflow:"hidden",minHeight:88}},{children:[lt(nh,{"aria-hidden":!0,sx:{width:6,alignSelf:"stretch",backgroundColor:s||"rgba(255, 174, 23, 0.25)",borderTopLeftRadius:r||2,borderBottomLeftRadius:r||2,marginRight:3}}),ct(nh,X({sx:{display:"flex",alignItems:"stretch",gap:2,width:"100%",paddingRight:3,paddingLeft:2,paddingTop:2,paddingBottom:2}},{children:[ct(nh,X({sx:{flexGrow:1,minWidth:0,display:"flex",flexDirection:"column",justifyContent:"center"}},{children:[ct(nh,X({sx:{display:"flex",alignItems:"center",gap:1,minWidth:0,marginBottom:1}},{children:[lt(Ic,X({sx:{fontWeight:700,color:l||"#111827",letterSpacing:"0.2px",fontSize:16,lineHeight:"24px",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{children:w||"No Title"})),lt(mrr,{value:k,mapping:p})]})),lt(Ic,X({sx:{color:c||"#6B7280",fontSize:12,lineHeight:"16px",letterSpacing:"0.2px",fontWeight:400,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{children:C||"No Subtitle"}))]})),ct(nh,X({sx:{display:"flex",alignItems:"flex-end",flexDirection:"column",justifyContent:"flex-end",height:"100%",flexShrink:0,minWidth:240,gap:1}},{children:[lt(zp,X({sx:{width:20,height:20,fontSize:11,fontWeight:500,backgroundColor:a||"#E6F6FF",color:i||"#0047B2",lineHeight:"20px",letterSpacing:"0.1px"},"aria-label":"avatar"},{children:S})),lt(Ic,X({sx:{color:u||"#111827",fontWeight:700,textAlign:"right",fontSize:12,lineHeight:"24px",letterSpacing:"0.2px",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{children:M||"No Company"}))]}))]}))]}))},krr=function(e,t){var r=e[t];return r&&"object"==typeof r&&"value"in r?r.value:r},_rr=function(e,t){var r,n;if(!e)return null;var o="component"===e.kind?e.id:e.field,a="component"===e.kind?e.componentRenderer:e.renderer,i=frr[a]||frr.DefaultTextCell,s="component"===e.kind?void 0:krr(t,o);return lt(i,X({value:s,row:t},null!==(n=null!==(r=e.rendererProps)&&void 0!==r?r:e.componentProps)&&void 0!==n?n:{}))},Crr=function(e,t){return e?"component"===e.kind?t:e.field:t},Mrr=function(e){var t=e.actionsColumn,r=e.row,n=e.borderColor,o=e.menuAnchorEl,a=e.isMenuOpen,i=e.handleMenuClose;return lt(ky,X({anchorEl:o,open:a,onClose:i,transformOrigin:{horizontal:"right",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"bottom"},PaperProps:{sx:{minWidth:160,boxShadow:"0px 4px 6px -1px rgba(0, 0, 0, 0.1), 0px 2px 4px -1px rgba(0, 0, 0, 0.06)",borderRadius:1,border:"1px solid ".concat(n)}}},{children:t&&"component"===t.kind?lt(Dy,X({sx:{padding:0,"&:hover":{backgroundColor:"transparent"}},onClick:function(e){e.target.closest("button")?e.stopPropagation():i()}},{children:lt(nh,X({sx:{width:"100%",padding:"8px 16px"},onClick:function(e){e.stopPropagation()}},{children:_rr(t,r)}))})):lt(Dy,X({disabled:!0,onClick:i},{children:lt(Ic,X({variant:"body2",color:"text.secondary"},{children:"No actions available"}))}))}))},Srr=function(t){var r,n,o,a,i,s,l,c,u,d,p,h,f,m=t.params,v=t.cfgCols,y=t.columns,g=t.config,b=t.onEdit,x=t.onDelete,w=t.onView,k=(null==m?void 0:m.row)||{},_=e.useState(null),C=_[0],M=_[1],S=Boolean(C),D=null==v?void 0:v[0];null==v||v[1];var O=null==v?void 0:v[2],P=null==v?void 0:v[3],E=null==v?void 0:v[4],j=null==v?void 0:v[5],T=(null==v?void 0:v.find(function(e){return"component"===e.kind}))||j,N="ActionButtons"===(null==T?void 0:T.componentRenderer)&&(null===(r=T.componentProps)||void 0===r?void 0:r.buttons)?X(X({},T),{componentProps:X(X({},T.componentProps),{actions:{edit:{enabled:!0,onClick:function(){return null==b?void 0:b(k)}},view:{enabled:!0,onClick:function(){return null==w?void 0:w(k)}},delete:{enabled:!0,onClick:function(){return null==x?void 0:x(k)}}},buttons:T.componentProps.buttons.map(function(e){return X(X({},e),{onClick:function(t){switch(t.stopPropagation(),e.id){case"edit":null==b||b(k);break;case"view":null==w||w(k);break;case"delete":null==x||x(k);break;default:console.log("Action clicked:",e.id,k)}}})})})}):T,R=Crr(O,null===(n=y[2])||void 0===n?void 0:n.field),F=R?String(null!==(o=krr(k,R))&&void 0!==o?o:""):"",z=null===(a=null==O?void 0:O.rendererProps)||void 0===a?void 0:a.mapping,I=Crr(D,null===(i=y[0])||void 0===i?void 0:i.field),A=function(e){var t,r,n=String(null!=e?e:"").trim();if(!n)return"";var o=n.split(/\s+/).filter(Boolean);return 1===o.length?o[0].slice(0,2).toUpperCase():"".concat(null!==(t=o[0][0])&&void 0!==t?t:"").concat(null!==(r=o[1][0])&&void 0!==r?r:"").toUpperCase()||n.slice(0,2).toUpperCase()}(I?krr(k,I):""),L=g||{},B=L.backgroundColor,V=L.borderColor,H=L.borderRadius,q=L.avatarBgColor,$=L.avatarTextColor,W=L.textColor,U=L.secondaryTextColor;return ct(st,{children:[lt(nh,X({role:"listitem",sx:{width:"100%",height:"100%",boxSizing:"border-box",border:"1px solid ".concat(V||"#E5E7EB"),borderRadius:H||1,backgroundColor:B||"#FFFFFF",display:"flex",alignItems:"stretch",position:"relative",overflow:"hidden",minHeight:88}},{children:ct(nh,X({sx:{display:"flex",alignItems:"stretch",gap:2,width:"100%",pr:3,pl:2,py:2}},{children:[lt(nh,X({sx:{display:"flex",alignItems:"center",flexShrink:0}},{children:lt(zp,X({sx:{width:28,height:28,fontSize:12,fontWeight:600,backgroundColor:q||"#E6F6FF",color:$||"#0047B2"},"aria-label":"avatar"},{children:A}))})),ct(nh,X({sx:{flexGrow:1,minWidth:0,display:"flex",flexDirection:"column",justifyContent:"center"}},{children:[ct(nh,X({sx:{display:"flex",alignItems:"center",gap:1,minWidth:0,mb:1}},{children:[lt(Ic,X({sx:{fontWeight:600,color:W||"#111827",letterSpacing:"-0.01em",fontSize:15,lineHeight:1.4,minWidth:0,flex:1}},{children:D?_rr(D,k):String(null!==(l=krr(k,(null===(s=y[0])||void 0===s?void 0:s.field)||""))&&void 0!==l?l:"")})),ct(nh,X({sx:{display:"flex",alignItems:"center",gap:1,flexShrink:0}},{children:[lt(mrr,{value:F,mapping:z}),lt(yc,X({size:"small",onClick:function(e){M(e.currentTarget)},sx:{color:U||"#6B7280",padding:.5,"&:hover":{backgroundColor:"rgba(0, 0, 0, 0.04)"}},"aria-label":"more actions"},{children:lt($ce,{size:16})}))]}))]})),ct(nh,X({sx:{display:"flex",alignItems:"center",gap:1,minWidth:0}},{children:[lt(Ic,X({sx:{color:U||"#6B7280",fontSize:12,lineHeight:1.3,letterSpacing:"0.01em",fontWeight:400,minWidth:0,flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{children:P?_rr(P,k):String(null!==(u=krr(k,(null===(c=y[3])||void 0===c?void 0:c.field)||""))&&void 0!==u?u:"")})),lt(Ic,X({sx:{color:U||"#6B7280",fontSize:12,lineHeight:1.3,letterSpacing:"0.01em",fontWeight:400,minWidth:0,flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{children:E?_rr(E,k):String(null!==(p=krr(k,(null===(d=y[4])||void 0===d?void 0:d.field)||""))&&void 0!==p?p:"")})),lt(Ic,X({sx:{color:W||"#111827",fontSize:12,lineHeight:1.3,letterSpacing:"0.01em",fontWeight:600,minWidth:0,flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",textAlign:"right"}},{children:j?_rr(j,k):String(null!==(f=krr(k,(null===(h=y[5])||void 0===h?void 0:h.field)||""))&&void 0!==f?f:"")}))]}))]}))]}))})),lt(Mrr,{actionsColumn:N,row:k,borderColor:V,menuAnchorEl:C,isMenuOpen:S,handleMenuClose:function(){M(null)}})]})},Drr=function(e,t){var r=e[t];return r&&"object"==typeof r&&"value"in r?r.value:r},Orr=function(e){var t,r,n,o,a,i,s,l,c,u,d,p,h,f,m,v,y,g,b,x,w,k=e.params,_=e.columns,C=e.layout,M=String(null!==(r=Drr(k.row,(null===(t=_[0])||void 0===t?void 0:t.field)||""))&&void 0!==r?r:""),S=String(null!==(o=Drr(k.row,(null===(n=_[1])||void 0===n?void 0:n.field)||""))&&void 0!==o?o:""),D=String(null!==(i=Drr(k.row,(null===(a=_[2])||void 0===a?void 0:a.field)||""))&&void 0!==i?i:"");return lt(nh,X({sx:{width:"100%",height:"100%",boxSizing:"border-box",p:null!==(l=null===(s=null==C?void 0:C.item)||void 0===s?void 0:s.padding)&&void 0!==l?l:void 0,px:null===(c=null==C?void 0:C.item)||void 0===c?void 0:c.paddingX,py:null===(u=null==C?void 0:C.item)||void 0===u?void 0:u.paddingY,mx:null===(d=null==C?void 0:C.item)||void 0===d?void 0:d.marginX,my:null!==(h=null===(p=null==C?void 0:C.item)||void 0===p?void 0:p.marginY)&&void 0!==h?h:0,border:(null===(f=null==C?void 0:C.item)||void 0===f?void 0:f.borderColor)?"1px solid ".concat(null===(m=null==C?void 0:C.item)||void 0===m?void 0:m.borderColor):"1px solid #E5E7EB",borderRadius:null!==(y=null===(v=null==C?void 0:C.item)||void 0===v?void 0:v.borderRadius)&&void 0!==y?y:"16px",bgcolor:null!==(b=null===(g=null==C?void 0:C.item)||void 0===g?void 0:g.backgroundColor)&&void 0!==b?b:"background.paper",boxShadow:null!==(w=null===(x=null==C?void 0:C.item)||void 0===x?void 0:x.boxShadow)&&void 0!==w?w:"0 6px 16px rgba(17,24,39,0.06), 0 1px 2px rgba(17,24,39,0.03)",display:"flex",alignItems:"stretch"}},{children:ct(lx,X({direction:"row",sx:{alignItems:"center",gap:2,width:"100%",height:"100%"}},{children:[ct(lx,X({sx:{flexGrow:1,minWidth:0}},{children:[lt(Ic,X({variant:"subtitle1",fontWeight:700,sx:{color:"#111827",letterSpacing:.2}},{children:M})),lt(Ic,X({variant:"body2",sx:{color:"#6B7280",mt:1}},{children:D}))]})),lt(nh,X({sx:{display:"flex",alignItems:"center",justifyContent:"flex-end"}},{children:lt(Ic,X({variant:"body2",sx:{color:"#111827",whiteSpace:"nowrap",fontWeight:600}},{children:S}))}))]}))}))},Prr=function(e,t){var r=e[t];return r&&"object"==typeof r&&"value"in r?r.value:r},Err=function(e){var t,r,n,o,a,i,s,l,c,u,d,p,h,f,m,v,y,g,b,x,w,k=e.params,_=e.columns,C=e.layout,M=String(null!==(r=Prr(k.row,(null===(t=_[0])||void 0===t?void 0:t.field)||""))&&void 0!==r?r:""),S=String(null!==(o=Prr(k.row,(null===(n=_[1])||void 0===n?void 0:n.field)||""))&&void 0!==o?o:""),D=String(null!==(i=Prr(k.row,(null===(a=_[2])||void 0===a?void 0:a.field)||""))&&void 0!==i?i:"");return lt(nh,X({sx:{width:"100%",height:"100%",boxSizing:"border-box",p:null!==(l=null===(s=null==C?void 0:C.item)||void 0===s?void 0:s.padding)&&void 0!==l?l:void 0,px:null===(c=null==C?void 0:C.item)||void 0===c?void 0:c.paddingX,py:null===(u=null==C?void 0:C.item)||void 0===u?void 0:u.paddingY,mx:null===(d=null==C?void 0:C.item)||void 0===d?void 0:d.marginX,my:null!==(h=null===(p=null==C?void 0:C.item)||void 0===p?void 0:p.marginY)&&void 0!==h?h:0,border:(null===(f=null==C?void 0:C.item)||void 0===f?void 0:f.borderColor)?"1px solid ".concat(null===(m=null==C?void 0:C.item)||void 0===m?void 0:m.borderColor):"1px solid #E5E7EB",borderRadius:null!==(y=null===(v=null==C?void 0:C.item)||void 0===v?void 0:v.borderRadius)&&void 0!==y?y:"16px",bgcolor:null!==(b=null===(g=null==C?void 0:C.item)||void 0===g?void 0:g.backgroundColor)&&void 0!==b?b:"background.paper",boxShadow:null!==(w=null===(x=null==C?void 0:C.item)||void 0===x?void 0:x.boxShadow)&&void 0!==w?w:"0 6px 16px rgba(17,24,39,0.06), 0 1px 2px rgba(17,24,39,0.03)",display:"flex",alignItems:"stretch"}},{children:ct(lx,X({direction:"row",sx:{alignItems:"center",height:"100%",gap:2,width:"100%"}},{children:[ct(lx,X({sx:{flexGrow:1,minWidth:0}},{children:[lt(Ic,X({variant:"subtitle1",fontWeight:700,sx:{color:"#111827",letterSpacing:.2}},{children:M})),lt(Ic,X({variant:"body2",sx:{color:"#6B7280",mt:1}},{children:D}))]})),ct(nh,X({sx:{display:"flex",flexDirection:"column",alignItems:"flex-end",justifyContent:"space-between",height:"100%",alignSelf:"stretch",flexShrink:0}},{children:[lt(Ic,X({variant:"body2",sx:{color:"#111827",whiteSpace:"nowrap",fontWeight:600}},{children:S})),lt("span",X({"aria-label":"checked",style:{color:"#111827",lineHeight:1}},{children:"✓"}))]}))]}))}))},jrr=function(e,t){return t?e.find(function(e){return("component"===e.kind?e.id:e.field)===t}):void 0},Trr=function(e,t){var r=e[t];return r&&"object"==typeof r&&"value"in r?r.value:r},Nrr=function(e,t,r){var n,o,a,i,s;if(!t)return null;var l="component"===t.kind?t.id:t.field,c=null!==(n=frr["component"===t.kind?t.componentRenderer:t.renderer])&&void 0!==n?n:frr.DefaultTextCell,u="component"===t.kind?void 0:Trr(r,l);return lt(c,X({value:u,row:r},null!==(a=null!==(o=t.rendererProps)&&void 0!==o?o:t.componentProps)&&void 0!==a?a:{},"component"===t.kind&&"PredefinedActions"===t.componentRenderer?{size:"compact"===e?"small":"medium",disabled:!orr(null==r?void 0:r.id),actions:null===(s=null!==(i=t.rendererProps)&&void 0!==i?i:t.componentProps)||void 0===s?void 0:s.actions,onEdit:function(){var e,n,o,a,i,s,l;try{var c=null===(n=null!==(e=t.rendererProps)&&void 0!==e?e:t.componentProps)||void 0===n?void 0:n.actions,u=(null==c?void 0:c.idField)||"id",d=Trr(r,u),p="string"==typeof d?d:String(null!=d?d:"");if(!(null===(o=null==c?void 0:c.edit)||void 0===o?void 0:o.enabled))return;var h=null===(i=null===(a=null==c?void 0:c.edit)||void 0===a?void 0:a.link)||void 0===i?void 0:i.internalLink;if(onInternalNavigation&&h){var f=h,m=f.length>0&&!f.endsWith("/"),v=null===(s=null==c?void 0:c.edit)||void 0===s?void 0:s.targetFormId;if(v&&(f="".concat(f).concat(m?"/":"","organismId=").concat(encodeURIComponent(v))),p){var y=f.length>0&&!f.endsWith("/");f="".concat(f).concat(y?"/":"","rwoRecordId=").concat(encodeURIComponent(p))}var g={};return v&&(g.organismId=v),p&&(g.rwoRecordId=p),void onInternalNavigation({link:f,query:g})}onAction&&onAction({action:{type:"edit_record",targetFormId:null===(l=null==c?void 0:c.edit)||void 0===l?void 0:l.targetFormId,idField:u},row:r})}catch(e){console.error("Error in list view edit action:",e)}},onView:function(){var e,n,o,a,i,s,l,c,u;try{var d=null===(n=null!==(e=t.rendererProps)&&void 0!==e?e:t.componentProps)||void 0===n?void 0:n.actions,p=(null==d?void 0:d.idField)||"id",h=Trr(r,p),f="string"==typeof h?h:String(null!=h?h:"");if(!(null===(o=null==d?void 0:d.view)||void 0===o?void 0:o.enabled))return;var m=(null===(i=null===(a=null==d?void 0:d.view)||void 0===a?void 0:a.link)||void 0===i?void 0:i.internalLink)||(null===(s=null==d?void 0:d.view)||void 0===s?void 0:s.routeKey);if(onInternalNavigation&&m){var v={},y=!1!==(null===(l=null==d?void 0:d.view)||void 0===l?void 0:l.includeRwoRecordId),g=Array.isArray(null===(c=null==d?void 0:d.view)||void 0===c?void 0:c.rwoContextMapping)?null===(u=null==d?void 0:d.view)||void 0===u?void 0:u.rwoContextMapping:[],b=S$({includeRwoRecordId:y,recordId:f||void 0,mapping:g,contextSource:r}).query;return Object.assign(v,b),f&&!v.rwoRecordId&&(v.rwoRecordId=f),void onInternalNavigation({link:m,query:v})}onAction&&onAction({action:null==d?void 0:d.view,row:r})}catch(e){console.error("Error in list view view action:",e)}},onDelete:function(){var e,n,o;try{var a=null===(n=null!==(e=t.rendererProps)&&void 0!==e?e:t.componentProps)||void 0===n?void 0:n.actions;if(!(null===(o=null==a?void 0:a.delete)||void 0===o?void 0:o.enabled))return;onAction&&onAction({action:null==a?void 0:a.delete,row:r})}catch(e){console.error("Error in list view delete action:",e)}}}:{}))},Rrr=function(e,t){if(!e)return"";var r,n="component"===e.kind?void 0:Trr(t,"component"===(r=e).kind?r.id:r.field);return null==n?"":String(n)},Frr=function(t,r){var n=t.organism,o=t.density;return t.onAction,oqt().onInternalNavigation,e.useMemo(function(){var e,t,a,i,s,l,c,u,d,p,h,f,m,v,y,g,b,x,w,k,_,C,M=(null==n?void 0:n.config)||{},S=(null===(e=null==M?void 0:M.dataRetrievalConfig)||void 0===e?void 0:e.columns)||[],D=(null===(t=null==M?void 0:M.view)||void 0===t?void 0:t.templateType)||""||"compact",O=(null===(i=null===(a=null==M?void 0:M.view)||void 0===a?void 0:a.list)||void 0===i?void 0:i.mapping)||(null===(l=null===(s=null==M?void 0:M.dataGrid)||void 0===s?void 0:s.list)||void 0===l?void 0:l.mapping)||{},P=(null===(u=null===(c=null==M?void 0:M.view)||void 0===c?void 0:c.list)||void 0===u?void 0:u.layout)||(null===(p=null===(d=null==M?void 0:M.dataGrid)||void 0===d?void 0:d.list)||void 0===p?void 0:p.layout)||{},E=function(e,t,r){var n=t.filter(function(e){return"component"!==e.kind}),o=t.filter(function(e){return"component"===e.kind});switch(e){case"fourItems":var a=t[0],i=t[1],s=t[2],l=t[3];return{topLeft:jrr(t,r.topLeftFieldId)||a,topRight:jrr(t,r.topRightFieldId)||i,bottomLeft:jrr(t,r.bottomLeftFieldId)||s,bottomRight:jrr(t,r.bottomRightFieldId)||l,meta:[],trailing:[]};case"titleSubtitleMeta":var c={primary:jrr(t,r.primaryFieldId)||n[0],secondary:jrr(t,r.secondaryFieldId)||n[1],meta:(r.metaFieldIds||[]).map(function(e){return jrr(t,e)}).filter(Boolean),trailing:(r.trailingComponentIds||[]).map(function(e){return jrr(t,e)}).filter(Boolean)};return c.meta&&0!==c.meta.length||(c.meta=n.slice(2,4)),c.trailing&&0!==c.trailing.length||(c.trailing=o),c;case"twoColumn":return c={primary:jrr(t,r.primaryFieldId)||n[0],secondary:jrr(t,r.secondaryFieldId)||n[1],meta:[],trailing:(r.trailingComponentIds||[]).map(function(e){return jrr(t,e)}).filter(Boolean)},c.trailing&&0!==c.trailing.length||(c.trailing=o),c;case"mediaLeft":return{primary:n[0],secondary:n[1],meta:n.slice(2,3),trailing:o};case"custom":return a=t[0],i=t[1],s=t[2],l=t[3],{topLeft:jrr(t,r.topLeftFieldId)||a,topRight:jrr(t,r.topRightFieldId)||i,bottomLeft:jrr(t,r.bottomLeftFieldId)||s,bottomRight:jrr(t,r.bottomRightFieldId)||l,meta:[],trailing:[]};default:var u=n[2];return{primary:n[0],secondary:n[1],meta:[],trailing:ee([u],o,!0).filter(Boolean)}}}(D,S,O),j=function(e,t){return{gap:"custom"===e&&Number.isFinite(t.gap)?t.gap:12,verticalGap:"custom"===e&&Number.isFinite(t.verticalGap)?t.verticalGap:4,trailingDirection:"custom"===e&&t.trailingDirection||"horizontal",templateColumns:"custom"===e&&t.templateColumns?t.templateColumns:"minmax(0,1fr) auto",item:"custom"===e?{padding:t.itemPadding,backgroundColor:t.itemBackgroundColor,borderColor:t.itemBorderColor,borderRadius:t.itemBorderRadius,boxShadow:t.itemBoxShadow}:void 0}}(D,P),T=(null===(f=null===(h=null==M?void 0:M.props)||void 0===h?void 0:h.listItem)||void 0===f?void 0:f.sx)||{},N=X(X({},j),{item:X(X({},j.item||{}),{padding:null!==(m=T.padding)&&void 0!==m?m:null===(v=j.item)||void 0===v?void 0:v.padding,paddingX:T.paddingX,paddingY:T.paddingY,marginX:T.marginX,marginY:T.marginY,backgroundColor:null!==(y=T.backgroundColor)&&void 0!==y?y:null===(g=j.item)||void 0===g?void 0:g.backgroundColor,borderColor:null!==(b=T.borderColor)&&void 0!==b?b:null===(x=j.item)||void 0===x?void 0:x.borderColor,borderRadius:null!==(w=T.borderRadius)&&void 0!==w?w:null===(k=j.item)||void 0===k?void 0:k.borderRadius,boxShadow:null!==(_=T.boxShadow)&&void 0!==_?_:null===(C=j.item)||void 0===C?void 0:C.boxShadow})}),R=function(e,t,r,n,o){var a,i,s=function(e){return e.map(function(e){return{field:e.field}})}(o);return"subjectCard"===e?{field:"listItem",renderCell:function(e){return lt(Srr,{params:e,cfgCols:n,columns:s,config:{backgroundColor:"#FFFFFF",borderColor:"#E5E7EB",borderRadius:1,avatarBgColor:"#E6F6FF",avatarTextColor:"#0047B2",textColor:"#111827",secondaryTextColor:"#6B7280"}})}}:"studyCard"===e?{field:"listItem",renderCell:function(e){var t,n,a,i,s,l;return lt(wrr,{params:e,borderRadius:null!==(n=null===(t=r.item)||void 0===t?void 0:t.borderRadius)&&void 0!==n?n:2,backgroundColor:null!==(i=null===(a=r.item)||void 0===a?void 0:a.backgroundColor)&&void 0!==i?i:"#FFFFFF",borderColor:null!==(l=null===(s=r.item)||void 0===s?void 0:s.borderColor)&&void 0!==l?l:"#E5E7EB",avatarBackgroundColor:"#E6F6FF",avatarTextColor:"#0047B2",stripeColor:"rgba(255, 174, 23, 0.25)",titleColor:"#111827",subtitleColor:"#6B7280",companyColor:"#111827",columns:o})}}:"custom"===e?Boolean((null==t?void 0:t.topLeft)||(null==t?void 0:t.topRight)||(null==t?void 0:t.bottomLeft)||(null==t?void 0:t.bottomRight)||(null==t?void 0:t.primary)||(null==t?void 0:t.secondary)||(null===(a=(null==t?void 0:t.meta)||[])||void 0===a?void 0:a.length)||(null===(i=(null==t?void 0:t.trailing)||[])||void 0===i?void 0:i.length))?{field:"listItem",renderCell:function(e){return lt(yrr,{params:e,areas:t,layout:{gap:r.gap,verticalGap:r.verticalGap,trailingDirection:r.trailingDirection,templateColumns:r.templateColumns,item:r.item}})}}:{field:"listItem",renderCell:function(e){return lt(Err,{params:e,columns:s})}}:"visitCard"===e?{field:"listItem",renderCell:function(e){return lt(Orr,{params:e,columns:s,layout:{item:r.item}})}}:"visitCardCheck"===e?{field:"listItem",renderCell:function(e){return lt(Err,{params:e,columns:s,layout:{item:r.item}})}}:"fourItems"===e?(n||[]).length>0?{field:"listItem",renderCell:function(e){return lt(brr,{params:e,cfgCols:n,columns:s,layout:{gap:r.gap,verticalGap:r.verticalGap,trailingDirection:r.trailingDirection,item:r.item}})}}:{field:"listItem",renderCell:function(e){return lt(Err,{params:e,columns:s})}}:"compact"===e||"mediaLeft"===e||"titleSubtitleMeta"===e||"twoColumn"===e?{field:"listItem",renderCell:function(e){return lt(Err,{params:e,columns:s,layout:{item:r.item}})}}:void 0}(D,E,N,S,r);return R||{field:"listItem",renderCell:function(e){var t,r,n,a,i,s=(null==e?void 0:e.row)||{},l=E.secondary?void 0:null!==(n=null!==(r=null!==(t=Trr(s,"email"))&&void 0!==t?t:Trr(s,"studyCode"))&&void 0!==r?r:Trr(s,"position"))&&void 0!==n?n:void 0,c=E.trailing&&E.trailing.length?void 0:null!==(i=null!==(a=Trr(s,"timeRange"))&&void 0!==a?a:Trr(s,"status"))&&void 0!==i?i:void 0;return ct("div",X({role:"listitem","aria-label":String([E.primary?Rrr(E.primary,s):void 0,E.secondary?Rrr(E.secondary,s):void 0].filter(Boolean).join(" — ")),style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:j.gap,width:"100%"}},{children:[ct("div",X({style:{minWidth:0,flex:1},"aria-label":"list-item-text"},{children:[E.primary?lt("div",X({style:{fontWeight:600,color:"#111827",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},{children:Nrr(o,E.primary,s)})):null,E.secondary||l?lt("div",X({style:{fontSize:12,color:"#6B7280",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},{children:E.secondary?"component"===E.secondary.kind?Nrr(o,E.secondary,s):Rrr(E.secondary,s):String(l)})):null,E.meta&&E.meta.length?lt("div",X({style:{marginTop:j.verticalGap,display:"inline-flex",gap:8,flexWrap:"wrap"},"aria-label":"list-item-meta"},{children:E.meta.map(function(e,t){return lt("span",X({style:{fontSize:11,color:"#374151",background:"#F3F4F6",borderRadius:10,padding:"2px 8px"}},{children:"component"===e.kind?Nrr(o,e,s):Rrr(e,s)}),t)})})):null]})),lt("div",X({"aria-label":"list-item-actions",style:"vertical"===j.trailingDirection?{display:"grid",justifyItems:"end",alignContent:"center",rowGap:8,height:"100%",flexShrink:0}:{display:"inline-flex",alignItems:"center",gap:8,flexShrink:0}},{children:E.trailing&&E.trailing.length||c?(E.trailing||[]).map(function(e,t){return lt("span",{children:"component"===e.kind?Nrr(o,e,s):Rrr(e,s)},"t-".concat(t))}).concat(E.trailing&&E.trailing.length?[]:c?[lt("span",X({style:{color:"#111827"}},{children:String(c)}),"fallback-trailing")]:[]):null}))]}))}}},[n,o,r])},zrr=function(e,t){var r=e[t];return r&&"object"==typeof r&&"value"in r?r.value:r},Irr=function(t){var r,o,a,i,s,l,c=(null===(r=null==t?void 0:t.organism)||void 0===r?void 0:r.id)||"",u=e.useMemo(function(){var e;return(null===(e=null==t?void 0:t.organism)||void 0===e?void 0:e.config)||{}},[null==t?void 0:t.organism]),d=e.useMemo(function(){var e;return{columns:(null===(e=null==u?void 0:u.dataRetrievalConfig)||void 0===e?void 0:e.columns)||[],toolbar:(null==u?void 0:u.toolbar)||{}}},[u]),p=e.useMemo(function(){return(null==u?void 0:u.toolbar)||{}},[u]),h=e.useState(""),f=h[0],m=h[1],v=e.useState(0),y=v[0],g=v[1],b=e.useState(25),x=b[0],w=b[1],k=e.useState({}),_=k[0],C=k[1],M=e.useState(null!==(i=null!==(a=null===(o=d.toolbar)||void 0===o?void 0:o.densityDefault)&&void 0!==a?a:null==p?void 0:p.densityDefault)&&void 0!==i?i:"comfortable"),S=M[0],D=M[1],O=e.useState(!1),P=O[0],E=O[1],j=rrr(c).rwoRecordId,T=function(t){var r,o,a,i,s,l=t.organismId,c=t.query,u=pqt().dataGrid,d=lqt().stateConfig,p=rrr(l).rwoRecordId,h=e.useMemo(function(){var e="data_grid:organism:".concat(l),t=null==d?void 0:d[e];return"number"==typeof t?t:0},[d,l]),f=e.useMemo(function(){return X(X({},c),{rwoRecordId:p||c.rwoRecordId})},[c,p]),m=n.useQuery({queryKey:[x$,l,f.page,f.pageSize,null!==(r=f.search)&&void 0!==r?r:"",JSON.stringify(null!==(o=f.quickFilters)&&void 0!==o?o:{}),null!==(a=f.rwoRecordId)&&void 0!==a?a:"",h],queryFn:function(){return Q(void 0,void 0,void 0,function(){var e,t,r;return J(this,function(n){switch(n.label){case 0:if(!u)throw new Error("DataGrid API not available");return[4,u.getOrganismData(l,f)];case 1:if(e=n.sent(),t=null==e?void 0:e.data,!(r=null==t?void 0:t.data)||"object"!=typeof r)throw new Error("Invalid data grid response");return[2,r]}})})},enabled:Boolean(u&&l),staleTime:6e4,gcTime:3e5}),v=m.data,y=m.isLoading,g=m.error,b=m.refetch;return{rows:null!==(i=null==v?void 0:v.rows)&&void 0!==i?i:[],total:null!==(s=null==v?void 0:v.total)&&void 0!==s?s:0,isLoading:y,error:g,refetch:b,refreshSignal:h}}({organismId:c,query:e.useMemo(function(){return X({page:y,pageSize:x,search:f,quickFilters:_},j?{rwoRecordId:j}:{})},[y,x,f,_,j])}),N=T.rows,R=T.total,F=T.isLoading,z=T.error,I=T.refetch,A=e.useMemo(function(){try{return(N||[]).some(function(e){return!orr(null==e?void 0:e.id)})}catch(e){return!1}},[N]),L=e.useMemo(function(){var e=Object.entries(_).flatMap(function(e){var t=e[0],r=e[1],n=Array.isArray(r)?r.filter(Boolean):[r].filter(Boolean);return 0===n.length?[]:[{field:t,operator:"isAnyOf",value:n}]});return{items:e,logicOperator:"and"}},[_]),B=d.toolbar&&Object.keys(d.toolbar).length?d.toolbar:p||{},V=!1!==(null==B?void 0:B.densityToggle),H=null!==(s=null==B?void 0:B.quickFilters)&&void 0!==s?s:[],q=!1!==(null==B?void 0:B.search),$=!1!==(null==B?void 0:B.exportCsv)&&!A,W=e.useMemo(function(){var e;return((null===(e=null==u?void 0:u.dataRetrievalConfig)||void 0===e?void 0:e.columns)||[]).map(function(e){return"".concat(("component"===e.kind?e.id:e.field)||"",":").concat(e.headerName||"",":").concat(e.width||"")}).join("|")},[u]),U=jtr(),G=mat().isMobile,K=(null===(l=null==u?void 0:u.view)||void 0===l?void 0:l.viewType)||"table",Y="auto"===K?G?"list":"table":K,Z=function(t){var r,n=t.organism,o=t.density,a=t.onAction,i=t.apiRef,s=oqt().onInternalNavigation,l=mnt,c=(null==n?void 0:n.config)||{},u=(null===(r=null==c?void 0:c.dataRetrievalConfig)||void 0===r?void 0:r.columns)||[],d=e.useMemo(function(){return u.map(function(e){return"".concat(("component"===e.kind?e.id:e.field)||"",":").concat(e.headerName||"",":").concat(e.width||"")}).join("|")},[u]),p=e.useMemo(function(){return u.map(function(e){var t,r="component"===e.kind?"__component_".concat(e.id):e.field,n=null!==(t=frr["component"===e.kind?e.componentRenderer:e.renderer])&&void 0!==t?t:frr.DefaultTextCell,c="component"===e.kind&&"ActionButtonCell"===e.componentRenderer,u="component"===e.kind&&"PredefinedActions"===e.componentRenderer,d={field:r,headerName:e.headerName,width:e.width,sortable:Boolean(e.sortable),filterable:e.filterable,renderHeader:function(){return ct(nh,X({sx:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"}},{children:[ct(nh,X({sx:{display:"inline-flex",alignItems:"center",gap:.5}},{children:[e.titleIconName?lt(l,{iconName:e.titleIconName,size:14}):null,lt("span",{children:e.headerName})]})),e.filterable&&lt(yc,X({"aria-label":"open-filter-".concat(r),size:"small",onClick:function(e){var t,n;e.stopPropagation();try{null===(n=null===(t=i.current)||void 0===t?void 0:t.showFilterPanel)||void 0===n||n.call(t,r)}catch(e){}},sx:{ml:.5,color:"#9CA3AF","& svg":{display:"block"}}},{children:lt(l,{iconName:"filter",size:16})}))]}))},renderCell:function(t){var i,l,d,p=zrr(t.row,r);return lt(n,X({value:p,row:t.row},null!==(l=null!==(i=e.rendererProps)&&void 0!==i?i:e.componentProps)&&void 0!==l?l:{},c?{onClick:function(){return null==a?void 0:a({action:e.actionConfig,row:t.row})},disabled:!orr(zrr(t.row,"id"))}:{},u?{actions:null===(d=e.componentProps)||void 0===d?void 0:d.actions,size:"compact"===o?"small":"medium",disabled:!orr(zrr(t.row,"id")),onEdit:function(){var r,n,o,i,l,c,u,d,p,h,f,m,v,y=(null===(n=null===(r=e.componentProps)||void 0===r?void 0:r.actions)||void 0===n?void 0:n.idField)||"id",g=zrr(t.row,y),b="string"==typeof g?g:String(null!=g?g:""),x=(null===(o=e.rendererProps)||void 0===o?void 0:o.editLink)||(null===(u=null===(c=null===(l=null===(i=e.componentProps)||void 0===i?void 0:i.actions)||void 0===l?void 0:l.edit)||void 0===c?void 0:c.link)||void 0===u?void 0:u.internalLink);if(s&&x){var w=x,k=w.length>0&&!w.endsWith("/"),_=null===(h=null===(p=null===(d=e.componentProps)||void 0===d?void 0:d.actions)||void 0===p?void 0:p.edit)||void 0===h?void 0:h.targetFormId;if(_&&(w="".concat(w).concat(k?"/":"","organismId=").concat(encodeURIComponent(_))),b){var C=w.length>0&&!w.endsWith("/");w="".concat(w).concat(C?"/":"","rwoRecordId=").concat(encodeURIComponent(b))}var M={};return _&&(M.organismId=_),b&&(M.rwoRecordId=b),void s({link:w,query:M})}null==a||a({action:{type:"edit_record",targetFormId:null===(v=null===(m=null===(f=e.componentProps)||void 0===f?void 0:f.actions)||void 0===m?void 0:m.edit)||void 0===v?void 0:v.targetFormId,idField:y},row:t.row})},onView:function(){var r,n,o,i,l,c,u,d,p,h,f,m=(null===(n=null===(r=e.componentProps)||void 0===r?void 0:r.actions)||void 0===n?void 0:n.idField)||"id",v=zrr(t.row,m),y="string"==typeof v?v:String(null!=v?v:""),g=(null===(c=null===(l=null===(i=null===(o=e.componentProps)||void 0===o?void 0:o.actions)||void 0===i?void 0:i.view)||void 0===l?void 0:l.link)||void 0===c?void 0:c.internalLink)||(null===(p=null===(d=null===(u=e.componentProps)||void 0===u?void 0:u.actions)||void 0===d?void 0:d.view)||void 0===p?void 0:p.routeKey);if(s&&g){var b=g,x={},w=(null===(f=null===(h=e.componentProps)||void 0===h?void 0:h.actions)||void 0===f?void 0:f.view)||{},k=!1!==(null==w?void 0:w.includeRwoRecordId),_=Array.isArray(null==w?void 0:w.rwoContextMapping)?w.rwoContextMapping:[],C=S$({includeRwoRecordId:k,recordId:y||void 0,mapping:_,contextSource:t.row}).query;return Object.assign(x,C),y&&!x.rwoRecordId&&(x.rwoRecordId=y),void s({link:b,query:x})}null==a||a({action:{type:"view_record_details",routeKey:g||"",idField:m},row:t.row})},onDelete:function(){var r,n,o,i,s,l;return null==a?void 0:a({action:{type:"delete_record",apiKey:null!==(i=null===(o=null===(n=null===(r=e.componentProps)||void 0===r?void 0:r.actions)||void 0===n?void 0:n.delete)||void 0===o?void 0:o.apiKey)&&void 0!==i?i:"delete",idField:null===(l=null===(s=e.componentProps)||void 0===s?void 0:s.actions)||void 0===l?void 0:l.idField},row:t.row})}}:{}))}};return d})},[u,o,a,i,s,l]);return{columns:p,columnsKey:d}}({organism:t.organism,density:S,onAction:t.onAction,apiRef:U}),te=function(t){var r,n=t.organism,o=t.density,a=t.onAction,i=(null==n?void 0:n.config)||{},s=(null===(r=null==i?void 0:i.dataRetrievalConfig)||void 0===r?void 0:r.columns)||[],l=e.useMemo(function(){return s.filter(function(e){return"component"!==e.kind}).map(function(e){var t;return{field:("component"===e.kind?e.id:e.field)||e.field||e.id,headerName:e.headerName||e.field||e.id,width:e.width||120,hide:!0,sortable:Boolean(e.sortable),filterable:Boolean(null===(t=e.filterable)||void 0===t||t)}})},[s]);return{hiddenColumns:l,listViewColumn:Frr({organism:n,density:o,onAction:a},l),columnsKey:e.useMemo(function(){return s.map(function(e){return"".concat(("component"===e.kind?e.id:e.field)||"",":").concat(e.headerName||"",":").concat(e.width||"")}).join("|")},[s])}}({organism:t.organism,density:S,onAction:t.onAction}),re="table"===Y?Z.columns:te.hiddenColumns;return{organismId:c,configuration:d,rows:N,total:R,isLoading:F,error:z,page:y,pageSize:x,search:f,quickFilters:_,density:S,showSearch:P,filterModel:L,densityToggle:V,quickFiltersCfg:H,showSearchControl:q,showExport:$,columnsKey:("table"===Y?Z.columnsKey:te.columnsKey)||W,apiRef:U,columns:re,listViewColumn:te.listViewColumn,resolvedView:Y,setPage:g,setPageSize:w,setSearch:m,setQuickFilter:function(e,t){C(function(r){var n=X({},r);if(""===t)return delete n[e],n;var o=n[e];if(Array.isArray(o))if(o.includes(t)){var a=o.filter(function(e){return e!==t});0===a.length?delete n[e]:n[e]=a}else n[e]=ee(ee([],o,!0),[t],!1);else o?o===t?delete n[e]:n[e]=[o,t]:n[e]=t;return n})},setDensity:D,setShowSearch:E,refetch:I}},Arr=function(e){var t=e.rows,r=e.total,n=e.isLoading,o=e.error,a=e.page,i=e.pageSize,s=e.density,l=e.filterModel,c=e.listViewColumn,u=e.hiddenColumns,d=e.columnsKey,p=e.apiRef,h=e.setPage,f=e.setPageSize,m=e.gridStyles;if(o)return null;var v=Number(null==m?void 0:m.rowHeight)||64,y=Number(null==m?void 0:m.rowGap),g=Number.isFinite(y)?y:8;return lt(Etr,{apiRef:p,rows:t.map(function(e,t){var r,n=(r=e["id"])&&"object"==typeof r&&null!==r&&"value"in r?r.value:r,o=null==n||""===n;return X(X({},e),{id:null!=n?n:"".concat(t),__unsafeRowId:o})}),columns:u,listView:!0,listViewColumn:c,filterModel:l,pagination:!0,paginationModel:{page:a,pageSize:i},onPaginationModelChange:function(e){h(e.page),f(e.pageSize)},density:s,loading:n,rowCount:r,paginationMode:"client",rowSelectionModel:{type:"include",ids:new Set},onRowSelectionModelChange:function(){},disableRowSelectionOnClick:!0,isRowSelectable:function(){return!1},onRowClick:function(e,t){t&&"object"==typeof t&&(t.defaultMuiPrevented=!0,"function"==typeof t.stopPropagation&&t.stopPropagation())},onCellClick:function(e,t){t&&"object"==typeof t&&(t.target.closest('[data-action-button="true"], [data-action-link="true"], button, [role="button"], .MuiButton-root, .MuiIconButton-root, a[href]')||(t.defaultMuiPrevented=!0,"function"==typeof t.stopPropagation&&t.stopPropagation()))},autoHeight:!1,getRowHeight:function(){return v},getRowSpacing:function(e){return{top:e.isFirstVisible?0:g,bottom:e.isLastVisible?0:g}},sx:X(X({},m),{border:"none","--DataGrid-rowBorderColor":"transparent","--DataGrid-rowHoverBackground":"transparent","--DataGrid-selectedRowBackground":"transparent","& .MuiDataGrid-withBorderColor":{borderColor:"transparent"},"& .MuiDataGrid-row":{borderBottom:"none",alignItems:"stretch"},"& .MuiDataGrid-row:hover":{backgroundColor:"transparent"},"& .MuiDataGrid-row.Mui-selected, & .MuiDataGrid-row.Mui-selected:hover":{backgroundColor:"transparent"},"& .MuiDataGrid-cell":{outline:"none"}}),slots:{noRowsOverlay:void 0},slotProps:{loadingOverlay:{variant:"linear-progress",noRowsVariant:"skeleton"}}},d)},Lrr=function(e){var t=e.rows,r=e.total,n=e.isLoading,o=e.error,a=e.page,i=e.pageSize,s=e.density,l=e.filterModel,c=e.columns,u=e.columnsKey,d=e.apiRef,p=e.setPage,h=e.setPageSize,f=e.gridStyles;return o?null:lt(Etr,{apiRef:d,rows:t.map(function(e,t){var r,n=(r=e["id"])&&"object"==typeof r&&null!==r&&"value"in r?r.value:r,o=null==n||""===n;return X(X({},e),{id:null!=n?n:"".concat(t),__unsafeRowId:o})}),columns:c,filterModel:l,pagination:!0,paginationModel:{page:a,pageSize:i},onPaginationModelChange:function(e){p(e.page),h(e.pageSize)},density:s,loading:n,rowCount:r,paginationMode:"client",disableRowSelectionOnClick:!0,autoHeight:!0,sx:f,slots:{noRowsOverlay:void 0},slotProps:{loadingOverlay:{variant:"linear-progress",noRowsVariant:"skeleton"}}},u)},Brr=function(e){var t,r,n,o,a,i=e.controlHeight,s=e.density,l=e.styles,c=e.setDensity,u=l||{};return lt(nh,X({sx:{background:null!==(t=u.backgroundColor)&&void 0!==t?t:"#F7F5FF",borderRadius:null!==(r=u.borderRadius)&&void 0!==r?r:3,px:1,py:.5,display:"inline-flex",alignItems:"center"}},{children:ct(Pk,X({size:"small",exclusive:!0,value:s,onChange:function(e,t){t&&c(t)},"aria-label":"table-density",sx:{"& .MuiToggleButton-root":{textTransform:"none",height:i,px:2,py:0,fontSize:14,lineHeight:1.2,borderRadius:"".concat(null!==(n=u.borderRadius)&&void 0!==n?n:10,"px"),border:"none",color:"#6B7280",background:"transparent"},"& .MuiToggleButton-root + .MuiToggleButton-root":{ml:1},"& .MuiToggleButton-root.Mui-selected":{fontWeight:700,color:null!==(o=u.selectedTextColor)&&void 0!==o?o:"#3F3F46",background:null!==(a=u.selectedBackgroundColor)&&void 0!==a?a:"#FFFFFF",border:"1px solid #E2E4EA",boxShadow:"0 2px 6px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06)"}}},{children:[lt(Ck,X({value:"compact","aria-label":"Compact"},{children:"Compact"})),lt(Ck,X({value:"comfortable","aria-label":"Comfortable"},{children:"Comfortable"}))]}))}))},Vrr=function(e){var t,r,n,o,a,i,s=e.controlHeight,l=e.styles,c=e.apiRef,u=mnt,d=l||{};return lt(yc,X({"aria-label":"export-csv",size:"small",onClick:function(){var e,t;return null===(t=null===(e=c.current)||void 0===e?void 0:e.exportDataAsCsv)||void 0===t?void 0:t.call(e)},sx:{display:"flex",alignItems:"center",justifyContent:"center",lineHeight:0,p:0,width:s,height:s,borderRadius:null!==(t=d.borderRadius)&&void 0!==t?t:2,background:null!==(r=d.backgroundColor)&&void 0!==r?r:"#FFFFFF",border:"1px solid ".concat(null!==(n=d.borderColor)&&void 0!==n?n:"#E2E4EA"),boxShadow:"0 2px 6px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04)",color:null!==(o=d.iconColor)&&void 0!==o?o:"#6C4CF5","& svg":{display:"block"},"&:hover":{background:null!==(a=d.backgroundColor)&&void 0!==a?a:"#FFFFFF",borderColor:null!==(i=d.borderColor)&&void 0!==i?i:"#D7DAE2",boxShadow:"0 3px 8px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.05)"}}},{children:lt(u,{iconName:"download",size:20})}))},Hrr=function(e){var t,r=e.controlHeight,n=e.quickFiltersCfg,o=e.quickFilters,a=e.styles,i=e.setQuickFilter,s=a||{};return n.length?lt(nh,X({sx:{minWidth:0,overflowX:"auto",pr:1,flexShrink:0}},{children:lt(nh,X({sx:{display:"inline-flex",alignItems:"center",gap:"".concat(null!==(t=s.chipGap)&&void 0!==t?t:8,"px"),px:"6px",py:"4px",borderRadius:"8px",background:"#FAFAFF",whiteSpace:"nowrap"}},{children:n.map(function(e){var t,n,a,l,c,u=o[e.columnField],d=Array.isArray(u)?u.includes(e.value):u===e.value,p=""===e.value,h=p&&(void 0===u||Array.isArray(u)&&0===u.length),f=e.color||s.chipBackgroundColor,m=s.selectedChipColor||f;return lt("button",X({"aria-label":e.label,"aria-pressed":p?h:d,onClick:function(){return i(e.columnField,e.value)},style:{height:r,padding:p?"0 14px":"0 12px",border:p||d||h?"1px solid ".concat(null!==(n=null!==(t=s.chipBorderColor)&&void 0!==t?t:f)&&void 0!==n?n:"#E5E7EB"):"none",borderRadius:p?null!==(a=s.chipBorderRadius)&&void 0!==a?a:10:d?null!==(l=s.chipBorderRadius)&&void 0!==l?l:10:0,background:p||d||h?d||h?null!=m?m:"#FFFFFF":null!=f?f:"#FFFFFF":"transparent",boxShadow:p&&h||!p&&d?"0 1px 2px rgba(0,0,0,0.06)":void 0,color:d?"#111827":null!==(c=s.chipTextColor)&&void 0!==c?c:"#6B7280",fontWeight:d||p&&h?700:500,fontSize:13,cursor:"pointer",transition:"transform 80ms ease, box-shadow 120ms ease"},onMouseDown:function(e){var t=e.currentTarget;t.style.transform="translateY(1px)",t.style.boxShadow=p?"0 0 0 rgba(0,0,0,0.0)":t.style.boxShadow||""},onMouseUp:function(e){e.currentTarget.style.transform="translateY(0)"}},{children:e.label}),e.label)})}))})):null},qrr=function(e){var t,r,n,o,a=e.controlHeight,i=e.searchWidth,s=e.search,l=e.showSearch,c=e.config,u=e.setSearch,d=e.setShowSearch,p=mnt,h=c||{};return lt(nh,X({sx:{width:l||Boolean(s)?"".concat(i,"px"):"".concat(a,"px"),transition:"width 250ms ease"}},{children:l||Boolean(s)?lt(fk,{"aria-label":"grid-search",size:"small",value:s,autoFocus:Boolean(h.autoFocus),onBlur:function(){s||d(!1)},onChange:function(e){return u(e.target.value)},placeholder:h.placeholder||"Search",fullWidth:!0,sx:{"& .MuiInputBase-root":{height:"".concat(a,"px"),borderRadius:h.borderRadius,background:h.backgroundColor},"& .MuiOutlinedInput-notchedOutline":{borderColor:h.borderColor},"& .MuiOutlinedInput-input":{py:0},"& .MuiInputAdornment-root svg":{transform:"translate(1px, 0.5px)"}},InputProps:{startAdornment:lt(Qm,X({position:"start"},{children:lt(p,{iconName:"search",size:16})}))}}):lt(nh,X({sx:{width:a,height:a}},{children:lt(yc,X({"aria-label":"open-search",size:"small",onClick:function(){return d(!0)},sx:{display:"grid",placeItems:"center",lineHeight:0,p:0,width:"100%",height:"100%",borderRadius:2,background:null!==(t=h.backgroundColor)&&void 0!==t?t:"#FFFFFF",border:"1px solid ".concat(null!==(r=h.borderColor)&&void 0!==r?r:"#E2E4EA"),boxShadow:"0 2px 6px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04)",color:"#6C4CF5","& svg":{display:"block",margin:0,transform:"translate(1px, 0.5px)"},"&:hover":{background:null!==(n=h.backgroundColor)&&void 0!==n?n:"#FFFFFF",borderColor:null!==(o=h.borderColor)&&void 0!==o?o:"#D7DAE2",boxShadow:"0 3px 8px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.05)"}}},{children:lt(p,{iconName:"search",size:20})}))}))}))},$rr=function(e){var t,r,n,o,a,i,s,l,c,u,d,p,h,f,m,v,y,g,b,x,w,k,_,C,M,S,D=e.cfgRoot,O=e.densityToggle,P=e.quickFiltersCfg,E=e.showSearchControl,j=e.showExport,T=e.search,N=e.showSearch,R=e.density,F=e.apiRef,z=e.quickFilters,I=e.setQuickFilter,A=e.setDensity,L=e.setSearch,B=e.setShowSearch,V=null!==(o=null===(n=null===(r=null===(t=null==D?void 0:D.props)||void 0===t?void 0:t.toolbarContainer)||void 0===r?void 0:r.sx)||void 0===n?void 0:n.controlHeight)&&void 0!==o?o:44,H=null!==(l=null===(s=null===(i=null===(a=null==D?void 0:D.props)||void 0===a?void 0:a.toolbarContainer)||void 0===i?void 0:i.sx)||void 0===s?void 0:s.searchWidth)&&void 0!==l?l:360,q=null!==(p=null===(d=null===(u=null===(c=null==D?void 0:D.props)||void 0===c?void 0:c.toolbarContainer)||void 0===u?void 0:u.sx)||void 0===d?void 0:d.marginTop)&&void 0!==p?p:1,$=null!==(v=null===(m=null===(f=null===(h=null==D?void 0:D.props)||void 0===h?void 0:h.toolbarContainer)||void 0===f?void 0:f.sx)||void 0===m?void 0:m.columnGap)&&void 0!==v?v:1,W=(null===(g=null===(y=null==D?void 0:D.props)||void 0===y?void 0:y.toolbarContainer)||void 0===g?void 0:g.sx)||{},U=(null===(x=null===(b=null==D?void 0:D.props)||void 0===b?void 0:b.quickFiltersGroup)||void 0===x?void 0:x.sx)||{},G=(null===(k=null===(w=null==D?void 0:D.props)||void 0===w?void 0:w.exportButton)||void 0===k?void 0:k.sx)||{},K=(null===(C=null===(_=null==D?void 0:D.props)||void 0===_?void 0:_.densityToggleContainer)||void 0===C?void 0:C.sx)||{},Y=(null===(M=null==D?void 0:D.toolbar)||void 0===M?void 0:M.searchControl)||{};return ct(nh,X({sx:{display:"grid",gridTemplateColumns:"auto 1fr auto",alignItems:"center",mt:q,columnGap:$}},{children:[lt(Hrr,{controlHeight:V,quickFiltersCfg:P,quickFilters:z,styles:U,setQuickFilter:I}),lt(nh,{}),ct(nh,X({sx:{display:"inline-flex",alignItems:"center",gap:null!==(S=W.gap)&&void 0!==S?S:1.5,flexShrink:0,justifySelf:"end",background:W.backgroundColor,border:W.borderColor?"1px solid ".concat(W.borderColor):void 0,borderRadius:W.borderRadius}},{children:[E&&lt(qrr,{controlHeight:V,searchWidth:H,search:T,showSearch:N,config:Y,setSearch:L,setShowSearch:B}),O&&lt(Brr,{controlHeight:V,density:R,styles:K,setDensity:A}),j&&lt(Vrr,{controlHeight:V,styles:G,apiRef:F})]}))]}))},Wrr=e.memo(function(e){var t,r,n,o,a,i,s=e.organism,l=e.onAction,c=e.errorState,u=Irr({organism:s,onAction:l}),d=u.rows,p=u.total,h=u.isLoading,f=u.error,m=u.page,v=u.pageSize,y=u.search,g=u.quickFilters,b=u.density,x=u.showSearch,w=u.filterModel,k=u.densityToggle,_=u.quickFiltersCfg,C=u.showSearchControl,M=u.showExport,S=u.columnsKey,D=u.setPage,O=u.setPageSize,P=u.setSearch,E=u.setQuickFilter,j=u.setDensity,T=u.setShowSearch,N=u.columns,R=u.listViewColumn,F=u.resolvedView,z=u.apiRef,I=(null==s?void 0:s.config)||{},A=(null===(r=null===(t=null==I?void 0:I.props)||void 0===t?void 0:t.rootContainer)||void 0===r?void 0:r.sx)||{},L=(null===(o=null===(n=null==I?void 0:I.props)||void 0===n?void 0:n.dataGridWrapper)||void 0===o?void 0:o.sx)||{},B=(null===(i=null===(a=null==I?void 0:I.props)||void 0===a?void 0:a.dataGrid)||void 0===i?void 0:i.sx)||{},V=N;return f?lt(st,{children:c?c(f):lt(Ic,X({color:"error"},{children:f.message}))}):lt(nh,X({sx:{background:null==A?void 0:A.backgroundColor,px:null==A?void 0:A.paddingX,py:null==A?void 0:A.paddingY,mx:null==A?void 0:A.marginX,my:null==A?void 0:A.marginY}},{children:ct(nh,X({sx:{background:L.backgroundColor,border:L.borderColor?"1px solid ".concat(L.borderColor):void 0,borderRadius:L.borderRadius,px:L.paddingX,py:L.paddingY,mx:L.marginX,my:L.marginY,boxShadow:L.boxShadow||("number"==typeof L.elevation&&L.elevation>0?"0 2px 6px rgba(0,0,0,0.06)":void 0)}},{children:[lt($rr,{cfgRoot:I,densityToggle:k,quickFiltersCfg:_,showSearchControl:C,showExport:M,search:y,showSearch:x,density:b,apiRef:z,quickFilters:g,setQuickFilter:E,setDensity:j,setSearch:P,setShowSearch:T}),lt(nh,X({mt:2},{children:"list"===F?lt(Arr,{rows:d,total:p,isLoading:h,error:f,page:m,pageSize:v,density:b,filterModel:w,listViewColumn:R,hiddenColumns:V,columnsKey:S,apiRef:z,setPage:D,setPageSize:O,gridStyles:X(X({minHeight:320},B),{background:null==B?void 0:B.backgroundColor,"& .MuiDataGrid-row:hover":{background:null==B?void 0:B.rowHoverColor}})}):lt(Lrr,{rows:d,total:p,isLoading:h,error:f,page:m,pageSize:v,density:b,filterModel:w,columns:V,columnsKey:S,apiRef:z,setPage:D,setPageSize:O,gridStyles:X(X({minHeight:320},B),{background:null==B?void 0:B.backgroundColor,"& .MuiDataGrid-columnHeaders":{background:null==B?void 0:B.headerBackgroundColor,"& .MuiDataGrid-columnHeaderTitle":{fontSize:null==B?void 0:B.headerFontSize}},"& .MuiDataGrid-row:hover":{background:null==B?void 0:B.rowHoverColor}})})}))]}))}))});Wrr.displayName="DataGridOrganism";var Urr=function(t,r,o){var a,i,s=pqt().calendar,l=e.useMemo(function(){return r?r.toISOString():void 0},[r]),c=e.useMemo(function(){return o?o.toISOString():void 0},[o]),u=n.useQuery({queryKey:[b$,t,null!=l?l:"",null!=c?c:""],queryFn:function(){return Q(void 0,void 0,void 0,function(){var e,n,a,i,l;return J(this,function(c){switch(c.label){case 0:if(!s)throw new Error("Calendar API not available");return[4,s.getOrganismData(t,{start:null!=r?r:new Date("1970-01-01"),end:null!=o?o:new Date("2100-12-31")})];case 1:if(e=c.sent(),n=null==e?void 0:e.data,!(a=null==n?void 0:n.data))throw new Error("Invalid calendar data response");return[2,{events:null!==(i=a.events)&&void 0!==i?i:[],resources:null!==(l=a.resources)&&void 0!==l?l:[]}]}})})},enabled:Boolean(s&&t),staleTime:3e5,gcTime:6e5}),d=u.data,p=u.isLoading,h=u.error,f=u.refetch;return{events:null!==(a=null==d?void 0:d.events)&&void 0!==a?a:[],resources:null!==(i=null==d?void 0:d.resources)&&void 0!==i?i:[],isLoading:p,error:h,refetch:f}},Grr=function(e){var t,r,n=null===(r=null===(t=null==e?void 0:e.row)||void 0===t?void 0:t.__rangesInfo)||void 0===r?void 0:r[String(null==e?void 0:e.field)];if(!n||!n.active)return null;var o=n.color||"#E8F5E9",a=0;switch(n.part){case"single":a=12;break;case"start":a="12px 0 0 12px";break;case"end":a="0 12px 12px 0";break;default:a=0}return lt("div",{title:n.title,"aria-label":n.title||"time-off",style:{width:"100%",height:"66%",margin:"auto 0",backgroundColor:o,borderRadius:a}})},Krr=function(e){var t,r=e.value,n=e.row,o=String(null!==(t=null!=r?r:null==n?void 0:n.name)&&void 0!==t?t:""),a=(null==n?void 0:n.subtitle)||void 0,i=(null==n?void 0:n.avatarUrl)||void 0,s=o.split(" ").map(function(e){return e[0]}).filter(Boolean).slice(0,2).join("").toUpperCase();return ct(nh,X({sx:{display:"flex",alignItems:"center",gap:1}},{children:[lt(zp,X({src:i,sx:{width:28,height:28,fontSize:12}},{children:s})),ct(nh,X({sx:{minWidth:0}},{children:[lt(Ic,X({variant:"body2",sx:{fontWeight:600,lineHeight:1.1},noWrap:!0},{children:o})),a&&lt(Ic,X({variant:"caption",sx:{color:"text.secondary"},noWrap:!0},{children:a}))]}))]}))},Yrr=e.memo(function(t){var r,n,o,a,i,s,l,c,u,d,p,h,f,m,v,y,g,b,x,w,k,_,C,M,S,D,O,P,E,j,T,N,R,F,z,I,A,L,B,V,H,q,$,W,U,G,K,Y,Z,Q,J,te,re,ne,oe,ae,ie,se,le,ce,ue,de=t.organism,pe=t.onAction,he=t.errorState,fe=function(t){var r,n,o,a,i,s,l,c=t.organism;t.onAction;var u=(null==c?void 0:c.id)||"",d=(null==c?void 0:c.config)||{},p=(null===(r=null==d?void 0:d.display)||void 0===r?void 0:r.timeline)||{startDate:(new Date).toISOString(),endDate:(new Date).toISOString(),granularity:"day",groupByMonth:!0,dayColumnWidth:40},h=e.useMemo(function(){return Uq($nt(p.startDate))},[p.startDate]),f=e.useState(h),m=f[0],v=f[1],y=e.useMemo(function(){return Uq(m)},[m]),g=e.useMemo(function(){return Gq(m)},[m]),b=e.useMemo(function(){return $H(m,"MMMM yyyy")},[m]),x=Urr(u,y,g),w=x.events,k=x.resources,_=x.isLoading,C=x.error,M=x.refetch,S=e.useState(""),D=S[0],O=S[1],P=e.useState(0),E=P[0],j=P[1],T=e.useState(25),N=T[0],R=T[1],F=e.useState({}),z=F[0],I=F[1],A=e.useState(null!==(o=null===(n=null==d?void 0:d.toolbar)||void 0===n?void 0:n.densityDefault)&&void 0!==o?o:"comfortable"),L=A[0],B=A[1],V=e.useState(!1),H=V[0],q=V[1],$=e.useMemo(function(){var e,t=null!==(e=p.dayColumnWidth)&&void 0!==e?e:36;return"comfortable"===L?t+12:t},[p.dayColumnWidth,L]),W=e.useMemo(function(){return qnt({start:y,end:g}).map(function(e){var t=$H(e,"yyyy-MM-dd"),r=$H(e,"EEE"),n=$H(e,"d"),o={field:t,headerName:n,width:$,sortable:!1,filterable:!1,resizable:!1,align:"center",renderCell:function(e){var t;if("__ooo__"===String(e.id)){var r=Number(null!==(t=e.value)&&void 0!==t?t:0);return lt("div",X({style:{display:"grid",placeItems:"center",width:"100%"}},{children:lt("span",X({style:{fontSize:12,color:"#6B7280"}},{children:r}))}))}return lt(Grr,X({},e))},renderHeader:function(){return ct("div",X({style:{display:"grid",placeItems:"center",lineHeight:1.05}},{children:[lt("div",X({style:{fontSize:11,color:"#6B7280"}},{children:r})),lt("div",X({style:{fontSize:13,fontWeight:600}},{children:n}))]}))},cellClassName:"CalDg--dayCell"};return o})},[y,g,$]),U=e.useMemo(function(){if(!p.groupByMonth)return[];var e=qnt({start:y,end:g}),t=[],r=null;return e.forEach(function(e){var n=$H(e,"yyyy-MM"),o=$H(e,"MMMM yyyy"),a=$H(e,"yyyy-MM-dd");r&&r.groupId===n||(r={groupId:n,headerName:o,children:[]},t.push(r)),r.children.push({field:a})}),t},[p.groupByMonth,y,g]),G=e.useMemo(function(){var e=z.status;if(e&&(!Array.isArray(e)||0!==e.length))return new Set(Array.isArray(e)?e:[e])},[z]),K=e.useMemo(function(){var e=qnt({start:y,end:g}).map(function(e){return $H(e,"yyyy-MM-dd")}),t={},r={},n=function(e){return e instanceof Date?e.toISOString():String(null!=e?e:"")};w.forEach(function(o){var a,i,s,l=String(null!==(a=o.resourceId)&&void 0!==a?a:"");if(l){var c=new Date(n(null!==(i=o.start)&&void 0!==i?i:o.startDate)),u=new Date(n(null!==(s=o.end)&&void 0!==s?s:o.endDate));if(!Number.isNaN(c.getTime())&&!Number.isNaN(u.getTime())){var d=(null==o?void 0:o.status)?String(o.status):void 0;if(!G||!d||G.has(d)){var p=qnt({start:c,end:u}).map(function(e){return $H(e,"yyyy-MM-dd")}).filter(function(t){return e.includes(t)});t[l]=t[l]||new Set,r[l]=r[l]||{},p.forEach(function(e,n){var a;t[l].add(e);var i=1===p.length?"single":0===n?"start":n===p.length-1?"end":"middle";r[l][e]={active:!0,part:i,color:null==o?void 0:o.color,title:String(null!==(a=null==o?void 0:o.title)&&void 0!==a?a:"Time off"),status:d}})}}}});var o=k.map(function(n,o){var a,i,s=String(null!==(a=n.id)&&void 0!==a?a:o),l=String(null!==(i=n.name)&&void 0!==i?i:""),c=t[s]||new Set,u=r[s]||{},d={id:s,name:l,__busyDays:c,__rangesInfo:u};return e.forEach(function(e){d[e]=c.has(e)?1:0}),d});return o},[k,w,y,g,G]),Y=e.useMemo(function(){return{field:"name",headerName:"Employees",width:220,pinned:"left",sortable:!1,filterable:!1,resizable:!1,renderCell:function(e){return lt(Krr,{value:e.value,row:e.row})}}},[]),Z=e.useMemo(function(){return ee([Y],W,!0)},[Y,W]),Q=e.useMemo(function(){var e=Object.entries(z).flatMap(function(e){var t=e[0],r=e[1],n=Array.isArray(r)?r.filter(Boolean):[r].filter(Boolean);return 0===n.length?[]:[{field:t,operator:"isAnyOf",value:n}]});return{items:e,logicOperator:"and"}},[z]),J=jtr(),te=e.useMemo(function(){return Z.map(function(e){var t;return"".concat(e.field,":").concat(null!==(t=e.width)&&void 0!==t?t:"")}).join("|")},[Z]),re=(null===(a=null==d?void 0:d.toolbar)||void 0===a?void 0:a.quickFilters)||[],ne=!1!==(null===(i=null==d?void 0:d.toolbar)||void 0===i?void 0:i.search),oe=!1!==(null===(s=null==d?void 0:d.toolbar)||void 0===s?void 0:s.densityToggle),ae=!1!==(null===(l=null==d?void 0:d.toolbar)||void 0===l?void 0:l.exportCsv),ie=$H(new Date,"yyyy-MM-dd"),se=e.useMemo(function(){var e=qnt({start:y,end:g}).map(function(e){return $H(e,"yyyy-MM-dd")}),t={};K.forEach(function(r){var n=r.__busyDays;e.forEach(function(e){var r,o;(null===(r=null==n?void 0:n.has)||void 0===r?void 0:r.call(n,e))&&(t[e]=(null!==(o=t[e])&&void 0!==o?o:0)+1)})});var r={id:"__ooo__",name:"Out of office:"};return e.forEach(function(e){var n;r[e]=null!==(n=t[e])&&void 0!==n?n:0}),[r]},[K,y,g]);return{rows:K,total:K.length,isLoading:_,error:C,currentMonth:m,page:E,pageSize:N,search:D,quickFilters:z,density:L,showSearch:H,filterModel:Q,densityToggle:oe,quickFiltersCfg:re,showSearchControl:ne,showExport:ae,columnsKey:te,apiRef:J,columns:Z,columnGroupingModel:U,monthLabel:b,getCellClassName:function(e){return String(e.field)===ie?"CalDg--today":""},pinnedTop:se,setPage:j,setPageSize:R,setSearch:O,setQuickFilter:function(e,t){I(function(r){var n=X({},r);if(""===t)return delete n[e],n;var o=n[e];if(Array.isArray(o))if(o.includes(t)){var a=o.filter(function(e){return e!==t});0===a.length?delete n[e]:n[e]=a}else n[e]=ee(ee([],o,!0),[t],!1);else o?o===t?delete n[e]:n[e]=[o,t]:n[e]=t;return n})},setDensity:B,setShowSearch:q,refetch:M,goPrevMonth:function(){return v(function(e){return UV(e,-1)})},goNextMonth:function(){return v(function(e){return UV(e,1)})},goToday:function(){return v(Uq(new Date))},goToMonth:function(e){return v(Uq(e))}}}({organism:de,onAction:pe}),me=fe.rows,ve=fe.total,ye=fe.isLoading,ge=fe.error,be=fe.page,xe=fe.pageSize,we=fe.search,ke=fe.quickFilters,_e=fe.density,Ce=fe.showSearch,Me=fe.filterModel,Se=fe.densityToggle,De=fe.quickFiltersCfg,Oe=fe.showSearchControl,Pe=fe.showExport,Ee=fe.columnsKey,je=fe.apiRef,Te=fe.columns,Ne=fe.columnGroupingModel,Re=fe.monthLabel,Fe=fe.getCellClassName,ze=fe.pinnedTop,Ie=fe.setPage,Ae=fe.setPageSize,Le=fe.setSearch,Be=fe.setQuickFilter,Ve=fe.setDensity,He=fe.setShowSearch,qe=fe.goPrevMonth,$e=fe.goNextMonth,We=fe.goToday,Ue=fe.goToMonth,Ge=fe.currentMonth,Ke=mnt,Ye=(null==de?void 0:de.config)||{},Xe=null!==(a=null===(o=null===(n=null===(r=null==Ye?void 0:Ye.props)||void 0===r?void 0:r.toolbarContainer)||void 0===n?void 0:n.sx)||void 0===o?void 0:o.controlHeight)&&void 0!==a?a:44,Ze=null!==(c=null===(l=null===(s=null===(i=null==Ye?void 0:Ye.props)||void 0===i?void 0:i.toolbarContainer)||void 0===s?void 0:s.sx)||void 0===l?void 0:l.searchWidth)&&void 0!==c?c:360,Qe=null!==(h=null===(p=null===(d=null===(u=null==Ye?void 0:Ye.props)||void 0===u?void 0:u.toolbarContainer)||void 0===d?void 0:d.sx)||void 0===p?void 0:p.marginTop)&&void 0!==h?h:1,Je=null!==(y=null===(v=null===(m=null===(f=null==Ye?void 0:Ye.props)||void 0===f?void 0:f.toolbarContainer)||void 0===m?void 0:m.sx)||void 0===v?void 0:v.columnGap)&&void 0!==y?y:1,et=(null===(b=null===(g=null==Ye?void 0:Ye.props)||void 0===g?void 0:g.toolbarContainer)||void 0===b?void 0:b.sx)||{},tt=(null===(w=null===(x=null==Ye?void 0:Ye.props)||void 0===x?void 0:x.quickFiltersGroup)||void 0===w?void 0:w.sx)||{},rt=(null===(_=null===(k=null==Ye?void 0:Ye.props)||void 0===k?void 0:k.exportButton)||void 0===_?void 0:_.sx)||{},nt=(null===(M=null===(C=null==Ye?void 0:Ye.props)||void 0===C?void 0:C.densityToggleContainer)||void 0===M?void 0:M.sx)||{},ot=(null===(D=null===(S=null==Ye?void 0:Ye.props)||void 0===S?void 0:S.dataGridWrapper)||void 0===D?void 0:D.sx)||{},at=(null===(O=null==Ye?void 0:Ye.toolbar)||void 0===O?void 0:O.searchControl)||{},it=Te.map(function(e){return X(X({},e),{resizable:!1})}),ut=e.useState(!1),dt=ut[0],pt=ut[1],ht=e.useState(null),ft=ht[0],mt=ht[1],vt={textTransform:"none",height:Xe,lineHeight:1.2,borderRadius:2,px:1.75,py:0,background:"#FFFFFF",border:"1px solid #E2E4EA",boxShadow:"0 2px 6px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04)","&:hover":{background:"#FFFFFF",borderColor:"#D7DAE2",boxShadow:"0 3px 8px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.05)"}},yt={lineHeight:0,p:0,width:Xe,height:Xe,borderRadius:2,background:"#FFFFFF",border:"1px solid #E2E4EA",boxShadow:"0 2px 6px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04)","&:hover":{background:"#FFFFFF",borderColor:"#D7DAE2",boxShadow:"0 3px 8px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.05)"}};return ge?lt(st,{children:he?he(ge):lt(Ic,X({color:"error"},{children:ge.message}))}):ct(nh,{children:[ct(nh,X({sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mt:1}},{children:[lt(Ic,X({variant:"h6",sx:{fontWeight:700}},{children:(null==de?void 0:de.name)||"Time Off Calendar"})),Se&&lt(nh,X({sx:{background:null!==(P=nt.backgroundColor)&&void 0!==P?P:"#F7F5FF",borderRadius:null!==(E=nt.borderRadius)&&void 0!==E?E:3,px:1,py:.5,display:"inline-flex",alignItems:"center"}},{children:ct(Pk,X({size:"small",exclusive:!0,value:_e,onChange:function(e,t){t&&Ve(t)},"aria-label":"table-density",sx:{"& .MuiToggleButton-root":{textTransform:"none",height:Xe,px:2,py:0,fontSize:14,lineHeight:1.2,borderRadius:"".concat(null!==(j=nt.borderRadius)&&void 0!==j?j:10,"px"),border:"none",color:"#6B7280",background:"transparent"},"& .MuiToggleButton-root + .MuiToggleButton-root":{ml:1},"& .MuiToggleButton-root.Mui-selected":{fontWeight:700,color:null!==(T=nt.selectedTextColor)&&void 0!==T?T:"#3F3F46",background:null!==(N=nt.selectedBackgroundColor)&&void 0!==N?N:"#FFFFFF",border:"1px solid #E2E4EA",boxShadow:"0 2px 6px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06)"}}},{children:[lt(Ck,X({value:"compact","aria-label":"Compact"},{children:"Compact"})),lt(Ck,X({value:"comfortable","aria-label":"Comfortable"},{children:"Comfortable"}))]}))}))]})),ct(nh,X({sx:{display:"grid",gridTemplateColumns:"auto 1fr auto",alignItems:"center",mt:Qe,columnGap:Je}},{children:[lt(nh,X({sx:{minWidth:0,overflowX:"auto",pr:1,flexShrink:0}},{children:De.length>0&&lt(nh,X({sx:{display:"inline-flex",alignItems:"center",gap:"".concat(null!==(R=tt.chipGap)&&void 0!==R?R:8,"px"),px:"6px",py:"4px",borderRadius:"8px",background:"#FAFAFF",whiteSpace:"nowrap"}},{children:De.map(function(e){var t,r,n,o,a=ke[e.columnField],i=Array.isArray(a)?a.includes(e.value):a===e.value,s=""===e.value,l=s&&(void 0===a||Array.isArray(a)&&0===a.length),c=(null==e?void 0:e.color)||tt.chipBackgroundColor,u=tt.selectedChipColor||c;return ct("button",X({"aria-label":e.label,"aria-pressed":s?l:i,onClick:function(){return Be(e.columnField,e.value)},style:{height:Xe,padding:s?"0 14px":"0 12px",border:s||i||l?"1px solid ".concat(null!==(r=null!==(t=tt.chipBorderColor)&&void 0!==t?t:c)&&void 0!==r?r:"#E2E4EA"):"none",borderRadius:null!==(n=tt.chipBorderRadius)&&void 0!==n?n:10,background:s||i||l?i||l?null!=u?u:"#FFFFFF":null!=c?c:"#FFFFFF":"transparent",boxShadow:s&&l||!s&&i?"0 1px 2px rgba(0,0,0,0.06)":void 0,color:i?"#111827":null!==(o=tt.chipTextColor)&&void 0!==o?o:"#6B7280",fontWeight:i||s&&l?700:500,fontSize:13,cursor:"pointer",transition:"transform 80ms ease, box-shadow 120ms ease",display:"inline-flex",alignItems:"center",gap:8},onMouseDown:function(e){var t=e.currentTarget;t.style.transform="translateY(1px)",t.style.boxShadow=s?"0 0 0 rgba(0,0,0,0.0)":t.style.boxShadow},onMouseUp:function(e){e.currentTarget.style.transform="translateY(0)"}},{children:[lt(Ke,{iconName:"check",size:16}),e.label]}),e.label)})}))})),lt(nh,X({sx:{display:"flex",alignItems:"center",justifyContent:"center"}},{children:ct(nh,X({sx:{display:"inline-flex",alignItems:"center",gap:1,px:1}},{children:[lt(yh,X({"aria-label":"today",size:"small",variant:"text",onClick:We,sx:vt},{children:"Today"})),lt(yc,X({"aria-label":"prev-month",size:"small",onClick:qe,sx:yt},{children:lt(Ke,{iconName:"chevron-left",size:16})})),lt(yh,X({"aria-label":"open-month-picker",size:"small",variant:"text",onClick:function(e){mt(e.currentTarget),pt(!0)},sx:vt},{children:lt(Ic,X({variant:"body2",sx:{fontWeight:600}},{children:Re.split(" ")[0]}))})),lt(yc,X({"aria-label":"next-month",size:"small",onClick:$e,sx:yt},{children:lt(Ke,{iconName:"chevron-right",size:16})}))]}))})),ct(nh,X({sx:{display:"inline-flex",alignItems:"center",gap:null!==(F=et.gap)&&void 0!==F?F:1.5,flexShrink:0,justifySelf:"end",background:et.backgroundColor,border:et.borderColor?"1px solid ".concat(et.borderColor):void 0,borderRadius:et.borderRadius}},{children:[Oe&&lt(nh,X({sx:{width:Ce||Boolean(we)?"".concat(Ze,"px"):"".concat(Xe,"px"),transition:"width 250ms ease"}},{children:Ce||Boolean(we)?lt(fk,{"aria-label":"grid-search",size:"small",value:we,autoFocus:Boolean(at.autoFocus),onBlur:function(){we||He(!1)},onChange:function(e){return Le(e.target.value)},placeholder:at.placeholder||"Search",fullWidth:!0,sx:{"& .MuiInputBase-root":{height:"".concat(Xe,"px"),borderRadius:at.borderRadius,background:at.backgroundColor},"& .MuiOutlinedInput-notchedOutline":{borderColor:at.borderColor},"& .MuiOutlinedInput-input":{py:0},"& .MuiInputAdornment-root svg":{transform:"translate(1px, 0.5px)"}},InputProps:{startAdornment:lt(Qm,X({position:"start"},{children:lt(Ke,{iconName:"search",size:16})}))}}):lt(nh,X({sx:{width:Xe,height:Xe}},{children:lt(yc,X({"aria-label":"open-search",size:"small",onClick:function(){return He(!0)},sx:{display:"grid",placeItems:"center",lineHeight:0,p:0,width:"100%",height:"100%",borderRadius:2,background:null!==(z=at.backgroundColor)&&void 0!==z?z:"#FFFFFF",border:"1px solid ".concat(null!==(I=at.borderColor)&&void 0!==I?I:"#E2E4EA"),boxShadow:"0 2px 6px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04)",color:"#6C4CF5","& svg":{display:"block",margin:0,transform:"translate(1px, 0.5px)"},"&:hover":{background:null!==(A=at.backgroundColor)&&void 0!==A?A:"#FFFFFF",borderColor:null!==(L=at.borderColor)&&void 0!==L?L:"#D7DAE2",boxShadow:"0 3px 8px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.05)"}}},{children:lt(Ke,{iconName:"search",size:20})}))}))})),Pe&&lt(yc,X({"aria-label":"export-csv",size:"small",onClick:function(){var e,t;return null===(t=null===(e=je.current)||void 0===e?void 0:e.exportDataAsCsv)||void 0===t?void 0:t.call(e)},sx:{display:"flex",alignItems:"center",justifyContent:"center",lineHeight:0,p:0,width:Xe,height:Xe,borderRadius:null!==(B=rt.borderRadius)&&void 0!==B?B:2,background:null!==(V=rt.backgroundColor)&&void 0!==V?V:"#FFFFFF",border:"1px solid ".concat(null!==(H=rt.borderColor)&&void 0!==H?H:"#E2E4EA"),boxShadow:"0 2px 6px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04)",color:null!==(q=rt.iconColor)&&void 0!==q?q:"#6C4CF5","& svg":{display:"block"},"&:hover":{background:null!==($=rt.backgroundColor)&&void 0!==$?$:"#FFFFFF",borderColor:null!==(W=rt.borderColor)&&void 0!==W?W:"#D7DAE2",boxShadow:"0 3px 8px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.05)"}}},{children:lt(Ke,{iconName:"download",size:20})}))]}))]})),ct(fy,X({open:dt,anchorEl:ft,onClose:function(){return pt(!1)},anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"}},{children:[lt(nh,X({sx:{p:2,pb:0}},{children:lt(Ic,X({variant:"h6",sx:{fontWeight:700,mb:1}},{children:Re}))})),lt(nh,X({sx:{p:1,pt:.5,display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:.5}},{children:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"].map(function(e,t){return lt("button",X({style:{padding:"8px 10px",borderRadius:10,border:"1px solid #E2E4EA",background:t===Ge.getMonth()?"#F3F0FF":"#FFFFFF",cursor:"pointer"},"aria-current":t===Ge.getMonth()?"date":void 0,onClick:function(){var e=new Date(Ge);e.setMonth(t),Ue(e),pt(!1)}},{children:lt("span",X({style:{fontWeight:t===Ge.getMonth()?700:500,color:t===Ge.getMonth()?"#6C4CF5":"#3F3F46"}},{children:e}))}),e)})}))]})),lt(nh,X({mt:2,sx:{background:ot.backgroundColor,border:ot.borderColor?"1px solid ".concat(ot.borderColor):void 0,borderRadius:ot.borderRadius,px:ot.paddingX,py:ot.paddingY,boxShadow:"number"==typeof ot.elevation&&ot.elevation>0?"0 2px 6px rgba(0,0,0,0.06)":void 0}},{children:lt(Etr,{apiRef:je,rows:me.map(function(e,t){var r,n=null==(null==e?void 0:e.id)||""===(null==e?void 0:e.id);return X(X({},e),{id:null!==(r=e.id)&&void 0!==r?r:"".concat(t),__unsafeRowId:n})}),columns:it,filterModel:Me,columnGroupingModel:Ne,getCellClassName:Fe,pinnedRows:{top:ze},pinnedColumns:{left:["name"]},pagination:!0,paginationModel:{page:be,pageSize:xe},onPaginationModelChange:function(e){Ie(e.page),Ae(e.pageSize)},density:"standard",loading:ye,rowCount:ve,paginationMode:"client",disableRowSelectionOnClick:!0,autoHeight:!0,rowHeight:null!==(Y=null===(K=null===(G=null===(U=null==Ye?void 0:Ye.props)||void 0===U?void 0:U.dataGrid)||void 0===G?void 0:G.sx)||void 0===K?void 0:K.rowHeight)&&void 0!==Y?Y:36,disableColumnMenu:!0,disableColumnSelector:!0,isCellEditable:function(){return!1},checkboxSelection:!1,sx:{minHeight:320,background:null===(J=null===(Q=null===(Z=null==Ye?void 0:Ye.props)||void 0===Z?void 0:Z.dataGrid)||void 0===Q?void 0:Q.sx)||void 0===J?void 0:J.backgroundColor,"& .MuiDataGrid-columnHeaders":{background:null===(ne=null===(re=null===(te=null==Ye?void 0:Ye.props)||void 0===te?void 0:te.dataGrid)||void 0===re?void 0:re.sx)||void 0===ne?void 0:ne.headerBackgroundColor,"& .MuiDataGrid-columnHeaderTitle":{fontSize:null===(ie=null===(ae=null===(oe=null==Ye?void 0:Ye.props)||void 0===oe?void 0:oe.dataGrid)||void 0===ae?void 0:ae.sx)||void 0===ie?void 0:ie.headerFontSize}},"& .MuiDataGrid-cell":{py:0,px:0},"& .CalDg--dayCell":{padding:0},"& .MuiDataGrid-row:hover":{background:null!==(ue=null===(ce=null===(le=null===(se=null==Ye?void 0:Ye.props)||void 0===se?void 0:se.dataGrid)||void 0===le?void 0:le.sx)||void 0===ce?void 0:ce.rowHoverColor)&&void 0!==ue?ue:"rgba(0,0,0,0.03)"},"& .CalDg--today":{background:"rgba(108, 76, 245, 0.06)"},"& .MuiDataGrid-cell:focus, & .MuiDataGrid-cell:focus-within":{outline:"none"}},slotProps:{loadingOverlay:{variant:"linear-progress",noRowsVariant:"skeleton"}}},Ee)}))]})});Yrr.displayName="CalendarDataGridOrganism";var Xrr={id:"eventBindings",tool:"calendarDataRetrieval",titleKey:"config.calendar.group.eventBindings",collapsible:!0,initiallyExpanded:!0,pathBase:"dataRetrievalConfig.bindings.event",toolConfig:{targets:[{captureName:"id",labelKey:"config.calendar.bindings.event.id"},{captureName:"title",labelKey:"config.calendar.bindings.event.title"},{captureName:"description",labelKey:"config.calendar.bindings.event.description"},{captureName:"startDate",labelKey:"config.calendar.bindings.event.startDate"},{captureName:"endDate",labelKey:"config.calendar.bindings.event.endDate"},{captureName:"startTime",labelKey:"config.calendar.bindings.event.startTime"},{captureName:"endTime",labelKey:"config.calendar.bindings.event.endTime"},{captureName:"status",labelKey:"config.calendar.bindings.event.status"},{captureName:"eventType",labelKey:"config.calendar.bindings.event.eventType"},{captureName:"resourceId",labelKey:"config.calendar.bindings.event.resourceId"},{captureName:"resourceName",labelKey:"config.calendar.bindings.event.resourceName"},{captureName:"visibility",labelKey:"config.calendar.bindings.event.visibility"},{captureName:"color",labelKey:"config.calendar.bindings.event.color"},{captureName:"isRepeating",labelKey:"config.calendar.bindings.event.isRepeating"},{captureName:"isRepeatingInterval",labelKey:"config.calendar.bindings.event.isRepeatingInterval"},{captureName:"isRepeatingExcludedDates",labelKey:"config.calendar.bindings.event.isRepeatingExcludedDates"},{captureName:"associatedEntityType",labelKey:"config.calendar.bindings.event.associatedEntityType"},{captureName:"associatedEntityId",labelKey:"config.calendar.bindings.event.associatedEntityId"},{captureName:"conferencingLink",labelKey:"config.calendar.bindings.event.conferencingLink"},{captureName:"meta[$index].token",labelKey:"config.calendar.bindings.event.meta.token"},{captureName:"meta[$index].dataFieldId",labelKey:"config.calendar.bindings.event.meta.fieldId"}]}},Zrr={id:"resourceBindings",tool:"calendarDataRetrieval",titleKey:"config.calendar.group.resourceBindings",collapsible:!0,initiallyExpanded:!1,pathBase:"dataRetrievalConfig.bindings.resource",toolConfig:{targets:[{captureName:"id",labelKey:"config.calendar.bindings.resource.id"},{captureName:"name",labelKey:"config.calendar.bindings.resource.name"},{captureName:"accentClass",labelKey:"config.calendar.bindings.resource.accentClass"},{captureName:"color",labelKey:"config.calendar.bindings.resource.color"},{captureName:"meta[$index].token",labelKey:"config.calendar.bindings.resource.meta.token"},{captureName:"meta[$index].dataFieldId",labelKey:"config.calendar.bindings.resource.meta.fieldId"}]}},Qrr={component:"CalendarDataGridOrganism",version:"1.0.0",toolGroups:[Xrr,Zrr,{id:"timeline",tool:"custom",titleKey:"config.calendarDataGrid.group.timeline",collapsible:!0,initiallyExpanded:!0,pathBase:"display.timeline",fields:[{type:"text",captureName:"startDate",labelKey:"config.calendarDataGrid.timeline.startDate"},{type:"text",captureName:"endDate",labelKey:"config.calendarDataGrid.timeline.endDate"},{type:"number",captureName:"dayColumnWidth",labelKey:"config.calendarDataGrid.timeline.dayWidth",defaultValue:40},{type:"switch",captureName:"groupByMonth",labelKey:"config.calendarDataGrid.timeline.groupByMonth",defaultValue:!0}]},hKt,iKt,mKt,fKt,cKt,uKt,dKt,sKt,lKt,pKt]},Jrr=function(e){var t=e.name,r=e.className,n=pnt[t];return n?lt(n,{className:r}):null},enr=function(t){var r,o,a,i,s,l=lqt().stateConfig,c=e.useRef(null),u=e.useState({}),d=u[0],p=u[1],h=d.start,f=d.end,m=(null===(r=null==t?void 0:t.organism)||void 0===r?void 0:r.id)||"",v=(null===(a=null===(o=null==t?void 0:t.organism)||void 0===o?void 0:o.config)||void 0===a?void 0:a.dataRetrievalConfig)||{},y=(null===(s=null===(i=null==t?void 0:t.organism)||void 0===i?void 0:i.config)||void 0===s?void 0:s.display)||{defaultView:"month",use24HourFormatByDefault:!1,colorMap:[],overlayIndicators:void 0},g=function(){var e,t;try{var r=err(),n=r[0],o=r[1];e=n,t=o}catch(r){e=new URLSearchParams,t=function(){}}return[e,t]}()[0],b=g.get("rwoContext")||"",x=g.get("rwoRecordId"),w=b?M$(b):null,k=null==w?void 0:w[m],_=(null==k?void 0:k.rwoRecordId)||x||void 0,C=e.useMemo(function(){var e="calendar:organism:".concat(m),t=null==l?void 0:l[e];return"number"==typeof t?t:0},[l,m]),M=function(t){var r,o,a,i=t.organismId,s=t.start,l=t.end,c=t.rwoRecordId,u=pqt().calendar,d=lqt().stateConfig,p=rrr(i).rwoRecordId,h=c||p,f=e.useMemo(function(){var e="calendar:organism:".concat(i),t=null==d?void 0:d[e];return"number"==typeof t?t:0},[d,i]),m=n.useQuery({queryKey:[b$,i,f,h],queryFn:function(){return Q(void 0,void 0,void 0,function(){var e,t,r,n,o,a;return J(this,function(c){switch(c.label){case 0:if(!u)throw new Error("Calendar API not available");return[4,u.getOrganismData(i,X({start:null!=s?s:new Date("1970-01-01"),end:null!=l?l:new Date("2100-12-31")},h?{rwoRecordId:h}:{}))];case 1:if(e=c.sent(),t=null==e?void 0:e.data,!(r=null==t?void 0:t.data))throw new Error("Invalid calendar data response");return[2,{events:null!==(n=r.events)&&void 0!==n?n:[],resources:null!==(o=r.resources)&&void 0!==o?o:[],overlays:null!==(a=r.overlays)&&void 0!==a?a:[]}]}})})},enabled:Boolean(u&&i),refetchOnMount:!0,refetchOnWindowFocus:!0,staleTime:3e5,gcTime:6e5}),v=m.data,y=m.isLoading,g=m.error,b=m.refetch;return{events:null!==(r=null==v?void 0:v.events)&&void 0!==r?r:[],resources:null!==(o=null==v?void 0:v.resources)&&void 0!==o?o:[],overlays:null!==(a=null==v?void 0:v.overlays)&&void 0!==a?a:[],isLoading:y,error:g,refetch:b,refreshSignal:f}}({organismId:m,start:h,end:f,rwoRecordId:_}),S=M.events,D=M.resources,O=M.overlays,P=M.isLoading,E=M.error,j=M.refetch,T=function(e){void 0===e&&(e={});var t=pqt().calendar,r=n.useQueryClient(),o=n.useMutation({mutationFn:function(e){var r=e.event;return Q(void 0,void 0,void 0,function(){var e;return J(this,function(n){switch(n.label){case 0:if(!t)throw new Error("Calendar API is not available. Please check your configuration.");n.label=1;case 1:return n.trys.push([1,3,,4]),[4,t.createEvent(r)];case 2:return[2,n.sent()];case 3:throw e=n.sent(),new Error("Failed to create calendar event: ".concat(e instanceof Error?e.message:"Unknown error"));case 4:return[2]}})})},onSuccess:function(t,n){var o;t&&(null===(o=e.onSuccess)||void 0===o||o.call(e,t,n)),r.invalidateQueries({queryKey:[b$]})},onError:function(t,r){var n;null===(n=e.onError)||void 0===n||n.call(e,t,r),console.error("Calendar event creation failed:",t)}});return{create:o.mutateAsync,isLoading:o.isPending,isError:o.isError,error:o.error,isSuccess:o.isSuccess,data:o.data}}(),N=T.create,R=T.isLoading,F=T.error,z=function(e){void 0===e&&(e={});var t=pqt().calendar,r=n.useQueryClient(),o=n.useMutation({mutationFn:function(e){var r=e.eventId;return Q(void 0,void 0,void 0,function(){var e;return J(this,function(n){switch(n.label){case 0:if(!t)throw new Error("Calendar API is not available. Please check your configuration.");if(!r)throw new Error("Event ID is required for deletion.");n.label=1;case 1:return n.trys.push([1,3,,4]),[4,t.deleteEvent(r)];case 2:return n.sent(),[2,{eventId:r}];case 3:throw e=n.sent(),new Error("Failed to delete calendar event: ".concat(e instanceof Error?e.message:"Unknown error"));case 4:return[2]}})})},onSuccess:function(t,n){var o;null===(o=e.onSuccess)||void 0===o||o.call(e,t,n),r.invalidateQueries({queryKey:[b$]})},onError:function(t,r){var n;null===(n=e.onError)||void 0===n||n.call(e,t,r),console.error("Failed to delete event ".concat(r.eventId,":"),t)}});return{delete:o.mutateAsync,isLoading:o.isPending,isError:o.isError,error:o.error,isSuccess:o.isSuccess,data:o.data}}(),I=z.delete,A=z.isLoading,L=z.error,B=function(e){void 0===e&&(e={});var t=pqt().calendar,r=n.useQueryClient(),o=n.useMutation({mutationFn:function(e){var r=e.event;return Q(void 0,void 0,void 0,function(){var e;return J(this,function(n){switch(n.label){case 0:if(!t)throw new Error("Calendar API is not available. Please check your configuration.");if(!r.id)throw new Error("Event ID is required for updates.");n.label=1;case 1:return n.trys.push([1,3,,4]),[4,t.updateEvent(r)];case 2:return[2,n.sent()];case 3:throw e=n.sent(),new Error("Failed to update calendar event: ".concat(e instanceof Error?e.message:"Unknown error"));case 4:return[2]}})})},onSuccess:function(t,n){var o;t&&(null===(o=e.onSuccess)||void 0===o||o.call(e,t,n)),r.invalidateQueries({queryKey:[b$]})},onError:function(t,r){var n;null===(n=e.onError)||void 0===n||n.call(e,t,r),console.error("Failed to update event ".concat(r.event.id,":"),t)}});return{update:o.mutateAsync,isLoading:o.isPending,isError:o.isError,error:o.error,isSuccess:o.isSuccess,data:o.data}}(),V=B.update,H=B.isLoading,q=B.error,$=function(e,t){if(e){if("string"==typeof e)return t[e];if("const"in e)return e.const;if("template"in e){var r=e.template;return e.tokens&&Object.entries(e.tokens).forEach(function(e){var n=e[0],o=e[1],a=t[o]||"";r=r.replace(new RegExp("{{".concat(n,"}}"),"g"),a)}),r}}},W=e.useMemo(function(){var e,t=null===(e=null==v?void 0:v.bindings)||void 0===e?void 0:e.resource;if(!t)return D;try{return D.map(function(e){var r,n,o,a,i,s;return{id:String(null!==(n=null!==(r=$(t.id,e))&&void 0!==r?r:e.id)&&void 0!==n?n:""),name:String(null!==(a=null!==(o=$(t.name,e))&&void 0!==o?o:e.name)&&void 0!==a?a:""),accentClass:null!==(i=$(t.accentClass,e))&&void 0!==i?i:e.accentClass,color:null!==(s=$(t.color,e))&&void 0!==s?s:e.color,meta:e.meta}})}catch(e){return D}},[D,v]),U=function(e){var r,n,o,a,i={},s=(null===(a=null===(o=null===(n=null===(r=null==t?void 0:t.organism)||void 0===r?void 0:r.config)||void 0===n?void 0:n.dataRetrievalConfig)||void 0===o?void 0:o.bindings)||void 0===a?void 0:a.event)||{};return Object.entries(s).forEach(function(t){var r=t[0],n=t[1];if("string"==typeof n){var o=function(e,t){return t.split(".").reduce(function(e,t){return null==e?void 0:e[t]},e)}(e,r);void 0!==o&&(i[n]=o)}}),i},G=pqt().calendar,K=eLt({initialEvents:S,onEventAdd:function(e){return Q(void 0,void 0,void 0,function(){var t,r,n,o,a;return J(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),t=U(e),[4,null===(a=null==G?void 0:G.createEvent)||void 0===a?void 0:a.call(G,{formId:m,data:t})];case 1:return(r=i.sent())?[2,r]:[4,N({event:X({},e)})];case 2:return n=i.sent(),[2,n||X(X({},e),{id:String(Date.now())})];case 3:return o=i.sent(),console.error("Failed to create event:",o),[2,X(X({},e),{id:String(Date.now())})];case 4:return[2]}})})},onEventUpdate:function(e){return Q(void 0,void 0,void 0,function(){var t,r,n,o;return J(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),t=U(e),[4,null===(o=null==G?void 0:G.updateEvent)||void 0===o?void 0:o.call(G,{formId:m,rwoRecordId:null==e?void 0:e.id,data:t})];case 1:return(r=a.sent())?[2,r]:[4,V({event:X({},e)})];case 2:return[2,a.sent()||e];case 3:return n=a.sent(),console.error("Failed to update event:",n),[2,e];case 4:return[2]}})})},onEventDelete:function(e){return Q(void 0,void 0,void 0,function(){var t;return J(this,function(r){switch(r.label){case 0:return r.trys.push([0,5,,6]),(null==v?void 0:v.onEventDelete)?[4,v.onEventDelete(e)]:[3,2];case 1:return r.sent(),[3,4];case 2:return[4,I({eventId:e})];case 3:r.sent(),r.label=4;case 4:return[3,6];case 5:return t=r.sent(),console.error("Failed to delete event:",t),[3,6];case 6:return[2]}})})},onDateRangeChange:function(e,t){return Q(void 0,void 0,void 0,function(){return J(this,function(r){return c.current={start:e,end:t},p({start:e,end:t}),[2,[]]})})}}),Y=K.events,Z=K.isLoading,ee=K.addEvent,te=K.updateEvent,re=K.deleteEvent,ne=K.onViewOrDateChange,oe=e.useRef(C);e.useEffect(function(){if(!E&&c.current&&C!==oe.current){oe.current=C;var e=c.current,t=e.start,r=e.end;ne(t,r)}},[C,ne,E]);var ae=e.useMemo(function(){return{defaultView:y.defaultView||"month",use24HourFormatByDefault:y.use24HourFormatByDefault||!1,overlayIndicators:(e=y.overlayIndicators,e?{maxPerCell:e.maxPerCell,statusClasses:e.statusClasses,showLegend:e.showLegend,icons:e.icons?Object.fromEntries(Object.entries(e.icons).map(function(e){var t=e[0],r=e[1];return[t,{className:r.className,priority:r.priority,showCountBadge:r.showCountBadge,icon:r.iconName?lt(Jrr,{name:r.iconName,className:r.className}):void 0}]})):void 0}:void 0)};var e},[y]);return{events:Y,resources:W,overlays:O,isLoading:P||Z||R||A||H,error:E||F||L||q,refreshSignal:C,calendarConfig:ae,onEventAdd:ee,onEventUpdate:te,onEventDelete:re,onDateRangeChange:ne,refetch:j}},tnr=e.memo(function(e){var t=enr(e),r=t.events,n=t.resources,o=t.isLoading,a=t.calendarConfig,i=t.onEventAdd,s=t.onEventUpdate,l=t.onEventDelete,c=t.onDateRangeChange;return lt(JAt,{events:r,resources:n,isLoading:o,config:a,onEventAdd:i,onEventUpdate:s,onEventDelete:l,onDateRangeChange:c})});tnr.displayName="CalendarOrganism";var rnr=function(e){var t,r=e.children,n=Z(e,["children"]);return X(X({},n),{items:null!==(t=null==r?void 0:r.map(function(e){return"molecule"===e.instance&&"consent"===e.type?e:"container"===e.instance?rnr(e):e}))&&void 0!==t?t:[]})},nnr={component:"CalendarOrganism",version:"2.0.0",toolGroups:[Xrr,Zrr,{id:"eventFormModal",tool:"custom",titleKey:"config.calendar.group.eventFormModal",collapsible:!0,initiallyExpanded:!0,pathBase:"dataRetrievalConfig.form.modal",fields:[{type:"icon",captureName:"titleIcon",labelKey:"config.calendar.form.modal.titleIcon"},{type:"text",captureName:"i18n.title",labelKey:"config.calendar.form.modal.i18n.title",defaultValue:"Schedule visit"},{type:"text",captureName:"i18n.description",labelKey:"config.calendar.form.modal.i18n.description"},{type:"text",captureName:"i18n.submitLabel",labelKey:"config.calendar.form.modal.i18n.submit",defaultValue:"Create"},{type:"text",captureName:"i18n.cancelLabel",labelKey:"config.calendar.form.modal.i18n.cancel",defaultValue:"Cancel"},{type:"number",captureName:"layout.columns",labelKey:"config.calendar.form.modal.layout.columns",defaultValue:2},{type:"array",captureName:"layout.order",labelKey:"config.calendar.form.modal.layout.order",allowAdd:!0,allowRemove:!0,allowReorder:!0,itemFields:[]}]},{id:"display",tool:"custom",titleKey:"config.calendar.group.display",collapsible:!0,initiallyExpanded:!0,pathBase:"display",fields:[{type:"select",captureName:"defaultView",labelKey:"config.calendar.display.defaultView",options:[{id:"day",labelKey:"config.calendar.display.view.day"},{id:"week",labelKey:"config.calendar.display.view.week"},{id:"month",labelKey:"config.calendar.display.view.month"},{id:"year",labelKey:"config.calendar.display.view.year"}],defaultValue:"month"},{type:"switch",captureName:"use24HourFormatByDefault",labelKey:"config.calendar.display.use24HourFormat",defaultValue:!1},{type:"number",captureName:"firstDayOfWeek",labelKey:"config.calendar.display.firstDayOfWeek",defaultValue:1},{type:"switch",captureName:"showWeekends",labelKey:"config.calendar.display.showWeekends",defaultValue:!0},{type:"number",captureName:"eventBorderRadius",labelKey:"config.calendar.display.eventBorderRadius",defaultValue:4},{type:"number",captureName:"minCellHeight",labelKey:"config.calendar.display.minCellHeight",defaultValue:32},{type:"select",captureName:"dayView.viewType",labelKey:"config.calendar.display.day.viewType",options:[{id:"regular",labelKey:"config.calendar.display.view.regular"},{id:"resource",labelKey:"config.calendar.display.view.resource"}],defaultValue:"regular"},{type:"switch",captureName:"dayView.hideHoverLine",labelKey:"config.calendar.display.day.hideHoverLine",defaultValue:!1},{type:"switch",captureName:"dayView.hideTimeline",labelKey:"config.calendar.display.day.hideTimeline",defaultValue:!1},{type:"switch",captureName:"dayView.enableDoubleClickToAddEvent",labelKey:"config.calendar.display.day.enableDoubleClickToAddEvent",defaultValue:!1},{type:"select",captureName:"weekView.viewType",labelKey:"config.calendar.display.week.viewType",options:[{id:"regular",labelKey:"config.calendar.display.view.regular"},{id:"resource",labelKey:"config.calendar.display.view.resource"}],defaultValue:"regular"},{type:"switch",captureName:"weekView.hideHoverLine",labelKey:"config.calendar.display.week.hideHoverLine",defaultValue:!1},{type:"switch",captureName:"weekView.hideTimeline",labelKey:"config.calendar.display.week.hideTimeline",defaultValue:!1},{type:"switch",captureName:"weekView.enableDoubleClickToShiftViewToDaily",labelKey:"config.calendar.display.week.enableDoubleClickToShiftViewToDaily",defaultValue:!1},{type:"select",captureName:"weekView.resourceDisplayMode",labelKey:"config.calendar.display.week.resourceDisplayMode",options:[{id:"row",labelKey:"config.calendar.display.week.resourceDisplayMode.row"},{id:"column",labelKey:"config.calendar.display.week.resourceDisplayMode.column"}],defaultValue:"row"},{type:"switch",captureName:"monthView.showOnlyCurrentMonth",labelKey:"config.calendar.display.month.showOnlyCurrentMonth",defaultValue:!1},{type:"select",captureName:"monthView.viewType",labelKey:"config.calendar.display.month.viewType",options:[{id:"basic",labelKey:"config.calendar.display.month.view.basic"},{id:"detailed",labelKey:"config.calendar.display.month.view.detailed"}],defaultValue:"basic"},{type:"switch",captureName:"monthView.enableDoubleClickToShiftViewToWeekly",labelKey:"config.calendar.display.month.enableDoubleClickToShiftViewToWeekly",defaultValue:!1},{type:"switch",captureName:"yearView.enableDoubleClickToShiftViewToMonthly",labelKey:"config.calendar.display.year.enableDoubleClickToShiftViewToMonthly",defaultValue:!1},{type:"color",captureName:"statusColors.tentative",labelKey:"config.calendar.status.tentative"},{type:"color",captureName:"statusColors.confirmed",labelKey:"config.calendar.status.confirmed"},{type:"color",captureName:"statusColors.completed",labelKey:"config.calendar.status.completed"},{type:"color",captureName:"statusColors.cancelled",labelKey:"config.calendar.status.cancelled"}]},{id:"overlays",tool:"custom",titleKey:"config.calendar.group.overlays",collapsible:!0,initiallyExpanded:!1,pathBase:"display.overlayIndicators",fields:[{type:"number",captureName:"maxPerCell",labelKey:"config.calendar.overlayIndicators.maxPerCell"},{type:"switch",captureName:"showLegend",labelKey:"config.calendar.overlayIndicators.showLegend",defaultValue:!1},{type:"text",captureName:"statusClasses.ok",labelKey:"config.calendar.overlayIndicators.status.ok"},{type:"text",captureName:"statusClasses.info",labelKey:"config.calendar.overlayIndicators.status.info"},{type:"text",captureName:"statusClasses.warning",labelKey:"config.calendar.overlayIndicators.status.warning"},{type:"text",captureName:"statusClasses.danger",labelKey:"config.calendar.overlayIndicators.status.danger"}]}]},onr={calendar:nnr,data_grid:vKt,calendar_data_grid:Qrr},anr={config:{isInitialized:!0},traits:{isDocker:!1,isCI:!1,machineId:null,projectId:"b28c94b2195c8ed259f0b415aaee3f39b0b2920a4537611499fa044956917a21",sessionId:"e6c76f882ba83eab20b67b618e67366a1ea6df7edfc7e16858aaa09f5954b7a3",anonymousId:"6c93d6e1c180e6b6bb382c3abcee40610d63bad23bdfc96ea9dc52a5eb06f242"}};function inr(e){return"__mui_x_telemetry_"+btoa(e)}function snr(e,t,r){try{if("undefined"!=typeof window&&window[e])return window[e].setItem(inr(t),r),!0}catch(e){}return!1}function lnr(e,t){try{if("undefined"!=typeof window&&window[e])return window[e].getItem(inr(t))}catch(e){}return null}function cnr(e){let t="";const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let n=0;for(;n<e;)t+=r.charAt(Math.floor(62*Math.random())),n+=1;return t}const unr="undefined"==typeof window||"test"===process.env.NODE_ENV?()=>{}:async()=>{const e="fingerprint";try{const t=lnr("localStorage",e);if(t)return JSON.parse(t);const r=await Promise.resolve().then(function(){return bor}),n=await r.load({monitoring:!1}),o=S({},(await n.get()).components);delete o.cookiesEnabled;const a=r.hashComponents(o),i=r.hashComponents(S({},function(e,t){return t.reduce((t,r)=>(t[r]=e[r],t),{})}(o,["fonts","audio","languages","deviceMemory","timezone","sessionStorage","localStorage","indexedDB","openDatabase","platform","canvas","vendor","vendorFlavors","colorGamut","forcedColors","monochrome","contrast","reducedMotion","math","videoCard","architecture"]))),s={fullHash:a,coreHash:i};return snr("localStorage",e,JSON.stringify(s)),s}catch(e){return null}};var dnr=Object.freeze({__proto__:null,default:async function(){return anr.traits.sessionId=function(){const e="session_id",t=lnr("sessionStorage",e);if(t)return t;const r=`sesid_${cnr(32)}`;return snr("sessionStorage",e,r)?r:`sestp_${cnr(32)}`}(),anr.config.isInitialized||(anr.traits.anonymousId=function(){const e="anonymous_id",t=lnr("localStorage",e);if(t)return t;const r=`anid_${cnr(32)}`;return snr("localStorage",e,r)?r:""}(),anr.config.isInitialized=!0),anr.traits.fingerprint||(anr.traits.fingerprint=await unr()),anr}}),pnr="3.4.2";function hnr(e,t){return new Promise(function(r){return setTimeout(r,e,t)})}function fnr(e){return!!e&&"function"==typeof e.then}function mnr(e,t){try{var r=e();fnr(r)?r.then(function(e){return t(!0,e)},function(e){return t(!1,e)}):t(!0,r)}catch(e){t(!1,e)}}function vnr(e,t,r){return void 0===r&&(r=16),Q(this,void 0,void 0,function(){var n,o,a,i;return J(this,function(s){switch(s.label){case 0:n=Array(e.length),o=Date.now(),a=0,s.label=1;case 1:return a<e.length?(n[a]=t(e[a],a),(i=Date.now())>=o+r?(o=i,[4,hnr(0)]):[3,3]):[3,4];case 2:s.sent(),s.label=3;case 3:return++a,[3,1];case 4:return[2,n]}})})}function ynr(e){e.then(void 0,function(){})}function gnr(e,t){e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]],t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var r=[0,0,0,0];return r[3]+=e[3]+t[3],r[2]+=r[3]>>>16,r[3]&=65535,r[2]+=e[2]+t[2],r[1]+=r[2]>>>16,r[2]&=65535,r[1]+=e[1]+t[1],r[0]+=r[1]>>>16,r[1]&=65535,r[0]+=e[0]+t[0],r[0]&=65535,[r[0]<<16|r[1],r[2]<<16|r[3]]}function bnr(e,t){e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]],t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var r=[0,0,0,0];return r[3]+=e[3]*t[3],r[2]+=r[3]>>>16,r[3]&=65535,r[2]+=e[2]*t[3],r[1]+=r[2]>>>16,r[2]&=65535,r[2]+=e[3]*t[2],r[1]+=r[2]>>>16,r[2]&=65535,r[1]+=e[1]*t[3],r[0]+=r[1]>>>16,r[1]&=65535,r[1]+=e[2]*t[2],r[0]+=r[1]>>>16,r[1]&=65535,r[1]+=e[3]*t[1],r[0]+=r[1]>>>16,r[1]&=65535,r[0]+=e[0]*t[3]+e[1]*t[2]+e[2]*t[1]+e[3]*t[0],r[0]&=65535,[r[0]<<16|r[1],r[2]<<16|r[3]]}function xnr(e,t){return 32===(t%=64)?[e[1],e[0]]:t<32?[e[0]<<t|e[1]>>>32-t,e[1]<<t|e[0]>>>32-t]:(t-=32,[e[1]<<t|e[0]>>>32-t,e[0]<<t|e[1]>>>32-t])}function wnr(e,t){return 0===(t%=64)?e:t<32?[e[0]<<t|e[1]>>>32-t,e[1]<<t]:[e[1]<<t-32,0]}function knr(e,t){return[e[0]^t[0],e[1]^t[1]]}function _nr(e){return e=knr(e,[0,e[0]>>>1]),e=knr(e=bnr(e,[4283543511,3981806797]),[0,e[0]>>>1]),e=knr(e=bnr(e,[3301882366,444984403]),[0,e[0]>>>1])}function Cnr(e,t){t=t||0;var r,n=(e=e||"").length%16,o=e.length-n,a=[0,t],i=[0,t],s=[0,0],l=[0,0],c=[2277735313,289559509],u=[1291169091,658871167];for(r=0;r<o;r+=16)s=[255&e.charCodeAt(r+4)|(255&e.charCodeAt(r+5))<<8|(255&e.charCodeAt(r+6))<<16|(255&e.charCodeAt(r+7))<<24,255&e.charCodeAt(r)|(255&e.charCodeAt(r+1))<<8|(255&e.charCodeAt(r+2))<<16|(255&e.charCodeAt(r+3))<<24],l=[255&e.charCodeAt(r+12)|(255&e.charCodeAt(r+13))<<8|(255&e.charCodeAt(r+14))<<16|(255&e.charCodeAt(r+15))<<24,255&e.charCodeAt(r+8)|(255&e.charCodeAt(r+9))<<8|(255&e.charCodeAt(r+10))<<16|(255&e.charCodeAt(r+11))<<24],s=xnr(s=bnr(s,c),31),a=gnr(a=xnr(a=knr(a,s=bnr(s,u)),27),i),a=gnr(bnr(a,[0,5]),[0,1390208809]),l=xnr(l=bnr(l,u),33),i=gnr(i=xnr(i=knr(i,l=bnr(l,c)),31),a),i=gnr(bnr(i,[0,5]),[0,944331445]);switch(s=[0,0],l=[0,0],n){case 15:l=knr(l,wnr([0,e.charCodeAt(r+14)],48));case 14:l=knr(l,wnr([0,e.charCodeAt(r+13)],40));case 13:l=knr(l,wnr([0,e.charCodeAt(r+12)],32));case 12:l=knr(l,wnr([0,e.charCodeAt(r+11)],24));case 11:l=knr(l,wnr([0,e.charCodeAt(r+10)],16));case 10:l=knr(l,wnr([0,e.charCodeAt(r+9)],8));case 9:l=bnr(l=knr(l,[0,e.charCodeAt(r+8)]),u),i=knr(i,l=bnr(l=xnr(l,33),c));case 8:s=knr(s,wnr([0,e.charCodeAt(r+7)],56));case 7:s=knr(s,wnr([0,e.charCodeAt(r+6)],48));case 6:s=knr(s,wnr([0,e.charCodeAt(r+5)],40));case 5:s=knr(s,wnr([0,e.charCodeAt(r+4)],32));case 4:s=knr(s,wnr([0,e.charCodeAt(r+3)],24));case 3:s=knr(s,wnr([0,e.charCodeAt(r+2)],16));case 2:s=knr(s,wnr([0,e.charCodeAt(r+1)],8));case 1:s=bnr(s=knr(s,[0,e.charCodeAt(r)]),c),a=knr(a,s=bnr(s=xnr(s,31),u))}return a=gnr(a=knr(a,[0,e.length]),i=knr(i,[0,e.length])),i=gnr(i,a),a=gnr(a=_nr(a),i=_nr(i)),i=gnr(i,a),("00000000"+(a[0]>>>0).toString(16)).slice(-8)+("00000000"+(a[1]>>>0).toString(16)).slice(-8)+("00000000"+(i[0]>>>0).toString(16)).slice(-8)+("00000000"+(i[1]>>>0).toString(16)).slice(-8)}function Mnr(e){return parseInt(e)}function Snr(e){return parseFloat(e)}function Dnr(e,t){return"number"==typeof e&&isNaN(e)?t:e}function Onr(e){return e.reduce(function(e,t){return e+(t?1:0)},0)}function Pnr(e,t){if(void 0===t&&(t=1),Math.abs(t)>=1)return Math.round(e/t)*t;var r=1/t;return Math.round(e*r)/r}function Enr(e){return e&&"object"==typeof e&&"message"in e?e:{message:e}}function jnr(e){return"function"!=typeof e}function Tnr(e,t,r){var n=Object.keys(e).filter(function(e){return!function(e,t){for(var r=0,n=e.length;r<n;++r)if(e[r]===t)return!0;return!1}(r,e)}),o=vnr(n,function(r){return function(e,t){var r=new Promise(function(r){var n=Date.now();mnr(e.bind(null,t),function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var o=Date.now()-n;if(!e[0])return r(function(){return{error:Enr(e[1]),duration:o}});var a=e[1];if(jnr(a))return r(function(){return{value:a,duration:o}});r(function(){return new Promise(function(e){var t=Date.now();mnr(a,function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var a=o+Date.now()-t;if(!r[0])return e({error:Enr(r[1]),duration:a});e({value:r[1],duration:a})})})})})});return ynr(r),function(){return r.then(function(e){return e()})}}(e[r],t)});return ynr(o),function(){return Q(this,void 0,void 0,function(){var e,t,r,a;return J(this,function(i){switch(i.label){case 0:return[4,o];case 1:return[4,vnr(i.sent(),function(e){var t=e();return ynr(t),t})];case 2:return e=i.sent(),[4,Promise.all(e)];case 3:for(t=i.sent(),r={},a=0;a<n.length;++a)r[n[a]]=t[a];return[2,r]}})})}}function Nnr(){var e=window,t=navigator;return Onr(["MSCSSMatrix"in e,"msSetImmediate"in e,"msIndexedDB"in e,"msMaxTouchPoints"in t,"msPointerEnabled"in t])>=4}function Rnr(){var e=window,t=navigator;return Onr(["msWriteProfilerMark"in e,"MSStream"in e,"msLaunchUri"in t,"msSaveBlob"in t])>=3&&!Nnr()}function Fnr(){var e=window,t=navigator;return Onr(["webkitPersistentStorage"in t,"webkitTemporaryStorage"in t,0===t.vendor.indexOf("Google"),"webkitResolveLocalFileSystemURL"in e,"BatteryManager"in e,"webkitMediaStream"in e,"webkitSpeechGrammar"in e])>=5}function znr(){var e=window,t=navigator;return Onr(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,0===t.vendor.indexOf("Apple"),"getStorageUpdates"in t,"WebKitMediaKeys"in e])>=4}function Inr(){var e=window;return Onr(["safari"in e,!("DeviceMotionEvent"in e),!("ongestureend"in e),!("standalone"in navigator)])>=3}function Anr(){var e,t,r=window;return Onr(["buildID"in navigator,"MozAppearance"in(null!==(t=null===(e=document.documentElement)||void 0===e?void 0:e.style)&&void 0!==t?t:{}),"onmozfullscreenchange"in r,"mozInnerScreenX"in r,"CSSMozDocumentRule"in r,"CanvasCaptureMediaStream"in r])>=4}function Lnr(){var e=document;return e.fullscreenElement||e.msFullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||null}function Bnr(){var e=Fnr(),t=Anr();if(!e&&!t)return!1;var r=window;return Onr(["onorientationchange"in r,"orientation"in r,e&&!("SharedWorker"in r),t&&/android/i.test(navigator.appVersion)])>=2}function Vnr(e){var t=new Error(e);return t.name=e,t}function Hnr(e,t,r){var n,o,a;return void 0===r&&(r=50),Q(this,void 0,void 0,function(){var i,s;return J(this,function(l){switch(l.label){case 0:i=document,l.label=1;case 1:return i.body?[3,3]:[4,hnr(r)];case 2:return l.sent(),[3,1];case 3:s=i.createElement("iframe"),l.label=4;case 4:return l.trys.push([4,,10,11]),[4,new Promise(function(e,r){var n=!1,o=function(){n=!0,e()};s.onload=o,s.onerror=function(e){n=!0,r(e)};var a=s.style;a.setProperty("display","block","important"),a.position="absolute",a.top="0",a.left="0",a.visibility="hidden",t&&"srcdoc"in s?s.srcdoc=t:s.src="about:blank",i.body.appendChild(s);var l=function(){var e,t;n||("complete"===(null===(t=null===(e=s.contentWindow)||void 0===e?void 0:e.document)||void 0===t?void 0:t.readyState)?o():setTimeout(l,10))};l()})];case 5:l.sent(),l.label=6;case 6:return(null===(o=null===(n=s.contentWindow)||void 0===n?void 0:n.document)||void 0===o?void 0:o.body)?[3,8]:[4,hnr(r)];case 7:return l.sent(),[3,6];case 8:return[4,e(s,s.contentWindow)];case 9:return[2,l.sent()];case 10:return null===(a=s.parentNode)||void 0===a||a.removeChild(s),[7];case 11:return[2]}})})}function qnr(e){for(var t=function(e){for(var t,r,n="Unexpected syntax '".concat(e,"'"),o=/^\s*([a-z-]*)(.*)$/i.exec(e),a=o[1]||void 0,i={},s=/([.:#][\w-]+|\[.+?\])/gi,l=function(e,t){i[e]=i[e]||[],i[e].push(t)};;){var c=s.exec(o[2]);if(!c)break;var u=c[0];switch(u[0]){case".":l("class",u.slice(1));break;case"#":l("id",u.slice(1));break;case"[":var d=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(u);if(!d)throw new Error(n);l(d[1],null!==(r=null!==(t=d[4])&&void 0!==t?t:d[5])&&void 0!==r?r:"");break;default:throw new Error(n)}}return[a,i]}(e),r=t[0],n=t[1],o=document.createElement(null!=r?r:"div"),a=0,i=Object.keys(n);a<i.length;a++){var s=i[a],l=n[s].join(" ");"style"===s?$nr(o.style,l):o.setAttribute(s,l)}return o}function $nr(e,t){for(var r=0,n=t.split(";");r<n.length;r++){var o=n[r],a=/^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(o);if(a){var i=a[1],s=a[2],l=a[4];e.setProperty(i,s,l||"")}}}var Wnr=["monospace","sans-serif","serif"],Unr=["sans-serif-thin","ARNO PRO","Agency FB","Arabic Typesetting","Arial Unicode MS","AvantGarde Bk BT","BankGothic Md BT","Batang","Bitstream Vera Sans Mono","Calibri","Century","Century Gothic","Clarendon","EUROSTILE","Franklin Gothic","Futura Bk BT","Futura Md BT","GOTHAM","Gill Sans","HELV","Haettenschweiler","Helvetica Neue","Humanst521 BT","Leelawadee","Letter Gothic","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Outlook","MS Reference Specialty","MS UI Gothic","MT Extra","MYRIAD PRO","Marlett","Meiryo UI","Microsoft Uighur","Minion Pro","Monotype Corsiva","PMingLiU","Pristina","SCRIPTINA","Segoe UI Light","Serifa","SimHei","Small Fonts","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","Vrinda","ZWAdobeF"];function Gnr(e){return e.toDataURL()}var Knr,Ynr;function Xnr(){var e=this;return function(){if(void 0===Ynr){var e=function(){var t=Znr();Qnr(t)?Ynr=setTimeout(e,2500):(Knr=t,Ynr=void 0)};e()}}(),function(){return Q(e,void 0,void 0,function(){var e;return J(this,function(t){switch(t.label){case 0:return Qnr(e=Znr())?Knr?[2,ee([],Knr,!0)]:Lnr()?[4,(r=document,(r.exitFullscreen||r.msExitFullscreen||r.mozCancelFullScreen||r.webkitExitFullscreen).call(r))]:[3,2]:[3,2];case 1:t.sent(),e=Znr(),t.label=2;case 2:return Qnr(e)||(Knr=e),[2,e]}var r})})}}function Znr(){var e=screen;return[Dnr(Snr(e.availTop),null),Dnr(Snr(e.width)-Snr(e.availWidth)-Dnr(Snr(e.availLeft),0),null),Dnr(Snr(e.height)-Snr(e.availHeight)-Dnr(Snr(e.availTop),0),null),Dnr(Snr(e.availLeft),null)]}function Qnr(e){for(var t=0;t<4;++t)if(e[t])return!1;return!0}function Jnr(e){var t;return Q(this,void 0,void 0,function(){var r,n,o,a,i,s,l;return J(this,function(c){switch(c.label){case 0:for(r=document,n=r.createElement("div"),o=new Array(e.length),a={},eor(n),l=0;l<e.length;++l)"DIALOG"===(i=qnr(e[l])).tagName&&i.show(),eor(s=r.createElement("div")),s.appendChild(i),n.appendChild(s),o[l]=i;c.label=1;case 1:return r.body?[3,3]:[4,hnr(50)];case 2:return c.sent(),[3,1];case 3:r.body.appendChild(n);try{for(l=0;l<e.length;++l)o[l].offsetParent||(a[e[l]]=!0)}finally{null===(t=n.parentNode)||void 0===t||t.removeChild(n)}return[2,a]}})})}function eor(e){e.style.setProperty("display","block","important")}function tor(e){return matchMedia("(inverted-colors: ".concat(e,")")).matches}function ror(e){return matchMedia("(forced-colors: ".concat(e,")")).matches}function nor(e){return matchMedia("(prefers-contrast: ".concat(e,")")).matches}function oor(e){return matchMedia("(prefers-reduced-motion: ".concat(e,")")).matches}function aor(e){return matchMedia("(dynamic-range: ".concat(e,")")).matches}var ior=Math,sor=function(){return 0};var lor={default:[],apple:[{font:"-apple-system-body"}],serif:[{fontFamily:"serif"}],sans:[{fontFamily:"sans-serif"}],mono:[{fontFamily:"monospace"}],min:[{fontSize:"1px"}],system:[{fontFamily:"system-ui"}]};var cor={fonts:function(){return Hnr(function(e,t){var r=t.document,n=r.body;n.style.fontSize="48px";var o=r.createElement("div"),a={},i={},s=function(e){var t=r.createElement("span"),n=t.style;return n.position="absolute",n.top="0",n.left="0",n.fontFamily=e,t.textContent="mmMwWLliI0O&1",o.appendChild(t),t},l=Wnr.map(s),c=function(){for(var e={},t=function(t){e[t]=Wnr.map(function(e){return function(e,t){return s("'".concat(e,"',").concat(t))}(t,e)})},r=0,n=Unr;r<n.length;r++){t(n[r])}return e}();n.appendChild(o);for(var u=0;u<Wnr.length;u++)a[Wnr[u]]=l[u].offsetWidth,i[Wnr[u]]=l[u].offsetHeight;return Unr.filter(function(e){return t=c[e],Wnr.some(function(e,r){return t[r].offsetWidth!==a[e]||t[r].offsetHeight!==i[e]});var t})})},domBlockers:function(e){var t=(void 0===e?{}:e).debug;return Q(this,void 0,void 0,function(){var e,r,n,o,a;return J(this,function(i){switch(i.label){case 0:return znr()||Bnr()?(s=atob,e={abpIndo:["#Iklan-Melayang","#Kolom-Iklan-728","#SidebarIklan-wrapper",'[title="ALIENBOLA" i]',s("I0JveC1CYW5uZXItYWRz")],abpvn:[".quangcao","#mobileCatfish",s("LmNsb3NlLWFkcw=="),'[id^="bn_bottom_fixed_"]',"#pmadv"],adBlockFinland:[".mainostila",s("LnNwb25zb3JpdA=="),".ylamainos",s("YVtocmVmKj0iL2NsaWNrdGhyZ2guYXNwPyJd"),s("YVtocmVmXj0iaHR0cHM6Ly9hcHAucmVhZHBlYWsuY29tL2FkcyJd")],adBlockPersian:["#navbar_notice_50",".kadr",'TABLE[width="140px"]',"#divAgahi",s("YVtocmVmXj0iaHR0cDovL2cxLnYuZndtcm0ubmV0L2FkLyJd")],adBlockWarningRemoval:["#adblock-honeypot",".adblocker-root",".wp_adblock_detect",s("LmhlYWRlci1ibG9ja2VkLWFk"),s("I2FkX2Jsb2NrZXI=")],adGuardAnnoyances:[".hs-sosyal","#cookieconsentdiv",'div[class^="app_gdpr"]',".as-oil",'[data-cypress="soft-push-notification-modal"]'],adGuardBase:[".BetterJsPopOverlay",s("I2FkXzMwMFgyNTA="),s("I2Jhbm5lcmZsb2F0MjI="),s("I2NhbXBhaWduLWJhbm5lcg=="),s("I0FkLUNvbnRlbnQ=")],adGuardChinese:[s("LlppX2FkX2FfSA=="),s("YVtocmVmKj0iLmh0aGJldDM0LmNvbSJd"),"#widget-quan",s("YVtocmVmKj0iLzg0OTkyMDIwLnh5eiJd"),s("YVtocmVmKj0iLjE5NTZobC5jb20vIl0=")],adGuardFrench:["#pavePub",s("LmFkLWRlc2t0b3AtcmVjdGFuZ2xl"),".mobile_adhesion",".widgetadv",s("LmFkc19iYW4=")],adGuardGerman:['aside[data-portal-id="leaderboard"]'],adGuardJapanese:["#kauli_yad_1",s("YVtocmVmXj0iaHR0cDovL2FkMi50cmFmZmljZ2F0ZS5uZXQvIl0="),s("Ll9wb3BJbl9pbmZpbml0ZV9hZA=="),s("LmFkZ29vZ2xl"),s("Ll9faXNib29zdFJldHVybkFk")],adGuardMobile:[s("YW1wLWF1dG8tYWRz"),s("LmFtcF9hZA=="),'amp-embed[type="24smi"]',"#mgid_iframe1",s("I2FkX2ludmlld19hcmVh")],adGuardRussian:[s("YVtocmVmXj0iaHR0cHM6Ly9hZC5sZXRtZWFkcy5jb20vIl0="),s("LnJlY2xhbWE="),'div[id^="smi2adblock"]',s("ZGl2W2lkXj0iQWRGb3hfYmFubmVyXyJd"),"#psyduckpockeball"],adGuardSocial:[s("YVtocmVmXj0iLy93d3cuc3R1bWJsZXVwb24uY29tL3N1Ym1pdD91cmw9Il0="),s("YVtocmVmXj0iLy90ZWxlZ3JhbS5tZS9zaGFyZS91cmw/Il0="),".etsy-tweet","#inlineShare",".popup-social"],adGuardSpanishPortuguese:["#barraPublicidade","#Publicidade","#publiEspecial","#queTooltip",".cnt-publi"],adGuardTrackingProtection:["#qoo-counter",s("YVtocmVmXj0iaHR0cDovL2NsaWNrLmhvdGxvZy5ydS8iXQ=="),s("YVtocmVmXj0iaHR0cDovL2hpdGNvdW50ZXIucnUvdG9wL3N0YXQucGhwIl0="),s("YVtocmVmXj0iaHR0cDovL3RvcC5tYWlsLnJ1L2p1bXAiXQ=="),"#top100counter"],adGuardTurkish:["#backkapat",s("I3Jla2xhbWk="),s("YVtocmVmXj0iaHR0cDovL2Fkc2Vydi5vbnRlay5jb20udHIvIl0="),s("YVtocmVmXj0iaHR0cDovL2l6bGVuemkuY29tL2NhbXBhaWduLyJd"),s("YVtocmVmXj0iaHR0cDovL3d3dy5pbnN0YWxsYWRzLm5ldC8iXQ==")],bulgarian:[s("dGQjZnJlZW5ldF90YWJsZV9hZHM="),"#ea_intext_div",".lapni-pop-over","#xenium_hot_offers"],easyList:[".yb-floorad",s("LndpZGdldF9wb19hZHNfd2lkZ2V0"),s("LnRyYWZmaWNqdW5reS1hZA=="),".textad_headline",s("LnNwb25zb3JlZC10ZXh0LWxpbmtz")],easyListChina:[s("LmFwcGd1aWRlLXdyYXBbb25jbGljayo9ImJjZWJvcy5jb20iXQ=="),s("LmZyb250cGFnZUFkdk0="),"#taotaole","#aafoot.top_box",".cfa_popup"],easyListCookie:[".ezmob-footer",".cc-CookieWarning","[data-cookie-number]",s("LmF3LWNvb2tpZS1iYW5uZXI="),".sygnal24-gdpr-modal-wrap"],easyListCzechSlovak:["#onlajny-stickers",s("I3Jla2xhbW5pLWJveA=="),s("LnJla2xhbWEtbWVnYWJvYXJk"),".sklik",s("W2lkXj0ic2tsaWtSZWtsYW1hIl0=")],easyListDutch:[s("I2FkdmVydGVudGll"),s("I3ZpcEFkbWFya3RCYW5uZXJCbG9jaw=="),".adstekst",s("YVtocmVmXj0iaHR0cHM6Ly94bHR1YmUubmwvY2xpY2svIl0="),"#semilo-lrectangle"],easyListGermany:["#SSpotIMPopSlider",s("LnNwb25zb3JsaW5rZ3J1ZW4="),s("I3dlcmJ1bmdza3k="),s("I3Jla2xhbWUtcmVjaHRzLW1pdHRl"),s("YVtocmVmXj0iaHR0cHM6Ly9iZDc0Mi5jb20vIl0=")],easyListItaly:[s("LmJveF9hZHZfYW5udW5jaQ=="),".sb-box-pubbliredazionale",s("YVtocmVmXj0iaHR0cDovL2FmZmlsaWF6aW9uaWFkcy5zbmFpLml0LyJd"),s("YVtocmVmXj0iaHR0cHM6Ly9hZHNlcnZlci5odG1sLml0LyJd"),s("YVtocmVmXj0iaHR0cHM6Ly9hZmZpbGlhemlvbmlhZHMuc25haS5pdC8iXQ==")],easyListLithuania:[s("LnJla2xhbW9zX3RhcnBhcw=="),s("LnJla2xhbW9zX251b3JvZG9z"),s("aW1nW2FsdD0iUmVrbGFtaW5pcyBza3lkZWxpcyJd"),s("aW1nW2FsdD0iRGVkaWt1b3RpLmx0IHNlcnZlcmlhaSJd"),s("aW1nW2FsdD0iSG9zdGluZ2FzIFNlcnZlcmlhaS5sdCJd")],estonian:[s("QVtocmVmKj0iaHR0cDovL3BheTRyZXN1bHRzMjQuZXUiXQ==")],fanboyAnnoyances:["#ac-lre-player",".navigate-to-top","#subscribe_popup",".newsletter_holder","#back-top"],fanboyAntiFacebook:[".util-bar-module-firefly-visible"],fanboyEnhancedTrackers:[".open.pushModal","#issuem-leaky-paywall-articles-zero-remaining-nag","#sovrn_container",'div[class$="-hide"][zoompage-fontsize][style="display: block;"]',".BlockNag__Card"],fanboySocial:["#FollowUs","#meteored_share","#social_follow",".article-sharer",".community__social-desc"],frellwitSwedish:[s("YVtocmVmKj0iY2FzaW5vcHJvLnNlIl1bdGFyZ2V0PSJfYmxhbmsiXQ=="),s("YVtocmVmKj0iZG9rdG9yLXNlLm9uZWxpbmsubWUiXQ=="),"article.category-samarbete",s("ZGl2LmhvbGlkQWRz"),"ul.adsmodern"],greekAdBlock:[s("QVtocmVmKj0iYWRtYW4ub3RlbmV0LmdyL2NsaWNrPyJd"),s("QVtocmVmKj0iaHR0cDovL2F4aWFiYW5uZXJzLmV4b2R1cy5nci8iXQ=="),s("QVtocmVmKj0iaHR0cDovL2ludGVyYWN0aXZlLmZvcnRobmV0LmdyL2NsaWNrPyJd"),"DIV.agores300","TABLE.advright"],hungarian:["#cemp_doboz",".optimonk-iframe-container",s("LmFkX19tYWlu"),s("W2NsYXNzKj0iR29vZ2xlQWRzIl0="),"#hirdetesek_box"],iDontCareAboutCookies:['.alert-info[data-block-track*="CookieNotice"]',".ModuleTemplateCookieIndicator",".o--cookies--container","#cookies-policy-sticky","#stickyCookieBar"],icelandicAbp:[s("QVtocmVmXj0iL2ZyYW1ld29yay9yZXNvdXJjZXMvZm9ybXMvYWRzLmFzcHgiXQ==")],latvian:[s("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiAxMjBweDsgaGVpZ2h0OiA0MHB4OyBvdmVyZmxvdzogaGlkZGVuOyBwb3NpdGlvbjogcmVsYXRpdmU7Il0="),s("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiA4OHB4OyBoZWlnaHQ6IDMxcHg7IG92ZXJmbG93OiBoaWRkZW47IHBvc2l0aW9uOiByZWxhdGl2ZTsiXQ==")],listKr:[s("YVtocmVmKj0iLy9hZC5wbGFuYnBsdXMuY28ua3IvIl0="),s("I2xpdmVyZUFkV3JhcHBlcg=="),s("YVtocmVmKj0iLy9hZHYuaW1hZHJlcC5jby5rci8iXQ=="),s("aW5zLmZhc3R2aWV3LWFk"),".revenue_unit_item.dable"],listeAr:[s("LmdlbWluaUxCMUFk"),".right-and-left-sponsers",s("YVtocmVmKj0iLmFmbGFtLmluZm8iXQ=="),s("YVtocmVmKj0iYm9vcmFxLm9yZyJd"),s("YVtocmVmKj0iZHViaXp6bGUuY29tL2FyLz91dG1fc291cmNlPSJd")],listeFr:[s("YVtocmVmXj0iaHR0cDovL3Byb21vLnZhZG9yLmNvbS8iXQ=="),s("I2FkY29udGFpbmVyX3JlY2hlcmNoZQ=="),s("YVtocmVmKj0id2Vib3JhbWEuZnIvZmNnaS1iaW4vIl0="),".site-pub-interstitiel",'div[id^="crt-"][data-criteo-id]'],officialPolish:["#ceneo-placeholder-ceneo-12",s("W2hyZWZePSJodHRwczovL2FmZi5zZW5kaHViLnBsLyJd"),s("YVtocmVmXj0iaHR0cDovL2Fkdm1hbmFnZXIudGVjaGZ1bi5wbC9yZWRpcmVjdC8iXQ=="),s("YVtocmVmXj0iaHR0cDovL3d3dy50cml6ZXIucGwvP3V0bV9zb3VyY2UiXQ=="),s("ZGl2I3NrYXBpZWNfYWQ=")],ro:[s("YVtocmVmXj0iLy9hZmZ0cmsuYWx0ZXgucm8vQ291bnRlci9DbGljayJd"),s("YVtocmVmXj0iaHR0cHM6Ly9ibGFja2ZyaWRheXNhbGVzLnJvL3Ryay9zaG9wLyJd"),s("YVtocmVmXj0iaHR0cHM6Ly9ldmVudC4ycGVyZm9ybWFudC5jb20vZXZlbnRzL2NsaWNrIl0="),s("YVtocmVmXj0iaHR0cHM6Ly9sLnByb2ZpdHNoYXJlLnJvLyJd"),'a[href^="/url/"]'],ruAd:[s("YVtocmVmKj0iLy9mZWJyYXJlLnJ1LyJd"),s("YVtocmVmKj0iLy91dGltZy5ydS8iXQ=="),s("YVtocmVmKj0iOi8vY2hpa2lkaWtpLnJ1Il0="),"#pgeldiz",".yandex-rtb-block"],thaiAds:["a[href*=macau-uta-popup]",s("I2Fkcy1nb29nbGUtbWlkZGxlX3JlY3RhbmdsZS1ncm91cA=="),s("LmFkczMwMHM="),".bumq",".img-kosana"],webAnnoyancesUltralist:["#mod-social-share-2","#social-tools",s("LmN0cGwtZnVsbGJhbm5lcg=="),".zergnet-recommend",".yt.btn-link.btn-md.btn"]},r=Object.keys(e),[4,Jnr((a=[]).concat.apply(a,r.map(function(t){return e[t]})))]):[2,void 0];case 1:return n=i.sent(),t&&function(e,t){for(var r="DOM blockers debug:\n```",n=0,o=Object.keys(e);n<o.length;n++){var a=o[n];r+="\n".concat(a,":");for(var i=0,s=e[a];i<s.length;i++){var l=s[i];r+="\n ".concat(t[l]?"🚫":"➡️"," ").concat(l)}}console.log("".concat(r,"\n```"))}(e,n),(o=r.filter(function(t){var r=e[t];return Onr(r.map(function(e){return n[e]}))>.6*r.length})).sort(),[2,o]}var s})})},fontPreferences:function(){return function(e,t){void 0===t&&(t=4e3);return Hnr(function(r,n){var o=n.document,a=o.body,i=a.style;i.width="".concat(t,"px"),i.webkitTextSizeAdjust=i.textSizeAdjust="none",Fnr()?a.style.zoom="".concat(1/n.devicePixelRatio):znr()&&(a.style.zoom="reset");var s=o.createElement("div");return s.textContent=ee([],Array(t/20|0),!0).map(function(){return"word"}).join(" "),a.appendChild(s),e(o,a)},'<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1">')}(function(e,t){for(var r={},n={},o=0,a=Object.keys(lor);o<a.length;o++){var i=a[o],s=lor[i],l=s[0],c=void 0===l?{}:l,u=s[1],d=void 0===u?"mmMwWLliI0fiflO&1":u,p=e.createElement("span");p.textContent=d,p.style.whiteSpace="nowrap";for(var h=0,f=Object.keys(c);h<f.length;h++){var m=f[h],v=c[m];void 0!==v&&(p.style[m]=v)}r[i]=p,t.appendChild(e.createElement("br")),t.appendChild(p)}for(var y=0,g=Object.keys(lor);y<g.length;y++){n[i=g[y]]=r[i].getBoundingClientRect().width}return n})},audio:function(){var e=window,t=e.OfflineAudioContext||e.webkitOfflineAudioContext;if(!t)return-2;if(znr()&&!Inr()&&!function(){var e=window;return Onr(["DOMRectList"in e,"RTCPeerConnectionIceEvent"in e,"SVGGeometryElement"in e,"ontransitioncancel"in e])>=3}())return-1;var r=new t(1,5e3,44100),n=r.createOscillator();n.type="triangle",n.frequency.value=1e4;var o=r.createDynamicsCompressor();o.threshold.value=-50,o.knee.value=40,o.ratio.value=12,o.attack.value=0,o.release.value=.25,n.connect(o),o.connect(r.destination),n.start(0);var a=function(e){var t=3,r=500,n=500,o=5e3,a=function(){},i=new Promise(function(i,s){var l=!1,c=0,u=0;e.oncomplete=function(e){return i(e.renderedBuffer)};var d=function(){setTimeout(function(){return s(Vnr("timeout"))},Math.min(n,u+o-Date.now()))},p=function(){try{var n=e.startRendering();switch(fnr(n)&&ynr(n),e.state){case"running":u=Date.now(),l&&d();break;case"suspended":document.hidden||c++,l&&c>=t?s(Vnr("suspended")):setTimeout(p,r)}}catch(e){s(e)}};p(),a=function(){l||(l=!0,u>0&&d())}});return[i,a]}(r),i=a[0],s=a[1],l=i.then(function(e){return function(e){for(var t=0,r=0;r<e.length;++r)t+=Math.abs(e[r]);return t}(e.getChannelData(0).subarray(4500))},function(e){if("timeout"===e.name||"suspended"===e.name)return-3;throw e});return ynr(l),function(){return s(),l}},screenFrame:function(){var e=this,t=Xnr();return function(){return Q(e,void 0,void 0,function(){var e,r;return J(this,function(n){switch(n.label){case 0:return[4,t()];case 1:return e=n.sent(),[2,[(r=function(e){return null===e?null:Pnr(e,10)})(e[0]),r(e[1]),r(e[2]),r(e[3])]]}})})}},osCpu:function(){return navigator.oscpu},languages:function(){var e,t=navigator,r=[],n=t.language||t.userLanguage||t.browserLanguage||t.systemLanguage;if(void 0!==n&&r.push([n]),Array.isArray(t.languages))Fnr()&&Onr([!("MediaSettingsRange"in(e=window)),"RTCEncodedAudioFrame"in e,""+e.Intl=="[object Intl]",""+e.Reflect=="[object Reflect]"])>=3||r.push(t.languages);else if("string"==typeof t.languages){var o=t.languages;o&&r.push(o.split(","))}return r},colorDepth:function(){return window.screen.colorDepth},deviceMemory:function(){return Dnr(Snr(navigator.deviceMemory),void 0)},screenResolution:function(){var e=screen,t=function(e){return Dnr(Mnr(e),null)},r=[t(e.width),t(e.height)];return r.sort().reverse(),r},hardwareConcurrency:function(){return Dnr(Mnr(navigator.hardwareConcurrency),void 0)},timezone:function(){var e,t=null===(e=window.Intl)||void 0===e?void 0:e.DateTimeFormat;if(t){var r=(new t).resolvedOptions().timeZone;if(r)return r}var n,o=(n=(new Date).getFullYear(),-Math.max(Snr(new Date(n,0,1).getTimezoneOffset()),Snr(new Date(n,6,1).getTimezoneOffset())));return"UTC".concat(o>=0?"+":"").concat(Math.abs(o))},sessionStorage:function(){try{return!!window.sessionStorage}catch(e){return!0}},localStorage:function(){try{return!!window.localStorage}catch(e){return!0}},indexedDB:function(){if(!Nnr()&&!Rnr())try{return!!window.indexedDB}catch(e){return!0}},openDatabase:function(){return!!window.openDatabase},cpuClass:function(){return navigator.cpuClass},platform:function(){var e=navigator.platform;return"MacIntel"===e&&znr()&&!Inr()?function(){if("iPad"===navigator.platform)return!0;var e=screen,t=e.width/e.height;return Onr(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,t>.65&&t<1.53])>=2}()?"iPad":"iPhone":e},plugins:function(){var e=navigator.plugins;if(e){for(var t=[],r=0;r<e.length;++r){var n=e[r];if(n){for(var o=[],a=0;a<n.length;++a){var i=n[a];o.push({type:i.type,suffixes:i.suffixes})}t.push({name:n.name,description:n.description,mimeTypes:o})}}return t}},canvas:function(){var e,t,r=!1,n=function(){var e=document.createElement("canvas");return e.width=1,e.height=1,[e,e.getContext("2d")]}(),o=n[0],a=n[1];if(function(e,t){return!(!t||!e.toDataURL)}(o,a)){r=function(e){return e.rect(0,0,10,10),e.rect(2,2,6,6),!e.isPointInPath(5,5,"evenodd")}(a),function(e,t){e.width=240,e.height=60,t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(100,1,62,20),t.fillStyle="#069",t.font='11pt "Times New Roman"';var r="Cwm fjordbank gly ".concat(String.fromCharCode(55357,56835));t.fillText(r,2,15),t.fillStyle="rgba(102, 204, 0, 0.2)",t.font="18pt Arial",t.fillText(r,4,45)}(o,a);var i=Gnr(o);i!==Gnr(o)?e=t="unstable":(t=i,function(e,t){e.width=122,e.height=110,t.globalCompositeOperation="multiply";for(var r=0,n=[["#f2f",40,40],["#2ff",80,40],["#ff2",60,80]];r<n.length;r++){var o=n[r],a=o[0],i=o[1],s=o[2];t.fillStyle=a,t.beginPath(),t.arc(i,s,40,0,2*Math.PI,!0),t.closePath(),t.fill()}t.fillStyle="#f9c",t.arc(60,60,60,0,2*Math.PI,!0),t.arc(60,60,20,0,2*Math.PI,!0),t.fill("evenodd")}(o,a),e=Gnr(o))}else e=t="";return{winding:r,geometry:e,text:t}},touchSupport:function(){var e,t=navigator,r=0;void 0!==t.maxTouchPoints?r=Mnr(t.maxTouchPoints):void 0!==t.msMaxTouchPoints&&(r=t.msMaxTouchPoints);try{document.createEvent("TouchEvent"),e=!0}catch(t){e=!1}return{maxTouchPoints:r,touchEvent:e,touchStart:"ontouchstart"in window}},vendor:function(){return navigator.vendor||""},vendorFlavors:function(){for(var e=[],t=0,r=["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"];t<r.length;t++){var n=r[t],o=window[n];o&&"object"==typeof o&&e.push(n)}return e.sort()},cookiesEnabled:function(){var e=document;try{e.cookie="cookietest=1; SameSite=Strict;";var t=-1!==e.cookie.indexOf("cookietest=");return e.cookie="cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT",t}catch(e){return!1}},colorGamut:function(){for(var e=0,t=["rec2020","p3","srgb"];e<t.length;e++){var r=t[e];if(matchMedia("(color-gamut: ".concat(r,")")).matches)return r}},invertedColors:function(){return!!tor("inverted")||!tor("none")&&void 0},forcedColors:function(){return!!ror("active")||!ror("none")&&void 0},monochrome:function(){if(matchMedia("(min-monochrome: 0)").matches){for(var e=0;e<=100;++e)if(matchMedia("(max-monochrome: ".concat(e,")")).matches)return e;throw new Error("Too high value")}},contrast:function(){return nor("no-preference")?0:nor("high")||nor("more")?1:nor("low")||nor("less")?-1:nor("forced")?10:void 0},reducedMotion:function(){return!!oor("reduce")||!oor("no-preference")&&void 0},hdr:function(){return!!aor("high")||!aor("standard")&&void 0},math:function(){var e,t=ior.acos||sor,r=ior.acosh||sor,n=ior.asin||sor,o=ior.asinh||sor,a=ior.atanh||sor,i=ior.atan||sor,s=ior.sin||sor,l=ior.sinh||sor,c=ior.cos||sor,u=ior.cosh||sor,d=ior.tan||sor,p=ior.tanh||sor,h=ior.exp||sor,f=ior.expm1||sor,m=ior.log1p||sor;return{acos:t(.12312423423423424),acosh:r(1e308),acoshPf:(e=1e154,ior.log(e+ior.sqrt(e*e-1))),asin:n(.12312423423423424),asinh:o(1),asinhPf:function(e){return ior.log(e+ior.sqrt(e*e+1))}(1),atanh:a(.5),atanhPf:function(e){return ior.log((1+e)/(1-e))/2}(.5),atan:i(.5),sin:s(-1e300),sinh:l(1),sinhPf:function(e){return ior.exp(e)-1/ior.exp(e)/2}(1),cos:c(10.000000000123),cosh:u(1),coshPf:function(e){return(ior.exp(e)+1/ior.exp(e))/2}(1),tan:d(-1e300),tanh:p(1),tanhPf:function(e){return(ior.exp(2*e)-1)/(ior.exp(2*e)+1)}(1),exp:h(1),expm1:f(1),expm1Pf:function(e){return ior.exp(e)-1}(1),log1p:m(10),log1pPf:function(e){return ior.log(1+e)}(10),powPI:function(e){return ior.pow(ior.PI,e)}(-100)}},videoCard:function(){var e,t=document.createElement("canvas"),r=null!==(e=t.getContext("webgl"))&&void 0!==e?e:t.getContext("experimental-webgl");if(r&&"getExtension"in r){var n=r.getExtension("WEBGL_debug_renderer_info");if(n)return{vendor:(r.getParameter(n.UNMASKED_VENDOR_WEBGL)||"").toString(),renderer:(r.getParameter(n.UNMASKED_RENDERER_WEBGL)||"").toString()}}},pdfViewerEnabled:function(){return navigator.pdfViewerEnabled},architecture:function(){var e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=1/0,e[0]=e[0]-e[0],t[3]}};function uor(e){var t=function(e){if(Bnr())return.4;if(znr())return Inr()?.5:.3;var t=e.platform.value||"";if(/^Win/.test(t))return.6;if(/^Mac/.test(t))return.5;return.7}(e),r=function(e){return Pnr(.99+.01*e,1e-4)}(t);return{score:t,comment:"$ if upgrade to Pro: https://fpjs.dev/pro".replace(/\$/g,"".concat(r))}}function dor(e){return JSON.stringify(e,function(e,t){return t instanceof Error?function(e){var t;return X({name:e.name,message:e.message,stack:null===(t=e.stack)||void 0===t?void 0:t.split("\n")},e)}(t):t},2)}function por(e){return Cnr(function(e){for(var t="",r=0,n=Object.keys(e).sort();r<n.length;r++){var o=n[r],a=e[o],i=a.error?"error":JSON.stringify(a.value);t+="".concat(t?"|":"").concat(o.replace(/([:|\\])/g,"\\$1"),":").concat(i)}return t}(e))}function hor(e){return void 0===e&&(e=50),function(e,t){void 0===t&&(t=1/0);var r=window.requestIdleCallback;return r?new Promise(function(e){return r.call(window,function(){return e()},{timeout:t})}):hnr(Math.min(e,t))}(e,2*e)}function mor(e,t){var r=Date.now();return{get:function(n){return Q(this,void 0,void 0,function(){var o,a,i;return J(this,function(s){switch(s.label){case 0:return o=Date.now(),[4,e()];case 1:return a=s.sent(),i=function(e){var t,r=uor(e);return{get visitorId(){return void 0===t&&(t=por(this.components)),t},set visitorId(e){t=e},confidence:r,components:e,version:pnr}}(a),(t||(null==n?void 0:n.debug))&&console.log("Copy the text below to get the debug data:\n\n```\nversion: ".concat(i.version,"\nuserAgent: ").concat(navigator.userAgent,"\ntimeBetweenLoadAndGet: ").concat(o-r,"\nvisitorId: ").concat(i.visitorId,"\ncomponents: ").concat(dor(a),"\n```")),[2,i]}})})}}}function vor(e){var t=void 0===e?{}:e,r=t.delayFallback,n=t.debug,o=t.monitoring,a=void 0===o||o;return Q(this,void 0,void 0,function(){var e;return J(this,function(t){switch(t.label){case 0:return a&&function(){if(!(window.__fpjs_d_m||Math.random()>=.001))try{var e=new XMLHttpRequest;e.open("get","https://m1.openfpcdn.io/fingerprintjs/v".concat(pnr,"/npm-monitoring"),!0),e.send()}catch(e){console.error(e)}}(),[4,hor(r)];case 1:return t.sent(),e=function(e){return Tnr(cor,e,[])}({debug:n}),[2,mor(e,n)]}})})}var yor={load:vor,hashComponents:por,componentsToDebugString:dor},gor=Cnr,bor=Object.freeze({__proto__:null,componentsToDebugString:dor,default:yor,getFullscreenElement:Lnr,getScreenFrame:Xnr,hashComponents:por,isAndroid:Bnr,isChromium:Fnr,isDesktopSafari:Inr,isEdgeHTML:Rnr,isGecko:Anr,isTrident:Nnr,isWebKit:znr,load:vor,loadSources:Tnr,murmurX64Hash128:gor,prepareForSources:hor,sources:cor,transformSource:function(e,t){var r=function(e){return jnr(e)?t(e):function(){var r=e();return fnr(r)?r.then(t):t(r)}};return function(t){var n=e(t);return fnr(n)?n.then(r):r(n)}},withIframe:Hnr});exports.AccountButtonContext=aqt,exports.AccountButtonProvider=iqt,exports.ActionButtonCell=arr,exports.AlertMolecule=vnt,exports.ApiContext=dqt,exports.ApiProvider=function(e){var t=e.api,r=e.children;return lt(dqt.Provider,X({value:t},{children:r}))},exports.AvatarTextCell=function(e){var t,r,n=e.row,o=e.avatarField,a=e.textField,i=String(null!==(t=irr(n,o))&&void 0!==t?t:"")||void 0,s=String(null!==(r=irr(n,a))&&void 0!==r?r:"");return ct(nh,X({sx:{display:"flex",alignItems:"center"}},{children:[lt(zp,{src:i,sx:{width:24,height:24,mr:1}}),lt(Ic,X({variant:"body2"},{children:s}))]}))},exports.BackgroundImage=$C,exports.BadgeMolecule=ynt,exports.BaseMolecule=yLt,exports.BaseTextButton=D_,exports.BasicTextField=knt,exports.BinaryRadioButtons=pat,exports.BooleanIconCell=srr,exports.Button=_nt,exports.ButtonActionsContext=GT,exports.ButtonActionsProvider=function(t){var r,n,o,a=t.children,i=t.popupProps,s=oqt().localStateObject,l=lqt().stateConfig,c=s||l,u=e.useState({}),d=u[0],p=u[1],h=e.useState(!1),f=h[0],m=h[1],v=e.useState(!1),y=v[0],g=v[1],b=e.useState(null),x=b[0],w=b[1],k=ZT().onStateChange,_=function(e){var t=null==i?void 0:i.find(function(t){return t.id===e});w(t||null),m(!0),k({id:e,type:"opened"})};e.useEffect(function(){null==i||i.forEach(function(e){var t;(null===(t=c[e.id])||void 0===t?void 0:t.visible)&&_(e.id)})},[c]);var C=function(e){w(null),m(!1),k({id:e,type:"closed"})},M=function(){g(!1)};lt(rqt,{item:d});var S=e.useMemo(function(){return{actionContent:d,setActionContent:p,isModalVisible:f,isDrawerVisible:y,setDrawerVisible:g,setActivePopUpById:_,onCloseDrawer:M,onCloseModal:C}},[d,p,f,y,g,_,M,C]),D=x||{},O=D.config,P=D.content;return ct(GT.Provider,X({value:S},{children:[x&&f&&ct(cat,X({size:null==O?void 0:O.size,open:f,onClose:function(){return C(x.id)},popupId:x.id,modalStyles:null==O?void 0:O.styles,withCloseIcon:null==O?void 0:O.withCloseIcon},{children:[null===(r=null==P?void 0:P.embedded)||void 0===r?void 0:r.map(function(e){var t;return lt(XT,X({initItems:null===(t=null==e?void 0:e.body)||void 0===t?void 0:t.items},{children:lt(rqt,{item:null==e?void 0:e.body},e.id)}))}),(null==P?void 0:P.isi)&&lt(rqt,{item:null===(o=null===(n=null==x?void 0:x.content)||void 0===n?void 0:n.isi)||void 0===o?void 0:o.body})]})),a]}))},exports.COMMUNICATION_LINK_DATA_TEXT=Lqt,exports.COMMUNICATION_LINK_DATA_URL=Aqt,exports.COMMUNICATION_LINK_ELEMENT_ID=zqt,exports.CalendarDataGridOrganism=Yrr,exports.CalendarOrganism=tnr,exports.CellRendererRegistry=frr,exports.Checkbox=hat,exports.Checklist=jnt,exports.ChipMolecule=Tnt,exports.Circle=T_,exports.CirclesWrapper=R_,exports.CircularIndicator=function(e){var t=e.activeColor,r=e.inactiveColor,n=Z(e,["activeColor","inactiveColor"]),o=(Qe()||mt).colors;return lt(F_,X({},n,{activeColor:o[t]||t,inactiveColor:o[r]||r}))},exports.CircularIndicatorStyledComponent=F_,exports.ConsentMolecule=Nnt,exports.Container=QHt,exports.ContainerRuntimeContext=gnt,exports.ContainerRuntimeContextProvider=xnt,exports.ContainerWrapper=h$,exports.ContentWrapper=function(t){var r=t.children,n=t.className,o=t.marginTop,a=void 0===o?"0px":o,i=t.marginLeft,s=void 0===i?"0px":i,l=t.marginRight,c=void 0===l?"0px":l,u=mat(),d=u.drawer,p=u.setDrawerContainerRef,h=e.useRef(null);e.useEffect(function(){return p&&p(h.current),function(){p&&p(null)}},[p]);var f=function(e){var t=parseFloat(e);return isNaN(t)?0:t},m=f(s),v="absolute"!==d.positionType&&"left"===d.position&&d.isOpen?"".concat(m+d.width,"px"):s,y=f(c),g="absolute"!==d.positionType&&"right"===d.position&&d.isOpen?"".concat(y+d.width,"px"):c;return lt(vat,X({ref:h,className:n,style:{marginTop:a,marginLeft:v,marginRight:g}},{children:r}))},exports.CurrencyCell=lrr,exports.CustomValidation=Int,exports.DataGridOrganism=Wrr,exports.DateCalendar=Hnt,exports.DateCell=crr,exports.DatePickerMolecule=cot,exports.DefaultTextCell=urr,exports.Divider=uot,exports.Drawer=kot,exports.EmailLinkCell=drr,exports.ErrorText=function(e){var t=e.text;return ct(st,{children:[lt(Rnt,{height:"XS"}),lt(Fnt,X({variant:"XS",color:"red"},{children:t}))]})},exports.FormOrganismItem=tqt,exports.FormStepContext=qHt,exports.FormStepContextProvider=$Ht,exports.HorizontalButtons=function(e){var t=e.onClick,r=e.disabled,n=e.buttonOptions,o=e.selectedButtonId,a=e.error,i=(null==n?void 0:n.slice(0,2))||[];return lt(z_,X({error:a,disabled:r},{children:i.map(function(e){var r=e.value,n=e.id;return lt(I_,X({isActive:n===o,onClick:function(){return t(n)}},{children:r}),n)})}))},exports.HorizontalPadding=zC,exports.Icon=L_,exports.IconButton=function(e){var t=e.name,r=e.color,n=e.onClick,o=e.disabled,a=e.activeOpacity,i=e.withoutOpacityEffect,s=Z(e,["name","color","onClick","disabled","activeOpacity","withoutOpacityEffect"]),l=(Qe()||mt).colors;return lt(P_,X({onClick:n,disabled:o,activeOpacity:a,withoutOpacityEffect:i},{children:lt(S_[t],X({},s,{color:l[r]||r}))}))},exports.IconRenderer=mnt,exports.IconWrapper=dat,exports.Image=dot,exports.Input=tC,exports.LayoutContext=fat,exports.LayoutProvider=function(t){var r=t.children,n=t.layoutPosition,o=void 0===n?"normal":n,a=t.drawerMaxWidthPercent,i=void 0===a?80:a,s=t.headerHeight,l=void 0===s?"0px":s,c=t.isMLR,u=void 0!==c&&c,d=t.isMobile,p=void 0!==d&&d,h=e.useState({width:0,position:"right",isOpen:!1,positionType:o}),f=h[0],m=h[1],v=e.useRef(null),y=e.useState(null),g=y[0],b=y[1],x=r_("xs"),w=p||x;e.useEffect(function(){m(function(e){return X(X({},e),{positionType:o})})},[o]),e.useEffect(function(){if(v.current){var e=function(){var e;if(f.isOpen){var t=(null===(e=v.current)||void 0===e?void 0:e.clientWidth)||0,r=Math.floor(t*(i/100));f.width>r&&m(function(e){return X(X({},e),{width:r})})}};e();var t=new ResizeObserver(function(){e()});return t.observe(v.current),function(){t&&t.disconnect()}}},[f.isOpen,f.width,i]);var k=e.useMemo(function(){return function(e){m(function(t){var r=void 0!==e.width?e.width:t.width;if(v.current&&(e.isOpen||t.isOpen)){var n=v.current.clientWidth,o=Math.floor(n*(i/100));r=Math.min(r,o)}var a=void 0!==e.positionType?e.positionType:t.positionType;return X(X(X({},t),e),{width:r,positionType:a})})}},[i]),_=e.useMemo(function(){return{drawer:f,updateDrawer:k,drawerContainerRef:g,setDrawerContainerRef:b,headerHeight:l,isMobile:w,isMLR:u}},[f,k,g,l,w,u]);return lt(fat.Provider,X({value:_},{children:lt("div",X({ref:v,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden"}},{children:r}))}))},exports.Link=_ot,exports.MATRIX_MESSAGE_DATA_ID=Iqt,exports.MATRIX_MESSAGE_ELEMENT_ID=Fqt,exports.MlrRichTextViewerContext=WT,exports.MlrRichTextViewerProvider=function(e){var t=e.children,r=e.isMLRReview,n=e.showAnnotations,o=e.annotationsList;return lt(WT.Provider,X({value:{isMLRReview:r,annotationsList:o,showAnnotations:n}},{children:t}))},exports.ModalWrapper=uat,exports.Organism=function(e){var t=e.organism;return lt(rqt,{item:rnr(t.body)})},exports.OrganismContext=KT,exports.OrganismContextProvider=XT,exports.OrganismItem=rqt,exports.PasswordSetup=Dot,exports.PdfDocument=function(t){var r=t.source,n=t.isMobile,a=void 0!==n&&n,i=t.customDocumentStyles,s=e.useState(0),l=s[0],c=s[1],u=e.useState(1),d=u[0],p=u[1],h=e.useState(null),f=h[0],m=h[1],v=i||{},y=v.pageWidth,g=void 0===y?a?342:856:y,b=v.pageHeight,x=f!==d;return lt(Lot,X({pageWidth:g,pageHeight:void 0===b?a?442:1108:b},{children:ct(Bot,X({customDocumentStyles:i},{children:[ct(o.Document,X({file:r,renderMode:"canvas",className:"document",onLoadSuccess:function(e){var t=e.numPages;c(t)},loading:lt(dc,{size:60})},{children:[x&&f?lt(o.Page,{pageNumber:f,renderTextLayer:!1,className:"custom-pdf"},f):null,lt(o.Page,{pageNumber:d,renderTextLayer:!1,className:"".concat(x?"loadingPage":"custom-pdf"),onRenderSuccess:function(){return m(d)}},d)]})),ct(Vot,{children:[lt(Hot,X({disable:d<=1,onClick:function(){return p(function(e){return e+(e<=1?0:-1)})},customDocumentStyles:i},{children:lt(L_,{name:"CaretLeft",size:33})})),lt(qot,{type:"number",size:"small",customDocumentStyles:i,onChange:function(e){var t=e.target.value,r=e.nativeEvent;return function(e,t){if(!Number.isNaN(e)){var r=Math.round(e);r>l?!Number.isNaN(t)&&t>0&&t<=l&&p(t):r<1||p(r)}}(+t,+((null==r?void 0:r.data)||""))},value:d}),lt(Hot,X({disabled:!0},{children:lt($ot,{})})),lt(Fnt,X({variant:"S",color:(null==i?void 0:i.pageNumberColor)||"white"},{children:l})),lt(Hot,X({disable:d>=l,onClick:function(){return p(function(e){return e+(e>=l?0:1)})},customDocumentStyles:i},{children:lt(L_,{name:"CaretRight"})}))]})]}))}))},exports.PhoneLinkCell=prr,exports.RadioButtons=function(e){var t=e.ref,r=e.name,n=e.value,o=e.options,a=e.onBlur,i=e.onChange,s=e.isRow,l=void 0!==s&&s,c=e.isError,u=void 0!==c&&c,d=e.disabled,p=void 0!==d&&d,h=e.isEditMode,f=void 0===h||h,m=e.isRichText,v=void 0!==m&&m,y=e.internalConfig,g=AC({internalConfig:y}).groupWrapperStyles;return lt(HC,X({ref:t,row:l,$isRow:l,name:r,value:n,onBlur:a,onChange:function(e){f&&(null==i||i(e.target.value))},$styles:g},{children:null==o?void 0:o.map(function(e){return lt(VC,{option:e,isError:u,disabled:p,isRichText:v,isEditMode:f,internalConfig:y},e.id)})}))},exports.RadioGroupWrapper=HC,exports.RatingCell=hrr,exports.RatingMolecule=Wot,exports.RegularImage=qC,exports.RichTextViewer=Vqt,exports.Select=function(t){var r=t.ref,n=t.onBlur,o=t.onChange,a=t.value,i=t.placeholder,s=t.options,l=void 0===s?[]:s,c=t.disabled,u=void 0!==c&&c,d=t.optionsPresentation,p=void 0!==d&&d,h=t.isError,f=t.isEditMode,m=void 0===f||f,v=t.selectInternalConfig,y=t.isRichText,g=void 0!==y&&y,b=e.useState(p),x=b[0],w=b[1],k=e.useState(a),_=k[0],C=k[1],M=null==l?void 0:l.find(function(e){return e.id===_});e.useEffect(function(){var e=function(){return!p&&w(!1)};return window.addEventListener("click",e),function(){return window.removeEventListener("click",e)}}),e.useEffect(function(){return w(p)},[p]),e.useEffect(function(){return C(a)},[a]);var S=function(e){return e===_};return lt(qqt,X({ref:r,tabIndex:0,onBlur:n,disabled:u,isEditMode:m,hasValue:!!M,isOpen:x,hasError:!!h,$styles:Uqt(v,!!M)},{children:ct("div",X({className:"select-wrapper"},{children:[ct("div",X({className:"select-input",onClick:function(e){p||(e.stopPropagation(),w(function(e){return!e}))}},{children:[M?g?lt(Vqt,{numberOfLines:1,value:M.label}):lt(Fnt,X({numberOfLines:1,variant:"M",color:"gray1"},{children:M.label})):lt(Fnt,X({numberOfLines:1,variant:"M",color:"gray3"},{children:i})),m&&lt("div",X({className:"icon-container"},{children:lt(L_,{name:"CaretDown"})}))]})),x&&m&&lt($qt,{children:l.map(function(e){var t=e.id,r=e.label;return lt(Wqt,X({$selected:S(t),onClick:function(){return function(e){C(e),null==o||o(e)}(t)}},{children:g?Hqt(JSON.parse(r)):r}),t)})})]}))}))},exports.SelectMolecule=Uot,exports.SliderMolecule=eat,exports.Spacer=Rnt,exports.SpeedDial=yat,exports.Spinner=Kqt,exports.StateContext=sqt,exports.StateContextProvider=function(t){var r=t.initStateConfig,n=t.children,o=t.stateHandler,a=t.authenticated,i=e.useMemo(function(){return{stateConfig:r,stateHandler:o,authenticated:a}},[r,o,a]);return lt(sqt.Provider,X({value:i},{children:n}))},exports.StatusChipCell=mrr,exports.Stepper=tat,exports.StyleWrapper=rKt,exports.SwitchMolecule=nat,exports.TextButton=O_,exports.TextMolecule=hot,exports.TextWrapper=Fnt,exports.TimePickerMolecule=aat,exports.Tooltip=function(t){var r=t.trigger,n=void 0===r?"hover":r,o=t.placement,a=void 0===o?"top":o,i=t.styles,s=Z(t,["trigger","placement","styles"]),l=e.useRef(null);return lt(rKt,X({ref:l,$styles:i},{children:lt(tKt,X({},s,{getTooltipContainer:function(){return l.current},trigger:n,placement:a}))}))},exports.TouchableOpacity=P_,exports.ValidationTag=oKt,exports.VerticalPadding=IC,exports.Video=iat,exports.ZealThemeProvider=function(e){return lt(hr,X({injectFirst:!0},{children:lt(et,X({theme:X(X({},t_),e.theme)},{children:ct(Fi,X({theme:X(X({},t_),e.theme)},{children:[lt(Qh,{}),lt(Pt,{styles:e_}),e.children]}))}))}))},exports.ZealUIModal=cat,exports.calendarConfiguratorDescriptor=nnr,exports.calendarDataGridConfiguratorDescriptor=Qrr,exports.containerConfiguratorsMap={},exports.dataGridConfiguratorDescriptor=vKt,exports.defaultTheme=mt,exports.fontWeight=[100,200,300,400,500,600,700,800,900],exports.fonts=["3XL","2XL","XL","L","M","S","XS"],exports.moleculeConfiguratorsMap={},exports.moleculeItemConfiguratorsMap={},exports.organismConfiguratorsMap=onr,exports.passwordValidationMapper=Cot,exports.richTextDefaultValue=Bqt,exports.seoTags=["h1","h2","h3","h4","h5","h6"],exports.sizings=["5XL","4XL","3XL","2XL","XL","L","M","S","XS",0],exports.toast=wUt,exports.toastStyles=Jk,exports.useAccountButtonContext=function(){return e.useContext(aqt)},exports.useApi=pqt,exports.useButtonActionsContext=nqt,exports.useCalendarDataGridData=Urr,exports.useContainerRuntime=bnt,exports.useDataGridOrganism=Irr,exports.useFormStepContext=cqt,exports.useLayoutContext=mat,exports.useMediaQuery=r_,exports.useMlrRichTextViewerContext=UT,exports.useOrganismContext=oqt,exports.useStateContext=lqt;
9729
9729
  //# sourceMappingURL=index.js.map