slicer-studio 0.7.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,19 +1,19 @@
1
- import{r as e,t}from"./chunks/rolldown-runtime-XKyaHtl9.js";import{a as n,i as r,n as i,r as a,t as o}from"./chunks/StudioContext-CsxoZNKd.js";import{A as s,C as c,D as l,E as u,O as d,S as f,T as p,_ as m,a as h,b as g,c as _,d as v,f as y,g as b,h as x,i as S,k as C,l as w,m as T,n as E,o as D,p as O,r as k,s as A,t as j,u as M,v as N,w as P,x as F,y as I}from"./chunks/tip-BR1chAbl.js";import{n as ee,r as te,t as ne}from"./chunks/triangle-alert-5i_bibCW.js";import{a as re,c as ie,d as ae,f as oe,i as se,l as ce,m as le,o as ue,p as de,r as fe,s as pe,t as L,u as R}from"./chunks/plate-geometry-Dd9vKDEP.js";import{n as me,r as he,t as ge}from"./chunks/features-6cCl0G7E.js";import{i as _e,n as ve,o as z,r as ye,t as be}from"./chunks/files-BZtizmc1.js";var xe=/* @__PURE__ */ t((e=>{var t=r(),i=n(),a=s();function o(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function l(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function u(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function f(e){if(l(e)!==e)throw Error(o(188))}function p(e){var t=e.alternate;if(!t){if(t=l(e),t===null)throw Error(o(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return f(i),e;if(a===r)return f(i),t;a=a.sibling}throw Error(o(188))}if(n.return!==r.return)n=i,r=a;else{for(var s=!1,c=i.child;c;){if(c===n){s=!0,n=i,r=a;break}if(c===r){s=!0,r=i,n=a;break}c=c.sibling}if(!s){for(c=a.child;c;){if(c===n){s=!0,n=a,r=i;break}if(c===r){s=!0,r=a,n=i;break}c=c.sibling}if(!s)throw Error(o(189))}}if(n.alternate!==r)throw Error(o(190))}if(n.tag!==3)throw Error(o(188));return n.stateNode.current===n?e:t}function m(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=m(e),t!==null)return t;e=e.sibling}return null}function h(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&h(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function g(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function _(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function v(e){var t=[null,null],n=g(e);return n===null||y(t,e,n.child,{foundSelf:!1}),t}function y(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&y(e,t,n.child,r))return!0;n=n.sibling}return!1}function b(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(o(559))}}var x=null,S=null;function C(e,t,n){return e===n||e===t&&(x=e,!0)}function w(e,t,n){return e===n?(S=e,!1):e===t&&(S!==null&&(x=e),!0)}function T(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function E(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var D=Object.assign,O=Symbol.for(`react.element`),k=Symbol.for(`react.transitional.element`),A=Symbol.for(`react.portal`),j=Symbol.for(`react.fragment`),M=Symbol.for(`react.strict_mode`),N=Symbol.for(`react.profiler`),P=Symbol.for(`react.consumer`),F=Symbol.for(`react.context`),I=Symbol.for(`react.forward_ref`),ee=Symbol.for(`react.suspense`),te=Symbol.for(`react.suspense_list`),ne=Symbol.for(`react.memo`),re=Symbol.for(`react.lazy`),ie=Symbol.for(`react.activity`),ae=Symbol.for(`react.legacy_hidden`),oe=Symbol.for(`react.memo_cache_sentinel`),se=Symbol.for(`react.view_transition`),ce=Symbol.for(`react.recoverable`),le=Symbol.iterator;function ue(e){return typeof e!=`object`||!e?null:(e=le&&e[le]||e[`@@iterator`],typeof e==`function`?e:null)}var de=Symbol.for(`react.client.reference`);function fe(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===de?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case j:return`Fragment`;case N:return`Profiler`;case M:return`StrictMode`;case ee:return`Suspense`;case te:return`SuspenseList`;case ie:return`Activity`;case se:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case A:return`Portal`;case F:return e.displayName||`Context`;case P:return(e._context.displayName||`Context`)+`.Consumer`;case I:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ne:return t=e.displayName||null,t===null?fe(e.type)||`Memo`:t;case re:t=e._payload,e=e._init;try{return fe(e(t))}catch{}}return null}var pe=Array.isArray,L=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,R=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,me={pending:!1,data:null,method:null,action:null},he=[],ge=-1;function _e(e){return{current:e}}function ve(e){0>ge||(e.current=he[ge],he[ge]=null,ge--)}function z(e,t){ge++,he[ge]=e.current,e.current=t}var ye=_e(null),be=_e(null),xe=_e(null),Se=_e(null);function B(e,t){switch(z(xe,t),z(be,e),z(ye,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?up(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=up(t),e=dp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ve(ye),z(ye,e)}function V(){ve(ye),ve(be),ve(xe)}function Ce(e){var t=e.memoizedState;t!==null&&(sh._currentValue=t.memoizedState,z(Se,e)),t=ye.current;var n=dp(t,e.type);t!==n&&(z(be,e),z(ye,n))}function we(e){be.current===e&&(ve(ye),ve(be)),Se.current===e&&(ve(Se),sh._currentValue=me)}var Te,Ee;function De(e){if(Te===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Te=t&&t[1]||``,Ee=-1<e.stack.indexOf(`
1
+ import{r as e,t}from"./chunks/rolldown-runtime-XKyaHtl9.js";import{a as n,i as r,n as i,r as a,t as o}from"./chunks/StudioContext-CsxoZNKd.js";import{$ as s,$t as c,A as l,At as u,B as d,Bt as f,C as p,Ct as m,D as h,Dt as g,E as _,Et as v,F as y,Ft as b,G as x,Gt as S,H as C,Ht as w,I as T,It as E,J as D,Jt as O,K as k,Kt as A,L as j,Lt as M,M as N,Mt as P,N as F,Nt as I,O as ee,Ot as te,P as ne,Pt as re,Q as ie,Qt as ae,R as oe,Rt as se,S as ce,St as le,T as ue,Tt as de,U as fe,Ut as L,V as R,Vt as pe,W as me,Wt as he,X as ge,Xt as z,Y as B,Yt as V,Z as _e,Zt as ve,_ as ye,_t as be,a as xe,at as Se,b as Ce,bt as we,c as Te,ct as Ee,d as De,dt as Oe,en as ke,et as Ae,f as je,ft as Me,g as Ne,gt as Pe,h as Fe,ht as Ie,i as Le,it as Re,j as ze,jt as Be,k as Ve,kt as He,l as Ue,lt as We,m as Ge,mt as Ke,n as qe,nt as Je,o as H,ot as Ye,p as Xe,pt as Ze,q as Qe,qt as $e,r as et,rt as tt,s as U,st as nt,t as rt,tt as it,u as at,ut as ot,v as st,vt as ct,w as lt,wt as ut,x as dt,xt as ft,y as pt,yt as mt,z as ht,zt as gt}from"./chunks/tool-button-BSd3e5SL.js";import{n as _t,r as vt,t as yt}from"./chunks/triangle-alert-uvtJzBCN.js";import{a as bt,i as xt,n as St,r as Ct,s as wt,t as Tt}from"./chunks/files-YWgqYMU_.js";import{a as Et,c as Dt,d as Ot,f as kt,h as At,i as jt,l as Mt,m as Nt,o as Pt,p as Ft,r as It,s as Lt,t as Rt,u as zt}from"./chunks/plate-geometry-B8juLONh.js";import{n as Bt,r as W,t as Vt}from"./chunks/features-6cCl0G7E.js";var Ht=/* @__PURE__ */ t((e=>{var t=r(),i=n(),a=ke();function o(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function s(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function c(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function l(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(c(e)!==e)throw Error(o(188))}function f(e){var t=e.alternate;if(!t){if(t=c(e),t===null)throw Error(o(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return d(i),e;if(a===r)return d(i),t;a=a.sibling}throw Error(o(188))}if(n.return!==r.return)n=i,r=a;else{for(var s=!1,l=i.child;l;){if(l===n){s=!0,n=i,r=a;break}if(l===r){s=!0,r=i,n=a;break}l=l.sibling}if(!s){for(l=a.child;l;){if(l===n){s=!0,n=a,r=i;break}if(l===r){s=!0,r=a,n=i;break}l=l.sibling}if(!s)throw Error(o(189))}}if(n.alternate!==r)throw Error(o(190))}if(n.tag!==3)throw Error(o(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}function m(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&m(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function h(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function g(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function _(e){var t=[null,null],n=h(e);return n===null||v(t,e,n.child,{foundSelf:!1}),t}function v(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&v(e,t,n.child,r))return!0;n=n.sibling}return!1}function y(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(o(559))}}var b=null,x=null;function S(e,t,n){return e===n||e===t&&(b=e,!0)}function C(e,t,n){return e===n?(x=e,!1):e===t&&(x!==null&&(b=e),!0)}function w(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function T(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var E=Object.assign,D=Symbol.for(`react.element`),O=Symbol.for(`react.transitional.element`),k=Symbol.for(`react.portal`),A=Symbol.for(`react.fragment`),j=Symbol.for(`react.strict_mode`),M=Symbol.for(`react.profiler`),N=Symbol.for(`react.consumer`),P=Symbol.for(`react.context`),F=Symbol.for(`react.forward_ref`),I=Symbol.for(`react.suspense`),ee=Symbol.for(`react.suspense_list`),te=Symbol.for(`react.memo`),ne=Symbol.for(`react.lazy`),re=Symbol.for(`react.activity`),ie=Symbol.for(`react.legacy_hidden`),ae=Symbol.for(`react.memo_cache_sentinel`),oe=Symbol.for(`react.view_transition`),se=Symbol.for(`react.recoverable`),ce=Symbol.iterator;function le(e){return typeof e!=`object`||!e?null:(e=ce&&e[ce]||e[`@@iterator`],typeof e==`function`?e:null)}var ue=Symbol.for(`react.client.reference`);function de(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ue?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case A:return`Fragment`;case M:return`Profiler`;case j:return`StrictMode`;case I:return`Suspense`;case ee:return`SuspenseList`;case re:return`Activity`;case oe:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case k:return`Portal`;case P:return e.displayName||`Context`;case N:return(e._context.displayName||`Context`)+`.Consumer`;case F:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case te:return t=e.displayName||null,t===null?de(e.type)||`Memo`:t;case ne:t=e._payload,e=e._init;try{return de(e(t))}catch{}}return null}var fe=Array.isArray,L=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,R=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,pe={pending:!1,data:null,method:null,action:null},me=[],he=-1;function ge(e){return{current:e}}function z(e){0>he||(e.current=me[he],me[he]=null,he--)}function B(e,t){he++,me[he]=e.current,e.current=t}var V=ge(null),_e=ge(null),ve=ge(null),ye=ge(null);function be(e,t){switch(B(ve,t),B(_e,e),B(V,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?up(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=up(t),e=dp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}z(V),B(V,e)}function xe(){z(V),z(_e),z(ve)}function Se(e){var t=e.memoizedState;t!==null&&(sh._currentValue=t.memoizedState,B(ye,e)),t=V.current;var n=dp(t,e.type);t!==n&&(B(_e,e),B(V,n))}function Ce(e){_e.current===e&&(z(V),z(_e)),ye.current===e&&(z(ye),sh._currentValue=pe)}var we,Te;function Ee(e){if(we===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);we=t&&t[1]||``,Te=-1<e.stack.indexOf(`
2
2
  at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
- `+Te+e+Ee}var Oe=!1;function ke(e,t){if(!e||Oe)return``;Oe=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
3
+ `+we+e+Te}var De=!1;function Oe(e,t){if(!e||De)return``;De=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
4
4
  `),l=s.split(`
5
5
  `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
6
- `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Oe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?De(n):``}function Ae(e,t){switch(e.tag){case 26:case 27:case 5:return De(e.type);case 16:return De(`Lazy`);case 13:return e.child!==t&&t!==null?De(`Suspense Fallback`):De(`Suspense`);case 19:return De(`SuspenseList`);case 0:case 15:return ke(e.type,!1);case 11:return ke(e.type.render,!1);case 1:return ke(e.type,!0);case 31:return De(`Activity`);case 30:return De(`ViewTransition`);default:return``}}function je(e){try{var t=``,n=null;do t+=Ae(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
6
+ `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{De=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Ee(n):``}function Ae(e,t){switch(e.tag){case 26:case 27:case 5:return Ee(e.type);case 16:return Ee(`Lazy`);case 13:return e.child!==t&&t!==null?Ee(`Suspense Fallback`):Ee(`Suspense`);case 19:return Ee(`SuspenseList`);case 0:case 15:return Oe(e.type,!1);case 11:return Oe(e.type.render,!1);case 1:return Oe(e.type,!0);case 31:return Ee(`Activity`);case 30:return Ee(`ViewTransition`);default:return``}}function je(e){try{var t=``,n=null;do t+=Ae(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
7
  Error generating stack: `+e.message+`
8
- `+e.stack}}var Me=Object.prototype.hasOwnProperty,Ne=t.unstable_scheduleCallback,Pe=t.unstable_cancelCallback,Fe=t.unstable_shouldYield,Ie=t.unstable_requestPaint,Le=t.unstable_now,Re=t.unstable_getCurrentPriorityLevel,ze=t.unstable_ImmediatePriority,Be=t.unstable_UserBlockingPriority,Ve=t.unstable_NormalPriority,He=t.unstable_LowPriority,Ue=t.unstable_IdlePriority,We=t.log,Ge=t.unstable_setDisableYieldValue,Ke=null,qe=null;function Je(e){if(typeof We==`function`&&Ge(e),qe&&typeof qe.setStrictMode==`function`)try{qe.setStrictMode(Ke,e)}catch{}}var Ye=Math.clz32?Math.clz32:Qe,Xe=Math.log,Ze=Math.LN2;function Qe(e){return e>>>=0,e===0?32:31-(Xe(e)/Ze|0)|0}var $e=256,et=262144,tt=4194304;function nt(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function rt(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=nt(n))):i=nt(o):i=nt(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=nt(n))):i=nt(o)):i=nt(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function it(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function at(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-Ye(n),i=1<<r;t|=e[r],n&=~i}return t}function ot(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function st(){var e=tt;return tt<<=1,!(tt&62914560)&&(tt=4194304),e}function ct(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function lt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ut(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Ye(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&dt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function dt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ye(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function ft(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ye(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function pt(e,t){var n=t&-t;return n=n&42?1:mt(n),(n&(e.suspendedLanes|t))===0?n:0}function mt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function ht(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function gt(){var e=R.p;return e===0?(e=window.event,e===void 0?32:Ch(e.type)):e}function _t(e,t){var n=R.p;try{return R.p=e,t()}finally{R.p=n}}var vt=Math.random().toString(36).slice(2),yt=`__reactFiber$`+vt,bt=`__reactProps$`+vt,xt=`__reactContainer$`+vt,St=`__reactEvents$`+vt,Ct=`__reactListeners$`+vt,wt=`__reactHandles$`+vt,Tt=`__reactResources$`+vt,Et=`__reactMarker$`+vt,Dt=`__reactLoad$`+vt;function Ot(e){delete e[yt],delete e[bt],delete e[Ct],delete e[wt]}function kt(e){var t;if(t=e[yt])return t;for(var n=e.parentNode;n;){if(t=n[xt]||n[yt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=fm(e);e!==null;){if(n=e[yt])return n;e=fm(e)}return t}e=n,n=e.parentNode}return null}function At(e){if(e=e[yt]||e[xt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function jt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function Mt(e){var t=e[Tt];return t||=e[Tt]={hoistableStyles:/* @__PURE__ */ new Map,hoistableScripts:/* @__PURE__ */ new Map},t}function Nt(e){e[Et]=!0}function Pt(e){e[Dt]=void 0}var Ft=/* @__PURE__ */ new Set,It={};function Lt(e,t){Rt(e,t),Rt(e+`Capture`,t)}function Rt(e,t){for(It[e]=t,e=0;e<t.length;e++)Ft.add(t[e])}var zt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Bt={},Vt={};function Ht(e){return Me.call(Vt,e)?!0:Me.call(Bt,e)?!1:zt.test(e)?Vt[e]=!0:(Bt[e]=!0,!1)}var H=!1;function Ut(){var e=H;return H=!1,e}function Wt(e,t,n){if(Ht(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function Gt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function Kt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function qt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Jt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Yt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Xt(e){if(!e._valueTracker){var t=Jt(e)?`checked`:`value`;e._valueTracker=Yt(e,t,``+e[t])}}function Zt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Jt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var Qt=/[\n"\\]/g;function $t(e){return e.replace(Qt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function en(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+qt(t)):e.value!==``+qt(t)&&(e.value=``+qt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):nn(e,qt(n)):o===`number`&&e.value==t?nn(e,qt(e.value)):nn(e,qt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+qt(s):e.removeAttribute(`name`)}function tn(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Xt(e);return}n=n==null?``:``+qt(n),t=t==null?n:``+qt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Xt(e)}function nn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function rn(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+qt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function an(e,t,n){t!=null&&(t=``+qt(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+qt(n)}function on(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(o(92));if(pe(r)){if(1<r.length)throw Error(o(93));r=r[0]}n=r}n??=``,t=n}n=qt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Xt(e)}function sn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var cn=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function ln(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||cn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function un(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(o(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,H=!0);for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&(ln(e,i,r),H=!0)}else for(var a in t)t.hasOwnProperty(a)&&ln(e,a,t[a])}function dn(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var fn=/* @__PURE__ */ new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`maskType`,`mask-type`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),pn=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function mn(e){return pn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function hn(){}var gn=null;function _n(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var vn=null,yn=null;function bn(e){var t=At(e);if(t&&(e=t.stateNode)){var n=e[bt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(en(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+$t(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[bt]||null;if(!i)throw Error(o(90));en(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Zt(r)}break a;case`textarea`:an(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&rn(e,!!n.multiple,t,!1)}}}var xn=!1;function Sn(e,t,n){if(xn)return e(t,n);xn=!0;try{return e(t)}finally{if(xn=!1,(vn!==null||yn!==null)&&(Ld(),vn&&(t=vn,e=yn,yn=vn=null,bn(t),e)))for(t=0;t<e.length;t++)bn(e[t])}}function Cn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[bt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(o(231,t,typeof n));return n}var wn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Tn=!1;if(wn)try{var En={};Object.defineProperty(En,"passive",{get:function(){Tn=!0}}),window.addEventListener(`test`,En,En),window.removeEventListener(`test`,En,En)}catch{Tn=!1}var Dn=null,On=null,kn=null;function An(){if(kn)return kn;var e,t=On,n=t.length,r,i=`value`in Dn?Dn.value:Dn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return kn=i.slice(e,1<r?1-r:void 0)}function jn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Mn(){return!0}function Nn(){return!1}function Pn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?Mn:Nn,this.isPropagationStopped=Nn,this}return D(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=Mn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Mn)},persist:function(){},isPersistent:Mn}),t}var Fn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},In=Pn(Fn),Ln=D({},Fn,{view:0,detail:0}),Rn=Pn(Ln),zn,Bn,Vn,Hn=D({},Ln,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:$n,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Vn&&(Vn&&e.type===`mousemove`?(zn=e.screenX-Vn.screenX,Bn=e.screenY-Vn.screenY):Bn=zn=0,Vn=e),zn)},movementY:function(e){return`movementY`in e?e.movementY:Bn}}),Un=Pn(Hn),Wn=Pn(D({},Hn,{dataTransfer:0})),Gn=Pn(D({},Ln,{relatedTarget:0})),Kn=Pn(D({},Fn,{animationName:0,elapsedTime:0,pseudoElement:0})),qn=Pn(D({},Fn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Jn=Pn(D({},Fn,{data:0})),Yn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Xn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},Zn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Qn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Zn[e])?!!t[e]:!1}function $n(){return Qn}var er=Pn(D({},Ln,{key:function(e){if(e.key){var t=Yn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=jn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Xn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:$n,charCode:function(e){return e.type===`keypress`?jn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?jn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),tr=Pn(D({},Hn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),nr=Pn(D({},Fn,{submitter:0})),rr=Pn(D({},Ln,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:$n})),ir=Pn(D({},Fn,{propertyName:0,elapsedTime:0,pseudoElement:0})),ar=Pn(D({},Hn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),or=Pn(D({},Fn,{newState:0,oldState:0,source:0})),sr=[9,13,27,32],cr=wn&&`CompositionEvent`in window,lr=null;wn&&`documentMode`in document&&(lr=document.documentMode);var ur=wn&&`TextEvent`in window&&!lr,dr=wn&&(!cr||lr&&8<lr&&11>=lr),fr=` `,pr=!1;function mr(e,t){switch(e){case`keyup`:return sr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function hr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var gr=!1;function _r(e,t){switch(e){case`compositionend`:return hr(t);case`keypress`:return t.which===32?(pr=!0,fr):null;case`textInput`:return e=t.data,e===fr&&pr?null:e;default:return null}}function vr(e,t){if(gr)return e===`compositionend`||!cr&&mr(e,t)?(e=An(),kn=On=Dn=null,gr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return dr&&t.locale!==`ko`?null:t.data;default:return null}}var yr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function br(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!yr[e.type]:t===`textarea`}function xr(e,t,n,r){vn?yn?yn.push(r):yn=[r]:vn=r,t=qf(t,`onChange`),0<t.length&&(n=new In(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Sr=null,Cr=null;function wr(e){Bf(e,0)}function Tr(e){if(Zt(jt(e)))return e}function Er(e,t){if(e===`change`)return t}var Dr=!1;if(wn){var Or;if(wn){var kr=`oninput`in document;if(!kr){var Ar=document.createElement(`div`);Ar.setAttribute(`oninput`,`return;`),kr=typeof Ar.oninput==`function`}Or=kr}else Or=!1;Dr=Or&&(!document.documentMode||9<document.documentMode)}function jr(){Sr&&(Sr.detachEvent(`onpropertychange`,Mr),Cr=Sr=null)}function Mr(e){if(e.propertyName===`value`&&Tr(Cr)){var t=[];xr(t,Cr,e,_n(e)),Sn(wr,t)}}function Nr(e,t,n){e===`focusin`?(jr(),Sr=t,Cr=n,Sr.attachEvent(`onpropertychange`,Mr)):e===`focusout`&&jr()}function Pr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Tr(Cr)}function Fr(e,t){if(e===`click`)return Tr(t)}function Ir(e,t){if(e===`input`||e===`change`)return Tr(t)}function Lr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Rr=typeof Object.is==`function`?Object.is:Lr;function zr(e,t){if(Rr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Me.call(t,i)||!Rr(e[i],t[i]))return!1}return!0}function Br(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Vr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Hr(e,t){var n=Vr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Vr(n)}}function Ur(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ur(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Wr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Br(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Br(e.document)}return t}function Gr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Kr=wn&&`documentMode`in document&&11>=document.documentMode,qr=null,Jr=null,Yr=null,Xr=!1;function Zr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Xr||qr==null||qr!==Br(r)||(r=qr,`selectionStart`in r&&Gr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Yr&&zr(Yr,r)||(Yr=r,r=qf(Jr,`onSelect`),0<r.length&&(t=new In(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=qr)))}function Qr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var $r={animationend:Qr(`Animation`,`AnimationEnd`),animationiteration:Qr(`Animation`,`AnimationIteration`),animationstart:Qr(`Animation`,`AnimationStart`),transitionrun:Qr(`Transition`,`TransitionRun`),transitionstart:Qr(`Transition`,`TransitionStart`),transitioncancel:Qr(`Transition`,`TransitionCancel`),transitionend:Qr(`Transition`,`TransitionEnd`)},ei={},ti={};wn&&(ti=document.createElement(`div`).style,`AnimationEvent`in window||(delete $r.animationend.animation,delete $r.animationiteration.animation,delete $r.animationstart.animation),`TransitionEvent`in window||delete $r.transitionend.transition);function ni(e){if(ei[e])return ei[e];if(!$r[e])return e;var t=$r[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ti)return ei[e]=t[n];return e}var ri=ni(`animationend`),ii=ni(`animationiteration`),ai=ni(`animationstart`),oi=ni(`transitionrun`),si=ni(`transitionstart`),ci=ni(`transitioncancel`),li=ni(`transitionend`),ui=/* @__PURE__ */ new Map,di=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);di.push(`scrollEnd`);function fi(e,t){ui.set(e,t),Lt(t,[e])}var pi=0;function mi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=vd.identifierPrefix;var n=pi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function hi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Ed;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function gi(e,t){return e=hi(e),t=hi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var _i=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},vi=[],yi=0,bi=0;function xi(){for(var e=yi,t=bi=yi=0;t<e;){var n=vi[t];vi[t++]=null;var r=vi[t];vi[t++]=null;var i=vi[t];vi[t++]=null;var a=vi[t];if(vi[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Ti(n,i,a)}}function Si(e,t,n,r){vi[yi++]=e,vi[yi++]=t,vi[yi++]=n,vi[yi++]=r,bi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Ci(e,t,n,r){return Si(e,t,n,r),Ei(e)}function wi(e,t){return Si(e,null,null,t),Ei(e)}function Ti(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Ye(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Ei(e){if(50<Dd)throw Dd=0,Od=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Di={};function Oi(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ki(e,t,n,r){return new Oi(e,t,n,r)}function Ai(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ji(e,t){var n=e.alternate;return n===null?(n=ki(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Mi(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Ni(e,t,n,r,i,a){var s=0;if(r=e,typeof r==`function`)Ai(r)&&(s=1);else if(typeof r==`string`)s=qm(e,n,ye.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case ie:return e=ki(31,n,t,i),e.elementType=ie,e.lanes=a,e;case j:return Pi(n.children,i,a,t);case M:s=8,i|=24;break;case N:return e=ki(12,n,t,i|2),e.elementType=N,e.lanes=a,e;case ee:return e=ki(13,n,t,i),e.elementType=ee,e.lanes=a,e;case te:return e=ki(19,n,t,i),e.elementType=te,e.lanes=a,e;case ae:case se:return e=i|32,e=ki(30,n,t,e),e.elementType=se,e.lanes=a,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case F:s=10;break a;case P:s=9;break a;case I:s=11;break a;case ne:s=14;break a;case re:s=16,r=null;break a}s=29,n=Error(o(130,e===null?`null`:typeof e,``)),r=null}return t=ki(s,n,t,i),t.elementType=e,t.type=r,t.lanes=a,t}function Pi(e,t,n,r){return e=ki(7,e,r,t),e.lanes=n,e}function Fi(e,t,n){return e=ki(6,e,null,t),e.lanes=n,e}function Ii(e){var t=ki(18,null,null,0);return t.stateNode=e,t}function Li(e,t,n){return t=ki(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ri=/* @__PURE__ */ new WeakMap;function zi(e,t){if(typeof e==`object`&&e){var n=Ri.get(e);return n===void 0?(t={value:e,source:t,stack:je(t)},Ri.set(e,t),t):n}return{value:e,source:t,stack:je(t)}}var Bi=[],Vi=0,Hi=null,Ui=0,Wi=[],Gi=0,Ki=null,U=1,qi=``;function Ji(e,t){Bi[Vi++]=Ui,Bi[Vi++]=Hi,Hi=e,Ui=t}function Yi(e,t,n){Wi[Gi++]=U,Wi[Gi++]=qi,Wi[Gi++]=Ki,Ki=e;var r=U;e=qi;var i=32-Ye(r)-1;r&=~(1<<i),n+=1;var a=32-Ye(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,U=1<<32-Ye(t)+i|n<<i|r,qi=a+e}else U=1<<a|n<<i|r,qi=e}function Xi(e){e.return!==null&&(Ji(e,1),Yi(e,1,0))}function Zi(e){for(;e===Hi;)Hi=Bi[--Vi],Bi[Vi]=null,Ui=Bi[--Vi],Bi[Vi]=null;for(;e===Ki;)Ki=Wi[--Gi],Wi[Gi]=null,qi=Wi[--Gi],Wi[Gi]=null,U=Wi[--Gi],Wi[Gi]=null}function Qi(e,t){Wi[Gi++]=U,Wi[Gi++]=qi,Wi[Gi++]=Ki,U=t.id,qi=t.overflow,Ki=e}var $i=null,ea=null,W=!1,ta=null,na=!1,ra=Error(o(519));function ia(e){throw ua(zi(Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ra}function aa(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[yt]=e,t[bt]=r,n){case`dialog`:$(`cancel`,t),$(`close`,t);break;case`iframe`:case`object`:case`embed`:$(`load`,t);break;case`video`:case`audio`:for(n=0;n<Rf.length;n++)$(Rf[n],t);break;case`source`:$(`error`,t);break;case`img`:case`image`:case`link`:$(`error`,t),$(`load`,t);break;case`details`:$(`toggle`,t);break;case`input`:$(`invalid`,t),tn(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:$(`invalid`,t);break;case`textarea`:$(`invalid`,t),on(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||$f(t.textContent,n)?(r.popover!=null&&($(`beforetoggle`,t),$(`toggle`,t)),r.onScroll!=null&&$(`scroll`,t),r.onScrollEnd!=null&&$(`scrollend`,t),r.onClick!=null&&(t.onclick=hn),t=!0):t=!1,t||ia(e,!0)}function oa(e){for($i=e.return;$i;)switch($i.tag){case 5:case 31:case 13:na=!1;return;case 27:case 3:na=!0;return;default:$i=$i.return}}function sa(e){if(e!==$i)return!1;if(!W)return oa(e),W=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||pp(e.type,e.memoizedProps)),n=!n),n&&ea&&ia(e),oa(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(o(317));ea=dm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(o(317));ea=dm(e)}else t===27?(t=ea,Sp(e.type)?(e=um,um=null,ea=e):ea=t):ea=$i?lm(e.stateNode.nextSibling):null;return!0}function ca(){ea=$i=null,W=!1}function la(){var e=ta;return e!==null&&(ud===null?ud=e:ud.push.apply(ud,e),ta=null),e}function ua(e){ta===null?ta=[e]:ta.push(e)}var da=_e(null),fa=null,pa=null;function ma(e,t,n){z(da,t._currentValue),t._currentValue=n}function ha(e){e._currentValue=da.current,ve(da)}function ga(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function _a(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var a=i.dependencies;if(a!==null){var s=i.child;a=a.firstContext;a:for(;a!==null;){var c=a;a=i;for(var l=0;l<t.length;l++)if(c.context===t[l]){a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),ga(a.return,n,e),r||(s=null);break a}a=c.next}}else if(i.tag===18){if(s=i.return,s===null)throw Error(o(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),ga(s,n,e),s=null}else i.tag===13&&i.memoizedState!==null&&i.memoizedState.dehydrated===null?(i.lanes|=n,s=i.alternate,s!==null&&(s.lanes|=n),ga(i.return,n,e),s=i.child,s=s===null?null:s.sibling):s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===e){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}}function va(e,t,n,r){e=null;for(var i=t,a=!1;i!==null;){if(!a){if(i.flags&524288)a=!0;else if(i.flags&262144)break}if(i.tag===10){var s=i.alternate;if(s===null)throw Error(o(387));if(s=s.memoizedProps,s!==null){var c=i.type;Rr(i.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(i===Se.current){if(s=i.alternate,s===null)throw Error(o(387));s.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e===null?e=[sh]:e.push(sh))}i=i.return}return e!==null&&_a(t,e,n,r),t.flags|=262144,e!==null}function ya(e){for(e=e.firstContext;e!==null;){if(!Rr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ba(e){fa=e,pa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function xa(e){return Ca(fa,e)}function Sa(e,t){return fa===null&&ba(e),Ca(e,t)}function Ca(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},pa===null){if(e===null)throw Error(o(308));pa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else pa=pa.next=t;return n}var wa=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Ta=t.unstable_scheduleCallback,Ea=t.unstable_NormalPriority,Da={$$typeof:F,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Oa(){return{controller:new wa,data:/* @__PURE__ */ new Map,refCount:0}}function ka(e){e.refCount--,e.refCount===0&&Ta(Ea,function(){e.controller.abort()})}function Aa(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var ja=null;function Ma(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Na=null,Pa=0,Fa=0,Ia=null;function La(e,t){if(Na===null){var n=Na=[];Pa=0,Fa=Nf(),Ia={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Pa++,t.then(Ra,Ra),t}function Ra(){if(--Pa===0&&(ja=null,Na!==null)){Ia!==null&&(Ia.status=`fulfilled`);var e=Na;Na=null,Fa=0,Ia=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function za(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Ba=L.S;L.S=function(e,t){if(pd=Le(),typeof t==`object`&&t&&typeof t.then==`function`&&La(e,t),ja!==null)for(var n=yf;n!==null;)Aa(n,ja),n=n.next;if(n=e.types,n!==null){for(var r=yf;r!==null;)Aa(r,n),r=r.next;if(Fa!==0){r=ja,r===null&&(r=ja=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ba!==null&&Ba(e,t)};var Va=_e(null);function Ha(){var e=Va.current;return e===null?Zu.pooledCache:e}function Ua(e,t){t===null?z(Va,Va.current):z(Va,t.pool)}function Wa(){var e=Ha();return e===null?null:{parent:Da._currentValue,pool:e}}var Ga=Error(o(460)),Ka=Error(o(474)),qa=Error(o(542)),Ja={then:function(){}};function Ya(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Xa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(hn,hn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,eo(e),e===void 0&&!(`reason`in t)?Error(o(600)):e;default:if(typeof t.status==`string`)t.then(hn,hn);else{if(e=Zu,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,eo(e),e}throw Qa=t,Ga}}function Za(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Qa=e,Ga):e}}var Qa=null;function $a(){if(Qa===null)throw Error(o(459));var e=Qa;return Qa=null,e}function eo(e){if(e===Ga||e===qa)throw Error(o(483))}var to=null,no=0;function ro(e){var t=no;return no+=1,to===null&&(to=[]),Xa(to,e,t)}function io(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function ao(e,t){throw t.$$typeof===O?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function oo(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=/* @__PURE__ */ new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function i(e,t){return e=ji(e,t),e.index=0,e.sibling=null,e}function a(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Fi(n,e.mode,r),t.return=e,t):(t=i(t,n),t.return=e,t)}function l(e,t,n,r){var a=n.type;return a===j?(e=d(e,t,n.props.children,r,n.key),io(e,n),e):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===re&&Za(a)===t.type)?(t=i(t,n.props),io(t,n),t.return=e,t):(t=Ni(n.type,n.key,n.props,null,e.mode,r),io(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Li(n,e.mode,r),t.return=e,t):(t=i(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,a){return t===null||t.tag!==7?(t=Pi(n,e.mode,r,a),t.return=e,t):(t=i(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Fi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case k:return n=Ni(t.type,t.key,t.props,null,e.mode,n),io(n,t),n.return=e,n;case A:return t=Li(t,e.mode,n),t.return=e,t;case re:return t=Za(t),f(e,t,n)}if(pe(t)||ue(t))return t=Pi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,ro(t),n);if(t.$$typeof===F)return f(e,Sa(e,t),n);ao(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case k:return n.key===i?l(e,t,n,r):null;case A:return n.key===i?u(e,t,n,r):null;case re:return n=Za(n),p(e,t,n,r)}if(pe(n)||ue(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,ro(n),r);if(n.$$typeof===F)return p(e,t,Sa(e,n),r);ao(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case k:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case A:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case re:return r=Za(r),m(e,t,n,r,i)}if(pe(r)||ue(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,ro(r),i);if(r.$$typeof===F)return m(e,t,n,Sa(t,r),i);ao(t,r)}return null}function h(i,o,s,c){for(var l=null,u=null,d=o,h=o=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),o=a(_,o,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),W&&Ji(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(o=a(d,o,h),u===null?l=d:u.sibling=d,u=d);return W&&Ji(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),o=a(g,o,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),W&&Ji(i,h),l}function g(i,s,c,l){if(c==null)throw Error(o(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),s=a(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),W&&Ji(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(s=a(v,s,g),d===null?u=v:d.sibling=v,d=v);return W&&Ji(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=a(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),W&&Ji(i,g),u}function _(e,r,a,c){if(typeof a==`object`&&a&&a.type===j&&a.key===null&&a.props.ref===void 0&&(a=a.props.children),typeof a==`object`&&a){switch(a.$$typeof){case k:a:{for(var l=a.key;r!==null;){if(r.key===l){if(l=a.type,l===j){if(r.tag===7){n(e,r.sibling),c=i(r,a.props.children),io(c,a),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===re&&Za(l)===r.type){n(e,r.sibling),c=i(r,a.props),io(c,a),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}a.type===j?(c=Pi(a.props.children,e.mode,c,a.key),io(c,a),c.return=e,e=c):(c=Ni(a.type,a.key,a.props,null,e.mode,c),io(c,a),c.return=e,e=c)}return s(e);case A:a:{for(l=a.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===a.containerInfo&&r.stateNode.implementation===a.implementation){n(e,r.sibling),c=i(r,a.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Li(a,e.mode,c),c.return=e,e=c}return s(e);case re:return a=Za(a),_(e,r,a,c)}if(pe(a))return h(e,r,a,c);if(ue(a)){if(l=ue(a),typeof l!=`function`)throw Error(o(150));return a=l.call(a),g(e,r,a,c)}if(typeof a.then==`function`)return _(e,r,ro(a),c);if(a.$$typeof===F)return _(e,r,Sa(e,a),c);ao(e,a)}return typeof a==`string`&&a!==``||typeof a==`number`||typeof a==`bigint`?(a=``+a,r!==null&&r.tag===6?(n(e,r.sibling),c=i(r,a),c.return=e,e=c):(n(e,r),c=Fi(a,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{no=0;var i=_(e,t,n,r);return to=null,i}catch(t){if(t===Ga||t===qa)throw t;var a=ki(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var so=oo(!0),co=oo(!1),lo=!1;function uo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function fo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function po(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function mo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Xu&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ei(e),Ti(e,null,n),t}return Si(e,r,t,n),Ei(e)}function ho(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ft(e,n)}}function go(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var _o=!1;function vo(){if(_o){var e=Ia;if(e!==null)throw e}}function yo(e,t,n,r){_o=!1;var i=e.updateQueue;lo=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Z&f)===f:(r&f)===f){f!==0&&f===Fa&&(_o=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=D({},d,f);break a;case 2:lo=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),id|=o,e.lanes=o,e.memoizedState=d}}function bo(e,t){if(typeof e!=`function`)throw Error(o(191,e));e.call(t)}function xo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)bo(n[e],t)}var So=_e(null),Co=_e(0);function wo(e,t){e=nd,z(Co,e),z(So,t),nd=e|t.baseLanes}function To(){z(Co,nd),z(So,So.current)}function Eo(){nd=Co.current,ve(So),ve(Co)}var Do=_e(null),Oo=null;function ko(e){var t=e.alternate;z(No,No.current&1),z(Do,e),Oo===null&&(t===null||So.current!==null||t.memoizedState!==null)&&(Oo=e)}function Ao(e){z(No,No.current),z(Do,e),Oo===null&&(Oo=e)}function jo(e){e.tag===22?(z(No,No.current),z(Do,e),Oo===null&&(Oo=e)):Mo()}function Mo(){z(No,No.current),z(Do,Do.current)}function G(e){ve(Do),Oo===e&&(Oo=null),ve(No)}var No=_e(0);function Po(e,t){z(Do,Do.current),z(No,t)}function Fo(e){ve(No),ve(Do),Oo===e&&(Oo=null)}function Io(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||om(n)||sm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Lo=0,K=null,Ro=null,zo=null,Bo=!1,Vo=!1,Ho=!1,Uo=0,Wo=0,Go=null,Ko=0;function qo(){throw Error(o(321))}function Jo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Rr(e[n],t[n]))return!1;return!0}function Yo(e,t,n,r,i,a){return Lo=a,K=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,L.H=e===null||e.memoizedState===null?dc:fc,Ho=!1,a=n(r,i),Ho=!1,Vo&&(a=Zo(t,n,r,i)),Xo(e),a}function Xo(e){L.H=uc;var t=Ro!==null&&Ro.next!==null;if(Lo=0,zo=Ro=K=null,Bo=!1,Wo=0,Go=null,t)throw Error(o(300));e===null||kc||(e=e.dependencies,e!==null&&ya(e)&&(kc=!0))}function Zo(e,t,n,r){K=e;var i=0;do{if(Vo&&(Go=null),Wo=0,Vo=!1,25<=i)throw Error(o(301));if(i+=1,zo=Ro=null,e.updateQueue!=null){var a=e.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,a.memoCache!=null&&(a.memoCache.index=0)}L.H=pc,a=t(n,r)}while(Vo);return a}function Qo(){var e=L.H,t=e.useState()[0];return t=typeof t.then==`function`?as(t):t,e=e.useState()[0],(Ro===null?null:Ro.memoizedState)!==e&&(K.flags|=1024),t}function $o(){var e=Uo!==0;return Uo=0,e}function es(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ts(e){if(Bo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Bo=!1}Lo=0,zo=Ro=K=null,Vo=!1,Wo=Uo=0,Go=null}function ns(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return zo===null?K.memoizedState=zo=e:zo=zo.next=e,zo}function rs(){if(Ro===null){var e=K.alternate;e=e===null?null:e.memoizedState}else e=Ro.next;var t=zo===null?K.memoizedState:zo.next;if(t!==null)zo=t,Ro=e;else{if(e===null)throw K.alternate===null?Error(o(467)):Error(o(310));Ro=e,e={memoizedState:Ro.memoizedState,baseState:Ro.baseState,baseQueue:Ro.baseQueue,queue:Ro.queue,next:null},zo===null?K.memoizedState=zo=e:zo=zo.next=e}return zo}function is(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function as(e){var t=Wo;return Wo+=1,Go===null&&(Go=[]),e=Xa(Go,e,t),t=K,(zo===null?t.memoizedState:zo.next)===null&&(t=t.alternate,L.H=t===null||t.memoizedState===null?dc:fc),e}function os(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return as(e);if(e.$$typeof===ce)return;if(e.$$typeof===F)return xa(e)}throw Error(o(438,String(e)))}function ss(e){var t=null,n=K.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=K.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=is(),K.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=oe;return t.index++,n}function cs(e,t){return typeof t==`function`?t(e):t}function ls(e){return us(rs(),Ro,e)}function us(e,t,n){var r=e.queue;if(r===null)throw Error(o(311));r.lastRenderedReducer=n;var i=e.baseQueue,a=r.pending;if(a!==null){if(i!==null){var s=i.next;i.next=a.next,a.next=s}t.baseQueue=i=a,r.pending=null}if(a=e.baseState,i===null)e.memoizedState=a;else{t=i.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Lo&f)===f:(Z&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Fa&&(d=!0);else if((Lo&p)===p){u=u.next,p===Fa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=a):l=l.next=f,K.lanes|=p,id|=p;f=u.action,Ho&&n(a,f),a=u.hasEagerState?u.eagerState:n(a,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=a):l=l.next=p,K.lanes|=f,id|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=a:l.next=c,!Rr(a,e.memoizedState)&&(kc=!0,d&&(n=Ia,n!==null)))throw n;e.memoizedState=a,e.baseState=s,e.baseQueue=l,r.lastRenderedState=a}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function ds(e){var t=rs(),n=t.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,a=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do a=e(a,s.action),s=s.next;while(s!==i);Rr(a,t.memoizedState)||(kc=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function fs(e,t,n){var r=K,i=rs(),a=W;if(a){if(n===void 0)throw Error(o(407));n=n()}else n=t();var s=!Rr((Ro||i).memoizedState,n);if(s&&(i.memoizedState=n,kc=!0),i=i.queue,Is(hs.bind(null,r,i,e),[e]),e=i.getSnapshot!==t||s||zo!==null&&!!(zo.memoizedState.tag&1),Ms(e?9:8,{destroy:void 0},ms.bind(null,r,i,n,t),null),e){if(r.flags|=2048,Zu===null)throw Error(o(349));a||Lo&127||ps(r,t,n)}return n}function ps(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=K.updateQueue,t===null?(t=is(),K.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ms(e,t,n,r){t.value=n,t.getSnapshot=r,gs(t)&&_s(e)}function hs(e,t,n){return n(function(){gs(t)&&_s(e)})}function gs(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Rr(e,n)}catch{return!0}}function _s(e){var t=wi(e,2);t!==null&&Md(t,e,2)}function vs(e){var t=ns();if(typeof e==`function`){var n=e;if(e=n(),Ho){Je(!0);try{n()}finally{Je(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:e},t}function ys(e,t,n,r){return e.baseState=n,us(e,Ro,typeof r==`function`?r:cs)}function bs(e,t,n,r,i){if(sc(e))throw Error(o(485));if(e=t.action,e!==null){var a={payload:i,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){a.listeners.push(e)}};L.T===null?a.isTransition=!1:n(!0),r(a),n=t.pending,n===null?(a.next=t.pending=a,xs(t,a)):(a.next=n.next,t.pending=n.next=a)}}function xs(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=L.T,o={};o.types=a===null?null:a.types,L.T=o;try{var s=n(i,r),c=L.S;c!==null&&c(o,s),Ss(e,t,s)}catch(n){ws(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),L.T=a}}else try{a=n(i,r),Ss(e,t,a)}catch(n){ws(e,t,n)}}function Ss(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Cs(e,t,n)},function(n){return ws(e,t,n)}):Cs(e,t,n)}function Cs(e,t,n){t.status=`fulfilled`,t.value=n,Ts(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,xs(e,n)))}function ws(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Ts(t),t=t.next;while(t!==r)}e.action=null}function Ts(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Es(e,t){return t}function Ds(e,t){if(W){var n=Zu.formState;if(n!==null){a:{var r=K;if(W){if(ea){b:{for(var i=ea,a=na;i.nodeType!==8;)if(!a||(i=lm(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ea=lm(i.nextSibling),r=i.data===`F!`;break a}}ia(r)}r=!1}r&&(t=n[0])}}return n=ns(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Es,lastRenderedState:t},n.queue=r,n=ic.bind(null,K,r),r.dispatch=n,r=vs(!1),a=oc.bind(null,K,!1,r.queue),r=ns(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=bs.bind(null,K,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Os(e){return ks(rs(),Ro,e)}function ks(e,t,n){if(t=us(e,t,Es)[0],e=ls(cs)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=as(t)}catch(e){throw e===Ga?qa:e}else r=t;t=rs();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(K.flags|=2048,Ms(9,{destroy:void 0},As.bind(null,i,n),null)),[r,a,e]}function As(e,t){e.action=t}function js(e){var t=rs(),n=Ro;if(n!==null)return ks(t,n,e);rs(),t=t.memoizedState,n=rs();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Ms(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=K.updateQueue,t===null&&(t=is(),K.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Ns(){return rs().memoizedState}function Ps(e,t,n,r){var i=ns();K.flags|=e,i.memoizedState=Ms(1|t,{destroy:void 0},n,r===void 0?null:r)}function Fs(e,t,n,r){var i=rs();r=r===void 0?null:r;var a=i.memoizedState.inst;Ro!==null&&r!==null&&Jo(r,Ro.memoizedState.deps)?i.memoizedState=Ms(t,a,n,r):(K.flags|=e,i.memoizedState=Ms(1|t,a,n,r))}function q(e,t){Ps(8390656,8,e,t)}function Is(e,t){Fs(2048,8,e,t)}function Ls(e){K.flags|=4;var t=K.updateQueue;if(t===null)t=is(),K.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Rs(e){var t=rs().memoizedState;return Ls({ref:t,nextImpl:e}),function(){if(Xu&2)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function zs(e,t){return Fs(4,2,e,t)}function Bs(e,t){return Fs(4,4,e,t)}function Vs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Hs(e,t,n){n=n==null?null:n.concat([e]),Fs(4,4,Vs.bind(null,t,e),n)}function Us(){}function Ws(e,t){var n=rs();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Jo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Gs(e,t){var n=rs();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Jo(t,r[1]))return r[0];if(r=e(),Ho){Je(!0);try{e()}finally{Je(!1)}}return n.memoizedState=[r,t],r}function Ks(e,t,n){return n===void 0||Lo&1073741824&&!(Z&261930)?e.memoizedState=t:(e.memoizedState=n,e=Ad(),K.lanes|=e,id|=e,n)}function qs(e,t,n,r){return Rr(n,t)?n:So.current===null?!(Lo&106)||Lo&1073741824&&!(Z&261930)?(kc=!0,e.memoizedState=n):(e=Ad(),K.lanes|=e,id|=e,t):(e=Ks(e,n,r),Rr(e,t)||(kc=!0),e)}function Js(e,t,n,r,i){var a=R.p;R.p=a!==0&&8>a?a:8;var o=L.T,s={};s.types=o===null?null:o.types,L.T=s,oc(e,!1,t,n);try{var c=i(),l=L.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?ac(e,t,za(c,r),kd(e)):ac(e,t,r,kd(e))}catch(n){ac(e,t,{then:function(){},status:`rejected`,reason:n},kd())}finally{R.p=a,o!==null&&s.types!==null&&(o.types=s.types),L.T=o}}function Ys(){}function Xs(e,t,n,r){if(e.tag!==5)throw Error(o(476));var i=Zs(e).queue;Js(e,i,t,me,n===null?Ys:function(){return Qs(e),n(r)})}function Zs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:me,baseState:me,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:me},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Qs(e){var t=Zs(e);t.next===null&&(t=e.alternate.memoizedState),ac(e,t.next.queue,{},kd())}function $s(){return xa(sh)}function ec(){return rs().memoizedState}function tc(){return rs().memoizedState}function nc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=kd();e=po(n);var r=mo(t,e,n);r!==null&&(Md(r,t,n),ho(r,t,n)),t={cache:Oa()},e.payload=t;return}t=t.return}}function rc(e,t,n){var r=kd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},sc(e)?cc(t,n):(n=Ci(e,t,n,r),n!==null&&(Md(n,e,r),lc(n,t,r)))}function ic(e,t,n){ac(e,t,n,kd())}function ac(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(sc(e))cc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Rr(s,o))return Si(e,t,i,0),Zu===null&&xi(),!1}catch{}if(n=Ci(e,t,i,r),n!==null)return Md(n,e,r),lc(n,t,r),!0}return!1}function oc(e,t,n,r){if(r={lane:2,revertLane:Nf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},sc(e)){if(t)throw Error(o(479))}else t=Ci(e,n,r,2),t!==null&&Md(t,e,2)}function sc(e){var t=e.alternate;return e===K||t!==null&&t===K}function cc(e,t){Vo=Bo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function lc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ft(e,n)}}var uc={readContext:xa,use:os,useCallback:qo,useContext:qo,useEffect:qo,useImperativeHandle:qo,useLayoutEffect:qo,useInsertionEffect:qo,useMemo:qo,useReducer:qo,useRef:qo,useState:qo,useDebugValue:qo,useDeferredValue:qo,useTransition:qo,useSyncExternalStore:qo,useId:qo,useHostTransitionStatus:qo,useFormState:qo,useActionState:qo,useOptimistic:qo,useMemoCache:qo,useCacheRefresh:qo,useEffectEvent:qo},dc={readContext:xa,use:os,useCallback:function(e,t){return ns().memoizedState=[e,t===void 0?null:t],e},useContext:xa,useEffect:q,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Ps(4194308,4,Vs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ps(4194308,4,e,t)},useInsertionEffect:function(e,t){Ps(4,2,e,t)},useMemo:function(e,t){var n=ns();t=t===void 0?null:t;var r=e();if(Ho){Je(!0);try{e()}finally{Je(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=ns();if(n!==void 0){var i=n(t);if(Ho){Je(!0);try{n(t)}finally{Je(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=rc.bind(null,K,e),[r.memoizedState,e]},useRef:function(e){var t=ns();return e={current:e},t.memoizedState=e},useState:function(e){e=vs(e);var t=e.queue,n=ic.bind(null,K,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Us,useDeferredValue:function(e,t){return Ks(ns(),e,t)},useTransition:function(){var e=vs(!1);return e=Js.bind(null,K,e.queue,!0,!1),ns().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=K,i=ns();if(W){if(n===void 0)throw Error(o(407));n=n()}else{if(n=t(),Zu===null)throw Error(o(349));Z&127||ps(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,q(hs.bind(null,r,a,e),[e]),r.flags|=2048,Ms(9,{destroy:void 0},ms.bind(null,r,a,n,t),null),n},useId:function(){var e=ns(),t=Zu.identifierPrefix;if(W){var n=qi,r=U;n=(r&~(1<<32-Ye(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Uo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Ko++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:$s,useFormState:Ds,useActionState:Ds,useOptimistic:function(e){var t=ns();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=oc.bind(null,K,!0,n),n.dispatch=t,[e,t]},useMemoCache:ss,useCacheRefresh:function(){return ns().memoizedState=nc.bind(null,K)},useEffectEvent:function(e){var t=ns(),n={impl:e};return t.memoizedState=n,function(){if(Xu&2)throw Error(o(440));return n.impl.apply(void 0,arguments)}}},fc={readContext:xa,use:os,useCallback:Ws,useContext:xa,useEffect:Is,useImperativeHandle:Hs,useInsertionEffect:zs,useLayoutEffect:Bs,useMemo:Gs,useReducer:ls,useRef:Ns,useState:function(){return ls(cs)},useDebugValue:Us,useDeferredValue:function(e,t){return qs(rs(),Ro.memoizedState,e,t)},useTransition:function(){var e=ls(cs)[0],t=rs().memoizedState;return[typeof e==`boolean`?e:as(e),t]},useSyncExternalStore:fs,useId:ec,useHostTransitionStatus:$s,useFormState:Os,useActionState:Os,useOptimistic:function(e,t){return ys(rs(),Ro,e,t)},useMemoCache:ss,useCacheRefresh:tc,useEffectEvent:Rs},pc={readContext:xa,use:os,useCallback:Ws,useContext:xa,useEffect:Is,useImperativeHandle:Hs,useInsertionEffect:zs,useLayoutEffect:Bs,useMemo:Gs,useReducer:ds,useRef:Ns,useState:function(){return ds(cs)},useDebugValue:Us,useDeferredValue:function(e,t){var n=rs();return Ro===null?Ks(n,e,t):qs(n,Ro.memoizedState,e,t)},useTransition:function(){var e=ds(cs)[0],t=rs().memoizedState;return[typeof e==`boolean`?e:as(e),t]},useSyncExternalStore:fs,useId:ec,useHostTransitionStatus:$s,useFormState:js,useActionState:js,useOptimistic:function(e,t){var n=rs();return Ro===null?(n.baseState=e,[e,n.queue.dispatch]):ys(n,Ro,e,t)},useMemoCache:ss,useCacheRefresh:tc,useEffectEvent:Rs};function mc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:D({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var hc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=kd(),i=po(r);i.payload=t,n!=null&&(i.callback=n),t=mo(e,i,r),t!==null&&(Md(t,e,r),ho(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=kd(),i=po(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=mo(e,i,r),t!==null&&(Md(t,e,r),ho(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=kd(),r=po(n);r.tag=2,t!=null&&(r.callback=t),t=mo(e,r,n),t!==null&&(Md(t,e,n),ho(t,e,n))}};function gc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!zr(n,r)||!zr(i,a):!0}function _c(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&hc.enqueueReplaceState(t,t.state,null)}function vc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=D({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function yc(e){_i(e)}function bc(e){console.error(e)}function xc(e){_i(e)}function Sc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Cc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function wc(e,t,n){return n=po(n),n.tag=3,n.payload={element:null},n.callback=function(){Sc(e,t)},n}function Tc(e){return e=po(e),e.tag=3,e}function Ec(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Cc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Cc(t,n,r),typeof i!=`function`&&(gd===null?gd=/* @__PURE__ */ new Set([this]):gd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Dc(e,t,n,r,i){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&va(t,n,i,!0),n=Do.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Oo===null?Wd():n.alternate===null&&rd===0&&(rd=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===Ja?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=/* @__PURE__ */ new Set([r]):t.add(r),pf(e,r,i)),!1;case 22:return n.flags|=65536,r===Ja?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:/* @__PURE__ */ new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=/* @__PURE__ */ new Set([r]):n.add(r)),pf(e,r,i)),!1}throw Error(o(435,n.tag))}return pf(e,r,i),Wd(),!1}if(W)return t=Do.current,t===null?(r!==ra&&(t=Error(o(423),{cause:r}),ua(zi(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=zi(r,n),i=wc(e.stateNode,r,i),go(e,i),rd!==4&&(rd=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==ra&&(e=Error(o(422),{cause:r}),ua(zi(e,n)))),!1;var a=Error(o(520),{cause:r});if(a=zi(a,n),ld===null?ld=[a]:ld.push(a),rd!==4&&(rd=2),t===null)return!0;r=zi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=wc(n.stateNode,r,e),go(n,e),!1;case 1:if(t=n.type,a=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||a!==null&&typeof a.componentDidCatch==`function`&&(gd===null||!gd.has(a))))return n.flags|=65536,i&=-i,n.lanes|=i,i=Tc(i),Ec(i,e,n,r),go(n,i),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Oc=Error(o(461)),kc=!1;function Ac(e,t,n,r){t.child=e===null?co(t,null,n,r):so(t,e.child,n,r)}function jc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return ba(t),r=Yo(e,t,n,o,a,i),s=$o(),e!==null&&!kc?(es(e,t,i),al(e,t,i)):(W&&s&&Xi(t),t.flags|=1,Ac(e,t,r,i),t.child)}function Mc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Ai(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Nc(e,t,a,r,i)):(e=Ni(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!ol(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?zr:n,n(o,r)&&e.ref===t.ref)return al(e,t,i)}return t.flags|=1,e=ji(a,r),e.ref=t.ref,e.return=t,t.child=e}function Nc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(zr(a,r)&&e.ref===t.ref){if(kc=!1,t.pendingProps=r=a,ol(e,i))e.flags&131072&&(kc=!0);else return t.lanes=e.lanes,al(e,t,i)}}return Vc(e,t,n,r,i)}function Pc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Ic(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ua(t,a===null?null:a.cachePool),a===null?To():wo(t,a),jo(t);else return r=t.lanes=536870912,Ic(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ua(t,null),To(),Mo()):(Ua(t,a.cachePool),wo(t,a),Mo(),t.memoizedState=null);return Ac(e,t,i,n),t.child}function Fc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Ic(e,t,n,r,i){var a=Ha();return a=a===null?null:{parent:Da._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ua(t,null),To(),jo(t),e!==null&&va(e,t,r,!0),t.childLanes=i,null}function Lc(e,t){return t=Xc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Rc(e,t,n){return so(t,e.child,null,n),e=Lc(t,t.pendingProps),e.flags|=2,G(t),t.memoizedState=null,e}function zc(e,t,n){var r=t.pendingProps,i=!!(t.flags&128);if(t.flags&=-129,e===null){if(W){if(r.mode===`hidden`)return e=Lc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Fc(null,e);if(Ao(t),(e=ea)?(e=am(e,na),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ki===null?null:{id:U,overflow:qi},retryLane:536870912,hydrationErrors:null},n=Ii(e),n.return=t,t.child=n,$i=t,ea=null)):e=null,e===null)throw ia(t);return t.lanes=536870912,null}return Lc(t,r)}var a=e.memoizedState;if(a!==null){var s=a.dehydrated;if(Ao(t),i){if(t.flags&256)t.flags&=-257,t=Rc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558))}else if(kc||va(e,t,n,!1),i=(n&e.childLanes)!==0,kc||i){if(So.current===null){if(r=Zu,r!==null&&(s=pt(r,n),s!==0&&s!==a.retryLane))throw a.retryLane=s,wi(e,s),Md(r,e,s),Oc;Wd()}t=Rc(e,t,n)}else e=a.treeContext,ea=lm(s.nextSibling),$i=t,W=!0,ta=null,na=!1,e!==null&&Qi(t,e),t=Lc(t,r),t.flags|=134221824;return t}return e=ji(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Bc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(o(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Vc(e,t,n,r,i){return ba(t),n=Yo(e,t,n,r,void 0,i),r=$o(),e!==null&&!kc?(es(e,t,i),al(e,t,i)):(W&&r&&Xi(t),t.flags|=1,Ac(e,t,n,i),t.child)}function Hc(e,t,n,r,i,a){return ba(t),t.updateQueue=null,n=Zo(t,r,n,i),Xo(e),r=$o(),e!==null&&!kc?(es(e,t,a),al(e,t,a)):(W&&r&&Xi(t),t.flags|=1,Ac(e,t,n,a),t.child)}function Uc(e,t,n,r,i){if(ba(t),t.stateNode===null){var a=Di,o=n.contextType;typeof o==`object`&&o&&(a=xa(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=hc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},uo(t),o=n.contextType,a.context=typeof o==`object`&&o?xa(o):Di,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(mc(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&hc.enqueueReplaceState(a,a.state,null),yo(t,r,a,i),vo(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=vc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Di,typeof u==`object`&&u&&(o=xa(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&_c(t,a,r,o),lo=!1;var f=t.memoizedState;a.state=f,yo(t,r,a,i),vo(),l=t.memoizedState,s||f!==l||lo?(typeof d==`function`&&(mc(t,n,d,r),l=t.memoizedState),(c=lo||gc(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,fo(e,t),o=t.memoizedProps,u=vc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Di,typeof l==`object`&&l&&(c=xa(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&_c(t,a,r,c),lo=!1,f=t.memoizedState,a.state=f,yo(t,r,a,i),vo();var p=t.memoizedState;o!==d||f!==p||lo||e!==null&&e.dependencies!==null&&ya(e.dependencies)?(typeof s==`function`&&(mc(t,n,s,r),p=t.memoizedState),(u=lo||gc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ya(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Bc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=so(t,e.child,null,i),t.child=so(t,null,n,i)):Ac(e,t,n,i),t.memoizedState=a.state,e=t.child):e=al(e,t,i),e}function Wc(e,t,n,r){return ca(),t.flags|=256,Ac(e,t,n,r),t.child}var Gc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Kc(e){return{baseLanes:e,cachePool:Wa()}}function qc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=sd),e}function Jc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(No.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(W){if(i?ko(t):Mo(),(e=ea)?(e=am(e,na),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ki===null?null:{id:U,overflow:qi},retryLane:536870912,hydrationErrors:null},n=Ii(e),n.return=t,t.child=n,$i=t,ea=null)):e=null,e===null)throw ia(t);return t.lanes=sm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Mo(),i=t.mode,a=Xc({mode:`hidden`,children:a},i),r=Pi(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Kc(n),r.childLanes=qc(e,o,n),t.memoizedState=Gc,Fc(null,r)):(ko(t),Yc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return Qc(e,t,a,o,r,c,s,n)}return i?(Mo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=ji(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Pi(i,a,n,null),i.flags|=2):i=ji(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Fc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Kc(n):(a=i.cachePool,a===null?a=Wa():(s=Da._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=qc(e,o,n),t.memoizedState=Gc,Fc(e.child,r)):(ko(t),n=e.child,e=n.sibling,n=ji(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function Yc(e,t){return t=Xc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Xc(e,t){return e=ki(22,e,null,t),e.lanes=0,e}function Zc(e,t,n){return so(t,e.child,null,n),e=Yc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Qc(e,t,n,r,i,a,s,c){if(n)return t.flags&256?(ko(t),t.flags&=-257,Zc(e,t,c)):t.memoizedState===null?(Mo(),a=i.fallback,s=t.mode,i=Xc({mode:`visible`,children:i.children},s),a=Pi(a,s,c,null),a.flags|=2,i.return=t,a.return=t,i.sibling=a,t.child=i,so(t,e.child,null,c),i=t.child,i.memoizedState=Kc(c),i.childLanes=qc(e,r,c),t.memoizedState=Gc,Fc(null,i)):(Mo(),t.child=e.child,t.flags|=128,null);if(ko(t),sm(a)){if(r=a.nextSibling&&a.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(i=Error(o(419)),i.stack=``,i.digest=r,ua({value:i,source:null,stack:null})),Zc(e,t,c)}if(kc||va(e,t,c,!1),r=(c&e.childLanes)!==0,kc||r){if(So.current!==null)return Zc(e,t,c);if(r=Zu,r!==null&&(i=pt(r,c),i!==0&&i!==s.retryLane))throw s.retryLane=i,wi(e,i),Md(r,e,i),Oc;return om(a)||Wd(),Zc(e,t,c)}return om(a)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,ea=lm(a.nextSibling),$i=t,W=!0,ta=null,na=!1,e!==null&&Qi(t,e),t=Yc(t,i.children),t.flags|=134221824,t)}function $c(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ga(e.return,t,n)}function el(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Io(n)===null&&(t=e),e=e.sibling}return t}function tl(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function nl(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function rl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=No.current;if(t.flags&128)return Po(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Po(t,o),i===`backwards`&&e!==null?(nl(e),Ac(e,t,r,n),nl(e)):Ac(e,t,r,n),r=W?Ui:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&$c(e,n,t);else if(e.tag===19)$c(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=el(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,nl(t)),tl(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Io(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}tl(t,!0,n,null,a,r);break;case`together`:tl(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=el(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),tl(t,!1,i,n,a,r)}return t.child}function il(e,t,n){var r=t.pendingProps;return ma(t,t.type,r.value),Ac(e,t,r.children,n),t.child}function al(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),id|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(va(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,n=ji(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ji(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function ol(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&ya(e)))}function sl(e,t,n){switch(t.tag){case 3:B(t,t.stateNode.containerInfo),ma(t,Da,e.memoizedState.cache),ca();break;case 27:case 5:Ce(t);break;case 4:B(t,t.stateNode.containerInfo);break;case 10:ma(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ao(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return ko(t),t.flags|=128,null;r=va(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Jc(e,t,n):(ko(t),e=al(e,t,n),e===null?null:e.sibling)}ko(t);break;case 19:if(t.flags&128)return rl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(va(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return rl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Po(t,No.current),r)break;return null;case 22:return t.lanes=0,Pc(e,t,n,t.pendingProps);case 24:ma(t,Da,e.memoizedState.cache)}return al(e,t,n)}function cl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)kc=!0;else{if(!ol(e,n)&&!(t.flags&128))return kc=!1,sl(e,t,n);kc=!!(e.flags&131072)}}else kc=!1,W&&t.flags&1048576&&Yi(t,Ui,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Za(t.elementType),t.type=e,typeof e==`function`)Ai(e)?(r=vc(e,r),t.tag=1,t=Uc(null,t,e,r,n)):(t.tag=0,t=Vc(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===I){t.tag=11,t=jc(null,t,e,r,n);break a}if(i===ne){t.tag=14,t=Mc(null,t,e,r,n);break a}if(i===F){t.tag=10,t.type=e,t=il(null,t,n);break a}}throw t=fe(e)||e,Error(o(306,t,``))}}return t;case 0:return Vc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=vc(r,t.pendingProps),Uc(e,t,r,i,n);case 3:a:{if(B(t,t.stateNode.containerInfo),e===null)throw Error(o(387));r=t.pendingProps;var a=t.memoizedState;i=a.element,fo(e,t),yo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ma(t,Da,r),r!==a.cache&&_a(t,[Da],n,!0),vo(),r=s.element,a.isDehydrated){if(a={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){t=Wc(e,t,r,n);break a}if(r!==i){i=zi(Error(o(424)),t),ua(i),t=Wc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(ea=lm(e.firstChild),$i=t,W=!0,ta=null,na=!0,n=co(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(ca(),r===i){t=al(e,t,n);break a}Ac(e,t,r,n)}t=t.child}return t;case 26:return Bc(e,t),e===null?(n=Nm(t.type,null,t.pendingProps,null))?t.memoizedState=n:W||(t.stateNode=fp(t.type,t.pendingProps,xe.current,t)):t.memoizedState=Nm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ce(t),e===null&&W&&(r=t.stateNode=hm(t.type,t.pendingProps,xe.current),$i=t,na=!0,i=ea,Sp(t.type)?(um=i,ea=lm(r.firstChild)):ea=i),Ac(e,t,t.pendingProps.children,n),Bc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&W&&((i=r=ea)&&(r=rm(r,t.type,t.pendingProps,na),r===null?i=!1:(t.stateNode=r,$i=t,ea=lm(r.firstChild),na=!1,i=!0)),i||ia(t)),Ce(t),i=t.type,a=t.pendingProps,s=e===null?null:e.memoizedProps,r=a.children,pp(i,a)?r=null:s!==null&&pp(i,s)&&(t.flags|=32),t.memoizedState!==null&&(i=Yo(e,t,Qo,null,null,n),sh._currentValue=i),Bc(e,t),Ac(e,t,r,n),t.child;case 6:return e===null&&W&&((e=n=ea)&&(n=im(n,t.pendingProps,na),n===null?e=!1:(t.stateNode=n,$i=t,ea=null,e=!0)),e||ia(t)),null;case 13:return Jc(e,t,n);case 4:return B(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=so(t,null,r,n):Ac(e,t,r,n),t.child;case 11:return jc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Bc(e,t),Ac(e,t,r,n),t.child;case 8:return Ac(e,t,t.pendingProps.children,n),t.child;case 12:return Ac(e,t,t.pendingProps.children,n),t.child;case 10:return il(e,t,n);case 9:return i=t.type._context,r=t.pendingProps.children,ba(t),i=xa(i),r=r(i),t.flags|=1,Ac(e,t,r,n),t.child;case 14:return Mc(e,t,t.type,t.pendingProps,n);case 15:return Nc(e,t,t.type,t.pendingProps,n);case 19:return rl(e,t,n);case 31:return zc(e,t,n);case 22:return Pc(e,t,n,t.pendingProps);case 24:return ba(t),r=xa(Da),e===null?(i=Ha(),i===null&&(i=Zu,a=Oa(),i.pooledCache=a,a.refCount++,a!==null&&(i.pooledCacheLanes|=n),i=a),t.memoizedState={parent:r,cache:i},uo(t),ma(t,Da,i)):((e.lanes&n)!==0&&(fo(e,t),yo(t,null,null,n),vo()),i=e.memoizedState,a=t.memoizedState,i.parent===r?(r=a.cache,ma(t,Da,r),r!==i.cache&&_a(t,[Da],n,!0)):(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),ma(t,Da,r))),Ac(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:W&&Xi(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Bc(e,t),Ac(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function ll(e){e.flags|=4}function ul(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Jm(t,r):Jm(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Vd())e.flags|=8192;else throw Qa=Ja,Ka}}else e.flags&=-16777217}function dl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Ym(t)){if(Vd())e.flags|=8192;else throw Qa=Ja,Ka}}function fl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:st(),e.lanes|=t,cd|=t)}function pl(e,t){if(!W)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function ml(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function hl(e,t,n){var r=t.pendingProps;switch(Zi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ml(t),null;case 1:return ml(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ha(Da),V(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(sa(t)?ll(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,la())),ml(t),null;case 26:var i=t.type,a=t.memoizedState;return e===null?(ll(t),a===null?(ml(t),ul(t,i,null,r,n)):(ml(t),dl(t,a))):a?a===e.memoizedState?(ml(t),t.flags&=-16777217):(ll(t),ml(t),dl(t,a)):(e=e.memoizedProps,e!==r&&ll(t),ml(t),ul(t,i,e,r,n)),null;case 27:if(we(t),n=xe.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ll(t);else{if(!r){if(t.stateNode===null)throw Error(o(166));return ml(t),t.subtreeFlags&=-33554433,null}e=ye.current,sa(t)?aa(t,e):(e=hm(i,r,n),t.stateNode=e,ll(t))}return ml(t),t.subtreeFlags&=-33554433,null;case 5:if(we(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ll(t);else{if(!r){if(t.stateNode===null)throw Error(o(166));return ml(t),t.subtreeFlags&=-33554433,null}if(a=ye.current,sa(t))aa(t,a);else{var s=lp(xe.current);switch(a){case 1:a=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case 2:a=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;default:switch(i){case`svg`:a=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case`math`:a=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;case`script`:a=s.createElement(`div`),a.innerHTML=`<script><\/script>`,a=a.removeChild(a.firstChild);break;case`select`:a=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?a.multiple=!0:r.size&&(a.size=r.size);break;default:a=typeof r.is==`string`?s.createElement(i,{is:r.is}):s.createElement(i)}}a[yt]=t,a[bt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)a.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=a;a:switch(np(a,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&ll(t)}}return ml(t),t.subtreeFlags&=-33554433,ul(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&ll(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(o(166));if(e=xe.current,sa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=$i,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[yt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||$f(e.nodeValue,n)),e||ia(t,!0)}else e=lp(e).createTextNode(r),e[yt]=t,t.stateNode=e}return ml(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=sa(t),n!==null){if(e===null){if(!r)throw Error(o(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(o(557));e[yt]=t}else ca(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ml(t),e=!1}else n=la(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(G(t),t):(G(t),null);if(t.flags&128)throw Error(o(558))}return ml(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=sa(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(o(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(o(317));i[yt]=t}else ca(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ml(t),i=!1}else i=la(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(G(t),t):(G(t),null)}return G(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),a=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(a=r.memoizedState.cachePool.pool),a!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),fl(t,t.updateQueue),ml(t),null);case 4:return V(),e===null&&Uf(t.stateNode.containerInfo),t.flags|=67108864,ml(t),null;case 10:return ha(t.type),ml(t),null;case 19:if(Fo(t),r=t.memoizedState,r===null)return ml(t),null;if(i=!!(t.flags&128),a=r.rendering,a===null){if(i)pl(r,!1);else{if(rd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=Io(e),a!==null){for(t.flags|=128,pl(r,!1),e=a.updateQueue,t.updateQueue=e,fl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Mi(n,e),n=n.sibling;return Po(t,No.current&1|2),W&&Ji(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Le()>md&&(t.flags|=128,i=!0,pl(r,!1),t.lanes=4194304)}}else{if(!i){if(e=Io(a),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,fl(t,e),pl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!a.alternate&&!W)return ml(t),null}else 2*Le()-r.renderingStartTime>md&&n!==536870912&&(t.flags|=128,i=!0,pl(r,!1),t.lanes=4194304)}r.isBackwards?(a.sibling=t.child,t.child=a):(e=r.last,e===null?t.child=a:e.sibling=a,r.last=a)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Le(),e.sibling=null,a=No.current,a=i?a&1|2:a&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||W?Po(t,a):(n=a,z(Do,t),z(No,n),Oo===null&&(Oo=t)),W&&Ji(t,r.treeForkCount),e}return ml(t),null;case 22:case 23:return G(t),Eo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(ml(t),t.subtreeFlags&6&&(t.flags|=8192)):ml(t),n=t.updateQueue,n!==null&&fl(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&ve(Va),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ha(Da),ml(t),null;case 25:return null;case 30:return t.flags|=33554432,ml(t),null}throw Error(o(156,t.tag))}function gl(e,t){switch(Zi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ha(Da),V(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return we(t),null;case 31:if(t.memoizedState!==null){if(G(t),t.alternate===null)throw Error(o(340));ca()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(G(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));ca()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Fo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return V(),null;case 10:return ha(t.type),null;case 22:case 23:return G(t),Eo(),e!==null&&ve(Va),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ha(Da),null;case 25:return null;default:return null}}function _l(e,t){switch(Zi(t),t.tag){case 3:ha(Da),V();break;case 26:case 27:case 5:we(t);break;case 4:V();break;case 31:t.memoizedState!==null&&G(t);break;case 13:G(t);break;case 19:Fo(t);break;case 10:ha(t.type);break;case 22:case 23:G(t),Eo(),e!==null&&ve(Va);break;case 24:ha(Da)}}function vl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){ff(t,t.return,e)}}function yl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){ff(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){ff(t,t.return,e)}}function bl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{xo(t,n)}catch(t){ff(e,e.return,t)}}}function xl(e,t,n){n.props=vc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){ff(e,t,n)}}function Sl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=mi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Pp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Fp(e);h(e.child,!1,Qp,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){ff(e,t,n)}}function Cl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){ff(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){ff(e,t,n)}else n.current=null}}function wl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)em(e.stateNode,t[n])}function Tl(e){for(var t=e.return;t!==null&&(Ol(t)&&em(e.stateNode,t.stateNode),!Dl(t));)t=t.return}function El(e){for(var t=e.return;t!==null&&(Ol(t)&&tm(e.stateNode,t.stateNode),!Dl(t));)t=t.return}function Dl(e){return e.tag===5||e.tag===3||e.tag===27}function Ol(e){return e&&e.tag===7&&e.stateNode!==null}function kl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){ff(e,e.return,t)}}function Al(e,t,n){try{var r=e.stateNode;ip(r,e.type,n,t),r[bt]=t}catch(t){ff(e,e.return,t)}}function jl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Sp(e.type)||e.tag===4}function Ml(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||jl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Sp(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Nl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=hn)),wl(e,r),H=!0;else if(i!==4&&(i===27&&(wl(e,r),r=null,Sp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Nl(e,t,n,r),e=e.sibling;e!==null;)Nl(e,t,n,r),e=e.sibling}function Pl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),wl(e,r),H=!0;else if(i!==4&&(i===27&&(wl(e,r),r=null,Sp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Pl(e,t,n,r),e=e.sibling;e!==null;)Pl(e,t,n,r),e=e.sibling}function Fl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);np(t,r,n),t[yt]=e,t[bt]=n}catch(t){ff(e,e.return,t)}}var Il=!1,J=null;function Ll(e){(e.tag===30||e.subtreeFlags&33554432)&&(Il=!0)}var Rl=null;function zl(){var e=Rl;return Rl=null,e}var Bl=0;function Vl(e,t,n,r,i){return Bl=0,Hl(e.child,t,n,r,i)}function Hl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Op(o);r.push(s),s.view&&(a=!0)}else a||Op(o).view&&(a=!0);Il=!0,Tp(o,Bl===0?t:t+`_`+Bl,n),Bl++}else e.tag===22&&e.memoizedState!==null||e.tag===30&&i||Hl(e.child,t,n,r,i)&&(a=!0);e=e.sibling}return a}function Ul(e,t){for(;e!==null;)e.tag===5?Ep(e.stateNode,e.memoizedProps):e.tag===22&&e.memoizedState!==null||e.tag===30&&t||Ul(e.child,t),e=e.sibling}function Wl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Wl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(o(544));var n=t.name;t=gi(t.default,t.share),t!==`none`&&(Vl(e,n,t,null,!1)||Ul(e.child,!1))}e=e.sibling}}function Gl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=mi(r,n),a=gi(r.default,n.paired?r.share:r.enter);a===`none`?Wl(e):Vl(e,i,a,null,!1)?(Wl(e),n.paired||t||jd(e,r.onEnter)):Ul(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Gl(e,t),e=e.sibling;else Wl(e)}function Kl(e){if(J!==null&&J.size!==0){var t=J;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=gi(n.default,n.share);if(a!==`none`&&(Vl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,jd(e,n.onShare)):Ul(e.child,!1)),t.delete(r),t.size===0)break}}}Kl(e)}e=e.sibling}}}function ql(e){if(e.tag===30){var t=e.memoizedProps,n=mi(t,e.stateNode),r=J===null?void 0:J.get(n),i=gi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Vl(e,n,i,null,!1)?r===void 0?jd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,J.delete(n),jd(e,t.onShare)):Ul(e.child,!1)),J!==null&&Kl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)ql(e),e=e.sibling;else J!==null&&Kl(e)}function Jl(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=mi(t,e.stateNode);t=gi(t.default,t.update),e.flags&=-5,t!==`none`&&Vl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Jl(e);e=e.sibling}}function Yl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Ul(e.child,!1))}Yl(e)}e=e.sibling}}function Xl(e){if(e.tag===30)e.stateNode.paired=null,Ul(e.child,!1),Yl(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Xl(e),e=e.sibling;else Yl(e)}function Zl(e){for(e=e.child;e!==null;)e.tag===30?Ul(e.child,!1):e.subtreeFlags&33554432&&Zl(e),e=e.sibling}function Ql(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Bl<a.length){var l=a[Bl],u=Op(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Tp(c,Bl===0?n:n+`_`+Bl,i),s&&e.flags&4||(Rl===null&&(Rl=[]),Rl.push(c,Bl===0?r:r+`_`+Bl,t.memoizedProps)),Bl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:Ql(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function $l(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=mi(n,r),a=gi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(kp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Bl=0,i=Ql(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||jd(e,n.onUpdate))}else e.subtreeFlags&33554432&&$l(e,t);e=e.sibling}}var eu=!1,tu=!1,nu=!1,ru=!1,iu=typeof WeakSet==`function`?WeakSet:Set,au=null,ou=!1,Y=!1,su=!1,cu=!1;function lu(e,t,n){if(e=e.containerInfo,sp=gh,e=Wr(e),Gr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(cp={focusedElem:e,selectionRange:r},gh=!1,n=(n&335544064)===n,au=t,t=n?9270:1024;au!==null;){if(e=au,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&ql(r[a]);if(e.alternate===null&&e.flags&2)n&&Ll(e),uu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&ql(r),uu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Ll(e),uu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,au=r):(n&&Jl(e),uu(n))}}J=null}function uu(e){for(;au!==null;){var t=au,n=e,r=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(i&1024&&r!==null){n=void 0,i=r.memoizedProps,r=r.memoizedState;var a=t.stateNode;try{var s=vc(t.type,i);n=a.getSnapshotBeforeUpdate(s,r),a.__reactInternalSnapshotBeforeUpdate=n}catch(e){ff(t,t.return,e)}}break;case 3:if(i&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)nm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:nm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=mi(r.memoizedProps,r.stateNode),i=t.memoizedProps,i=gi(i.default,i.update),i!==`none`&&Vl(r,n,i,r.memoizedState=[],!0));break;default:if(i&1024)throw Error(o(163))}if(r=t.sibling,r!==null){r.return=t.return,au=r;break}au=t.return}}function du(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:ju(e,n),r&4&&vl(5,n);break;case 1:if(ju(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){ff(n,n.return,e)}else{var i=vc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){ff(n,n.return,e)}}}r&64&&bl(n),r&512&&Sl(n,n.return);break;case 3:if(ju(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{xo(e,t)}catch(e){ff(n,n.return,e)}}break;case 27:t===null&&r&4&&Fl(n);case 26:case 5:ju(e,n),t===null&&r&4&&kl(n),r&512&&Sl(n,n.return);break;case 12:ju(e,n);break;case 31:ju(e,n),r&4&&bu(e,n);break;case 13:ju(e,n),r&4&&xu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=gf.bind(null,n),cm(e,n))));break;case 22:if(r=n.memoizedState!==null||eu,!r){var a=t!==null&&t.memoizedState!==null||tu;t=eu,i=tu,eu=r,(tu=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Nu(e,n,r)):ju(e,n),eu=t,tu=i}break;case 30:ju(e,n),r&512&&Sl(n,n.return);break;case 7:r&512&&Sl(n,n.return);default:ju(e,n)}}function fu(e,t){for(e=e.child;e!==null;)pu(e,t),e=e.sibling}function pu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){ff(e,e.return,t)}mu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,H=!0}catch(t){ff(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?wp(s,!0):wp(e.stateNode,!1)}catch(t){ff(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&fu(e,t);break;default:fu(e,t)}}function mu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:pu(n,r);break a;case 22:n.memoizedState===null&&mu(n,r);break a;default:mu(n,r)}}e=e.sibling}}function hu(e){var t=e.alternate;t!==null&&(e.alternate=null,hu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ot(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var gu=null,_u=!1;function vu(e,t,n){for(n=n.child;n!==null;)yu(e,t,n),n=n.sibling}function yu(e,t,n){if(qe&&typeof qe.onCommitFiberUnmount==`function`)try{qe.onCommitFiberUnmount(Ke,n)}catch{}switch(n.tag){case 26:tu||Cl(n,t),vu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!tu&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:tu||Cl(n,t),El(n);var r=gu,i=_u;Sp(n.type)&&(gu=n.stateNode,_u=!1),vu(e,t,n),gm(n.stateNode,n.type,n.memoizedProps),gu=r,_u=i;break;case 5:tu||Cl(n,t),El(n);case 6:if(n.tag===6&&El(n),r=gu,i=_u,gu=null,vu(e,t,n),gu=r,_u=i,gu!==null){if(_u)try{(gu.nodeType===9?gu.body:gu.nodeName===`HTML`?gu.ownerDocument.body:gu).removeChild(n.stateNode),H=!0}catch(e){ff(n,t,e)}else try{gu.removeChild(n.stateNode),H=!0}catch(e){ff(n,t,e)}}break;case 18:gu!==null&&(_u?(e=gu,Cp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Hh(e)):Cp(gu,n.stateNode));break;case 4:r=gu,i=_u,gu=n.stateNode.containerInfo,_u=!0,vu(e,t,n),gu=r,_u=i;break;case 0:case 11:case 14:case 15:yl(2,n,t),tu||yl(4,n,t),vu(e,t,n);break;case 1:tu||(Cl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&xl(n,t,r)),vu(e,t,n);break;case 21:vu(e,t,n);break;case 22:tu=(r=tu)||n.memoizedState!==null,vu(e,t,n),tu=r;break;case 30:Cl(n,t),vu(e,t,n);break;case 7:tu||Cl(n,t),vu(e,t,n);break;default:vu(e,t,n)}}function bu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Hh(e)}catch(e){ff(t,t.return,e)}}}function xu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Hh(e)}catch(e){ff(t,t.return,e)}}function Su(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new iu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new iu),t;default:throw Error(o(435,e.tag))}}function Cu(e,t){var n=Su(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=_f.bind(null,e,t);t.then(r,r)}})}function wu(e,t,n){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var a=r[i],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Sp(l.type)){gu=l.stateNode,_u=!1;break a}break;case 5:gu=l.stateNode,_u=!1;break a;case 3:case 4:gu=l.stateNode.containerInfo,_u=!0;break a}l=l.return}if(gu===null)throw Error(o(160));yu(s,c,a),gu=null,_u=!1,s=a.alternate,s!==null&&(s.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Eu(t,e,n),t=t.sibling}var Tu=null;function Eu(e,t,n){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(i&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var a=0;a<r.length;a++){var s=r[a];s.ref.impl=s.nextImpl}wu(t,e,n),Du(e),i&4&&(yl(3,e,e.return),vl(3,e),yl(5,e,e.return));break;case 1:wu(t,e,n),Du(e),i&512&&(tu||r===null||Cl(r,r.return)),i&64&&eu&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(a=Tu,wu(t,e,n),Du(e),i&512&&(tu||r===null||Cl(r,r.return)),i&4){if(i=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(eu)e.stateNode=fp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,i=a.ownerDocument||a;b:switch(t){case`title`:r=i.getElementsByTagName(`title`)[0],(!r||r[Et]||r[yt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=i.createElement(t),i.head.insertBefore(r,i.querySelector(`head > title`))),np(r,t,n),r[yt]=e,Nt(r),t=r;break a;case`link`:if(a=Gm(`link`,`href`,i).get(t+(n.href||``))){for(s=0;s<a.length;s++)if(r=a[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){a.splice(s,1);break b}}r=i.createElement(t),np(r,t,n),i.head.appendChild(r);break;case`meta`:if(a=Gm(`meta`,`content`,i).get(t+(n.content||``))){for(s=0;s<a.length;s++)if(r=a[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){a.splice(s,1);break b}}r=i.createElement(t),np(r,t,n),i.head.appendChild(r);break;default:throw Error(o(468,t))}r[yt]=e,Nt(r),t=r}e.stateNode=t}}else eu||Km(a,e.type,e.stateNode)}else e.stateNode=Bm(a,n,e.memoizedProps)}else i===n?n===null&&e.stateNode!==null&&Al(e,e.memoizedProps,r.memoizedProps):(i===null?(t=r.stateNode,t===null||tu||t.parentNode.removeChild(t)):i.count--,n===null?eu||Km(a,e.type,e.stateNode):Bm(a,n,e.memoizedProps))}break;case 27:wu(t,e,n),Du(e),i&512&&(tu||r===null||Cl(r,r.return)),r!==null&&i&4&&Al(e,e.memoizedProps,r.memoizedProps);break;case 5:if(a=nu,nu=!1,wu(t,e,n),nu=a,Du(e),i&512&&(tu||r===null||Cl(r,r.return)),e.flags&32){t=e.stateNode;try{sn(t,``),H=!0}catch(t){ff(e,e.return,t)}}i&4&&e.stateNode!=null&&(t=e.memoizedProps,Al(e,t,r===null?t:r.memoizedProps)),i&1024&&(ru=!0);break;case 6:if(wu(t,e,n),Du(e),i&4){if(e.stateNode===null)throw Error(o(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,H=!0}catch(t){ff(e,e.return,t)}}break;case 3:if(H=!1,Wm=null,a=Tu,Tu=bm(t.containerInfo),wu(t,e,n),Tu=a,Du(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{Hh(t.containerInfo)}catch(t){ff(e,e.return,t)}ru&&(ru=!1,Ou(e)),H=!1;break;case 4:i=nu,nu=eu,r=Ut(),a=Tu,Tu=bm(e.stateNode.containerInfo),wu(t,e,n),Du(e),Tu=a,H&&Y&&(su=!0),H=r,nu=i;break;case 12:wu(t,e,n),Du(e);break;case 31:wu(t,e,n),Du(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Cu(e,t)));break;case 13:wu(t,e,n),Du(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(fd=Le()),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Cu(e,t)));break;case 22:a=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=eu,l=tu,u=nu;eu=c||a,nu=u||a,tu=l||s,wu(t,e,n),tu=l,nu=u,eu=c,Du(e),i&8192&&(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,!a||r===null||s||eu||tu||(t=s||tu,n=eu,r=tu,eu=a||eu,tu=t,Mu(e,2),eu=n,tu=r),!a&&nu||fu(e,a)),i&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Cu(e,n))));break;case 19:wu(t,e,n),Du(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Cu(e,t)));break;case 30:i&512&&(tu||r===null||Cl(r,r.return)),i=Ut(),a=Y,s=(n&335544064)===n,c=e.memoizedProps,Y=s&&gi(c.default,c.update)!==`none`,wu(t,e,n),Du(e),s&&r!==null&&H&&(e.flags|=4),Y=a,H=i;break;case 21:break;case 7:i&512&&(tu||r===null||Cl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:wu(t,e,n),Du(e)}}function Du(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(jl(r)){n=r;break}r=r.return}r=null;for(var i=e.return;i!==null;){if(Ol(i)){var a=i.stateNode;r===null?r=[a]:r.push(a)}if(Dl(i))break;i=i.return}var s=r;if(n==null)throw Error(o(160));switch(n.tag){case 27:var c=n.stateNode;Pl(e,Ml(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(sn(l,``),n.flags&=-33),Pl(e,Ml(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Nl(e,Ml(e),u,s);break;default:throw Error(o(161))}}catch(t){ff(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ou(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Ou(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,gh=!0,t.reset(),gh=!1),e=e.sibling}}function ku(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Au(t,e),t=t.sibling;else $l(t,!1)}function Au(e,t){var n=e.alternate;if(n===null)Gl(e,!1);else switch(e.tag){case 3:if(cu=ou=!1,zl(),ku(t,e),!ou&&!su){if(e=Rl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Ep(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),cu=!0}Rl=null;break;case 5:ku(t,e);break;case 4:r=ou,ou=!1,ku(t,e),ou&&(su=!0),ou=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?ku(t,e):Gl(e,!1));break;case 30:r=ou,i=zl(),ou=!1,ku(t,e),ou&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=mi(a,o),o=mi(n.memoizedProps,o);var s=gi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Bl=0,t=Ql(e,n,t,o,s,a,!0),Bl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(jd(e,e.memoizedProps.onUpdate),Rl=i):i!==null&&(i.push.apply(i,Rl),Rl=i),ou=e.flags&32?!0:r;break;default:ku(t,e)}}function ju(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)du(e,t.alternate,t),t=t.sibling}function Mu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:yl(4,n,n.return),Mu(n,r);break;case 1:Cl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&xl(n,n.return,i),Mu(n,r);break;case 27:r&2&&gm(n.stateNode,n.type,n.memoizedProps);case 5:Cl(n,n.return),n.tag!==5&&n.tag!==27||El(n),Mu(n,r);break;case 6:El(n);break;case 26:Cl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||tu||i.parentNode.removeChild(i),Mu(n,r);break;case 22:n.memoizedState===null&&Mu(n,r);break;case 30:Cl(n,n.return),Mu(n,r);break;case 7:Cl(n,n.return);default:Mu(n,r)}e=e.sibling}}function Nu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Nu(i,a,n),vl(4,a);break;case 1:if(Nu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){ff(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)bo(l[i],c)}catch(e){ff(r,r.return,e)}}s&&o&64&&bl(a),Sl(a,a.return);break;case 27:n&2&&Fl(a);case 5:a.tag!==5&&a.tag!==27||Tl(a),Nu(i,a,n),s&&r===null&&o&4&&kl(a),Sl(a,a.return);break;case 6:Tl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||eu||Km(bm(c.ownerDocument),a.type,c),Nu(i,a,n),s&&r===null&&o&4&&kl(a),Sl(a,a.return);break;case 12:Nu(i,a,n);break;case 31:Nu(i,a,n),s&&o&4&&bu(i,a);break;case 13:Nu(i,a,n),s&&o&4&&xu(i,a);break;case 22:a.memoizedState===null&&Nu(i,a,n),Sl(a,a.return);break;case 30:Nu(i,a,n),Sl(a,a.return);break;case 7:Sl(a,a.return);default:Nu(i,a,n)}t=t.sibling}}function Pu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ka(n))}function Fu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ka(e))}function Iu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Lu(e,t,n,r),t=t.sibling;else i&&Zl(t)}function Lu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Xl(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Iu(e,t,n,r),a&2048&&vl(9,t);break;case 1:Iu(e,t,n,r);break;case 3:Iu(e,t,n,r),i&&cu&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&ka(a)));break;case 12:if(a&2048){Iu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){ff(t,t.return,e)}}else Iu(e,t,n,r);break;case 31:Iu(e,t,n,r);break;case 13:Iu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&Xl(t),o._visibility&2?Iu(e,t,n,r):(o._visibility|=2,Ru(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&Xl(s),o._visibility&2?Iu(e,t,n,r):zu(e,t)),a&2048&&Pu(s,t);break;case 24:Iu(e,t,n,r),a&2048&&Fu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Ul(a.child,!0),Ul(t.child,!0))),Iu(e,t,n,r);break;default:Iu(e,t,n,r)}}function Ru(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Ru(a,o,s,c,i),vl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Ru(a,o,s,c,i)):u._visibility&2?Ru(a,o,s,c,i):zu(a,o),i&&l&2048&&Pu(o.alternate,o);break;case 24:Ru(a,o,s,c,i),i&&l&2048&&Fu(o.alternate,o);break;default:Ru(a,o,s,c,i)}t=t.sibling}}function zu(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:zu(n,r),i&2048&&Pu(r.alternate,r);break;case 24:zu(n,r),i&2048&&Fu(r.alternate,r);break;default:zu(n,r)}t=t.sibling}}var Bu=8192;function Vu(e,t,n){if(e.subtreeFlags&Bu)for(e=e.child;e!==null;)Hu(e,t,n),e=e.sibling}function Hu(e,t,n){switch(e.tag){case 26:Vu(e,t,n),e.flags&Bu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&Zm(n,e)):Qm(n,Tu,e.memoizedState,e.memoizedProps));break;case 5:Vu(e,t,n),e.flags&Bu&&(e=e.stateNode,(t&335544128)===t&&Zm(n,e));break;case 3:case 4:var r=Tu;Tu=bm(e.stateNode.containerInfo),Vu(e,t,n),Tu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Bu,Bu=16777216,Vu(e,t,n),Bu=r):Vu(e,t,n));break;case 30:if((e.flags&Bu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,J===null&&(J=/* @__PURE__ */ new Map),J.set(r,i)}Vu(e,t,n);break;default:Vu(e,t,n)}}function Uu(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Wu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];au=r,qu(r,e)}Uu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Gu(e),e=e.sibling}function Gu(e){switch(e.tag){case 0:case 11:case 15:Wu(e),e.flags&2048&&yl(9,e,e.return);break;case 3:Wu(e);break;case 12:Wu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ku(e)):Wu(e);break;default:Wu(e)}}function Ku(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];au=r,qu(r,e)}Uu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:yl(8,t,t.return),Ku(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Ku(t));break;default:Ku(t)}e=e.sibling}}function qu(e,t){for(;au!==null;){var n=au;switch(n.tag){case 0:case 11:case 15:yl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:ka(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,au=r;else a:for(n=e;au!==null;){r=au;var i=r.sibling,a=r.return;if(hu(r),r===n){au=null;break a}if(i!==null){i.return=a,au=i;break a}au=a}}}var Ju={getCacheForType:function(e){var t=xa(Da),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return xa(Da).controller.signal}},Yu=typeof WeakMap==`function`?WeakMap:Map,Xu=0,Zu=null,X=null,Z=0,Qu=0,Q=null,$u=!1,ed=!1,td=!1,nd=0,rd=0,id=0,ad=0,od=0,sd=0,cd=0,ld=null,ud=null,dd=!1,fd=0,pd=0,md=1/0,hd=null,gd=null,_d=0,vd=null,yd=null,bd=0,xd=0,Sd=null,Cd=null,wd=null,Td=null,Ed=null,Dd=0,Od=null;function kd(){return Xu&2&&Z!==0?Z&-Z:L.T===null?gt():Nf()}function Ad(){if(sd===0){if(!(Z&536870912)||W){var e=et;et<<=1,!(et&3932160)&&(et=262144),sd=e}else sd=536870912}return e=Do.current,e!==null&&(e.flags|=32),sd}function jd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Pp(mi(e.memoizedProps,n))),Td===null&&(Td=[]),Td.push(t.bind(null,r))}}function Md(e,t,n){(e===Zu&&(Qu===2||Qu===9)||e.cancelPendingCommit!==null)&&(zd(e,0),Id(e,Z,sd,!1)),lt(e,n),Xu&2&&e===Zu||(e===Zu&&(!(Xu&2)&&(ad|=n),rd===4&&Id(e,Z,sd,!1)),Tf(e))}function Nd(e,t,n){if(Xu&6)throw Error(o(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||it(e,t),i=r?qd(e,t):Gd(e,t,!0),a=r;do{if(i===0){ed&&!r&&Id(e,t,0,!1);break}if(n=e.current.alternate,a&&!Fd(n))i=Gd(e,t,!1),a=!1;else{if(i===2){if(a=t,e.errorRecoveryDisabledLanes&a)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;i=ld;var l=c.current.memoizedState.isDehydrated;if(l&&(zd(c,s).flags|=256),s=Gd(c,s,!1),s!==2&&s!==6){if(td&&!l){c.errorRecoveryDisabledLanes|=a,ad|=a,i=4;break a}a=ud,ud=i,a!==null&&(ud===null?ud=a:ud.push.apply(ud,a))}i=s}if(a=!1,i!==2)continue}}if(i===1){zd(e,0),Id(e,t,0,!0);break}a:{switch(r=e,a=i,a){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Id(r,t,sd,!$u);break a;case 2:ud=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(i=fd+300-Le(),10<i)){if(Id(r,t,sd,!$u),rt(r,0,!0)!==0)break a;bd=t,r.timeoutHandle=gp(Pd.bind(null,r,n,ud,hd,dd,t,sd,ad,cd,$u,a,`Throttled`,-0,0),i);break a}Pd(r,n,ud,hd,dd,t,sd,ad,cd,$u,a,null,-0,0)}break}}while(1);Tf(e)}function Pd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:hn},J=null,Hu(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=nh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?fd-Le():(a&4194048)===a?pd-Le():0,m=eh(d,m),m!==null)?(bd=a,e.cancelPendingCommit=m(ef.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Id(e,a,o,!l)):ef(e,t,a,n,r,i,o,s,c,l,u,d)}function Fd(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Rr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Id(e,t,n,r){t=at(e,t),t&=~od,t&=~ad,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ye(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&dt(e,n,t)}function Ld(){return Xu&6?!0:(Ef(0,!1),!1)}function Rd(){if(X!==null){if(Qu===0)var e=X.return;else e=X,pa=fa=null,ts(e),to=null,no=0,e=X;for(;e!==null;)_l(e.alternate,e),e=e.return;X=null}}function zd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,_p(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),bd=0,Rd(),Zu=e,X=n=ji(e.current,null),Z=t,Qu=0,Q=null,$u=!1,ed=it(e,t),td=!1,cd=sd=od=ad=id=rd=0,ud=ld=null,dd=!1,nd=at(e,t),xi(),n}function Bd(e,t){K=null,L.H=uc,t===Ga||t===qa?(t=$a(),Qu=3):t===Ka?(t=$a(),Qu=4):Qu=t===Oc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Q=t,X===null&&(rd=1,Sc(e,zi(t,e.current)))}function Vd(){var e=Do.current;return e===null?!0:(Z&4194048)===Z?Oo===null:(Z&62914560)===Z||Z&536870912?e===Oo:!1}function Hd(){var e=L.H;return L.H=uc,e===null?uc:e}function Ud(){var e=L.A;return L.A=Ju,e}function Wd(){rd=4,$u||(Z&4194048)!==Z&&Do.current!==null||(ed=!0),!(id&134217727)&&!(ad&134217727)||Zu===null||Id(Zu,Z,sd,!1)}function Gd(e,t,n){var r=Xu;Xu|=2;var i=Hd(),a=Ud();(Zu!==e||Z!==t)&&(hd=null,zd(e,t)),t=!1;var o=rd;a:do try{if(Qu!==0&&X!==null){var s=X,c=Q;switch(Qu){case 8:Rd(),o=6;break a;case 3:case 2:case 9:case 6:Do.current===null&&(t=!0);var l=Qu;if(Qu=0,Q=null,Zd(e,s,c,l),n&&ed){o=0;break a}break;default:l=Qu,Qu=0,Q=null,Zd(e,s,c,l)}}Kd(),o=rd;break}catch(t){Bd(e,t)}while(1);return t&&e.shellSuspendCounter++,pa=fa=null,Xu=r,L.H=i,L.A=a,X===null&&(Zu=null,Z=0,xi()),o}function Kd(){for(;X!==null;)Yd(X)}function qd(e,t){var n=Xu;Xu|=2;var r=Hd(),i=Ud();Zu!==e||Z!==t?(hd=null,md=Le()+500,zd(e,t)):ed=it(e,t);a:do try{if(Qu!==0&&X!==null){t=X;var a=Q;b:switch(Qu){case 1:Qu=0,Q=null,Zd(e,t,a,1);break;case 2:case 9:if(Ya(a)){Qu=0,Q=null,Xd(t);break}t=function(){Qu!==2&&Qu!==9||Zu!==e||(Qu=7),Tf(e)},a.then(t,t);break a;case 3:Qu=7;break a;case 4:Qu=5;break a;case 7:Ya(a)?(Qu=0,Q=null,Xd(t)):(Qu=0,Q=null,Zd(e,t,a,7));break;case 5:var s=null;switch(X.tag){case 26:s=X.memoizedState;case 5:case 27:var c=X;if(s?Ym(s):c.stateNode.complete){Qu=0,Q=null;var l=c.sibling;if(l!==null)X=l;else{var u=c.return;u===null?X=null:(X=u,Qd(u))}break b}}Qu=0,Q=null,Zd(e,t,a,5);break;case 6:Qu=0,Q=null,Zd(e,t,a,6);break;case 8:Rd(),rd=6;break a;default:throw Error(o(462))}}Jd();break}catch(t){Bd(e,t)}while(1);return pa=fa=null,L.H=r,L.A=i,Xu=n,X===null?(Zu=null,Z=0,xi(),rd):0}function Jd(){for(;X!==null&&!Fe();)Yd(X)}function Yd(e){var t=cl(e.alternate,e,nd);e.memoizedProps=e.pendingProps,t===null?Qd(e):X=t}function Xd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Hc(n,t,t.pendingProps,t.type,void 0,Z);break;case 11:t=Hc(n,t,t.pendingProps,t.type.render,t.ref,Z);break;case 5:ts(t);var r=t;r===$i&&(W?(oa(r),r.tag===5&&r.stateNode!=null&&(ea=r.stateNode)):(oa(r),W=!0));default:_l(n,t),t=X=Mi(t,nd),t=cl(n,t,nd)}e.memoizedProps=e.pendingProps,t===null?Qd(e):X=t}function Zd(e,t,n,r){pa=fa=null,ts(t),to=null,no=0;var i=t.return;try{if(Dc(e,i,t,n,Z)){rd=1,Sc(e,zi(n,e.current)),X=null;return}}catch(t){if(i!==null)throw X=i,t;rd=1,Sc(e,zi(n,e.current)),X=null;return}t.flags&32768?(W||r===1?e=!0:ed||Z&536870912?e=!1:($u=e=!0,(r===2||r===9||r===3||r===6)&&(r=Do.current,r!==null&&r.tag===13&&(r.flags|=16384))),$d(t,e)):Qd(t)}function Qd(e){var t=e;do{if(t.flags&32768){$d(t,$u);return}e=t.return;var n=hl(t.alternate,t,nd);if(n!==null){X=n;return}if(t=t.sibling,t!==null){X=t;return}X=t=e}while(t!==null);rd===0&&(rd=5)}function $d(e,t){do{var n=gl(e.alternate,e);if(n!==null){n.flags&=32767,X=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){X=e;return}X=e=n}while(e!==null);rd=6,X=null}function ef(e,t,n,r,i,a,s,c,l,u,d,f){e.cancelPendingCommit=null;do lf();while(_d!==0);if(Xu&6)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));e===Zu&&(X=Zu=null,Z=0),yd=t,vd=e,bd=n,Sd=i,Cd=r,tf(e,t,n,s,c,l,f)}}function tf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(xd=s,s|=bi,ut(e,n,s,r,i,a),Td=null,(n&335544064)===n?(Ed=Ma(e),r=10262):(Ed=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,vf(Ve,function(){return uf(),null})):(e.callbackNode=null,e.callbackPriority=0),Il=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=L.T,L.T=null,i=R.p,R.p=2,a=Xu,Xu|=4;try{lu(e,t,n)}finally{Xu=a,R.p=i,L.T=r}}_d=1,Il?wd=Mp(o,e.containerInfo,Ed,af,of,rf,sf,uf,nf,null,null):(af(),of(),sf())}function nf(e){if(_d!==0){var t=vd.onRecoverableError;t(e,{componentStack:null})}}function rf(){_d===3&&(_d=0,Au(yd,vd),_d=4)}function af(){if(_d===1){_d=0;var e=vd,t=yd,n=bd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=L.T,L.T=null;var i=R.p;R.p=2;var a=Xu;Xu|=4;try{Y=su=!1,Eu(t,e,n),n=cp;var o=Wr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Ur(s.ownerDocument.documentElement,s)){if(c!==null&&Gr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Hr(s,h),v=Hr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}gh=!!sp,cp=sp=null}finally{Xu=a,R.p=i,L.T=r}}e.current=t,_d=2}}function of(){if(_d===2){_d=0;var e=vd,t=yd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=L.T,L.T=null;var r=R.p;R.p=2;var i=Xu;Xu|=4;try{du(e,t.alternate,t)}finally{Xu=i,R.p=r,L.T=n}}_d=3}}function sf(){if(_d===4||_d===3){_d=0;var e=wd;wd=null,Ie();var t=vd,n=yd,r=bd,i=Cd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?_d=5:(_d=0,yd=vd=null,cf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(gd=null),ht(r),n=n.stateNode,qe&&typeof qe.onCommitFiberRoot==`function`)try{qe.onCommitFiberRoot(Ke,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=L.T,a=R.p,R.p=2,L.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{L.T=n,R.p=a}}if(i=Td,o=Ed,Ed=null,i!==null&&(Td=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);bd&3&&lf(),Tf(t),a=t.pendingLanes,r&261930&&a&42?t===Od?Dd++:(Dd=0,Od=t):(Dd=0,Od=null),Ef(0,!1)}}function cf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ka(t)))}function lf(){return wd!==null&&(wd.skipTransition(),wd=null),af(),of(),sf(),uf()}function uf(){if(_d!==5)return!1;var e=vd,t=xd;xd=0;var n=ht(bd),r=L.T,i=R.p;try{R.p=32>n?32:n,L.T=null,n=Sd,Sd=null;var a=vd,s=bd;if(_d=0,yd=vd=null,bd=0,Xu&6)throw Error(o(331));var c=Xu;if(Xu|=4,Gu(a.current),Lu(a,a.current,s,n),Xu=c,Ef(0,!1),qe&&typeof qe.onPostCommitFiberRoot==`function`)try{qe.onPostCommitFiberRoot(Ke,a)}catch{}return!0}finally{R.p=i,L.T=r,cf(e,t)}}function df(e,t,n){t=zi(n,t),t=wc(e.stateNode,t,2),e=mo(e,t,2),e!==null&&(lt(e,2),Tf(e))}function ff(e,t,n){if(e.tag===3)df(e,e,n);else for(;t!==null;){if(t.tag===3){df(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(gd===null||!gd.has(r))){e=zi(n,e),n=Tc(2),r=mo(t,n,2),r!==null&&(Ec(n,r,t,e),lt(r,2),Tf(r));break}}t=t.return}}function pf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Yu;var i=/* @__PURE__ */ new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=/* @__PURE__ */ new Set,r.set(t,i));i.has(n)||(td=!0,i.add(n),e=mf.bind(null,e,t,n),t.then(e,e))}function mf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Zu===e&&(Z&n)===n&&(rd===4||rd===3&&(Z&62914560)===Z&&300>Le()-fd?Xu&2?od|=n:zd(e,0):od|=n,cd===Z&&(cd=0)),Tf(e)}function hf(e,t){t===0&&(t=st()),e=wi(e,t),e!==null&&(lt(e,t),Tf(e))}function gf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),hf(e,n)}function _f(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(o(314))}r!==null&&r.delete(t),hf(e,n)}function vf(e,t){return Ne(e,t)}var yf=null,bf=null,xf=!1,Sf=!1,Cf=!1,wf=0;function Tf(e){e!==bf&&e.next===null&&(bf===null?yf=bf=e:bf=bf.next=e),Sf=!0,xf||(xf=!0,Mf())}function Ef(e,t){if(!Cf&&Sf){Cf=!0;do for(var n=!1,r=yf;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Ye(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,jf(r,a))}else a=Z,a=rt(r,r===Zu?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||it(r,a)||(n=!0,jf(r,a))}r=r.next}while(n);Cf=!1}}function Df(){Of()}function Of(){Sf=xf=!1;var e=0;wf!==0&&hp()&&(e=wf);for(var t=Le(),n=null,r=yf;r!==null;){var i=r.next,a=kf(r,t);a===0?(r.next=null,n===null?yf=i:n.next=i,i===null&&(bf=n)):(n=r,(e!==0||a&3)&&(Sf=!0)),r=i}_d!==0&&_d!==5||Ef(e,!1),wf!==0&&(wf=0)}function kf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ye(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=ot(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Zu,n=Z,n=rt(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Qu===2||Qu===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Pe(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||it(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Pe(r),ht(n)){case 2:case 8:n=Be;break;case 32:n=Ve;break;case 268435456:n=Ue;break;default:n=Ve}return r=Af.bind(null,e),n=Ne(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Pe(r),e.callbackPriority=2,e.callbackNode=null,2}function Af(e,t){if(_d!==0&&_d!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(lf()&&e.callbackNode!==n)return null;var r=Z;return r=rt(e,e===Zu?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Nd(e,r,t),kf(e,Le()),e.callbackNode!=null&&e.callbackNode===n?Af.bind(null,e):null)}function jf(e,t){if(lf())return null;Nd(e,t,!0)}function Mf(){bp(function(){Xu&6?Ne(ze,Df):Of()})}function Nf(){if(wf===0){var e=Fa;e===0&&(e=$e,$e<<=1,!($e&261888)&&($e=256)),wf=e}return wf}function Pf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:mn(e)}function Ff(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Pf((i[bt]||null).action),o=r.submitter;o&&(t=(t=o[bt]||null)?Pf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new In(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(wf!==0){var e=new FormData(i,o);Xs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),Xs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var If=0;If<di.length;If++){var Lf=di[If];fi(Lf.toLowerCase(),`on`+(Lf[0].toUpperCase()+Lf.slice(1)))}fi(ri,`onAnimationEnd`),fi(ii,`onAnimationIteration`),fi(ai,`onAnimationStart`),fi(`dblclick`,`onDoubleClick`),fi(`focusin`,`onFocus`),fi(`focusout`,`onBlur`),fi(oi,`onTransitionRun`),fi(si,`onTransitionStart`),fi(ci,`onTransitionCancel`),fi(li,`onTransitionEnd`),Rt(`onMouseEnter`,[`mouseout`,`mouseover`]),Rt(`onMouseLeave`,[`mouseout`,`mouseover`]),Rt(`onPointerEnter`,[`pointerout`,`pointerover`]),Rt(`onPointerLeave`,[`pointerout`,`pointerover`]),Lt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Lt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Lt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Lt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Lt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Lt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Rf=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),zf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Rf));function Bf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){_i(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){_i(e)}i.currentTarget=null,a=c}}}}function $(e,t){var n=t[St];n===void 0&&(n=t[St]=/* @__PURE__ */ new Set);var r=e+`__bubble`;n.has(r)||(Wf(t,e,2,!1),n.add(r))}function Vf(e,t,n){var r=0;t&&(r|=4),Wf(n,e,r,t)}var Hf=`_reactListening`+Math.random().toString(36).slice(2);function Uf(e){if(!e[Hf]){e[Hf]=!0,Ft.forEach(function(t){t!==`selectionchange`&&(zf.has(t)||Vf(t,!1,e),Vf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Hf]||(t[Hf]=!0,Vf(`selectionchange`,!1,t))}}function Wf(e,t,n,r){switch(Ch(t)){case 2:var i=_h;break;case 8:i=vh;break;default:i=yh}n=i.bind(null,t,n,e),i=void 0,!Tn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Gf(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;s!==null;){if(o=kt(s),o===null)return;if(c=o.tag,c===5||c===6||c===26||c===27){r=a=o;continue a}s=s.parentNode}}r=r.return}Sn(function(){var r=a,i=_n(n),o=[];a:{var s=ui.get(e);if(s!==void 0){var c=In,u=e;switch(e){case`keypress`:if(jn(n)===0)break a;case`keydown`:case`keyup`:c=er;break;case`focusin`:u=`focus`,c=Gn;break;case`focusout`:u=`blur`,c=Gn;break;case`beforeblur`:case`afterblur`:c=Gn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:c=Un;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:c=Wn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:c=rr;break;case ri:case ii:case ai:c=Kn;break;case li:c=ir;break;case`scroll`:case`scrollend`:c=Rn;break;case`wheel`:c=ar;break;case`copy`:case`cut`:case`paste`:c=qn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:c=tr;break;case`submit`:c=nr;break;case`toggle`:case`beforetoggle`:c=or}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?s===null?null:s+`Capture`:s;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=Cn(m,p),g!=null&&d.push(Kf(m,g,h))),f)break;m=m.return}0<d.length&&(s=new c(s,u,null,n,i),o.push({event:s,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,s=e===`mouseout`||e===`pointerout`,c&&n!==gn&&(u=n.relatedTarget||n.fromElement)&&(kt(u)||u[xt]))break a;(s||c)&&(u=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,s?(c=n.relatedTarget||n.toElement,s=r,c=c?kt(c):null,c!==null&&(f=l(c),d=c.tag,c!==f||d!==5&&d!==27&&d!==6)&&(c=null)):(s=null,c=r),s!==c&&(d=Un,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=tr,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=s==null?u:jt(s),h=c==null?u:jt(c),u=new d(g,m+`leave`,s,n,i),u.target=f,u.relatedTarget=h,g=null,kt(i)===r&&(d=new d(p,m+`enter`,c,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=s&&c?E(s,c,Jf):null,s!==null&&Yf(o,u,s,d,!1),c!==null&&f!==null&&Yf(o,f,c,d,!0)))}a:{if(s=r?jt(r):window,c=s.nodeName&&s.nodeName.toLowerCase(),c===`select`||c===`input`&&s.type===`file`)var _=Er;else if(br(s)){if(Dr)_=Ir;else{_=Pr;var v=Nr}}else c=s.nodeName,!c||c.toLowerCase()!==`input`||s.type!==`checkbox`&&s.type!==`radio`?r&&dn(r.elementType)&&(_=Er):_=Fr;if(_&&=_(e,r)){xr(o,_,n,i);break a}v&&v(e,s,r)}switch(v=r?jt(r):window,e){case`focusin`:(br(v)||v.contentEditable===`true`)&&(qr=v,Jr=r,Yr=null);break;case`focusout`:Yr=Jr=qr=null;break;case`mousedown`:Xr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Xr=!1,Zr(o,n,i);break;case`selectionchange`:if(Kr)break;case`keydown`:case`keyup`:Zr(o,n,i)}var y;if(cr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else gr?mr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(dr&&n.locale!==`ko`&&(gr||b!==`onCompositionStart`?b===`onCompositionEnd`&&gr&&(y=An()):(Dn=i,On=`value`in Dn?Dn.value:Dn.textContent,gr=!0)),v=qf(r,b),0<v.length&&(b=new Jn(b,e,null,n,i),o.push({event:b,listeners:v}),y?b.data=y:(y=hr(n),y!==null&&(b.data=y)))),(y=ur?_r(e,n):vr(e,n))&&(b=qf(r,`onBeforeInput`),0<b.length&&(v=new Jn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:v,listeners:b}),v.data=y)),Ff(o,e,r,n,i)}Bf(o,t)})}function Kf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function qf(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=Cn(e,n),i!=null&&r.unshift(Kf(e,i,a)),i=Cn(e,t),i!=null&&r.push(Kf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Jf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Yf(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=Cn(n,a),l!=null&&o.unshift(Kf(n,l,c))):i||(l=Cn(n,a),l!=null&&o.push(Kf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Xf=/\r\n?/g,Zf=/\u0000|\uFFFD/g;function Qf(e){return(typeof e==`string`?e:``+e).replace(Xf,`
9
- `).replace(Zf,``)}function $f(e,t){return t=Qf(t),Qf(e)===t}function ep(e,t,n,r,i,a){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||sn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&sn(e,``+r);else return;break;case`className`:Gt(e,`class`,r);break;case`tabIndex`:Gt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Gt(e,n,r);break;case`style`:un(e,r,a);return;case`data`:if(t!==`object`){Gt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=mn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof a==`function`&&(n===`formAction`?(t!==`input`&&ep(e,t,`name`,i.name,i,null),ep(e,t,`formEncType`,i.formEncType,i,null),ep(e,t,`formMethod`,i.formMethod,i,null),ep(e,t,`formTarget`,i.formTarget,i,null)):(ep(e,t,`encType`,i.encType,i,null),ep(e,t,`method`,i.method,i,null),ep(e,t,`target`,i.target,i,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=mn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=hn);return;case`onScroll`:r!=null&&$(`scroll`,e);return;case`onScrollEnd`:r!=null&&$(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(o(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(o(60));a?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=mn(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:$(`beforetoggle`,e),$(`toggle`,e),Wt(e,`popover`,r);break;case`xlinkActuate`:Kt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Kt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Kt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Kt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Kt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Kt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Wt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=fn.get(n)||n,Wt(e,n,r);else return}H=!0}function tp(e,t,n,r,i,a){switch(n){case`style`:un(e,r,a);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(o(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(o(60));a?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)sn(e,r);else if(typeof r==`number`||typeof r==`bigint`)sn(e,``+r);else return;break;case`onScroll`:r!=null&&$(`scroll`,e);return;case`onScrollEnd`:r!=null&&$(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=hn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!It.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),a=n.slice(2,i?n.length-7:void 0),t=e[bt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(a,t,i),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(a,r,i);break a}H=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Wt(e,n,r)}return}H=!0}function np(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:$(`error`,e),$(`load`,e);var r=!1,i=!1,a;for(a in n)if(n.hasOwnProperty(a)){var s=n[a];if(s!=null)switch(a){case`src`:r=!0;break;case`srcSet`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(o(137,t));default:ep(e,t,a,s,n,null)}}i&&ep(e,t,`srcSet`,n.srcSet,n,null),r&&ep(e,t,`src`,n.src,n,null);return;case`input`:$(`invalid`,e);var c=a=s=i=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:i=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:a=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(o(137,t));break;default:ep(e,t,r,d,n,null)}}tn(e,a,c,l,u,s,i,!1);return;case`select`:for(i in $(`invalid`,e),r=s=a=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:a=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:ep(e,t,i,c,n,null)}t=a,n=s,e.multiple=!!r,t==null?n!=null&&rn(e,!!r,n,!0):rn(e,!!r,t,!1);return;case`textarea`:for(s in $(`invalid`,e),a=i=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:a=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(o(91));break;default:ep(e,t,s,c,n,null)}on(e,r,i,a);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:ep(e,t,l,r,n,null)}return;case`dialog`:$(`beforetoggle`,e),$(`toggle`,e),$(`cancel`,e),$(`close`,e);break;case`iframe`:case`object`:$(`load`,e);break;case`video`:case`audio`:for(r=0;r<Rf.length;r++)$(Rf[r],e);break;case`image`:$(`error`,e),$(`load`,e);break;case`details`:$(`toggle`,e);break;case`embed`:case`source`:case`link`:$(`error`,e),$(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(o(137,t));default:ep(e,t,u,r,n,null)}return;default:if(dn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&tp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&ep(e,t,c,r,n,null))}var rp={};function ip(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var i=null,a=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||ep(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(H=!0),a=m;break;case`name`:m!==f&&(H=!0),i=m;break;case`checked`:m!==f&&(H=!0),u=m;break;case`defaultChecked`:m!==f&&(H=!0),d=m;break;case`value`:m!==f&&(H=!0),s=m;break;case`defaultValue`:m!==f&&(H=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(o(137,t));break;default:m!==f&&ep(e,t,p,m,r,f)}}en(e,s,c,l,u,d,a,i);return;case`select`:for(a in m=s=c=p=null,n)if(l=n[a],n.hasOwnProperty(a)&&l!=null)switch(a){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(a)||ep(e,t,a,null,r,l)}for(i in r)if(a=r[i],l=n[i],r.hasOwnProperty(i)&&(a!=null||l!=null))switch(i){case`value`:a!==l&&(H=!0),p=a;break;case`defaultValue`:a!==l&&(H=!0),c=a;break;case`multiple`:a!==l&&(H=!0),s=a;default:a!==l&&ep(e,t,i,a,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?rn(e,!!n,n?[]:``,!1):rn(e,!!n,t,!0)):rn(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:ep(e,t,c,null,r,i)}for(s in r)if(i=r[s],a=n[s],r.hasOwnProperty(s)&&(i!=null||a!=null))switch(s){case`value`:i!==a&&(H=!0),p=i;break;case`defaultValue`:i!==a&&(H=!0),m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(o(91));break;default:i!==a&&ep(e,t,s,i,r,a)}an(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:ep(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(H=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:ep(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&ep(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(o(137,t));break;default:ep(e,t,u,p,r,m)}return;default:if(dn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&tp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||tp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&ep(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||ep(e,t,f,p,r,m)}function ap(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function op(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&ap(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&ap(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var sp=null,cp=null;function lp(e){return e.nodeType===9?e:e.ownerDocument}function up(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function dp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function fp(e,t,n,r){return n=lp(n).createElement(e),n[yt]=r,n[bt]=t,np(n,e,t),Nt(n),n}function pp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var mp=null;function hp(){var e=window.event;return e&&e.type===`popstate`?e!==mp&&(mp=e,!0):(mp=null,!1)}var gp=typeof setTimeout==`function`?setTimeout:void 0,_p=typeof clearTimeout==`function`?clearTimeout:void 0,vp=typeof Promise==`function`?Promise:void 0,yp=typeof requestAnimationFrame==`function`?requestAnimationFrame:gp,bp=typeof queueMicrotask==`function`?queueMicrotask:vp===void 0?gp:function(e){return vp.resolve(null).then(e).catch(xp)};function xp(e){setTimeout(function(){throw e})}function Sp(e){return e===`head`}function Cp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Hh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)_m(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,_m(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Et]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&_m(e.ownerDocument.body)}n=i}while(n);Hh(t)}function wp(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Tp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Ep(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Dp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Op(e){return Dp(e.getBoundingClientRect(),getComputedStyle(e),e)}function kp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Dp(t,n,e)}function Ap(e){return e.documentElement.clientHeight}function jp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Mp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Ap(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=Xm(f),u>$m){s.length=o;break}f=new Promise(jp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Np(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Np.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Np.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Np.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Pp(e){return{name:e,group:new Np(`group`,e),imagePair:new Np(`image-pair`,e),old:new Np(`old`,e),new:new Np(`new`,e)}}function Fp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Fp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Bp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Rp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),h(this._fragmentFiber.child,!1,Ip,e,s,r)}this._eventListeners=a}};function Ip(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Fp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Bp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Rp(i.optionsOrUseCapture),h(this._fragmentFiber.child,!1,Lp,e,n,i),r.splice(t,1),a!==null&&a()}};function Lp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Rp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function zp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Bp(e,t,n,r){if(e.length===0)return-1;r=zp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&zp(a.optionsOrUseCapture)===r)return i}return-1}Fp.prototype.dispatchEvent=function(e){var t=g(this._fragmentFiber);if(t===null)return!0;t=b(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Fp.prototype.focus=function(e){h(this._fragmentFiber.child,!0,Vp,e,void 0,void 0)};function Vp(e,t){return e.tag!==6&&(e=b(e),pm(e,t))}Fp.prototype.focusLast=function(e){var t=[];h(this._fragmentFiber.child,!0,Hp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Vp(t[n],e);n--);};function Hp(e,t){return t.push(e),!1}Fp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=lp(e).activeElement,e!==null&&h(this._fragmentFiber.child,!1,Up,e,void 0,void 0))};function Up(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Fp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=/* @__PURE__ */ new Set),this._observers.add(e),h(this._fragmentFiber.child,!1,Wp,e,void 0,void 0)};function Wp(e,t){return e.tag===6||(e=b(e),t.observe(e)),!1}Fp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),h(this._fragmentFiber.child,!1,Gp,e,void 0,void 0);for(var n=t=0;n<Kp.length;n++){var r=Kp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Kp[t++]=r}Kp.length=t}};function Gp(e,t){return e.tag===6||(e=b(e),t.unobserve(e)),!1}var Kp=[],qp=!1;function Jp(e,t,n){Kp.push({fragmentInstance:e,observer:t,instance:n}),qp||(qp=!0,mm(function(){qp=!1;var e=Kp;Kp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Fp.prototype.getClientRects=function(){var e=[];return h(this._fragmentFiber.child,!1,Yp,e,void 0,void 0),e};function Yp(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=b(e),t.push.apply(t,e.getClientRects());return!1}Fp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Fp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];h(this._fragmentFiber.child,!1,Hp,n,void 0,void 0);var r=b(t);if(n.length===0){if(n=r,_(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=v(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=b(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=b(n[0]),i=b(n[n.length-1]);var a=_(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Xp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Xp(e,t,n,r,i){var a=kt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=g(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=E(n,a,T),t===null?t=!1:(h(t,!0,C,a,n),a=x,x=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=E(r,a,T),t===null?t=!1:(h(t,!0,w,a,r),a=x,S=x=null,t=a!==null)),t):!1}function Zp(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Fp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(o(566));var t=[];h(this._fragmentFiber.child,!1,Hp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=v(this._fragmentFiber);if(r=n?r[1]||r[0]||g(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=b(r),Zp(e,n);return}if(r=b(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var i=t[r];i.tag===6?(i=b(i),Zp(i,n)):b(i).scrollIntoView(e),r+=n?-1:1}};function Qp(e,t){return e=b(e),$p(e,t),!1}function $p(e,t){e.reactFragments??=/* @__PURE__ */ new Set,e.reactFragments.add(t)}function em(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Kp.length;i++){var a=Kp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Kp[r++]=a)}Kp.length=r,n.observe(e)}),$p(e,t))}function tm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Jp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function nm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:nm(n),Ot(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function rm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[Et])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=lm(e.nextSibling),e===null)break}return null}function im(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=lm(e.nextSibling),e===null))return null;return e}function am(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=lm(e.nextSibling),e===null))return null;return e}function om(e){return e.data===`$?`||e.data===`$~`}function sm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function cm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function lm(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var um=null;function dm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return lm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function fm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function pm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function mm(e){yp(function(){yp(function(t){return e(t)})})}function hm(e,t,n){switch(t=lp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(o(452));return e;case`head`:if(e=t.head,!e)throw Error(o(453));return e;case`body`:if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function gm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&ep(e,t,r,null,rp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===hn&&(e.onclick=null),Ot(e)}function _m(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ot(e)}var vm=/* @__PURE__ */ new Map,ym=/* @__PURE__ */ new Set;function bm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var xm=R.d;R.d={f:Sm,r:Cm,D:Em,C:Dm,L:Om,m:km,X:jm,S:Am,M:Mm};function Sm(){var e=xm.f(),t=Ld();return e||t}function Cm(e){var t=At(e);t!==null&&t.tag===5&&t.type===`form`?Qs(t):xm.r(e)}var wm=typeof document>`u`?null:document;function Tm(e,t,n){var r=wm;if(r&&typeof t==`string`&&t){var i=$t(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),ym.has(i)||(ym.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),np(t,`link`,e),Nt(t),r.head.appendChild(t)))}}function Em(e){xm.D(e),Tm(`dns-prefetch`,e,null)}function Dm(e,t){xm.C(e,t),Tm(`preconnect`,e,t)}function Om(e,t,n){xm.L(e,t,n);var r=wm;if(r&&e&&t){var i=`link[rel="preload"][as="`+$t(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+$t(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+$t(n.imageSizes)+`"]`)):i+=`[href="`+$t(e)+`"]`;var a=i;switch(t){case`style`:a=Pm(e);break;case`script`:a=Rm(e)}if(!(vm.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),vm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Fm(a))||t===`script`&&r.querySelector(zm(a))))){var o=r.createElement(`link`);np(o,`link`,e),t===`style`&&(o[Dt]=!0,o.onload=o.onerror=function(){Pt(o)}),Nt(o),r.head.appendChild(o)}}}function km(e,t){xm.m(e,t);var n=wm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+$t(r)+`"][href="`+$t(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Rm(e)}if(!vm.has(a)&&(e=D({rel:`modulepreload`,href:e},t),vm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(zm(a)))return}r=n.createElement(`link`),np(r,`link`,e),Nt(r),n.head.appendChild(r)}}}function Am(e,t,n){xm.S(e,t,n);var r=wm;if(r&&e){var i=Mt(r).hoistableStyles,a=Pm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Fm(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=vm.get(a))&&Hm(e,n);var c=o=r.createElement(`link`);Nt(c),np(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Vm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function jm(e,t){xm.X(e,t);var n=wm;if(n&&e){var r=Mt(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=D({src:e,async:!0},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Nt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mm(e,t){xm.M(e,t);var n=wm;if(n&&e){var r=Mt(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Nt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t,n,r){var i=(i=xe.current)?bm(i):null;if(!i)throw Error(o(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Pm(n.href),t=Mt(i).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Pm(n.href);var a=Mt(i).hoistableStyles,s=a.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},a.set(e,s),(a=i.querySelector(Fm(e)))?a._p||(s.instance=a,s.state.loading=5):(a=vm.get(e),a||(a={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},vm.set(e,a)),Lm(i,e,a,s.state))),t&&r===null)throw Error(o(528,``));return s}if(t&&r!==null)throw Error(o(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Rm(n),t=Mt(i).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Pm(e){return`href="`+$t(e)+`"`}function Fm(e){return`link[rel="stylesheet"][`+e+`]`}function Im(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Lm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Dt]){r.loading=1;return}}else t=e.createElement(`link`),t[Dt]=!0,t.onload=t.onerror=Pt.bind(null,t),np(t,`link`,n),Nt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Rm(e){return`[src="`+$t(e)+`"]`}function zm(e){return`script[async]`+e}function Bm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+$t(n.href)+`"]`);if(r)return t.instance=r,Nt(r),r;var i=D({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Nt(r),np(r,`style`,i),Vm(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Pm(n.href);var a=e.querySelector(Fm(i));if(a)return t.state.loading|=4,t.instance=a,Nt(a),a;r=Im(n),(i=vm.get(i))&&Hm(r,i),a=(e.ownerDocument||e).createElement(`link`),Nt(a);var s=a;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),np(a,`link`,r),t.state.loading|=4,Vm(a,n.precedence,e),t.instance=a;case`script`:return a=Rm(n.src),(i=e.querySelector(zm(a)))?(t.instance=i,Nt(i),i):(r=n,(i=vm.get(a))&&(r=D({},n),Um(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),Nt(i),np(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(o(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Vm(r,n.precedence,e));return t.instance}function Vm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Hm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Um(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Wm=null;function Gm(e,t,n){if(Wm===null){var r=/* @__PURE__ */ new Map,i=Wm=/* @__PURE__ */ new Map;i.set(n,r)}else i=Wm,r=i.get(n),r||(r=/* @__PURE__ */ new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[Et]||a[yt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Km(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function qm(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Jm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Ym(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Xm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Zm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Xm(t),e.suspenseyImages.push(t)),e=rh.bind(e),t.decode().then(e,e))}function Qm(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Pm(r.href),a=t.querySelector(Fm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=nh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Nt(a);return}a=t.ownerDocument||t,r=Im(r),(i=vm.get(i))&&Hm(r,i),a=a.createElement(`link`),Nt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),np(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=/* @__PURE__ */ new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=nh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var $m=0;function eh(e,t){return e.stylesheets&&e.count===0&&ah(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&$m===0&&($m=62500*op());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>$m?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function th(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ah(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function nh(){this.count--,th(this)}function rh(){this.imgCount--,th(this)}var ih=null;function ah(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ih=/* @__PURE__ */ new Map,t.forEach(oh,e),ih=null,nh.call(e))}function oh(e,t){if(!(t.state.loading&4)){var n=ih.get(e);if(n)var r=n.get(null);else{n=/* @__PURE__ */ new Map,ih.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=nh.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var sh={$$typeof:F,Provider:null,Consumer:null,_currentValue:me,_currentValue2:me,_threadCount:0};function ch(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ct(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ct(0),this.hiddenUpdates=ct(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=/* @__PURE__ */ new Map}function lh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ch(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ki(3,null,null,t),e.current=a,a.stateNode=e,t=Oa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},uo(a),e}function uh(e){return e?(e=Di,e):Di}function dh(e,t,n,r,i,a){i=uh(i),r.context===null?r.context=i:r.pendingContext=i,r=po(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=mo(e,r,t),n!==null&&(Md(n,e,t),ho(n,e,t))}function fh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ph(e,t){fh(e,t),(e=e.alternate)&&fh(e,t)}function mh(e){if(e.tag===13||e.tag===31){var t=wi(e,67108864);t!==null&&Md(t,e,67108864),ph(e,67108864)}}function hh(e){if(e.tag===13||e.tag===31){var t=kd();t=mt(t);var n=wi(e,t);n!==null&&Md(n,e,t),ph(e,t)}}var gh=!0;function _h(e,t,n,r){var i=L.T;L.T=null;var a=R.p;try{R.p=2,yh(e,t,n,r)}finally{R.p=a,L.T=i}}function vh(e,t,n,r){var i=L.T;L.T=null;var a=R.p;try{R.p=8,yh(e,t,n,r)}finally{R.p=a,L.T=i}}function yh(e,t,n,r){if(gh){var i=bh(r);if(i===null)Gf(e,t,r,xh,n),Mh(e,r);else if(Ph(i,e,t,n,r))r.stopPropagation();else if(Mh(e,r),t&4&&-1<jh.indexOf(e)){for(;i!==null;){var a=At(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=nt(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ye(o);s.entanglements[1]|=c,o&=~c}Tf(a),!(Xu&6)&&(md=Le()+500,Ef(0,!1))}}break;case 31:case 13:s=wi(a,2),s!==null&&Md(s,a,2),Ld(),ph(a,2)}if(a=bh(r),a===null&&Gf(e,t,r,xh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Gf(e,t,r,null,n)}}function bh(e){return e=_n(e),Sh(e)}var xh=null;function Sh(e){if(xh=null,e=kt(e),e!==null){var t=l(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=u(t),e!==null)return e;e=null}else if(n===31){if(e=d(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return xh=e,null}function Ch(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`fullscreenerror`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Re()){case ze:return 2;case Be:return 8;case Ve:case He:return 32;case Ue:return 268435456;default:return 32}default:return 32}}var wh=!1,Th=null,Eh=null,Dh=null,Oh=/* @__PURE__ */ new Map,kh=/* @__PURE__ */ new Map,Ah=[],jh=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Mh(e,t){switch(e){case`focusin`:case`focusout`:Th=null;break;case`dragenter`:case`dragleave`:Eh=null;break;case`mouseover`:case`mouseout`:Dh=null;break;case`pointerover`:case`pointerout`:Oh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:kh.delete(t.pointerId)}}function Nh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=At(t),t!==null&&mh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ph(e,t,n,r,i){switch(t){case`focusin`:return Th=Nh(Th,e,t,n,r,i),!0;case`dragenter`:return Eh=Nh(Eh,e,t,n,r,i),!0;case`mouseover`:return Dh=Nh(Dh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Oh.set(a,Nh(Oh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,kh.set(a,Nh(kh.get(a)||null,e,t,n,r,i)),!0}return!1}function Fh(e){var t=kt(e.target);if(t!==null){var n=l(t);if(n!==null){if(t=n.tag,t===13){if(t=u(n),t!==null){e.blockedOn=t,_t(e.priority,function(){hh(n)});return}}else if(t===31){if(t=d(n),t!==null){e.blockedOn=t,_t(e.priority,function(){hh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ih(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=bh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);gn=r,n.target.dispatchEvent(r),gn=null}else return t=At(n),t!==null&&mh(t),e.blockedOn=n,!1;t.shift()}return!0}function Lh(e,t,n){Ih(e)&&n.delete(t)}function Rh(){wh=!1,Th!==null&&Ih(Th)&&(Th=null),Eh!==null&&Ih(Eh)&&(Eh=null),Dh!==null&&Ih(Dh)&&(Dh=null),Oh.forEach(Lh),kh.forEach(Lh)}function zh(e,n){e.blockedOn===n&&(e.blockedOn=null,wh||(wh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Rh)))}var Bh=null;function Vh(e){Bh!==e&&(Bh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Bh===e&&(Bh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Sh(r||n)===null)continue;break}var a=At(n);a!==null&&(e.splice(t,3),t-=3,Xs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Hh(e){function t(t){return zh(t,e)}Th!==null&&zh(Th,e),Eh!==null&&zh(Eh,e),Dh!==null&&zh(Dh,e),Oh.forEach(t),kh.forEach(t);for(var n=0;n<Ah.length;n++){var r=Ah[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ah.length&&(n=Ah[0],n.blockedOn===null);)Fh(n),n.blockedOn===null&&Ah.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[bt]||null;if(typeof a==`function`)o||Vh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[bt]||null)s=o.formAction;else if(Sh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Vh(n)}}}function Uh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Wh(e){this._internalRoot=e}Gh.prototype.render=Wh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var n=t.current;dh(n,kd(),e,t,null,null)},Gh.prototype.unmount=Wh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;dh(e.current,2,null,e,null,null),Ld(),t[xt]=null}};function Gh(e){this._internalRoot=e}Gh.prototype.unstable_scheduleHydration=function(e){if(e){var t=gt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ah.length&&t!==0&&t<Ah[n].priority;n++);Ah.splice(n,0,e),n===0&&Fh(e)}};var Kh=i.version;if(Kh!==`19.3.1`)throw Error(o(527,Kh,`19.3.1`));R.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(o(188)):(e=Object.keys(e).join(`,`),Error(o(268,e)));return e=p(t),e=e===null?null:m(e),e=e===null?null:e.stateNode,e};var qh={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:L,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Jh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jh.isDisabled&&Jh.supportsFiber)try{Ke=Jh.inject(qh),qe=Jh}catch{}}e.createRoot=function(e,t){if(!c(e))throw Error(o(299));var n=!1,r=``,i=yc,a=bc,s=xc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(a=t.onCaughtError),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=lh(e,1,!1,null,null,n,r,null,i,a,s,Uh),e[xt]=t.current,Uf(e),new Wh(t)}})),Se=/* @__PURE__ */ t(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=xe()})),B=/* @__PURE__ */ e(n(),1),V=a(),Ce=B.createContext(void 0),we=e=>{let t=B.useContext(Ce);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Te=({client:e,children:t})=>(B.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),/* @__PURE__ */ (0,V.jsx)(Ce.Provider,{value:e,children:t})),Ee={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},De=new class{#e=Ee;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function Oe(e){setTimeout(e,0)}var ke=typeof window>`u`||`Deno`in globalThis;function Ae(){}function je(e,t){return typeof e==`function`?e(t):e}function Me(e){return typeof e==`number`&&e>=0&&e!==1/0}function Ne(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Pe(e,t){return typeof e==`function`?e(t):e}function Fe(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==Le(o,t.options))return!1}else if(!ze(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function Ie(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Re(t.options.mutationKey)!==Re(a))return!1}else if(!ze(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Le(e,t){return(t?.queryKeyHashFn||Re)(e)}function Re(e){return JSON.stringify(e,(e,t)=>We(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function ze(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(!ze(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!ze(e[r],t[r]))return!1;return!0}return!1}var Be=Object.prototype.hasOwnProperty;function Ve(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=Ue(e)&&Ue(t);if(!r&&!(We(e)&&We(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:Be.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=Ve(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function He(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function Ue(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function We(e){if(!Ge(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!Ge(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function Ge(e){return Object.prototype.toString.call(e)===`[object Object]`}function Ke(e){return new Promise(t=>{De.setTimeout(t,e)})}function qe(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:Ve(e,t)}function Je(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Ye(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Xe=Symbol();function Ze(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Xe?()=>Promise.reject(/* @__PURE__ */ Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Qe(e,t){return typeof e==`function`?e(...t):!!e}function $e(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0})),i)}),e}var et=()=>ke,tt=()=>et(),nt=class{constructor(){this.listeners=/* @__PURE__ */ new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},rt=new class extends nt{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},it=Oe;function at(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=it,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var ot=at(),st=new class extends nt{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function ct(e){return Math.min(1e3*2**e,3e4)}function lt(e){return(e??`online`)!==`online`||st.isOnline()}var ut=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function dt(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(Ae);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new ut(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>rt.isFocused()&&(e.networkMode===`always`||st.isOnline())&&e.canRun(),p=()=>lt(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=t=>new Promise(n=>{r=e=>{(c()||t())&&n(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(tt()?0:3),a=e.retryDelay??ct,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);t||!s?h(r):(n++,e.onFail?.(n,r),Ke(o).then(()=>f()?void 0:g(f)).then(()=>{t?h(r):_()}))})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g(p).then(_),s)}}var ft=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Me(this.gcTime)&&(this.#e=De.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(tt()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(De.clearTimeout(this.#e),this.#e=void 0)}};function pt(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{$e(e,()=>t.signal,()=>n=!0)},u=Ze(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?Ye:Je;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?ht:mt,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]===void 0?r.initialPageParam:o[0]:mt(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function mt(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function ht(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var gt=class extends ft{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=yt(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=yt(this.options);e.data!==void 0&&(this.setState(vt(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=qe(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(Ae).catch(Ae):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Pe(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Xe||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>Pe(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!Ne(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=Ze(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?pt(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=dt({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof ut&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof ut){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,..._t(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...vt(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),ot.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function _t(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:lt(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function vt(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function yt(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var bt=class extends nt{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=/* @__PURE__ */ new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),St(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ct(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ct(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=/* @__PURE__ */ new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof Pe(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!He(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&wt(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||Pe(this.options.enabled,this.#t)!==Pe(t.enabled,this.#t)||Pe(this.options.staleTime,this.#t)!==Pe(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||Pe(this.options.enabled,this.#t)!==Pe(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return He(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch(t).then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Ae)),t}#h(e){return!tt()&&Pe(this.options.enabled,this.#t)!==!1&&Me(e)}#g(){this.#b();let e=Pe(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=Ne(this.#r.dataUpdatedAt,e)+1;this.#u=De.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return Pe(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=De.setInterval(()=>{(this.options.refetchIntervalInBackground||rt.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(De.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(De.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&St(e,t),o=i&&wt(e,n,t,r);(a||o)&&(l={...l,..._t(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=qe(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=qe(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Tt(e,t),refetch:this.refetch,isEnabled:Pe(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),He(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();ot.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function xt(e,t){return Pe(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||Pe(t.retryOnMount,e)!==!1)}function St(e,t){return xt(e,t)||e.state.data!==void 0&&Ct(e,t,t.refetchOnMount)}function Ct(e,t,n){if(Pe(t.enabled,e)!==!1&&Pe(t.staleTime,e)!==`static`){let r=Pe(n,e);return r===`always`||r!==!1&&Tt(e,t)}return!1}function wt(e,t,n,r){return(e!==t||Pe(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Tt(e,n)}function Tt(e,t){return Pe(t.enabled,e)!==!1&&e.isStaleByTime(Pe(t.staleTime,e))}var Et=class extends ft{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Dt(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=dt({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(/* @__PURE__ */ Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),ot.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Dt(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Ot=class extends nt{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=/* @__PURE__ */ new Set,this.#t=/* @__PURE__ */ new Map,this.#n=0}build(e,t,n){let r=new Et({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=kt(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=kt(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=kt(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=kt(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){ot.batch(()=>{let e=this.getAll();this.#e.clear(),this.#t.clear(),e.forEach(e=>{this.notify({type:`removed`,mutation:e})})})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Ie(t,e))}findAll(e={}){return this.getAll().filter(t=>Ie(e,t))}notify(e){ot.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return ot.batch(()=>Promise.all(e.map(e=>e.continue().catch(Ae))))}};function kt(e){return e.options.scope?.id}var At=class extends nt{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),He(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&Re(t.mutationKey)!==Re(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Dt();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){ot.batch(()=>{let t=this.#r;if(t&&this.hasListeners()){let n=this.#t.variables,r=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{t.onSuccess?.(e.data,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(e.data,null,n,r,i)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{t.onError?.(e.error,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(void 0,e.error,n,r,i)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}};function jt(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}var Mt=class extends nt{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=/* @__PURE__ */ new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,ot.batch(()=>{let e=this.#i,t=this.#p(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!He(e,n)});(o||s)&&(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&(jt(e,n).forEach(e=>{e.destroy()}),jt(n,e).forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#p(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){let n=/* @__PURE__ */ new Set;return t.map((r,i)=>{let a=e[i];return r.defaultedQueryOptions.notifyOnChangeProps?a:r.observer.trackResult(a,e=>{n.has(e)||(n.add(e),t.forEach(t=>{t.observer.trackProp(e)}))})})}#d(e,t,n){if(t){let r=this.#c,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(this.#t!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=Ve(this.#a,t(e))),this.#a}return e}#f(){return!this.#r?.combine||this.#i.some((e,t)=>e.options.suspense&&this.#t[t]?.data===void 0)}#p(e){let t=/* @__PURE__ */ new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new bt(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#m(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=this.#t.slice(),this.#t[n]=t,this.#h())}#h(){if(this.hasListeners()){let e=this.#f(),t=this.#a,n=e?t:this.#d(this.#u(this.#t,this.#l),this.#r?.combine);(e||t!==n)&&ot.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},Nt=class extends nt{#e;constructor(e={}){super(),this.config=e,this.#e=/* @__PURE__ */ new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??Le(r,t),a=this.get(i);return a||(a=new gt({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){ot.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Fe(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>Fe(e,t)):t}notify(e){ot.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){ot.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ot.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Pt=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Nt,this.#t=e.mutationCache||new Ot,this.#n=e.defaultOptions||{},this.#r=/* @__PURE__ */ new Map,this.#i=/* @__PURE__ */ new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=rt.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=st.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Pe(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=je(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return ot.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;ot.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return ot.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=ot.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(Ae).catch(Ae)}invalidateQueries(e,t={}){return ot.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=ot.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(Ae)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(Ae)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(Pe(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(Pe(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ae).catch(Ae)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ae).catch(Ae)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return st.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(Re(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{ze(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(Re(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{ze(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=Le(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===Xe&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Ft=B.createContext(!1),It=()=>B.useContext(Ft);Ft.Provider;function Lt(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Rt=B.createContext(Lt()),zt=()=>B.useContext(Rt),Bt=(e,t,n)=>{let r=n?.state.status===`error`&&typeof e.throwOnError==`function`?Qe(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},Vt=e=>{B.useEffect(()=>{e.clearReset()},[e])},Ht=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Qe(n,[e.error,r])),H=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Ut=(e,t)=>e?.suspense&&t.isPending,Wt=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Gt({queries:e,...t},n){let r=we(n),i=It(),a=zt(),o=t.subscribed!==!1,s=B.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?`isRestoring`:o?`optimistic`:void 0,t}),[e,r,i,o]);s.forEach(e=>{H(e);let t=r.getQueryCache().get(e.queryHash);Bt(e,a,t)}),Vt(a);let[c]=B.useState(()=>new Mt(r,s,t)),[l,u,d]=c.getOptimisticResult(s,t.combine),f=!i&&o;B.useSyncExternalStore(B.useCallback(e=>f?c.subscribe(ot.batchCalls(e)):Ae,[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),B.useEffect(()=>{c.setQueries(s,t)},[s,t,c]);let p=l.some((e,t)=>Ut(s[t],e))?l.flatMap((e,t)=>{let n=s[t];return n&&Ut(n,e)?Wt(n,new bt(r,n),a):[]}):[];if(p.length>0)throw Promise.all(p);let m=l.find((e,t)=>{let n=s[t];return n&&Ht({result:e,errorResetBoundary:a,throwOnError:n.throwOnError,query:r.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(m)throw m.error;return u(d())}function Kt(e,t,n){let r=It(),i=zt(),a=we(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,H(o),Bt(o,i,s),Vt(i);let[l]=B.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(B.useSyncExternalStore(B.useCallback(e=>{let t=d?l.subscribe(ot.batchCalls(e)):Ae;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),B.useEffect(()=>{l.setOptions(o)},[o,l]),Ut(o,u))throw Wt(o,l,i);if(Ht({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function qt(e,t){return Kt(e,bt,t)}function Jt(e,t){let n=we(t),[r]=B.useState(()=>new At(n,e));B.useEffect(()=>{r.setOptions(e)},[r,e]);let i=B.useSyncExternalStore(B.useCallback(e=>r.subscribe(ot.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=B.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(Ae)},[r]);if(i.error&&Qe(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var Yt=Object.defineProperty,Xt=(e,t)=>Yt(e,`name`,{value:t,configurable:!0});// @__NO_SIDE_EFFECTS__
10
- function Zt(e){let t=e+`CollectionProvider`,[n,r]=c(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:/* @__PURE__ */ new Map}),o=/* @__PURE__ */ Xt(e=>{let{scope:t,children:n}=e,r=B.useRef(null),a=B.useRef(/* @__PURE__ */ new Map).current;return/* @__PURE__ */ (0,V.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,u=l(s),d=B.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=a(s,n),o=C(t,i.collectionRef);return/* @__PURE__ */ (0,V.jsx)(u,{ref:o,children:r})});d.displayName=s;let f=e+`CollectionItemSlot`,p=`data-radix-collection-item`,m=l(f),h=B.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=B.useRef(null),s=C(t,o),c=a(f,n);return B.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),/* @__PURE__ */ (0,V.jsx)(m,{[p]:``,ref:s,children:r})});h.displayName=f;function g(t){let n=a(e+`CollectionConsumer`,t);return B.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${p}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return Xt(g,`useCollection`),[{Provider:o,Slot:d,ItemSlot:h},g,r]}Xt(Zt,`createCollection`);var Qt=/* @__PURE__ */ new WeakMap,$t=class e extends Map{static{Xt(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],Qt.set(this,!0)}set(e,t){return Qt.get(this)&&!this.has(e)&&this.#e.push(e),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=r?this.size:this.size+1,a=nn(e),o=a>=0?Math.min(a,i-1):Math.max(i+a,0);if(r?this.#e.indexOf(t)===o:o===this.size)return this.set(t,n),this;let s=this.#e.filter(e=>e!==t);s.splice(o,0,t);let c=s.map(e=>[e,e===t?n:this.get(e)]);this.clear();for(let[e,t]of c)this.set(e,t);return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<r?r-1:r;return this.insert(a,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<=r?r:r+1;return this.insert(a,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=en(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=en(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return en(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=0,a=n;for(let e of this)a=i===0&&!r?e:Reflect.apply(t,this,[a,e,i,this]),i++;return a}reduceRight(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=n;for(let e=this.size-1;e>=0;e--){let n=this.entryAt(e);i=e===this.size-1&&!r?n:Reflect.apply(t,this,[i,n,e,this])}return i}sort(e){if(typeof e!=`function`)throw TypeError(`OrderedDict.sort requires a compare function`);let t=[...this.entries()].sort(e);this.clear();for(let[e,n]of t)this.set(e,n);return this}toSorted(t){if(typeof t!=`function`)throw TypeError(`OrderedDict.toSorted requires a compare function`);let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e;for(let e of this.#e.slice(t,n))r.set(e,this.get(e));return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function en(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=tn(e,t);return n===-1?void 0:e[n]}Xt(en,`at`);function tn(e,t){let n=e.length,r=nn(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}Xt(tn,`toSafeIndex`);function nn(e){return e!==e||e===0?0:Math.trunc(e)}Xt(nn,`toSafeInteger`);// @__NO_SIDE_EFFECTS__
11
- function rn(e){let t=e+`CollectionProvider`,[n,r]=c(t),[i,a]=n(t);i.displayName=e+`CollectionStableContextProvider`;let[o,s]=n(t);o.displayName=e+`CollectionStatefulContextProvider`;let u=/* @__PURE__ */ Xt(({state:e,...t})=>e?/* @__PURE__ */ (0,V.jsx)(p,{...t,state:e}):/* @__PURE__ */ (0,V.jsx)(d,{...t}),`CollectionProvider`);u.displayName=t;let d=/* @__PURE__ */ Xt(e=>{let t=b();return/* @__PURE__ */ (0,V.jsx)(p,{...e,state:t})},`CollectionInit`);d.displayName=e+`CollectionInit`;let p=/* @__PURE__ */ Xt(e=>{let{scope:t,children:n,state:r}=e,a=B.useRef(null),[s,c]=B.useState(null),l=C(a,c),[u,d]=r,f=B.useRef(new $t),p=B.useCallback(()=>{let e=f.current;return sn(e)||e.sort(cn),e},[]);return B.useEffect(()=>{if(!s)return;let e=ln(()=>{d(e=>{let t=e.toSorted(cn);return t.some(([t],n)=>e.keyAt(n)!==t)?t:e})});return e.observe(s,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[s,d]),/* @__PURE__ */ (0,V.jsx)(i,{scope:t,collectionElementRef:l,collectionElementRefObject:a,getCollection:p,setCollection:d,registryRef:f,children:/* @__PURE__ */ (0,V.jsx)(o,{scope:t,collectionElement:s,collection:u,children:n})})},`CollectionProviderImpl`);p.displayName=e+`CollectionProviderImpl`;let m=e+`CollectionSlot`,h=l(m),g=B.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=a(m,n),o=C(t,i.collectionElementRef);return/* @__PURE__ */ (0,V.jsx)(h,{ref:o,children:r})});g.displayName=m;let _=e+`CollectionItemSlot`,v=l(_),y=B.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=B.useRef(null),{setCollection:s,registryRef:c}=a(_,n),l=B.useRef(i);an(l.current,i)||(l.current=i);let u=l.current,d=B.useCallback(e=>{let t=c.current;e?t.set(e,{...l.current,element:e}):o.current&&t.delete(o.current)},[c]),p=C(t,d,o);f(()=>{let e=o.current,t=c.current;e&&t.has(e)&&t.set(e,{...u,element:e})},[u,c]);let m=B.useRef(null);return B.useEffect(()=>{let e=o.current,t=m.current;((t?.element??null)!==e||e&&t?.itemData!==u)&&(m.current=e?{element:e,itemData:u}:null,s(n=>{let r=new $t(n);return t&&t.element!==e&&r.delete(t.element),e&&r.set(e,{...u,element:e}),r.sort(cn)}))}),B.useEffect(()=>()=>{let e=m.current;m.current=null,e&&s(t=>{if(!t.has(e.element))return t;let n=new $t(t);return n.delete(e.element),n})},[s]),/* @__PURE__ */ (0,V.jsx)(v,{"data-radix-collection-item":``,ref:p,children:r})});y.displayName=_;function b(){return B.useState(new $t)}Xt(b,`useInitCollection`);function x(t){let{collection:n}=s(e+`CollectionConsumer`,t);return n}Xt(x,`useCollection`);function S(t){let{getCollection:n}=a(e+`CollectionConsumer`,t);return n}return Xt(S,`useGetCollection`),[{Provider:u,Slot:g,ItemSlot:y},{createCollectionScope:r,useCollection:x,useGetCollection:S,useInitCollection:b}]}Xt(rn,`createCollection`);function an(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}Xt(an,`shallowEqual`);function on(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Xt(on,`isElementPreceding`);function sn(e){let t;for(let n of e.keys()){if(t){let e=t.compareDocumentPosition(n);if(!(e&Node.DOCUMENT_POSITION_DISCONNECTED)&&e&Node.DOCUMENT_POSITION_PRECEDING)return!1}t=n}return!0}Xt(sn,`isInDocumentOrder`);function cn(e,t){return!e[1].element||!t[1].element?0:on(e[1].element,t[1].element)?-1:1}Xt(cn,`sortByDocumentPosition`);function ln(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}Xt(ln,`getChildListObserver`);var un=Object.defineProperty,dn=(e,t)=>un(e,`name`,{value:t,configurable:!0}),fn={LTR:`ltr`,RTL:`rtl`},pn=B.createContext(void 0);function mn(e){let t=B.useContext(pn);return e||t||fn.LTR}dn(mn,`useDirection`);var hn=/* @__PURE__ */ e(s(),1),gn=/* @__PURE__ */ e(Se(),1),_n=Object.defineProperty,vn=(e,t)=>_n(e,`name`,{value:t,configurable:!0}),yn=0,bn=null;function xn(e){return Sn(),e.children}vn(xn,`FocusGuards`);function Sn(){B.useEffect(()=>{bn||={start:Cn(),end:Cn()};let{start:e,end:t}=bn;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),yn++,()=>{yn===1&&(bn?.start.remove(),bn?.end.remove(),bn=null),yn=Math.max(0,yn-1)}},[])}vn(Sn,`useFocusGuards`);function Cn(){let 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}vn(Cn,`createFocusGuard`);var wn=function(){return wn=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},wn.apply(this,arguments)};function Tn(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function En(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Dn=`right-scroll-bar-position`,On=`width-before-scroll-bar`,kn=`with-scroll-bars-hidden`,An=`--removed-body-scroll-bar-size`;function jn(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Mn(e,t){var n=(0,B.useState)(function(){return{value:e,callback:t,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=t,n.facade}var Nn=typeof window<`u`?B.useLayoutEffect:B.useEffect,Pn=/* @__PURE__ */ new WeakMap;function Fn(e,t){var n=Mn(t||null,function(t){return e.forEach(function(e){return jn(e,t)})});return Nn(function(){var t=Pn.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||jn(e,null)}),i.forEach(function(e){r.has(e)||jn(e,a)})}Pn.set(n,e)},[e]),n}function In(e){return e}function Ln(e,t){t===void 0&&(t=In);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Rn(e){e===void 0&&(e={});var t=Ln(null);return t.options=wn({async:!0,ssr:!1},e),t}var zn=function(e){var t=e.sideCar,n=Tn(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return B.createElement(r,wn({},n))};zn.isSideCarExport=!0;function Bn(e,t){return e.useMedium(t),zn}var Vn=Rn(),Hn=function(){},Un=B.forwardRef(function(e,t){var n=B.useRef(null),r=B.useState({onScrollCapture:Hn,onWheelCapture:Hn,onTouchMoveCapture:Hn}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=Tn(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Fn([n,t]),C=wn(wn({},b),i);return B.createElement(B.Fragment,null,u&&B.createElement(x,{sideCar:Vn,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?B.cloneElement(B.Children.only(s),wn(wn({},C),{ref:S})):B.createElement(v,wn({},C,{className:c,ref:S}),s))});Un.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Un.classNames={fullWidth:On,zeroRight:Dn};var Wn=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Gn(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Wn();return t&&e.setAttribute(`nonce`,t),e}function Kn(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function qn(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Jn=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Gn())&&(Kn(t,n),qn(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Yn=function(){var e=Jn();return function(t,n){B.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Xn=function(){var e=Yn();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Zn={left:0,top:0,right:0,gap:0},Qn=function(e){return parseInt(e||``,10)||0},$n=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Qn(n),Qn(r),Qn(i)]},er=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Zn;var t=$n(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},tr=Xn(),nr=`data-scroll-locked`,rr=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
12
- .${kn} {
8
+ `+e.stack}}var Me=Object.prototype.hasOwnProperty,Ne=t.unstable_scheduleCallback,Pe=t.unstable_cancelCallback,Fe=t.unstable_shouldYield,Ie=t.unstable_requestPaint,Le=t.unstable_now,Re=t.unstable_getCurrentPriorityLevel,ze=t.unstable_ImmediatePriority,Be=t.unstable_UserBlockingPriority,Ve=t.unstable_NormalPriority,He=t.unstable_LowPriority,Ue=t.unstable_IdlePriority,We=t.log,Ge=t.unstable_setDisableYieldValue,Ke=null,qe=null;function Je(e){if(typeof We==`function`&&Ge(e),qe&&typeof qe.setStrictMode==`function`)try{qe.setStrictMode(Ke,e)}catch{}}var H=Math.clz32?Math.clz32:Ze,Ye=Math.log,Xe=Math.LN2;function Ze(e){return e>>>=0,e===0?32:31-(Ye(e)/Xe|0)|0}var Qe=256,$e=262144,et=4194304;function tt(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function U(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=tt(n))):i=tt(o):i=tt(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=tt(n))):i=tt(o)):i=tt(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function nt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function rt(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-H(n),i=1<<r;t|=e[r],n&=~i}return t}function it(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function at(){var e=et;return et<<=1,!(et&62914560)&&(et=4194304),e}function ot(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function st(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ct(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-H(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&lt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function lt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-H(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function ut(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-H(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function dt(e,t){var n=t&-t;return n=n&42?1:ft(n),(n&(e.suspendedLanes|t))===0?n:0}function ft(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function pt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function mt(){var e=R.p;return e===0?(e=window.event,e===void 0?32:Ch(e.type)):e}function ht(e,t){var n=R.p;try{return R.p=e,t()}finally{R.p=n}}var gt=Math.random().toString(36).slice(2),_t=`__reactFiber$`+gt,vt=`__reactProps$`+gt,yt=`__reactContainer$`+gt,bt=`__reactEvents$`+gt,xt=`__reactListeners$`+gt,St=`__reactHandles$`+gt,Ct=`__reactResources$`+gt,wt=`__reactMarker$`+gt,Tt=`__reactLoad$`+gt;function Et(e){delete e[_t],delete e[vt],delete e[xt],delete e[St]}function Dt(e){var t;if(t=e[_t])return t;for(var n=e.parentNode;n;){if(t=n[yt]||n[_t]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=fm(e);e!==null;){if(n=e[_t])return n;e=fm(e)}return t}e=n,n=e.parentNode}return null}function Ot(e){if(e=e[_t]||e[yt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function kt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function At(e){var t=e[Ct];return t||=e[Ct]={hoistableStyles:/* @__PURE__ */ new Map,hoistableScripts:/* @__PURE__ */ new Map},t}function jt(e){e[wt]=!0}function Mt(e){e[Tt]=void 0}var Nt=/* @__PURE__ */ new Set,Pt={};function Ft(e,t){It(e,t),It(e+`Capture`,t)}function It(e,t){for(Pt[e]=t,e=0;e<t.length;e++)Nt.add(t[e])}var Lt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Rt={},zt={};function Bt(e){return Me.call(zt,e)?!0:Me.call(Rt,e)?!1:Lt.test(e)?zt[e]=!0:(Rt[e]=!0,!1)}var W=!1;function Vt(){var e=W;return W=!1,e}function Ht(e,t,n){if(Bt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function Ut(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function G(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function K(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Wt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Gt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Kt(e){if(!e._valueTracker){var t=Wt(e)?`checked`:`value`;e._valueTracker=Gt(e,t,``+e[t])}}function qt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Wt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var Jt=/[\n"\\]/g;function Yt(e){return e.replace(Jt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Xt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+K(t)):e.value!==``+K(t)&&(e.value=``+K(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Qt(e,K(n)):o===`number`&&e.value==t?Qt(e,K(e.value)):Qt(e,K(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+K(s):e.removeAttribute(`name`)}function Zt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Kt(e);return}n=n==null?``:``+K(n),t=t==null?n:``+K(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Kt(e)}function Qt(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function $t(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+K(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function en(e,t,n){t!=null&&(t=``+K(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+K(n)}function tn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(o(92));if(fe(r)){if(1<r.length)throw Error(o(93));r=r[0]}n=r}n??=``,t=n}n=K(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Kt(e)}function nn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var rn=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function an(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||rn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function on(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(o(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,W=!0);for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&(an(e,i,r),W=!0)}else for(var a in t)t.hasOwnProperty(a)&&an(e,a,t[a])}function sn(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var cn=/* @__PURE__ */ new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`maskType`,`mask-type`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),ln=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function un(e){return ln.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function dn(){}var fn=null;function pn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var mn=null,hn=null;function gn(e){var t=Ot(e);if(t&&(e=t.stateNode)){var n=e[vt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Xt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Yt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[vt]||null;if(!i)throw Error(o(90));Xt(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&qt(r)}break a;case`textarea`:en(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&$t(e,!!n.multiple,t,!1)}}}var _n=!1;function vn(e,t,n){if(_n)return e(t,n);_n=!0;try{return e(t)}finally{if(_n=!1,(mn!==null||hn!==null)&&(Ld(),mn&&(t=mn,e=hn,hn=mn=null,gn(t),e)))for(t=0;t<e.length;t++)gn(e[t])}}function yn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[vt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(o(231,t,typeof n));return n}var bn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,xn=!1;if(bn)try{var Sn={};Object.defineProperty(Sn,"passive",{get:function(){xn=!0}}),window.addEventListener(`test`,Sn,Sn),window.removeEventListener(`test`,Sn,Sn)}catch{xn=!1}var Cn=null,wn=null,Tn=null;function En(){if(Tn)return Tn;var e,t=wn,n=t.length,r,i=`value`in Cn?Cn.value:Cn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return Tn=i.slice(e,1<r?1-r:void 0)}function Dn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function On(){return!0}function kn(){return!1}function An(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?On:kn,this.isPropagationStopped=kn,this}return E(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=On)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=On)},persist:function(){},isPersistent:On}),t}var jn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Mn=An(jn),Nn=E({},jn,{view:0,detail:0}),Pn=An(Nn),Fn,In,Ln,Rn=E({},Nn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Yn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Ln&&(Ln&&e.type===`mousemove`?(Fn=e.screenX-Ln.screenX,In=e.screenY-Ln.screenY):In=Fn=0,Ln=e),Fn)},movementY:function(e){return`movementY`in e?e.movementY:In}}),zn=An(Rn),Bn=An(E({},Rn,{dataTransfer:0})),Vn=An(E({},Nn,{relatedTarget:0})),Hn=An(E({},jn,{animationName:0,elapsedTime:0,pseudoElement:0})),Un=An(E({},jn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Wn=An(E({},jn,{data:0})),Gn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Kn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},qn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Jn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=qn[e])?!!t[e]:!1}function Yn(){return Jn}var Xn=An(E({},Nn,{key:function(e){if(e.key){var t=Gn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Dn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Kn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Yn,charCode:function(e){return e.type===`keypress`?Dn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Dn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Zn=An(E({},Rn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Qn=An(E({},jn,{submitter:0})),$n=An(E({},Nn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Yn})),er=An(E({},jn,{propertyName:0,elapsedTime:0,pseudoElement:0})),tr=An(E({},Rn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),nr=An(E({},jn,{newState:0,oldState:0,source:0})),rr=[9,13,27,32],ir=bn&&`CompositionEvent`in window,ar=null;bn&&`documentMode`in document&&(ar=document.documentMode);var or=bn&&`TextEvent`in window&&!ar,sr=bn&&(!ir||ar&&8<ar&&11>=ar),cr=` `,lr=!1;function ur(e,t){switch(e){case`keyup`:return rr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function dr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var fr=!1;function pr(e,t){switch(e){case`compositionend`:return dr(t);case`keypress`:return t.which===32?(lr=!0,cr):null;case`textInput`:return e=t.data,e===cr&&lr?null:e;default:return null}}function mr(e,t){if(fr)return e===`compositionend`||!ir&&ur(e,t)?(e=En(),Tn=wn=Cn=null,fr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return sr&&t.locale!==`ko`?null:t.data;default:return null}}var hr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function gr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!hr[e.type]:t===`textarea`}function _r(e,t,n,r){mn?hn?hn.push(r):hn=[r]:mn=r,t=qf(t,`onChange`),0<t.length&&(n=new Mn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var vr=null,yr=null;function br(e){Bf(e,0)}function xr(e){if(qt(kt(e)))return e}function Sr(e,t){if(e===`change`)return t}var Cr=!1;if(bn){var wr;if(bn){var Tr=`oninput`in document;if(!Tr){var Er=document.createElement(`div`);Er.setAttribute(`oninput`,`return;`),Tr=typeof Er.oninput==`function`}wr=Tr}else wr=!1;Cr=wr&&(!document.documentMode||9<document.documentMode)}function Dr(){vr&&(vr.detachEvent(`onpropertychange`,Or),yr=vr=null)}function Or(e){if(e.propertyName===`value`&&xr(yr)){var t=[];_r(t,yr,e,pn(e)),vn(br,t)}}function kr(e,t,n){e===`focusin`?(Dr(),vr=t,yr=n,vr.attachEvent(`onpropertychange`,Or)):e===`focusout`&&Dr()}function Ar(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return xr(yr)}function jr(e,t){if(e===`click`)return xr(t)}function Mr(e,t){if(e===`input`||e===`change`)return xr(t)}function Nr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Pr=typeof Object.is==`function`?Object.is:Nr;function Fr(e,t){if(Pr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Me.call(t,i)||!Pr(e[i],t[i]))return!1}return!0}function Ir(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Lr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Rr(e,t){var n=Lr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Lr(n)}}function zr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?zr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Br(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ir(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ir(e.document)}return t}function Vr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Hr=bn&&`documentMode`in document&&11>=document.documentMode,Ur=null,Wr=null,Gr=null,Kr=!1;function qr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Kr||Ur==null||Ur!==Ir(r)||(r=Ur,`selectionStart`in r&&Vr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Gr&&Fr(Gr,r)||(Gr=r,r=qf(Wr,`onSelect`),0<r.length&&(t=new Mn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Ur)))}function Jr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Yr={animationend:Jr(`Animation`,`AnimationEnd`),animationiteration:Jr(`Animation`,`AnimationIteration`),animationstart:Jr(`Animation`,`AnimationStart`),transitionrun:Jr(`Transition`,`TransitionRun`),transitionstart:Jr(`Transition`,`TransitionStart`),transitioncancel:Jr(`Transition`,`TransitionCancel`),transitionend:Jr(`Transition`,`TransitionEnd`)},Xr={},Zr={};bn&&(Zr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Yr.animationend.animation,delete Yr.animationiteration.animation,delete Yr.animationstart.animation),`TransitionEvent`in window||delete Yr.transitionend.transition);function Qr(e){if(Xr[e])return Xr[e];if(!Yr[e])return e;var t=Yr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Zr)return Xr[e]=t[n];return e}var $r=Qr(`animationend`),ei=Qr(`animationiteration`),ti=Qr(`animationstart`),ni=Qr(`transitionrun`),ri=Qr(`transitionstart`),ii=Qr(`transitioncancel`),ai=Qr(`transitionend`),oi=/* @__PURE__ */ new Map,si=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);si.push(`scrollEnd`);function ci(e,t){oi.set(e,t),Ft(t,[e])}var li=0;function ui(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=vd.identifierPrefix;var n=li++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function di(e){if(e==null||typeof e==`string`)return e;var t=null,n=Ed;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function fi(e,t){return e=di(e),t=di(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var pi=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},mi=[],hi=0,gi=0;function _i(){for(var e=hi,t=gi=hi=0;t<e;){var n=mi[t];mi[t++]=null;var r=mi[t];mi[t++]=null;var i=mi[t];mi[t++]=null;var a=mi[t];if(mi[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&xi(n,i,a)}}function vi(e,t,n,r){mi[hi++]=e,mi[hi++]=t,mi[hi++]=n,mi[hi++]=r,gi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function yi(e,t,n,r){return vi(e,t,n,r),Si(e)}function bi(e,t){return vi(e,null,null,t),Si(e)}function xi(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-H(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Si(e){if(50<Dd)throw Dd=0,Od=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ci={};function wi(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ti(e,t,n,r){return new wi(e,t,n,r)}function Ei(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Di(e,t){var n=e.alternate;return n===null?(n=Ti(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Oi(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ki(e,t,n,r,i,a){var s=0;if(r=e,typeof r==`function`)Ei(r)&&(s=1);else if(typeof r==`string`)s=qm(e,n,V.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case re:return e=Ti(31,n,t,i),e.elementType=re,e.lanes=a,e;case A:return Ai(n.children,i,a,t);case j:s=8,i|=24;break;case M:return e=Ti(12,n,t,i|2),e.elementType=M,e.lanes=a,e;case I:return e=Ti(13,n,t,i),e.elementType=I,e.lanes=a,e;case ee:return e=Ti(19,n,t,i),e.elementType=ee,e.lanes=a,e;case ie:case oe:return e=i|32,e=Ti(30,n,t,e),e.elementType=oe,e.lanes=a,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case P:s=10;break a;case N:s=9;break a;case F:s=11;break a;case te:s=14;break a;case ne:s=16,r=null;break a}s=29,n=Error(o(130,e===null?`null`:typeof e,``)),r=null}return t=Ti(s,n,t,i),t.elementType=e,t.type=r,t.lanes=a,t}function Ai(e,t,n,r){return e=Ti(7,e,r,t),e.lanes=n,e}function ji(e,t,n){return e=Ti(6,e,null,t),e.lanes=n,e}function Mi(e){var t=Ti(18,null,null,0);return t.stateNode=e,t}function Ni(e,t,n){return t=Ti(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Pi=/* @__PURE__ */ new WeakMap;function Fi(e,t){if(typeof e==`object`&&e){var n=Pi.get(e);return n===void 0?(t={value:e,source:t,stack:je(t)},Pi.set(e,t),t):n}return{value:e,source:t,stack:je(t)}}var Ii=[],Li=0,Ri=null,zi=0,Bi=[],Vi=0,Hi=null,Ui=1,Wi=``;function Gi(e,t){Ii[Li++]=zi,Ii[Li++]=Ri,Ri=e,zi=t}function Ki(e,t,n){Bi[Vi++]=Ui,Bi[Vi++]=Wi,Bi[Vi++]=Hi,Hi=e;var r=Ui;e=Wi;var i=32-H(r)-1;r&=~(1<<i),n+=1;var a=32-H(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ui=1<<32-H(t)+i|n<<i|r,Wi=a+e}else Ui=1<<a|n<<i|r,Wi=e}function qi(e){e.return!==null&&(Gi(e,1),Ki(e,1,0))}function Ji(e){for(;e===Ri;)Ri=Ii[--Li],Ii[Li]=null,zi=Ii[--Li],Ii[Li]=null;for(;e===Hi;)Hi=Bi[--Vi],Bi[Vi]=null,Wi=Bi[--Vi],Bi[Vi]=null,Ui=Bi[--Vi],Bi[Vi]=null}function Yi(e,t){Bi[Vi++]=Ui,Bi[Vi++]=Wi,Bi[Vi++]=Hi,Ui=t.id,Wi=t.overflow,Hi=e}var Xi=null,Zi=null,q=!1,Qi=null,$i=!1,ea=Error(o(519));function ta(e){throw sa(Fi(Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ea}function na(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[_t]=e,t[vt]=r,n){case`dialog`:$(`cancel`,t),$(`close`,t);break;case`iframe`:case`object`:case`embed`:$(`load`,t);break;case`video`:case`audio`:for(n=0;n<Rf.length;n++)$(Rf[n],t);break;case`source`:$(`error`,t);break;case`img`:case`image`:case`link`:$(`error`,t),$(`load`,t);break;case`details`:$(`toggle`,t);break;case`input`:$(`invalid`,t),Zt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:$(`invalid`,t);break;case`textarea`:$(`invalid`,t),tn(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||$f(t.textContent,n)?(r.popover!=null&&($(`beforetoggle`,t),$(`toggle`,t)),r.onScroll!=null&&$(`scroll`,t),r.onScrollEnd!=null&&$(`scrollend`,t),r.onClick!=null&&(t.onclick=dn),t=!0):t=!1,t||ta(e,!0)}function ra(e){for(Xi=e.return;Xi;)switch(Xi.tag){case 5:case 31:case 13:$i=!1;return;case 27:case 3:$i=!0;return;default:Xi=Xi.return}}function ia(e){if(e!==Xi)return!1;if(!q)return ra(e),q=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||pp(e.type,e.memoizedProps)),n=!n),n&&Zi&&ta(e),ra(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(o(317));Zi=dm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(o(317));Zi=dm(e)}else t===27?(t=Zi,Sp(e.type)?(e=um,um=null,Zi=e):Zi=t):Zi=Xi?lm(e.stateNode.nextSibling):null;return!0}function aa(){Zi=Xi=null,q=!1}function oa(){var e=Qi;return e!==null&&(ud===null?ud=e:ud.push.apply(ud,e),Qi=null),e}function sa(e){Qi===null?Qi=[e]:Qi.push(e)}var ca=ge(null),la=null,ua=null;function da(e,t,n){B(ca,t._currentValue),t._currentValue=n}function fa(e){e._currentValue=ca.current,z(ca)}function pa(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function ma(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var a=i.dependencies;if(a!==null){var s=i.child;a=a.firstContext;a:for(;a!==null;){var c=a;a=i;for(var l=0;l<t.length;l++)if(c.context===t[l]){a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),pa(a.return,n,e),r||(s=null);break a}a=c.next}}else if(i.tag===18){if(s=i.return,s===null)throw Error(o(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),pa(s,n,e),s=null}else i.tag===13&&i.memoizedState!==null&&i.memoizedState.dehydrated===null?(i.lanes|=n,s=i.alternate,s!==null&&(s.lanes|=n),pa(i.return,n,e),s=i.child,s=s===null?null:s.sibling):s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===e){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}}function ha(e,t,n,r){e=null;for(var i=t,a=!1;i!==null;){if(!a){if(i.flags&524288)a=!0;else if(i.flags&262144)break}if(i.tag===10){var s=i.alternate;if(s===null)throw Error(o(387));if(s=s.memoizedProps,s!==null){var c=i.type;Pr(i.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(i===ye.current){if(s=i.alternate,s===null)throw Error(o(387));s.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e===null?e=[sh]:e.push(sh))}i=i.return}return e!==null&&ma(t,e,n,r),t.flags|=262144,e!==null}function ga(e){for(e=e.firstContext;e!==null;){if(!Pr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function _a(e){la=e,ua=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function va(e){return ba(la,e)}function ya(e,t){return la===null&&_a(e),ba(e,t)}function ba(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ua===null){if(e===null)throw Error(o(308));ua=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ua=ua.next=t;return n}var xa=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Sa=t.unstable_scheduleCallback,Ca=t.unstable_NormalPriority,wa={$$typeof:P,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ta(){return{controller:new xa,data:/* @__PURE__ */ new Map,refCount:0}}function Ea(e){e.refCount--,e.refCount===0&&Sa(Ca,function(){e.controller.abort()})}function Da(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Oa=null;function ka(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Aa=null,ja=0,Ma=0,Na=null;function Pa(e,t){if(Aa===null){var n=Aa=[];ja=0,Ma=Nf(),Na={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ja++,t.then(Fa,Fa),t}function Fa(){if(--ja===0&&(Oa=null,Aa!==null)){Na!==null&&(Na.status=`fulfilled`);var e=Aa;Aa=null,Ma=0,Na=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ia(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var La=L.S;L.S=function(e,t){if(pd=Le(),typeof t==`object`&&t&&typeof t.then==`function`&&Pa(e,t),Oa!==null)for(var n=yf;n!==null;)Da(n,Oa),n=n.next;if(n=e.types,n!==null){for(var r=yf;r!==null;)Da(r,n),r=r.next;if(Ma!==0){r=Oa,r===null&&(r=Oa=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}La!==null&&La(e,t)};var Ra=ge(null);function za(){var e=Ra.current;return e===null?Xu.pooledCache:e}function Ba(e,t){t===null?B(Ra,Ra.current):B(Ra,t.pool)}function Va(){var e=za();return e===null?null:{parent:wa._currentValue,pool:e}}var Ha=Error(o(460)),Ua=Error(o(474)),Wa=Error(o(542)),Ga={then:function(){}};function Ka(e){return e=e.status,e===`fulfilled`||e===`rejected`}function qa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(dn,dn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Za(e),e===void 0&&!(`reason`in t)?Error(o(600)):e;default:if(typeof t.status==`string`)t.then(dn,dn);else{if(e=Xu,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Za(e),e}throw Ya=t,Ha}}function Ja(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Ya=e,Ha):e}}var Ya=null;function Xa(){if(Ya===null)throw Error(o(459));var e=Ya;return Ya=null,e}function Za(e){if(e===Ha||e===Wa)throw Error(o(483))}var Qa=null,$a=0;function eo(e){var t=$a;return $a+=1,Qa===null&&(Qa=[]),qa(Qa,e,t)}function to(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function no(e,t){throw t.$$typeof===D?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function ro(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=/* @__PURE__ */ new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function i(e,t){return e=Di(e,t),e.index=0,e.sibling=null,e}function a(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=ji(n,e.mode,r),t.return=e,t):(t=i(t,n),t.return=e,t)}function l(e,t,n,r){var a=n.type;return a===A?(e=d(e,t,n.props.children,r,n.key),to(e,n),e):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===ne&&Ja(a)===t.type)?(t=i(t,n.props),to(t,n),t.return=e,t):(t=ki(n.type,n.key,n.props,null,e.mode,r),to(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Ni(n,e.mode,r),t.return=e,t):(t=i(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,a){return t===null||t.tag!==7?(t=Ai(n,e.mode,r,a),t.return=e,t):(t=i(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=ji(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case O:return n=ki(t.type,t.key,t.props,null,e.mode,n),to(n,t),n.return=e,n;case k:return t=Ni(t,e.mode,n),t.return=e,t;case ne:return t=Ja(t),f(e,t,n)}if(fe(t)||le(t))return t=Ai(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,eo(t),n);if(t.$$typeof===P)return f(e,ya(e,t),n);no(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case O:return n.key===i?l(e,t,n,r):null;case k:return n.key===i?u(e,t,n,r):null;case ne:return n=Ja(n),p(e,t,n,r)}if(fe(n)||le(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,eo(n),r);if(n.$$typeof===P)return p(e,t,ya(e,n),r);no(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case O:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case k:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case ne:return r=Ja(r),m(e,t,n,r,i)}if(fe(r)||le(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,eo(r),i);if(r.$$typeof===P)return m(e,t,n,ya(t,r),i);no(t,r)}return null}function h(i,o,s,c){for(var l=null,u=null,d=o,h=o=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),o=a(_,o,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),q&&Gi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(o=a(d,o,h),u===null?l=d:u.sibling=d,u=d);return q&&Gi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),o=a(g,o,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),q&&Gi(i,h),l}function g(i,s,c,l){if(c==null)throw Error(o(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),s=a(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),q&&Gi(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(s=a(v,s,g),d===null?u=v:d.sibling=v,d=v);return q&&Gi(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=a(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),q&&Gi(i,g),u}function _(e,r,a,c){if(typeof a==`object`&&a&&a.type===A&&a.key===null&&a.props.ref===void 0&&(a=a.props.children),typeof a==`object`&&a){switch(a.$$typeof){case O:a:{for(var l=a.key;r!==null;){if(r.key===l){if(l=a.type,l===A){if(r.tag===7){n(e,r.sibling),c=i(r,a.props.children),to(c,a),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===ne&&Ja(l)===r.type){n(e,r.sibling),c=i(r,a.props),to(c,a),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}a.type===A?(c=Ai(a.props.children,e.mode,c,a.key),to(c,a),c.return=e,e=c):(c=ki(a.type,a.key,a.props,null,e.mode,c),to(c,a),c.return=e,e=c)}return s(e);case k:a:{for(l=a.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===a.containerInfo&&r.stateNode.implementation===a.implementation){n(e,r.sibling),c=i(r,a.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Ni(a,e.mode,c),c.return=e,e=c}return s(e);case ne:return a=Ja(a),_(e,r,a,c)}if(fe(a))return h(e,r,a,c);if(le(a)){if(l=le(a),typeof l!=`function`)throw Error(o(150));return a=l.call(a),g(e,r,a,c)}if(typeof a.then==`function`)return _(e,r,eo(a),c);if(a.$$typeof===P)return _(e,r,ya(e,a),c);no(e,a)}return typeof a==`string`&&a!==``||typeof a==`number`||typeof a==`bigint`?(a=``+a,r!==null&&r.tag===6?(n(e,r.sibling),c=i(r,a),c.return=e,e=c):(n(e,r),c=ji(a,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{$a=0;var i=_(e,t,n,r);return Qa=null,i}catch(t){if(t===Ha||t===Wa)throw t;var a=Ti(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var io=ro(!0),ao=ro(!1),oo=!1;function so(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function co(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function lo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function uo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,X&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Si(e),xi(e,null,n),t}return vi(e,r,t,n),Si(e)}function fo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ut(e,n)}}function po(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var mo=!1;function ho(){if(mo){var e=Na;if(e!==null)throw e}}function go(e,t,n,r){mo=!1;var i=e.updateQueue;oo=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Q&f)===f:(r&f)===f){f!==0&&f===Ma&&(mo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=E({},d,f);break a;case 2:oo=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),id|=o,e.lanes=o,e.memoizedState=d}}function _o(e,t){if(typeof e!=`function`)throw Error(o(191,e));e.call(t)}function vo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)_o(n[e],t)}var yo=ge(null),bo=ge(0);function xo(e,t){e=nd,B(bo,e),B(yo,t),nd=e|t.baseLanes}function So(){B(bo,nd),B(yo,yo.current)}function Co(){nd=bo.current,z(yo),z(bo)}var wo=ge(null),To=null;function Eo(e){var t=e.alternate;B(jo,jo.current&1),B(wo,e),To===null&&(t===null||yo.current!==null||t.memoizedState!==null)&&(To=e)}function Do(e){B(jo,jo.current),B(wo,e),To===null&&(To=e)}function Oo(e){e.tag===22?(B(jo,jo.current),B(wo,e),To===null&&(To=e)):ko()}function ko(){B(jo,jo.current),B(wo,wo.current)}function Ao(e){z(wo),To===e&&(To=null),z(jo)}var jo=ge(0);function Mo(e,t){B(wo,wo.current),B(jo,t)}function No(e){z(jo),z(wo),To===e&&(To=null)}function Po(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||om(n)||sm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Fo=0,J=null,Io=null,Lo=null,Ro=!1,zo=!1,Bo=!1,Vo=0,Ho=0,Uo=null,Wo=0;function Go(){throw Error(o(321))}function Ko(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Pr(e[n],t[n]))return!1;return!0}function qo(e,t,n,r,i,a){return Fo=a,J=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,L.H=e===null||e.memoizedState===null?uc:dc,Bo=!1,a=n(r,i),Bo=!1,zo&&(a=Yo(t,n,r,i)),Jo(e),a}function Jo(e){L.H=lc;var t=Io!==null&&Io.next!==null;if(Fo=0,Lo=Io=J=null,Ro=!1,Ho=0,Uo=null,t)throw Error(o(300));e===null||Oc||(e=e.dependencies,e!==null&&ga(e)&&(Oc=!0))}function Yo(e,t,n,r){J=e;var i=0;do{if(zo&&(Uo=null),Ho=0,zo=!1,25<=i)throw Error(o(301));if(i+=1,Lo=Io=null,e.updateQueue!=null){var a=e.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,a.memoCache!=null&&(a.memoCache.index=0)}L.H=fc,a=t(n,r)}while(zo);return a}function Xo(){var e=L.H,t=e.useState()[0];return t=typeof t.then==`function`?rs(t):t,e=e.useState()[0],(Io===null?null:Io.memoizedState)!==e&&(J.flags|=1024),t}function Zo(){var e=Vo!==0;return Vo=0,e}function Qo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function $o(e){if(Ro){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ro=!1}Fo=0,Lo=Io=J=null,zo=!1,Ho=Vo=0,Uo=null}function es(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Lo===null?J.memoizedState=Lo=e:Lo=Lo.next=e,Lo}function ts(){if(Io===null){var e=J.alternate;e=e===null?null:e.memoizedState}else e=Io.next;var t=Lo===null?J.memoizedState:Lo.next;if(t!==null)Lo=t,Io=e;else{if(e===null)throw J.alternate===null?Error(o(467)):Error(o(310));Io=e,e={memoizedState:Io.memoizedState,baseState:Io.baseState,baseQueue:Io.baseQueue,queue:Io.queue,next:null},Lo===null?J.memoizedState=Lo=e:Lo=Lo.next=e}return Lo}function ns(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function rs(e){var t=Ho;return Ho+=1,Uo===null&&(Uo=[]),e=qa(Uo,e,t),t=J,(Lo===null?t.memoizedState:Lo.next)===null&&(t=t.alternate,L.H=t===null||t.memoizedState===null?uc:dc),e}function is(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return rs(e);if(e.$$typeof===se)return;if(e.$$typeof===P)return va(e)}throw Error(o(438,String(e)))}function as(e){var t=null,n=J.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=J.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=ns(),J.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=ae;return t.index++,n}function os(e,t){return typeof t==`function`?t(e):t}function ss(e){return cs(ts(),Io,e)}function cs(e,t,n){var r=e.queue;if(r===null)throw Error(o(311));r.lastRenderedReducer=n;var i=e.baseQueue,a=r.pending;if(a!==null){if(i!==null){var s=i.next;i.next=a.next,a.next=s}t.baseQueue=i=a,r.pending=null}if(a=e.baseState,i===null)e.memoizedState=a;else{t=i.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Fo&f)===f:(Q&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Ma&&(d=!0);else if((Fo&p)===p){u=u.next,p===Ma&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=a):l=l.next=f,J.lanes|=p,id|=p;f=u.action,Bo&&n(a,f),a=u.hasEagerState?u.eagerState:n(a,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=a):l=l.next=p,J.lanes|=f,id|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=a:l.next=c,!Pr(a,e.memoizedState)&&(Oc=!0,d&&(n=Na,n!==null)))throw n;e.memoizedState=a,e.baseState=s,e.baseQueue=l,r.lastRenderedState=a}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function ls(e){var t=ts(),n=t.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,a=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do a=e(a,s.action),s=s.next;while(s!==i);Pr(a,t.memoizedState)||(Oc=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function us(e,t,n){var r=J,i=ts(),a=q;if(a){if(n===void 0)throw Error(o(407));n=n()}else n=t();var s=!Pr((Io||i).memoizedState,n);if(s&&(i.memoizedState=n,Oc=!0),i=i.queue,Fs(ps.bind(null,r,i,e),[e]),e=i.getSnapshot!==t||s||Lo!==null&&!!(Lo.memoizedState.tag&1),As(e?9:8,{destroy:void 0},fs.bind(null,r,i,n,t),null),e){if(r.flags|=2048,Xu===null)throw Error(o(349));a||Fo&127||ds(r,t,n)}return n}function ds(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=J.updateQueue,t===null?(t=ns(),J.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function fs(e,t,n,r){t.value=n,t.getSnapshot=r,ms(t)&&hs(e)}function ps(e,t,n){return n(function(){ms(t)&&hs(e)})}function ms(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Pr(e,n)}catch{return!0}}function hs(e){var t=bi(e,2);t!==null&&Md(t,e,2)}function gs(e){var t=es();if(typeof e==`function`){var n=e;if(e=n(),Bo){Je(!0);try{n()}finally{Je(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:os,lastRenderedState:e},t}function _s(e,t,n,r){return e.baseState=n,cs(e,Io,typeof r==`function`?r:os)}function vs(e,t,n,r,i){if(oc(e))throw Error(o(485));if(e=t.action,e!==null){var a={payload:i,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){a.listeners.push(e)}};L.T===null?a.isTransition=!1:n(!0),r(a),n=t.pending,n===null?(a.next=t.pending=a,ys(t,a)):(a.next=n.next,t.pending=n.next=a)}}function ys(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=L.T,o={};o.types=a===null?null:a.types,L.T=o;try{var s=n(i,r),c=L.S;c!==null&&c(o,s),bs(e,t,s)}catch(n){Ss(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),L.T=a}}else try{a=n(i,r),bs(e,t,a)}catch(n){Ss(e,t,n)}}function bs(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){xs(e,t,n)},function(n){return Ss(e,t,n)}):xs(e,t,n)}function xs(e,t,n){t.status=`fulfilled`,t.value=n,Cs(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,ys(e,n)))}function Ss(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Cs(t),t=t.next;while(t!==r)}e.action=null}function Cs(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ws(e,t){return t}function Ts(e,t){if(q){var n=Xu.formState;if(n!==null){a:{var r=J;if(q){if(Zi){b:{for(var i=Zi,a=$i;i.nodeType!==8;)if(!a||(i=lm(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Zi=lm(i.nextSibling),r=i.data===`F!`;break a}}ta(r)}r=!1}r&&(t=n[0])}}return n=es(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ws,lastRenderedState:t},n.queue=r,n=rc.bind(null,J,r),r.dispatch=n,r=gs(!1),a=ac.bind(null,J,!1,r.queue),r=es(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=vs.bind(null,J,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Es(e){return Ds(ts(),Io,e)}function Ds(e,t,n){if(t=cs(e,t,ws)[0],e=ss(os)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=rs(t)}catch(e){throw e===Ha?Wa:e}else r=t;t=ts();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(J.flags|=2048,As(9,{destroy:void 0},Os.bind(null,i,n),null)),[r,a,e]}function Os(e,t){e.action=t}function ks(e){var t=ts(),n=Io;if(n!==null)return Ds(t,n,e);ts(),t=t.memoizedState,n=ts();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function As(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=J.updateQueue,t===null&&(t=ns(),J.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function js(){return ts().memoizedState}function Ms(e,t,n,r){var i=es();J.flags|=e,i.memoizedState=As(1|t,{destroy:void 0},n,r===void 0?null:r)}function Ns(e,t,n,r){var i=ts();r=r===void 0?null:r;var a=i.memoizedState.inst;Io!==null&&r!==null&&Ko(r,Io.memoizedState.deps)?i.memoizedState=As(t,a,n,r):(J.flags|=e,i.memoizedState=As(1|t,a,n,r))}function Ps(e,t){Ms(8390656,8,e,t)}function Fs(e,t){Ns(2048,8,e,t)}function Is(e){J.flags|=4;var t=J.updateQueue;if(t===null)t=ns(),J.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Ls(e){var t=ts().memoizedState;return Is({ref:t,nextImpl:e}),function(){if(X&2)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function Rs(e,t){return Ns(4,2,e,t)}function zs(e,t){return Ns(4,4,e,t)}function Bs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Vs(e,t,n){n=n==null?null:n.concat([e]),Ns(4,4,Bs.bind(null,t,e),n)}function Hs(){}function Us(e,t){var n=ts();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Ko(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ws(e,t){var n=ts();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Ko(t,r[1]))return r[0];if(r=e(),Bo){Je(!0);try{e()}finally{Je(!1)}}return n.memoizedState=[r,t],r}function Gs(e,t,n){return n===void 0||Fo&1073741824&&!(Q&261930)?e.memoizedState=t:(e.memoizedState=n,e=Ad(),J.lanes|=e,id|=e,n)}function Ks(e,t,n,r){return Pr(n,t)?n:yo.current===null?!(Fo&106)||Fo&1073741824&&!(Q&261930)?(Oc=!0,e.memoizedState=n):(e=Ad(),J.lanes|=e,id|=e,t):(e=Gs(e,n,r),Pr(e,t)||(Oc=!0),e)}function qs(e,t,n,r,i){var a=R.p;R.p=a!==0&&8>a?a:8;var o=L.T,s={};s.types=o===null?null:o.types,L.T=s,ac(e,!1,t,n);try{var c=i(),l=L.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?ic(e,t,Ia(c,r),kd(e)):ic(e,t,r,kd(e))}catch(n){ic(e,t,{then:function(){},status:`rejected`,reason:n},kd())}finally{R.p=a,o!==null&&s.types!==null&&(o.types=s.types),L.T=o}}function Js(){}function Ys(e,t,n,r){if(e.tag!==5)throw Error(o(476));var i=Xs(e).queue;qs(e,i,t,pe,n===null?Js:function(){return Zs(e),n(r)})}function Xs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:pe,baseState:pe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:os,lastRenderedState:pe},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:os,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Zs(e){var t=Xs(e);t.next===null&&(t=e.alternate.memoizedState),ic(e,t.next.queue,{},kd())}function Qs(){return va(sh)}function $s(){return ts().memoizedState}function ec(){return ts().memoizedState}function tc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=kd();e=lo(n);var r=uo(t,e,n);r!==null&&(Md(r,t,n),fo(r,t,n)),t={cache:Ta()},e.payload=t;return}t=t.return}}function nc(e,t,n){var r=kd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},oc(e)?sc(t,n):(n=yi(e,t,n,r),n!==null&&(Md(n,e,r),cc(n,t,r)))}function rc(e,t,n){ic(e,t,n,kd())}function ic(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(oc(e))sc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Pr(s,o))return vi(e,t,i,0),Xu===null&&_i(),!1}catch{}if(n=yi(e,t,i,r),n!==null)return Md(n,e,r),cc(n,t,r),!0}return!1}function ac(e,t,n,r){if(r={lane:2,revertLane:Nf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},oc(e)){if(t)throw Error(o(479))}else t=yi(e,n,r,2),t!==null&&Md(t,e,2)}function oc(e){var t=e.alternate;return e===J||t!==null&&t===J}function sc(e,t){zo=Ro=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function cc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ut(e,n)}}var lc={readContext:va,use:is,useCallback:Go,useContext:Go,useEffect:Go,useImperativeHandle:Go,useLayoutEffect:Go,useInsertionEffect:Go,useMemo:Go,useReducer:Go,useRef:Go,useState:Go,useDebugValue:Go,useDeferredValue:Go,useTransition:Go,useSyncExternalStore:Go,useId:Go,useHostTransitionStatus:Go,useFormState:Go,useActionState:Go,useOptimistic:Go,useMemoCache:Go,useCacheRefresh:Go,useEffectEvent:Go},uc={readContext:va,use:is,useCallback:function(e,t){return es().memoizedState=[e,t===void 0?null:t],e},useContext:va,useEffect:Ps,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Ms(4194308,4,Bs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ms(4194308,4,e,t)},useInsertionEffect:function(e,t){Ms(4,2,e,t)},useMemo:function(e,t){var n=es();t=t===void 0?null:t;var r=e();if(Bo){Je(!0);try{e()}finally{Je(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=es();if(n!==void 0){var i=n(t);if(Bo){Je(!0);try{n(t)}finally{Je(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=nc.bind(null,J,e),[r.memoizedState,e]},useRef:function(e){var t=es();return e={current:e},t.memoizedState=e},useState:function(e){e=gs(e);var t=e.queue,n=rc.bind(null,J,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Hs,useDeferredValue:function(e,t){return Gs(es(),e,t)},useTransition:function(){var e=gs(!1);return e=qs.bind(null,J,e.queue,!0,!1),es().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=J,i=es();if(q){if(n===void 0)throw Error(o(407));n=n()}else{if(n=t(),Xu===null)throw Error(o(349));Q&127||ds(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,Ps(ps.bind(null,r,a,e),[e]),r.flags|=2048,As(9,{destroy:void 0},fs.bind(null,r,a,n,t),null),n},useId:function(){var e=es(),t=Xu.identifierPrefix;if(q){var n=Wi,r=Ui;n=(r&~(1<<32-H(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Vo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Wo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Qs,useFormState:Ts,useActionState:Ts,useOptimistic:function(e){var t=es();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=ac.bind(null,J,!0,n),n.dispatch=t,[e,t]},useMemoCache:as,useCacheRefresh:function(){return es().memoizedState=tc.bind(null,J)},useEffectEvent:function(e){var t=es(),n={impl:e};return t.memoizedState=n,function(){if(X&2)throw Error(o(440));return n.impl.apply(void 0,arguments)}}},dc={readContext:va,use:is,useCallback:Us,useContext:va,useEffect:Fs,useImperativeHandle:Vs,useInsertionEffect:Rs,useLayoutEffect:zs,useMemo:Ws,useReducer:ss,useRef:js,useState:function(){return ss(os)},useDebugValue:Hs,useDeferredValue:function(e,t){return Ks(ts(),Io.memoizedState,e,t)},useTransition:function(){var e=ss(os)[0],t=ts().memoizedState;return[typeof e==`boolean`?e:rs(e),t]},useSyncExternalStore:us,useId:$s,useHostTransitionStatus:Qs,useFormState:Es,useActionState:Es,useOptimistic:function(e,t){return _s(ts(),Io,e,t)},useMemoCache:as,useCacheRefresh:ec,useEffectEvent:Ls},fc={readContext:va,use:is,useCallback:Us,useContext:va,useEffect:Fs,useImperativeHandle:Vs,useInsertionEffect:Rs,useLayoutEffect:zs,useMemo:Ws,useReducer:ls,useRef:js,useState:function(){return ls(os)},useDebugValue:Hs,useDeferredValue:function(e,t){var n=ts();return Io===null?Gs(n,e,t):Ks(n,Io.memoizedState,e,t)},useTransition:function(){var e=ls(os)[0],t=ts().memoizedState;return[typeof e==`boolean`?e:rs(e),t]},useSyncExternalStore:us,useId:$s,useHostTransitionStatus:Qs,useFormState:ks,useActionState:ks,useOptimistic:function(e,t){var n=ts();return Io===null?(n.baseState=e,[e,n.queue.dispatch]):_s(n,Io,e,t)},useMemoCache:as,useCacheRefresh:ec,useEffectEvent:Ls};function pc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:E({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var mc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=kd(),i=lo(r);i.payload=t,n!=null&&(i.callback=n),t=uo(e,i,r),t!==null&&(Md(t,e,r),fo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=kd(),i=lo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=uo(e,i,r),t!==null&&(Md(t,e,r),fo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=kd(),r=lo(n);r.tag=2,t!=null&&(r.callback=t),t=uo(e,r,n),t!==null&&(Md(t,e,n),fo(t,e,n))}};function hc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Fr(n,r)||!Fr(i,a):!0}function gc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&mc.enqueueReplaceState(t,t.state,null)}function _c(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=E({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function vc(e){pi(e)}function yc(e){console.error(e)}function bc(e){pi(e)}function xc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Sc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Cc(e,t,n){return n=lo(n),n.tag=3,n.payload={element:null},n.callback=function(){xc(e,t)},n}function wc(e){return e=lo(e),e.tag=3,e}function Tc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Sc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Sc(t,n,r),typeof i!=`function`&&(gd===null?gd=/* @__PURE__ */ new Set([this]):gd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Ec(e,t,n,r,i){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ha(t,n,i,!0),n=wo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return To===null?Wd():n.alternate===null&&rd===0&&(rd=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===Ga?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=/* @__PURE__ */ new Set([r]):t.add(r),pf(e,r,i)),!1;case 22:return n.flags|=65536,r===Ga?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:/* @__PURE__ */ new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=/* @__PURE__ */ new Set([r]):n.add(r)),pf(e,r,i)),!1}throw Error(o(435,n.tag))}return pf(e,r,i),Wd(),!1}if(q)return t=wo.current,t===null?(r!==ea&&(t=Error(o(423),{cause:r}),sa(Fi(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=Fi(r,n),i=Cc(e.stateNode,r,i),po(e,i),rd!==4&&(rd=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==ea&&(e=Error(o(422),{cause:r}),sa(Fi(e,n)))),!1;var a=Error(o(520),{cause:r});if(a=Fi(a,n),ld===null?ld=[a]:ld.push(a),rd!==4&&(rd=2),t===null)return!0;r=Fi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=Cc(n.stateNode,r,e),po(n,e),!1;case 1:if(t=n.type,a=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||a!==null&&typeof a.componentDidCatch==`function`&&(gd===null||!gd.has(a))))return n.flags|=65536,i&=-i,n.lanes|=i,i=wc(i),Tc(i,e,n,r),po(n,i),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Dc=Error(o(461)),Oc=!1;function kc(e,t,n,r){t.child=e===null?ao(t,null,n,r):io(t,e.child,n,r)}function Ac(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return _a(t),r=qo(e,t,n,o,a,i),s=Zo(),e!==null&&!Oc?(Qo(e,t,i),il(e,t,i)):(q&&s&&qi(t),t.flags|=1,kc(e,t,r,i),t.child)}function jc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Ei(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Mc(e,t,a,r,i)):(e=ki(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!al(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Fr:n,n(o,r)&&e.ref===t.ref)return il(e,t,i)}return t.flags|=1,e=Di(a,r),e.ref=t.ref,e.return=t,t.child=e}function Mc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Fr(a,r)&&e.ref===t.ref){if(Oc=!1,t.pendingProps=r=a,al(e,i))e.flags&131072&&(Oc=!0);else return t.lanes=e.lanes,il(e,t,i)}}return Bc(e,t,n,r,i)}function Nc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Fc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ba(t,a===null?null:a.cachePool),a===null?So():xo(t,a),Oo(t);else return r=t.lanes=536870912,Fc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ba(t,null),So(),ko()):(Ba(t,a.cachePool),xo(t,a),ko(),t.memoizedState=null);return kc(e,t,i,n),t.child}function Pc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Fc(e,t,n,r,i){var a=za();return a=a===null?null:{parent:wa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ba(t,null),So(),Oo(t),e!==null&&ha(e,t,r,!0),t.childLanes=i,null}function Ic(e,t){return t=Yc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Lc(e,t,n){return io(t,e.child,null,n),e=Ic(t,t.pendingProps),e.flags|=2,Ao(t),t.memoizedState=null,e}function Rc(e,t,n){var r=t.pendingProps,i=!!(t.flags&128);if(t.flags&=-129,e===null){if(q){if(r.mode===`hidden`)return e=Ic(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Pc(null,e);if(Do(t),(e=Zi)?(e=am(e,$i),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Hi===null?null:{id:Ui,overflow:Wi},retryLane:536870912,hydrationErrors:null},n=Mi(e),n.return=t,t.child=n,Xi=t,Zi=null)):e=null,e===null)throw ta(t);return t.lanes=536870912,null}return Ic(t,r)}var a=e.memoizedState;if(a!==null){var s=a.dehydrated;if(Do(t),i){if(t.flags&256)t.flags&=-257,t=Lc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558))}else if(Oc||ha(e,t,n,!1),i=(n&e.childLanes)!==0,Oc||i){if(yo.current===null){if(r=Xu,r!==null&&(s=dt(r,n),s!==0&&s!==a.retryLane))throw a.retryLane=s,bi(e,s),Md(r,e,s),Dc;Wd()}t=Lc(e,t,n)}else e=a.treeContext,Zi=lm(s.nextSibling),Xi=t,q=!0,Qi=null,$i=!1,e!==null&&Yi(t,e),t=Ic(t,r),t.flags|=134221824;return t}return e=Di(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function zc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(o(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Bc(e,t,n,r,i){return _a(t),n=qo(e,t,n,r,void 0,i),r=Zo(),e!==null&&!Oc?(Qo(e,t,i),il(e,t,i)):(q&&r&&qi(t),t.flags|=1,kc(e,t,n,i),t.child)}function Vc(e,t,n,r,i,a){return _a(t),t.updateQueue=null,n=Yo(t,r,n,i),Jo(e),r=Zo(),e!==null&&!Oc?(Qo(e,t,a),il(e,t,a)):(q&&r&&qi(t),t.flags|=1,kc(e,t,n,a),t.child)}function Hc(e,t,n,r,i){if(_a(t),t.stateNode===null){var a=Ci,o=n.contextType;typeof o==`object`&&o&&(a=va(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=mc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},so(t),o=n.contextType,a.context=typeof o==`object`&&o?va(o):Ci,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(pc(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&mc.enqueueReplaceState(a,a.state,null),go(t,r,a,i),ho(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=_c(n,s);a.props=c;var l=a.context,u=n.contextType;o=Ci,typeof u==`object`&&u&&(o=va(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&gc(t,a,r,o),oo=!1;var f=t.memoizedState;a.state=f,go(t,r,a,i),ho(),l=t.memoizedState,s||f!==l||oo?(typeof d==`function`&&(pc(t,n,d,r),l=t.memoizedState),(c=oo||hc(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,co(e,t),o=t.memoizedProps,u=_c(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Ci,typeof l==`object`&&l&&(c=va(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&gc(t,a,r,c),oo=!1,f=t.memoizedState,a.state=f,go(t,r,a,i),ho();var p=t.memoizedState;o!==d||f!==p||oo||e!==null&&e.dependencies!==null&&ga(e.dependencies)?(typeof s==`function`&&(pc(t,n,s,r),p=t.memoizedState),(u=oo||hc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ga(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,zc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=io(t,e.child,null,i),t.child=io(t,null,n,i)):kc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=il(e,t,i),e}function Uc(e,t,n,r){return aa(),t.flags|=256,kc(e,t,n,r),t.child}var Wc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Gc(e){return{baseLanes:e,cachePool:Va()}}function Kc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=sd),e}function qc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(jo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(q){if(i?Eo(t):ko(),(e=Zi)?(e=am(e,$i),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Hi===null?null:{id:Ui,overflow:Wi},retryLane:536870912,hydrationErrors:null},n=Mi(e),n.return=t,t.child=n,Xi=t,Zi=null)):e=null,e===null)throw ta(t);return t.lanes=sm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(ko(),i=t.mode,a=Yc({mode:`hidden`,children:a},i),r=Ai(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Gc(n),r.childLanes=Kc(e,o,n),t.memoizedState=Wc,Pc(null,r)):(Eo(t),Jc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return Zc(e,t,a,o,r,c,s,n)}return i?(ko(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Di(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Ai(i,a,n,null),i.flags|=2):i=Di(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Pc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Gc(n):(a=i.cachePool,a===null?a=Va():(s=wa._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Kc(e,o,n),t.memoizedState=Wc,Pc(e.child,r)):(Eo(t),n=e.child,e=n.sibling,n=Di(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function Jc(e,t){return t=Yc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Yc(e,t){return e=Ti(22,e,null,t),e.lanes=0,e}function Xc(e,t,n){return io(t,e.child,null,n),e=Jc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Zc(e,t,n,r,i,a,s,c){if(n)return t.flags&256?(Eo(t),t.flags&=-257,Xc(e,t,c)):t.memoizedState===null?(ko(),a=i.fallback,s=t.mode,i=Yc({mode:`visible`,children:i.children},s),a=Ai(a,s,c,null),a.flags|=2,i.return=t,a.return=t,i.sibling=a,t.child=i,io(t,e.child,null,c),i=t.child,i.memoizedState=Gc(c),i.childLanes=Kc(e,r,c),t.memoizedState=Wc,Pc(null,i)):(ko(),t.child=e.child,t.flags|=128,null);if(Eo(t),sm(a)){if(r=a.nextSibling&&a.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(i=Error(o(419)),i.stack=``,i.digest=r,sa({value:i,source:null,stack:null})),Xc(e,t,c)}if(Oc||ha(e,t,c,!1),r=(c&e.childLanes)!==0,Oc||r){if(yo.current!==null)return Xc(e,t,c);if(r=Xu,r!==null&&(i=dt(r,c),i!==0&&i!==s.retryLane))throw s.retryLane=i,bi(e,i),Md(r,e,i),Dc;return om(a)||Wd(),Xc(e,t,c)}return om(a)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,Zi=lm(a.nextSibling),Xi=t,q=!0,Qi=null,$i=!1,e!==null&&Yi(t,e),t=Jc(t,i.children),t.flags|=134221824,t)}function Qc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),pa(e.return,t,n)}function $c(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Po(n)===null&&(t=e),e=e.sibling}return t}function el(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function tl(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function nl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=jo.current;if(t.flags&128)return Mo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Mo(t,o),i===`backwards`&&e!==null?(tl(e),kc(e,t,r,n),tl(e)):kc(e,t,r,n),r=q?zi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Qc(e,n,t);else if(e.tag===19)Qc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=$c(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,tl(t)),el(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Po(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}el(t,!0,n,null,a,r);break;case`together`:el(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=$c(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),el(t,!1,i,n,a,r)}return t.child}function rl(e,t,n){var r=t.pendingProps;return da(t,t.type,r.value),kc(e,t,r.children,n),t.child}function il(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),id|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(ha(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,n=Di(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Di(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function al(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&ga(e)))}function Y(e,t,n){switch(t.tag){case 3:be(t,t.stateNode.containerInfo),da(t,wa,e.memoizedState.cache),aa();break;case 27:case 5:Se(t);break;case 4:be(t,t.stateNode.containerInfo);break;case 10:da(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Do(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Eo(t),t.flags|=128,null;r=ha(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?qc(e,t,n):(Eo(t),e=il(e,t,n),e===null?null:e.sibling)}Eo(t);break;case 19:if(t.flags&128)return nl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(ha(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return nl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Mo(t,jo.current),r)break;return null;case 22:return t.lanes=0,Nc(e,t,n,t.pendingProps);case 24:da(t,wa,e.memoizedState.cache)}return il(e,t,n)}function ol(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Oc=!0;else{if(!al(e,n)&&!(t.flags&128))return Oc=!1,Y(e,t,n);Oc=!!(e.flags&131072)}}else Oc=!1,q&&t.flags&1048576&&Ki(t,zi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Ja(t.elementType),t.type=e,typeof e==`function`)Ei(e)?(r=_c(e,r),t.tag=1,t=Hc(null,t,e,r,n)):(t.tag=0,t=Bc(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===F){t.tag=11,t=Ac(null,t,e,r,n);break a}if(i===te){t.tag=14,t=jc(null,t,e,r,n);break a}if(i===P){t.tag=10,t.type=e,t=rl(null,t,n);break a}}throw t=de(e)||e,Error(o(306,t,``))}}return t;case 0:return Bc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=_c(r,t.pendingProps),Hc(e,t,r,i,n);case 3:a:{if(be(t,t.stateNode.containerInfo),e===null)throw Error(o(387));r=t.pendingProps;var a=t.memoizedState;i=a.element,co(e,t),go(t,r,null,n);var s=t.memoizedState;if(r=s.cache,da(t,wa,r),r!==a.cache&&ma(t,[wa],n,!0),ho(),r=s.element,a.isDehydrated){if(a={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){t=Uc(e,t,r,n);break a}if(r!==i){i=Fi(Error(o(424)),t),sa(i),t=Uc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Zi=lm(e.firstChild),Xi=t,q=!0,Qi=null,$i=!0,n=ao(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(aa(),r===i){t=il(e,t,n);break a}kc(e,t,r,n)}t=t.child}return t;case 26:return zc(e,t),e===null?(n=Nm(t.type,null,t.pendingProps,null))?t.memoizedState=n:q||(t.stateNode=fp(t.type,t.pendingProps,ve.current,t)):t.memoizedState=Nm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Se(t),e===null&&q&&(r=t.stateNode=hm(t.type,t.pendingProps,ve.current),Xi=t,$i=!0,i=Zi,Sp(t.type)?(um=i,Zi=lm(r.firstChild)):Zi=i),kc(e,t,t.pendingProps.children,n),zc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&q&&((i=r=Zi)&&(r=rm(r,t.type,t.pendingProps,$i),r===null?i=!1:(t.stateNode=r,Xi=t,Zi=lm(r.firstChild),$i=!1,i=!0)),i||ta(t)),Se(t),i=t.type,a=t.pendingProps,s=e===null?null:e.memoizedProps,r=a.children,pp(i,a)?r=null:s!==null&&pp(i,s)&&(t.flags|=32),t.memoizedState!==null&&(i=qo(e,t,Xo,null,null,n),sh._currentValue=i),zc(e,t),kc(e,t,r,n),t.child;case 6:return e===null&&q&&((e=n=Zi)&&(n=im(n,t.pendingProps,$i),n===null?e=!1:(t.stateNode=n,Xi=t,Zi=null,e=!0)),e||ta(t)),null;case 13:return qc(e,t,n);case 4:return be(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=io(t,null,r,n):kc(e,t,r,n),t.child;case 11:return Ac(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,zc(e,t),kc(e,t,r,n),t.child;case 8:return kc(e,t,t.pendingProps.children,n),t.child;case 12:return kc(e,t,t.pendingProps.children,n),t.child;case 10:return rl(e,t,n);case 9:return i=t.type._context,r=t.pendingProps.children,_a(t),i=va(i),r=r(i),t.flags|=1,kc(e,t,r,n),t.child;case 14:return jc(e,t,t.type,t.pendingProps,n);case 15:return Mc(e,t,t.type,t.pendingProps,n);case 19:return nl(e,t,n);case 31:return Rc(e,t,n);case 22:return Nc(e,t,n,t.pendingProps);case 24:return _a(t),r=va(wa),e===null?(i=za(),i===null&&(i=Xu,a=Ta(),i.pooledCache=a,a.refCount++,a!==null&&(i.pooledCacheLanes|=n),i=a),t.memoizedState={parent:r,cache:i},so(t),da(t,wa,i)):((e.lanes&n)!==0&&(co(e,t),go(t,null,null,n),ho()),i=e.memoizedState,a=t.memoizedState,i.parent===r?(r=a.cache,da(t,wa,r),r!==i.cache&&ma(t,[wa],n,!0)):(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),da(t,wa,r))),kc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:q&&qi(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:zc(e,t),kc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function sl(e){e.flags|=4}function cl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Jm(t,r):Jm(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Vd())e.flags|=8192;else throw Ya=Ga,Ua}}else e.flags&=-16777217}function ll(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Ym(t)){if(Vd())e.flags|=8192;else throw Ya=Ga,Ua}}function ul(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:at(),e.lanes|=t,cd|=t)}function dl(e,t){if(!q)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function fl(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function pl(e,t,n){var r=t.pendingProps;switch(Ji(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return fl(t),null;case 1:return fl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),fa(wa),xe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ia(t)?sl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,oa())),fl(t),null;case 26:var i=t.type,a=t.memoizedState;return e===null?(sl(t),a===null?(fl(t),cl(t,i,null,r,n)):(fl(t),ll(t,a))):a?a===e.memoizedState?(fl(t),t.flags&=-16777217):(sl(t),fl(t),ll(t,a)):(e=e.memoizedProps,e!==r&&sl(t),fl(t),cl(t,i,e,r,n)),null;case 27:if(Ce(t),n=ve.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&sl(t);else{if(!r){if(t.stateNode===null)throw Error(o(166));return fl(t),t.subtreeFlags&=-33554433,null}e=V.current,ia(t)?na(t,e):(e=hm(i,r,n),t.stateNode=e,sl(t))}return fl(t),t.subtreeFlags&=-33554433,null;case 5:if(Ce(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&sl(t);else{if(!r){if(t.stateNode===null)throw Error(o(166));return fl(t),t.subtreeFlags&=-33554433,null}if(a=V.current,ia(t))na(t,a);else{var s=lp(ve.current);switch(a){case 1:a=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case 2:a=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;default:switch(i){case`svg`:a=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case`math`:a=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;case`script`:a=s.createElement(`div`),a.innerHTML=`<script><\/script>`,a=a.removeChild(a.firstChild);break;case`select`:a=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?a.multiple=!0:r.size&&(a.size=r.size);break;default:a=typeof r.is==`string`?s.createElement(i,{is:r.is}):s.createElement(i)}}a[_t]=t,a[vt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)a.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=a;a:switch(np(a,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&sl(t)}}return fl(t),t.subtreeFlags&=-33554433,cl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&sl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(o(166));if(e=ve.current,ia(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=Xi,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[_t]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||$f(e.nodeValue,n)),e||ta(t,!0)}else e=lp(e).createTextNode(r),e[_t]=t,t.stateNode=e}return fl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ia(t),n!==null){if(e===null){if(!r)throw Error(o(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(o(557));e[_t]=t}else aa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;fl(t),e=!1}else n=oa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Ao(t),t):(Ao(t),null);if(t.flags&128)throw Error(o(558))}return fl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=ia(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(o(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(o(317));i[_t]=t}else aa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;fl(t),i=!1}else i=oa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(Ao(t),t):(Ao(t),null)}return Ao(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),a=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(a=r.memoizedState.cachePool.pool),a!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),ul(t,t.updateQueue),fl(t),null);case 4:return xe(),e===null&&Uf(t.stateNode.containerInfo),t.flags|=67108864,fl(t),null;case 10:return fa(t.type),fl(t),null;case 19:if(No(t),r=t.memoizedState,r===null)return fl(t),null;if(i=!!(t.flags&128),a=r.rendering,a===null){if(i)dl(r,!1);else{if(rd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=Po(e),a!==null){for(t.flags|=128,dl(r,!1),e=a.updateQueue,t.updateQueue=e,ul(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Oi(n,e),n=n.sibling;return Mo(t,jo.current&1|2),q&&Gi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Le()>md&&(t.flags|=128,i=!0,dl(r,!1),t.lanes=4194304)}}else{if(!i){if(e=Po(a),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,ul(t,e),dl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!a.alternate&&!q)return fl(t),null}else 2*Le()-r.renderingStartTime>md&&n!==536870912&&(t.flags|=128,i=!0,dl(r,!1),t.lanes=4194304)}r.isBackwards?(a.sibling=t.child,t.child=a):(e=r.last,e===null?t.child=a:e.sibling=a,r.last=a)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Le(),e.sibling=null,a=jo.current,a=i?a&1|2:a&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||q?Mo(t,a):(n=a,B(wo,t),B(jo,n),To===null&&(To=t)),q&&Gi(t,r.treeForkCount),e}return fl(t),null;case 22:case 23:return Ao(t),Co(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(fl(t),t.subtreeFlags&6&&(t.flags|=8192)):fl(t),n=t.updateQueue,n!==null&&ul(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&z(Ra),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),fa(wa),fl(t),null;case 25:return null;case 30:return t.flags|=33554432,fl(t),null}throw Error(o(156,t.tag))}function ml(e,t){switch(Ji(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return fa(wa),xe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ce(t),null;case 31:if(t.memoizedState!==null){if(Ao(t),t.alternate===null)throw Error(o(340));aa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ao(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));aa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return No(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return xe(),null;case 10:return fa(t.type),null;case 22:case 23:return Ao(t),Co(),e!==null&&z(Ra),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return fa(wa),null;case 25:return null;default:return null}}function hl(e,t){switch(Ji(t),t.tag){case 3:fa(wa),xe();break;case 26:case 27:case 5:Ce(t);break;case 4:xe();break;case 31:t.memoizedState!==null&&Ao(t);break;case 13:Ao(t);break;case 19:No(t);break;case 10:fa(t.type);break;case 22:case 23:Ao(t),Co(),e!==null&&z(Ra);break;case 24:fa(wa)}}function gl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){ff(t,t.return,e)}}function _l(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){ff(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){ff(t,t.return,e)}}function vl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{vo(t,n)}catch(t){ff(e,e.return,t)}}}function yl(e,t,n){n.props=_c(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){ff(e,t,n)}}function bl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=ui(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Pp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Fp(e);m(e.child,!1,Qp,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){ff(e,t,n)}}function xl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){ff(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){ff(e,t,n)}else n.current=null}}function Sl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)em(e.stateNode,t[n])}function Cl(e){for(var t=e.return;t!==null&&(El(t)&&em(e.stateNode,t.stateNode),!Tl(t));)t=t.return}function wl(e){for(var t=e.return;t!==null&&(El(t)&&tm(e.stateNode,t.stateNode),!Tl(t));)t=t.return}function Tl(e){return e.tag===5||e.tag===3||e.tag===27}function El(e){return e&&e.tag===7&&e.stateNode!==null}function Dl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){ff(e,e.return,t)}}function Ol(e,t,n){try{var r=e.stateNode;ip(r,e.type,n,t),r[vt]=t}catch(t){ff(e,e.return,t)}}function kl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Sp(e.type)||e.tag===4}function Al(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||kl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Sp(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function jl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=dn)),Sl(e,r),W=!0;else if(i!==4&&(i===27&&(Sl(e,r),r=null,Sp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(jl(e,t,n,r),e=e.sibling;e!==null;)jl(e,t,n,r),e=e.sibling}function Ml(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Sl(e,r),W=!0;else if(i!==4&&(i===27&&(Sl(e,r),r=null,Sp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Ml(e,t,n,r),e=e.sibling;e!==null;)Ml(e,t,n,r),e=e.sibling}function Nl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);np(t,r,n),t[_t]=e,t[vt]=n}catch(t){ff(e,e.return,t)}}var Pl=!1,Fl=null;function Il(e){(e.tag===30||e.subtreeFlags&33554432)&&(Pl=!0)}var Ll=null;function Rl(){var e=Ll;return Ll=null,e}var zl=0;function Bl(e,t,n,r,i){return zl=0,Vl(e.child,t,n,r,i)}function Vl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Op(o);r.push(s),s.view&&(a=!0)}else a||Op(o).view&&(a=!0);Pl=!0,Tp(o,zl===0?t:t+`_`+zl,n),zl++}else e.tag===22&&e.memoizedState!==null||e.tag===30&&i||Vl(e.child,t,n,r,i)&&(a=!0);e=e.sibling}return a}function Hl(e,t){for(;e!==null;)e.tag===5?Ep(e.stateNode,e.memoizedProps):e.tag===22&&e.memoizedState!==null||e.tag===30&&t||Hl(e.child,t),e=e.sibling}function Ul(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Ul(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(o(544));var n=t.name;t=fi(t.default,t.share),t!==`none`&&(Bl(e,n,t,null,!1)||Hl(e.child,!1))}e=e.sibling}}function Wl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=ui(r,n),a=fi(r.default,n.paired?r.share:r.enter);a===`none`?Ul(e):Bl(e,i,a,null,!1)?(Ul(e),n.paired||t||jd(e,r.onEnter)):Hl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Wl(e,t),e=e.sibling;else Ul(e)}function Gl(e){if(Fl!==null&&Fl.size!==0){var t=Fl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=fi(n.default,n.share);if(a!==`none`&&(Bl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,jd(e,n.onShare)):Hl(e.child,!1)),t.delete(r),t.size===0)break}}}Gl(e)}e=e.sibling}}}function Kl(e){if(e.tag===30){var t=e.memoizedProps,n=ui(t,e.stateNode),r=Fl===null?void 0:Fl.get(n),i=fi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Bl(e,n,i,null,!1)?r===void 0?jd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Fl.delete(n),jd(e,t.onShare)):Hl(e.child,!1)),Fl!==null&&Gl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Kl(e),e=e.sibling;else Fl!==null&&Gl(e)}function ql(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=ui(t,e.stateNode);t=fi(t.default,t.update),e.flags&=-5,t!==`none`&&Bl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&ql(e);e=e.sibling}}function Jl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Hl(e.child,!1))}Jl(e)}e=e.sibling}}function Yl(e){if(e.tag===30)e.stateNode.paired=null,Hl(e.child,!1),Jl(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Yl(e),e=e.sibling;else Jl(e)}function Xl(e){for(e=e.child;e!==null;)e.tag===30?Hl(e.child,!1):e.subtreeFlags&33554432&&Xl(e),e=e.sibling}function Zl(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&zl<a.length){var l=a[zl],u=Op(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Tp(c,zl===0?n:n+`_`+zl,i),s&&e.flags&4||(Ll===null&&(Ll=[]),Ll.push(c,zl===0?r:r+`_`+zl,t.memoizedProps)),zl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:Zl(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function Ql(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=ui(n,r),a=fi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(kp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;zl=0,i=Zl(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||jd(e,n.onUpdate))}else e.subtreeFlags&33554432&&Ql(e,t);e=e.sibling}}var $l=!1,eu=!1,tu=!1,nu=!1,ru=typeof WeakSet==`function`?WeakSet:Set,iu=null,au=!1,ou=!1,su=!1,cu=!1;function lu(e,t,n){if(e=e.containerInfo,sp=gh,e=Br(e),Vr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(cp={focusedElem:e,selectionRange:r},gh=!1,n=(n&335544064)===n,iu=t,t=n?9270:1024;iu!==null;){if(e=iu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Kl(r[a]);if(e.alternate===null&&e.flags&2)n&&Il(e),uu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Kl(r),uu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Il(e),uu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,iu=r):(n&&ql(e),uu(n))}}Fl=null}function uu(e){for(;iu!==null;){var t=iu,n=e,r=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(i&1024&&r!==null){n=void 0,i=r.memoizedProps,r=r.memoizedState;var a=t.stateNode;try{var s=_c(t.type,i);n=a.getSnapshotBeforeUpdate(s,r),a.__reactInternalSnapshotBeforeUpdate=n}catch(e){ff(t,t.return,e)}}break;case 3:if(i&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)nm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:nm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=ui(r.memoizedProps,r.stateNode),i=t.memoizedProps,i=fi(i.default,i.update),i!==`none`&&Bl(r,n,i,r.memoizedState=[],!0));break;default:if(i&1024)throw Error(o(163))}if(r=t.sibling,r!==null){r.return=t.return,iu=r;break}iu=t.return}}function du(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:ju(e,n),r&4&&gl(5,n);break;case 1:if(ju(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){ff(n,n.return,e)}else{var i=_c(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){ff(n,n.return,e)}}}r&64&&vl(n),r&512&&bl(n,n.return);break;case 3:if(ju(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{vo(e,t)}catch(e){ff(n,n.return,e)}}break;case 27:t===null&&r&4&&Nl(n);case 26:case 5:ju(e,n),t===null&&r&4&&Dl(n),r&512&&bl(n,n.return);break;case 12:ju(e,n);break;case 31:ju(e,n),r&4&&bu(e,n);break;case 13:ju(e,n),r&4&&xu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=gf.bind(null,n),cm(e,n))));break;case 22:if(r=n.memoizedState!==null||$l,!r){var a=t!==null&&t.memoizedState!==null||eu;t=$l,i=eu,$l=r,(eu=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Nu(e,n,r)):ju(e,n),$l=t,eu=i}break;case 30:ju(e,n),r&512&&bl(n,n.return);break;case 7:r&512&&bl(n,n.return);default:ju(e,n)}}function fu(e,t){for(e=e.child;e!==null;)pu(e,t),e=e.sibling}function pu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){ff(e,e.return,t)}mu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,W=!0}catch(t){ff(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?wp(s,!0):wp(e.stateNode,!1)}catch(t){ff(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&fu(e,t);break;default:fu(e,t)}}function mu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:pu(n,r);break a;case 22:n.memoizedState===null&&mu(n,r);break a;default:mu(n,r)}}e=e.sibling}}function hu(e){var t=e.alternate;t!==null&&(e.alternate=null,hu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Et(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var gu=null,_u=!1;function vu(e,t,n){for(n=n.child;n!==null;)yu(e,t,n),n=n.sibling}function yu(e,t,n){if(qe&&typeof qe.onCommitFiberUnmount==`function`)try{qe.onCommitFiberUnmount(Ke,n)}catch{}switch(n.tag){case 26:eu||xl(n,t),vu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!eu&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:eu||xl(n,t),wl(n);var r=gu,i=_u;Sp(n.type)&&(gu=n.stateNode,_u=!1),vu(e,t,n),gm(n.stateNode,n.type,n.memoizedProps),gu=r,_u=i;break;case 5:eu||xl(n,t),wl(n);case 6:if(n.tag===6&&wl(n),r=gu,i=_u,gu=null,vu(e,t,n),gu=r,_u=i,gu!==null){if(_u)try{(gu.nodeType===9?gu.body:gu.nodeName===`HTML`?gu.ownerDocument.body:gu).removeChild(n.stateNode),W=!0}catch(e){ff(n,t,e)}else try{gu.removeChild(n.stateNode),W=!0}catch(e){ff(n,t,e)}}break;case 18:gu!==null&&(_u?(e=gu,Cp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Hh(e)):Cp(gu,n.stateNode));break;case 4:r=gu,i=_u,gu=n.stateNode.containerInfo,_u=!0,vu(e,t,n),gu=r,_u=i;break;case 0:case 11:case 14:case 15:_l(2,n,t),eu||_l(4,n,t),vu(e,t,n);break;case 1:eu||(xl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&yl(n,t,r)),vu(e,t,n);break;case 21:vu(e,t,n);break;case 22:eu=(r=eu)||n.memoizedState!==null,vu(e,t,n),eu=r;break;case 30:xl(n,t),vu(e,t,n);break;case 7:eu||xl(n,t),vu(e,t,n);break;default:vu(e,t,n)}}function bu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Hh(e)}catch(e){ff(t,t.return,e)}}}function xu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Hh(e)}catch(e){ff(t,t.return,e)}}function Su(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ru),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ru),t;default:throw Error(o(435,e.tag))}}function Cu(e,t){var n=Su(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=_f.bind(null,e,t);t.then(r,r)}})}function wu(e,t,n){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var a=r[i],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Sp(l.type)){gu=l.stateNode,_u=!1;break a}break;case 5:gu=l.stateNode,_u=!1;break a;case 3:case 4:gu=l.stateNode.containerInfo,_u=!0;break a}l=l.return}if(gu===null)throw Error(o(160));yu(s,c,a),gu=null,_u=!1,s=a.alternate,s!==null&&(s.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Eu(t,e,n),t=t.sibling}var Tu=null;function Eu(e,t,n){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(i&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var a=0;a<r.length;a++){var s=r[a];s.ref.impl=s.nextImpl}wu(t,e,n),Du(e),i&4&&(_l(3,e,e.return),gl(3,e),_l(5,e,e.return));break;case 1:wu(t,e,n),Du(e),i&512&&(eu||r===null||xl(r,r.return)),i&64&&$l&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(a=Tu,wu(t,e,n),Du(e),i&512&&(eu||r===null||xl(r,r.return)),i&4){if(i=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if($l)e.stateNode=fp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,i=a.ownerDocument||a;b:switch(t){case`title`:r=i.getElementsByTagName(`title`)[0],(!r||r[wt]||r[_t]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=i.createElement(t),i.head.insertBefore(r,i.querySelector(`head > title`))),np(r,t,n),r[_t]=e,jt(r),t=r;break a;case`link`:if(a=Gm(`link`,`href`,i).get(t+(n.href||``))){for(s=0;s<a.length;s++)if(r=a[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){a.splice(s,1);break b}}r=i.createElement(t),np(r,t,n),i.head.appendChild(r);break;case`meta`:if(a=Gm(`meta`,`content`,i).get(t+(n.content||``))){for(s=0;s<a.length;s++)if(r=a[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){a.splice(s,1);break b}}r=i.createElement(t),np(r,t,n),i.head.appendChild(r);break;default:throw Error(o(468,t))}r[_t]=e,jt(r),t=r}e.stateNode=t}}else $l||Km(a,e.type,e.stateNode)}else e.stateNode=Bm(a,n,e.memoizedProps)}else i===n?n===null&&e.stateNode!==null&&Ol(e,e.memoizedProps,r.memoizedProps):(i===null?(t=r.stateNode,t===null||eu||t.parentNode.removeChild(t)):i.count--,n===null?$l||Km(a,e.type,e.stateNode):Bm(a,n,e.memoizedProps))}break;case 27:wu(t,e,n),Du(e),i&512&&(eu||r===null||xl(r,r.return)),r!==null&&i&4&&Ol(e,e.memoizedProps,r.memoizedProps);break;case 5:if(a=tu,tu=!1,wu(t,e,n),tu=a,Du(e),i&512&&(eu||r===null||xl(r,r.return)),e.flags&32){t=e.stateNode;try{nn(t,``),W=!0}catch(t){ff(e,e.return,t)}}i&4&&e.stateNode!=null&&(t=e.memoizedProps,Ol(e,t,r===null?t:r.memoizedProps)),i&1024&&(nu=!0);break;case 6:if(wu(t,e,n),Du(e),i&4){if(e.stateNode===null)throw Error(o(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,W=!0}catch(t){ff(e,e.return,t)}}break;case 3:if(W=!1,Wm=null,a=Tu,Tu=bm(t.containerInfo),wu(t,e,n),Tu=a,Du(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{Hh(t.containerInfo)}catch(t){ff(e,e.return,t)}nu&&(nu=!1,Ou(e)),W=!1;break;case 4:i=tu,tu=$l,r=Vt(),a=Tu,Tu=bm(e.stateNode.containerInfo),wu(t,e,n),Du(e),Tu=a,W&&ou&&(su=!0),W=r,tu=i;break;case 12:wu(t,e,n),Du(e);break;case 31:wu(t,e,n),Du(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Cu(e,t)));break;case 13:wu(t,e,n),Du(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(fd=Le()),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Cu(e,t)));break;case 22:a=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=$l,l=eu,u=tu;$l=c||a,tu=u||a,eu=l||s,wu(t,e,n),eu=l,tu=u,$l=c,Du(e),i&8192&&(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,!a||r===null||s||$l||eu||(t=s||eu,n=$l,r=eu,$l=a||$l,eu=t,Mu(e,2),$l=n,eu=r),!a&&tu||fu(e,a)),i&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Cu(e,n))));break;case 19:wu(t,e,n),Du(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Cu(e,t)));break;case 30:i&512&&(eu||r===null||xl(r,r.return)),i=Vt(),a=ou,s=(n&335544064)===n,c=e.memoizedProps,ou=s&&fi(c.default,c.update)!==`none`,wu(t,e,n),Du(e),s&&r!==null&&W&&(e.flags|=4),ou=a,W=i;break;case 21:break;case 7:i&512&&(eu||r===null||xl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:wu(t,e,n),Du(e)}}function Du(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(kl(r)){n=r;break}r=r.return}r=null;for(var i=e.return;i!==null;){if(El(i)){var a=i.stateNode;r===null?r=[a]:r.push(a)}if(Tl(i))break;i=i.return}var s=r;if(n==null)throw Error(o(160));switch(n.tag){case 27:var c=n.stateNode;Ml(e,Al(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(nn(l,``),n.flags&=-33),Ml(e,Al(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;jl(e,Al(e),u,s);break;default:throw Error(o(161))}}catch(t){ff(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ou(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Ou(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,gh=!0,t.reset(),gh=!1),e=e.sibling}}function ku(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Au(t,e),t=t.sibling;else Ql(t,!1)}function Au(e,t){var n=e.alternate;if(n===null)Wl(e,!1);else switch(e.tag){case 3:if(cu=au=!1,Rl(),ku(t,e),!au&&!su){if(e=Ll,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Ep(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),cu=!0}Ll=null;break;case 5:ku(t,e);break;case 4:r=au,au=!1,ku(t,e),au&&(su=!0),au=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?ku(t,e):Wl(e,!1));break;case 30:r=au,i=Rl(),au=!1,ku(t,e),au&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=ui(a,o),o=ui(n.memoizedProps,o);var s=fi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,zl=0,t=Zl(e,n,t,o,s,a,!0),zl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(jd(e,e.memoizedProps.onUpdate),Ll=i):i!==null&&(i.push.apply(i,Ll),Ll=i),au=e.flags&32?!0:r;break;default:ku(t,e)}}function ju(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)du(e,t.alternate,t),t=t.sibling}function Mu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:_l(4,n,n.return),Mu(n,r);break;case 1:xl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&yl(n,n.return,i),Mu(n,r);break;case 27:r&2&&gm(n.stateNode,n.type,n.memoizedProps);case 5:xl(n,n.return),n.tag!==5&&n.tag!==27||wl(n),Mu(n,r);break;case 6:wl(n);break;case 26:xl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||eu||i.parentNode.removeChild(i),Mu(n,r);break;case 22:n.memoizedState===null&&Mu(n,r);break;case 30:xl(n,n.return),Mu(n,r);break;case 7:xl(n,n.return);default:Mu(n,r)}e=e.sibling}}function Nu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Nu(i,a,n),gl(4,a);break;case 1:if(Nu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){ff(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)_o(l[i],c)}catch(e){ff(r,r.return,e)}}s&&o&64&&vl(a),bl(a,a.return);break;case 27:n&2&&Nl(a);case 5:a.tag!==5&&a.tag!==27||Cl(a),Nu(i,a,n),s&&r===null&&o&4&&Dl(a),bl(a,a.return);break;case 6:Cl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||$l||Km(bm(c.ownerDocument),a.type,c),Nu(i,a,n),s&&r===null&&o&4&&Dl(a),bl(a,a.return);break;case 12:Nu(i,a,n);break;case 31:Nu(i,a,n),s&&o&4&&bu(i,a);break;case 13:Nu(i,a,n),s&&o&4&&xu(i,a);break;case 22:a.memoizedState===null&&Nu(i,a,n),bl(a,a.return);break;case 30:Nu(i,a,n),bl(a,a.return);break;case 7:bl(a,a.return);default:Nu(i,a,n)}t=t.sibling}}function Pu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Ea(n))}function Fu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ea(e))}function Iu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Lu(e,t,n,r),t=t.sibling;else i&&Xl(t)}function Lu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Yl(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Iu(e,t,n,r),a&2048&&gl(9,t);break;case 1:Iu(e,t,n,r);break;case 3:Iu(e,t,n,r),i&&cu&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Ea(a)));break;case 12:if(a&2048){Iu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){ff(t,t.return,e)}}else Iu(e,t,n,r);break;case 31:Iu(e,t,n,r);break;case 13:Iu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&Yl(t),o._visibility&2?Iu(e,t,n,r):(o._visibility|=2,Ru(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&Yl(s),o._visibility&2?Iu(e,t,n,r):zu(e,t)),a&2048&&Pu(s,t);break;case 24:Iu(e,t,n,r),a&2048&&Fu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Hl(a.child,!0),Hl(t.child,!0))),Iu(e,t,n,r);break;default:Iu(e,t,n,r)}}function Ru(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Ru(a,o,s,c,i),gl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Ru(a,o,s,c,i)):u._visibility&2?Ru(a,o,s,c,i):zu(a,o),i&&l&2048&&Pu(o.alternate,o);break;case 24:Ru(a,o,s,c,i),i&&l&2048&&Fu(o.alternate,o);break;default:Ru(a,o,s,c,i)}t=t.sibling}}function zu(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:zu(n,r),i&2048&&Pu(r.alternate,r);break;case 24:zu(n,r),i&2048&&Fu(r.alternate,r);break;default:zu(n,r)}t=t.sibling}}var Bu=8192;function Vu(e,t,n){if(e.subtreeFlags&Bu)for(e=e.child;e!==null;)Hu(e,t,n),e=e.sibling}function Hu(e,t,n){switch(e.tag){case 26:Vu(e,t,n),e.flags&Bu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&Zm(n,e)):Qm(n,Tu,e.memoizedState,e.memoizedProps));break;case 5:Vu(e,t,n),e.flags&Bu&&(e=e.stateNode,(t&335544128)===t&&Zm(n,e));break;case 3:case 4:var r=Tu;Tu=bm(e.stateNode.containerInfo),Vu(e,t,n),Tu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Bu,Bu=16777216,Vu(e,t,n),Bu=r):Vu(e,t,n));break;case 30:if((e.flags&Bu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Fl===null&&(Fl=/* @__PURE__ */ new Map),Fl.set(r,i)}Vu(e,t,n);break;default:Vu(e,t,n)}}function Uu(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Wu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];iu=r,qu(r,e)}Uu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Gu(e),e=e.sibling}function Gu(e){switch(e.tag){case 0:case 11:case 15:Wu(e),e.flags&2048&&_l(9,e,e.return);break;case 3:Wu(e);break;case 12:Wu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ku(e)):Wu(e);break;default:Wu(e)}}function Ku(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];iu=r,qu(r,e)}Uu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:_l(8,t,t.return),Ku(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Ku(t));break;default:Ku(t)}e=e.sibling}}function qu(e,t){for(;iu!==null;){var n=iu;switch(n.tag){case 0:case 11:case 15:_l(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Ea(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,iu=r;else a:for(n=e;iu!==null;){r=iu;var i=r.sibling,a=r.return;if(hu(r),r===n){iu=null;break a}if(i!==null){i.return=a,iu=i;break a}iu=a}}}var Ju={getCacheForType:function(e){var t=va(wa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return va(wa).controller.signal}},Yu=typeof WeakMap==`function`?WeakMap:Map,X=0,Xu=null,Z=null,Q=0,Zu=0,Qu=null,$u=!1,ed=!1,td=!1,nd=0,rd=0,id=0,ad=0,od=0,sd=0,cd=0,ld=null,ud=null,dd=!1,fd=0,pd=0,md=1/0,hd=null,gd=null,_d=0,vd=null,yd=null,bd=0,xd=0,Sd=null,Cd=null,wd=null,Td=null,Ed=null,Dd=0,Od=null;function kd(){return X&2&&Q!==0?Q&-Q:L.T===null?mt():Nf()}function Ad(){if(sd===0){if(!(Q&536870912)||q){var e=$e;$e<<=1,!($e&3932160)&&($e=262144),sd=e}else sd=536870912}return e=wo.current,e!==null&&(e.flags|=32),sd}function jd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Pp(ui(e.memoizedProps,n))),Td===null&&(Td=[]),Td.push(t.bind(null,r))}}function Md(e,t,n){(e===Xu&&(Zu===2||Zu===9)||e.cancelPendingCommit!==null)&&(zd(e,0),Id(e,Q,sd,!1)),st(e,n),X&2&&e===Xu||(e===Xu&&(!(X&2)&&(ad|=n),rd===4&&Id(e,Q,sd,!1)),Tf(e))}function Nd(e,t,n){if(X&6)throw Error(o(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||nt(e,t),i=r?qd(e,t):Gd(e,t,!0),a=r;do{if(i===0){ed&&!r&&Id(e,t,0,!1);break}if(n=e.current.alternate,a&&!Fd(n))i=Gd(e,t,!1),a=!1;else{if(i===2){if(a=t,e.errorRecoveryDisabledLanes&a)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;i=ld;var l=c.current.memoizedState.isDehydrated;if(l&&(zd(c,s).flags|=256),s=Gd(c,s,!1),s!==2&&s!==6){if(td&&!l){c.errorRecoveryDisabledLanes|=a,ad|=a,i=4;break a}a=ud,ud=i,a!==null&&(ud===null?ud=a:ud.push.apply(ud,a))}i=s}if(a=!1,i!==2)continue}}if(i===1){zd(e,0),Id(e,t,0,!0);break}a:{switch(r=e,a=i,a){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Id(r,t,sd,!$u);break a;case 2:ud=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(i=fd+300-Le(),10<i)){if(Id(r,t,sd,!$u),U(r,0,!0)!==0)break a;bd=t,r.timeoutHandle=gp(Pd.bind(null,r,n,ud,hd,dd,t,sd,ad,cd,$u,a,`Throttled`,-0,0),i);break a}Pd(r,n,ud,hd,dd,t,sd,ad,cd,$u,a,null,-0,0)}break}}while(1);Tf(e)}function Pd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:dn},Fl=null,Hu(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=nh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?fd-Le():(a&4194048)===a?pd-Le():0,m=eh(d,m),m!==null)?(bd=a,e.cancelPendingCommit=m(ef.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Id(e,a,o,!l)):ef(e,t,a,n,r,i,o,s,c,l,u,d)}function Fd(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Pr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Id(e,t,n,r){t=rt(e,t),t&=~od,t&=~ad,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-H(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&lt(e,n,t)}function Ld(){return X&6?!0:(Ef(0,!1),!1)}function Rd(){if(Z!==null){if(Zu===0)var e=Z.return;else e=Z,ua=la=null,$o(e),Qa=null,$a=0,e=Z;for(;e!==null;)hl(e.alternate,e),e=e.return;Z=null}}function zd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,_p(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),bd=0,Rd(),Xu=e,Z=n=Di(e.current,null),Q=t,Zu=0,Qu=null,$u=!1,ed=nt(e,t),td=!1,cd=sd=od=ad=id=rd=0,ud=ld=null,dd=!1,nd=rt(e,t),_i(),n}function Bd(e,t){J=null,L.H=lc,t===Ha||t===Wa?(t=Xa(),Zu=3):t===Ua?(t=Xa(),Zu=4):Zu=t===Dc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Qu=t,Z===null&&(rd=1,xc(e,Fi(t,e.current)))}function Vd(){var e=wo.current;return e===null?!0:(Q&4194048)===Q?To===null:(Q&62914560)===Q||Q&536870912?e===To:!1}function Hd(){var e=L.H;return L.H=lc,e===null?lc:e}function Ud(){var e=L.A;return L.A=Ju,e}function Wd(){rd=4,$u||(Q&4194048)!==Q&&wo.current!==null||(ed=!0),!(id&134217727)&&!(ad&134217727)||Xu===null||Id(Xu,Q,sd,!1)}function Gd(e,t,n){var r=X;X|=2;var i=Hd(),a=Ud();(Xu!==e||Q!==t)&&(hd=null,zd(e,t)),t=!1;var o=rd;a:do try{if(Zu!==0&&Z!==null){var s=Z,c=Qu;switch(Zu){case 8:Rd(),o=6;break a;case 3:case 2:case 9:case 6:wo.current===null&&(t=!0);var l=Zu;if(Zu=0,Qu=null,Zd(e,s,c,l),n&&ed){o=0;break a}break;default:l=Zu,Zu=0,Qu=null,Zd(e,s,c,l)}}Kd(),o=rd;break}catch(t){Bd(e,t)}while(1);return t&&e.shellSuspendCounter++,ua=la=null,X=r,L.H=i,L.A=a,Z===null&&(Xu=null,Q=0,_i()),o}function Kd(){for(;Z!==null;)Yd(Z)}function qd(e,t){var n=X;X|=2;var r=Hd(),i=Ud();Xu!==e||Q!==t?(hd=null,md=Le()+500,zd(e,t)):ed=nt(e,t);a:do try{if(Zu!==0&&Z!==null){t=Z;var a=Qu;b:switch(Zu){case 1:Zu=0,Qu=null,Zd(e,t,a,1);break;case 2:case 9:if(Ka(a)){Zu=0,Qu=null,Xd(t);break}t=function(){Zu!==2&&Zu!==9||Xu!==e||(Zu=7),Tf(e)},a.then(t,t);break a;case 3:Zu=7;break a;case 4:Zu=5;break a;case 7:Ka(a)?(Zu=0,Qu=null,Xd(t)):(Zu=0,Qu=null,Zd(e,t,a,7));break;case 5:var s=null;switch(Z.tag){case 26:s=Z.memoizedState;case 5:case 27:var c=Z;if(s?Ym(s):c.stateNode.complete){Zu=0,Qu=null;var l=c.sibling;if(l!==null)Z=l;else{var u=c.return;u===null?Z=null:(Z=u,Qd(u))}break b}}Zu=0,Qu=null,Zd(e,t,a,5);break;case 6:Zu=0,Qu=null,Zd(e,t,a,6);break;case 8:Rd(),rd=6;break a;default:throw Error(o(462))}}Jd();break}catch(t){Bd(e,t)}while(1);return ua=la=null,L.H=r,L.A=i,X=n,Z===null?(Xu=null,Q=0,_i(),rd):0}function Jd(){for(;Z!==null&&!Fe();)Yd(Z)}function Yd(e){var t=ol(e.alternate,e,nd);e.memoizedProps=e.pendingProps,t===null?Qd(e):Z=t}function Xd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Vc(n,t,t.pendingProps,t.type,void 0,Q);break;case 11:t=Vc(n,t,t.pendingProps,t.type.render,t.ref,Q);break;case 5:$o(t);var r=t;r===Xi&&(q?(ra(r),r.tag===5&&r.stateNode!=null&&(Zi=r.stateNode)):(ra(r),q=!0));default:hl(n,t),t=Z=Oi(t,nd),t=ol(n,t,nd)}e.memoizedProps=e.pendingProps,t===null?Qd(e):Z=t}function Zd(e,t,n,r){ua=la=null,$o(t),Qa=null,$a=0;var i=t.return;try{if(Ec(e,i,t,n,Q)){rd=1,xc(e,Fi(n,e.current)),Z=null;return}}catch(t){if(i!==null)throw Z=i,t;rd=1,xc(e,Fi(n,e.current)),Z=null;return}t.flags&32768?(q||r===1?e=!0:ed||Q&536870912?e=!1:($u=e=!0,(r===2||r===9||r===3||r===6)&&(r=wo.current,r!==null&&r.tag===13&&(r.flags|=16384))),$d(t,e)):Qd(t)}function Qd(e){var t=e;do{if(t.flags&32768){$d(t,$u);return}e=t.return;var n=pl(t.alternate,t,nd);if(n!==null){Z=n;return}if(t=t.sibling,t!==null){Z=t;return}Z=t=e}while(t!==null);rd===0&&(rd=5)}function $d(e,t){do{var n=ml(e.alternate,e);if(n!==null){n.flags&=32767,Z=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Z=e;return}Z=e=n}while(e!==null);rd=6,Z=null}function ef(e,t,n,r,i,a,s,c,l,u,d,f){e.cancelPendingCommit=null;do lf();while(_d!==0);if(X&6)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));e===Xu&&(Z=Xu=null,Q=0),yd=t,vd=e,bd=n,Sd=i,Cd=r,tf(e,t,n,s,c,l,f)}}function tf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(xd=s,s|=gi,ct(e,n,s,r,i,a),Td=null,(n&335544064)===n?(Ed=ka(e),r=10262):(Ed=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,vf(Ve,function(){return uf(),null})):(e.callbackNode=null,e.callbackPriority=0),Pl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=L.T,L.T=null,i=R.p,R.p=2,a=X,X|=4;try{lu(e,t,n)}finally{X=a,R.p=i,L.T=r}}_d=1,Pl?wd=Mp(o,e.containerInfo,Ed,af,of,rf,sf,uf,nf,null,null):(af(),of(),sf())}function nf(e){if(_d!==0){var t=vd.onRecoverableError;t(e,{componentStack:null})}}function rf(){_d===3&&(_d=0,Au(yd,vd),_d=4)}function af(){if(_d===1){_d=0;var e=vd,t=yd,n=bd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=L.T,L.T=null;var i=R.p;R.p=2;var a=X;X|=4;try{ou=su=!1,Eu(t,e,n),n=cp;var o=Br(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&zr(s.ownerDocument.documentElement,s)){if(c!==null&&Vr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Rr(s,h),v=Rr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}gh=!!sp,cp=sp=null}finally{X=a,R.p=i,L.T=r}}e.current=t,_d=2}}function of(){if(_d===2){_d=0;var e=vd,t=yd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=L.T,L.T=null;var r=R.p;R.p=2;var i=X;X|=4;try{du(e,t.alternate,t)}finally{X=i,R.p=r,L.T=n}}_d=3}}function sf(){if(_d===4||_d===3){_d=0;var e=wd;wd=null,Ie();var t=vd,n=yd,r=bd,i=Cd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?_d=5:(_d=0,yd=vd=null,cf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(gd=null),pt(r),n=n.stateNode,qe&&typeof qe.onCommitFiberRoot==`function`)try{qe.onCommitFiberRoot(Ke,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=L.T,a=R.p,R.p=2,L.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{L.T=n,R.p=a}}if(i=Td,o=Ed,Ed=null,i!==null&&(Td=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);bd&3&&lf(),Tf(t),a=t.pendingLanes,r&261930&&a&42?t===Od?Dd++:(Dd=0,Od=t):(Dd=0,Od=null),Ef(0,!1)}}function cf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ea(t)))}function lf(){return wd!==null&&(wd.skipTransition(),wd=null),af(),of(),sf(),uf()}function uf(){if(_d!==5)return!1;var e=vd,t=xd;xd=0;var n=pt(bd),r=L.T,i=R.p;try{R.p=32>n?32:n,L.T=null,n=Sd,Sd=null;var a=vd,s=bd;if(_d=0,yd=vd=null,bd=0,X&6)throw Error(o(331));var c=X;if(X|=4,Gu(a.current),Lu(a,a.current,s,n),X=c,Ef(0,!1),qe&&typeof qe.onPostCommitFiberRoot==`function`)try{qe.onPostCommitFiberRoot(Ke,a)}catch{}return!0}finally{R.p=i,L.T=r,cf(e,t)}}function df(e,t,n){t=Fi(n,t),t=Cc(e.stateNode,t,2),e=uo(e,t,2),e!==null&&(st(e,2),Tf(e))}function ff(e,t,n){if(e.tag===3)df(e,e,n);else for(;t!==null;){if(t.tag===3){df(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(gd===null||!gd.has(r))){e=Fi(n,e),n=wc(2),r=uo(t,n,2),r!==null&&(Tc(n,r,t,e),st(r,2),Tf(r));break}}t=t.return}}function pf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Yu;var i=/* @__PURE__ */ new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=/* @__PURE__ */ new Set,r.set(t,i));i.has(n)||(td=!0,i.add(n),e=mf.bind(null,e,t,n),t.then(e,e))}function mf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Xu===e&&(Q&n)===n&&(rd===4||rd===3&&(Q&62914560)===Q&&300>Le()-fd?X&2?od|=n:zd(e,0):od|=n,cd===Q&&(cd=0)),Tf(e)}function hf(e,t){t===0&&(t=at()),e=bi(e,t),e!==null&&(st(e,t),Tf(e))}function gf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),hf(e,n)}function _f(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(o(314))}r!==null&&r.delete(t),hf(e,n)}function vf(e,t){return Ne(e,t)}var yf=null,bf=null,xf=!1,Sf=!1,Cf=!1,wf=0;function Tf(e){e!==bf&&e.next===null&&(bf===null?yf=bf=e:bf=bf.next=e),Sf=!0,xf||(xf=!0,Mf())}function Ef(e,t){if(!Cf&&Sf){Cf=!0;do for(var n=!1,r=yf;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-H(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,jf(r,a))}else a=Q,a=U(r,r===Xu?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||nt(r,a)||(n=!0,jf(r,a))}r=r.next}while(n);Cf=!1}}function Df(){Of()}function Of(){Sf=xf=!1;var e=0;wf!==0&&hp()&&(e=wf);for(var t=Le(),n=null,r=yf;r!==null;){var i=r.next,a=kf(r,t);a===0?(r.next=null,n===null?yf=i:n.next=i,i===null&&(bf=n)):(n=r,(e!==0||a&3)&&(Sf=!0)),r=i}_d!==0&&_d!==5||Ef(e,!1),wf!==0&&(wf=0)}function kf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-H(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=it(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Xu,n=Q,n=U(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Zu===2||Zu===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Pe(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||nt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Pe(r),pt(n)){case 2:case 8:n=Be;break;case 32:n=Ve;break;case 268435456:n=Ue;break;default:n=Ve}return r=Af.bind(null,e),n=Ne(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Pe(r),e.callbackPriority=2,e.callbackNode=null,2}function Af(e,t){if(_d!==0&&_d!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(lf()&&e.callbackNode!==n)return null;var r=Q;return r=U(e,e===Xu?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Nd(e,r,t),kf(e,Le()),e.callbackNode!=null&&e.callbackNode===n?Af.bind(null,e):null)}function jf(e,t){if(lf())return null;Nd(e,t,!0)}function Mf(){bp(function(){X&6?Ne(ze,Df):Of()})}function Nf(){if(wf===0){var e=Ma;e===0&&(e=Qe,Qe<<=1,!(Qe&261888)&&(Qe=256)),wf=e}return wf}function Pf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:un(e)}function Ff(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Pf((i[vt]||null).action),o=r.submitter;o&&(t=(t=o[vt]||null)?Pf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Mn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(wf!==0){var e=new FormData(i,o);Ys(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),Ys(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var If=0;If<si.length;If++){var Lf=si[If];ci(Lf.toLowerCase(),`on`+(Lf[0].toUpperCase()+Lf.slice(1)))}ci($r,`onAnimationEnd`),ci(ei,`onAnimationIteration`),ci(ti,`onAnimationStart`),ci(`dblclick`,`onDoubleClick`),ci(`focusin`,`onFocus`),ci(`focusout`,`onBlur`),ci(ni,`onTransitionRun`),ci(ri,`onTransitionStart`),ci(ii,`onTransitionCancel`),ci(ai,`onTransitionEnd`),It(`onMouseEnter`,[`mouseout`,`mouseover`]),It(`onMouseLeave`,[`mouseout`,`mouseover`]),It(`onPointerEnter`,[`pointerout`,`pointerover`]),It(`onPointerLeave`,[`pointerout`,`pointerover`]),Ft(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Ft(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Ft(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Ft(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Ft(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Ft(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Rf=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),zf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Rf));function Bf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){pi(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){pi(e)}i.currentTarget=null,a=c}}}}function $(e,t){var n=t[bt];n===void 0&&(n=t[bt]=/* @__PURE__ */ new Set);var r=e+`__bubble`;n.has(r)||(Wf(t,e,2,!1),n.add(r))}function Vf(e,t,n){var r=0;t&&(r|=4),Wf(n,e,r,t)}var Hf=`_reactListening`+Math.random().toString(36).slice(2);function Uf(e){if(!e[Hf]){e[Hf]=!0,Nt.forEach(function(t){t!==`selectionchange`&&(zf.has(t)||Vf(t,!1,e),Vf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Hf]||(t[Hf]=!0,Vf(`selectionchange`,!1,t))}}function Wf(e,t,n,r){switch(Ch(t)){case 2:var i=_h;break;case 8:i=vh;break;default:i=yh}n=i.bind(null,t,n,e),i=void 0,!xn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Gf(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;s!==null;){if(o=Dt(s),o===null)return;if(l=o.tag,l===5||l===6||l===26||l===27){r=a=o;continue a}s=s.parentNode}}r=r.return}vn(function(){var r=a,i=pn(n),o=[];a:{var s=oi.get(e);if(s!==void 0){var l=Mn,u=e;switch(e){case`keypress`:if(Dn(n)===0)break a;case`keydown`:case`keyup`:l=Xn;break;case`focusin`:u=`focus`,l=Vn;break;case`focusout`:u=`blur`,l=Vn;break;case`beforeblur`:case`afterblur`:l=Vn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=zn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Bn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=$n;break;case $r:case ei:case ti:l=Hn;break;case ai:l=er;break;case`scroll`:case`scrollend`:l=Pn;break;case`wheel`:l=tr;break;case`copy`:case`cut`:case`paste`:l=Un;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Zn;break;case`submit`:l=Qn;break;case`toggle`:case`beforetoggle`:l=nr}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?s===null?null:s+`Capture`:s;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=yn(m,p),g!=null&&d.push(Kf(m,g,h))),f)break;m=m.return}0<d.length&&(s=new l(s,u,null,n,i),o.push({event:s,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,s=e===`mouseout`||e===`pointerout`,l&&n!==fn&&(u=n.relatedTarget||n.fromElement)&&(Dt(u)||u[yt]))break a;(s||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,s?(l=n.relatedTarget||n.toElement,s=r,l=l?Dt(l):null,l!==null&&(f=c(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(s=null,l=r),s!==l&&(d=zn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Zn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=s==null?u:kt(s),h=l==null?u:kt(l),u=new d(g,m+`leave`,s,n,i),u.target=f,u.relatedTarget=h,g=null,Dt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=s&&l?T(s,l,Jf):null,s!==null&&Yf(o,u,s,d,!1),l!==null&&f!==null&&Yf(o,f,l,d,!0)))}a:{if(s=r?kt(r):window,l=s.nodeName&&s.nodeName.toLowerCase(),l===`select`||l===`input`&&s.type===`file`)var _=Sr;else if(gr(s)){if(Cr)_=Mr;else{_=Ar;var v=kr}}else l=s.nodeName,!l||l.toLowerCase()!==`input`||s.type!==`checkbox`&&s.type!==`radio`?r&&sn(r.elementType)&&(_=Sr):_=jr;if(_&&=_(e,r)){_r(o,_,n,i);break a}v&&v(e,s,r)}switch(v=r?kt(r):window,e){case`focusin`:(gr(v)||v.contentEditable===`true`)&&(Ur=v,Wr=r,Gr=null);break;case`focusout`:Gr=Wr=Ur=null;break;case`mousedown`:Kr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Kr=!1,qr(o,n,i);break;case`selectionchange`:if(Hr)break;case`keydown`:case`keyup`:qr(o,n,i)}var y;if(ir)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else fr?ur(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(sr&&n.locale!==`ko`&&(fr||b!==`onCompositionStart`?b===`onCompositionEnd`&&fr&&(y=En()):(Cn=i,wn=`value`in Cn?Cn.value:Cn.textContent,fr=!0)),v=qf(r,b),0<v.length&&(b=new Wn(b,e,null,n,i),o.push({event:b,listeners:v}),y?b.data=y:(y=dr(n),y!==null&&(b.data=y)))),(y=or?pr(e,n):mr(e,n))&&(b=qf(r,`onBeforeInput`),0<b.length&&(v=new Wn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:v,listeners:b}),v.data=y)),Ff(o,e,r,n,i)}Bf(o,t)})}function Kf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function qf(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=yn(e,n),i!=null&&r.unshift(Kf(e,i,a)),i=yn(e,t),i!=null&&r.push(Kf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Jf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Yf(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=yn(n,a),l!=null&&o.unshift(Kf(n,l,c))):i||(l=yn(n,a),l!=null&&o.push(Kf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Xf=/\r\n?/g,Zf=/\u0000|\uFFFD/g;function Qf(e){return(typeof e==`string`?e:``+e).replace(Xf,`
9
+ `).replace(Zf,``)}function $f(e,t){return t=Qf(t),Qf(e)===t}function ep(e,t,n,r,i,a){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||nn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&nn(e,``+r);else return;break;case`className`:Ut(e,`class`,r);break;case`tabIndex`:Ut(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Ut(e,n,r);break;case`style`:on(e,r,a);return;case`data`:if(t!==`object`){Ut(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=un(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof a==`function`&&(n===`formAction`?(t!==`input`&&ep(e,t,`name`,i.name,i,null),ep(e,t,`formEncType`,i.formEncType,i,null),ep(e,t,`formMethod`,i.formMethod,i,null),ep(e,t,`formTarget`,i.formTarget,i,null)):(ep(e,t,`encType`,i.encType,i,null),ep(e,t,`method`,i.method,i,null),ep(e,t,`target`,i.target,i,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=un(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=dn);return;case`onScroll`:r!=null&&$(`scroll`,e);return;case`onScrollEnd`:r!=null&&$(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(o(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(o(60));a?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=un(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:$(`beforetoggle`,e),$(`toggle`,e),Ht(e,`popover`,r);break;case`xlinkActuate`:G(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:G(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:G(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:G(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:G(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:G(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:G(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:G(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:G(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Ht(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=cn.get(n)||n,Ht(e,n,r);else return}W=!0}function tp(e,t,n,r,i,a){switch(n){case`style`:on(e,r,a);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(o(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(o(60));a?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)nn(e,r);else if(typeof r==`number`||typeof r==`bigint`)nn(e,``+r);else return;break;case`onScroll`:r!=null&&$(`scroll`,e);return;case`onScrollEnd`:r!=null&&$(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=dn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Pt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),a=n.slice(2,i?n.length-7:void 0),t=e[vt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(a,t,i),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(a,r,i);break a}W=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Ht(e,n,r)}return}W=!0}function np(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:$(`error`,e),$(`load`,e);var r=!1,i=!1,a;for(a in n)if(n.hasOwnProperty(a)){var s=n[a];if(s!=null)switch(a){case`src`:r=!0;break;case`srcSet`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(o(137,t));default:ep(e,t,a,s,n,null)}}i&&ep(e,t,`srcSet`,n.srcSet,n,null),r&&ep(e,t,`src`,n.src,n,null);return;case`input`:$(`invalid`,e);var c=a=s=i=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:i=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:a=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(o(137,t));break;default:ep(e,t,r,d,n,null)}}Zt(e,a,c,l,u,s,i,!1);return;case`select`:for(i in $(`invalid`,e),r=s=a=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:a=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:ep(e,t,i,c,n,null)}t=a,n=s,e.multiple=!!r,t==null?n!=null&&$t(e,!!r,n,!0):$t(e,!!r,t,!1);return;case`textarea`:for(s in $(`invalid`,e),a=i=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:a=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(o(91));break;default:ep(e,t,s,c,n,null)}tn(e,r,i,a);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:ep(e,t,l,r,n,null)}return;case`dialog`:$(`beforetoggle`,e),$(`toggle`,e),$(`cancel`,e),$(`close`,e);break;case`iframe`:case`object`:$(`load`,e);break;case`video`:case`audio`:for(r=0;r<Rf.length;r++)$(Rf[r],e);break;case`image`:$(`error`,e),$(`load`,e);break;case`details`:$(`toggle`,e);break;case`embed`:case`source`:case`link`:$(`error`,e),$(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(o(137,t));default:ep(e,t,u,r,n,null)}return;default:if(sn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&tp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&ep(e,t,c,r,n,null))}var rp={};function ip(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var i=null,a=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||ep(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(W=!0),a=m;break;case`name`:m!==f&&(W=!0),i=m;break;case`checked`:m!==f&&(W=!0),u=m;break;case`defaultChecked`:m!==f&&(W=!0),d=m;break;case`value`:m!==f&&(W=!0),s=m;break;case`defaultValue`:m!==f&&(W=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(o(137,t));break;default:m!==f&&ep(e,t,p,m,r,f)}}Xt(e,s,c,l,u,d,a,i);return;case`select`:for(a in m=s=c=p=null,n)if(l=n[a],n.hasOwnProperty(a)&&l!=null)switch(a){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(a)||ep(e,t,a,null,r,l)}for(i in r)if(a=r[i],l=n[i],r.hasOwnProperty(i)&&(a!=null||l!=null))switch(i){case`value`:a!==l&&(W=!0),p=a;break;case`defaultValue`:a!==l&&(W=!0),c=a;break;case`multiple`:a!==l&&(W=!0),s=a;default:a!==l&&ep(e,t,i,a,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?$t(e,!!n,n?[]:``,!1):$t(e,!!n,t,!0)):$t(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:ep(e,t,c,null,r,i)}for(s in r)if(i=r[s],a=n[s],r.hasOwnProperty(s)&&(i!=null||a!=null))switch(s){case`value`:i!==a&&(W=!0),p=i;break;case`defaultValue`:i!==a&&(W=!0),m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(o(91));break;default:i!==a&&ep(e,t,s,i,r,a)}en(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:ep(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(W=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:ep(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&ep(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(o(137,t));break;default:ep(e,t,u,p,r,m)}return;default:if(sn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&tp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||tp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&ep(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||ep(e,t,f,p,r,m)}function ap(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function op(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&ap(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&ap(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var sp=null,cp=null;function lp(e){return e.nodeType===9?e:e.ownerDocument}function up(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function dp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function fp(e,t,n,r){return n=lp(n).createElement(e),n[_t]=r,n[vt]=t,np(n,e,t),jt(n),n}function pp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var mp=null;function hp(){var e=window.event;return e&&e.type===`popstate`?e!==mp&&(mp=e,!0):(mp=null,!1)}var gp=typeof setTimeout==`function`?setTimeout:void 0,_p=typeof clearTimeout==`function`?clearTimeout:void 0,vp=typeof Promise==`function`?Promise:void 0,yp=typeof requestAnimationFrame==`function`?requestAnimationFrame:gp,bp=typeof queueMicrotask==`function`?queueMicrotask:vp===void 0?gp:function(e){return vp.resolve(null).then(e).catch(xp)};function xp(e){setTimeout(function(){throw e})}function Sp(e){return e===`head`}function Cp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Hh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)_m(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,_m(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[wt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&_m(e.ownerDocument.body)}n=i}while(n);Hh(t)}function wp(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Tp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Ep(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Dp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Op(e){return Dp(e.getBoundingClientRect(),getComputedStyle(e),e)}function kp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Dp(t,n,e)}function Ap(e){return e.documentElement.clientHeight}function jp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Mp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Ap(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=Xm(f),u>$m){s.length=o;break}f=new Promise(jp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Np(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Np.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:E({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Np.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Np.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Pp(e){return{name:e,group:new Np(`group`,e),imagePair:new Np(`image-pair`,e),old:new Np(`old`,e),new:new Np(`new`,e)}}function Fp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Fp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Bp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Rp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),m(this._fragmentFiber.child,!1,Ip,e,s,r)}this._eventListeners=a}};function Ip(e,t,n,r){return y(e).addEventListener(t,n,r),!1}Fp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Bp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Rp(i.optionsOrUseCapture),m(this._fragmentFiber.child,!1,Lp,e,n,i),r.splice(t,1),a!==null&&a()}};function Lp(e,t,n,r){return y(e).removeEventListener(t,n,r),!1}function Rp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function zp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Bp(e,t,n,r){if(e.length===0)return-1;r=zp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&zp(a.optionsOrUseCapture)===r)return i}return-1}Fp.prototype.dispatchEvent=function(e){var t=h(this._fragmentFiber);if(t===null)return!0;t=y(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Fp.prototype.focus=function(e){m(this._fragmentFiber.child,!0,Vp,e,void 0,void 0)};function Vp(e,t){return e.tag!==6&&(e=y(e),pm(e,t))}Fp.prototype.focusLast=function(e){var t=[];m(this._fragmentFiber.child,!0,Hp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Vp(t[n],e);n--);};function Hp(e,t){return t.push(e),!1}Fp.prototype.blur=function(){var e=h(this._fragmentFiber);e!==null&&(e=y(e),e=lp(e).activeElement,e!==null&&m(this._fragmentFiber.child,!1,Up,e,void 0,void 0))};function Up(e,t){return e.tag!==6&&(e=y(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Fp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=/* @__PURE__ */ new Set),this._observers.add(e),m(this._fragmentFiber.child,!1,Wp,e,void 0,void 0)};function Wp(e,t){return e.tag===6||(e=y(e),t.observe(e)),!1}Fp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),m(this._fragmentFiber.child,!1,Gp,e,void 0,void 0);for(var n=t=0;n<Kp.length;n++){var r=Kp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Kp[t++]=r}Kp.length=t}};function Gp(e,t){return e.tag===6||(e=y(e),t.unobserve(e)),!1}var Kp=[],qp=!1;function Jp(e,t,n){Kp.push({fragmentInstance:e,observer:t,instance:n}),qp||(qp=!0,mm(function(){qp=!1;var e=Kp;Kp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Fp.prototype.getClientRects=function(){var e=[];return m(this._fragmentFiber.child,!1,Yp,e,void 0,void 0),e};function Yp(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=y(e),t.push.apply(t,e.getClientRects());return!1}Fp.prototype.getRootNode=function(e){var t=h(this._fragmentFiber);return t===null?this:y(t).getRootNode(e)},Fp.prototype.compareDocumentPosition=function(e){var t=h(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];m(this._fragmentFiber.child,!1,Hp,n,void 0,void 0);var r=y(t);if(n.length===0){if(n=r,g(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=_(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=y(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=y(n[0]),i=y(n[n.length-1]);var a=g(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Xp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Xp(e,t,n,r,i){var a=Dt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=h(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=T(n,a,w),t===null?t=!1:(m(t,!0,S,a,n),a=b,b=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=T(r,a,w),t===null?t=!1:(m(t,!0,C,a,r),a=b,x=b=null,t=a!==null)),t):!1}function Zp(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Fp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(o(566));var t=[];m(this._fragmentFiber.child,!1,Hp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=_(this._fragmentFiber);if(r=n?r[1]||r[0]||h(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=y(r),Zp(e,n);return}if(r=y(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var i=t[r];i.tag===6?(i=y(i),Zp(i,n)):y(i).scrollIntoView(e),r+=n?-1:1}};function Qp(e,t){return e=y(e),$p(e,t),!1}function $p(e,t){e.reactFragments??=/* @__PURE__ */ new Set,e.reactFragments.add(t)}function em(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Kp.length;i++){var a=Kp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Kp[r++]=a)}Kp.length=r,n.observe(e)}),$p(e,t))}function tm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Jp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function nm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:nm(n),Et(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function rm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[wt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=lm(e.nextSibling),e===null)break}return null}function im(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=lm(e.nextSibling),e===null))return null;return e}function am(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=lm(e.nextSibling),e===null))return null;return e}function om(e){return e.data===`$?`||e.data===`$~`}function sm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function cm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function lm(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var um=null;function dm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return lm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function fm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function pm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function mm(e){yp(function(){yp(function(t){return e(t)})})}function hm(e,t,n){switch(t=lp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(o(452));return e;case`head`:if(e=t.head,!e)throw Error(o(453));return e;case`body`:if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function gm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&ep(e,t,r,null,rp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===dn&&(e.onclick=null),Et(e)}function _m(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Et(e)}var vm=/* @__PURE__ */ new Map,ym=/* @__PURE__ */ new Set;function bm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var xm=R.d;R.d={f:Sm,r:Cm,D:Em,C:Dm,L:Om,m:km,X:jm,S:Am,M:Mm};function Sm(){var e=xm.f(),t=Ld();return e||t}function Cm(e){var t=Ot(e);t!==null&&t.tag===5&&t.type===`form`?Zs(t):xm.r(e)}var wm=typeof document>`u`?null:document;function Tm(e,t,n){var r=wm;if(r&&typeof t==`string`&&t){var i=Yt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),ym.has(i)||(ym.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),np(t,`link`,e),jt(t),r.head.appendChild(t)))}}function Em(e){xm.D(e),Tm(`dns-prefetch`,e,null)}function Dm(e,t){xm.C(e,t),Tm(`preconnect`,e,t)}function Om(e,t,n){xm.L(e,t,n);var r=wm;if(r&&e&&t){var i=`link[rel="preload"][as="`+Yt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Yt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Yt(n.imageSizes)+`"]`)):i+=`[href="`+Yt(e)+`"]`;var a=i;switch(t){case`style`:a=Pm(e);break;case`script`:a=Rm(e)}if(!(vm.has(a)||(e=E({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),vm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Fm(a))||t===`script`&&r.querySelector(zm(a))))){var o=r.createElement(`link`);np(o,`link`,e),t===`style`&&(o[Tt]=!0,o.onload=o.onerror=function(){Mt(o)}),jt(o),r.head.appendChild(o)}}}function km(e,t){xm.m(e,t);var n=wm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Yt(r)+`"][href="`+Yt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Rm(e)}if(!vm.has(a)&&(e=E({rel:`modulepreload`,href:e},t),vm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(zm(a)))return}r=n.createElement(`link`),np(r,`link`,e),jt(r),n.head.appendChild(r)}}}function Am(e,t,n){xm.S(e,t,n);var r=wm;if(r&&e){var i=At(r).hoistableStyles,a=Pm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Fm(a)))s.loading=5;else{e=E({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=vm.get(a))&&Hm(e,n);var c=o=r.createElement(`link`);jt(c),np(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Vm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function jm(e,t){xm.X(e,t);var n=wm;if(n&&e){var r=At(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=E({src:e,async:!0},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),jt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mm(e,t){xm.M(e,t);var n=wm;if(n&&e){var r=At(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=E({src:e,async:!0,type:`module`},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),jt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t,n,r){var i=(i=ve.current)?bm(i):null;if(!i)throw Error(o(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Pm(n.href),t=At(i).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Pm(n.href);var a=At(i).hoistableStyles,s=a.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},a.set(e,s),(a=i.querySelector(Fm(e)))?a._p||(s.instance=a,s.state.loading=5):(a=vm.get(e),a||(a={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},vm.set(e,a)),Lm(i,e,a,s.state))),t&&r===null)throw Error(o(528,``));return s}if(t&&r!==null)throw Error(o(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Rm(n),t=At(i).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Pm(e){return`href="`+Yt(e)+`"`}function Fm(e){return`link[rel="stylesheet"][`+e+`]`}function Im(e){return E({},e,{"data-precedence":e.precedence,precedence:null})}function Lm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Tt]){r.loading=1;return}}else t=e.createElement(`link`),t[Tt]=!0,t.onload=t.onerror=Mt.bind(null,t),np(t,`link`,n),jt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Rm(e){return`[src="`+Yt(e)+`"]`}function zm(e){return`script[async]`+e}function Bm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Yt(n.href)+`"]`);if(r)return t.instance=r,jt(r),r;var i=E({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),jt(r),np(r,`style`,i),Vm(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Pm(n.href);var a=e.querySelector(Fm(i));if(a)return t.state.loading|=4,t.instance=a,jt(a),a;r=Im(n),(i=vm.get(i))&&Hm(r,i),a=(e.ownerDocument||e).createElement(`link`),jt(a);var s=a;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),np(a,`link`,r),t.state.loading|=4,Vm(a,n.precedence,e),t.instance=a;case`script`:return a=Rm(n.src),(i=e.querySelector(zm(a)))?(t.instance=i,jt(i),i):(r=n,(i=vm.get(a))&&(r=E({},n),Um(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),jt(i),np(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(o(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Vm(r,n.precedence,e));return t.instance}function Vm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Hm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Um(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Wm=null;function Gm(e,t,n){if(Wm===null){var r=/* @__PURE__ */ new Map,i=Wm=/* @__PURE__ */ new Map;i.set(n,r)}else i=Wm,r=i.get(n),r||(r=/* @__PURE__ */ new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[wt]||a[_t]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Km(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function qm(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Jm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Ym(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Xm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Zm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Xm(t),e.suspenseyImages.push(t)),e=rh.bind(e),t.decode().then(e,e))}function Qm(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Pm(r.href),a=t.querySelector(Fm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=nh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,jt(a);return}a=t.ownerDocument||t,r=Im(r),(i=vm.get(i))&&Hm(r,i),a=a.createElement(`link`),jt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),np(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=/* @__PURE__ */ new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=nh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var $m=0;function eh(e,t){return e.stylesheets&&e.count===0&&ah(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&$m===0&&($m=62500*op());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>$m?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function th(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ah(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function nh(){this.count--,th(this)}function rh(){this.imgCount--,th(this)}var ih=null;function ah(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ih=/* @__PURE__ */ new Map,t.forEach(oh,e),ih=null,nh.call(e))}function oh(e,t){if(!(t.state.loading&4)){var n=ih.get(e);if(n)var r=n.get(null);else{n=/* @__PURE__ */ new Map,ih.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=nh.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var sh={$$typeof:P,Provider:null,Consumer:null,_currentValue:pe,_currentValue2:pe,_threadCount:0};function ch(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ot(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ot(0),this.hiddenUpdates=ot(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=/* @__PURE__ */ new Map}function lh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ch(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Ti(3,null,null,t),e.current=a,a.stateNode=e,t=Ta(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},so(a),e}function uh(e){return e?(e=Ci,e):Ci}function dh(e,t,n,r,i,a){i=uh(i),r.context===null?r.context=i:r.pendingContext=i,r=lo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=uo(e,r,t),n!==null&&(Md(n,e,t),fo(n,e,t))}function fh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ph(e,t){fh(e,t),(e=e.alternate)&&fh(e,t)}function mh(e){if(e.tag===13||e.tag===31){var t=bi(e,67108864);t!==null&&Md(t,e,67108864),ph(e,67108864)}}function hh(e){if(e.tag===13||e.tag===31){var t=kd();t=ft(t);var n=bi(e,t);n!==null&&Md(n,e,t),ph(e,t)}}var gh=!0;function _h(e,t,n,r){var i=L.T;L.T=null;var a=R.p;try{R.p=2,yh(e,t,n,r)}finally{R.p=a,L.T=i}}function vh(e,t,n,r){var i=L.T;L.T=null;var a=R.p;try{R.p=8,yh(e,t,n,r)}finally{R.p=a,L.T=i}}function yh(e,t,n,r){if(gh){var i=bh(r);if(i===null)Gf(e,t,r,xh,n),Mh(e,r);else if(Ph(i,e,t,n,r))r.stopPropagation();else if(Mh(e,r),t&4&&-1<jh.indexOf(e)){for(;i!==null;){var a=Ot(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=tt(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-H(o);s.entanglements[1]|=c,o&=~c}Tf(a),!(X&6)&&(md=Le()+500,Ef(0,!1))}}break;case 31:case 13:s=bi(a,2),s!==null&&Md(s,a,2),Ld(),ph(a,2)}if(a=bh(r),a===null&&Gf(e,t,r,xh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Gf(e,t,r,null,n)}}function bh(e){return e=pn(e),Sh(e)}var xh=null;function Sh(e){if(xh=null,e=Dt(e),e!==null){var t=c(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=l(t),e!==null)return e;e=null}else if(n===31){if(e=u(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return xh=e,null}function Ch(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`fullscreenerror`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Re()){case ze:return 2;case Be:return 8;case Ve:case He:return 32;case Ue:return 268435456;default:return 32}default:return 32}}var wh=!1,Th=null,Eh=null,Dh=null,Oh=/* @__PURE__ */ new Map,kh=/* @__PURE__ */ new Map,Ah=[],jh=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Mh(e,t){switch(e){case`focusin`:case`focusout`:Th=null;break;case`dragenter`:case`dragleave`:Eh=null;break;case`mouseover`:case`mouseout`:Dh=null;break;case`pointerover`:case`pointerout`:Oh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:kh.delete(t.pointerId)}}function Nh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Ot(t),t!==null&&mh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ph(e,t,n,r,i){switch(t){case`focusin`:return Th=Nh(Th,e,t,n,r,i),!0;case`dragenter`:return Eh=Nh(Eh,e,t,n,r,i),!0;case`mouseover`:return Dh=Nh(Dh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Oh.set(a,Nh(Oh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,kh.set(a,Nh(kh.get(a)||null,e,t,n,r,i)),!0}return!1}function Fh(e){var t=Dt(e.target);if(t!==null){var n=c(t);if(n!==null){if(t=n.tag,t===13){if(t=l(n),t!==null){e.blockedOn=t,ht(e.priority,function(){hh(n)});return}}else if(t===31){if(t=u(n),t!==null){e.blockedOn=t,ht(e.priority,function(){hh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ih(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=bh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);fn=r,n.target.dispatchEvent(r),fn=null}else return t=Ot(n),t!==null&&mh(t),e.blockedOn=n,!1;t.shift()}return!0}function Lh(e,t,n){Ih(e)&&n.delete(t)}function Rh(){wh=!1,Th!==null&&Ih(Th)&&(Th=null),Eh!==null&&Ih(Eh)&&(Eh=null),Dh!==null&&Ih(Dh)&&(Dh=null),Oh.forEach(Lh),kh.forEach(Lh)}function zh(e,n){e.blockedOn===n&&(e.blockedOn=null,wh||(wh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Rh)))}var Bh=null;function Vh(e){Bh!==e&&(Bh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Bh===e&&(Bh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Sh(r||n)===null)continue;break}var a=Ot(n);a!==null&&(e.splice(t,3),t-=3,Ys(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Hh(e){function t(t){return zh(t,e)}Th!==null&&zh(Th,e),Eh!==null&&zh(Eh,e),Dh!==null&&zh(Dh,e),Oh.forEach(t),kh.forEach(t);for(var n=0;n<Ah.length;n++){var r=Ah[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ah.length&&(n=Ah[0],n.blockedOn===null);)Fh(n),n.blockedOn===null&&Ah.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[vt]||null;if(typeof a==`function`)o||Vh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[vt]||null)s=o.formAction;else if(Sh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Vh(n)}}}function Uh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Wh(e){this._internalRoot=e}Gh.prototype.render=Wh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var n=t.current;dh(n,kd(),e,t,null,null)},Gh.prototype.unmount=Wh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;dh(e.current,2,null,e,null,null),Ld(),t[yt]=null}};function Gh(e){this._internalRoot=e}Gh.prototype.unstable_scheduleHydration=function(e){if(e){var t=mt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ah.length&&t!==0&&t<Ah[n].priority;n++);Ah.splice(n,0,e),n===0&&Fh(e)}};var Kh=i.version;if(Kh!==`19.3.1`)throw Error(o(527,Kh,`19.3.1`));R.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(o(188)):(e=Object.keys(e).join(`,`),Error(o(268,e)));return e=f(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var qh={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:L,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Jh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jh.isDisabled&&Jh.supportsFiber)try{Ke=Jh.inject(qh),qe=Jh}catch{}}e.createRoot=function(e,t){if(!s(e))throw Error(o(299));var n=!1,r=``,i=vc,a=yc,c=bc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(a=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=lh(e,1,!1,null,null,n,r,null,i,a,c,Uh),e[yt]=t.current,Uf(e),new Wh(t)}})),Ut=/* @__PURE__ */ t(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Ht()})),G=/* @__PURE__ */ e(n(),1),K=a(),Wt=G.createContext(void 0),Gt=e=>{let t=G.useContext(Wt);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Kt=({client:e,children:t})=>(G.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),/* @__PURE__ */ (0,K.jsx)(Wt.Provider,{value:e,children:t})),qt={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Jt=new class{#e=qt;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function Yt(e){setTimeout(e,0)}var Xt=typeof window>`u`||`Deno`in globalThis;function Zt(){}function Qt(e,t){return typeof e==`function`?e(t):e}function $t(e){return typeof e==`number`&&e>=0&&e!==1/0}function en(e,t){return Math.max(e+(t||0)-Date.now(),0)}function tn(e,t){return typeof e==`function`?e(t):e}function nn(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==an(o,t.options))return!1}else if(!sn(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function rn(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(on(t.options.mutationKey)!==on(a))return!1}else if(!sn(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function an(e,t){return(t?.queryKeyHashFn||on)(e)}function on(e){return JSON.stringify(e,(e,t)=>fn(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function sn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(!sn(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!sn(e[r],t[r]))return!1;return!0}return!1}var cn=Object.prototype.hasOwnProperty;function ln(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=dn(e)&&dn(t);if(!r&&!(fn(e)&&fn(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:cn.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=ln(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function un(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function dn(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function fn(e){if(!pn(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!pn(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function pn(e){return Object.prototype.toString.call(e)===`[object Object]`}function mn(e){return new Promise(t=>{Jt.setTimeout(t,e)})}function hn(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:ln(e,t)}function gn(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function _n(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var vn=Symbol();function yn(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===vn?()=>Promise.reject(/* @__PURE__ */ Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function bn(e,t){return typeof e==`function`?e(...t):!!e}function xn(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0})),i)}),e}var Sn=()=>Xt,Cn=()=>Sn(),wn=class{constructor(){this.listeners=/* @__PURE__ */ new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Tn=new class extends wn{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},En=Yt;function Dn(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=En,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var On=Dn(),kn=new class extends wn{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function An(e){return Math.min(1e3*2**e,3e4)}function jn(e){return(e??`online`)!==`online`||kn.isOnline()}var Mn=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Nn(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(Zt);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new Mn(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>Tn.isFocused()&&(e.networkMode===`always`||kn.isOnline())&&e.canRun(),p=()=>jn(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=t=>new Promise(n=>{r=e=>{(c()||t())&&n(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(Cn()?0:3),a=e.retryDelay??An,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);t||!s?h(r):(n++,e.onFail?.(n,r),mn(o).then(()=>f()?void 0:g(f)).then(()=>{t?h(r):_()}))})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g(p).then(_),s)}}var Pn=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),$t(this.gcTime)&&(this.#e=Jt.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Cn()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(Jt.clearTimeout(this.#e),this.#e=void 0)}};function Fn(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{xn(e,()=>t.signal,()=>n=!0)},u=yn(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?_n:gn;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?Ln:In,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]===void 0?r.initialPageParam:o[0]:In(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function In(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Ln(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Rn=class extends Pn{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Vn(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Vn(this.options);e.data!==void 0&&(this.setState(Bn(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=hn(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(Zt).catch(Zt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>tn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===vn||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>tn(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!en(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=yn(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?Fn(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=Nn({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Mn&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Mn){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...zn(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Bn(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),On.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function zn(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:jn(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Bn(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Vn(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Hn=class extends wn{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=/* @__PURE__ */ new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Wn(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Gn(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Gn(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=/* @__PURE__ */ new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof tn(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!un(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Kn(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||tn(this.options.enabled,this.#t)!==tn(t.enabled,this.#t)||tn(this.options.staleTime,this.#t)!==tn(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||tn(this.options.enabled,this.#t)!==tn(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return un(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch(t).then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Zt)),t}#h(e){return!Cn()&&tn(this.options.enabled,this.#t)!==!1&&$t(e)}#g(){this.#b();let e=tn(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=en(this.#r.dataUpdatedAt,e)+1;this.#u=Jt.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return tn(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=Jt.setInterval(()=>{(this.options.refetchIntervalInBackground||Tn.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(Jt.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(Jt.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Wn(e,t),o=i&&Kn(e,n,t,r);(a||o)&&(l={...l,...zn(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=hn(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=hn(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:qn(e,t),refetch:this.refetch,isEnabled:tn(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),un(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();On.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function Un(e,t){return tn(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||tn(t.retryOnMount,e)!==!1)}function Wn(e,t){return Un(e,t)||e.state.data!==void 0&&Gn(e,t,t.refetchOnMount)}function Gn(e,t,n){if(tn(t.enabled,e)!==!1&&tn(t.staleTime,e)!==`static`){let r=tn(n,e);return r===`always`||r!==!1&&qn(e,t)}return!1}function Kn(e,t,n,r){return(e!==t||tn(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&qn(e,n)}function qn(e,t){return tn(t.enabled,e)!==!1&&e.isStaleByTime(tn(t.staleTime,e))}var Jn=class extends Pn{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Yn(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=Nn({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(/* @__PURE__ */ Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),On.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Yn(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Xn=class extends wn{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=/* @__PURE__ */ new Set,this.#t=/* @__PURE__ */ new Map,this.#n=0}build(e,t,n){let r=new Jn({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Zn(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Zn(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Zn(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=Zn(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){On.batch(()=>{let e=this.getAll();this.#e.clear(),this.#t.clear(),e.forEach(e=>{this.notify({type:`removed`,mutation:e})})})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>rn(t,e))}findAll(e={}){return this.getAll().filter(t=>rn(e,t))}notify(e){On.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return On.batch(()=>Promise.all(e.map(e=>e.continue().catch(Zt))))}};function Zn(e){return e.options.scope?.id}var Qn=class extends wn{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),un(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&on(t.mutationKey)!==on(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Yn();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){On.batch(()=>{let t=this.#r;if(t&&this.hasListeners()){let n=this.#t.variables,r=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{t.onSuccess?.(e.data,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(e.data,null,n,r,i)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{t.onError?.(e.error,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(void 0,e.error,n,r,i)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}};function $n(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}var er=class extends wn{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=/* @__PURE__ */ new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,On.batch(()=>{let e=this.#i,t=this.#p(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!un(e,n)});(o||s)&&(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&($n(e,n).forEach(e=>{e.destroy()}),$n(n,e).forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#p(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){let n=/* @__PURE__ */ new Set;return t.map((r,i)=>{let a=e[i];return r.defaultedQueryOptions.notifyOnChangeProps?a:r.observer.trackResult(a,e=>{n.has(e)||(n.add(e),t.forEach(t=>{t.observer.trackProp(e)}))})})}#d(e,t,n){if(t){let r=this.#c,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(this.#t!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=ln(this.#a,t(e))),this.#a}return e}#f(){return!this.#r?.combine||this.#i.some((e,t)=>e.options.suspense&&this.#t[t]?.data===void 0)}#p(e){let t=/* @__PURE__ */ new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new Hn(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#m(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=this.#t.slice(),this.#t[n]=t,this.#h())}#h(){if(this.hasListeners()){let e=this.#f(),t=this.#a,n=e?t:this.#d(this.#u(this.#t,this.#l),this.#r?.combine);(e||t!==n)&&On.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},tr=class extends wn{#e;constructor(e={}){super(),this.config=e,this.#e=/* @__PURE__ */ new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??an(r,t),a=this.get(i);return a||(a=new Rn({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){On.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>nn(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>nn(e,t)):t}notify(e){On.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){On.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){On.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},nr=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new tr,this.#t=e.mutationCache||new Xn,this.#n=e.defaultOptions||{},this.#r=/* @__PURE__ */ new Map,this.#i=/* @__PURE__ */ new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Tn.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=kn.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(tn(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=Qt(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return On.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;On.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return On.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=On.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(Zt).catch(Zt)}invalidateQueries(e,t={}){return On.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=On.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(Zt)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(Zt)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(tn(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(tn(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Zt).catch(Zt)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Zt).catch(Zt)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return kn.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(on(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{sn(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(on(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{sn(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=an(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===vn&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},rr=G.createContext(!1),ir=()=>G.useContext(rr);rr.Provider;function ar(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var or=G.createContext(ar()),sr=()=>G.useContext(or),cr=(e,t,n)=>{let r=n?.state.status===`error`&&typeof e.throwOnError==`function`?bn(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},lr=e=>{G.useEffect(()=>{e.clearReset()},[e])},ur=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||bn(n,[e.error,r])),dr=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},fr=(e,t)=>e?.suspense&&t.isPending,pr=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function mr({queries:e,...t},n){let r=Gt(n),i=ir(),a=sr(),o=t.subscribed!==!1,s=G.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?`isRestoring`:o?`optimistic`:void 0,t}),[e,r,i,o]);s.forEach(e=>{dr(e);let t=r.getQueryCache().get(e.queryHash);cr(e,a,t)}),lr(a);let[c]=G.useState(()=>new er(r,s,t)),[l,u,d]=c.getOptimisticResult(s,t.combine),f=!i&&o;G.useSyncExternalStore(G.useCallback(e=>f?c.subscribe(On.batchCalls(e)):Zt,[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),G.useEffect(()=>{c.setQueries(s,t)},[s,t,c]);let p=l.some((e,t)=>fr(s[t],e))?l.flatMap((e,t)=>{let n=s[t];return n&&fr(n,e)?pr(n,new Hn(r,n),a):[]}):[];if(p.length>0)throw Promise.all(p);let m=l.find((e,t)=>{let n=s[t];return n&&ur({result:e,errorResetBoundary:a,throwOnError:n.throwOnError,query:r.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(m)throw m.error;return u(d())}function hr(e,t,n){let r=ir(),i=sr(),a=Gt(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,dr(o),cr(o,i,s),lr(i);let[l]=G.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(G.useSyncExternalStore(G.useCallback(e=>{let t=d?l.subscribe(On.batchCalls(e)):Zt;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),G.useEffect(()=>{l.setOptions(o)},[o,l]),fr(o,u))throw pr(o,l,i);if(ur({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function gr(e,t){return hr(e,Hn,t)}function _r(e,t){let n=Gt(t),[r]=G.useState(()=>new Qn(n,e));G.useEffect(()=>{r.setOptions(e)},[r,e]);let i=G.useSyncExternalStore(G.useCallback(e=>r.subscribe(On.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=G.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(Zt)},[r]);if(i.error&&bn(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var vr=Object.defineProperty,yr=(e,t)=>vr(e,`name`,{value:t,configurable:!0});// @__NO_SIDE_EFFECTS__
10
+ function br(e){let t=e+`CollectionProvider`,[n,r]=$e(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:/* @__PURE__ */ new Map}),o=/* @__PURE__ */ yr(e=>{let{scope:t,children:n}=e,r=G.useRef(null),a=G.useRef(/* @__PURE__ */ new Map).current;return/* @__PURE__ */ (0,K.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,l=ve(s),u=G.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=a(s,n),o=c(t,i.collectionRef);return/* @__PURE__ */ (0,K.jsx)(l,{ref:o,children:r})});u.displayName=s;let d=e+`CollectionItemSlot`,f=`data-radix-collection-item`,p=ve(d),m=G.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=G.useRef(null),s=c(t,o),l=a(d,n);return G.useEffect(()=>(l.itemMap.set(o,{ref:o,...i}),()=>void l.itemMap.delete(o))),/* @__PURE__ */ (0,K.jsx)(p,{[f]:``,ref:s,children:r})});m.displayName=d;function h(t){let n=a(e+`CollectionConsumer`,t);return G.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${f}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return yr(h,`useCollection`),[{Provider:o,Slot:u,ItemSlot:m},h,r]}yr(br,`createCollection`);var xr=/* @__PURE__ */ new WeakMap,Sr=class e extends Map{static{yr(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],xr.set(this,!0)}set(e,t){return xr.get(this)&&!this.has(e)&&this.#e.push(e),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=r?this.size:this.size+1,a=Tr(e),o=a>=0?Math.min(a,i-1):Math.max(i+a,0);if(r?this.#e.indexOf(t)===o:o===this.size)return this.set(t,n),this;let s=this.#e.filter(e=>e!==t);s.splice(o,0,t);let c=s.map(e=>[e,e===t?n:this.get(e)]);this.clear();for(let[e,t]of c)this.set(e,t);return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<r?r-1:r;return this.insert(a,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<=r?r:r+1;return this.insert(a,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=Cr(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=Cr(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return Cr(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=0,a=n;for(let e of this)a=i===0&&!r?e:Reflect.apply(t,this,[a,e,i,this]),i++;return a}reduceRight(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=n;for(let e=this.size-1;e>=0;e--){let n=this.entryAt(e);i=e===this.size-1&&!r?n:Reflect.apply(t,this,[i,n,e,this])}return i}sort(e){if(typeof e!=`function`)throw TypeError(`OrderedDict.sort requires a compare function`);let t=[...this.entries()].sort(e);this.clear();for(let[e,n]of t)this.set(e,n);return this}toSorted(t){if(typeof t!=`function`)throw TypeError(`OrderedDict.toSorted requires a compare function`);let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e;for(let e of this.#e.slice(t,n))r.set(e,this.get(e));return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function Cr(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=wr(e,t);return n===-1?void 0:e[n]}yr(Cr,`at`);function wr(e,t){let n=e.length,r=Tr(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}yr(wr,`toSafeIndex`);function Tr(e){return e!==e||e===0?0:Math.trunc(e)}yr(Tr,`toSafeInteger`);// @__NO_SIDE_EFFECTS__
11
+ function Er(e){let t=e+`CollectionProvider`,[n,r]=$e(t),[i,a]=n(t);i.displayName=e+`CollectionStableContextProvider`;let[o,s]=n(t);o.displayName=e+`CollectionStatefulContextProvider`;let l=/* @__PURE__ */ yr(({state:e,...t})=>e?/* @__PURE__ */ (0,K.jsx)(d,{...t,state:e}):/* @__PURE__ */ (0,K.jsx)(u,{...t}),`CollectionProvider`);l.displayName=t;let u=/* @__PURE__ */ yr(e=>{let t=v();return/* @__PURE__ */ (0,K.jsx)(d,{...e,state:t})},`CollectionInit`);u.displayName=e+`CollectionInit`;let d=/* @__PURE__ */ yr(e=>{let{scope:t,children:n,state:r}=e,a=G.useRef(null),[s,l]=G.useState(null),u=c(a,l),[d,f]=r,p=G.useRef(new Sr),m=G.useCallback(()=>{let e=p.current;return kr(e)||e.sort(Ar),e},[]);return G.useEffect(()=>{if(!s)return;let e=jr(()=>{f(e=>{let t=e.toSorted(Ar);return t.some(([t],n)=>e.keyAt(n)!==t)?t:e})});return e.observe(s,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[s,f]),/* @__PURE__ */ (0,K.jsx)(i,{scope:t,collectionElementRef:u,collectionElementRefObject:a,getCollection:m,setCollection:f,registryRef:p,children:/* @__PURE__ */ (0,K.jsx)(o,{scope:t,collectionElement:s,collection:d,children:n})})},`CollectionProviderImpl`);d.displayName=e+`CollectionProviderImpl`;let f=e+`CollectionSlot`,p=ve(f),m=G.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=a(f,n),o=c(t,i.collectionElementRef);return/* @__PURE__ */ (0,K.jsx)(p,{ref:o,children:r})});m.displayName=f;let h=e+`CollectionItemSlot`,g=ve(h),_=G.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=G.useRef(null),{setCollection:s,registryRef:l}=a(h,n),u=G.useRef(i);Dr(u.current,i)||(u.current=i);let d=u.current,f=G.useCallback(e=>{let t=l.current;e?t.set(e,{...u.current,element:e}):o.current&&t.delete(o.current)},[l]),p=c(t,f,o);A(()=>{let e=o.current,t=l.current;e&&t.has(e)&&t.set(e,{...d,element:e})},[d,l]);let m=G.useRef(null);return G.useEffect(()=>{let e=o.current,t=m.current;((t?.element??null)!==e||e&&t?.itemData!==d)&&(m.current=e?{element:e,itemData:d}:null,s(n=>{let r=new Sr(n);return t&&t.element!==e&&r.delete(t.element),e&&r.set(e,{...d,element:e}),r.sort(Ar)}))}),G.useEffect(()=>()=>{let e=m.current;m.current=null,e&&s(t=>{if(!t.has(e.element))return t;let n=new Sr(t);return n.delete(e.element),n})},[s]),/* @__PURE__ */ (0,K.jsx)(g,{"data-radix-collection-item":``,ref:p,children:r})});_.displayName=h;function v(){return G.useState(new Sr)}yr(v,`useInitCollection`);function y(t){let{collection:n}=s(e+`CollectionConsumer`,t);return n}yr(y,`useCollection`);function b(t){let{getCollection:n}=a(e+`CollectionConsumer`,t);return n}return yr(b,`useGetCollection`),[{Provider:l,Slot:m,ItemSlot:_},{createCollectionScope:r,useCollection:y,useGetCollection:b,useInitCollection:v}]}yr(Er,`createCollection`);function Dr(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}yr(Dr,`shallowEqual`);function Or(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}yr(Or,`isElementPreceding`);function kr(e){let t;for(let n of e.keys()){if(t){let e=t.compareDocumentPosition(n);if(!(e&Node.DOCUMENT_POSITION_DISCONNECTED)&&e&Node.DOCUMENT_POSITION_PRECEDING)return!1}t=n}return!0}yr(kr,`isInDocumentOrder`);function Ar(e,t){return!e[1].element||!t[1].element?0:Or(e[1].element,t[1].element)?-1:1}yr(Ar,`sortByDocumentPosition`);function jr(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}yr(jr,`getChildListObserver`);var Mr=Object.defineProperty,Nr=(e,t)=>Mr(e,`name`,{value:t,configurable:!0}),Pr={LTR:`ltr`,RTL:`rtl`},Fr=G.createContext(void 0);function Ir(e){let t=G.useContext(Fr);return e||t||Pr.LTR}Nr(Ir,`useDirection`);var Lr=/* @__PURE__ */ e(ke(),1),Rr=/* @__PURE__ */ e(Ut(),1),zr=Object.defineProperty,Br=(e,t)=>zr(e,`name`,{value:t,configurable:!0}),Vr=0,Hr=null;function Ur(e){return Wr(),e.children}Br(Ur,`FocusGuards`);function Wr(){G.useEffect(()=>{Hr||={start:Gr(),end:Gr()};let{start:e,end:t}=Hr;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Vr++,()=>{Vr===1&&(Hr?.start.remove(),Hr?.end.remove(),Hr=null),Vr=Math.max(0,Vr-1)}},[])}Br(Wr,`useFocusGuards`);function Gr(){let 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}Br(Gr,`createFocusGuard`);var Kr=function(){return Kr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Kr.apply(this,arguments)};function qr(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Jr(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Yr=`right-scroll-bar-position`,Xr=`width-before-scroll-bar`,Zr=`with-scroll-bars-hidden`,Qr=`--removed-body-scroll-bar-size`;function $r(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function ei(e,t){var n=(0,G.useState)(function(){return{value:e,callback:t,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=t,n.facade}var ti=typeof window<`u`?G.useLayoutEffect:G.useEffect,ni=/* @__PURE__ */ new WeakMap;function ri(e,t){var n=ei(t||null,function(t){return e.forEach(function(e){return $r(e,t)})});return ti(function(){var t=ni.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||$r(e,null)}),i.forEach(function(e){r.has(e)||$r(e,a)})}ni.set(n,e)},[e]),n}function ii(e){return e}function ai(e,t){t===void 0&&(t=ii);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function oi(e){e===void 0&&(e={});var t=ai(null);return t.options=Kr({async:!0,ssr:!1},e),t}var si=function(e){var t=e.sideCar,n=qr(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return G.createElement(r,Kr({},n))};si.isSideCarExport=!0;function ci(e,t){return e.useMedium(t),si}var li=oi(),ui=function(){},di=G.forwardRef(function(e,t){var n=G.useRef(null),r=G.useState({onScrollCapture:ui,onWheelCapture:ui,onTouchMoveCapture:ui}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=qr(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=ri([n,t]),C=Kr(Kr({},b),i);return G.createElement(G.Fragment,null,u&&G.createElement(x,{sideCar:li,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?G.cloneElement(G.Children.only(s),Kr(Kr({},C),{ref:S})):G.createElement(v,Kr({},C,{className:c,ref:S}),s))});di.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},di.classNames={fullWidth:Xr,zeroRight:Yr};var fi=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function pi(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=fi();return t&&e.setAttribute(`nonce`,t),e}function mi(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function hi(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var gi=function(){var e=0,t=null;return{add:function(n){e==0&&(t=pi())&&(mi(t,n),hi(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},_i=function(){var e=gi();return function(t,n){G.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},vi=function(){var e=_i();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},yi={left:0,top:0,right:0,gap:0},bi=function(e){return parseInt(e||``,10)||0},xi=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[bi(n),bi(r),bi(i)]},Si=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return yi;var t=xi(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Ci=vi(),wi=`data-scroll-locked`,Ti=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
12
+ .${Zr} {
13
13
  overflow: hidden ${r};
14
14
  padding-right: ${s}px ${r};
15
15
  }
16
- body[${nr}] {
16
+ body[${wi}] {
17
17
  overflow: hidden ${r};
18
18
  overscroll-behavior: contain;
19
19
  ${[t&&`position: relative ${r};`,n===`margin`&&`
@@ -26,31 +26,28 @@ function rn(e){let t=e+`CollectionProvider`,[n,r]=c(t),[i,a]=n(t);i.displayName=
26
26
  `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
27
27
  }
28
28
 
29
- .${Dn} {
29
+ .${Yr} {
30
30
  right: ${s}px ${r};
31
31
  }
32
32
 
33
- .${On} {
33
+ .${Xr} {
34
34
  margin-right: ${s}px ${r};
35
35
  }
36
36
 
37
- .${Dn} .${Dn} {
37
+ .${Yr} .${Yr} {
38
38
  right: 0 ${r};
39
39
  }
40
40
 
41
- .${On} .${On} {
41
+ .${Xr} .${Xr} {
42
42
  margin-right: 0 ${r};
43
43
  }
44
44
 
45
- body[${nr}] {
46
- ${An}: ${s}px;
45
+ body[${wi}] {
46
+ ${Qr}: ${s}px;
47
47
  }
48
- `},ir=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},ar=function(){B.useEffect(function(){return document.body.setAttribute(nr,(ir()+1).toString()),function(){var e=ir()-1;e<=0?document.body.removeAttribute(nr):document.body.setAttribute(nr,e.toString())}},[])},or=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;ar();var a=B.useMemo(function(){return er(i)},[i]);return B.createElement(tr,{styles:rr(a,!t,i,n?``:`!important`)})},sr=!1;if(typeof window<`u`)try{var cr=Object.defineProperty({},"passive",{get:function(){return sr=!0,!0}});window.addEventListener(`test`,cr,cr),window.removeEventListener(`test`,cr,cr)}catch{sr=!1}var lr=sr?{passive:!1}:!1,ur=function(e){return e.tagName===`TEXTAREA`},dr=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!ur(e)&&n[t]===`visible`)},fr=function(e){return dr(e,`overflowY`)},pr=function(e){return dr(e,`overflowX`)},mr=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),_r(e,r)){var i=vr(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},hr=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},gr=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},_r=function(e,t){return e===`v`?fr(t):pr(t)},vr=function(e,t){return e===`v`?hr(t):gr(t)},yr=function(e,t){return e===`h`&&t===`rtl`?-1:1},br=function(e,t,n,r,i){var a=yr(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=vr(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&_r(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},xr=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Sr=function(e){return[e.deltaX,e.deltaY]},Cr=function(e){return e&&`current`in e?e.current:e},wr=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Tr=function(e){return`
48
+ `},Ei=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Di=function(){G.useEffect(function(){return document.body.setAttribute(wi,(Ei()+1).toString()),function(){var e=Ei()-1;e<=0?document.body.removeAttribute(wi):document.body.setAttribute(wi,e.toString())}},[])},Oi=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Di();var a=G.useMemo(function(){return Si(i)},[i]);return G.createElement(Ci,{styles:Ti(a,!t,i,n?``:`!important`)})},ki=!1;if(typeof window<`u`)try{var Ai=Object.defineProperty({},"passive",{get:function(){return ki=!0,!0}});window.addEventListener(`test`,Ai,Ai),window.removeEventListener(`test`,Ai,Ai)}catch{ki=!1}var ji=ki?{passive:!1}:!1,Mi=function(e){return e.tagName===`TEXTAREA`},Ni=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Mi(e)&&n[t]===`visible`)},Pi=function(e){return Ni(e,`overflowY`)},Fi=function(e){return Ni(e,`overflowX`)},Ii=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),zi(e,r)){var i=Bi(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Li=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Ri=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},zi=function(e,t){return e===`v`?Pi(t):Fi(t)},Bi=function(e,t){return e===`v`?Li(t):Ri(t)},Vi=function(e,t){return e===`h`&&t===`rtl`?-1:1},Hi=function(e,t,n,r,i){var a=Vi(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Bi(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&zi(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Ui=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Wi=function(e){return[e.deltaX,e.deltaY]},Gi=function(e){return e&&`current`in e?e.current:e},Ki=function(e,t){return e[0]===t[0]&&e[1]===t[1]},qi=function(e){return`
49
49
  .block-interactivity-${e} {pointer-events: none;}
50
50
  .allow-interactivity-${e} {pointer-events: all;}
51
- `},Er=0,Dr=[];function Or(e){var t=B.useRef([]),n=B.useRef([0,0]),r=B.useRef(),i=B.useState(Er++)[0],a=B.useState(Xn)[0],o=B.useRef(e);B.useEffect(function(){o.current=e},[e]),B.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=En([e.lockRef.current],(e.shards||[]).map(Cr),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=B.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=xr(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=mr(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=mr(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return br(h,t,e,h===`h`?s:c,!0)},[]),c=B.useCallback(function(e){var n=e;if(Dr.length&&Dr[Dr.length-1]===a){var r=`deltaY`in n?Sr(n):xr(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&wr(e.delta,r)})[0];if(i&&i.should)n.cancelable&&n.preventDefault();else if(!i){var c=(o.current.shards||[]).map(Cr).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=B.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:kr(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=B.useCallback(function(e){n.current=xr(e),r.current=void 0},[]),d=B.useCallback(function(t){l(t.type,Sr(t),t.target,s(t,e.lockRef.current))},[]),f=B.useCallback(function(t){l(t.type,xr(t),t.target,s(t,e.lockRef.current))},[]);B.useEffect(function(){return Dr.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,lr),document.addEventListener(`touchmove`,c,lr),document.addEventListener(`touchstart`,u,lr),function(){Dr=Dr.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,lr),document.removeEventListener(`touchmove`,c,lr),document.removeEventListener(`touchstart`,u,lr)}},[]);var p=e.removeScrollBar,m=e.inert;return B.createElement(B.Fragment,null,m?B.createElement(a,{styles:Tr(i)}):null,p?B.createElement(or,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function kr(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Ar=Bn(Vn,Or),jr=B.forwardRef(function(e,t){return B.createElement(Un,wn({},e,{ref:t,sideCar:Ar}))});jr.classNames=Un.classNames;var Mr=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Nr=/* @__PURE__ */ new WeakMap,Pr=/* @__PURE__ */ new WeakMap,Fr={},Ir=0,Lr=function(e){return e&&(e.host||Lr(e.parentNode))},Rr=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Lr(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},zr=function(e,t,n,r){var i=Rr(t,Array.isArray(e)?e:[e]);Fr[n]||(Fr[n]=/* @__PURE__ */ new WeakMap);var a=Fr[n],o=[],s=/* @__PURE__ */ new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Nr.get(e)||0)+1,l=(a.get(e)||0)+1;Nr.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Pr.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Ir++,function(){o.forEach(function(e){var t=Nr.get(e)-1,i=a.get(e)-1;Nr.set(e,t),a.set(e,i),t||(Pr.has(e)||e.removeAttribute(r),Pr.delete(e)),i||e.removeAttribute(n)}),Ir--,Ir||(Nr=/* @__PURE__ */ new WeakMap,Nr=/* @__PURE__ */ new WeakMap,Pr=/* @__PURE__ */ new WeakMap,Fr={})}},Br=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Mr(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),zr(r,i,n,`aria-hidden`)):function(){return null}},Vr=Object.defineProperty,Hr=(e,t)=>Vr(e,`name`,{value:t,configurable:!0}),Ur=`Dialog`,[Wr,Gr]=c(Ur),[Kr,qr]=Wr(Ur),Jr=/* @__PURE__ */ Hr(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=B.useRef(null),c=B.useRef(null),{nodes:l,registry:u}=T(),[d,f]=g({prop:r,defaultProp:i??!1,onChange:a,caller:Ur}),[p,m]=B.useState(0),[h,_]=B.useState(0);return/* @__PURE__ */ (0,V.jsx)(Kr,{scope:t,triggerRef:s,contentRef:c,contentId:N(),titleId:N(),descriptionId:N(),titlePresent:p>0,descriptionPresent:h>0,setTitleCount:m,setDescriptionCount:_,open:d,onOpenChange:f,onOpenToggle:B.useCallback(()=>f(e=>!e),[f]),modal:o,branchNodes:l,branchRegistry:u,children:n})},`Dialog`),Yr=`DialogPortal`,[Xr,Zr]=Wr(Yr,{forceMount:void 0}),Qr=/* @__PURE__ */ Hr(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=qr(Yr,t);return/* @__PURE__ */ (0,V.jsx)(Xr,{scope:t,forceMount:n,children:B.Children.map(r,e=>/* @__PURE__ */ (0,V.jsx)(I,{present:n||a.open,children:/* @__PURE__ */ (0,V.jsx)(M,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),$r=`DialogOverlay`,ei=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Hr(function(e,t){let n=Zr($r,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=qr($r,e.__scopeDialog);return a.modal?/* @__PURE__ */ (0,V.jsx)(I,{present:r||a.open,children:/* @__PURE__ */ (0,V.jsx)(ni,{...i,ref:t})}):null},`DialogOverlay`)),ti=l(`DialogOverlay.RemoveScroll`),ni=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Hr(function(e,t){let{__scopeDialog:n,...r}=e,i=qr($r,n),a=b(),o=C(t,a);return/* @__PURE__ */ (0,V.jsx)(jr,{as:ti,allowPinchZoom:!0,shards:B.useMemo(()=>[i.contentRef,...i.branchNodes.map(e=>({current:e}))],[i.contentRef,i.branchNodes]),children:/* @__PURE__ */ (0,V.jsx)(p.div,{"data-state":pi(i.open),...r,ref:o,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),ri=`DialogContent`,ii=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Hr(function(e,t){let n=Zr(ri,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=qr(ri,e.__scopeDialog);return/* @__PURE__ */ (0,V.jsx)(I,{present:r||a.open,children:a.modal?/* @__PURE__ */ (0,V.jsx)(ai,{...i,ref:t}):/* @__PURE__ */ (0,V.jsx)(oi,{...i,ref:t})})},`DialogContent`)),ai=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Hr(function(e,t){let n=qr(ri,e.__scopeDialog),r=B.useRef(null),i=C(t,n.contentRef,r);return B.useEffect(()=>{let e=r.current;if(e)return Br(e)},[]),/* @__PURE__ */ (0,V.jsx)(si,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:F(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:F(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:F(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),oi=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Hr(function(e,t){let n=qr(ri,e.__scopeDialog),r=B.useRef(!1),i=B.useRef(!1);return/* @__PURE__ */ (0,V.jsx)(si,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),si=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Hr(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,"aria-describedby":o,children:s,...c}=e,l=qr(ri,n);return Sn(),/* @__PURE__ */ (0,V.jsx)(y,{registry:l.branchRegistry,children:/* @__PURE__ */ (0,V.jsx)(v,{asChild:!0,loop:!0,trapped:r,branches:l.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:a,children:/* @__PURE__ */ (0,V.jsx)(x,{role:`dialog`,id:l.contentId,"aria-labelledby":l.titlePresent?l.titleId:void 0,"aria-describedby":l.descriptionPresent?fi(o,l.descriptionId):o,"data-state":pi(l.open),...c,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1),children:s})})})},`DialogContentImpl`)),ci=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Hr(function(e,t){let{__scopeDialog:n,...r}=e,i=qr(`DialogTitle`,n),{setTitleCount:a}=i;return f(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),/* @__PURE__ */ (0,V.jsx)(p.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),li=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Hr(function(e,t){let{__scopeDialog:n,...r}=e,i=qr(`DialogDescription`,n),{setDescriptionCount:a}=i;return f(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),/* @__PURE__ */ (0,V.jsx)(p.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),ui=`DialogClose`,di=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Hr(function(e,t){let{__scopeDialog:n,...r}=e,i=qr(ui,n);return/* @__PURE__ */ (0,V.jsx)(p.button,{type:`button`,...r,ref:t,onClick:F(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function fi(...e){let t=/* @__PURE__ */ new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}Hr(fi,`concatAriaDescribedby`);function pi(e){return e?`open`:`closed`}Hr(pi,`getState`);var mi=Object.defineProperty,hi=(e,t)=>mi(e,`name`,{value:t,configurable:!0}),gi=!1;function _i(){let[e,t]=B.useState(gi);return B.useEffect(()=>{gi||(gi=!0,t(!0))},[]),e}hi(_i,`useIsHydrated`);var vi=B.useSyncExternalStore;function yi(){return()=>{}}hi(yi,`subscribe`);function bi(){return vi(yi,()=>!0,()=>!1)}hi(bi,`useIsHydratedModern`);var xi=typeof vi==`function`?bi:_i,Si=Object.defineProperty,Ci=(e,t)=>Si(e,`name`,{value:t,configurable:!0});function wi(){let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e}var Ti=`rovingFocusGroup.onEntryFocus`,Ei={bubbles:!1,cancelable:!0},Di=`RovingFocusGroup`,[Oi,ki,Ai]=/* @__PURE__ */ Zt(Di),[ji,Mi]=c(Di,[Ai]),Ni={Vertical:`vertical`,Horizontal:`horizontal`},Pi={LTR:`ltr`,RTL:`rtl`},[Fi,Ii]=ji(Di),Li=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Ci(function(e,t){return/* @__PURE__ */ (0,V.jsx)(Oi.Provider,{scope:e.__scopeRovingFocusGroup,children:/* @__PURE__ */ (0,V.jsx)(Oi.Slot,{scope:e.__scopeRovingFocusGroup,children:/* @__PURE__ */ (0,V.jsx)(Ri,{...e,ref:t})})})},`RovingFocusGroup`)),Ri=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Ci(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=B.useRef(null),h=C(t,f),_=mn(a),[v,y]=g({prop:o,defaultProp:s??null,onChange:c,caller:Di}),[b,x]=B.useState(!1),S=m(l),w=ki(n),T=B.useRef(!1),[E,D]=B.useState(0);return B.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(Ti,S),()=>e.removeEventListener(Ti,S)},[S]),/* @__PURE__ */ (0,V.jsx)(Fi,{scope:n,orientation:r,dir:_,loop:i,currentTabStopId:v,onItemFocus:B.useCallback(e=>y(e),[y]),onItemShiftTab:B.useCallback(()=>x(!0),[]),onFocusableItemAdd:B.useCallback(()=>D(e=>e+1),[]),onFocusableItemRemove:B.useCallback(()=>D(e=>e-1),[]),children:/* @__PURE__ */ (0,V.jsx)(p.div,{tabIndex:b||E===0?-1:0,"data-orientation":r,...d,ref:h,style:{outline:`none`,...e.style},onMouseDown:F(e.onMouseDown,()=>{T.current=!0}),onFocus:F(e.onFocus,e=>{let t=!T.current;if(e.target===e.currentTarget&&t&&!b){let t=new CustomEvent(Ti,Ei);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=w().filter(e=>e.focusable);Wi([e.find(e=>e.active),e.find(e=>e.id===v),...e].filter(Boolean).map(e=>e.ref.current),u)}}T.current=!1}),onBlur:F(e.onBlur,()=>x(!1))})})},`RovingFocusGroupImpl`)),zi=`RovingFocusGroupItem`,Bi=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Ci(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=N(),l=a||c,u=Ii(zi,n),d=u.currentTabStopId===l,m=ki(n),{onFocusableItemAdd:h,onFocusableItemRemove:g,currentTabStopId:_}=u,v=xi();return f(()=>{if(v&&r)return h(),()=>g()},[v,r,h,g]),B.useEffect(()=>{if(!v&&r)return h(),()=>g()},[v,r,h,g]),/* @__PURE__ */ (0,V.jsx)(Oi.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:/* @__PURE__ */ (0,V.jsx)(p.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:F(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:F(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:F(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Ui(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=m().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?Gi(n,r+1):n.slice(r+1)}setTimeout(()=>Wi(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:_!=null}):o})})},`RovingFocusGroupItem`)),Vi={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Hi(e,t){return t===Pi.RTL?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}Ci(Hi,`getDirectionAwareKey`);function Ui(e,t,n){let r=Hi(e.key,n);if(!(t===Ni.Vertical&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===Ni.Horizontal&&[`ArrowUp`,`ArrowDown`].includes(r)))return Vi[r]}Ci(Ui,`getFocusIntent`);function Wi(e,t=!1){let n=wi();for(let r of e)if(r===n||(r.focus({preventScroll:t}),wi()!==n))return}Ci(Wi,`focusFirst`);function Gi(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Ci(Gi,`wrapArray`);var Ki=Object.defineProperty,U=(e,t)=>Ki(e,`name`,{value:t,configurable:!0});function qi(){let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e}var Ji=[`Enter`,` `],Yi=[`ArrowDown`,`PageUp`,`Home`],Xi=[`ArrowUp`,`PageDown`,`End`],Zi=[...Yi,...Xi];[...Ji],[...Ji];var Qi=`Menu`,[$i,ea,W]=/* @__PURE__ */ Zt(Qi),[ta,na]=c(Qi,[W,_,Mi]),ra=_(),ia=Mi(),[aa,oa]=ta(Qi),[sa,ca]=ta(Qi),la=/* @__PURE__ */ U(e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=ra(t),[c,l]=B.useState(null),u=B.useRef(!1),d=m(a),f=mn(i);return B.useEffect(()=>{let e=/* @__PURE__ */ U(()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=/* @__PURE__ */ U(()=>u.current=!1,`handlePointer`);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})}},[]),B.useEffect(()=>{if(!n)return;let e=/* @__PURE__ */ U(()=>d(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),/* @__PURE__ */ (0,V.jsx)(h,{...s,children:/* @__PURE__ */ (0,V.jsx)(aa,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:/* @__PURE__ */ (0,V.jsx)(sa,{scope:t,onClose:B.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})},`Menu`),ua=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ U(function(e,t){let{__scopeMenu:n,...r}=e,i=ra(n);return/* @__PURE__ */ (0,V.jsx)(D,{...i,...r,ref:t})},`MenuAnchor`)),da=`MenuPortal`,[fa,pa]=ta(da,{forceMount:void 0}),ma=/* @__PURE__ */ U(e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=oa(da,t);return/* @__PURE__ */ (0,V.jsx)(fa,{scope:t,forceMount:n,children:/* @__PURE__ */ (0,V.jsx)(I,{present:n||a.open,children:/* @__PURE__ */ (0,V.jsx)(M,{asChild:!0,container:i,children:r})})})},`MenuPortal`),ha=`MenuContent`,[ga,_a]=ta(ha),va=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ U(function(e,t){let n=pa(ha,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=oa(ha,e.__scopeMenu),o=ca(ha,e.__scopeMenu);return/* @__PURE__ */ (0,V.jsx)($i.Provider,{scope:e.__scopeMenu,children:/* @__PURE__ */ (0,V.jsx)(I,{present:r||a.open,children:/* @__PURE__ */ (0,V.jsx)($i.Slot,{scope:e.__scopeMenu,children:o.modal?/* @__PURE__ */ (0,V.jsx)(ya,{...i,ref:t}):/* @__PURE__ */ (0,V.jsx)(ba,{...i,ref:t})})})})},`MenuContent`)),ya=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ U(function(e,t){let n=oa(ha,e.__scopeMenu),r=B.useRef(null),i=C(t,r);return B.useEffect(()=>{let e=r.current;if(e)return Br(e)},[]),/* @__PURE__ */ (0,V.jsx)(Sa,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:F(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentModal`)),ba=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ U(function(e,t){let n=oa(ha,e.__scopeMenu);return/* @__PURE__ */ (0,V.jsx)(Sa,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentNonModal`)),xa=l(`MenuContent.ScrollLock`),Sa=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ U(function(e,t){let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=oa(ha,n),_=ca(ha,n),b=ra(n),S=ia(n),w=ea(n),[E,D]=B.useState(null),k=B.useRef(null),[j,M]=B.useState(null);O(j);let{nodes:N,registry:P}=T(),I=!!(i||m),ee=C(t,k,g.onContentChange,M),te=B.useRef(0),ne=B.useRef(``),re=B.useRef(0),ie=B.useRef(null),ae=B.useRef(`right`),oe=B.useRef(0),se=B.useMemo(()=>m?[k,...N.map(e=>({current:e}))]:[],[k,N,m]),ce=m?jr:B.Fragment,le=m?{as:xa,allowPinchZoom:!0,shards:se}:void 0,ue=/* @__PURE__ */ U(e=>{let t=ne.current+e,n=w().filter(e=>!e.disabled),r=qi(),i=n.find(e=>e.ref.current===r)?.textValue,a=za(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;function s(e){ne.current=e,window.clearTimeout(te.current),e!==``&&(te.current=window.setTimeout(()=>s(``),1e3))}U(s,`updateSearch`),s(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);B.useEffect(()=>()=>window.clearTimeout(te.current),[]),Sn();let de=B.useCallback(e=>ae.current===ie.current?.side&&Va(e,ie.current?.area),[]);return/* @__PURE__ */ (0,V.jsx)(ga,{scope:n,searchRef:ne,onItemEnter:B.useCallback(e=>{de(e)&&e.preventDefault()},[de]),onItemLeave:B.useCallback(e=>{de(e)||(k.current?.focus(),D(null))},[de]),onTriggerLeave:B.useCallback(e=>{de(e)&&e.preventDefault()},[de]),pointerGraceTimerRef:re,onPointerGraceIntentChange:B.useCallback(e=>{ie.current=e},[]),children:/* @__PURE__ */ (0,V.jsx)(y,{registry:I?P:null,children:/* @__PURE__ */ (0,V.jsx)(ce,{...le,children:/* @__PURE__ */ (0,V.jsx)(v,{asChild:!0,trapped:i,branches:N,onMountAutoFocus:F(a,e=>{e.preventDefault(),k.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:/* @__PURE__ */ (0,V.jsx)(x,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:/* @__PURE__ */ (0,V.jsx)(Li,{asChild:!0,...S,dir:_.dir,orientation:`vertical`,loop:r,currentTabStopId:E,onCurrentTabStopIdChange:D,onEntryFocus:F(c,e=>{_.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:/* @__PURE__ */ (0,V.jsx)(A,{role:`menu`,"aria-orientation":`vertical`,"data-state":Pa(g.open),"data-radix-menu-content":``,dir:_.dir,...b,...h,ref:ee,style:{outline:`none`,...h.style},onKeyDown:F(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&ue(e.key));let i=k.current;if(e.target!==i||!Zi.includes(e.key))return;e.preventDefault();let a=w().filter(e=>!e.disabled).map(e=>e.ref.current);Xi.includes(e.key)&&a.reverse(),La(a)}),onBlur:F(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(te.current),ne.current=``)}),onPointerMove:F(e.onPointerMove,Ha(e=>{let t=e.target,n=oe.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>oe.current?`right`:`left`;ae.current=t,oe.current=e.clientX}}))})})})})})})})},`MenuContentImpl`)),Ca=`MenuItem`,wa=`menu.itemSelect`,Ta=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ U(function(e,t){let{disabled:n=!1,onSelect:r,...i}=e,a=B.useRef(null),o=ca(Ca,e.__scopeMenu),s=_a(Ca,e.__scopeMenu),c=C(t,a),l=B.useRef(!1),d=/* @__PURE__ */ U(()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(wa,{bubbles:!0,cancelable:!0});e.addEventListener(wa,e=>r?.(e),{once:!0}),u(e,t),t.defaultPrevented?l.current=!1:o.onClose()}},`handleSelect`);return/* @__PURE__ */ (0,V.jsx)(Ea,{...i,ref:c,disabled:n,onClick:F(e.onClick,d),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:F(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:F(e.onKeyDown,e=>{n||e.target!==e.currentTarget||(s.searchRef.current===``||e.key!==` `)&&Ji.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),Ea=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ U(function(e,t){let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=_a(Ca,n),s=ia(n),c=B.useRef(null),l=C(t,c),[u,d]=B.useState(!1),[f,m]=B.useState(``);return B.useEffect(()=>{let e=c.current;e&&m((e.textContent??``).trim())},[a.children]),/* @__PURE__ */ (0,V.jsx)($i.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:/* @__PURE__ */ (0,V.jsx)(Bi,{asChild:!0,...s,focusable:!r,children:/* @__PURE__ */ (0,V.jsx)(p.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:F(e.onPointerMove,Ha(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:F(e.onPointerLeave,Ha(e=>o.onItemLeave(e))),onFocus:F(e.onFocus,()=>d(!0)),onBlur:F(e.onBlur,()=>d(!1))})})})},`MenuItemImpl`)),[Da,Oa]=ta(`MenuRadioGroup`,{value:void 0,onValueChange:/* @__PURE__ */ U(()=>{},`onValueChange`)}),[ka,Aa]=ta(`MenuItemIndicator`,{checked:!1}),ja=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ U(function(e,t){let{__scopeMenu:n,...r}=e;return/* @__PURE__ */ (0,V.jsx)(p.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})},`MenuSeparator`)),[Ma,Na]=ta(`MenuSub`);function Pa(e){return e?`open`:`closed`}U(Pa,`getOpenState`);function Fa(e){return e===`indeterminate`}U(Fa,`isIndeterminate`);function Ia(e){return Fa(e)?`indeterminate`:e?`checked`:`unchecked`}U(Ia,`getCheckedState`);function La(e){let t=qi();for(let n of e)if(n===t||(n.focus(),qi()!==t))return}U(La,`focusFirst`);function Ra(e,t){return e.map((n,r)=>e[(t+r)%e.length])}U(Ra,`wrapArray`);function za(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Ra(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}U(za,`getNextMatch`);function Ba(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}U(Ba,`isPointInPolygon`);function Va(e,t){return t?Ba({x:e.clientX,y:e.clientY},t):!1}U(Va,`isPointerInGraceArea`);function Ha(e){return t=>t.pointerType===`mouse`?e(t):void 0}U(Ha,`whenMouse`);var Ua=Object.defineProperty,Wa=(e,t)=>Ua(e,`name`,{value:t,configurable:!0}),Ga=`DropdownMenu`,[Ka,qa]=c(Ga,[na]),Ja=na(),[Ya,Xa]=Ka(Ga),Za=/* @__PURE__ */ Wa(e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=Ja(t),l=B.useRef(null),[u,d]=g({prop:i,defaultProp:a??!1,onChange:o,caller:Ga});return/* @__PURE__ */ (0,V.jsx)(Ya,{scope:t,triggerId:N(),triggerRef:l,contentId:N(),open:u,onOpenChange:d,onOpenToggle:B.useCallback(()=>d(e=>!e),[d]),modal:s,children:/* @__PURE__ */ (0,V.jsx)(la,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})},`DropdownMenu`),Qa=`DropdownMenuTrigger`,$a=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Wa(function(e,t){let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=Xa(Qa,n),o=Ja(n),s=C(t,a.triggerRef);return/* @__PURE__ */ (0,V.jsx)(ua,{asChild:!0,...o,children:/* @__PURE__ */ (0,V.jsx)(p.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:s,onPointerDown:F(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:F(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),eo=/* @__PURE__ */ Wa(e=>{let{__scopeDropdownMenu:t,...n}=e,r=Ja(t);return/* @__PURE__ */ (0,V.jsx)(ma,{...r,...n})},`DropdownMenuPortal`),to=`DropdownMenuContent`,no=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Wa(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Xa(to,n),a=Ja(n),o=B.useRef(!1);return/* @__PURE__ */ (0,V.jsx)(va,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:F(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:F(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.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)`}})},`DropdownMenuContent`)),ro=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Wa(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Ja(n);return/* @__PURE__ */ (0,V.jsx)(Ta,{...i,...r,ref:t})},`DropdownMenuItem`)),io=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Wa(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Ja(n);return/* @__PURE__ */ (0,V.jsx)(ja,{...i,...r,ref:t})},`DropdownMenuSeparator`)),ao=Object.defineProperty,oo=(e,t)=>ao(e,`name`,{value:t,configurable:!0});function so(e,[t,n]){return Math.min(n,Math.max(t,e))}oo(so,`clamp`);var co=Object.defineProperty,lo=(e,t)=>co(e,`name`,{value:t,configurable:!0}),uo=`Popover`,[fo,po]=c(uo,[_]),mo=_(),[ho,go]=fo(uo),_o=/* @__PURE__ */ lo(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=mo(t),c=B.useRef(null),[l,u]=B.useState(!1),[d,f]=B.useState(0),[p,m]=B.useState(0),[_,v]=g({prop:r,defaultProp:i??!1,onChange:a,caller:uo});return/* @__PURE__ */ (0,V.jsx)(h,{...s,children:/* @__PURE__ */ (0,V.jsx)(ho,{scope:t,contentId:N(),titleId:N(),descriptionId:N(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,triggerRef:c,open:_,onOpenChange:v,onOpenToggle:B.useCallback(()=>v(e=>!e),[v]),hasCustomAnchor:l,onCustomAnchorAdd:B.useCallback(()=>u(!0),[]),onCustomAnchorRemove:B.useCallback(()=>u(!1),[]),modal:o,children:n})})},`Popover`),vo=`PopoverTrigger`,yo=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ lo(function(e,t){let{__scopePopover:n,...r}=e,i=go(vo,n),a=mo(n),o=C(t,i.triggerRef),s=/* @__PURE__ */ (0,V.jsx)(p.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Ao(i.open),...r,ref:o,onClick:F(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:/* @__PURE__ */ (0,V.jsx)(D,{asChild:!0,...a,children:s})},`PopoverTrigger`)),bo=`PopoverPortal`,[xo,So]=fo(bo,{forceMount:void 0}),Co=/* @__PURE__ */ lo(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=go(bo,t);return/* @__PURE__ */ (0,V.jsx)(xo,{scope:t,forceMount:n,children:/* @__PURE__ */ (0,V.jsx)(I,{present:n||a.open,children:/* @__PURE__ */ (0,V.jsx)(M,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),wo=`PopoverContent`,To=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ lo(function(e,t){let n=So(wo,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=go(wo,e.__scopePopover);return/* @__PURE__ */ (0,V.jsx)(I,{present:r||a.open,children:a.modal?/* @__PURE__ */ (0,V.jsx)(Do,{...i,ref:t}):/* @__PURE__ */ (0,V.jsx)(Oo,{...i,ref:t})})},`PopoverContent`)),Eo=l(`PopoverContent.RemoveScroll`),Do=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ lo(function(e,t){let n=go(wo,e.__scopePopover),r=B.useRef(null),i=C(t,r),a=B.useRef(!1),{nodes:o,registry:s}=T();return B.useEffect(()=>{let e=r.current;if(e)return Br(e)},[]),/* @__PURE__ */ (0,V.jsx)(jr,{as:Eo,allowPinchZoom:!0,shards:B.useMemo(()=>[r,...o.map(e=>({current:e}))],[r,o]),children:/* @__PURE__ */ (0,V.jsx)(ko,{...e,ref:i,branchNodes:o,branchRegistry:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:F(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:F(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:F(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),Oo=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ lo(function(e,t){let n=go(wo,e.__scopePopover),r=B.useRef(!1),i=B.useRef(!1);return/* @__PURE__ */ (0,V.jsx)(ko,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`PopoverContentNonModal`)),ko=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ lo(function(e,t){let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,"aria-describedby":d,branchNodes:f,branchRegistry:p,...m}=e,h=go(wo,n),g=mo(n),[_,b]=B.useState(null),S=C(t,b);return O(_),Sn(),/* @__PURE__ */ (0,V.jsx)(y,{registry:p,children:/* @__PURE__ */ (0,V.jsx)(v,{asChild:!0,loop:!0,trapped:r,branches:f,onMountAutoFocus:i,onUnmountAutoFocus:a,children:/* @__PURE__ */ (0,V.jsx)(x,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>h.onOpenChange(!1),deferPointerDownOutside:!0,children:/* @__PURE__ */ (0,V.jsx)(A,{"data-state":Ao(h.open),role:`dialog`,id:h.contentId,"aria-labelledby":h.titlePresent?h.titleId:void 0,"aria-describedby":h.descriptionPresent?jo(d,h.descriptionId):d,...g,...m,ref:S,style:{...m.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)`}})})})})},`PopoverContentImpl`));function Ao(e){return e?`open`:`closed`}lo(Ao,`getState`);function jo(...e){let t=/* @__PURE__ */ new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}lo(jo,`concatAriaDescribedby`);var Mo=Object.defineProperty,G=(e,t)=>Mo(e,`name`,{value:t,configurable:!0});function No(){let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e}var Po={ItemAligned:`item-aligned`,Popper:`popper`},Fo={LTR:`ltr`,RTL:`rtl`},Io=[` `,`Enter`,`ArrowUp`,`ArrowDown`],Lo=[` `,`Enter`],K=`Select`,[Ro,zo,Bo]=/* @__PURE__ */ Zt(K),[Vo,Ho]=c(K,[Bo,_]),Uo=_(),[Wo,Go]=Vo(K),[Ko,qo]=Vo(K);function Jo(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m,internal_do_not_use_render:_}=e,v=Uo(t),[y,b]=B.useState(null),[x,S]=B.useState(null),[C,w]=B.useState(!1),T=mn(l),[E,D]=g({prop:r,defaultProp:i??!1,onChange:a,caller:K}),[O,k]=g({prop:o,defaultProp:s,onChange:c,caller:K}),A=B.useRef(null),j=B.useRef(!1),[M,P]=B.useState(null),F=/* @__PURE__ */ G(e=>{P({value:e,hasConsumerStoppedPropagation:j.current}),k(e)},`handleUserSelect`),I=B.useRef(O);B.useEffect(()=>{let e=m?y?.ownerDocument.getElementById(m):y?.form;if(e instanceof HTMLFormElement){let t=/* @__PURE__ */ G(()=>k(I.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[m,y,k]);let ee=!y||!!m||!!y.closest(`form`),[te,ne]=B.useState(/* @__PURE__ */ new Set),re=N(),ie=Array.from(te).map(e=>e.props.value).join(`;`),ae=B.useCallback(e=>{ne(t=>new Set(t).add(e))},[]),oe=B.useCallback(e=>{ne(t=>{let n=new Set(t);return n.delete(e),n})},[]),se={required:p,trigger:y,onTriggerChange:b,valueNode:x,onValueNodeChange:S,valueNodeHasChildren:C,onValueNodeHasChildrenChange:w,contentId:re,value:O,onValueChange:k,hasConsumerStoppedPropagationRef:j,userSelection:M,onUserSelect:F,open:E,onOpenChange:D,dir:T,triggerPointerDownPosRef:A,disabled:f,name:u,autoComplete:d,form:m,nativeOptions:te,nativeSelectKey:ie,isFormControl:ee};return/* @__PURE__ */ (0,V.jsx)(h,{...v,children:/* @__PURE__ */ (0,V.jsx)(Wo,{scope:t,...se,children:/* @__PURE__ */ (0,V.jsx)(Ro.Provider,{scope:t,children:/* @__PURE__ */ (0,V.jsx)(Ko,{scope:t,onNativeOptionAdd:ae,onNativeOptionRemove:oe,children:As(_)?_(se):n})})})})}G(Jo,`SelectProvider`);var Yo=/* @__PURE__ */ G(e=>{let{__scopeSelect:t,children:n,...r}=e;return/* @__PURE__ */ (0,V.jsx)(Jo,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>/* @__PURE__ */ (0,V.jsxs)(V.Fragment,{children:[n,e?/* @__PURE__ */ (0,V.jsx)(ks,{__scopeSelect:t}):null]})})},`Select`),Xo=`SelectTrigger`,Zo=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ G(function(e,t){let{__scopeSelect:n,disabled:r=!1,...i}=e,a=Uo(n),o=Go(Xo,n),s=o.disabled||r,c=C(t,o.onTriggerChange),l=zo(n),u=B.useRef(`touch`),[d,f,m]=Ms(e=>{let t=l().filter(e=>!e.disabled),n=Ns(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onUserSelect(n.value)}),h=/* @__PURE__ */ G(e=>{s||(o.onOpenChange(!0),m()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},`handleOpen`);return/* @__PURE__ */ (0,V.jsx)(D,{asChild:!0,...a,children:/* @__PURE__ */ (0,V.jsx)(p.button,{type:`button`,role:`combobox`,"aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":js(o.value)?``:void 0,...i,ref:c,onClick:F(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&h(e)}),onPointerDown:F(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(h(e),e.preventDefault())}),onKeyDown:F(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&(o.hasConsumerStoppedPropagationRef.current=e.isPropagationStopped(),f(e.key)),!(t&&e.key===` `)&&Io.includes(e.key)&&(h(),e.preventDefault())})})})},`SelectTrigger`)),Qo=`SelectValue`,$o=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ G(function(e,t){let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=Go(Qo,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=C(t,c.onValueNodeChange);f(()=>{l(u)},[l,u]);let m=js(c.value);return/* @__PURE__ */ (0,V.jsx)(p.span,{...s,asChild:!m&&s.asChild,ref:d,style:{pointerEvents:`none`},children:/* @__PURE__ */ (0,V.jsx)(B.Fragment,{children:m?o:a},m?`placeholder`:`value`)})},`SelectValue`)),es=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ G(function(e,t){let{__scopeSelect:n,children:r,...i}=e;return/* @__PURE__ */ (0,V.jsx)(p.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})},`SelectIcon`)),[ts,ns]=Vo(`SelectPortal`,{forceMount:void 0}),rs=/* @__PURE__ */ G(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return/* @__PURE__ */ (0,V.jsx)(ts,{scope:e.__scopeSelect,forceMount:n,children:/* @__PURE__ */ (0,V.jsx)(M,{asChild:!0,...r})})},`SelectPortal`),is=`SelectContent`,as=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ G(function(e,t){let n=ns(is,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=Go(is,e.__scopeSelect),[o,s]=B.useState();return f(()=>{s(new DocumentFragment)},[]),/* @__PURE__ */ (0,V.jsx)(I,{present:r||a.open,children:({present:e})=>e?/* @__PURE__ */ (0,V.jsx)(ds,{...i,ref:t}):/* @__PURE__ */ (0,V.jsx)(os,{...i,fragment:o})})},`SelectContent`)),os=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ G(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?hn.createPortal(/* @__PURE__ */ (0,V.jsx)(cs,{scope:n,children:/* @__PURE__ */ (0,V.jsx)(Ro.Slot,{scope:n,children:/* @__PURE__ */ (0,V.jsx)(`div`,{ref:t,children:r})})}),i):null},`SelectContentFragment`)),ss=10,[cs,ls]=Vo(is),us=l(`SelectContent.RemoveScroll`),ds=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ G(function(e,t){let{__scopeSelect:n}=e,{position:r=Po.ItemAligned,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,..._}=e,y=Go(is,n),[b,S]=B.useState(null),[w,T]=B.useState(null),E=C(t,S),[D,O]=B.useState(null),[k,A]=B.useState(null),j=zo(n),[M,N]=B.useState(!1),P=B.useRef(!1),I=B.useRef(!1),ee=B.useRef(!1);B.useEffect(()=>{if(b)return Br(b)},[b]),Sn();let te=B.useCallback(e=>{let[t,...n]=j().map(e=>e.ref.current),[r]=n.slice(-1),i=No();for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&w&&(w.scrollTop=0),n===r&&w&&(w.scrollTop=w.scrollHeight),n?.focus(),No()!==i))return},[j,w]),ne=B.useCallback(()=>te([D,b]),[te,D,b]);B.useEffect(()=>{M&&ne()},[M,ne]);let{onOpenChange:re,triggerPointerDownPosRef:ie}=y;B.useEffect(()=>{if(b){let e={x:0,y:0},t=/* @__PURE__ */ G(t=>{e={x:Math.abs(Math.round(t.pageX)-(ie.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(ie.current?.y??0))}},`handlePointerMove`),n=/* @__PURE__ */ G(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(b)||re(!1),document.removeEventListener(`pointermove`,t),ie.current=null},`handlePointerUp`);return ie.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[b,re,ie]),B.useEffect(()=>{let e=/* @__PURE__ */ G(()=>re(!1),`close`);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[re]);let[ae,oe]=Ms(e=>{let t=j().filter(e=>!e.disabled),n=Ns(t,e,t.find(e=>e.ref.current===No()));n&&setTimeout(()=>n.ref.current?.focus())}),se=B.useCallback((e,t,n)=>{let r=!I.current;r&&(I.current=!0);let i=!P.current&&!n;y.value!==void 0&&y.value===t||i?(O(e),i&&(P.current=!0)):r&&O(e)},[y.value]),ce=B.useCallback(()=>b?.focus(),[b]),le=B.useCallback((e,t,n)=>{if(!e)return;let r=!ee.current;r&&(ee.current=!0);let i=!P.current&&!n;(y.value!==void 0&&y.value===t||i||r)&&A(e)},[y.value]),ue=r===Po.Popper?ps:fs,de=ue===ps?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return/* @__PURE__ */ (0,V.jsx)(cs,{scope:n,content:b,viewport:w,onViewportChange:T,itemRefCallback:se,selectedItem:D,onItemLeave:ce,itemTextRefCallback:le,focusSelectedItem:ne,selectedItemText:k,position:r,isPositioned:M,searchRef:ae,children:/* @__PURE__ */ (0,V.jsx)(jr,{as:us,allowPinchZoom:!0,children:/* @__PURE__ */ (0,V.jsx)(v,{asChild:!0,trapped:y.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:F(i,e=>{y.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:/* @__PURE__ */ (0,V.jsx)(x,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:/* @__PURE__ */ (0,V.jsx)(ue,{role:`listbox`,id:y.contentId,"data-state":y.open?`open`:`closed`,dir:y.dir,onContextMenu:e=>e.preventDefault(),..._,...de,onPlaced:()=>N(!0),ref:E,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:F(_.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&oe(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=j().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>te(t)),e.preventDefault()}})})})})})})},`SelectContentImpl`)),fs=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ G(function(e,t){let{__scopeSelect:n,onPlaced:r,...i}=e,a=Go(is,n),o=ls(is,n),[s,c]=B.useState(null),[l,u]=B.useState(null),d=C(t,u),m=zo(n),h=B.useRef(!1),g=B.useRef(!0),{viewport:_,selectedItem:v,selectedItemText:y,focusSelectedItem:b}=o,x=B.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&_&&v&&y){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=y.getBoundingClientRect();if(a.dir!==Fo.RTL){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-ss,d=so(a,[ss,Math.max(ss,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-ss,d=so(a,[ss,Math.max(ss,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=m(),c=window.innerHeight-ss*2,u=_.scrollHeight,d=window.getComputedStyle(l),f=parseInt(d.borderTopWidth,10),p=parseInt(d.paddingTop,10),g=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=f+p+u+b+g,S=Math.min(v.offsetHeight*5,x),C=window.getComputedStyle(_),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-ss,D=c-E,O=v.offsetHeight/2,k=v.offsetTop+O,A=f+p+k,j=x-A;if(A<=E){let e=o.length>0&&v===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-_.offsetTop-_.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+g);s.style.height=n+`px`}else{let e=o.length>0&&v===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,f+_.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,_.scrollTop=A-E+_.offsetTop}s.style.margin=`${ss}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>h.current=!0)}},[m,a.trigger,a.valueNode,s,l,_,v,y,a.dir,r]);f(()=>x(),[x]);let[S,w]=B.useState();f(()=>{l&&w(window.getComputedStyle(l).zIndex)},[l]);let T=B.useCallback(e=>{e&&g.current===!0&&(x(),b?.(),g.current=!1)},[x,b]);return/* @__PURE__ */ (0,V.jsx)(ms,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:h,onScrollButtonChange:T,children:/* @__PURE__ */ (0,V.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:S},children:/* @__PURE__ */ (0,V.jsx)(p.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})},`SelectItemAlignedPosition`)),ps=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ G(function(e,t){let{__scopeSelect:n,align:r=`start`,collisionPadding:i=ss,...a}=e,o=Uo(n);return/* @__PURE__ */ (0,V.jsx)(A,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.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)`}})},`SelectPopperPosition`)),[ms,hs]=Vo(is,{}),gs=`SelectViewport`,_s=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ G(function(e,t){let{__scopeSelect:n,nonce:r,...i}=e,a=ls(gs,n),o=hs(gs,n),s=C(t,a.onViewportChange),c=B.useRef(0);return/* @__PURE__ */ (0,V.jsxs)(V.Fragment,{children:[/* @__PURE__ */ (0,V.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:r}),/* @__PURE__ */ (0,V.jsx)(Ro.Slot,{scope:n,children:/* @__PURE__ */ (0,V.jsx)(p.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:F(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-ss*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})},`SelectViewport`)),[vs,ys]=Vo(`SelectGroup`),bs=`SelectItem`,[xs,Ss]=Vo(bs),Cs=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ G(function(e,t){let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=Go(bs,n),c=ls(bs,n),l=s.value===r,[u,d]=B.useState(a??``),[f,h]=B.useState(!1),g=m(e=>c.itemRefCallback?.(e,r,i)),_=C(t,g),v=N(),y=B.useRef(`touch`);function b(e){s.hasConsumerStoppedPropagationRef.current=e.isPropagationStopped(),s.onUserSelect(r),s.onOpenChange(!1)}return G(b,`handleSelect`),/* @__PURE__ */ (0,V.jsx)(xs,{scope:n,value:r,disabled:i,textId:v,isSelected:l,onItemTextChange:B.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:/* @__PURE__ */ (0,V.jsx)(Ro.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:/* @__PURE__ */ (0,V.jsx)(p.div,{role:`option`,"aria-labelledby":v,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:_,onFocus:F(o.onFocus,()=>h(!0)),onBlur:F(o.onBlur,()=>h(!1)),onClick:F(o.onClick,e=>{i||y.current!==`mouse`&&b(e)}),onPointerUp:F(o.onPointerUp,e=>{i||y.current===`mouse`&&b(e)}),onPointerDown:F(o.onPointerDown,e=>{y.current=e.pointerType}),onPointerMove:F(o.onPointerMove,e=>{y.current=e.pointerType,i?c.onItemLeave?.():y.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:F(o.onPointerLeave,e=>{e.currentTarget===No()&&c.onItemLeave?.()}),onKeyDown:F(o.onKeyDown,e=>{i||e.target!==e.currentTarget||(c.searchRef?.current===``||e.key!==` `)&&(Lo.includes(e.key)&&b(e),e.key===` `&&e.preventDefault())})})})})},`SelectItem`)),ws=`SelectItemText`,Ts=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ G(function(e,t){let{__scopeSelect:n,className:r,style:i,...a}=e,o=Go(ws,n),s=ls(ws,n),c=Ss(ws,n),l=qo(ws,n),[u,d]=B.useState(null),h=m(e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),g=C(t,d,c.onItemTextChange,h),_=u?.textContent,v=B.useMemo(()=>/* @__PURE__ */ (0,V.jsx)(`option`,{value:c.value,disabled:c.disabled,children:_},c.value),[c.disabled,c.value,_]),{onNativeOptionAdd:y,onNativeOptionRemove:b}=l;return f(()=>(y(v),()=>b(v)),[y,b,v]),/* @__PURE__ */ (0,V.jsxs)(V.Fragment,{children:[/* @__PURE__ */ (0,V.jsx)(p.span,{id:c.textId,...a,ref:g}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!js(o.value)?hn.createPortal(a.children,o.valueNode):null]})},`SelectItemText`)),Es=`SelectItemIndicator`,Ds=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ G(function(e,t){let{__scopeSelect:n,...r}=e;return Ss(Es,n).isSelected?/* @__PURE__ */ (0,V.jsx)(p.span,{"aria-hidden":!0,...r,ref:t}):null},`SelectItemIndicator`)),Os=`SelectBubbleInput`,ks=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ G(function({__scopeSelect:e,...t},n){let r=Go(Os,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:l,form:u,userSelection:d}=r,{nativeOptions:f,nativeSelectKey:m}=r,h=B.useRef(null),g=C(n,h),_=i??``,v=B.useRef(_),y=B.useRef(d),b=B.useRef(!1),x=Array.from(f).some(e=>(e.props.value??``)===``);return B.useEffect(()=>{let e=h.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set,r=d!==null&&d!==y.current;y.current=d;let i=v.current!==_;v.current=_;let a=r&&i;if(r&&!i&&d.value!==_&&!d.hasConsumerStoppedPropagation&&n){b.current=!0;try{n.call(e,d.value),e.dispatchEvent(new Event(`change`,{bubbles:!0}))}finally{b.current=!1,n.call(e,_)}return}let o=a&&!d.hasConsumerStoppedPropagation;if(i&&n){let t=new Event(`change`,{bubbles:o});n.call(e,_),e.dispatchEvent(t)}},[_,d]),/* @__PURE__ */ (0,V.jsxs)(p.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:u,onChange:e=>{b.current||a(e.target.value)},...t,style:{...P,...t.style},ref:g,defaultValue:_,children:[js(i)&&!x?/* @__PURE__ */ (0,V.jsx)(`option`,{value:``}):null,Array.from(f)]},m)},`SelectBubbleInput`));function As(e){return typeof e==`function`}G(As,`isFunction`);function js(e){return e===``||e===void 0}G(js,`shouldShowPlaceholder`);function Ms(e){let t=m(e),n=B.useRef(``),r=B.useRef(0),i=B.useCallback(e=>{let i=n.current+e;t(i);function a(e){n.current=e,window.clearTimeout(r.current),e!==``&&(r.current=window.setTimeout(()=>a(``),1e3))}G(a,`updateSearch`),a(i)},[t]),a=B.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return B.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}G(Ms,`useTypeaheadSearch`);function Ns(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Ps(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}G(Ns,`findNextItem`);function Ps(e,t){return e.map((n,r)=>e[(t+r)%e.length])}G(Ps,`wrapArray`);var Fs=Object.defineProperty,q=(e,t)=>Fs(e,`name`,{value:t,configurable:!0}),Is={Vertical:`vertical`,Horizontal:`horizontal`},Ls={LTR:`ltr`,RTL:`rtl`},Rs=[`PageUp`,`PageDown`],zs=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],Bs={"from-left":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-right":[`Home`,`PageDown`,`ArrowDown`,`ArrowRight`],"from-bottom":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-top":[`Home`,`PageDown`,`ArrowUp`,`ArrowLeft`]},Vs=`Slider`,[Hs,Us,Ws]=/* @__PURE__ */ Zt(Vs),[Gs,Ks]=c(Vs,[Ws]),[qs,Js]=Gs(Vs),Ys=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ q(function(e,t){let{name:n,min:r=0,max:i=100,step:a=1,orientation:o=Is.Horizontal,disabled:s=!1,minStepsBetweenThumbs:c=0,preserveThumbOrder:l=!1,defaultValue:u=[r],value:d,onValueChange:f=/* @__PURE__ */ q(()=>{},`onValueChange`),onValueCommit:p=/* @__PURE__ */ q(()=>{},`onValueCommit`),inverted:m=!1,form:h,..._}=e,v=B.useRef(/* @__PURE__ */ new Set),y=B.useRef(0),b=B.useRef(!1),[x,S]=B.useState(null),w=o===Is.Horizontal?Qs:$s,[T,E]=B.useState(null),D=C(t,E),[O=[],k]=g({prop:d,defaultProp:u,onChange:/* @__PURE__ */ q(e=>{[...v.current][y.current]?.focus({preventScroll:!0,focusVisible:b.current}),b.current=!1,f(e)},`onChange`)}),A=B.useRef(O),j=B.useRef(O);B.useEffect(()=>{let e=h?T?.ownerDocument.getElementById(h):T?.closest(`form`);if(e instanceof HTMLFormElement){let t=/* @__PURE__ */ q(()=>k(j.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[T,h,k]);function M(e){I(e,_c(O,e))}q(M,`handleSlideStart`);function N(e){I(e,y.current)}q(N,`handleSlideMove`);function P(){String(O)!==String(A.current)&&p(O)}q(P,`handleSlideEnd`);function I(e,t,{commit:n}={commit:!1}){let o=Sc(a),s=so(Cc(Math.round((e-r)/a)*a+r,o),[r,i]),u=c*a;function d(e){let n=l?so(s,[e[t-1]===void 0?r:e[t-1]+u,e[t+1]===void 0?i:e[t+1]-u]):s,a=mc(e,n,t);return bc(a,u)?{nextValues:a,changedIndex:l?t:a.indexOf(n),hasChanged:String(a)!==String(e)}:null}q(d,`getNextValues`);let f=d(O);f?.hasChanged&&S(f.nextValues),k((e=[])=>{let t=d(e);return t?(y.current=t.changedIndex,t.hasChanged&&n&&p(t.nextValues),t.hasChanged?t.nextValues:e):e})}return q(I,`updateValues`),/* @__PURE__ */ (0,V.jsx)(qs,{scope:e.__scopeSlider,name:n,disabled:s,min:r,max:i,valueIndexToChangeRef:y,thumbs:v.current,values:O,orientation:o,form:h,userRequestedValues:x,children:/* @__PURE__ */ (0,V.jsx)(Hs.Provider,{scope:e.__scopeSlider,children:/* @__PURE__ */ (0,V.jsx)(Hs.Slot,{scope:e.__scopeSlider,children:/* @__PURE__ */ (0,V.jsx)(w,{"aria-disabled":s,"data-disabled":s?``:void 0,..._,ref:D,onPointerDown:F(_.onPointerDown,()=>{s||(A.current=O,b.current=!1)}),min:r,max:i,inverted:m,onSlideStart:s?void 0:M,onSlideMove:s?void 0:N,onSlideEnd:s?void 0:P,onHomeKeyDown:()=>{s||(b.current=!0,I(r,0,{commit:!0}))},onEndKeyDown:()=>{s||(b.current=!0,I(i,O.length-1,{commit:!0}))},onStepKeyDown:({event:e,direction:t})=>{if(!s){b.current=!0;let n=Rs.includes(e.key)||e.shiftKey&&zs.includes(e.key)?10:1,i=y.current,o=O[i];I(wc(o,{min:r,step:a,direction:t,multiplier:n}),i,{commit:!0})}}})})})})},`Slider`)),[Xs,Zs]=Gs(Vs,{startEdge:`left`,endEdge:`right`,size:`width`,direction:1}),Qs=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ q(function(e,t){let{min:n,max:r,dir:i,inverted:a,onSlideStart:o,onSlideMove:s,onSlideEnd:c,onStepKeyDown:l,...u}=e,[d,f]=B.useState(null),p=C(t,f),m=B.useRef(void 0),h=mn(i),g=h===Ls.LTR,_=g&&!a||!g&&a;function v(e){let t=m.current||d.getBoundingClientRect(),i=xc([0,t.width],_?[n,r]:[r,n]);return m.current=t,i(e-t.left)}return q(v,`getValueFromPointer`),/* @__PURE__ */ (0,V.jsx)(Xs,{scope:e.__scopeSlider,startEdge:_?`left`:`right`,endEdge:_?`right`:`left`,direction:_?1:-1,size:`width`,children:/* @__PURE__ */ (0,V.jsx)(ec,{dir:h,"data-orientation":`horizontal`,...u,ref:p,style:{...u.style,"--radix-slider-thumb-transform":`translateX(-50%)`},onSlideStart:e=>{let t=v(e.clientX);o?.(t)},onSlideMove:e=>{let t=v(e.clientX);s?.(t)},onSlideEnd:()=>{m.current=void 0,c?.()},onStepKeyDown:e=>{let t=Bs[_?`from-left`:`from-right`].includes(e.key);l?.({event:e,direction:t?-1:1})}})})},`SliderHorizontal`)),$s=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ q(function(e,t){let{min:n,max:r,inverted:i,onSlideStart:a,onSlideMove:o,onSlideEnd:s,onStepKeyDown:c,...l}=e,u=B.useRef(null),d=C(t,u),f=B.useRef(void 0),p=!i;function m(e){let t=f.current||u.current.getBoundingClientRect(),i=xc([0,t.height],p?[r,n]:[n,r]);return f.current=t,i(e-t.top)}return q(m,`getValueFromPointer`),/* @__PURE__ */ (0,V.jsx)(Xs,{scope:e.__scopeSlider,startEdge:p?`bottom`:`top`,endEdge:p?`top`:`bottom`,size:`height`,direction:p?1:-1,children:/* @__PURE__ */ (0,V.jsx)(ec,{"data-orientation":`vertical`,...l,ref:d,style:{...l.style,"--radix-slider-thumb-transform":`translateY(50%)`},onSlideStart:e=>{let t=m(e.clientY);a?.(t)},onSlideMove:e=>{let t=m(e.clientY);o?.(t)},onSlideEnd:()=>{f.current=void 0,s?.()},onStepKeyDown:e=>{let t=Bs[p?`from-bottom`:`from-top`].includes(e.key);c?.({event:e,direction:t?-1:1})}})})},`SliderVertical`)),ec=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ q(function(e,t){let{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:a,onHomeKeyDown:o,onEndKeyDown:s,onStepKeyDown:c,...l}=e,u=Js(Vs,n);return/* @__PURE__ */ (0,V.jsx)(p.span,{...l,ref:t,onKeyDown:F(e.onKeyDown,e=>{e.key===`Home`?(o(e),e.preventDefault()):e.key===`End`?(s(e),e.preventDefault()):Rs.concat(zs).includes(e.key)&&(c(e),e.preventDefault())}),onPointerDown:F(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),u.thumbs.has(t)?t.focus({preventScroll:!0,focusVisible:!1}):r(e)}),onPointerMove:F(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&i(e)}),onPointerUp:F(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),a(e))})})},`SliderImpl`)),tc=`SliderTrack`,nc=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ q(function(e,t){let{__scopeSlider:n,...r}=e,i=Js(tc,n);return/* @__PURE__ */ (0,V.jsx)(p.span,{"data-disabled":i.disabled?``:void 0,"data-orientation":i.orientation,...r,ref:t})},`SliderTrack`)),rc=`SliderRange`,ic=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ q(function(e,t){let{__scopeSlider:n,...r}=e,i=Js(rc,n),a=Zs(rc,n),o=B.useRef(null),s=C(t,o),c=i.values.length,l=i.values.map(e=>hc(e,i.min,i.max)),u=c>1?Math.min(...l):0,d=100-Math.max(...l);return/* @__PURE__ */ (0,V.jsx)(p.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?``:void 0,...r,ref:s,style:{...e.style,[a.startEdge]:u+`%`,[a.endEdge]:d+`%`}})},`SliderRange`)),[ac,oc]=Gs(`SliderThumb`),sc=`SliderThumbProvider`;function cc(e){let{__scopeSlider:t,name:n,children:r,internal_do_not_use_render:i}=e,a=Js(sc,t),o=Us(t),[s,c]=B.useState(null),l=B.useMemo(()=>s?o().findIndex(e=>e.ref.current===s):-1,[o,s]),u=w(s),d=!s||!!a.form||!!s.closest(`form`),f=a.values[l],p=n??(a.name?a.name+(a.values.length>1?`[]`:``):void 0),m=f===void 0?0:hc(f,a.min,a.max);B.useEffect(()=>{if(s)return a.thumbs.add(s),()=>{a.thumbs.delete(s)}},[s,a.thumbs]);let h={value:f,name:p,form:a.form,isFormControl:d,index:l,thumb:s,onThumbChange:c,percent:m,size:u};return/* @__PURE__ */ (0,V.jsx)(ac,{scope:t,...h,children:Tc(i)?i(h):r})}q(cc,`SliderThumbProvider`);var lc=`SliderThumbTrigger`,uc=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ q(function(e,t){let{__scopeSlider:n,...r}=e,i=Js(lc,n),a=Zs(lc,n),{index:o,value:s,percent:c,size:l,onThumbChange:u}=oc(lc,n),d=C(t,u),f=gc(o,i.values.length),m=l?.[a.size],h=m?vc(m,c,a.direction):0;return/* @__PURE__ */ (0,V.jsx)(`span`,{style:{transform:`var(--radix-slider-thumb-transform)`,position:`absolute`,[a.startEdge]:`calc(${c}% + ${h}px)`},children:/* @__PURE__ */ (0,V.jsx)(Hs.ItemSlot,{scope:n,children:/* @__PURE__ */ (0,V.jsx)(p.span,{role:`slider`,"aria-label":e[`aria-label`]||f,"aria-valuemin":i.min,"aria-valuenow":s,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?``:void 0,tabIndex:i.disabled?void 0:0,...r,ref:d,style:s===void 0?{display:`none`}:e.style,onFocus:F(e.onFocus,()=>{i.valueIndexToChangeRef.current=o})})})})},`SliderThumbTrigger`)),dc=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ q(function(e,t){let{__scopeSlider:n,name:r,...i}=e;return/* @__PURE__ */ (0,V.jsx)(cc,{__scopeSlider:n,name:r,internal_do_not_use_render:({index:e,isFormControl:r})=>/* @__PURE__ */ (0,V.jsxs)(V.Fragment,{children:[/* @__PURE__ */ (0,V.jsx)(uc,{...i,ref:t,__scopeSlider:n}),r?/* @__PURE__ */ (0,V.jsx)(pc,{__scopeSlider:n},e):null]})})},`SliderThumb`)),fc=`SliderBubbleInput`,pc=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ q(function({__scopeSlider:e,onInput:t,...n},r){let{index:i,value:a,name:o,form:s}=oc(fc,e),{userRequestedValues:c}=Js(fc,e),l=B.useRef(null),u=C(l,r),d=B.useRef(!1),f=B.useRef(a),m=B.useRef(c),h=B.useRef(c);return B.useEffect(()=>{let e=l.current;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set,r=f.current,o=r!==a;f.current=a;let s=c!==h.current;if(h.current=c,o&&n){let t=c!==m.current;m.current=c;let o=c?.[i];d.current=!(t&&(s&&o!==r||o===a));let l=new Event(`input`,{bubbles:!0});n.call(e,a),e.dispatchEvent(l),d.current=!1}},[i,a,c]),/* @__PURE__ */ (0,V.jsx)(p.input,{style:{display:`none`},name:o,form:s,...n,ref:u,defaultValue:a,onInput:F(t,e=>{d.current&&e.stopPropagation()})})},`SliderBubbleInput`));function mc(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}q(mc,`getNextSortedValues`);function hc(e,t,n){return so(100/(n-t)*(e-t),[0,100])}q(hc,`convertValueToPercentage`);function gc(e,t){if(t>2)return`Value ${e+1} of ${t}`;if(t===2)return[`Minimum`,`Maximum`][e]}q(gc,`getLabel`);function _c(e,t){if(e.length===1)return 0;let n=e.map(e=>Math.abs(e-t)),r=Math.min(...n);return n.indexOf(r)}q(_c,`getClosestValueIndex`);function vc(e,t,n){let r=e/2;return(r-xc([0,50],[0,r])(t)*n)*n}q(vc,`getThumbInBoundsOffset`);function yc(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}q(yc,`getStepsBetweenValues`);function bc(e,t){if(t>0){let n=yc(e);return Math.min(...n)>=t}return!0}q(bc,`hasMinStepsBetweenValues`);function xc(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}q(xc,`linearScale`);function Sc(e){if(!Number.isFinite(e))return 0;let t=e.toString();if(t.includes(`e`)){let[e,n]=t.split(`e`),r=e.split(`.`)[1]||``,i=Number(n);return Math.max(0,r.length-i)}let n=t.split(`.`)[1];return n?n.length:0}q(Sc,`getDecimalCount`);function Cc(e,t){let n=10**t;return Math.round(e*n)/n}q(Cc,`roundValue`);function wc(e,{min:t,step:n,direction:r,multiplier:i}){let a=Sc(n),o=(e-t)/n,s=Math.round(o),c=Cc(s*n+t,a)===Cc(e,a),l;return l=c?s+i*r:r>0?Math.ceil(o):Math.floor(o),Cc(l*n+t,a)}q(wc,`getNextStepValue`);function Tc(e){return typeof e==`function`}q(Tc,`isFunction`);var Ec=Object.defineProperty,Dc=(e,t)=>Ec(e,`name`,{value:t,configurable:!0}),Oc=`Toggle`,kc=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Dc(function(e,t){let{pressed:n,defaultPressed:r,onPressedChange:i,...a}=e,[o,s]=g({prop:n,onChange:i,defaultProp:r??!1,caller:Oc});return/* @__PURE__ */ (0,V.jsx)(p.button,{type:`button`,"aria-pressed":o,"data-state":o?`on`:`off`,"data-disabled":e.disabled?``:void 0,...a,ref:t,onClick:F(e.onClick,()=>{e.disabled||s(!o)})})},`Toggle`)),Ac=Object.defineProperty,jc=(e,t)=>Ac(e,`name`,{value:t,configurable:!0}),Mc=`ToggleGroup`,Nc={Single:`single`,Multiple:`multiple`},[Pc,Fc]=c(Mc,[Mi]),Ic=Mi(),Lc=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ jc(function(e,t){let{type:n,...r}=e;if(n===Nc.Single)return/* @__PURE__ */ (0,V.jsx)(Bc,{role:`radiogroup`,...r,ref:t});if(n===Nc.Multiple)return/* @__PURE__ */ (0,V.jsx)(Vc,{role:`toolbar`,...r,ref:t});throw Error(`Missing prop \`type\` expected on \`${Mc}\``)},`ToggleGroup`)),[Rc,zc]=Pc(Mc),Bc=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ jc(function(e,t){let{value:n,defaultValue:r,onValueChange:i=/* @__PURE__ */ jc(()=>{},`onValueChange`),...a}=e,[o,s]=g({prop:n,defaultProp:r??``,onChange:i,caller:Mc});return/* @__PURE__ */ (0,V.jsx)(Rc,{scope:e.__scopeToggleGroup,type:Nc.Single,value:B.useMemo(()=>o?[o]:[],[o]),onItemActivate:s,onItemDeactivate:B.useCallback(()=>s(``),[s]),children:/* @__PURE__ */ (0,V.jsx)(Wc,{...a,ref:t})})},`ToggleGroupImplSingle`)),Vc=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ jc(function(e,t){let{value:n,defaultValue:r,onValueChange:i=/* @__PURE__ */ jc(()=>{},`onValueChange`),...a}=e,[o,s]=g({prop:n,defaultProp:r??[],onChange:i,caller:Mc}),c=B.useCallback(e=>s((t=[])=>[...t,e]),[s]),l=B.useCallback(e=>s((t=[])=>t.filter(t=>t!==e)),[s]);return/* @__PURE__ */ (0,V.jsx)(Rc,{scope:e.__scopeToggleGroup,type:Nc.Multiple,value:o,onItemActivate:c,onItemDeactivate:l,children:/* @__PURE__ */ (0,V.jsx)(Wc,{...a,ref:t})})},`ToggleGroupImplMultiple`)),[Hc,Uc]=Pc(Mc),Wc=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ jc(function(e,t){let{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:i=!0,orientation:a,dir:o,loop:s=!0,...c}=e,l=Ic(n),u=mn(o),d={dir:u,...c};return/* @__PURE__ */ (0,V.jsx)(Hc,{scope:n,rovingFocus:i,disabled:r,children:i?/* @__PURE__ */ (0,V.jsx)(Li,{asChild:!0,...l,orientation:a,dir:u,loop:s,children:/* @__PURE__ */ (0,V.jsx)(p.div,{...d,ref:t})}):/* @__PURE__ */ (0,V.jsx)(p.div,{...d,ref:t})})},`ToggleGroupImpl`)),Gc=`ToggleGroupItem`,Kc=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ jc(function(e,t){let n=zc(Gc,e.__scopeToggleGroup),r=Uc(Gc,e.__scopeToggleGroup),i=Ic(e.__scopeToggleGroup),a=n.value.includes(e.value),o=r.disabled||e.disabled,s={...e,pressed:a,disabled:o},c=B.useRef(null);return r.rovingFocus?/* @__PURE__ */ (0,V.jsx)(Bi,{asChild:!0,...i,focusable:!o,active:a,ref:c,children:/* @__PURE__ */ (0,V.jsx)(qc,{...s,ref:t})}):/* @__PURE__ */ (0,V.jsx)(qc,{...s,ref:t})},`ToggleGroupItem`)),qc=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ jc(function(e,t){let{__scopeToggleGroup:n,value:r,...i}=e,a=zc(Gc,n),o={role:`radio`,"aria-checked":e.pressed,"aria-pressed":void 0},s=a.type===Nc.Single?o:void 0;return/* @__PURE__ */ (0,V.jsx)(kc,{...s,...i,ref:t,onPressedChange:e=>{e?a.onItemActivate(r):a.onItemDeactivate(r)}})},`ToggleGroupItemImpl`)),Jc=/* @__PURE__ */ (0,B.createContext)({});function Yc(e){let t=(0,B.useRef)(null);return t.current===null&&(t.current=e()),t.current}var Xc=typeof window<`u`?B.useLayoutEffect:B.useEffect,Zc=/* @__PURE__ */ (0,B.createContext)(null);function Qc(e,t){e.indexOf(t)===-1&&e.push(t)}function $c(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var el=(e,t,n)=>n>t?t:n<e?e:n,tl={},nl=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),rl=e=>typeof e==`object`&&!!e,il=e=>/^0[^.\s]+$/u.test(e);/*#__NO_SIDE_EFFECTS__*/
52
- function al(e){let t;return()=>(t===void 0&&(t=e()),t)}var ol=/* @__NO_SIDE_EFFECTS__ */ e=>e,sl=(...e)=>e.reduce((e,t)=>n=>t(e(n))),cl=/* @__NO_SIDE_EFFECTS__ */ (e,t,n)=>{let r=t-e;return r?(n-e)/r:1},ll=class{constructor(){this.subscriptions=[]}add(e){return Qc(this.subscriptions,e),()=>this.remove(e)}remove(e){$c(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r){if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},ul=/* @__NO_SIDE_EFFECTS__ */ e=>e*1e3,dl=/* @__NO_SIDE_EFFECTS__ */ e=>e/1e3,fl=/* @__NO_SIDE_EFFECTS__ */ (e,t)=>t?1e3/t*e:0,pl=(e,t,n)=>{let r=t-e;return((n-e)%r+r)%r+e},ml=(e,t,n)=>e*(3*(1-e)*((1-e)*t+e*n)+e*e);/*#__NO_SIDE_EFFECTS__*/
53
- function hl(e,t,n,r){return e===t&&n===r?ol:i=>{let a=0,o=1,s=i;for(let t=0;;t++){s>=a&&s<=o||(s=(a+o)/2);let r=ml(s,e,n)-i;if(r*r<1e-28||t===40)break;r>0?o=s:a=s,s-=r*1e-7/(ml(s+1e-7,e,n)-i-r)}return ml(s,t,r)}}var gl=/* @__NO_SIDE_EFFECTS__ */ e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,_l=/* @__NO_SIDE_EFFECTS__ */ e=>t=>1-e(1-t),vl=/*@__PURE__*/ hl(.33,1.53,.69,.99),yl=/*@__PURE__*/ _l(vl),bl=/*@__PURE__*/ gl(yl),xl=e=>e>=1?1:(e*=2)<1?.5*yl(e):.5*(2-2**(-10*(e-1))),Sl=e=>1-Math.sin(Math.acos(e)),Cl=/* @__PURE__ */ _l(Sl),wl=/* @__PURE__ */ gl(Sl),Tl=/*@__PURE__*/ hl(.42,0,1,1),El=/*@__PURE__*/ hl(0,0,.58,1),Dl=/*@__PURE__*/ hl(.42,0,.58,1),Ol=/* @__NO_SIDE_EFFECTS__ */ e=>Array.isArray(e)&&typeof e[0]!=`number`;/*#__NO_SIDE_EFFECTS__*/
54
- function kl(e,t){return/* @__PURE__ */ Ol(e)?e[pl(0,e.length,t)]:e}var Al=/* @__NO_SIDE_EFFECTS__ */ e=>Array.isArray(e)&&typeof e[0]==`number`,jl={linear:ol,easeIn:Tl,easeInOut:Dl,easeOut:El,circIn:Sl,circInOut:wl,circOut:Cl,backIn:yl,backInOut:bl,backOut:vl,anticipate:xl},Ml=e=>typeof e==`string`,Nl=e=>{if(/* @__PURE__ */ Al(e)){let[t,n,r,i]=e;return/* @__PURE__ */ hl(t,n,r,i)}return Ml(e)?jl[e]:e},Pl={delta:0,timestamp:0,isProcessing:!1},Fl;function Il(){Fl=void 0}var J={now:()=>(Fl===void 0&&J.set(Pl.isProcessing||tl.useManualTiming?Pl.timestamp:performance.now()),Fl),set:e=>{Fl=e,queueMicrotask(Il)}},Ll=e=>Math.round(e*1e5)/1e5,Rl=e=>t=>typeof t==`string`&&t.startsWith(e),zl=/*@__PURE__*/ Rl(`--`),Bl=/*@__PURE__*/ Rl(`var(--`),Vl=e=>Bl(e)?Hl.test(e.split(`/*`)[0].trim()):!1,Hl=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Ul(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}var Wl={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},Gl={...Wl,transform:e=>el(0,1,e)},Kl={...Wl,default:1},ql=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Jl(e){return e==null}var Yl=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Xl=(e,t)=>n=>!!(typeof n==`string`&&Yl.test(n)&&n.startsWith(e)||t&&!Jl(n)&&Object.prototype.hasOwnProperty.call(n,t)),Zl=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(ql);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},Ql=e=>el(0,255,e),$l={...Wl,transform:e=>Math.round(Ql(e))},eu={test:/*@__PURE__*/ Xl(`rgb`,`red`),parse:/*@__PURE__*/ Zl(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+$l.transform(e)+`, `+$l.transform(t)+`, `+$l.transform(n)+`, `+Ll(Gl.transform(r))+`)`},tu=(e,t,n)=>{let r=e.substring(1+t*n,1+(t+1)*n);return n>1?r:r+r};function nu(e){let t=e.length>5?2:1,n=tu(e,3,t);return{red:parseInt(tu(e,0,t),16),green:parseInt(tu(e,1,t),16),blue:parseInt(tu(e,2,t),16),alpha:n?parseInt(n,16)/255:1}}var ru={test:/*@__PURE__*/ Xl(`#`),parse:nu,transform:eu.transform},iu=/* @__NO_SIDE_EFFECTS__ */ e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),au=/*@__PURE__*/ iu(`deg`),ou=/*@__PURE__*/ iu(`%`),Y=/*@__PURE__*/ iu(`px`),su=/*@__PURE__*/ iu(`vh`),cu=/*@__PURE__*/ iu(`vw`),lu={...ou,parse:e=>ou.parse(e)/100,transform:e=>ou.transform(e*100)},uu={test:/*@__PURE__*/ Xl(`hsl`,`hue`),parse:/*@__PURE__*/ Zl(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+ou.transform(Ll(t))+`, `+ou.transform(Ll(n))+`, `+Ll(Gl.transform(r))+`)`},du={test:e=>eu.test(e)||ru.test(e)||uu.test(e),parse:e=>eu.test(e)?eu.parse(e):uu.test(e)?uu.parse(e):ru.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?eu.transform(e):uu.transform(e),getAnimatableNone:e=>{let t=du.parse(e);return t.alpha=0,du.transform(t)}},fu=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,pu=/*@__PURE__*/ new RegExp(ql.source),mu=/*@__PURE__*/ new RegExp(fu.source,`i`);function hu(e){return isNaN(e)&&typeof e==`string`&&(pu.test(e)||mu.test(e))}var gu=`number`,_u=`color`,vu=`var`,yu=`var(`,bu="${}",xu=/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+)(?![a-z]*\()/giu;function Su(e){let t=e.toString();return pu.test(t)||mu.test(t)}function Cu(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(xu,e=>(du.test(e)?(r.color.push(a),i.push(_u),n.push(du.parse(e))):e.startsWith(yu)?(r.var.push(a),i.push(vu),n.push(e)):(r.number.push(a),i.push(gu),n.push(parseFloat(e))),++a,bu)).split(bu),indexes:r,types:i}}function wu(e){return Cu(e).values}function Tu({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];i+=e===gu?Ll(r[a]):e===_u?du.transform(r[a]):r[a]}return i}}function Eu(e){return Tu(Cu(e))}var Du=e=>typeof e==`number`?0:du.test(e)?du.getAnimatableNone(e):e,Ou=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:Du(e);function ku(e){let t=Cu(e);return Tu(t)(t.values.map((e,n)=>Ou(e,t.split[n])))}var Au={test:hu,parse:wu,createTransformer:Eu,getAnimatableNone:ku};function ju(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Mu({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=ju(s,r,e+1/3),a=ju(s,r,e),o=ju(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function Nu(e,t){return n=>n>0?t:e}var Pu=(e,t,n)=>e+(t-e)*n,Fu=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Iu=[ru,eu,uu],Lu=e=>Iu.find(t=>t.test(e));function Ru(e){let t=Lu(e);if(!t)return!1;let n=t.parse(e);return t===uu&&(n=Mu(n)),n}var zu=(e,t)=>{let n=Ru(e),r=Ru(t);if(!n||!r)return Nu(e,t);let i={...n};return e=>(i.red=Fu(n.red,r.red,e),i.green=Fu(n.green,r.green,e),i.blue=Fu(n.blue,r.blue,e),i.alpha=Pu(n.alpha,r.alpha,e),eu.transform(i))},Bu=/* @__PURE__ */ new Set([`none`,`hidden`]);function Vu(e,t){return Bu.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Hu(e,t){return n=>Pu(e,t,n)}function Uu(e){return typeof e==`number`?Hu:typeof e==`string`?Vl(e)?Nu:du.test(e)?zu:qu:Array.isArray(e)?Wu:typeof e==`object`?du.test(e)?zu:Gu:Nu}function Wu(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>Uu(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function Gu(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Uu(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function Ku(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}var qu=(e,t)=>{let n=Cu(e),r=Cu(t);return n.indexes.var.length===r.indexes.var.length&&n.indexes.color.length===r.indexes.color.length&&n.indexes.number.length>=r.indexes.number.length?Bu.has(e)&&!r.values.length||Bu.has(t)&&!n.values.length?Vu(e,t):sl(Wu(Ku(n,r),r.values),Tu(r)):Nu(e,t)},Ju=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function Yu(e,t){let n=Ju.exec(e);if(!n)return;let r=Ju.exec(t);if(!r||n[2]!==r[2])return;let i=n[2],a=parseFloat(n[1]),o=parseFloat(r[1]);return e=>Ll(Pu(a,o,e))+i}function Xu(e,t,n){if(typeof e==`number`&&typeof t==`number`&&typeof n==`number`)return Pu(e,t,n);if(typeof e==`string`&&typeof t==`string`){let n=Yu(e,t);if(n)return n}return Uu(e)(e,t)}var Zu=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function X(e){let t=/* @__PURE__ */ new Set,n=/* @__PURE__ */ new Set,r=!1,i=!1,a,o=/* @__PURE__ */ new Set,s={delta:0,timestamp:0,isProcessing:!1};function c(t){o.has(t)&&(n.add(t),e()),(a=t)(s)}let l={schedule:(e,i=!1,s=!1)=>{let c=s&&r,l=c?t:n;return i&&o.add(e),c&&e!==a&&l.delete(e),l.add(e),e},cancel:e=>{n.delete(e),o.delete(e)},process:e=>{if(s=e,r){i=!0;return}r=!0;let o=t;t=n,n=o,t.forEach(c),t.clear(),a=void 0,r=!1,i&&(i=!1,l.process(e))}};return l}var Z=40;function Qu(e,t,n={delta:0,timestamp:0,isProcessing:!1}){let r=!1,i=!0,a=()=>r=!0,o=Zu.reduce((e,t)=>(e[t]=X(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=tl.useManualTiming,o=a?n.timestamp:performance.now();r=!1,a||(n.delta=i?1e3/60:Math.max(Math.min(o-n.timestamp,Z),1)),n.timestamp=o,n.isProcessing=!0,s.process(n),c.process(n),l.process(n),u.process(n),d.process(n),f.process(n),p.process(n),m.process(n),n.isProcessing=!1,r&&t&&(i=!1,e(h))},g=()=>{r=!0,i=!0,n.isProcessing||e(h)};return{schedule:Zu.reduce((e,t)=>{let n=o[t];return e[t]=(e,t=!1,i=!1)=>(r||g(),n.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<Zu.length;t++)o[Zu[t]].cancel(e)},state:n,steps:o}}var{schedule:Q,cancel:$u,steps:ed}=/* @__PURE__ */ Qu(typeof requestAnimationFrame<`u`?requestAnimationFrame:ol,!0,Pl),td=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>Q.update(t,e),stop:()=>$u(t),now:()=>Pl.isProcessing?Pl.timestamp:J.now()}},nd=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},rd=2e4;function id(e,t=50,n=rd,r){let i=0,a=e.next(i);for(r?.push(a.value);!a.done&&i<n;)i+=t,a=e.next(i),r?.push(a.value);return i>=n?1/0:i}function ad(e,t=100,n){let{keyframes:r,velocity:i}=e,a=r&&r[r.length-1]-r[0],o=n({...e,velocity:i&&a?i*t/a:i,keyframes:[0,t]}),s=Math.min(id(o),rd);return{type:`keyframes`,ease:e=>o.next(s*e).value/t,duration:/* @__PURE__ */ dl(s)}}var od=100,sd=10,cd=1,ld=800,ud=.3,dd=.3,fd=.01,pd=2,md=.005,hd=.5,gd=.01,_d=10,vd=.05,yd=e=>e<0?1/Math.max(1+e,vd):Math.max(1-e,vd);function bd(e,t){if(!(e>1))return 1;let n=Math.sqrt(e*e-1),r=e-n,i=e+n,a=2*n*Math.exp(-t)*(1+t);return Cd(e=>i*Math.exp(-r*e)-r*Math.exp(-i*e)-a,e=>Math.exp(-i*e)-Math.exp(-r*e),t)/t}function xd(e,t){return e*Math.sqrt(1-t*t)}var Sd=12;function Cd(e,t,n){let r=n;for(let n=1;n<Sd;n++)r-=e(r)/t(r);return r}var wd=.001;function Td({duration:e=ld,bounce:t=ud}){let n,r,i=yd(t);e=el(gd,_d,/* @__PURE__ */ dl(e)),i<1?(n=t=>{let n=t*i,r=n*e,a=xd(t,i),o=Math.exp(-r);return wd-n/a*o},r=t=>{let r=t*i*e,a=i*i*t*t*e,o=Math.exp(-r),s=xd(t*t,i);return(-n(t)+wd>0?-1:1)*-a*o/s}):(n=t=>-.001+Math.exp(-t*e)*(t*e+1),r=t=>Math.exp(-t*e)*(-t*(e*e)));let a=5/e,o=Cd(n,r,a),s=o*bd(i,o*e),c=s*s;return{stiffness:c,damping:i*2*Math.sqrt(c),duration:/* @__PURE__ */ ul(e)}}var Ed=(e,t)=>(t?e>=0:e>0)&&e<1/0;function Dd(e,t){if(Ed(e,t))return e}function Od(e){let t=Dd(e.stiffness),n=Dd(e.damping,!0),r=Dd(e.mass),i={...e,stiffness:t??od,damping:n??sd,mass:r??cd,isResolvedFromDuration:!1,isTimeDefined:(t??n??r)===void 0&&(e.duration!==void 0||e.bounce!==void 0)};if(i.isTimeDefined){if(e.visualDuration){let t=yd(e.bounce||0),n=2*Math.PI/(e.visualDuration*1.2)*bd(t,2*Math.PI/1.2);i.stiffness=n*n,i.damping=2*t*Math.sqrt(i.stiffness)}else Object.assign(i,Td(i)),i.isResolvedFromDuration=!0;Ed(i.stiffness)&&Ed(i.damping,!0)||(i.stiffness=od,i.damping=sd)}return i}function kd(e=dd,t=ud){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},r=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:o,damping:s,mass:c,duration:l,isResolvedFromDuration:u,isTimeDefined:d}=Od({...n}),f=e=>d?0:-/* @__PURE__ */ dl(e),p=s/(2*Math.sqrt(o*c)),m=/* @__PURE__ */ dl(Math.sqrt(o/c)),h=p*m,g={target:i,delta:i-r,velocity:f(n.velocity||0)||0,restSpeed:0,restDelta:0},_=()=>{let e=Math.abs(g.delta)<5;g.restSpeed=n.restSpeed||(e?fd:pd),g.restDelta=n.restDelta||(e?md:hd)};_();let v,y,b;if(p<1){let e=xd(m,p),t={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};b=()=>{t.A=(g.velocity+h*g.delta)/e,t.sinC=h*t.A+g.delta*e,t.cosC=h*g.delta-t.A*e};let n=n=>{n!==t.t&&(t.t=n,t.env=Math.exp(-h*n),t.sin=Math.sin(e*n),t.cos=Math.cos(e*n))};v=e=>(n(e),g.target-t.env*(t.A*t.sin+g.delta*t.cos)),y=e=>(n(e),t.env*(t.sinC*t.sin+t.cosC*t.cos))}else if(p===1){v=e=>g.target-Math.exp(-m*e)*(g.delta+(g.velocity+m*g.delta)*e);let e={C:0};b=()=>{e.C=g.velocity+m*g.delta},y=t=>Math.exp(-m*t)*(m*e.C*t-g.velocity)}else{let e=m*Math.sqrt(p*p-1),t=h-e,n=h+e,r=e<1||d?1/0:300/e,i=(e,t)=>Math.exp(t>r?(h-e)*r-h*t:-e*t),a={S:0,F:0};b=()=>{let t=(g.velocity+h*g.delta)/e;a.S=(g.delta+t)/2,a.F=(g.delta-t)/2},v=e=>g.target-a.S*i(t,e)-a.F*i(n,e),y=e=>t*a.S*i(t,e)+n*a.F*i(n,e)}b();let x=u&&l||null,S={calculatedDuration:x,retarget:(e,t)=>{g.target=e[e.length-1],g.delta=g.target-e[0],g.velocity=f(t),n.restSpeed&&n.restDelta||_(),S.calculatedDuration=x,a.done=!1,b()},velocity:e=>/* @__PURE__ */ ul(y(e)),next:e=>{let t=v(e);if(u)a.done=e>=l;else{let n=/* @__PURE__ */ ul(y(e));a.done=Math.abs(n)<=g.restSpeed&&Math.abs(g.target-t)<=g.restDelta}return a.value=a.done?g.target:t,a},toString:()=>{let e=Math.min(id(S),rd),t=nd(t=>S.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return S}var Ad=/* @__PURE__ */ Object.assign(kd,{applyToOptions:e=>{let t=ad(e,100,kd);return e.ease=t.ease,e.duration=/* @__PURE__ */ ul(t.duration),e.type=`keyframes`,e}});function jd({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>e<s||e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o?o(g):g;_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>{let t=v(e);f.done=Math.abs(t)<=l,f.value=f.done?_:e?_+t:d},b,x,S=e=>{p(f.value)&&(b=e,x=Ad({keyframes:[f.value,m(f.value)],velocity:-v(e)/r*1e3,damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return S(0),{calculatedDuration:null,next:e=>{let t=!1;return!x&&b===void 0&&(t=!0,y(e),S(e)),b!==void 0&&e>=b?x.next(e-b):(!t&&y(e),f)}}}function Md(e,t,n){let r=[],i=n||tl.mix||Xu,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=sl(Array.isArray(t)?t[n]||ol:t,a)),r.push(a)}return r}function Nd(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=Md(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=/* @__PURE__ */ cl(e[r],e[r+1],n);return s[r](i)};return n?t=>l(el(e[0],e[a-1],t)):l}function Pd(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=/* @__PURE__ */ cl(0,t,r);e.push(Pu(n,1,i))}}function Fd(e){let t=[0];return Pd(t,e.length-1),t}function Id(e,t){return e.map(e=>e*t)}function Ld(e,t){return e.map(()=>t||Dl).splice(0,e.length-1)}function Rd({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=/* @__PURE__ */ Ol(r)?r.map(Nl):Nl(r)||Dl,a={done:!1,value:t[0]};if(t.length===2&&!Array.isArray(i)&&(!n||n.length!==2||n[0]===0&&n[1]===1)){let[n,r]=t,o=n===r?void 0:(tl.mix||Xu)(n,r);return{calculatedDuration:e,next:t=>(a.value=o?o(i(e>0?el(0,1,t/e):1)):r,a.done=t>=e,a)}}let o=Nd(Id(n&&n.length===t.length?n:Fd(t),e),t,{ease:Array.isArray(i)?i:Ld(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var zd=5;function Bd(e,t,n){let r=Math.max(t-zd,0);return/* @__PURE__ */ fl(n-e(r),t-r)}function Vd(e,t,n=0){return t<=0?n:e.velocity?e.velocity(t):Bd(t=>e.next(t).value,t,e.next(t).value)}var Hd=e=>e!==null;function Ud(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(Hd),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var Wd={decay:jd,inertia:jd,tween:Rd,keyframes:Rd,spring:Ad};function Gd(e){typeof e.type==`string`&&(e.type=Wd[e.type])}var Kd=40,qd=(e,t)=>t-e>Kd&&!tl.useManualTiming?t:e;function Jd(e,t){return{kind:e,animation:t,timestamp:J.now(),frameTimestamp:Pl.timestamp,frameIsProcessing:Pl.isProcessing}}function Yd(e,t,n){let r=globalThis.__MOTION_INSPECT__;if(r)try{r({...Jd(`animation-start`,e),options:n?{...t,...n}:t})}catch{}}function Xd(e,t){let n=globalThis.__MOTION_INSPECT__;if(n)try{n({...Jd(`layout-animation-start`,e),node:t})}catch{}}var Zd=class{constructor(){this.isResolved=!1}get finished(){return this._finished||=this.isResolved?Promise.resolve():new Promise(e=>{this._resolve=e}),this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){this.isResolved=!0,this._resolve?.()}then(e,t){return this.finished.then(e,t)}},Qd=e=>e/100,$d=e=>Math.round(e*1e4)/1e4,ef=class extends Zd{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==J.now()&&this.tick(J.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause(),Yd(this,this.options)}initAnimation(){let{options:e}=this;Gd(e);let{type:t=Rd,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||Rd;s!==Rd&&typeof o[0]!=`number`&&(this.mixKeyframes=sl(Qd,Xu(o[0],o[1])),o=[0,100]);let c=s(o===e.keyframes?e:{...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=id(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){this.currentTime=this.holdTime??Math.round(e-this.startTime)*this.playbackSpeed}tick(e,t=!1){let{generator:n,totalDuration:r,calculatedDuration:i}=this;if(this.startTime===null)return n.next(0);let{delay:a=0,keyframes:o,type:s,onUpdate:c,finalKeyframe:l}=this.options;this.startTime===this.pendingStartTime&&(this.startTime=qd(this.startTime,e)),this.pendingStartTime=void 0,this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let u=this.currentTime-a*(this.playbackSpeed>=0?1:-1),d=this.playbackSpeed>=0?u<0:u>r;this.currentTime=Math.max(u,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let f=this.generate(this.currentTime,d),{done:p}=f;d||(p=this.playbackSpeed>=0?i<1/0?this.currentTime>=r:p:this.currentTime<=0);let m=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&p);return m&&s!==jd&&(f.value=Ud(o,this.options,l,this.speed)),c&&c(f.value),m&&this.finish(),f}at(e){return this.holdTime??$d((e-this.startTime)*this.playbackSpeed)}sampleAt(e,t){let{options:n,totalDuration:r}=this,i=this.at(e)-(n.delay||0);return i>=r&&n.type!==jd?Ud(n.keyframes,n,t?void 0:n.finalKeyframe):this.generate(Math.max(i,0),i<0).value}generate(e,t){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o}=this,{keyframes:s,repeat:c,repeatType:l,repeatDelay:u}=this.options,d=e,f=n;if(c){let t=Math.min(e,r)/o,n=Math.floor(t),i=t%1;!i&&t>=1&&(i=1),i===1&&n--,n=Math.min(n,c+1),n%2&&(l===`reverse`?(i=1-i,u&&(i-=u/o)):l===`mirror`&&(f=a)),d=el(0,1,i)*o}let p;return t?(this.delayState.value=s[0],p=this.delayState):p=f.next(d),i&&!t&&(p.value=i(p.value)),p}get duration(){return/* @__PURE__ */ dl(this.calculatedDuration)}get iterationDuration(){return this.duration+/* @__PURE__ */ dl(this.options.delay??0)}get time(){return/* @__PURE__ */ dl(this.currentTime)}set time(e){e=/* @__PURE__ */ ul(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){return Vd(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(J.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=/* @__PURE__ */ dl(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=td,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??(this.pendingStartTime=n):this.startTime=n-this.holdTime/(this.playbackSpeed||1),this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(J.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.driver?.stop(),this.driver=void 0,this.startTime=this.holdTime=null}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}},tf=/* @__PURE__ */ new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function nf(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(ql)||[];if(!r)return e;let i=n.replace(r,``),a=+!!tf.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var rf=/\b([a-z-]*)\(.*?\)/gu,af={...Au,getAnimatableNone:e=>{let t=e.match(rf);return t?t.map(nf).join(` `):e}},of={...Au,getAnimatableNone:e=>{let t=Au.parse(e);return Au.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},sf={...Wl,transform:Math.round},cf={rotate:au,pathRotation:au,rotateX:au,rotateY:au,rotateZ:au,scale:Kl,scaleX:Kl,scaleY:Kl,scaleZ:Kl,skew:au,skewX:au,skewY:au,distance:Y,translateX:Y,translateY:Y,translateZ:Y,x:Y,y:Y,z:Y,perspective:Y,transformPerspective:Y,opacity:Gl,originX:lu,originY:lu,originZ:Y},lf={borderWidth:Y,borderTopWidth:Y,borderRightWidth:Y,borderBottomWidth:Y,borderLeftWidth:Y,borderRadius:Y,borderTopLeftRadius:Y,borderTopRightRadius:Y,borderBottomRightRadius:Y,borderBottomLeftRadius:Y,width:Y,maxWidth:Y,height:Y,maxHeight:Y,top:Y,right:Y,bottom:Y,left:Y,inset:Y,insetBlock:Y,insetBlockStart:Y,insetBlockEnd:Y,insetInline:Y,insetInlineStart:Y,insetInlineEnd:Y,padding:Y,paddingTop:Y,paddingRight:Y,paddingBottom:Y,paddingLeft:Y,paddingBlock:Y,paddingBlockStart:Y,paddingBlockEnd:Y,paddingInline:Y,paddingInlineStart:Y,paddingInlineEnd:Y,margin:Y,marginTop:Y,marginRight:Y,marginBottom:Y,marginLeft:Y,marginBlock:Y,marginBlockStart:Y,marginBlockEnd:Y,marginInline:Y,marginInlineStart:Y,marginInlineEnd:Y,fontSize:Y,backgroundPositionX:Y,backgroundPositionY:Y,...cf,zIndex:sf,fillOpacity:Gl,strokeOpacity:Gl,numOctaves:sf},uf={...lf,color:du,backgroundColor:du,outlineColor:du,fill:du,stroke:du,borderColor:du,borderTopColor:du,borderRightColor:du,borderBottomColor:du,borderLeftColor:du,filter:af,WebkitFilter:af,mask:of,WebkitMask:of},df=e=>uf[e],ff=/*@__PURE__*/ new Set([af,of]);function pf(e,t){let n=df(e);return ff.has(n)||(n=Au),n.getAnimatableNone?n.getAnimatableNone(t):void 0}function mf(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var hf=e=>e*180/Math.PI,gf=e=>vf(hf(Math.atan2(e[1],e[0]))),_f={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scaleZ:()=>1,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:gf,rotateZ:gf,skewX:e=>hf(Math.atan(e[1])),skewY:e=>hf(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},vf=e=>(e%=360,e<0&&(e+=360),e),yf=gf,bf=e=>Math.hypot(e[0],e[1]),xf=e=>Math.hypot(e[4],e[5]),Sf={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:bf,scaleY:xf,scaleZ:e=>Math.hypot(e[8],e[9],e[10]),scale:e=>(bf(e)+xf(e))/2,rotateX:e=>vf(hf(Math.atan2(e[6],e[5]))),rotateY:e=>vf(hf(Math.atan2(-e[2],e[0]))),rotateZ:yf,rotate:yf,skewX:e=>hf(Math.atan(e[4])),skewY:e=>hf(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Cf(e){return+!!e.includes(`scale`)}function wf(e,t){if(!e||e===`none`)return Cf(t);let n=e.match(/^matrix(3d)?\(([-\d.e\s,]+)\)$/u);if(!n)return Cf(t);let r=(n[1]?Sf:_f)[t],i=n[2].split(`,`).map(e=>parseFloat(e));return typeof r==`function`?r(i):i[r]}var Tf=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return wf(n,t)},Ef=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`scaleZ`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],Df=/* @__PURE__ */ new Set([...Ef,`pathRotation`]),Of=e=>e===Wl||e===Y,kf=/* @__PURE__ */ new Set([`x`,`y`,`z`]),Af=/* @__PURE__ */ Ef.filter(e=>!kf.has(e));function jf(e){let t=[];return Af.forEach(n=>{let r=e.getValue(n);if(r!==void 0){let e=r.get(),i=+!!n.startsWith(`scale`);if(e===i)return;t.push([n,e]),r.set(i)}}),t}var Mf=/* @__PURE__ */ new Set([`bottom`,`right`]);function Nf(e,t,n,r,i,a){let o=parseFloat(e);if(!isNaN(o))return o;let{min:s,max:c}=t()[n],l=c-s;return a===`border-box`?l:l-parseFloat(r)-parseFloat(i)}var Pf=({transform:e})=>wf(e,`x`),Ff=({transform:e})=>wf(e,`y`),If={width:({width:e,paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r},i)=>Nf(e,i,`x`,t,n,r),height:({height:e,paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r},i)=>Nf(e,i,`y`,t,n,r),top:({top:e})=>parseFloat(e),left:({left:e})=>parseFloat(e),bottom:({top:e},t)=>{let{y:n}=t();return parseFloat(e)+(n.max-n.min)},right:({left:e},t)=>{let{x:n}=t();return parseFloat(e)+(n.max-n.min)},x:Pf,y:Ff,translateX:Pf,translateY:Ff},Lf=/* @__PURE__ */ new Set,Rf=!1,zf=!1,Bf=!1;function $(){if(zf){let e=[],t=/* @__PURE__ */ new Set,n=/* @__PURE__ */ new Set;Lf.forEach(r=>{r.needsMeasurement&&(e.push(r),t.add(r.element),Mf.has(r.name)&&n.add(r.element))});let r=/* @__PURE__ */ new Map;n.forEach(e=>{let t=jf(e);t.length&&(r.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=r.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}zf=!1,Rf=!1,Lf.forEach(e=>e.complete(Bf)),Lf.clear()}function Vf(){Lf.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(zf=!0)})}function Hf(){Bf=!0,Vf(),$(),Bf=!1}function Uf(e,t,n){if(typeof e==`string`){if(nl(e)||il(e))return parseFloat(e);if(!Au.test(e)&&Au.test(n))return pf(t,n)}return e??void 0}var Wf=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(Lf.add(this),Rf||(Rf=!0,Q.read(Vf),Q.resolveKeyframes($))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=Uf(n.readValue(t,a),t,a);r!==void 0&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}mf(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Lf.delete(this)}cancel(){this.state===`scheduled`&&(Lf.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},Gf=e=>e.startsWith(`--`);function Kf(e,t,n){Gf(t)?e.style.setProperty(t,n):e.style[t]=n}var qf={};function Jf(e,t){let n=/* @__PURE__ */ al(e);return()=>qf[t]??n()}var Yf=/* @__PURE__ */ Jf(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),Xf=/*@__PURE__*/ Jf(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),Zf=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Qf={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:/*@__PURE__*/ Zf([0,.65,.55,1]),circOut:/*@__PURE__*/ Zf([.55,0,1,.45]),backIn:/*@__PURE__*/ Zf([.31,.01,.66,-.59]),backOut:/*@__PURE__*/ Zf([.33,1.53,.69,.99])};function $f(e,t){if(e)return typeof e==`function`?Xf()?nd(e,t):`ease-out`:/* @__PURE__ */ Al(e)?Zf(e):Array.isArray(e)?e.map(e=>$f(e,t)||Qf.easeOut):Qf[e]}function ep(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=$f(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function tp(e){return typeof e==`function`&&`applyToOptions`in e}function np({type:e,...t}){return tp(e)&&Xf()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var rp=class extends Zd{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e;let c=np(e);this.animation=ep(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=Ud(r,this.options,o,this.speed);this.updateMotionValue?.(e),Kf(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()},Yd(this,e,c)}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){this.isStopped||(this.isStopped=!0,this.state!==`idle`&&this.finishedTime===null&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||(this.animation.onfinish=null,this.cancel())))}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return/* @__PURE__ */ dl(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+/* @__PURE__ */ dl(e)}get time(){return/* @__PURE__ */ dl(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=/* @__PURE__ */ ul(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,onAttach:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&Yf()?(this.animation.timeline=e,t?.(this.animation),ol):n(this)}},ip={anticipate:xl,backInOut:bl,circInOut:wl};function ap(e){return e in ip}function op(e){typeof e.ease==`string`&&ap(e.ease)&&(e.ease=ip[e.ease])}var sp=class extends rp{constructor(e){op(e),Gd(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}elapsed(){return this.state===`running`?(J.now()-this.startTime)*this.speed:this.time*1e3}sample(e){if(!this.sampler){let{motionValue:e,onUpdate:t,onComplete:n,onPlay:r,onStop:i,element:a,...o}=this.options;this.sampler=new ef({...o,autoplay:!1}),this.sampler.stop()}return this.sampler.sample(Math.max(0,e)).value}liveValue(){let{state:e}=this;if(e===`running`||e===`paused`)return this.sample(this.elapsed())}updateMotionValue(e){let{motionValue:t,element:n,name:r}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let{speed:i}=this,a=this.elapsed(),o=this.state===`running`&&i?el(0,10,a):0,s=this.sample(a);n&&r&&Kf(n,r,s),t.setWithVelocity(this.sample(a-o*Math.sign(i)),s,o/Math.abs(i||1))}},cp=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(Au.test(e)||e===`0`)&&!e.startsWith(`url(`));function lp(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function up(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=cp(i,t),s=cp(a,t);return!o||!s?!1:lp(e)||(n===`spring`||tp(n))&&r}function dp(e){e.duration=0,e.type=`keyframes`}var fp=/* @__PURE__ */ new Set([`opacity`,`clipPath`,`filter`,`transform`]),pp=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function mp(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&pp.test(e[t]))return!0;return!1}var hp=/* @__PURE__ */ new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),gp=()=>!tl.useManualTiming&&Object.hasOwnProperty.call(Element.prototype,`animate`);function _p(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!n||!(fp.has(n)||hp.has(n)))return!1;let c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return gp()&&(fp.has(n)||hp.has(n)&&mp(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var vp=(e,t)=>t&&typeof e==`number`?t.transform(e):e,yp={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},bp=Ef.length,xp={},Sp=(e,t,n=vp(t,cf[e]))=>(xp[e]||(xp[e]=(yp[e]||e)+`(`))+n+`)`,Cp=(e,t)=>(typeof t==`number`?t:parseFloat(t))===+!!e.startsWith(`scale`);function wp(e,t,n){let r=``;for(let i=0;i<bp;i++){let a=Ef[i],o=e[a];if(o===void 0)continue;let s=n&&(t[a]=vp(o,lf[a]));Cp(a,o)||(r+=Sp(a,o,s||void 0)+` `)}let i=e.pathRotation;return i&&(r+=Sp(`rotate`,i)),r=r.trim(),n?n(t,r):r||`none`}var Tp=/* @__PURE__ */ new WeakMap,Ep=200,Dp=.001,Op=.1,kp=.001,Ap=100,jp=e=>/^(linear|ease(In|Out|InOut))$/.test(e),Mp=(e,t)=>e-t,Np=(e,t,n)=>{let r=[];for(let i=0;i<=n;i++)r.push(Pu(e,t,i/n));return r},Pp=e=>e.motionValue.owner,Fp=e=>Tp.get(e),Ip=(e,t)=>e.latestValues?e.latestValues[t]:e.getValue(t)?.get(),Lp=({name:e,motionValue:t})=>e&&Ef.includes(e)&&t?.owner?.current instanceof HTMLElement&&gp()&&Xf();function Rp(e){let t=Pp(e),{onUpdate:n,transformTemplate:r}=t.getProps();return!e.isHandoff&&!n&&!e.hasOnUpdate&&!r&&e.type!==`inertia`&&(Ip(t,`transform`)||`none`)===`none`&&!Ip(t,`pathRotation`)&&!t.projection?.isProjecting()}var zp=class extends ef{constructor(e){let t=Pp(e).current,{driver:n=td}=e,r,i=Rp(e);e.driver=e=>{let i=n(e);return{js:i,now:i.now,start:(e=!0)=>{let n=Fp(t);!n||n.isJS?i.start(e):n.schedule(!1,!e)},stop:()=>{i.stop();let e=Fp(t);e&&!e.isFinishing&&e.release(r)}}},super(e),r=this,this.canAccelerate=i;let{stop:a}=this;this.stop=()=>{this.isAccelerated()&&this.sync(),a()}}get group(){return Fp(Pp(this.options).current)}get js(){return this.driver?.js}get name(){return this.options.name}timing(){let{startTime:e,speed:t,totalDuration:n}=this,{delay:r=0,repeatType:i}=this.options;return this.holdTime===null?n===1/0?[e+r/t,this.resolvedDuration*(i===`loop`?1:2)/t||1]:[e+(r+n)/t,0]:[1/0,0]}isAccelerated(){let{group:e,state:t}=this;return e?.tracks.has(this)&&!e.isJS&&this.canAccelerate&&(t===`running`||t===`paused`)}liveValue(){return this.isAccelerated()?this.sampleAt(J.now()):void 0}tween(){let{keyframes:e,type:t,ease:n,times:r,repeat:i,delay:a=0}=this.options,o=/* @__PURE__ */ Al(n)?Zf(n):jp(n)&&Qf[n];if(o&&!i&&!r&&e.length===2&&t===Rd&&this.holdTime===null){let e=this.startTime+a/this.speed;return[e,e+this.resolvedDuration/this.speed,o]}}boundaries(e,t){let{startTime:n,speed:r,resolvedDuration:i,options:a}=this,{delay:o=0,repeat:s=0,repeatDelay:c=0,repeatType:l,times:u,keyframes:d,type:f}=a,p=(f||Rd)===Rd?u||Fd(d):[0,1],m=n+o/r,h=[];if(this.holdTime!==null||!(i>0))return h;for(let n=Math.max(0,Math.floor((e-m)*r/i));n<=s;n++){let a=m+n*i/r;if(a>t)break;for(let o of p){let s=a+(n%2&&l&&l!==`loop`?1-o:o)*(i-c)/r;s>e&&s<t&&h.push(s)}}return h}numberAt(e){return parseFloat(this.sampleAt(e,!0))}sync(){let e=J.now();this.options.motionValue.setWithVelocity(this.sampleAt(e-10,!0),this.sampleAt(e,!0),10)}play(){this.isStopped||((this.group||Bp(Pp(this.options))).tracks.add(this),super.play())}pause(){super.pause(),this.isAccelerated()&&(this.sync(),this.group.schedule(!1))}complete(){super.complete();let{group:e}=this;e&&!e.isJS&&this.canAccelerate&&this.tick(J.now())}get time(){return this.isAccelerated()?/* @__PURE__ */ dl(el(0,this.totalDuration,this.at(J.now())-(this.options.delay||0))):super.time}set time(e){super.time=e,this.isAccelerated()&&this.sync()}attachTimeline(e){return this.canAccelerate=!1,this.group?.demote(!0),super.attachTimeline(e)}};function Bp(e){let t=e.current,n=/* @__PURE__ */ new Set,r=/* @__PURE__ */ new Map,i={},a=[],o=/* @__PURE__ */ new Map,s=[],c=!1,l=!1,u=!1,d=!1,f=-1/0,p=e=>{for(let t of n)if(t.name===e)return!0},m=(t,n)=>{let o={};for(let s of t===void 0?Ef:a){let a=r.get(s),c=t===void 0?Ip(e,s):a?a.sampleAt(n>t&&!a.timing()[1]?n:t):i[s];c!==void 0&&(o[s]=c)}return o},h=(e,t)=>{let n=``;for(let r in e){let i=e[r];t&&Cp(r,i)||(n+=Sp(r,i)+` `)}return(t?n.trim():n)||`none`},g=(e,t)=>h(m(e,t)),_=(e=m())=>{t.style.transform=h(e,!0)},v=(e=!0)=>{e&&_(),s.forEach(({animation:e})=>e.cancel()),s=[]},y=(e,n)=>new Animation(new KeyframeEffect(t,e,n)),b=(e,t,n=1/0)=>{let r={animation:e,offset:t,end:n};e.startTime=J.now()+t,n<1/0&&(e.onfinish=()=>{r.isDone=!0,s.some(e=>e.end===1/0)&&(e.cancel(),s=s.filter(e=>e!==r)),A.schedule(!1)}),e.oncancel=()=>s.includes(r)&&A.demote(),s.push(r)},x=(e,t,n)=>{let r=(t,n)=>Math.abs(e(n)-e(t)),i=r(t,n);for(;n-t>.01;){let e=(t+n)/2;r(t,e)>r(e,n)?n=e:t=e}return r(t,n)>i/2?[t,n]:[]},S=(e,t,n,r)=>{let i=Math.min(Ep,Math.max(2,Math.ceil((n-t)/10)));if(r.length*4>i)return;let a=Np(t,n,i).concat(r).sort(Mp),o=e=>/* @__PURE__ */ cl(t,n,e),s,c;for(let t of e){let e=a.map(e=>t.numberAt(e)),[n]=e,r=e.map(e=>e-n),i=r[r.length-1],o=r.some(e=>Math.abs(e)*Dp>Math.abs(i))?0:i,l=r.map(e=>o?e/o:e);if(!o){if(l.some(e=>!(Math.abs(e)<=Dp)))return}else if(!s)s=l,c=e=>(t.numberAt(e)-n)/o;else if(l.some((e,t)=>!(Math.abs(e-s[t])<=Dp)))return}if(!s||s.every((e,t)=>Math.abs(e-o(a[t]))<=Dp))return`linear`;let l=[],u=(e,t=c(e))=>l.push($d(t)+` `+$d(o(e)*100)+`%`);return s.forEach((e,t)=>{t&&Math.abs(e-s[t-1])>.2&&x(c,a[t-1],a[t]).forEach(e=>u(e)),u(a[t],e)}),`linear(`+l+`)`},C=(e,t,n,r)=>{let i=[t],a=(t,n)=>e.every(e=>!(Math.abs(e.numberAt((t+n)/2)-(e.numberAt(t)+e.numberAt(n))/2)>(e.name.startsWith(`scale`)?kp:Op))),o=(t,n,r)=>{if(n-t<1||a(t,n))i.push(n);else if(r<4)o(t,(t+n)/2,r+1),o((t+n)/2,n,r+1);else{for(let r of e)i.push(...x(e=>r.numberAt(e),t,n));i.push(n)}},s=Np(t,n,Math.ceil((n-t)/100));for(let e of r)s.push(e,Math.min(e+.01,n));let c=t;for(let e of s.sort(Mp))e>c&&o(c,e,0),c=e;return i.sort(Mp)},w=e=>{let t;for(let n of e){let e=n.tween();if(!e||t?.some((t,n)=>n<2?Math.abs(e[n]-t)>1:e[n]!==t))return;t=e}return t},T=(e,t,n,r={fill:`both`},i,a)=>{let o=e.flatMap(e=>e.boundaries(t,n)),s=a||S(e,t,n,o),c=s?[t,n]:C(e,t,n,o),l=c.map(e=>g(e,i)),u={transform:l};return s||(u.offset=c.map(e=>/* @__PURE__ */ cl(t,n,e))),l.every(e=>e===l[0])&&(_(m(t,i)),u=null),y(u,{...r,duration:n-t,easing:s||`linear`})},E=t=>{let c=t,l=0,u=0,d=[],f=[],p=/* @__PURE__ */ new Set;r.clear(),o=/* @__PURE__ */ new Map;for(let e of n){r.set(e.name,e);let[n,i]=e.timing(),a=n===1/0;if(o.set(e,[e.at(t),e.speed,a]),a)e.sync();else{if(e.speed<0)return;if(i){if(l){let e=(n-u)/i;if(Math.abs(i-l)>1||Math.abs(e-Math.round(e))*l>1)return}else l=i,u=n;f.push(e)}else p.add(n);d.push(e),c=Math.max(c,n)}}i={},a=Ef.filter(t=>{if(r.has(t))return!0;let n=i[t]=Ip(e,t);return n!==void 0&&parseFloat(n)!==+!!t.startsWith(`scale`)}),v(!1);let m=!l&&w(d);try{if(m&&m[1]>t){let[e,n,r]=m;b(T(d,e,n,void 0,void 0,r),e-t,n-e)}else c>t&&(b(T(d,t,c),0,c-t),p.forEach(e=>e<c-1&&b(y(null,{duration:e-t}),0,e-t)));if(l){let e=u+Math.floor((c-u)/l)*l;b(T(f,e,e+l,{iterations:1/0,iterationStart:(c-e)/l,fill:`forwards`},c),c-t)}}catch{return}return s.length||v(),!0},D=e=>{let t,r=0;for(let i of n){let n=o.get(i);if(!n)return!1;let[a,s,c]=n,l=i.at(e),u=i.timing()[0]===1/0;if(c){if(u&&l===a)continue;return!1}let d=(l-a)/s,f=u?0:i.speed/s;if(t===void 0)t=d,r=f;else if(Math.abs(d-t)>1||f!==r)return!1}if(t===void 0)return!0;if(!s.length)return!1;for(let{offset:e,end:n,isDone:r}of s){let i=t-e;if(n<1/0&&(r?i<n-1:i<0||i>=n))return!1}for(let{animation:n,offset:i,isDone:a}of s){if(a)continue;let o=t-i;r&&n.updatePlaybackRate&&n.playState===`running`&&Math.abs(Number(n.currentTime)-o)<20?n.playbackRate!==r&&n.updatePlaybackRate(r):r?(n.playbackRate=r,n.startTime=e-o/r):(n.startTime=null,n.currentTime=o)}return!0},O=()=>!n.size&&(u=!0,Fp(t)===A&&Tp.delete(t),A.isJS||v(),!0),k=()=>{let t=J.now();if(A.isJS||(A.isFinishing=!0,n.forEach(n=>{let[r,a]=n.timing();n.state===`running`&&n.speed>0&&!a&&r<=t+1&&(n.complete(),i[n.name]=Ip(e,n.name),o.has(n)||(c=!0))}),A.isFinishing=!1),l=!1,u||(n.forEach(({state:e},t)=>{(e===`idle`||e===`finished`)&&n.delete(t)}),O()))return;for(let e of n)if(!e.canAccelerate)return A.demote(!0);A.isJS&&(A.isJS=!1,c=!0,n.forEach(e=>e.js?.stop()));let r=c,a=d;if(c=d=!1,r||!D(t)){if(a){if(t-f<Ap)return A.demote();f=t}if(!E(t))return A.demote()}},A={tracks:n,isJS:!1,isFinishing:!1,schedule(e,t){u||(c||=e,d||=!!t,l||(l=!0,Pl.isProcessing?Q.render(k,!1,!0):queueMicrotask(k)))},release(e){let{state:t}=e;(t===`idle`||t===`finished`)&&n.delete(e),O()||A.schedule(!0)},check(){if(!A.isJS){for(let t in i)if(Ip(e,t)!==i[t]&&!p(t))return A.schedule(!0,!0)}},demote(e){if(!(A.isJS||u))return n.forEach(t=>{t.isAccelerated()&&t.sync(),e||(t.canAccelerate=!1)}),A.isJS=!0,o=/* @__PURE__ */ new Map,v(),n.forEach(e=>e.state===`running`&&e.js?.start()),!0}};return Tp.set(t,A),A}var Vp=class extends Zd{constructor(e){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=J.now();let{keyframes:t,name:n,motionValue:r,element:i}=e,a=e;a.autoplay??=!0,a.delay??=0,a.type??=`keyframes`,a.repeat??=0,a.repeatDelay??=0,a.repeatType??=`loop`;let o=i?.KeyframeResolver||Wf;this.keyframeResolver=new o(t,(e,t,n)=>this.onKeyframesResolved(e,t,a,!n),n,r,i),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=J.now();let u=up(e,i,a,o);u||((tl.instantAnimations||!s)&&l?.(Ud(e,n,t)),e[0]=e[e.length-1],dp(n),n.repeat=0);let{onComplete:d}=n;n.finalKeyframe=t,n.keyframes=e,n.onComplete=()=>{d?.(),this.notifyFinished()};let f=u&&!c&&_p(n),p=!f&&Lp(n);r&&(f||p||this.resolvedAt!==this.createdAt)&&(n.startTime??=qd(this.createdAt,this.resolvedAt));let m;if(f){n.element=n.motionValue?.owner?.current;try{m=new sp(n)}catch{m=new ef(n)}}else m=p?new zp(n):new ef(n);this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this._animation.finished:super.finished}then(e,t){return this.finished.finally(e).then(()=>{})}liveValue(){return this._animation?.liveValue?.()}get animation(){return this._animation||(this.keyframeResolver?.resume(),Hf()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation?.cancel(),this.keyframeResolver?.cancel()}},Hp=class{constructor(e){this.stop=()=>this.runAll(`stop`),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e){let t=this.animations.map(t=>t.attachTimeline(e));return()=>{t.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 state(){return this.getAll(`state`)}get startTime(){return this.getAll(`startTime`)}get duration(){return Up(this.animations,`duration`)}get iterationDuration(){return Up(this.animations,`iterationDuration`)}runAll(e){this.animations.forEach(t=>t[e]())}play(){this.runAll(`play`)}pause(){this.runAll(`pause`)}cancel(){this.runAll(`cancel`)}complete(){this.runAll(`complete`)}};function Up(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e[r][t];i!==null&&i>n&&(n=i)}return n}var Wp=class extends Hp{then(e,t){return this.finished.finally(e).then(()=>{})}};function Gp(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var Kp=30,qp=e=>!isNaN(parseFloat(e)),Jp={current:void 0},Yp=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=J.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.dirty(),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=J.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=qp(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){var n;return e===`change`?this.onChangeSubscribe(t):((n=this.events)[e]||(n[e]=new ll)).add(t)}onChangeSubscribe(e){let{events:t}=this;return!t.change&&!this.changeSubscriber?this.changeSubscriber=e:(t.change||(t.change=new ll,t.change.add(this.changeSubscriber),this.changeSubscriber=void 0),t.change.add(e)),()=>{this.changeSubscriber===e?this.changeSubscriber=void 0:t.change?.remove(e),this.stopIfUnobserved()}}stopIfUnobserved(){Q.read(()=>{!this.changeSubscriber&&!this.events.change?.getSize()&&this.stop()})}clearListeners(){this.changeSubscriber=void 0;for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect?.()}dirty(){let{current:e,changeSubscriber:t}=this;t?t(e):this.events.change?.notify(e)}addDependent(e){(this.dependents||=/* @__PURE__ */ new Set).add(e)}removeDependent(e){this.dependents?.delete(e)}get(){Jp.current?.push(this);let e=this.animation?.liveValue?.();return e===void 0?this.current:e}getCurrent(){return this.current}getPrevious(){return this.prev}getVelocity(){let e=J.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Kp)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,Kp);return/* @__PURE__ */ fl(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0;let n=!1,r;r=e(()=>{n=!0,this.events.animationComplete?.notify(),this.animation===r&&(this.animation=void 0),t()}),n||(this.animation=r),this.events.animationStart?.notify()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel?.notify()),this.animation=void 0}isAnimating(){return!!this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect?.()}};function Xp(e,t){return new Yp(e,t)}function Zp(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function Qp(e,t){let n=e?.[t]??e?.default??e;return n===e?n:Zp(n,e)}var $p={type:`spring`,stiffness:500,damping:25,restSpeed:10},em=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),tm={type:`keyframes`,duration:.8},nm={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},rm=(e,{keyframes:t})=>t.length>2?tm:Df.has(e)?e.startsWith(`scale`)?em(t[1]):$p:nm,im=/* @__PURE__ */ new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`,`out`]);function am(e){for(let t in e)if(!im.has(t))return!0;return!1}var om=(e,t,n,r={},i,a)=>o=>{let s=Qp(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=/* @__PURE__ */ ul(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i,hasOnUpdate:!!s.onUpdate};am(s)||Object.assign(u,rm(e,u)),u.duration&&=/* @__PURE__ */ ul(u.duration),u.repeatDelay&&=/* @__PURE__ */ ul(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(dp(u),u.delay===0&&(d=!0)),(tl.instantAnimations||tl.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,dp(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=Ud(u.keyframes,s);if(e!==void 0){Q.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new ef(u):new Vp(u)},sm=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function cm(e){let t=sm.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function lm(e,t,n=1){let[r,i]=cm(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return nl(e)?parseFloat(e):e}return Vl(i)?lm(i,t,n+1):i}function um(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function dm(e,t,n,r){let i=t=>typeof t==`function`?t(n===void 0?e.custom:n,...um(r)):t;return t=i(t),typeof t==`string`&&(t=e.variants&&e.variants[t]),i(t)}function fm(e,t,n){return dm(e.getProps(),t,n,e)}var pm=(e,t)=>t===`exit`?e.presenceContext?.custom:void 0,mm=/* @__PURE__ */ new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...Ef]),hm=e=>Array.isArray(e);function gm(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Xp(n))}function _m(e){return hm(e)?e[e.length-1]||0:e}function vm(e,t){let{transitionEnd:n={},transition:r={},...i}=fm(e,t)||{};i={...i,...n};for(let t in i)gm(e,t,_m(i[t]))}var ym=e=>!!(e&&e.getVelocity);function bm(e){return!!(ym(e)&&e.add)}function xm(e,t){let n=e.getValue(`willChange`);if(bm(n))return n.add(t);if(!n&&tl.WillChange){let n=new tl.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}var Sm=`data-framer-appear-id`;function Cm(e){return e.props[Sm]}var wm=typeof window<`u`;function Tm({protectedKeys:e,needsAnimating:t},n){let r=n in e&&!t[n];return t[n]=!1,r}function Em(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?Zp(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState?.getState()[i],p=a?.path;p&&(p.animateValues?p.animateValues(t=>e.getValue(t,e.latestValues[t]??0),s,a,n,d):p.animateVisualElement?.(e,s,a,n,d));for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&Tm(f,t))continue;let o={delay:n,...Qp(f?.out[t]||a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){Q.update(()=>r.set(i));continue}let p=!1;if(wm&&window.MotionHandoffAnimation){let n=Cm(e);if(n){let e=window.MotionHandoffAnimation(n,t,Q);e!==null&&(o.startTime=e,p=!0)}}xm(e,t);let m=l??e.shouldReduceMotion;r.start(om(t,r,i,m&&mm.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>Q.update(()=>{o&&vm(e,o)});d.length?Promise.all(d).then(t):t()}return d}function Dm(e,t,n={}){let r=fm(e,t,pm(e,n.type)),i=n.transitionOverride||(r?.transition??(e.getDefaultTransition()||{})),a=()=>Promise.all(r?Em(e,r,n):[]),o=(r=0)=>{let{variantChildren:a}=e,{delayChildren:o=0,staggerChildren:s,staggerDirection:c}=i,l=[];return a?.forEach(e=>{e.notify(`AnimationStart`,t),l.push(Dm(e,t,{...n,delay:r+(typeof o==`function`?0:o)+Gp(a,e,o,s,c)}).then(()=>e.notify(`AnimationComplete`,t)))}),Promise.all(l)},{when:s}=i;return s?s===`beforeChildren`?a().then(()=>o()):o().then(a):Promise.all([a(),o(n.delay)])}function Om(e,t,n={}){return e.notify(`AnimationStart`,t),(Array.isArray(t)?Promise.all(t.map(t=>Dm(e,t,n))):typeof t==`string`?Dm(e,t,n):Promise.all(Em(e,fm(e,t,n.custom),n))).then(()=>{e.notify(`AnimationComplete`,t)})}var km={test:e=>e===`auto`,parse:e=>e},Am=e=>t=>t.test(e),jm=[Wl,Y,ou,au,cu,su,km],Mm=e=>jm.find(Am(e));function Nm(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||il(e)}var Pm=/* @__PURE__ */ new Set([`auto`,`none`,`0`]);function Fm(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!Pm.has(t)&&Su(t)&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]!==i&&(e[r]=pf(n,i))}var Im=class extends Wf{constructor(){super(...arguments),this.isAsync=!0}scheduleResolve(){if(this.canReadNow()&&(this.readKeyframes(),!this.needsMeasurement))return this.complete();super.scheduleResolve()}canReadNow(){let{unresolvedKeyframes:e,element:t,motionValue:n}=this,r=e[0]??n?.get();if(!t?.current||r===void 0)return!1;for(let t=0;t<e.length;t++)if(Ul(t?e[t]:r))return!1;return!0}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t?.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),Vl(r))){let i=lm(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!mm.has(n)||e.length!==2)return;let[r,i]=e;if(typeof r==`number`&&typeof i==`number`)return;let a=Mm(r),o=Mm(i);if(Ul(r)!==Ul(i)&&If[n])this.needsMeasurement=!0;else if(a!==o){if(Of(a)&&Of(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else If[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||Nm(e[t]))&&n.push(t);n.length&&Fm(e,n,t)}measure(){let{element:e,name:t}=this;return If[t](window.getComputedStyle(e.current),()=>e.measureViewportBox())}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e?.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&this.motionValue?.jump(r,!1)}measureEndState(){let{element:e,unresolvedKeyframes:t}=this;if(!e?.current)return;this.motionValue?.jump(this.measuredOrigin,!1);let n=t.length-1,r=t[n];t[n]=this.measure(),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),this.resolveNoneKeyframes()}},Lm=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`],Rm=[];function zm(e){Bm(e),Rm.unshift(e)}function Bm(e){$c(Rm,e)}function Vm(e){return Rm.find(t=>t.test(e))}function Hm(e,t,n={},r){let i=[],{velocity:a,path:o}=n,s=n.reduceMotion??r?.shouldReduceMotion;o?.animateValues&&r&&(t={...t},o.animateValues(e,t,n,0,i));for(let o in t){if(o===`transition`||o===`transitionEnd`)continue;let c=t[o];if(c===void 0)continue;let l=e(o),u=l.get();u!==void 0&&!l.isAnimating()&&!Array.isArray(c)&&c===u&&!a?Q.update(()=>l.set(c)):(l.start(om(o,l,c,s&&mm.has(o)?{type:!1}:n,r)),l.animation&&i.push(l.animation))}let{transitionEnd:c}=t;if(c){let t=()=>Q.update(()=>{for(let t in c)e(t).set(c[t])});i.length?Promise.all(i).then(t):t()}return i}function Um(e,t,n,r,i){return Hm(r=>{let a=e.get(t,r);if(!a){let o;if(!i){let i=n[r];o=Wm(i)??e.read(t,r,i)}a=Xp(o,{owner:i}),e(t,{[r]:a})}return a},n,r,i)}function Wm(e){let t=Array.isArray(e)?e[0]:void 0;return t===null?void 0:t}function Gm(e){return rl(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}function Km(e){return rl(e)&&`ownerSVGElement`in e}var qm={};function Jm(e){return qm.current?.add(e),e}var Ym=e=>qm.current?qm.current.bind(e):e;function Xm(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=t?t.current:qm.current?.root||document,i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var Zm=class{constructor(e=Q.render){this.step=e,this.values=/* @__PURE__ */ new Map,this.pending=[],this.numPending=0,this.flush=()=>{let{pending:e,numPending:t}=this;this.numPending=0;for(let n=0;n<t;n++)e[n]()}}set(e,t,n,r){if(this.values.get(e)?.onRemove(),r)for(let e of this.values.values())e.value===r&&(n=e.render);let i=()=>n&&this.schedule(n);t.get()!==void 0&&i();let a=t.on(`change`,i),o=()=>{a(),n&&!r&&this.cancel(n),this.values.get(e)?.onRemove===o&&this.values.delete(e)};return this.values.set(e,{value:t,render:r?void 0:n,onRemove:o}),o}get(e){return this.values.get(e)?.value}release(){let e=/* @__PURE__ */ new Map;return this.values.forEach((t,n)=>{e.set(n,t.value),t.onRemove()}),this.transformKeys=this.transformValues=void 0,e}schedule(e){let{pending:t,numPending:n}=this;for(let r=0;r<n;r++)if(t[r]===e)return;n||this.step(this.flush),t[this.numPending++]=e}cancel(e){let{pending:t}=this;for(let n=0;n<this.numPending;n++)if(t[n]===e){t[n]=t[--this.numPending];return}}};function Qm(e,{step:t,...n}={}){let r=/* @__PURE__ */ new WeakMap;return Object.assign((n,i)=>{let a=r.get(n)??new Zm(t);r.set(n,a);let o=[];for(let t in i){let r=i[t],s=e(n,a,t,r);o.push(s)}return()=>{for(let e of o)e()}},n,{get:(e,t)=>r.get(e)?.get(t),flush:e=>r.get(e)?.flush(),state:e=>r.get(e)})}function $m(e){let t=``,{transformKeys:n=[],transformValues:r={}}=e;for(let e=0;e<n.length;e++){let i=n[e],a=r[i].getCurrent();a!==void 0&&(Cp(i,a)||(t+=(t&&` `)+Sp(i,a)))}let i=e.get(`pathRotation`)?.get();return i&&(t+=(t&&` `)+Sp(`rotate`,i)),t||`none`}var eh=/* @__PURE__ */ new Set([`originX`,`originY`,`originZ`]),th=(e,t)=>vp(e.get(t)?.get(),lf[t]),nh=(e,t,n,r)=>{let i,a;if(Df.has(n)){if(n!==`pathRotation`){let e=t.transformKeys??=[];(t.transformValues??={})[n]=r,e.includes(n)||(e.push(n),e.sort((e,t)=>Ef.indexOf(e)-Ef.indexOf(t)))}t.get(`transform`)||(!Gm(e)&&!t.get(`transformBox`)&&nh(e,t,`transformBox`,new Yp(`fill-box`)),t.set(`transform`,new Yp(`none`),()=>{Tp.get(e)?.check(),e.style.transform=$m(t)})),a=t.get(`transform`)}else eh.has(n)?(t.get(`transformOrigin`)||t.set(`transformOrigin`,new Yp(``),()=>{let n=th(t,`originX`)??`50%`,r=th(t,`originY`)??`50%`,i=th(t,`originZ`)??0;e.style.transformOrigin=`${n} ${r} ${i}`}),a=t.get(`transformOrigin`)):i=Gf(n)?()=>{e.style.setProperty(n,r.getCurrent())}:()=>{e.style[n]=vp(r.getCurrent(),lf[n])};return t.set(n,r,i,a)},rh=e=>Gm(e)||Km(e),ih=(e,t)=>{if(Df.has(t))return Tf(e,t);let n=getComputedStyle(e),r=Gf(t)?n.getPropertyValue(t):n[t];return typeof r==`string`&&r.trim()||0},ah=/*@__PURE__*/ Qm(nh,{test:rh,read:ih});function oh(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}function sh(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(Df.has(e))o=!0;else if(zl(e))i[e]=n;else{let t=vp(n,lf[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=wp(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}var ch={offset:`stroke-dashoffset`,array:`stroke-dasharray`},lh={offset:`strokeDashoffset`,array:`strokeDasharray`};function uh(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?ch:lh;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var dh=[`transform`,`opacity`,`clipPath`,`filter`,`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function fh(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(sh(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;for(let e of dh)d[e]!==void 0&&(f[e]=d[e],delete d[e]);(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&uh(d,i,a,o,!1)}function ph(e,t){if(!(t in e))return!1;let n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),t)||Object.getOwnPropertyDescriptor(e,t);return n&&typeof n.set==`function`}var mh=(e,t,n,r,i=n)=>{let a=ph(e,i);!a&&(i.startsWith(`data`)||i.startsWith(`aria`))&&(i=oh(i));let o=lf[n]||lf[i],s=a?()=>{e[i]=vp(r.get(),lf[n])}:()=>{let t=vp(r.get(),o);t==null?e.removeAttribute(i):e.setAttribute(i,String(t))};return t.set(n,r,s)};function hh(e,t,n,r){return Q.render(()=>e.setAttribute(`pathLength`,`1`)),n===`pathOffset`?t.set(n,r,()=>{let t=r.get();e.setAttribute(`stroke-dashoffset`,`${-t}`)}):(t.get(`stroke-dasharray`)||t.set(`stroke-dasharray`,new Yp(`1 1`),()=>{let n=t.get(`pathLength`)?.get()??1,r=t.get(`pathSpacing`)?.get();e.setAttribute(`stroke-dasharray`,`${n} ${r??1-Number(n)}`)}),t.set(n,r,void 0,t.get(`stroke-dasharray`)))}var gh=/*@__PURE__*/ Qm((e,t,n,r)=>n.startsWith(`path`)&&!Df.has(n)?hh(e,t,n,r):n.startsWith(`attr`)?mh(e,t,n,r,_h(n)):(Df.has(n)||eh.has(n)||Gf(n)||n in e.style?nh:mh)(e,t,n,r),{test:Km,read:(e,t)=>Df.has(t)?lf[t]?.default||0:Gf(t)||dh.includes(t)?ih(e,t)||e.getAttribute(oh(t))||0:(t=_h(t),e.getAttribute(oh(t))??e.getAttribute(t)??void 0)});function _h(e){return e.replace(/^attr([A-Z])/,(e,t)=>t.toLowerCase())}function vh({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function yh({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function bh(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function xh(e){return e===void 0||e===1}function Sh({scale:e,scaleX:t,scaleY:n}){return!xh(e)||!xh(t)||!xh(n)}var Ch=[`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skewX`,`skewY`];function wh(e){return Sh(e)||Eh(e)||Th(e)}function Th(e){return e.z||e.rotate||e.rotateX||e.rotateY||e.rotateZ||e.skewX||e.skewY}function Eh(e){return Dh(e.x)||Dh(e.y)}function Dh(e){return e&&e!==`0%`}function Oh(e,t,n){return n+t*(e-n)}function kh(e,t,n,r,i){return i!==void 0&&(e=Oh(e,i,r)),Oh(e,n,r)+t}function Ah(e,t=0,n=1,r,i){e.min=kh(e.min,t,n,r,i),e.max=kh(e.max,t,n,r,i)}function jh(e,{x:t,y:n}){Ah(e.x,t.translate,t.scale,t.originPoint),Ah(e.y,n.translate,n.scale,n.originPoint)}var Mh=.999999999999,Nh=1.0000000000001;function Ph(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++)a=n[s],o=a.projectionDelta,a.options.visualElement?.props.style?.display!==`contents`&&(r===!0&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(Fh(e.x,-a.scroll.offset.x),Fh(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,jh(e,o)),r&&(r.path?.[s]||r)!==a&&wh(a.latestValues)&&Rh(e,a.latestValues,a.layout?.layoutBox));t.x<Nh&&t.x>Mh&&(t.x=1),t.y<Nh&&t.y>Mh&&(t.y=1)}function Fh(e,t){e.min+=t,e.max+=t}function Ih(e,t,n,r,i=.5){Ah(e,t,n,Pu(e.min,e.max,i),r)}function Lh(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function Rh(e,t,n){let r=n??e;Ih(e.x,Lh(t.x,r.x),t.scaleX,t.scale,t.originX),Ih(e.y,Lh(t.y,r.y),t.scaleY,t.scale,t.originY)}function zh(e,t){return vh(bh(e.getBoundingClientRect(),t))}function Bh(e,t,n){let r=zh(e,n),{scroll:i}=t;return i&&(Fh(r.x,i.offset.x),Fh(r.y,i.offset.y)),r}var Vh={},Hh=e=>Km(e)?gh:ah,Uh=class{constructor(e,t){this.effect=e,this.current=t,this.KeyframeResolver=Im}getValue(e){return this.effect.get(this.current,e)}readValue(e,t){return this.effect.read(this.current,e,t)}render(){this.effect.flush(this.current)}measureViewportBox(){return zh(this.current)}getProps(){return Vh}};function Wh(e,t,n,r){if(qm.current?.track(e),r)return Hm(e=>r.getValue(e,null),t,n,r);let i=Hh(e);return Um(i,e,t,n,new Uh(i,e))}var Gh=/*@__PURE__*/ Qm((e,t,n,r)=>t.set(n,r,()=>{e[n]=r.get()}),{test:e=>rl(e),read:(e,t)=>{let n=e[t];return typeof n==`string`||typeof n==`number`?n:void 0}}),{schedule:Kh,cancel:qh}=/* @__PURE__ */ Qu(queueMicrotask,!1);function Jh(e,t,n){let r=ym(e)?e:Xp(e);return r.start(om(``,r,t,n)),r.animation}var Yh={},Xh={value:null,addProjectionMetrics:null};function Zh(e,t){let n=J.now();e=Ym(e);let r=({timestamp:i})=>{let a=i-n;a>=t&&($u(r),e(a-t))};return Q.setup(r,!0),Jm(()=>$u(r))}function Qh(e){return Km(e)&&e.tagName===`svg`}function $h(e){return ym(e)?e.get():e}var eg=e=>typeof e==`number`?e:parseFloat(e),tg=Lm.length,ng=e=>typeof e==`number`||Y.test(e);function rg(e,t,n,r,i,a){i?(e.opacity=Pu(0,n.opacity??1,ag(r)),e.opacityExit=Pu(t.opacity??1,0,og(r))):a&&(e.opacity=Pu(t.opacity??1,n.opacity??1,r));for(let i=0;i<tg;i++){let a=Lm[i],o=ig(t,a),s=ig(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||ng(o)===ng(s)?(e[a]=Math.max(Pu(eg(o),eg(s),r),0),(ou.test(s)||ou.test(o))&&(e[a]+=`%`)):e[a]=s)}for(let i=0;i<Ch.length;i++){let a=Ch[i];(t[a]||n[a])&&(e[a]=Pu(t[a]||0,n[a]||0,r))}}function ig(e,t){return e[t]===void 0?e.borderRadius:e[t]}var ag=/*@__PURE__*/ sg(0,.5,Cl),og=/*@__PURE__*/ sg(.5,.95,ol);function sg(e,t,n){return r=>r<e?0:r>t?1:n(/* @__PURE__ */ cl(e,t,r))}function cg(e,t){e.min=t.min,e.max=t.max}function lg(e,t){cg(e.x,t.x),cg(e.y,t.y)}function ug(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var dg=.9999,fg=1.0001,pg=-.01,mg=.01;function hg(e){return e.max-e.min}function gg(e,t,n){return Math.abs(e-t)<=n}function _g(e,t,n,r=.5){e.origin=r,e.originPoint=Pu(t.min,t.max,e.origin),e.scale=hg(n)/hg(t),e.translate=Pu(n.min,n.max,e.origin)-e.originPoint,(e.scale>=dg&&e.scale<=fg||isNaN(e.scale))&&(e.scale=1),(e.translate>=pg&&e.translate<=mg||isNaN(e.translate))&&(e.translate=0)}function vg(e,t,n,r){_g(e.x,t.x,n.x,r?.originX),_g(e.y,t.y,n.y,r?.originY)}function yg(e,t,n,r=0){e.min=(r?Pu(n.min,n.max,r):n.min)+t.min,e.max=e.min+hg(t)}function bg(e,t,n,r){yg(e.x,t.x,n.x,r?.x),yg(e.y,t.y,n.y,r?.y)}function xg(e,t,n,r=0){let i=r?Pu(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+hg(t)}function Sg(e,t,n,r){xg(e.x,t.x,n.x,r?.x),xg(e.y,t.y,n.y,r?.y)}function Cg(e,t,n,r,i){return e-=t,e=Oh(e,1/n,r),i!==void 0&&(e=Oh(e,1/i,r)),e}function wg(e,t=0,n=1,r=.5,i,a=e,o=e){if(ou.test(t)&&(t=parseFloat(t),t=Pu(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=Pu(a.min,a.max,r);e===a&&(s-=t),e.min=Cg(e.min,t,n,s,i),e.max=Cg(e.max,t,n,s,i)}function Tg(e,t,[n,r,i],a,o){wg(e,t[n],t[r],t[i],t.scale,a,o)}var Eg=[`x`,`scaleX`,`originX`],Dg=[`y`,`scaleY`,`originY`];function Og(e,t,n,r){Tg(e.x,t,Eg,n?.x,r?.x),Tg(e.y,t,Dg,n?.y,r?.y)}var kg=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ag=()=>({x:kg(),y:kg()}),jg=()=>({min:0,max:0}),Mg=()=>({x:jg(),y:jg()});function Ng(e){return e.translate===0&&e.scale===1}function Pg(e){return Ng(e.x)&&Ng(e.y)}function Fg(e,t){return e.min===t.min&&e.max===t.max}function Ig(e,t){return Fg(e.x,t.x)&&Fg(e.y,t.y)}function Lg(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Rg(e,t){return Lg(e.x,t.x)&&Lg(e.y,t.y)}function zg(e){return hg(e.x)/hg(e.y)}function Bg(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var Vg=class{constructor(){this.members=[]}add(e){Qc(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;r&&r.isConnected!==!1||n.snapshot||($c(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if($c(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}};function Hg(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var Ug={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(Y.test(e))e=parseFloat(e);else return e}return`${Hg(e,t.target.x)}% ${Hg(e,t.target.y)}%`}},Wg={borderRadius:/* @__PURE__ */ Object.assign({},Ug,{applyTo:/* @__PURE__ */ Lm.slice()}),borderTopLeftRadius:Ug,borderTopRightRadius:Ug,borderBottomLeftRadius:Ug,borderBottomRightRadius:Ug,boxShadow:{correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=Au.parse(e);if(i.length>5)return r;let a=Au.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=Pu(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}}};function Gg(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e}=n;e&&(r=`perspective(${e}px) ${r}`);for(let e=0;e<Ch.length;e++){let t=Ch[e],i=n[t];i&&(r+=`${t}(${i}deg) `),!e&&n.pathRotation&&(r+=`rotate(${n.pathRotation}deg) `)}}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}function Kg(e){return[e(`x`),e(`y`)]}var qg=(e,t)=>e.depth-t.depth,Jg=class{constructor(){this.children=[],this.isDirty=!1}add(e){Qc(this.children,e),this.isDirty=!0}remove(e){$c(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(qg),this.isDirty=!1,this.children.forEach(e)}},Yg={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Xg={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},Zg=[`z`,`skew`,`skewZ`],Qg=1e3,$g=0;function e_(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}var t_=e=>e.instance&&Tp.get(e.instance)?.demote()&&e.resetSkewAndRotation();function n_(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=Cm(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,Q,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&n_(r)}function r_({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return Object.assign(Yh,{...Wg,...Yh}),class{constructor(e={},n=t?.()){this.id=$g++,this.animationId=0,this.animationCommitId=0,this.children=/* @__PURE__ */ 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=/* @__PURE__ */ 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,Xh.value&&(Xg.nodes=Xg.calculatedTargetDeltas=Xg.calculatedProjections=0),this.nodes.forEach(o_),this.nodes.forEach(__),this.nodes.forEach(v_),this.nodes.forEach(s_),Xh.addProjectionMetrics&&Xh.addProjectionMetrics(Xg)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=/* @__PURE__ */ new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new Jg)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new ll),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){this.eventHandlers.get(e)?.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=Km(t)&&!Qh(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent?.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;Q.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n?.(),n=Zh(i,250),Yg.hasAnimatedSinceResize&&(Yg.hasAnimatedSinceResize=!1,this.nodes.forEach(g_)))})}n&&this.root.registerSharedNode(n,this),this.addLayoutListener()}addLayoutListener(){let{layoutId:e,layout:t,visualElement:n,animate:r}=this.options;this.instance&&!this.hasLayoutListener&&r!==!1&&n&&(e||t)&&(this.hasLayoutListener=!0,this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:r,layout:i})=>{if(this.isAnimationBlocked){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||n.getDefaultTransition()||w_,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=n.getProps(),c=!this.targetLayout||!Rg(this.targetLayout,i),l=!t&&r;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...Qp(a,`layout`),onPlay:o,onComplete:s};(n.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||g_(this),this.isLead()&&this.options.onExitComplete?.();this.targetLayout=i}))}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),this.getStack()?.remove(this),this.parent?.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),this.hasLayoutListener=!1,$u(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes?.forEach(y_),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete?.();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&n_(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;t_(this),this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,t_(t),(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1),t.isAnimationBlocked&&(t.dragSnapshot||=t.measure(),this.dragAncestor=t)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(u_),this.nodes.forEach(l_);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(d_);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(p_),this.nodes.forEach(m_),this.nodes.forEach(h_),this.nodes.forEach(i_),this.nodes.forEach(a_)):this.nodes.forEach(d_),this.clearAllSnapshots();let e=J.now();Pl.delta=el(0,1e3/60,e-Pl.timestamp),Pl.timestamp=e,Pl.isProcessing=!0,ed.update.process(Pl),ed.preRender.process(Pl),ed.render.process(Pl),Pl.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Kh.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(c_),this.sharedNodes.forEach((e,t)=>e.members.length?e.removeLeadSnapshot():this.sharedNodes.delete(t))}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Q.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Q.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),this.snapshot&&!hg(this.snapshot.measuredBox.x)&&!hg(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}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();let e=this.layout;this.layout=this.measure(!1),this.layoutCorrected||=Mg(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t?.notify(`LayoutMeasure`,this.layout.layoutBox,e?.layoutBox)}updateScroll(e=`measure`){let{scroll:t,instance:i}=this,{animationId:a}=this.root;if(this.options.layoutScroll&&i&&!(t&&t.animationId===a&&t.phase===e)){let o=r(i);this.scroll={animationId:a,phase:e,isRoot:o,offset:n(i),wasRoot:t?t.isRoot:o}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout;e&&t_(this);let t=this.projectionDelta&&!Pg(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||wh(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),O_(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return Mg();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(j_))){let{scroll:e}=this.root;e&&(Fh(t.x,e.offset.x),Fh(t.y,e.offset.y))}return t}removeElementScroll(e){let t=Mg();if(lg(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&lg(t,e),Fh(t.x,i.offset.x),Fh(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n,r,i=0){let a=n||Mg();lg(a,e);for(let e=i;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(Fh(a.x,-n.scroll.offset.x),Fh(a.y,-n.scroll.offset.y)),wh(n.latestValues)&&Rh(a,n.latestValues,n.layout?.layoutBox)}return!r&&wh(this.latestValues)&&Rh(a,this.latestValues,this.layout?.layoutBox),a}removeTransform(e){let t=Mg();lg(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!wh(n.latestValues))continue;let r;n.instance&&(Sh(n.latestValues)&&n.updateSnapshot(),r=Mg(),lg(r,n.measurePageBox())),Og(t,n.latestValues,n.snapshot?.layoutBox,r)}return wh(this.latestValues)&&Og(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade},this.addLayoutListener()}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!==Pl.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=Pl.timestamp;let a=this.getClosestProjectingParent();!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),(this.relativeTarget||this.targetDelta)&&(this.target||(this.target=Mg(),this.targetWithTransforms=Mg()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),bg(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target,!0):lg(this.target,this.layout.layoutBox),jh(this.target,this.targetDelta)):lg(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&(!a.resumingFrom==!this.resumingFrom||a.options.layoutRoot&&!a.resumingFrom)&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),Xh.value&&Xg.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||Sh(this.parent.latestValues)||Eh(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Mg(),this.relativeTargetOrigin=Mg(),Sg(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),lg(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===Pl.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent?.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;lg(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;Ph(this.layoutCorrected,this.treeScale,this.path,t&&(e.relativeTarget&&!e.relativeParent.resumingFrom?e.relativeParent:!0)),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=Mg());let{target:s}=e;s?(!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(ug(this.prevProjectionDelta.x,this.projectionDelta.x),ug(this.prevProjectionDelta.y,this.projectionDelta.y)),vg(this.projectionDelta,this.layoutCorrected,s,this.latestValues),this.treeScale.x===a&&this.treeScale.y===o&&Bg(this.projectionDelta.x,this.prevProjectionDelta.x)&&Bg(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),Xh.value&&Xg.calculatedProjections++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){this.options.visualElement?.scheduleRender(),e&&this.getStack()?.scheduleRender(),this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ag(),this.projectionDelta=Ag(),this.projectionDeltaWithTransform=Ag()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=Ag();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=Mg(),c=r?.source!==this.layout?.source,l=this.getStack(),u=!l||l.members.length<=1,d=!(!c||u||this.options.crossfade!==!0||this.path.some(C_));this.animationProgress=0;let f,p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n);b_(o.x,e.x,n),b_(o.y,e.y,n),r&&(o.x.translate=r.x,o.y.translate=r.y),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Sg(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),S_(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&Ig(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=Mg(),lg(f,this.relativeTarget)),c&&(this.animationValues=a,rg(a,i,this.latestValues,n,d,u)),r?.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=($u(this.pendingAnimation),void 0),this.pendingAnimation=Q.update(()=>{Yg.hasAnimatedSinceResize=!0,this.motionValue||=Xp(0),this.motionValue.jump(0,!1),this.currentAnimation=Jh(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),Xd(this.currentAnimation,this),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta?.(Qg),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,layout:n,latestValues:r}=e,{target:i}=e;if(t&&i&&n){if(this!==e&&this.layout&&n&&A_(this.options.animationType,this.layout.layoutBox,n.layoutBox)){let{layoutBox:e}=this.layout,t=i;i=this.target||Mg(),k_(i.x,t.x,e.x),k_(i.y,t.y,e.y)}lg(t,i),Rh(t,r),vg(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Vg),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?.transition,preserveFollowOpacity:n?.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){this.getStack()?.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){return this.getStack()?.relegate(this)||!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let{latestValues:t}=e;if(!Th(t))return;let n={};for(let t=0;t<Zg.length;t++)e_(Zg[t],e,n,this.animationValues);for(let t=0;t<Ch.length;t++)e_(Ch[t],e,n,this.animationValues);e.render();for(let t in n)e.setStaticValue(t,n[t]),this.animationValues&&(this.animationValues[t]=n[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;let n=this.getLead();if(!this.isVisible&&n!==this){e.visibility=`hidden`;return}let r=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=$h(t?.pointerEvents)||``,e.transform=r?r(this.latestValues,``):`none`;return}if(!this.projectionDelta||!this.layout||!n.target){(this.options.layoutId||this.needsShow)&&(this.needsShow=!1,e.visibility=``,e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=$h(t?.pointerEvents)||``),this.hasProjected&&!wh(this.latestValues)&&(e.transform=r?r({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=n.animationValues||n.latestValues;this.applyTransformsToTarget();let a=Gg(this.projectionDeltaWithTransform,this.treeScale,i);r&&(a=r(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=n.animationValues?n===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:n===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in Yh){if(i[t]===void 0)continue;let{correct:r,applyTo:o,isCSSVariable:s}=Yh[t],c=a===`none`?i[t]:r(i[t],n);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=n===this?$h(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=this.dragSnapshot=this.dragAncestor=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(l_),this.root.sharedNodes.clear()}}}function i_(e){e.updateLayout(),f_(e)}function a_(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source,o=(r,a)=>{if(i===`size`)Kg(e=>{let t=hg(r[e]);r[e].min=a[e].min,r[e].max=r[e].min+t});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;cg(r[e],a[e])}else A_(i,t.layoutBox,n)&&Kg(t=>{let n=hg(a[t]);r[t].max=r[t].min+n,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[t].max=e.relativeTarget[t].min+n)})},s=a?t.measuredBox:t.layoutBox;o(s,n);let c=Ag();vg(c,n,t.layoutBox);let l=Ag();vg(l,a?e.applyTransform(r,!0):n,s);let u=!Pg(c),d=!1,f=e.getClosestProjectingParent();if((!e.resumeFrom||f?.options.layoutRoot&&e.resumeFrom.path.includes(f))&&f&&!f.resumeFrom){let{snapshot:r,layout:i}=f;if(r&&i){let s=e.options.layoutAnchor||void 0,c=Mg();Sg(c,a?e.resumeFrom.applyTransform(t.layoutBox,!0,void 0,!0,f.depth+1):t.layoutBox,r.layoutBox,s);let l=Mg();Sg(l,n,i.layoutBox,s),a&&o(c,l),Rg(c,l)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=l,e.relativeTargetOrigin=c,e.relativeParent=f)}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:l,layoutDelta:c,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else e.isLead()&&e.options.onExitComplete?.();e.options.transition=void 0}function o_(e){Xh.value&&Xg.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function s_(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function c_(e){e.clearSnapshot()}function l_(e){e.clearMeasurements()}function u_(e){e.isLayoutDirty=!0,e.updateLayout()}function d_(e){e.isLayoutDirty=!1}function f_(e){let{snapshot:t,dragAncestor:n}=e,r=n?.isAnimationBlocked&&n.layout;if(!t||!r||e.resumeFrom||e.isAnimationBlocked)return;let i=n.dragSnapshot;Kg(e=>Fh(t.layoutBox[e],r.layoutBox[e].min-i.layoutBox[e].min))}function p_(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.dragSnapshot||e.layout,e.isLayoutDirty=!0)}function m_(e){e.relativeTarget&&e.relativeParent?.isLayoutDirty&&(e.currentAnimation?e.isLayoutDirty=!0:(e.targetDelta=void 0,e.removeRelativeTarget()))}function h_(e){let{visualElement:t}=e.options;t?.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function g_(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function __(e){e.resolveTargetDelta()}function v_(e){e.calcProjection()}function y_(e){e.resetSkewAndRotation()}function b_(e,t,n){e.translate=Pu(t.translate,0,n),e.scale=Pu(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function x_(e,t,n,r){e.min=Pu(t.min,n.min,r),e.max=Pu(t.max,n.max,r)}function S_(e,t,n,r){x_(e.x,t.x,n.x,r),x_(e.y,t.y,n.y,r)}function C_(e){return e.animationValues?.opacityExit!==void 0}var w_={duration:.45,ease:[.4,0,.1,1]},T_=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),E_=T_(`applewebkit/`)&&!T_(`chrome/`)?Math.round:ol;function D_(e){e.min=E_(e.min),e.max=E_(e.max)}function O_(e){D_(e.x),D_(e.y)}function k_(e,t,n){e.max=hg(n)+(e.min=t.min)}function A_(e,t,n){return e===`position`||e===`preserve-aspect`&&!gg(zg(t),zg(n),.2)}function j_(e){return e!==e.root&&e.scroll?.wasRoot}function M_(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var N_=/* @__PURE__ */ r_({attachResizeListener:(e,t)=>M_(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),P_={current:void 0},F_=/* @__PURE__ */ r_({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!P_.current){let e=new N_({});e.mount(window),e.setOptions({layoutScroll:!0}),P_.current=e}return P_.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),I_=/* @__PURE__ */ new WeakMap;function L_(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function R_(e){return typeof e==`string`||Array.isArray(e)}var z_=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],B_=/* @__PURE__ */ [`initial`].concat(z_);function V_(e){if(L_(e.animate))return!0;for(let t=0;t<B_.length;t++)if(R_(e[B_[t]]))return!0;return!1}function H_(e){return!!(V_(e)||e.variants)}function U_(e,t,n){for(let r in t){let i=t[r],a=n[r];if(ym(i))e.addValue(r,i);else if(ym(a))e.addValue(r,Xp(i,{owner:e}));else if(a!==i){if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,Xp(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var W_={current:null},G_={current:!1},K_=typeof window<`u`;function q_(){if(G_.current=!0,K_){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>W_.current=e.matches;e.addEventListener(`change`,t),t()}else W_.current=!1}}var J_=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],Y_={};function X_(e){Y_=e}function Z_(){return Y_}var Q_=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=/* @__PURE__ */ new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=/* @__PURE__ */ new Map,this.KeyframeResolver=Wf,this.features={},this.valueSubscriptions=/* @__PURE__ */ new Map,this.prevMotionValues={},this.hasBeenMounted=!1,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=()=>{let e=J.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,Q.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=V_(t),this.isVariantNode=H_(t),this.isVariantNode&&(this.variantChildren=/* @__PURE__ */ new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&ym(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];if(this.current=e,I_.set(e,this),this.projection?.instance||this.projection?.mount(e),this.isVariantNode&&!this.isControllingVariants){let e=this;do e=e.props.inherit!==!1&&e.parent;while(e&&!e.isVariantNode);if(e){let{variantChildren:t}=e;t.add(this),this.removeFromVariantTree=()=>t.delete(this)}}this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(G_.current||q_(),this.shouldReduceMotion=W_.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection?.unmount(),$u(this.notifyUpdate),$u(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree?.(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),(this.enteringChildren||=/* @__PURE__ */ new Set).add(e)}removeChild(e){this.children.delete(e),this.enteringChildren?.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.get(e)?.(),t.accelerate&&fp.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new rp({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:/* @__PURE__ */ ul(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=Df.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&Q.preRender(this.notifyUpdate),n&&(this.projection&&(this.projection.isTransformDirty=!0),Tp.get(this.current)?.check()),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i?.()})}sortNodePosition(e){return!this.current||!e.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in Y_){let t=Y_[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let 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):Mg()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){let{transformTemplate:n,onUpdate:r}=this.props;(e.transformTemplate||n)&&this.scheduleRender(),(e.transformTemplate&&!n||e.onUpdate&&!r)&&Tp.get(this.current)?.demote(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<J_.length;t++){let n=J_[t];this.propEventSubscriptions[n]?.(),delete this.propEventSubscriptions[n];let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=U_(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue?.()}getProps(){return this.props}getVariant(e){return this.props.variants?.[e]}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}addValue(e,t){let n=this.values.get(e);if(t!==n){n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t);let r=t.get();r!==void 0&&(this.latestValues[e]=r)}}removeValue(e){this.values.delete(e),this.valueSubscriptions.get(e)?.(),this.valueSubscriptions.delete(e),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){let n=this.props.values?.[e];return n||(n=this.values.get(e),n===void 0&&t!==void 0&&(n=Xp(t??this.getDefaultValue?.(e),{owner:this}),this.addValue(e,n)),n)}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(nl(n)||il(n))?n=parseFloat(n):typeof n!=`number`&&!Au.test(n)&&Au.test(t)&&(n=pf(e,t)),this.setBaseTarget(e,ym(n)?n.get():n)),ym(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}on(e,t){return(this.events[e]||(this.events[e]=new ll)).add(t)}notify(e,...t){this.events[e]?.notify(...t)}scheduleRenderMicrotask(){Kh.render(this.render)}},$_=class extends Q_{constructor(){super(...arguments),this.KeyframeResolver=Im}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;ym(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}};function ev(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function tv(e,{layout:t,layoutId:n}){return Df.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!Yh[e]||e===`opacity`)}function nv(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(ym(r[t])||i&&ym(i[t])||tv(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function rv(e){return window.getComputedStyle(e)}var iv=class extends $_{constructor(){super(...arguments),this.type=`html`,this.renderInstance=ev}mount(e){super.mount(e)}readValueFromInstance(e,t){if(Df.has(t))return this.projection?.isProjecting?Cf(t):Tf(e,t);{let n=rv(e),r=(zl(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return zh(e,t)}build(e,t,n){sh(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return nv(e,t,n)}},av=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1;function ov(e){return{point:{x:e.pageX,y:e.pageY}}}var sv=e=>t=>av(t)&&e(t,ov(t));function cv(e,t,n,r){return M_(e,t,sv(n),r)}var lv=/* @__PURE__ */ new WeakMap,uv,dv=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:Km(r)&&`getBBox`in r?r.getBBox()[t]:r[n],fv=/*@__PURE__*/ dv(`inline`,`width`,`offsetWidth`),pv=/*@__PURE__*/ dv(`block`,`height`,`offsetHeight`);function mv({target:e,borderBoxSize:t}){lv.get(e)?.forEach(n=>{n(e,{get width(){return fv(e,t)},get height(){return pv(e,t)}})})}function hv(e){e.forEach(mv)}function gv(){typeof ResizeObserver<`u`&&(uv=new ResizeObserver(hv))}function _v(e,t){uv||gv();let n=Xm(e);return n.forEach(e=>{let n=lv.get(e);n||(n=/* @__PURE__ */ new Set,lv.set(e,n)),n.add(t),uv?.observe(e)}),()=>{n.forEach(e=>{let n=lv.get(e);n?.delete(t),n?.size||uv?.unobserve(e)})}}var vv=/* @__PURE__ */ new Set,yv;function bv(){yv=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};vv.forEach(t=>t(e))},window.addEventListener(`resize`,yv)}function xv(e){return vv.add(e),yv||bv(),()=>{vv.delete(e),!vv.size&&typeof yv==`function`&&(window.removeEventListener(`resize`,yv),yv=void 0)}}function Sv(e,t){return Jm(typeof e==`function`?xv(e):_v(e,t))}var Cv=(e,t)=>Math.abs(e-t);function wv(e,t){let n=Cv(e.x,t.x),r=Cv(e.y,t.y);return Math.sqrt(n**2+r**2)}var Tv=/*#__PURE__*/ new Set([`auto`,`scroll`]),Ev=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=/* @__PURE__ */ new Map,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Ov(this.lastRawMoveEventInfo,this.transformPagePoint));let e=Av(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=wv(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e;this.history.push({...r,timestamp:J.now()});let{onStart:i,onMove:a}=this.handlers;t||(i?.(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),a?.(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.handleScroll(window),this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=Ov(t,this.transformPagePoint),this.hasPendingMove=!0,Q.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.hasPendingMove&&this.updatePoint(),this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i?.(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=Av(e.type===`pointercancel`?this.lastMoveEventInfo:Ov(t,this.transformPagePoint),this.history);this.startEvent&&n?.(e,a),r?.(e,a)},!av(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=Ov(ov(e),this.transformPagePoint),{point:c}=s;this.history=[{...c,timestamp:J.now()}];let{onSessionStart:l}=t;l&&l(e,Av(s,this.history));let u={passive:!0,capture:!0};this.removeListeners=sl(cv(this.contextWindow,`pointermove`,this.handlePointerMove,u),cv(this.contextWindow,`pointerup`,this.handlePointerUp,u),cv(this.contextWindow,`pointercancel`,this.handlePointerUp,u)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(Tv.has(e.overflowX)||Tv.has(e.overflowY))&&this.scrollPositions.set(t,Dv(t)),t=t.parentElement}this.scrollPositions.set(window,Dv(window)),this.removeScrollListeners=sl(M_(window,`scroll`,this.onElementScroll,{capture:!0}),M_(window,`scroll`,this.onWindowScroll,{}))}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=Dv(e),i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),Q.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners?.(),this.removeScrollListeners?.(),this.scrollPositions.clear(),$u(this.updatePoint)}},Dv=e=>e===window?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop};function Ov(e,t){return t?{point:t(e.point)}:e}function kv(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Av({point:e},t){return{point:e,delta:kv(e,Mv(t)),offset:kv(e,jv(t)),velocity:Nv(t,.1)}}function jv(e){return e[0]}function Mv(e){return e[e.length-1]}function Nv(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=Mv(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>/* @__PURE__ */ ul(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>/* @__PURE__ */ ul(t)*2&&(r=e[1]);let a=/* @__PURE__ */ dl(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}var Pv=/* @__PURE__ */ new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function Fv(e){return Pv.has(e.tagName)||e.isContentEditable===!0}var Iv=/* @__PURE__ */ new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function Lv(e){return Iv.has(e.tagName)||e.isContentEditable===!0}var Rv={x:!1,y:!1};function zv(){return Rv.x||Rv.y}function Bv(e){return e===`x`||e===`y`?Rv[e]?null:(Rv[e]=!0,()=>{Rv[e]=!1}):Rv.x||Rv.y?null:(Rv.x=Rv.y=!0,()=>{Rv.x=Rv.y=!1})}function Vv(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Pu(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Pu(n,e,r.max):Math.min(e,n)),e}function Hv(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function Uv(e,{top:t,left:n,bottom:r,right:i}){return{x:Hv(e.x,n,i),y:Hv(e.y,t,r)}}function Wv(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Gv(e,t){return{x:Wv(e.x,t.x),y:Wv(e.y,t.y)}}function Kv(e,t){let n=.5,r=hg(e),i=hg(t);return i>r?n=/* @__PURE__ */ cl(t.min,t.max-r,e.min):r>i&&(n=/* @__PURE__ */ cl(e.min,e.max-i,t.min)),el(0,1,n)}function qv(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var Jv=.35;function Yv(e=Jv){return e===!1?e=0:e===!0&&(e=Jv),{x:Xv(e,`left`,`right`),y:Xv(e,`top`,`bottom`)}}function Xv(e,t,n){return{min:Zv(e,t),max:Zv(e,n)}}function Zv(e,t){return typeof e==`number`?e:e[t]||0}function Qv(e){let t=``;for(let n of e.path){n.scroll=void 0,n.updateScroll();let{scroll:r}=n;n!==e.root&&r&&(t+=r.offset.x+`,`+r.offset.y+`,`)}return t}var $v=/* @__PURE__ */ new WeakMap,ey=class{constructor(e,t=()=>e.getProps()){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Mg(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e,this.readProps=t}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){if(this.visualElement.presenceContext?.isPresent===!1)return;let r=e=>{t&&this.snapToCursor(e),this.stopAnimation()},i=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock?.(),this.openDragLock=Bv(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints();let{projection:a}=this.visualElement;a&&(a.isAnimationBlocked=!0,a.target=void 0),Kg(e=>{let t=this.getAxisMotionValue(e).get()||0;if(Vl(t)&&(t=lm(t,this.visualElement.current)||0),Y.test(t))t=parseFloat(t);else if(ou.test(t)){let n=a?.layout?.layoutBox[e];n&&(t=hg(n)*(parseFloat(t)/100))}this.originPoint[e]=t}),i&&Q.update(()=>i(e,t),!1,!0),xm(this.visualElement,`transform`),this.visualElement.animationState?.setActive(`whileDrag`,!0)},a=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){if(this.currentDirection=oy(o),this.currentDirection===null)return;i&&i(this.currentDirection)}this.updateAxis(`x`,o),this.updateAxis(`y`,o),this.visualElement.render(),a&&Q.update(()=>a(e,t),!1,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},s=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:c}=this.getProps();this.panSession=new Ev(e,{onSessionStart:r,onStart:i,onMove:a,onSessionEnd:o,resumeAnimation:s},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,distanceThreshold:n,contextWindow:this.visualElement.current?.ownerDocument.defaultView,element:this.visualElement.current})}stop(e,t,n){let r=e||this.latestPointerEvent,i=t||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!i||!r)return;let{velocity:o}=i;this.startAnimation(o,n);let{onDragEnd:s}=this.getProps();s&&Q.postRender(()=>s(r,i))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession(),!this.getProps().dragPropagation&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t?.setActive(`whileDrag`,!1)}endPanSession(){this.panSession?.end(),this.panSession=void 0}updateAxis(e,t){let{drag:n}=this.readProps();if(!t||!ay(e,n,this.currentDirection))return;let r=this.getAxisMotionValue(e),i=this.originPoint[e]+t[e],a=this.constraints&&this.constraints[e];a&&(i=Vv(i,a,this.elastic[e])),r.set(i)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),{projection:n}=this.visualElement,r=n&&(n.layout||n.measure(!1)),i=this.constraints;ty(e)?this.constraints&&this.scroll===Qv(n)||(this.constraints=this.resolveRefConstraints()):this.constraints=e&&r?Uv(r.layoutBox,e):!1,this.elastic=Yv(t),i!==this.constraints&&!ty(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&Kg(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=qv(r.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!ty(e))return!1;let n=ny(e),{projection:r}=this.visualElement;if(!r||!r.layout)return!1;this.scroll=Qv(r);let i=Bh(n,r.root,this.visualElement.getTransformPagePoint()),a=Gv(r.layout.layoutBox,r.removeElementScroll(i));if(t){let e=t(yh(a));this.hasMutatedConstraints=!!e,e&&(a=vh(e))}return a}startAnimation(e,t){let{drag:n,dragMomentum:r,dragElastic:i,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:s}=this.getProps(),c=this.constraints||{},l=Kg(s=>{if(!ay(s,t||n,this.currentDirection))return;let l=c[s]||{};(o===!0||o===s)&&(l={min:0,max:0});let u=i?200:1e6,d=i?40:1e7,f={type:`inertia`,velocity:r?e[s]:0,bounceStiffness:u,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...a,...l};return this.startAxisValueAnimation(s,f)});return Promise.all(l).then(s)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return xm(this.visualElement,e),n.start(om(e,n,0,t,this.visualElement,!1))}stopAnimation(){Kg(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.readProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor({clientX:e,clientY:t}){let{drag:n}=this.getProps(),r={x:e,y:t},i=this.visualElement.getTransformPagePoint()?.(r)||r,a=this.visualElement.measureViewportBox();Kg(e=>{if(!ay(e,n,this.currentDirection))return;let t=this.getAxisMotionValue(e),{min:r,max:o}=a[e];t.set((t.get()||0)+i[e]-Pu(r,o,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!ty(t)||!n||!this.constraints)return;this.stopAnimation();let r=this.constraints,i={x:0,y:0};Kg(e=>{let t=this.getAxisMotionValue(e).get();i[e]=Kv({min:t,max:t},r[e])});let{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},``):`none`,n.root?.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),Kg(t=>{let n=this.getAxisMotionValue(t);if(!ay(t,e,null)||!n.get())return;let{min:r,max:a}=this.constraints[t];n.set(Pu(r,a,i[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;$v.set(this.visualElement,this);let e=this.visualElement.current,t=cv(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&Lv(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps(),r=ty(t)&&ny(t);r&&(this.constraints=this.resolveRefConstraints(),n||=iy(e,r,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i.layout||(i.root?.updateScroll(),i.updateLayout()),Q.read(r);let o=M_(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Kg(t=>{if(!ay(t,this.getProps().drag,this.currentDirection))return;let n=this.getAxisMotionValue(t);this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate)}),this.visualElement.render())}));return()=>{o(),t(),a(),s(),n?.()}}getProps(){let e=this.readProps(),{dragElastic:t=Jv,dragMomentum:n=!0}=e;return{...e,dragElastic:t,dragMomentum:n}}};function ty(e){return!!e&&typeof e==`object`&&(`current`in e||`nodeType`in e)}var ny=e=>`current`in e?e.current:e;function ry(e){let t=!0;return()=>{t?t=!1:e()}}function iy(e,t,n){let r=Sv(e,ry(n)),i=Sv(t,ry(n));return()=>{r(),i()}}function ay(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function oy(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}function sy(e,t){let n=Xm(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},Jm(()=>r.abort())]}function cy(e){return!(e.pointerType===`touch`||zv())}function ly(e,t,n={}){t=Ym(t);let[r,i,a]=sy(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{e.pointerType!==`touch`&&(n?r=!0:s(e))};e.addEventListener(`pointerenter`,n=>{if(!cy(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var uy=(e,t)=>t?e===t||uy(e,t.parentElement):!1,dy=/* @__PURE__ */ new WeakSet;function fy(e){return t=>{t.key===`Enter`&&e(t)}}function py(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var my=(e,t)=>{let n=!1,r=fy(()=>{dy.has(e)||(n=!0,py(e,`down`))}),i=fy(()=>{n&&(n=!1,py(e,`up`))});e.addEventListener(`keydown`,r,t),e.addEventListener(`keyup`,i,t),e.addEventListener(`blur`,()=>{e.removeEventListener(`keydown`,r),e.removeEventListener(`keyup`,i),n&&py(e,`cancel`)},{...t,once:!0})};function hy(e){return av(e)&&!zv()}var gy=/* @__PURE__ */ new WeakSet;function _y(e,t,n={}){t=Ym(t);let[r,i,a]=sy(e,n),o=e=>{let r=e.currentTarget;if(!hy(e)||gy.has(e))return;dy.add(r),n.stopPropagation&&gy.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),dy.has(r)&&dy.delete(r),hy(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||uy(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),Gm(e)&&(e.addEventListener(`focus`,()=>my(e,i),i),!Fv(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}var vy=class{constructor(e){this.isMounted=!1,this.node=e}update(){}},yy=/* @__PURE__ */ 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`]),by=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function xy(e,t,n,r){ev(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(yy.has(n)?n:oh(n),t.attrs[n])}function Sy(e,t,n){let r=nv(e,t,n);for(let n in e)if(n!==`children`&&(ym(e[n])||ym(t[n]))){let t=Ef.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var Cy=class extends $_{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=Mg}getBaseTargetFromProps(e,t){return Df.has(t)?super.getBaseTargetFromProps(e,t)??Cf(t):e[t]}getDefaultValue(e){return Df.has(e)?this.latestValues[e]??Cf(e):void 0}readValueFromInstance(e,t){if(Df.has(t)){let e=df(t);return e&&e.default||0}if(dh.includes(t)){let n=getComputedStyle(e)[t];if(typeof n==`string`&&n)return n.trim()}return t=yy.has(t)?t:oh(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return Sy(e,t,n)}build(e,t,n){fh(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){xy(e,t,n,r)}mount(e){this.isSVGTag=by(e.tagName),super.mount(e)}};function wy(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var Ty=[...z_].reverse(),Ey=e=>e?.out===!0?e:e?.out;function Dy(e){let t=t=>Promise.all(t.map(({animation:t,options:n})=>Om(e,t,n))),n=ky(),r=!0,i=!1;function a(a){let{props:o,parent:s,manuallyAnimateOnMount:c}=e,{initial:l}=o,u=r||i,d=[],f=(t=l)=>typeof t!=`boolean`&&fm(e,Array.isArray(t)?t[0]:t,e.presenceContext?.custom)||void 0,p=/* @__PURE__ */ new Map,m={},h=1/0,g=e;do g=g.props.inherit!==!1&&g.parent;while(g&&!g.isControllingVariants);let _=u&&Ey(f(l??(g&&g.props.initial))?.transition);if(Ty.forEach((t,r)=>{let i=n[t],l=o[t],f=g&&g.props[t],v=l===void 0?R_(f)||f===!1?f:void 0:l,y=R_(v),b=t===a?i.isActive:null,x=y&&l===void 0&&!(u&&c);if(i.protectedKeys={...m},!i.isActive&&b===null||!v&&!i.prevProp||L_(v)||typeof v==`boolean`)return;if(b===!1&&(h=r),t===`exit`&&i.isActive&&b!==!0){m={...m,...i.prevResolvedValues};return}let S=Oy(i.prevProp,v),C=S||y&&(b&&!x||r>h),w=!1,T=Array.isArray(v)?v:[v],E={},D;if(b!==!1)for(let n of T){let{transition:r,transitionEnd:i,...a}=fm(e,n,pm(e,t))||{};E={...E,...a,...i},D=Ey(r)||D}let{prevResolvedValues:O}=i;for(let t in{...O,...E}){if(t in m)continue;let n=E[t],r=O[t],a=Array.isArray(n)&&Array.isArray(r)?!wy(n,r)||S:n!==r,o;if(a&&n==null)p.has(t)||p.set(t,i.prevOut);else if(a||n!==void 0&&p.has(t)){C=!0,o=p.get(t)||_,p.delete(t)&&(w=!0),i.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)}else i.protectedKeys[t]=!0;i.out[t]=o}if(i.prevProp=v,i.prevResolvedValues=E,i.prevOut=D,i.isActive&&(m={...m,...E}),C&&(!(x&&S)||w))for(let n of T){let r={type:t};if(typeof n==`string`&&u&&c&&s?.enteringChildren){let t=fm(s,n)?.transition?.delayChildren;r.delay=Gp(s.enteringChildren,e,t)}d.push({animation:n,options:r})}}),p.size){let t={},n=f(),r=n?.transition;p.forEach((i,a)=>{i&&(r={...r||e.getDefaultTransition(),[a]:i});let s=e.getValue(a);s&&(s.liveStyle=!0);let c=n&&!Array.isArray(l)?n[a]:void 0,u=e.getBaseTargetFromProps(o,a);t[a]=(c===void 0?u!==void 0&&!ym(u)?u:e.initialValues[a]===void 0?e.baseTarget[a]:void 0:c)??null}),r&&(t.transition=r),d.push({animation:t})}let v=u&&e.blockInitialAnimation||r&&!c&&(o.initial===!1||o.initial===o.animate);return r=i=!1,!v&&d.length?t(d):Promise.resolve()}function o(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=a(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:a,setActive:o,setAnimateFunction:n=>{t=n(e)},getState:()=>n,reset:()=>{n=ky(),i=!0}}}function Oy(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!wy(t,e):!1}function ky(){let e={};for(let t of z_)e[t]={isActive:t===`animate`,protectedKeys:{},needsAnimating:{},prevResolvedValues:{},out:{}};return e}var Ay=/* @__PURE__ */ (0,B.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function jy(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function My(...e){return t=>{let n=!1,r=e.map(e=>{let r=jy(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():jy(e[t],null)}}}}function Ny(...e){return B.useCallback(My(...e),e)}var Py=e=>{let{width:t,height:n}=e?.getBoundingClientRect()||{};return[t/e?.offsetWidth||1,n/e?.offsetHeight||1]},Fy=e=>{let{left:t,top:n}=e.getBoundingClientRect(),r=e;for(;r=r.parentElement||r.parentNode?.host;){let{scrollLeft:e,scrollTop:i}=r;if(e||i){let[a,o]=Py(r);t+=e*a,n+=i*o}if(getComputedStyle(r).position===`fixed`)break}let[i,a]=Py(e.offsetParent);return[t/i,n/a]},Iy=class extends B.Component{getSnapshotBeforeUpdate(e){let t=this.props.getElement();if(Gm(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=Gm(e)&&e.offsetWidth||0,r=Gm(e)&&e.offsetHeight||0,i=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=r-a.height-a.top,a.direction=i.direction,a.point=Fy(t)}return null}componentDidUpdate(){}render(){return this.props.children}};function Ly({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:a,popNode:o}){let s=(0,B.useId)(),c=(0,B.useRef)(null),l=(0,B.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:`ltr`}),{nonce:u}=(0,B.useContext)(Ay),d=Ny(c,a===!1?void 0:e.props?.ref??e?.ref),f=()=>c.current||o?.current?.current,p=e=>{let{width:t,height:i,top:a,left:o,right:c,bottom:u,direction:d}=l.current,f=d===`rtl`,p=n===`left`?f?`right:${c}`:`left:${o}`:f?`left:${o}`:`right:${c}`,m=r===`bottom`?`bottom:${u}`:`top:${a}`;e?.insertRule(`[data-motion-pop-id="${s}"]{position:absolute!important;width:${t}px!important;height:${i}px!important;${p}px!important;${m}px!important}`)};return(0,B.useInsertionEffect)(()=>{let{width:e,height:n}=l.current,r=f();if(t||a===!1||!r||!e||!n)return;r.dataset.motionPopId=s;let o=r.ownerDocument,c=o.createElement(`style`);u&&(c.nonce=u);let d=i??o.head;d.appendChild(c),p(c.sheet);let m=0,h=0;return Kh.setup(()=>{let[e,t]=Fy(r);m=l.current.point[0]-e,h=l.current.point[1]-t}),Kh.read(()=>{let{sheet:e}=c;if(!e||!m&&!h)return;let t=l.current;t.left+=m,t.right-=m,t.top+=h,t.bottom-=h,e.deleteRule(0),p(e)}),()=>{r.removeAttribute(`data-motion-pop-id`),d.contains(c)&&d.removeChild(c)}},[t]),(0,V.jsx)(Iy,{isPresent:t,getElement:f,sizeRef:l,pop:a,children:a===!1?e:B.cloneElement(e,{ref:d})})}var Ry=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:s,anchorY:c,root:l})=>{let u=Yc(zy),d=(0,B.useId)(),f=(0,B.useRef)(),p=(0,B.useRef)(n),m=(0,B.useRef)(r);Xc(()=>{p.current=n,m.current=r});let h=!0,g=(0,B.useMemo)(()=>(h=!1,{id:d,initial:t,isPresent:n,custom:i,onExitComplete:e=>{u.set(e,!0);for(let e of u.values())if(!e)return;r&&r()},register:(e,t)=>(u.set(e,!1),t&&t.parent?.presenceContext?.id!==d&&(f.current=t),()=>{u.delete(e),!p.current&&!u.size&&m.current?.()})}),[n,u,r]);return a&&h&&(g={...g}),(0,B.useMemo)(()=>{u.forEach((e,t)=>u.set(t,!1))},[n]),B.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=(0,V.jsx)(Ly,{pop:o===`popLayout`,isPresent:n,anchorX:s,anchorY:c,root:l,popNode:f,children:e}),(0,V.jsx)(Zc.Provider,{value:g,children:e})};function zy(){return/* @__PURE__ */ new Map}function By(e=!0){let t=(0,B.useContext)(Zc);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,B.useId)();(0,B.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,B.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var Vy=e=>e.key||``;function Hy(e){let t=[];return B.Children.forEach(e,e=>{(0,B.isValidElement)(e)&&t.push(e)}),t}var Uy=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a=`sync`,propagate:o=!1,anchorX:s=`left`,anchorY:c=`top`,root:l})=>{let[u,d]=By(o),f=(0,B.useMemo)(()=>Hy(e),[e]),p=o&&!u?[]:f.map(Vy),m=(0,B.useRef)(!0),h=Yc(()=>/* @__PURE__ */ new Map),g=(0,B.useRef)(/* @__PURE__ */ new Set),[_,v]=(0,B.useState)(f),[y,b]=(0,B.useState)(f);Xc(()=>{o&&!u&&!y.length&&d?.()},[u,o,y.length,d]);let x=(0,B.useRef)();(0,B.useEffect)(()=>()=>{let e=x.current;x.current=void 0,e?.()},[y]),Xc(()=>{m.current=!1;for(let e=0;e<y.length;e++){let t=Vy(y[e]);p.includes(t)?(h.delete(t),g.current.delete(t)):h.get(t)!==!0&&h.set(t,!1)}},[y,p.length,p.join(`-`)]);let S=[];if(f!==_){let e=[...f],t=0;for(let n of y){let r=p.indexOf(Vy(n));r===-1?(e.splice(t++,0,n),S.push(n)):t=r+S.length+1}return S.every(e=>h.get(Vy(e)))?e=f:a===`wait`&&(e=S),b(Hy(e)),v(f),null}let{forceRender:C}=(0,B.useContext)(Jc);return(0,V.jsx)(V.Fragment,{children:y.map(e=>{let _=Vy(e),b=o&&!u?!1:f===y||p.includes(_);return(0,V.jsx)(Ry,{isPresent:b,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:l,onExitComplete:b?void 0:()=>{if(g.current.has(_))return;if(h.has(_))g.current.add(_),h.set(_,!0);else return;let e=!0;h.forEach(t=>{t||(e=!1)}),e&&(C?.(),v([]),o&&d?.(),x.current=r)},anchorX:s,anchorY:c,children:e},_)})})},Wy=/* @__PURE__ */ (0,B.createContext)({strict:!1}),Gy={animation:[`variants`,...z_],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`]},Ky=!1;function qy(){if(Ky)return;let e={};for(let t in Gy)e[t]={isEnabled:e=>Gy[t].some(t=>!!e[t])};X_(e),Ky=!0}function Jy(){return qy(),Z_()}function Yy(e){let t=Jy();for(let n in e)t[n]={...t[n],...e[n]};X_(t)}function Xy({children:e,...t}){let n=(0,B.useContext)(Ay);t={...n,...t},t.transition=Zp(t.transition,n.transition),t.isStatic=Yc(()=>t.isStatic);let r=(0,B.useMemo)(()=>t,[JSON.stringify(t.transition),t.transformPagePoint,t.reducedMotion,t.skipAnimations,t.isValidProp]);return(0,V.jsx)(Ay.Provider,{value:r,children:e})}var Zy=/* @__PURE__ */ (0,B.createContext)({});function Qy(e,t){if(V_(e)){let{initial:t,animate:n}=e;return{initial:t===!1||R_(t)?t:void 0,animate:R_(n)?n:void 0}}return e.inherit===!1?{}:t}function $y(e){let{initial:t,animate:n}=Qy(e,(0,B.useContext)(Zy));return(0,B.useMemo)(()=>({initial:t,animate:n}),[eb(t),eb(n)])}function eb(e){return Array.isArray(e)?e.join(` `):e}var tb=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function nb(e,t,n){for(let r in t)!ym(t[r])&&!tv(r,n)&&(e[r]=t[r])}function rb({transformTemplate:e},t){return(0,B.useMemo)(()=>{let n=tb();return sh(n,t,e),Object.assign({},n.vars,n.style)},[t])}function ib(e,t){let n=e.style||{},r={};return nb(r,n,e),Object.assign(r,rb(e,t)),r}function ab(e,t){let n={},r=ib(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var ob=()=>({...tb(),attrs:{}});function sb(e,t,n,r){let i=(0,B.useMemo)(()=>{let n=ob();return fh(n,t,by(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};return nb(t,e.style,e),{...i,style:{...t,...i.style}}}return i}var cb=/* @__PURE__ */ new Set(/* @__PURE__ */ `animate.exit.variants.initial.style.values.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function lb(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||cb.has(e)}function ub(e,t){return e.startsWith(`on`)?!lb(e):t?.(e)??!lb(e)}function db(e,t,n,r){let i={};for(let a in e)a===`values`&&typeof e.values==`object`||ym(e[a])||(ub(a,r)||n===!0&&lb(a)||!t&&!lb(a)||e.draggable&&a.startsWith(`onDrag`))&&(i[a]=e[a]);return i}var fb=[`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 pb(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(fb.indexOf(e)>-1||/[A-Z]/u.test(e))}function mb(e,t,n,{latestValues:r},i,a=!1,o,s){let c=(o??pb(e)?sb:ab)(t,r,i,e),l=db(t,typeof e==`string`,a,s),u=e===B.Fragment?{}:{...l,...c,ref:n},{children:d}=t,f=(0,B.useMemo)(()=>ym(d)?d.get():d,[d]);return(0,B.createElement)(e,{...u,children:f})}function hb({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:gb(n,r,i,e),renderState:t()}}function gb(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=$h(a[e]);let{initial:o,animate:s}=e,c=V_(e),l=H_(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!L_(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=dm(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var _b=e=>(t,n)=>{let r=(0,B.useContext)(Zy),i=(0,B.useContext)(Zc),a=()=>hb(e,t,r,i);return n?a():Yc(a)},vb=/*@__PURE__*/ _b({scrapeMotionValuesFromProps:nv,createRenderState:tb}),yb=/*@__PURE__*/ _b({scrapeMotionValuesFromProps:Sy,createRenderState:ob}),bb=/* @__PURE__ */ Symbol.for(`motionComponentSymbol`);function xb(e,t,n){let r=(0,B.useRef)(n);(0,B.useInsertionEffect)(()=>{r.current=n});let i=(0,B.useRef)(null);return(0,B.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}var Sb=/* @__PURE__ */ (0,B.createContext)({});function Cb(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function wb(e,t,n,r,i,a){let{visualElement:o}=(0,B.useContext)(Zy),s=(0,B.useContext)(Wy),c=(0,B.useContext)(Zc),l=(0,B.useContext)(Ay),u=l.reducedMotion,d=l.skipAnimations,f=(0,B.useRef)(null),p=(0,B.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,B.useContext)(Sb);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&Tb(f.current,n,i,h),(0,B.useInsertionEffect)(()=>{m&&m.props!==n&&m.update(n,c)});let g=n[Sm],_=(0,B.useRef)(!!g&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(g)&&window.MotionHasOptimisedAnimation?.(g));return Xc(()=>{p.current&&m&&(m.animationState?.animateChanges(),m.enteringChildren=void 0)},[]),Xc(()=>{p.current=!0,m&&(window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),_.current&&m.animationState&&m.animationState.animateChanges())}),(0,B.useEffect)(()=>{m&&(!_.current&&m.animationState&&m.animationState.animateChanges(),_.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(g)}),!1),m.enteringChildren=void 0)}),m}function Tb(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t,f=e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:Eb(e.parent));f.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&Cb(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u});let p=f.getStack()?.lead;p&&!f.root.isUpdateBlocked()&&(p.willUpdate(),p.scheduleCheckAfterUnmount())}function Eb(e){if(e)return e.options.allowProjection===!1?Eb(e.parent):e.projection}function Db(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&Yy(r);let a=n?n===`svg`:pb(e),o=a?yb:vb;function s(n,s){let c,l=Ob(n);Yc(()=>!!P_.current?.sharedNodes.get(l)?.lead&&n.initial)&&(n={...n,initial:!1});let u={...(0,B.useContext)(Ay),...n,layoutId:l},{isStatic:d,isValidProp:f}=u,p=$y(n),m=o(n,d);if(!d&&typeof window<`u`){kb(u,r);let t=Ab(u);p.visualElement=wb(e,m,u,i,t.ProjectionNode,a),(t.isEnabled||p.visualElement?.projection?.options.layoutId)&&(c=t.MeasureLayout)}return(0,V.jsxs)(Zy.Provider,{value:p,children:[c&&p.visualElement?(0,V.jsx)(c,{visualElement:p.visualElement,...u}):null,mb(e,n,xb(m,p.visualElement,s),m,d,t,a,f)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,B.forwardRef)(s);return c[bb]=e,c}function Ob({layoutId:e}){let t=(0,B.useContext)(Jc).id;return t&&e!==void 0?t+`-`+e:e}function kb(e,t){(0,B.useContext)(Wy).strict}function Ab(e){let{drag:t,layout:n}=Jy();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:r.MeasureLayout,isEnabled:t?.isEnabled(e)||n?.isEnabled(e),ProjectionNode:r.ProjectionNode}}function jb(e,t){if(typeof Proxy>`u`)return Db;let n=/* @__PURE__ */ new Map,r=(n,r)=>Db(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,Db(a,void 0,e,t)),n.get(a))})}var Mb=(e,t)=>t.isSVG??pb(e)?new Cy(t):new iv(t,{allowProjection:e!==B.Fragment}),Nb=class extends vy{constructor(e){super(e),e.animationState||=Dy(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();L_(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){this.node.getProps().animate!==this.node.prevProps?.animate&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},Pb=0,Fb={animation:{Feature:Nb},exit:{Feature:class extends vy{constructor(){super(...arguments),this.id=Pb++}update(){let{presenceContext:e,prevPresenceContext:t,animationState:n}=this.node;if(!e||!n)return;let{isPresent:r,onExitComplete:i}=e,a=t?.isPresent;if(r===a)return;if(r&&a===!1){if(this.exit===!0){let{initial:e}=this.node.getProps();if(e&&!Array.isArray(e)){let{transition:t,transitionEnd:n,...r}=fm(this.node,e)||{};for(let e in r)this.node.getValue(e)?.jump(r[e])}this.node.blockInitialAnimation=!1,n.reset(),n.animateChanges()}else n.setActive(`exit`,!1);this.exit=void 0;return}let o=this.exit=n.setActive(`exit`,!r);i&&!r&&o.then(()=>{this.exit===o&&(this.exit=!0,i(this.id))})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id,this.node))}unmount(){}}}},Ib=class extends vy{constructor(e){super(e),this.removeGroupControls=ol,this.removeListeners=ol,this.controls=new ey(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ol}update(){let{dragControls:e,drag:t}=this.node.getProps(),{dragControls:n,drag:r}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls))),r&&!t&&this.controls.stop(void 0,void 0,r)}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},Lb=e=>(t,n)=>{e&&Q.update(()=>e(t,n),!1,!0)},Rb=class extends vy{constructor(){super(...arguments),this.removePointerDownListener=ol}onPointerDown(e){this.session=new Ev(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:this.node.current?.ownerDocument.defaultView})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Lb(e),onStart:Lb(t),onMove:Lb(n),onEnd:(e,t)=>{delete this.session,r&&Q.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=cv(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session?.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session?.end()}},zb=!1,Bb=({layout:e,layoutDependency:t,layoutAnchor:n})=>({layout:e,layoutDependency:t,layoutAnchor:n,animationType:typeof e==`string`?e:`both`}),Vb=(e,t)=>{let{snapshot:n}=e,r=e.getStack();r?.remove(e);let i=r?.lead;if(r?.prevLead===e&&i.resumeFrom===e&&(i.resumeFrom=i.currentAnimation=e.resumingFrom=void 0),e.options.layoutId=t,!t)e.needsShow=!0;else return e.root.registerSharedNode(t,e),()=>{let{resumeFrom:t}=e;t?.isPresent!==!1&&e.getStack().members.includes(t)&&(t.hide(),e.resumeFrom=void 0,e.snapshot=n)}},Hb=class extends B.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group?.add(i),r&&n?.register?.(i),zb&&i.root.didUpdate(),i.options.layoutId!==r&&Vb(i,r)?.(),i.addEventListener(`animationComplete`,()=>this.safeToRemove()),i.setOptions({...i.options,...Bb(this.props),onExitComplete:()=>this.safeToRemove()})),Yg.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,layoutId:n,visualElement:r,drag:i,isPresent:a}=this.props,{projection:o}=r;return o&&(o.isPresent=a,this.takeOver=e.layoutId===n?void 0:(o.willUpdate(),Vb(o,n)),o.setOptions({...o.options,...Bb(this.props)}),zb=!0,i||e.layoutDependency!==t||t===void 0||e.isPresent!==a?o.willUpdate():this.safeToRemove(),e.isPresent!==a&&(a?o.promote():o.relegate()||Q.postRender(()=>{o.getStack()?.members.length||this.safeToRemove()}))),null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(this.takeOver?.(),e.root.didUpdate(),Kh.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;zb=!0,r&&(r.scheduleCheckAfterUnmount(),t.group?.remove(r),n?.deregister?.(r))}safeToRemove(){this.props.safeToRemove?.()}render(){return null}};function Ub(e){let[t,n]=By(),r=(0,B.useContext)(Jc);return(0,V.jsx)(Hb,{...e,layoutGroup:r,switchLayoutGroup:(0,B.useContext)(Sb),isPresent:t,safeToRemove:n})}var Wb={pan:{Feature:Rb},drag:{Feature:Ib,ProjectionNode:F_,MeasureLayout:Ub}};function Gb(e,t,n,r){let{props:i}=e,a=`while`+n;e.animationState&&i[a]&&e.animationState.setActive(a,r===`Start`);let o=i[`on`+n+r];o&&Q.postRender(()=>o(t,ov(t)))}var Kb=class extends vy{mount(){let{current:e}=this.node;e&&(this.unmount=ly(e,(e,t)=>(Gb(this.node,t,`Hover`,`Start`),e=>Gb(this.node,e,`Hover`,`End`))))}unmount(){}},qb=class extends vy{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=sl(M_(this.node.current,`focus`,()=>this.onFocus()),M_(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function Jb(e,t,n){e.current instanceof HTMLButtonElement&&e.current.disabled||Gb(e,t,`Tap`,n)}var Yb=class extends vy{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=_y(e,(e,t)=>(Jb(this.node,t,`Start`),(e,{success:t})=>Jb(this.node,e,t?``:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},Xb=/* @__PURE__ */ new WeakMap,Zb=/* @__PURE__ */ new WeakMap,Qb=e=>{let t=Xb.get(e.target);t&&t(e)},$b=e=>{e.forEach(Qb)};function ex({root:e,...t}){let n=e||document;Zb.has(n)||Zb.set(n,{});let r=Zb.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver($b,{root:e,...t})),r[i]}function tx(e,t,n){let r=ex(t);return Xb.set(e,n),r.observe(e),()=>{Xb.delete(e),r.unobserve(e)}}var nx={some:0,all:1},rx=class extends vy{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:nx[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=tx(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(ix(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function ix({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var ax=/*@__PURE__*/ jb(/* @__PURE__ */ Object.assign({},Fb,{inView:{Feature:rx},tap:{Feature:Yb},focus:{Feature:qb},hover:{Feature:Kb}},Wb,{layout:{ProjectionNode:F_,MeasureLayout:Ub}}),Mb);function ox(){!G_.current&&q_();let[e]=(0,B.useState)(W_.current);return e}function sx(e){return typeof e==`object`&&!Array.isArray(e)}function cx(e,t,n,r){return e==null?[]:typeof e==`string`&&sx(t)?Xm(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function lx(e,t,n){return e*(t+1)+n*t}function ux(e,t){if(t.has(e))return t.get(e);let[,n,r]=e.match(/^(.+?)([+-][\d.]+)$/)||[];return t.has(n)?Math.max(0,t.get(n)+parseFloat(r)):void 0}function dx(e,t,n,r){return typeof t==`number`?t:t.startsWith(`-`)||t.startsWith(`+`)?Math.max(0,e+parseFloat(t)):t===`<`?n:t.startsWith(`<`)?Math.max(0,n+parseFloat(t.slice(1))):ux(t,r)??e}function fx(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];i.at>t&&i.at<n&&($c(e,i),r--)}}function px(e,t,n,r,i,a){fx(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:Pu(i,a,r[o]),easing:/* @__PURE__ */ kl(n,o)})}function mx(e,t,n=0){let r=t+1+t*n;for(let t=0;t<e.length;t++)e[t]=e[t]/r}function hx(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var gx=`easeInOut`,_x=20;function vx(e,{defaultTransition:t={},...n}={},r,i,a){let o=t.duration||.3,s=/* @__PURE__ */ new Map,c=/* @__PURE__ */ new Map,l={},u=/* @__PURE__ */ new Map,d=0,f=0,p=0,m=(e,n)=>{let a=n,s=e=>typeof e==`number`?n+e:dx(f,e,d,u);for(let n=0;n<e.length;n++){let h=e[n];if(typeof h==`string`){u.set(h,f);continue}if(!Array.isArray(h)){let e=h.at===void 0?f:s(h.at);`sequence`in h?(d=f=e,f=m(h.sequence,e),d=e,a=Math.max(a,f)):u.set(h.name,e);continue}let[g,_,v={}]=h;v.at!==void 0&&(f=s(v.at));let y=0,b=(e,n,r,a=0,s=0)=>{let c=xx(e),{delay:l=0,times:u=Fd(c),type:d=t.type||`keyframes`,repeat:m,repeatType:h,repeatDelay:g=0,..._}=n,{ease:v=t.ease||`easeOut`,duration:b}=n,x=typeof l==`function`?l(a,s):l,S=c.length,C=tp(d)?d:i?.[d||`keyframes`];if(S<=2&&C){let e=100;if(S===2&&wx(c)){let t=c[1]-c[0];e=Math.abs(t)}let n={...t,..._};b!==void 0&&(n.duration=/* @__PURE__ */ ul(b));let r=ad(n,e,C);v=r.ease,b=r.duration}b??=o;let w=f+x;u.length===1&&u[0]===0&&(u[1]=1);let T=u.length-c.length;if(T>0&&Pd(u,T),c.length===1&&c.unshift(null),m&&m<_x){let e=b>0?g/b:0;b=lx(b,m,g);let t=[...c],n=[...u];v=Array.isArray(v)?[...v]:[v];let r=[...v],i=h===`reverse`||h===`mirror`,a=t,o=r;i&&(a=[...t].reverse(),h===`reverse`&&(o=[...r].reverse().map(e=>typeof e==`function`?/* @__PURE__ */ _l(e):e)));for(let s=0;s<m;s++){let l=i&&s%2==0,d=l?a:t,f=l?o:r,p=(s+1)*(1+e);e>0&&(c.push(c[c.length-1]),u.push(p),v.push(`linear`)),c.push(...d);for(let e=0;e<d.length;e++)u.push(n[e]+p),v.push(e===0?`linear`:/* @__PURE__ */ kl(f,e-1))}mx(u,m,e)}let E=w+b;px(r,c,v,u,w,E),y=Math.max(x+b,y),p=Math.max(E,p)};if(ym(g)){let e=yx(g,c);b(_,v,bx(`default`,e))}else{let e=cx(g,_,r,l),t=e.length;for(let n=0;n<t;n++){_=_,v=v;let r=e[n],i=yx(r,c);for(let e in _)b(_[e],Sx(v,e),bx(e,i),n,t)}}d=f,f+=y,a=Math.max(a,f)}return a};return m(e,0),a&&(a.duration=p,a.labels=u),c.forEach((e,r)=>{for(let i in e){let a=e[i];a.sort(hx);let o=[],c=[],l=[];for(let e=0;e<a.length;e++){let{at:t,value:n,easing:r}=a[e];o.push(n),c.push(/* @__PURE__ */ cl(0,p,t)),l.push(r||`easeOut`)}c[0]!==0&&(c.unshift(0),o.unshift(o[0]),l.unshift(gx)),c[c.length-1]!==1&&(c.push(1),o.push(null)),s.has(r)||s.set(r,{keyframes:{},transition:{}});let u=s.get(r);u.keyframes[i]=o;let{type:d,...f}=t;u.transition[i]={...f,duration:p,ease:l,times:c,...n}}}),s}function yx(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function bx(e,t){return t[e]||(t[e]=[]),t[e]}function xx(e){return Array.isArray(e)?e:[e]}function Sx(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var Cx=e=>typeof e==`number`,wx=e=>e.every(Cx);function Tx(e,t){return ym(e)||typeof e==`number`||typeof e==`string`&&!sx(t)}function Ex(e,t,n,r){let i=[];if(Tx(e,t))i.push(Jh(e,sx(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let a=cx(e,t,r),o=a.length;for(let e=0;e<o;e++){let r=a[e],s={...n};`delay`in s&&typeof s.delay==`function`&&(s.delay=s.delay(e,o)),r instanceof Element?i.push(...Wh(r,t,s,I_.get(r))):i.push(...Um(Vm(r)??Gh,r,t,s))}}return i}function Dx(e,t,n,r){let i=[];return vx(e.map(e=>{if(Array.isArray(e)&&typeof e[0]==`function`){let t=e[0],n=Xp(0);return n.on(`change`,t),e.length===1?[n,[0,1]]:e.length===2?[n,[0,1],e[1]]:[n,e[1],e[2]]}return e}),t,n,{spring:Ad},r).forEach(({keyframes:e,transition:t},n)=>{i.push(...Ex(n,e,t))}),i}var Ox=0;function kx(e,t){let n=[...e],r=typeof n[0]==`function`?Math.max(1,n.length-1):2;return n[r]={...n[r],at:t},n}var Ax=(e,t)=>t===void 0?e:{name:e,at:t};function jx(e){e.pause(),e.time=0,e.stop()}var Mx=class e{constructor(e=[],t={},n){this.options=t,this.entries=[],this.repeatIndex=0,this.prevTime=0,this.markers=[],this.labels=/* @__PURE__ */ new Map,this.totalDuration=0,this.isDirty=!1,this.isDone=!1,this.isRebuilding=!1,this.playbackSpeed=1,this.isWrapped=!1,this.stop=()=>{this.flush(),this.group?.stop()},this.isPaused=t.autoplay===!1,this.newFinished(),e.forEach(e=>this.add(e)),n?(this.isDirty=!1,this.isWrapped=!0,this.group=new Wp(n),this.watch()):(this.invalidate(),this.flush());let{scope:r}=t;r&&(r.animations.push(this),this.finished.then(()=>$c(r.animations,this)))}add(t,n){return t instanceof e&&t.adopt(this),this.push({item:t,at:n})}call(e,t){return this.push({item:e,at:t,marker:{name:`_m`+Ox++,time:0,callback:e}})}addPause(e,t){return this.push({item:t||{},at:e,marker:{name:`_m`+Ox++,time:0,callback:t,pause:!0}})}move(e,t){return this.entries.forEach(n=>{n.item===e&&(n.at=t)}),this.invalidate()}remove(t){return t instanceof e&&(t.parent=void 0),this.entries=this.entries.filter(e=>e.item!==t),this.invalidate()}clear(){return this.entries=[],this.invalidate()}getLabelTime(e){return this.flush(),this.labels.get(e)}seek(e){return this.time=this.resolve(e),this}playTo(e){let t=this.resolve(e),n=Math.abs(this.speed);return this.speed=t<this.time?-n:n,this.stopAt=t,this.clock||this.invalidate(),this.play(),this}reverse(){return this.speed=-this.speed,this.play(),this}get progress(){return this.duration?this.time/this.duration:0}set progress(e){this.time=e*this.duration}get time(){return this.active()?.time??0}set time(e){this.flush(),this.prevTime=e,this.group&&(this.group.time=e),this.repeatIndex=this.currentRepeat()}get speed(){return this.playbackSpeed}set speed(e){this.playbackSpeed=e,this.group&&(this.group.speed=e)}get duration(){return this.flush(),this.isWrapped?this.group.duration:this.totalDuration}get iterationDuration(){return this.flush(),this.isWrapped?this.group.iterationDuration:this.totalDuration}get state(){return this.active()?.state??`idle`}get startTime(){return this.active()?.startTime??null}play(){this.flush(),this.isPaused=!1,this.group?.play(),this.isDone&&(this.newFinished(),this.watch())}pause(){this.flush(),this.isPaused=!0,this.group?.pause()}cancel(){this.flush(),this.group?.cancel()}complete(){this.flush(),this.group?.complete()}attachTimeline(e){return this.flush(),this.scrollTimeline=e,this.detachScroll=this.group?.attachTimeline(e),()=>{this.scrollTimeline=void 0,this.detachScroll?.()}}then(e,t){return this.finished.then(e,t)}active(){return this.flush(),this.group?.animations.length?this.group:void 0}push(e){return this.entries.push(e),this.invalidate()}invalidate(){return this.parent?this.parent.invalidate():this.isDirty||(this.isDirty=!0,queueMicrotask(()=>this.flush())),this}flush(){this.isDirty&&!this.parent&&this.build()}adopt(e){this.group&&=(jx(this.group),void 0),this.isDirty=!1,this.parent=e}build(){this.isDirty=!1,this.isWrapped=!1;let e=this.group,t=0;e&&(this.isRebuilding=!0,this.scrollTimeline?(this.detachScroll?.(),e.cancel()):(t=e.animations.length?e.time:0,jx(e)),this.isRebuilding=!1);let{defaultTransition:n,onComplete:r,onUpdate:i,onRepeat:a,onReverseComplete:o,autoplay:s,scope:c,...l}=this.options,u={};c?.reduceMotion!==void 0&&(u.reduceMotion=c.reduceMotion),c?.skipAnimations!==void 0&&(u.skipAnimations=c.skipAnimations),Object.assign(u,l);let d=/* @__PURE__ */ new Map,f={},p=Dx(this.toSequence(d),{defaultTransition:n,...u},c,f),m=f.labels,h=u.duration??f.duration,g=f.duration?h/f.duration:1;if(m.forEach((e,t)=>m.set(t,e*g)),this.markers=[],d.forEach((e,t)=>{e.time=m.get(t),m.delete(t),h=Math.max(h,e.time),this.markers.push(e)}),this.markers.sort((e,t)=>e.time-t.time),this.labels=m,this.totalDuration=h,this.clock=this.clockAnimation=void 0,this.markers.length||this.stopAt!==void 0||i||a){let e=this.clock=Xp(0);e.on(`change`,t=>e===this.clock&&this.onClock(t)),p.unshift(this.clockAnimation=Jh(e,[0,h],{...u,duration:h,ease:`linear`}))}let _=this.group=new Wp(p);t=Math.min(t,h),this.isDone&&t<h&&this.newFinished(),this.scrollTimeline?this.detachScroll=_.attachTimeline(this.scrollTimeline):(_.speed=this.playbackSpeed,this.isPaused&&_.pause(),t&&(_.time=t)),this.repeatIndex=this.currentRepeat(),this.prevTime=t||-1,this.watch()}toSequence(t){return this.entries.map(({item:n,at:r,marker:i})=>i?(t.set(i.name,i),Ax(i.name,r)):n instanceof e?{sequence:n.toSequence(t),at:r}:typeof n==`string`?Ax(n,r):r===void 0?n:Array.isArray(n)?kx(n,r):{...n,at:r})}resolve(e){return this.flush(),typeof e==`number`?e:ux(e,this.labels)??this.time}currentRepeat(){let{repeat:e=0,repeatDelay:t=0,delay:n=0}=this.options,r=this.totalDuration+t,i=(this.clockAnimation?.time??0)-n;return r&&i>0?Math.min(e,Math.floor(i/r)):0}onClock(e){let t=this.prevTime;if(this.prevTime=e,this.isRebuilding)return;let{onUpdate:n,onRepeat:r,repeatType:i=`loop`}=this.options;n?.(e);let a=this.currentRepeat();if(a!==this.repeatIndex&&(this.repeatIndex=a,r?.(),i===`loop`)){let e=this.speed>0;if(this.cross(t,e?this.totalDuration:0))return;t=e?-1:1/0}this.cross(t,e)}cross(e,t){if(e===t)return;let n=t>e,r=r=>n?r>e&&r<=t:r<e&&r>=t,i=n?this.markers:[...this.markers].reverse();for(let e of i)if(r(e.time)&&(e.callback?.(n?1:-1),e.pause))return this.pauseAt(e.time);if(this.stopAt!==void 0&&r(this.stopAt))return this.pauseAt(this.stopAt),this.stopAt=void 0,!0}pauseAt(e){return this.pause(),this.time=e,!0}watch(){let e=this.group;e.finished.then(()=>{if(e!==this.group||this.isDone)return;this.isDone=!0;let{onComplete:t,onReverseComplete:n}=this.options;(this.speed<0&&n||t)?.(),this.resolveFinished()})}newFinished(){this.isDone=!1,this.finished=new Promise(e=>{this.resolveFinished=e})}};function Nx(e){return Array.isArray(e)&&e.some(Array.isArray)}function Px(e={}){let{scope:t,reduceMotion:n,skipAnimations:r}=e;function i(e,i,a){let o=qm.current,s=o?.transition,c={};n!==void 0&&(c.reduceMotion=n),r!==void 0&&(c.skipAnimations=r);let l;if(Nx(e)){let n={...c,...i,scope:t};s&&(n.defaultTransition={...s,...n.defaultTransition}),l=new Mx(e,n)}else{let{onComplete:n,...r}=a||{},o={...c,...s,...r},{onUpdate:u}=r;l=new Mx([typeof e==`number`||typeof e==`string`&&(typeof i==`string`||Array.isArray(i))?[u||(()=>{}),Array.isArray(i)?i:[e,i],{...o,onUpdate:void 0}]:[e,i,o]],{...c,onComplete:n,scope:t},Ex(e,i,o,t))}return o&&l.finished.then(o.add(()=>l.stop())),l}return i}var Fx=/* @__PURE__ */ Object.assign(/* @__PURE__ */ Px(),{addEffect:zm,removeEffect:Bm}),Ix=ax;function Lx(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var Rx=e=>{switch(e){case`success`:return Vx;case`info`:return Ux;case`warning`:return Hx;case`error`:return Wx;default:return null}},zx=Array(12).fill(0),Bx=({visible:e,className:t})=>/*#__PURE__*/ B.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},/*#__PURE__*/ B.createElement(`div`,{className:`sonner-spinner`},zx.map((e,t)=>/*#__PURE__*/ B.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),Vx=/*#__PURE__*/ B.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},/*#__PURE__*/ B.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`})),Hx=/*#__PURE__*/ B.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},/*#__PURE__*/ B.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`})),Ux=/*#__PURE__*/ B.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},/*#__PURE__*/ B.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`})),Wx=/*#__PURE__*/ B.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},/*#__PURE__*/ B.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`})),Gx=/*#__PURE__*/ B.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`,"aria-hidden":`true`},/*#__PURE__*/ B.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),/*#__PURE__*/ B.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),Kx=()=>{let[e,t]=B.useState(document.hidden);return B.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]),e},qx=1,Jx=100,Yx=e=>typeof e?.id==`number`||e?.id?.length>0?e.id:qx++,Xx=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),this.getActiveToasts().forEach(t=>e(t)),()=>{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.trimHistory()},this.trimHistory=()=>{let e=this.toasts.length-Jx;e<=0||(this.toasts=this.toasts.filter(t=>e>0&&this.dismissedToasts.has(t.id)?(this.dismissedToasts.delete(t.id),e--,!1):!0))},this.create=e=>{let{message:t,...n}=e,r=Yx(e),i=this.pendingDismissals.get(r);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(r),this.dismissedToasts.delete(r));let a=this.dismissedToasts.has(r),o=e.dismissible===void 0||e.dismissible;return a&&(this.dismissedToasts.delete(r),this.toasts=this.toasts.filter(e=>e.id!==r)),!a&&this.toasts.find(e=>e.id===r)?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:o,title:t}):n):this.addToast({title:t,...n,dismissible:o,id:r}),r},this.dismiss=e=>{if(e==null)return this.getActiveToasts().forEach(e=>{this.dismissedToasts.add(e.id),this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e;this.dismissedToasts.add(e);let t=this.pendingDismissals.get(e);return t!==void 0&&cancelAnimationFrame(t),this.pendingDismissals.set(e,requestAnimationFrame(()=>{this.pendingDismissals.delete(e),this.subscribers.forEach(t=>t({id:e,dismiss:!0}))})),e},this.message=(e,t)=>this.create({...t,message:e,type:void 0}),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 n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],B.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(Qx(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!B.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!B.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!B.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!B.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=Yx(t);return this.create({...t,jsx:e(n),id:n,type:void 0}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=/* @__PURE__ */ new Set,this.pendingDismissals=/* @__PURE__ */ new Map}},Zx=(e,t)=>Xx.message(e,t),Qx=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,$x=Object.assign(Zx,{success:Xx.success,info:Xx.info,warning:Xx.warning,error:Xx.error,custom:Xx.custom,message:Xx.message,promise:Xx.promise,dismiss:Xx.dismiss,loading:Xx.loading},{getHistory:()=>Xx.toasts,getToasts:()=>Xx.getActiveToasts()});Lx(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function eS(e){return e.label!==void 0}var tS=3,nS=`24px`,rS=`16px`,iS=4e3,aS=356,oS=14,sS=45,cS=200;function lS(...e){return e.filter(Boolean).join(` `)}function uS(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var dS=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:_=``,descriptionClassName:v=``,duration:y,position:b,gap:x,expandByDefault:S,classNames:C,icons:w,closeButtonAriaLabel:T=`Close toast`}=e,[E,D]=B.useState(null),[O,k]=B.useState(null),[A,j]=B.useState(!1),[M,N]=B.useState(!1),[P,F]=B.useState(!1),[I,ee]=B.useState(!1),[te,ne]=B.useState(!1),[re,ie]=B.useState(0),[ae,oe]=B.useState(0),se=B.useRef(n.duration||y||iS),ce=B.useRef(null),le=B.useRef(null),ue=c===0,de=c+1<=o,fe=n.type,pe=fe??`default`,L=n.dismissible!==!1,R=n.className||``,me=n.descriptionClassName||``,he=B.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),ge=B.useMemo(()=>n.closeButton??p,[n.closeButton,p]),_e=B.useMemo(()=>n.duration||y||iS,[n.duration,y]),ve=B.useRef(0),z=B.useRef(0),ye=B.useRef(0),be=B.useRef(null),[xe,Se]=b.split(`-`),V=B.useMemo(()=>s.reduce((e,t,n)=>n>=he?e:e+t.height,0),[s,he]),Ce=Kx(),we=B.useMemo(()=>e.swipeDirections??uS(b),[e.swipeDirections,b]),Te=n.invert||t,Ee=fe===`loading`;z.current=B.useMemo(()=>he*x+V,[he,V]),B.useEffect(()=>{se.current=_e},[_e]),B.useEffect(()=>{j(!0)},[]),B.useEffect(()=>{let e=le.current;if(e){let t=e.getBoundingClientRect().height;return oe(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),B.useLayoutEffect(()=>{if(!A)return;let e=le.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,oe(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[A,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let De=B.useCallback(()=>{N(!0),ie(z.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},cS)},[n,d,a,z]);B.useEffect(()=>{if(n.promise&&fe===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||Ce?(()=>{if(ye.current<ve.current){let e=(/* @__PURE__ */ new Date()).getTime()-ve.current;se.current-=e}ye.current=(/* @__PURE__ */ new Date()).getTime()})():se.current!==1/0&&(ve.current=(/* @__PURE__ */ new Date()).getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),De()},se.current)),()=>clearTimeout(e)},[u,i,n,fe,Ce,De]),B.useEffect(()=>{n.delete&&(De(),n.onDismiss==null||n.onDismiss.call(n,n))},[De,n.delete]);function Oe(){return w?.loading?/*#__PURE__*/ B.createElement(`div`,{className:lS(C?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":fe===`loading`},w.loading):/*#__PURE__*/ B.createElement(Bx,{className:lS(C?.loader,n?.classNames?.loader),visible:fe===`loading`})}let ke=n.icon||w?.[fe]||Rx(fe);return/*#__PURE__*/ B.createElement(`li`,{tabIndex:0,ref:le,className:lS(_,R,C?.toast,n?.classNames?.toast,C?.[pe],n?.classNames?.[pe]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":A,"data-promise":!!n.promise,"data-swiped":te,"data-removed":M,"data-visible":de,"data-y-position":xe,"data-x-position":Se,"data-index":c,"data-front":ue,"data-swiping":P,"data-dismissible":L,"data-type":fe,"data-invert":Te,"data-swipe-out":I,"data-swipe-direction":O,"data-expanded":!!(u||S&&A),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${M?re:z.current}px`,"--initial-height":S?`auto`:`${ae}px`,...m,...n.style},onDragEnd:()=>{F(!1),D(null),be.current=null},onPointerDown:e=>{e.button!==2&&!Ee&&L&&(ce.current=/* @__PURE__ */ new Date,ie(z.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(F(!0),be.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{if(I||!L)return;be.current=null;let e=Number(le.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(le.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=(/* @__PURE__ */ new Date()).getTime()-ce.current?.getTime(),i=E===`x`?e:t,a=Math.abs(i)/r;if((E===`x`?we.includes(e>0?`right`:`left`):we.includes(t>0?`bottom`:`top`))&&(Math.abs(i)>=sS||a>.11))ie(z.current),n.onDismiss==null||n.onDismiss.call(n,n),k(E===`x`?e>0?`right`:`left`:t>0?`down`:`up`),De(),ee(!0);else{var o,s;(o=le.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=le.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`),ne(!1),F(!1),D(null)}},onPointerMove:e=>{var t,n;if(!be.current||!L||window.getSelection()?.toString().length>0)return;let r=e.clientY-be.current.y,i=e.clientX-be.current.x;!E&&(Math.abs(i)>1||Math.abs(r)>1)&&D(Math.abs(i)>Math.abs(r)?`x`:`y`);let a={x:0,y:0},o=e=>1/(1.5+Math.abs(e)/20);if(E===`y`){if(we.includes(`top`)||we.includes(`bottom`)){if(we.includes(`top`)&&r<0||we.includes(`bottom`)&&r>0)a.y=r;else{let e=r*o(r);a.y=Math.abs(e)<Math.abs(r)?e:r}}}else if(E===`x`&&(we.includes(`left`)||we.includes(`right`))){if(we.includes(`left`)&&i<0||we.includes(`right`)&&i>0)a.x=i;else{let e=i*o(i);a.x=Math.abs(e)<Math.abs(i)?e:i}}(Math.abs(a.x)>0||Math.abs(a.y)>0)&&ne(!0),(t=le.current)==null||t.style.setProperty(`--swipe-amount-x`,`${a.x}px`),(n=le.current)==null||n.style.setProperty(`--swipe-amount-y`,`${a.y}px`)}},ge&&!n.jsx&&fe!==`loading`?/*#__PURE__*/ B.createElement(`button`,{"aria-label":T,"data-disabled":Ee,"data-close-button":!0,onClick:Ee||!L?()=>{}:()=>{De(),n.onDismiss==null||n.onDismiss.call(n,n)},className:lS(C?.closeButton,n?.classNames?.closeButton)},w?.close??Gx):null,(fe||n.icon||n.promise)&&n.icon!==null&&(w?.[fe]!==null||n.icon)?/*#__PURE__*/ B.createElement(`div`,{"data-icon":``,className:lS(C?.icon,n?.classNames?.icon)},fe===`loading`?n.icon||Oe():n.promise?Oe():null,fe===`loading`?null:ke):null,/*#__PURE__*/ B.createElement(`div`,{"data-content":``,className:lS(C?.content,n?.classNames?.content)},/*#__PURE__*/ B.createElement(`div`,{"data-title":``,className:lS(C?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?/*#__PURE__*/ B.createElement(`div`,{"data-description":``,className:lS(v,me,C?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),/*#__PURE__*/ B.isValidElement(n.cancel)?n.cancel:n.cancel&&eS(n.cancel)?/*#__PURE__*/ B.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{eS(n.cancel)&&L&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),De())},className:lS(C?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,/*#__PURE__*/ B.isValidElement(n.action)?n.action:n.action&&eS(n.action)?/*#__PURE__*/ B.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{eS(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&De())},className:lS(C?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function fS(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function pS(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?rS:nS;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var mS=/*#__PURE__*/ B.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:f,duration:p,style:m,visibleToasts:h=tS,toastOptions:g,dir:_=fS(),gap:v=oS,icons:y,customAriaLabel:b,containerAriaLabel:x=`Notifications`}=e,[S,C]=B.useState([]),w=B.useMemo(()=>n?S.filter(e=>e.toasterId===n):S.filter(e=>!e.toasterId),[S,n]),T=B.useMemo(()=>Array.from(new Set([i].concat(w.filter(e=>e.position).map(e=>e.position)))),[w,i]),[E,D]=B.useState([]),[O,k]=B.useState(!1),[A,j]=B.useState(!1),[M,N]=B.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),P=B.useRef(null),F=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),I=B.useRef(null),ee=B.useRef(!1),te=B.useCallback(e=>{C(t=>(t.find(t=>t.id===e.id)?.delete||Xx.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return B.useEffect(()=>Xx.subscribe(e=>{e.dismiss?requestAnimationFrame(()=>{C(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))}):setTimeout(()=>{hn.flushSync(()=>{C(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[]),B.useEffect(()=>{if(d!==`system`){N(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?N(`dark`):N(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{N(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{N(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),B.useEffect(()=>{S.length<=1&&k(!1)},[S]),B.useEffect(()=>{let e=e=>{if(a.length>0&&a.every(t=>e[t]||e.code===t)){var t;k(!0),(t=P.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===P.current||P.current?.contains(document.activeElement))&&k(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),B.useEffect(()=>{if(P.current)return()=>{I.current&&(I.current.focus({preventScroll:!0}),I.current=null,ee.current=!1)}},[P.current]),/*#__PURE__*/ B.createElement(`section`,{ref:t,"aria-label":b??`${x} ${F}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},T.map((t,n)=>{let[i,a]=t.split(`-`);return w.length?/*#__PURE__*/ B.createElement(`ol`,{key:t,dir:_===`auto`?fS():_,tabIndex:-1,ref:P,className:c,"data-sonner-toaster":!0,"data-sonner-theme":M,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${E[0]?.height||0}px`,"--width":`${aS}px`,"--gap":`${v}px`,...m,...pS(l,u)},onBlur:e=>{ee.current&&!e.currentTarget.contains(e.relatedTarget)&&(ee.current=!1,I.current&&=(I.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||ee.current||(ee.current=!0,I.current=e.relatedTarget)},onMouseEnter:()=>k(!0),onMouseMove:()=>k(!0),onMouseLeave:()=>{A||k(!1)},onDragEnd:()=>k(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||j(!0)},onPointerUp:()=>j(!1)},w.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>/*#__PURE__*/ B.createElement(dS,{key:n.id,icons:y,index:i,toast:n,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:A,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:te,toasts:w.filter(e=>e.position==n.position),heights:E.filter(e=>e.position==n.position),setHeights:D,expandByDefault:o,gap:v,expanded:O,swipeDirections:e.swipeDirections}))):null}))}),hS=/* @__PURE__ */ new Map([[`avif`,`image/avif`],[`bmp`,`image/bmp`],[`css`,`text/css`],[`csv`,`text/csv`],[`doc`,`application/msword`],[`docx`,`application/vnd.openxmlformats-officedocument.wordprocessingml.document`],[`gif`,`image/gif`],[`gz`,`application/gzip`],[`htm`,`text/html`],[`html`,`text/html`],[`ico`,`image/x-icon`],[`jpeg`,`image/jpeg`],[`jpg`,`image/jpeg`],[`js`,`application/javascript`],[`json`,`application/json`],[`md`,`text/markdown`],[`mjs`,`application/javascript`],[`mp3`,`audio/mpeg`],[`mp4`,`video/mp4`],[`ogg`,`audio/ogg`],[`pdf`,`application/pdf`],[`png`,`image/png`],[`ppt`,`application/powerpoint`],[`pptx`,`application/vnd.openxmlformats-officedocument.presentationml.presentation`],[`svg`,`image/svg+xml`],[`tif`,`image/tiff`],[`tiff`,`image/tiff`],[`txt`,`text/plain`],[`wasm`,`application/wasm`],[`wav`,`audio/x-wav`],[`weba`,`audio/webm`],[`webm`,`video/webm`],[`webp`,`image/webp`],[`xls`,`application/vnd.ms-excel`],[`xlsx`,`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`],[`xml`,`application/xml`],[`zip`,`application/zip`]]),gS=class extends Error{constructor(e){super(`DataTransferItem is not a file`),this.item=e,this.name=`UnexpectedObjectError`}};function _S(e,t,n){let r=e,{webkitRelativePath:i}=e,a=typeof t==`string`?t:typeof i==`string`&&i.length>0?i:`./${e.name}`;return typeof r.path!=`string`&&yS(r,`path`,a),n!==void 0&&Object.defineProperty(r,"handle",{value:n,writable:!1,configurable:!1,enumerable:!0}),yS(r,`relativePath`,a),r}function vS(e,t=hS){let{name:n}=e;if(n&&n.lastIndexOf(`.`)!==-1&&!e.type){let r=n.split(`.`).pop().toLowerCase(),i=t.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}function yS(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}var bS=[`.DS_Store`,`Thumbs.db`];async function xS(e,{mimeTypes:t=hS}={}){return(await SS(e)).map(e=>e instanceof File?vS(e,t):e)}async function SS(e){return ES(e)&&CS(e.dataTransfer)?kS(e.dataTransfer,e.type):wS(e)?AS(e.clipboardData):TS(e)?DS(e):Array.isArray(e)&&e.every(e=>`getFile`in e&&typeof e.getFile==`function`)?OS(e):[]}function CS(e){return ES(e)}function wS(e){return ES(e)&&CS(e.clipboardData)}function TS(e){return ES(e)&&ES(e.target)}function ES(e){return typeof e==`object`&&!!e}function DS(e){return MS(e.target.files).map(e=>_S(e))}async function OS(e){return(await Promise.all(e.map(e=>e.getFile()))).map(e=>_S(e))}async function kS(e,t){let n=MS(e.items).filter(e=>e.kind===`file`);return t===`drop`?jS(PS(await Promise.all(n.map(NS)))):n}function AS(e){let t=MS(e.items).filter(e=>e.kind===`file`).map(e=>e.getAsFile()).filter(e=>e!==null);return jS((t.length>0?t:MS(e.files)).map(e=>_S(e)))}function jS(e){return e.filter(e=>bS.indexOf(e.name)===-1)}function MS(e){return e===null?[]:Array.from(e)}async function NS(e){if(typeof e.webkitGetAsEntry!=`function`)return FS(e);let t=e.webkitGetAsEntry();if(t?.isDirectory){let n=await IS(e);return n?.kind===`directory`?LS(n,`/${n.name}`):zS(t)}return FS(e,t)}function PS(e){let t=[];for(let n of e)Array.isArray(n)?t.push(...PS(n)):t.push(n);return t}async function FS(e,t){let n=e.getAsFile(),r=await IS(e);if(r!=null){let e=n??await r.getFile();return e.handle=r,_S(e)}if(!n)throw new gS(e);return _S(n,t?.fullPath??void 0)}async function IS(e){if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle==`function`)return e.getAsFileSystemHandle()}async function LS(e,t){let n=[];for await(let r of e.values()){let e=`${t}/${r.name}`;if(r.kind===`directory`)n.push(...await LS(r,e));else{let t=await r.getFile();n.push(_S(t,e,r))}}return n}async function RS(e){return e.isDirectory?zS(e):BS(e)}function zS(e){let t=e.createReader();return new Promise((e,n)=>{let r=[];function i(){t.readEntries(async t=>{if(t.length){let e=Promise.all(t.map(RS));r.push(e),i()}else try{e(await Promise.all(r))}catch(e){n(e)}},e=>{n(e)})}i()})}async function BS(e){return new Promise((t,n)=>{e.file(n=>{t(_S(n,e.fullPath))},e=>{n(e)})})}function VS(e,t){if(e&&t){let n=(Array.isArray(t)?t:t.split(`,`)).filter(e=>e.trim()!==``);if(n.length===0)return!0;let r=e.name||``,i=(e.type||``).toLowerCase(),a=i.replace(/\/.*$/,``);return n.some(e=>{let t=e.trim().toLowerCase();return t.charAt(0)===`.`?r.toLowerCase().endsWith(t):t.endsWith(`/*`)?a===t.replace(/\/.*$/,``):i===t})}return!0}var HS=typeof VS==`function`?VS:VS.default,US=`file-invalid-type`,WS=`file-too-large`,GS=`file-too-small`,KS=`too-many-files`;function qS(e=``){let t=e.split(`,`);return{code:US,message:`File type must be ${t.length>1?`one of ${t.join(`, `)}`:t[0]}`}}var JS=[`KB`,`MB`,`GB`,`TB`,`PB`];function YS(e){if(e<1024)return`${e} ${e===1?`byte`:`bytes`}`;let t=e/1024,n=0;for(;t>=1024&&n<JS.length-1;)t/=1024,n++;return`${Number(t.toFixed(2))} ${JS[n]}`}function XS(e){return{code:WS,message:`File is larger than ${YS(e)}`}}function ZS(e){return{code:GS,message:`File is smaller than ${YS(e)}`}}var QS={code:KS,message:`Too many files`};function $S(e){return e.type===``&&typeof e.getAsFile==`function`}function eC(e,t){let n=e.type===`application/x-moz-file`||HS(e,t??``)||$S(e);return[n,n?null:qS(t)]}function tC(e,t,n){if(nC(e.size)){if(nC(t)&&nC(n)){if(e.size>n)return[!1,XS(n)];if(e.size<t)return[!1,ZS(t)]}else if(nC(t)&&e.size<t)return[!1,ZS(t)];else if(nC(n)&&e.size>n)return[!1,XS(n)]}return[!0,null]}function nC(e){return e!=null}function rC(e){return e!=null&&typeof e.then==`function`}function iC({files:e,accept:t,minSize:n,maxSize:r,multiple:i,maxFiles:a=0,validator:o,getErrorMessage:s}){let c=[],l=[],u=(e,t)=>s&&typeof File<`u`&&t instanceof File?{...e,message:s(e,t)}:e;e.forEach(e=>{let[i,a]=eC(e,t),[o,s]=tC(e,n,r);i&&o?c.push(e):l.push({file:e,errors:[a,s].filter(e=>e!=null).map(t=>u(t,e))})});let d=i?a>=1?a:1/0:1;return c.length>d&&c.slice(d).forEach(e=>{l.push({file:e,errors:[u(QS,e)]})}),l.length>0?{verdict:`reject`,rejections:l}:{verdict:o?`unknown`:`accept`,rejections:l}}function aC(e){return typeof e.isPropagationStopped==`function`?e.isPropagationStopped():e.cancelBubble!==void 0&&e.cancelBubble}function oC(e){let t=e.dataTransfer??e.clipboardData;return t?Array.prototype.some.call(t.types,e=>e===`Files`||e===`application/x-moz-file`)||Array.prototype.some.call(t.items??[],sC):!!e.target&&!!e.target.files}function sC(e){return typeof e==`object`&&!!e&&e.kind===`file`}function cC(e){e.preventDefault()}function lC(e){return e.indexOf(`MSIE`)!==-1||e.indexOf(`Trident/`)!==-1}function uC(e){return e.indexOf(`Edge/`)!==-1}function dC(e=window.navigator.userAgent){return lC(e)||uC(e)}function fC(...e){return(t,...n)=>e.some(e=>(!aC(t)&&e&&e(t,...n),aC(t)))}function pC(){return`showOpenFilePicker`in window}function mC(e){return Array.isArray(e)?e:typeof e==`string`?[e]:[]}function hC(e){if(nC(e))return Array.isArray(e)?e.filter(e=>nC(e)&&nC(e.accept)):[{accept:e}]}function gC(e){let t=[],n=Object.keys(e);for(let n of Object.values(e))for(let e of mC(n))t.includes(e)||t.push(e);return t.length>0?t.join(`, `):n.length>0?n.join(`, `):`Files`}function _C(e){let t=hC(e);if(!nC(t))return;let n={};for(let e of t)for(let[t,r]of Object.entries(e.accept)){let e=n[t]??(n[t]=[]);for(let t of mC(r))e.includes(t)||e.push(t)}return n}function vC(e){let t=hC(e);if(!nC(t))return;let n=t.map(e=>{let t=Object.entries(e.accept).filter(([e,t])=>{let n=!0;return CC(e)||(console.warn(`Skipped "${e}" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.`),n=!1),(Array.isArray(t)||typeof t==`string`)&&mC(t).every(TC)||(console.warn(`Skipped "${e}" because an invalid file extension was provided.`),n=!1),n}).reduce((e,[t,n])=>(e[t]=mC(n),e),{});return{description:nC(e.description)&&e.description!==``?e.description:gC(t),accept:t}}).filter(e=>Object.keys(e.accept).length>0);return n.length>0?n:void 0}function yC(e,{omitWildcardMimeTypesWithExtensions:t=!1}={}){if(nC(e))return Object.entries(e).reduce((e,[n,r])=>{let i=mC(r);return t&&wC(n)&&i.some(TC)?e.push(...i):e.push(n,...i),e},[]).filter(e=>CC(e)||TC(e)).join(`,`)}function bC(e){return e instanceof DOMException&&(e.name===`AbortError`||e.code===e.ABORT_ERR)}function xC(e){return e instanceof DOMException&&(e.name===`SecurityError`||e.code===e.SECURITY_ERR)}function SC(e){return e instanceof DOMException&&e.name===`NotAllowedError`}function CC(e){return e===`audio/*`||e===`video/*`||e===`image/*`||e===`text/*`||e===`application/*`||/\w+\/[-+.\w]+/g.test(e)}function wC(e){return e.endsWith(`/*`)}function TC(e){return/^.*\.[\w]+$/.test(e)}var EC=(0,B.forwardRef)(({children:e,...t},n)=>{let{open:r,...i}=OC(t);return(0,B.useImperativeHandle)(n,()=>({open:r}),[r]),/* @__PURE__ */ (0,V.jsx)(V.Fragment,{children:e?.({...i,open:r})})});EC.displayName=`Dropzone`;var DC={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,isDragUnknown:!1,isDragGlobal:!1,isProcessing:!1,acceptedFiles:[],fileRejections:[],dragFileRejections:[]};function OC(e={}){let{accept:t,disabled:n=!1,getFilesFromEvent:r=xS,maxSize:i=1/0,minSize:a=0,multiple:o=!0,maxFiles:s=0,onDragEnter:c,onDragLeave:l,onDragOver:u,onDrop:d,onDropAccepted:f,onDropRejected:p,onFileDialogCancel:m,onFileDialogOpen:h,useFsAccessApi:g=!1,autoFocus:_=!1,preventDropOnDocument:v=!0,noClick:y=!1,noKeyboard:b=!1,noDrag:x=!1,noDragEventsBubbling:S=!1,noPaste:C=!1,onError:w,validator:T,getErrorMessage:E}=e,D=(0,B.useMemo)(()=>_C(t),[t]),O=(0,B.useMemo)(()=>yC(D),[D]),k=(0,B.useMemo)(()=>yC(D,{omitWildcardMimeTypesWithExtensions:!0}),[D]),A=(0,B.useMemo)(()=>vC(t),[t]),j=(0,B.useMemo)(()=>typeof h==`function`?h:AC,[h]),M=(0,B.useMemo)(()=>typeof m==`function`?m:AC,[m]),N=(0,B.useRef)(null),P=(0,B.useRef)(null),[F,I]=(0,B.useReducer)(kC,DC),{isFocused:ee,isFileDialogActive:te}=F,ne=(0,B.useRef)(te);ne.current=te;let re=(0,B.useRef)(null),ie=(0,B.useCallback)(()=>{re.current?.abort();let e=new AbortController;return re.current=e,I({type:`setProcessing`,isProcessing:!0}),e.signal},[]),ae=(0,B.useCallback)(e=>{e.aborted||I({type:`setProcessing`,isProcessing:!1})},[]);(0,B.useEffect)(()=>()=>re.current?.abort(),[]);let oe=(0,B.useRef)(typeof window<`u`&&window.isSecureContext&&g&&pC()),se=()=>{!oe.current&&te&&setTimeout(()=>{if(P.current){let{files:e}=P.current;e?.length||(I({type:`closeDialog`}),M())}},300)};(0,B.useEffect)(()=>(window.addEventListener(`focus`,se,!1),()=>{window.removeEventListener(`focus`,se,!1)}),[P,te,M,oe]);let ce=(0,B.useRef)([]),le=(0,B.useRef)([]),ue=e=>{N.current&&e.target&&N.current.contains(e.target)&&e.defaultPrevented||(e.preventDefault(),ce.current=[])};(0,B.useEffect)(()=>(v&&(document.addEventListener(`dragover`,cC,!1),document.addEventListener(`drop`,ue,!1)),()=>{v&&(document.removeEventListener(`dragover`,cC),document.removeEventListener(`drop`,ue))}),[N,v]),(0,B.useEffect)(()=>{let e=e=>{e.target&&(le.current=[...le.current,e.target]),oC(e)&&I({isDragGlobal:!0,type:`setDragGlobal`})},t=e=>{le.current=le.current.filter(t=>t!==e.target&&t!==null),!(le.current.length>0)&&I({isDragGlobal:!1,type:`setDragGlobal`})},n=()=>{le.current=[],I({isDragGlobal:!1,type:`setDragGlobal`})},r=()=>{le.current=[],I({isDragGlobal:!1,type:`setDragGlobal`})};return document.addEventListener(`dragenter`,e,!1),document.addEventListener(`dragleave`,t,!1),document.addEventListener(`dragend`,n,!1),document.addEventListener(`drop`,r,!1),()=>{document.removeEventListener(`dragenter`,e),document.removeEventListener(`dragleave`,t),document.removeEventListener(`dragend`,n),document.removeEventListener(`drop`,r)}},[N]),(0,B.useEffect)(()=>(!n&&_&&N.current&&N.current.focus(),()=>{}),[N,_,n]);let de=(0,B.useCallback)(e=>{w?w(e):console.error(e)},[w]),fe=(0,B.useCallback)(e=>{e.preventDefault(),e.persist?.(),Ce(e),!ne.current&&(ce.current=[...ce.current,e.target],oC(e)&&Promise.resolve(r(e)).then(t=>{if(aC(e)&&!S)return;let n=t.length>0?iC({files:t,accept:O,minSize:a,maxSize:i,multiple:o,maxFiles:s,validator:T,getErrorMessage:E}):null;I({isDragAccept:n?.verdict===`accept`,isDragReject:n?.verdict===`reject`,isDragUnknown:n?.verdict===`unknown`,isDragActive:!0,dragFileRejections:n?.rejections??[],type:`setDraggedFiles`}),c&&c(e)}).catch(e=>de(e)))},[r,c,de,S,O,a,i,o,s,T,E]),pe=(0,B.useCallback)(e=>{if(e.preventDefault(),e.persist?.(),Ce(e),ne.current)return!1;let t=oC(e);if(t&&e.dataTransfer)try{e.dataTransfer.dropEffect=`copy`}catch{}return t&&u&&u(e),!1},[u,S]),L=(0,B.useCallback)(e=>{e.preventDefault(),e.persist?.(),Ce(e);let t=ce.current.filter(e=>N.current?.contains(e)),n=t.indexOf(e.target);n!==-1&&t.splice(n,1),ce.current=t,!(t.length>0)&&(I({type:`setDraggedFiles`,isDragActive:!1,isDragAccept:!1,isDragReject:!1,isDragUnknown:!1,dragFileRejections:[]}),oC(e)&&l&&l(e))},[N,l,S]),R=(0,B.useCallback)(async(e,t,n)=>{let r=(e,t)=>E?{...e,message:E(e,t)}:e,c=e=>{let n=[],i=[];e.forEach(({file:e,accepted:t,acceptError:a,sizeMatch:o,sizeError:s,customErrors:c})=>{let l=!c||Array.isArray(c)&&c.length===0;if(t&&o&&l)n.push(e);else{let t=[a,s];c&&(t=t.concat(c)),i.push({file:e,errors:t.filter(e=>e!=null).map(t=>r(t,e))})}});let a=o?s>=1?s:1/0:1;n.length>a&&n.splice(a).forEach(e=>{i.push({file:e,errors:[r(QS,e)]})}),I({acceptedFiles:n,fileRejections:i,type:`setFiles`}),d&&d(n,i,t),i.length>0&&p&&p(i,t),n.length>0&&f&&f(n,t)},l=e.map(e=>{let[t,n]=eC(e,k),[r,o]=tC(e,a,i);return{file:e,accepted:t,acceptError:n,sizeMatch:r,sizeError:o,customErrors:T?T(e):null}});if(!l.some(({customErrors:e})=>rC(e))){c(l);return}let u;try{u=await Promise.all(l.map(async({customErrors:e,...t})=>({...t,customErrors:await e})))}catch(e){n.aborted||(ae(n),de(e));return}n.aborted||c(u)},[I,o,k,a,i,s,d,f,p,T,E,de,ae]),me=(0,B.useCallback)(e=>{if(e.preventDefault(),e.persist?.(),Ce(e),ce.current=[],!(ne.current&&e.dataTransfer)&&(I({type:`reset`}),oC(e))){let t=ie();Promise.resolve(r(e)).then(n=>{if(!t.aborted){if(aC(e)&&!S)ae(t);else return R(n,e,t)}}).catch(e=>{t.aborted||(ae(t),de(e))})}},[r,R,de,S,ie,ae]),he=(0,B.useCallback)(e=>{if(!oC(e))return;e.preventDefault(),e.persist?.(),Ce(e);let t=ie();Promise.resolve(r(e)).then(n=>{if(!t.aborted){if(aC(e)&&!S)ae(t);else return R(n,e,t)}}).catch(e=>{t.aborted||(ae(t),de(e))})},[r,R,de,S,ie,ae]),ge=(0,B.useCallback)(()=>{if(oe.current){I({type:`openDialog`}),j();let e={multiple:o,types:A},t;window.showOpenFilePicker(e).then(e=>(t=ie(),r(e))).then(e=>{if(I({type:`closeDialog`}),!t.aborted)return R(e,null,t)}).catch(e=>{t&&ae(t),bC(e)?(M(e),I({type:`closeDialog`})):xC(e)||SC(e)?(oe.current=!1,P.current?(P.current.value=``,P.current.click()):de(/* @__PURE__ */ Error(`Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided.`))):de(e)})}else P.current&&(I({type:`openDialog`}),j(),P.current.value=``,P.current.click())},[I,j,M,g,R,de,A,o,ie,ae]),_e=(0,B.useCallback)(e=>{N.current?.isEqualNode(e.target)&&(e.key===` `||e.key===`Enter`||e.keyCode===32||e.keyCode===13)&&(e.preventDefault(),ge())},[N,ge]),ve=(0,B.useCallback)(()=>{I({type:`focus`})},[]),z=(0,B.useCallback)(()=>{I({type:`blur`})},[]),ye=(0,B.useCallback)(()=>{y||(dC()?setTimeout(ge,0):ge())},[y,ge]),be=e=>n?null:e,xe=e=>b?null:be(e),Se=e=>x?null:be(e),V=e=>C?null:be(e),Ce=e=>{S&&e.stopPropagation()},we=(0,B.useMemo)(()=>({refKey:e=`ref`,role:t,onKeyDown:r,onFocus:i,onBlur:a,onClick:o,onDragEnter:s,onDragOver:c,onDragLeave:l,onDrop:u,onPaste:d,...f}={})=>({onKeyDown:xe(fC(r,_e)),onFocus:xe(fC(i,ve)),onBlur:xe(fC(a,z)),onClick:be(fC(o,ye)),onDragEnter:Se(fC(s,fe)),onDragOver:Se(fC(c,pe)),onDragLeave:Se(fC(l,L)),onDrop:Se(fC(u,me)),onPaste:V(fC(d,he)),role:typeof t==`string`&&t!==``?t:`presentation`,[e]:N,...!n&&!b?{tabIndex:0}:{},...n?{"aria-disabled":!0}:{},...f}),[N,_e,ve,z,ye,fe,pe,L,me,he,b,x,C,n]),Te=(0,B.useCallback)(e=>{e.stopPropagation()},[]),Ee=(0,B.useMemo)(()=>({refKey:e=`ref`,onChange:t,onClick:n,...r}={})=>({accept:k,multiple:o,type:`file`,"aria-label":`file upload`,style:{border:0,display:`block`,height:0,margin:0,maxWidth:0,opacity:0,overflow:`hidden`,padding:0,width:0},onChange:be(fC(t,me)),onClick:be(fC(n,Te)),tabIndex:-1,[e]:P,...r}),[P,t,o,me,n]);return{...F,isFocused:ee&&!n,getRootProps:we,getInputProps:Ee,rootRef:N,inputRef:P,open:be(ge)}}function kC(e,t){switch(t.type){case`focus`:return{...e,isFocused:!0};case`blur`:return{...e,isFocused:!1};case`openDialog`:return{...DC,isFileDialogActive:!0};case`closeDialog`:return{...e,isFileDialogActive:!1};case`setDraggedFiles`:return{...e,isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject,isDragUnknown:t.isDragUnknown,dragFileRejections:t.dragFileRejections};case`setProcessing`:return{...e,isProcessing:t.isProcessing};case`setFiles`:return{...e,acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,dragFileRejections:[],isProcessing:!1,isDragReject:!1,isDragUnknown:!1};case`setDragGlobal`:return{...e,isDragGlobal:t.isDragGlobal};case`reset`:return{...DC};default:return e}}function AC(){}var jC={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};jC.node;var MC=k(jC),NC={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};NC.node;var PC=k(NC),FC={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};FC.node;var IC=k(FC),LC={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};LC.node;var RC=k(LC),zC={name:`chevrons-up-down`,size:24,node:[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]};zC.node;var BC=k(zC),VC={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]};VC.node;var HC=k(VC),UC={name:`clock`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]};UC.node;var WC=k(UC),GC={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};GC.node;var KC=k(GC),qC={name:`ellipsis-vertical`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]],aliases:[`more-vertical`]};qC.node;var JC=k(qC),YC={name:`eye-off`,size:24,node:[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};YC.node;var XC=k(YC),ZC={name:`eye`,size:24,node:[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};ZC.node;var QC=k(ZC),$C={name:`file-code-corner`,size:24,node:[[`path`,{d:`M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35`,key:`1wthlu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m5 16-3 3 3 3`,key:`331omg`}],[`path`,{d:`m9 22 3-3-3-3`,key:`lsp7cz`}]],aliases:[`file-code-2`]};$C.node;var ew=k($C),tw={name:`files`,size:24,node:[[`path`,{d:`M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8`,key:`14sh0y`}],[`path`,{d:`M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z`,key:`1970lx`}],[`path`,{d:`M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1`,key:`l4dndm`}]]};tw.node;var nw=k(tw),rw={name:`info`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]};rw.node;var iw=k(rw),aw={name:`layers`,size:24,node:[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]],aliases:[`layers-3`]};aw.node;var ow=k(aw),sw={name:`mail`,size:24,node:[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]};sw.node;var cw=k(sw),lw={name:`minus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]};lw.node;var uw=k(lw),dw={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};dw.node;var fw=k(dw),pw={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};pw.node;var mw=k(pw),hw={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};hw.node;var gw=k(hw),_w={name:`route`,size:24,node:[[`circle`,{cx:`6`,cy:`19`,r:`3`,key:`1kj8tv`}],[`path`,{d:`M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15`,key:`1d8sl`}],[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}]]};_w.node;var vw=k(_w),yw={name:`ruler`,size:24,node:[[`path`,{d:`M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z`,key:`icamh8`}],[`path`,{d:`m14.5 12.5 2-2`,key:`inckbg`}],[`path`,{d:`m11.5 9.5 2-2`,key:`fmmyf7`}],[`path`,{d:`m8.5 6.5 2-2`,key:`vc6u1g`}],[`path`,{d:`m17.5 15.5 2-2`,key:`wo5hmg`}]]};yw.node;var bw=k(yw),xw={name:`scan`,size:24,node:[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}]]};xw.node;var Sw=k(xw),Cw={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};Cw.node;var ww=k(Cw),Tw={name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]};Tw.node;var Ew=k(Tw),Dw={name:`upload`,size:24,node:[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]};Dw.node;var Ow=k(Dw),kw={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};kw.node;var Aw=k(kw),jw={name:`zap`,size:24,node:[[`path`,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`,key:`1v7up4`}]]};jw.node;var Mw=k(jw);function Nw({pick:e,onPick:t,onClose:n}){let{portal:r}=i(),a=(0,B.useMemo)(()=>e?e.plates.map(e=>e.thumbnail?URL.createObjectURL(new Blob([e.thumbnail],{type:`image/png`})):null):[],[e]);return(0,B.useEffect)(()=>()=>a.forEach(e=>e&&URL.revokeObjectURL(e)),[a]),/* @__PURE__ */ (0,V.jsx)(Jr,{open:!!e,onOpenChange:e=>{e||n()},children:/* @__PURE__ */ (0,V.jsxs)(Qr,{container:r,children:[/* @__PURE__ */ (0,V.jsx)(ei,{className:`fixed inset-0 z-50 bg-black/40`}),/* @__PURE__ */ (0,V.jsxs)(ii,{className:`fixed top-1/2 left-1/2 z-50 w-[min(560px,calc(100%-32px))] -translate-x-1/2 -translate-y-1/2 rounded-2xl border border-rule bg-panel p-5 shadow-[0_24px_64px_-24px_rgb(0_0_0/0.5)]`,children:[/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[/* @__PURE__ */ (0,V.jsxs)(`div`,{children:[/* @__PURE__ */ (0,V.jsx)(ci,{className:`text-[16px] font-semibold`,children:`Which plate?`}),/* @__PURE__ */ (0,V.jsx)(li,{className:`mt-1 text-[13px] text-muted`,children:e&&`${e.file.name} has ${e.plates.length} sliced plates. Open one; you can come back for the others.`})]}),/* @__PURE__ */ (0,V.jsx)(di,{className:`grid size-8 place-items-center rounded-md text-muted hover:bg-raise hover:text-ink`,"aria-label":`Close`,children:/* @__PURE__ */ (0,V.jsx)(Aw,{className:`size-4`,"aria-hidden":!0})})]}),/* @__PURE__ */ (0,V.jsx)(`div`,{className:`@container`,children:/* @__PURE__ */ (0,V.jsx)(`div`,{className:`mt-4 grid grid-cols-2 gap-3 @sm:grid-cols-3`,children:e&&e.plates.map((e,n)=>/* @__PURE__ */ (0,V.jsxs)(`button`,{type:`button`,onClick:()=>t(e.plate),className:`overflow-hidden rounded-xl border border-rule bg-raise text-left transition-colors hover:border-ink`,children:[a[n]?/* @__PURE__ */ (0,V.jsx)(`img`,{src:a[n],alt:``,className:`aspect-square w-full bg-viewer object-contain`}):/* @__PURE__ */ (0,V.jsx)(`div`,{className:`aspect-square w-full bg-viewer`}),/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`num block px-3 py-2 text-[13px] font-medium`,children:[`Plate `,e.plate]})]},e.plate))})})]})]})})}function Pw({show:e,text:t}){return/* @__PURE__ */ (0,V.jsx)(Uy,{children:e&&/* @__PURE__ */ (0,V.jsx)(Ix.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:`pointer-events-none fixed inset-0 z-50 grid place-items-center bg-bench/80 backdrop-blur-sm`,children:/* @__PURE__ */ (0,V.jsx)(`p`,{className:`rounded-2xl border-2 border-dashed border-ink px-8 py-6 font-display text-[18px] font-semibold`,children:t})})})}function Fw({n:e,title:t,done:n,aside:r,children:i}){return/* @__PURE__ */ (0,V.jsxs)(`section`,{className:`border-b border-rule px-5 py-5 last:border-b-0`,children:[/* @__PURE__ */ (0,V.jsxs)(`header`,{className:`mb-3.5 flex items-center gap-2.5`,children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:E(`num grid size-6 shrink-0 place-items-center rounded-full text-[12px] font-semibold transition-colors`,n?`bg-ink text-ink-contrast`:`border border-rule text-muted`),"aria-hidden":!0,children:n?/* @__PURE__ */ (0,V.jsx)(MC,{className:`size-3.5`,strokeWidth:3}):e}),/* @__PURE__ */ (0,V.jsx)(`h2`,{className:`text-[15px] font-semibold`,children:t}),r&&/* @__PURE__ */ (0,V.jsx)(`span`,{className:`ml-auto truncate text-[13px] text-muted`,children:r})]}),i]})}function Iw({label:e,hint:t,children:n}){return/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2`,children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:`text-[13px] font-medium`,children:e}),t&&/* @__PURE__ */ (0,V.jsx)(`span`,{className:`num text-[13px] text-muted`,children:t})]}),n]})}var Lw={primary:`bg-ink text-ink-contrast hover:opacity-90 disabled:opacity-40`,secondary:`bg-panel text-ink border border-rule hover:border-muted disabled:opacity-50`,ghost:`text-ink hover:bg-raise disabled:opacity-40`},Rw={md:`h-9 px-3.5 gap-2 text-[14px]`,lg:`h-11 px-5 gap-2.5 text-[15px]`,icon:`size-9 justify-center`};function zw({variant:e=`secondary`,size:t=`md`,className:n,...r}){return/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,className:E(`inline-flex shrink-0 items-center rounded-lg font-medium transition-[opacity,border-color,background-color]`,Lw[e],Rw[t],n),...r})}var Bw=1e6,Vw={plates:[],files:{},selected:{plate:null,object:null}},Hw=(e,t,n={x:0,y:0},r=0,i=L)=>({id:e,fileId:t,x:n.x,y:n.y,spin:r,orient:i}),Uw=(e,t,n)=>({...e,plates:e.plates.map(e=>e.id===t?n(e):e)}),Ww=(e,t)=>({...e,plates:e.plates.map(e=>({...e,objects:e.objects.map(t)}))});function Gw(e){let t=new Set(e.plates.flatMap(e=>e.objects.map(e=>e.fileId))),n=Object.fromEntries(Object.entries(e.files).filter(([e])=>t.has(e)));return Object.keys(n).length===Object.keys(e.files).length?e:{...e,files:n}}function Kw(e){let{plate:t,object:n}=e.selected,r=e.plates.find(e=>e.objects.some(e=>e.id===n));if(r)return r.id===t?e:{...e,selected:{plate:r.id,object:n}};let i=e.plates.find(e=>e.id===t)||e.plates[0]||null;return{...e,selected:{plate:i?i.id:null,object:null}}}function qw(e,t){switch(t.type){case`addPlate`:return e.plates.length>=10?e:{...e,plates:[...e.plates,{id:t.id,settings:t.settings,objects:[],result:null,error:null}],selected:{plate:t.id,object:null}};case`removePlate`:return Kw(Gw({...e,plates:e.plates.filter(e=>e.id!==t.id)}));case`selectPlate`:return e.plates.some(e=>e.id===t.id)?{...e,selected:{plate:t.id,object:null}}:e;case`selectObject`:return Kw({...e,selected:{...e.selected,object:t.id}});case`addObjects`:{let n=e.plates.find(e=>e.id===t.plate);if(!n||!t.objects.length)return e;let r=50-n.objects.length,i=t.objects.slice(0,Math.max(0,r));return i.length?{...Uw({...e,files:{...e.files,...t.files}},t.plate,e=>({...e,objects:[...e.objects,...i]})),selected:{plate:t.plate,object:i[0].id}}:e}case`updateObject`:return Ww(e,e=>e.id===t.id?{...e,...t.patch}:e);case`updateObjects`:return Ww(e,e=>t.patches[e.id]?{...e,...t.patches[e.id]}:e);case`removeObjects`:{let n=new Set(t.ids);return Kw(Gw({...e,plates:e.plates.map(e=>({...e,objects:e.objects.filter(e=>!n.has(e.id))}))}))}case`moveObjects`:{let n=new Set(t.ids);if(!e.plates.find(e=>e.id===t.to))return e;let r=e.plates.flatMap(e=>e.objects.filter(e=>n.has(e.id))).map(e=>({...e,...t.positions[e.id]})),i=e.plates.map(e=>{let i=e.objects.filter(e=>!n.has(e.id));return e.id===t.to?{...e,objects:[...i,...r]}:i.length===e.objects.length?e:{...e,objects:i}});return{...e,plates:i,selected:{plate:t.to,object:r.length?r[0].id:null}}}case`settings`:return Uw(e,t.plate,e=>({...e,settings:{...e.settings,...t.patch}}));case`settingsForAll`:{let n=e.plates.find(e=>e.id===t.from);return n?{...e,plates:e.plates.map(e=>({...e,settings:{...n.settings}}))}:e}case`result`:return Uw(e,t.plate,e=>({...e,result:t.result,error:null}));case`error`:return Uw(e,t.plate,e=>({...e,error:t.error}));default:return e}}var Jw=e=>Math.round(e*100)/100,Yw=e=>e?[e.name,e.size,e.lastModified]:null,Xw=(e,t)=>JSON.stringify([e.settings,e.objects.map(e=>[Yw(t[e.fileId]),Jw(e.x),Jw(e.y),Jw(e.spin),e.orient.map(e=>Math.round(e*1e6)/1e6)])]),Zw=(e,t)=>e.objects.length>0&&(!e.result||e.result.sig!==Xw(e,t)||!!e.error);function Qw(e){let t=/* @__PURE__ */ new Map;for(let n of e.objects)t.has(n.fileId)||t.set(n.fileId,[]),t.get(n.fileId).push(n);return[...t].map(([e,t])=>({fileId:e,objects:t}))}var $w=(e,t,n)=>e.filter(e=>!Object.hasOwn(t,e)&&!n.has(e)),eT=(e,t)=>`${e}|${t.join(`,`)}`,tT=e=>e.slice(0,e.indexOf(`|`));function nT(e,t,n){let r=[],i=e;for(;i.length&&r.length<n;){let e=[],n=0;for(let t of i){if(e.length>=50||e.length&&n+t.triangles>1e6)break;e.push(t),n+=t.triangles}let{positions:a,overflow:o}=fe(e.map(e=>({id:e.id,points:e.points,spin:0})),t),s=e.map(e=>e.id).filter(e=>!o.includes(e));s.length||(s=[e[0].id],a[s[0]]={x:0,y:0}),r.push({ids:s,positions:Object.fromEntries(s.map(e=>[e,a[e]]))});let c=new Set(s);i=i.filter(e=>!c.has(e.id))}return{plates:r,left:i.map(e=>e.id)}}var rT={"model/stl":[`.stl`],"model/3mf":[`.3mf`],"model/obj":[`.obj`],"model/step":[`.step`,`.stp`],"model/iges":[`.iges`,`.igs`]},iT={sliced:[`bg-ok`,`sliced`],stale:[`bg-warn`,`changed since slicing`],failed:[`bg-danger`,`failed`]};function aT({n:e,on:t,state:n,onClick:r}){let[i,a]=iT[n]||[];return/* @__PURE__ */ (0,V.jsxs)(`button`,{type:`button`,"aria-pressed":t,"aria-label":`Plate ${e}${a?`, ${a}`:``}`,onClick:r,className:E(`num relative h-9 min-w-9 rounded-lg border px-3 text-[14px] font-medium transition-colors`,t?`border-ink bg-ink text-ink-contrast`:`border-rule hover:border-muted`),children:[e,i&&/* @__PURE__ */ (0,V.jsx)(`span`,{className:E(`absolute -top-1 -right-1 size-2.5 rounded-full border-2 border-panel`,i),"aria-hidden":!0})]})}function oT({name:e,value:t,disabled:n,onChange:r}){let i=`grid size-7 place-items-center rounded-md text-ink transition-colors hover:bg-rule disabled:text-muted disabled:opacity-50`;return/* @__PURE__ */ (0,V.jsxs)(`div`,{role:`group`,"aria-label":`Copies of ${e}`,className:`flex shrink-0 items-center rounded-lg bg-raise p-0.5`,children:[/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,"aria-label":`One copy fewer`,disabled:n||t<=1,onClick:()=>r(t-1),className:i,children:/* @__PURE__ */ (0,V.jsx)(uw,{className:`size-3`,"aria-hidden":!0})}),/* @__PURE__ */ (0,V.jsx)(`span`,{className:`num w-6 text-center text-[13px] font-semibold`,"aria-live":`polite`,children:t}),/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,"aria-label":`One copy more`,disabled:n||t>=50,onClick:()=>r(t+1),className:i,children:/* @__PURE__ */ (0,V.jsx)(mw,{className:`size-3`,"aria-hidden":!0})})]})}function sT({name:e,others:t,canAdd:n,onMove:r,onRemove:a}){let{portal:o}=i(),s=`cursor-pointer rounded-lg px-3 py-2 text-[14px] outline-none data-[disabled]:cursor-default data-[disabled]:opacity-50 data-[highlighted]:bg-raise`;return/* @__PURE__ */ (0,V.jsxs)(Za,{children:[/* @__PURE__ */ (0,V.jsx)($a,{"aria-label":`More for ${e}`,className:`grid size-8 shrink-0 place-items-center rounded-lg text-muted transition-colors hover:bg-raise hover:text-ink`,children:/* @__PURE__ */ (0,V.jsx)(JC,{className:`size-4`,"aria-hidden":!0})}),/* @__PURE__ */ (0,V.jsx)(eo,{container:o,children:/* @__PURE__ */ (0,V.jsxs)(no,{align:`end`,sideOffset:4,className:`z-50 min-w-[220px] rounded-xl border border-rule bg-panel p-1 shadow-[0_12px_32px_-12px_rgb(0_0_0/0.3)]`,children:[t.map(e=>/* @__PURE__ */ (0,V.jsxs)(ro,{className:s,onSelect:()=>r(e.id),children:[`Move to plate `,e.n]},e.id)),/* @__PURE__ */ (0,V.jsx)(ro,{className:s,disabled:!n,onSelect:()=>r(`new`),children:`Move to a new plate`}),/* @__PURE__ */ (0,V.jsx)(io,{className:`my-1 h-px bg-rule`}),/* @__PURE__ */ (0,V.jsx)(ro,{className:E(s,`text-danger`),onSelect:a,children:`Remove from this plate`})]})})]})}var cT=e=>e?`${e.map(e=>e.toFixed(1)).join(` × `)} mm`:null;function lT({plates:e,selected:t,files:n,loading:r,summary:i,onSelectPlate:a,onNewPlate:o,onRemovePlate:s,onSettingsForAll:c,onFiles:l,onChoose:u,onSelectFile:d,onCopies:f,onMove:p,onRemove:m}){let{getRootProps:h,getInputProps:g,isDragActive:_}=OC({accept:rT,multiple:!0,noClick:!0,noKeyboard:!0,noDragEventsBubbling:!0,onDrop:e=>{e.length&&l(e)}}),v=e.find(e=>e.id===t),y=n.reduce((e,t)=>e+t.copies,0),b=e.filter(e=>e.id!==t);return/* @__PURE__ */ (0,V.jsxs)(Fw,{n:1,title:`Plates`,done:y>0,aside:y?`${y} ${y===1?`object`:`objects`}`:void 0,children:[/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center gap-1.5`,children:[e.map(e=>/* @__PURE__ */ (0,V.jsx)(aT,{n:e.n,on:e.id===t,state:e.state,onClick:()=>a(e.id)},e.id)),/* @__PURE__ */ (0,V.jsx)(j,{label:`New plate`,children:/* @__PURE__ */ (0,V.jsx)(zw,{variant:`ghost`,size:`icon`,"aria-label":`New plate`,disabled:e.length>=10,onClick:o,children:/* @__PURE__ */ (0,V.jsx)(mw,{className:`size-4`,"aria-hidden":!0})})})]}),/* @__PURE__ */ (0,V.jsxs)(`div`,{...h(),className:E(`rounded-xl outline-none`,_&&`ring-2 ring-ink ring-offset-2 ring-offset-panel`),children:[/* @__PURE__ */ (0,V.jsx)(`input`,{...g()}),n.length||r.length?/* @__PURE__ */ (0,V.jsxs)(`ul`,{className:`space-y-1.5`,children:[n.map(t=>/* @__PURE__ */ (0,V.jsxs)(`li`,{className:E(`flex items-center gap-1.5 rounded-xl border bg-raise py-1 pr-1 pl-1 transition-colors`,t.on?`border-ink`:`border-rule`),children:[/* @__PURE__ */ (0,V.jsxs)(`button`,{type:`button`,"aria-current":t.on||void 0,onClick:()=>d(t.firstId),className:`flex min-w-0 flex-1 items-center gap-2.5 rounded-lg py-1.5 pl-2 text-left`,children:[/* @__PURE__ */ (0,V.jsx)(te,{className:E(`size-5 shrink-0`,t.on?`text-ink`:`text-muted`),"aria-hidden":!0}),/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:`block truncate text-[14px] font-medium`,title:t.name,children:t.name}),/* @__PURE__ */ (0,V.jsx)(`span`,{className:`block truncate text-[12px] text-muted`,children:t.cad?`Placed by the slicer`:cT(t.size)})]})]}),/* @__PURE__ */ (0,V.jsx)(oT,{name:t.name,value:t.copies,disabled:t.cad,onChange:e=>f(t.fileId,e)}),/* @__PURE__ */ (0,V.jsx)(sT,{name:t.name,others:b,canAdd:e.length<10,onMove:e=>p(t.fileId,e),onRemove:()=>m(t.fileId)})]},t.fileId)),r.map((e,t)=>/* @__PURE__ */ (0,V.jsxs)(`li`,{className:`flex items-center gap-2.5 rounded-xl border border-dashed border-rule px-3 py-2.5 text-[13px] text-muted`,children:[/* @__PURE__ */ (0,V.jsx)(ee,{className:`size-4 shrink-0 animate-spin`,"aria-hidden":!0}),` `,/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`truncate`,children:[`Reading `,e]})]},`${e}-${t}`))]}):/* @__PURE__ */ (0,V.jsxs)(`button`,{type:`button`,onClick:u,className:E(`flex w-full flex-col items-center gap-2 rounded-xl border-2 border-dashed border-rule px-4 py-6 text-center transition-colors hover:border-muted`,_&&`border-ink bg-raise`),children:[/* @__PURE__ */ (0,V.jsx)(Ow,{className:`size-6 text-muted`,"aria-hidden":!0}),/* @__PURE__ */ (0,V.jsx)(`span`,{className:`text-[14px] font-medium`,children:_?`Drop the files to place them`:`Drop models here, or choose them`}),/* @__PURE__ */ (0,V.jsx)(`span`,{className:`text-[12px] text-muted`,children:`STL, 3MF, OBJ, STEP or IGES, up to 10 files of 50 MB each`})]})]}),i&&/* @__PURE__ */ (0,V.jsx)(`p`,{className:E(`mt-2.5 text-[13px]`,i.warn?`text-warn`:`text-muted`),children:i.text}),/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`mt-2.5 flex flex-wrap items-center gap-1`,children:[(n.length>0||r.length>0)&&/* @__PURE__ */ (0,V.jsxs)(zw,{variant:`ghost`,className:`h-8 px-2.5 text-[13px]`,onClick:u,children:[/* @__PURE__ */ (0,V.jsx)(mw,{className:`size-4`,"aria-hidden":!0}),` Add files`]}),e.length>1&&v&&/* @__PURE__ */ (0,V.jsxs)(V.Fragment,{children:[/* @__PURE__ */ (0,V.jsx)(zw,{variant:`ghost`,className:`h-8 px-2.5 text-[13px]`,onClick:c,children:`Use these settings for all plates`}),/* @__PURE__ */ (0,V.jsxs)(zw,{variant:`ghost`,className:`h-8 px-2.5 text-[13px] text-danger`,onClick:()=>s(v.id),children:[`Remove plate `,v.n]})]})]})]})}var uT=e=>String(Math.round(e*10)/10);function dT({label:e,value:t,unit:n,onCommit:r}){let[i,a]=(0,B.useState)(uT(t));return(0,B.useEffect)(()=>a(uT(t)),[t]),/* @__PURE__ */ (0,V.jsxs)(`label`,{className:`flex h-9 min-w-0 flex-1 items-center gap-1.5 rounded-lg border border-rule bg-panel px-2.5 focus-within:border-muted`,children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:`text-[12px] text-muted`,children:e}),/* @__PURE__ */ (0,V.jsx)(`input`,{inputMode:`decimal`,"aria-label":e,value:i,onChange:e=>a(e.target.value),onBlur:()=>{let e=parseFloat(i.replace(`,`,`.`));Number.isFinite(e)&&Math.abs(e-t)>.04?r(e):a(uT(t))},onKeyDown:e=>{e.key===`Enter`&&e.currentTarget.blur(),e.key===`Escape`&&(a(uT(t)),e.currentTarget.blur())},className:`num min-w-0 flex-1 bg-transparent text-right text-[14px] outline-none`}),/* @__PURE__ */ (0,V.jsx)(`span`,{className:`text-[12px] text-muted`,children:n})]})}var fT=`h-8 px-2.5 text-[13px]`;function pT({n:e,item:t,copy:n,problem:r,layMode:i,canArrange:a,onLayMode:o,onMoveTo:s,onSpin:c,onSpinBy:l,onTip:u,onReset:d,onCentre:f,onArrange:p}){let m=t?`${t.name}${n&&n.of>1?`, copy ${n.k} of ${n.of}`:``}`:void 0;return/* @__PURE__ */ (0,V.jsxs)(Fw,{n:e,title:`Position`,done:!!t&&!r,aside:m,children:[!t&&/* @__PURE__ */ (0,V.jsx)(`p`,{className:`text-[13px] text-muted`,children:`Click an object on the plate, or in the list, to move or turn it. Drag it on the plate to move it.`}),t&&t.cad&&/* @__PURE__ */ (0,V.jsx)(`p`,{className:`text-[13px] text-muted`,children:`STEP and IGES files are placed by the slicer, in the middle of the bed, as the file has them.`}),t&&!t.cad&&/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`space-y-4`,children:[/* @__PURE__ */ (0,V.jsx)(Iw,{label:`Where`,hint:`mm, from the printer's origin`,children:/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`flex gap-2`,children:[/* @__PURE__ */ (0,V.jsx)(dT,{label:`X`,value:t.at[0],unit:`mm`,onCommit:e=>s(e,t.at[1])}),/* @__PURE__ */ (0,V.jsx)(dT,{label:`Y`,value:t.at[1],unit:`mm`,onCommit:e=>s(t.at[0],e)})]})}),/* @__PURE__ */ (0,V.jsx)(Iw,{label:`Spin`,hint:`about the plate`,children:/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[/* @__PURE__ */ (0,V.jsx)(`div`,{className:`w-[104px] shrink-0`,children:/* @__PURE__ */ (0,V.jsx)(dT,{label:`Spin`,value:t.spin,unit:`°`,onCommit:c})}),[-90,-15,15,90].map(e=>/* @__PURE__ */ (0,V.jsxs)(zw,{className:E(fT,`num min-w-0 flex-1 justify-center px-1`),onClick:()=>l(e),"aria-label":`Spin ${e>0?`left`:`right`} ${Math.abs(e)} degrees`,children:[e>0?`+${e}`:e,`°`]},e))]})}),/* @__PURE__ */ (0,V.jsx)(Iw,{label:`Turn`,hint:t.size?`${t.size.map(e=>e.toFixed(1)).join(` × `)} mm`:void 0,children:/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[/* @__PURE__ */ (0,V.jsx)(j,{label:`Tip it toward you, a quarter turn`,children:/* @__PURE__ */ (0,V.jsx)(zw,{className:fT,onClick:()=>u(`forward`),children:`Tip forward`})}),/* @__PURE__ */ (0,V.jsx)(j,{label:`Tip it onto its side, a quarter turn`,children:/* @__PURE__ */ (0,V.jsx)(zw,{className:fT,onClick:()=>u(`sideways`),children:`Tip sideways`})}),/* @__PURE__ */ (0,V.jsx)(j,{label:`Then click a face on the plate to stand the object on it`,children:/* @__PURE__ */ (0,V.jsx)(zw,{className:E(fT,i&&`border-ink bg-ink text-ink-contrast hover:border-ink`),"aria-pressed":i,onClick:()=>o(!i),children:`Lay on face`})}),/* @__PURE__ */ (0,V.jsx)(j,{label:`Back to how the file has it`,children:/* @__PURE__ */ (0,V.jsx)(zw,{variant:`ghost`,size:`icon`,className:`size-8`,"aria-label":`Undo turns`,onClick:d,children:/* @__PURE__ */ (0,V.jsx)(gw,{className:`size-4`,"aria-hidden":!0})})})]})}),r&&/* @__PURE__ */ (0,V.jsx)(`p`,{className:`text-[13px] text-danger`,role:`status`,children:r})]}),/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-1.5`,children:[t&&!t.cad&&/* @__PURE__ */ (0,V.jsx)(zw,{className:fT,onClick:f,children:`Centre`}),/* @__PURE__ */ (0,V.jsx)(zw,{className:fT,disabled:!a,onClick:p,children:`Arrange plate`})]})]})}var mT=1,hT=.9,gT=.8,_T=.17,vT=.1,yT=.999,bT=.9999,xT=.99,ST=/[\\\/_+.#"@\[\(\{&]/,CT=/[\\\/_+.#"@\[\(\{&]/g,wT=/[\s-]/,TT=/[\s-]/g;function ET(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?mT:xT;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=ET(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=mT:ST.test(e.charAt(l-1))?(d*=gT,p=e.slice(i,l-1).match(CT),p&&i>0&&(d*=yT**+p.length)):wT.test(e.charAt(l-1))?(d*=hT,m=e.slice(i,l-1).match(TT),m&&i>0&&(d*=yT**+m.length)):(d*=_T,i>0&&(d*=yT**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=bT)),(d<vT&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=ET(e,t,n,r,l+1,a+2,o),f*vT>d&&(d=f*vT)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function DT(e){return e.toLowerCase().replace(TT,` `)}function OT(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,ET(e,t,DT(e),DT(t),0,0,{})}var kT=`[cmdk-group=""]`,AT=`[cmdk-group-items=""]`,jT=`[cmdk-group-heading=""]`,MT=`[cmdk-item=""]`,NT=`${MT}:not([aria-disabled="true"])`,PT=`cmdk-item-select`,FT=`data-value`,IT=(e,t,n)=>OT(e,t,n),LT=B.createContext(void 0),RT=()=>B.useContext(LT),zT=B.createContext(void 0),BT=()=>B.useContext(zT),VT=B.createContext(void 0),HT=B.forwardRef((e,t)=>{let n=nE(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:/* @__PURE__ */ new Map,groups:/* @__PURE__ */ new Set}})),r=nE(()=>/* @__PURE__ */ new Set),i=nE(()=>/* @__PURE__ */ new Map),a=nE(()=>/* @__PURE__ */ new Map),o=nE(()=>/* @__PURE__ */ new Set),s=eE(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:m,loop:h,disablePointerSelection:g=!1,vimBindings:_=!0,...v}=e,y=N(),b=N(),x=N(),S=B.useRef(null),C=aE();tE(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,w.emit()}},[u]),tE(()=>{C(6,A)},[]);let w=B.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)k(),D(),C(1,O);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(x);e?e.focus():(i=document.getElementById(y))==null||i.focus()}if(C(7,()=>{n.current.selectedItemId=j()?.id,w.emit()}),r||C(5,A),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}w.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),T=B.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,E(t,r)),C(2,()=>{D(),w.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,/* @__PURE__ */ new Set([e]))),C(3,()=>{k(),D(),n.current.value||O(),w.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=j();C(4,()=>{k(),t?.getAttribute(`id`)===e&&O(),w.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,/* @__PURE__ */ new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:y,inputId:x,labelId:b,listInnerRef:S}),[]);function E(e,t){let r=s.current?.filter??IT;return e?r(e,n.current.search,t):0}function D(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=S.current;M().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(AT);t?t.appendChild(e.parentElement===t?e:e.closest(`${AT} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${AT} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=S.current?.querySelector(`${kT}[${FT}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function O(){let e=M().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(FT);w.setState(`value`,e||void 0)}function k(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=/* @__PURE__ */ new Set;let e=0;for(let t of r.current){let r=E(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function A(){var e;let t=j();t&&(t.parentElement?.firstChild===t&&((e=t.closest(kT)?.querySelector(jT))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function j(){return S.current?.querySelector(`${MT}[aria-selected="true"]`)}function M(){return Array.from(S.current?.querySelectorAll(NT)||[])}function P(e){let t=M()[e];t&&w.setState(`value`,t.getAttribute(FT))}function F(e){var t;let n=j(),r=M(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&w.setState(`value`,a.getAttribute(FT))}function I(e){let t=j()?.closest(kT),n;for(;t&&!n;)t=e>0?QT(t,kT):$T(t,kT),n=t?.querySelector(NT);n?w.setState(`value`,n.getAttribute(FT)):F(e)}let ee=()=>P(M().length-1),te=e=>{e.preventDefault(),e.metaKey?ee():e.altKey?I(1):F(1)},ne=e=>{e.preventDefault(),e.metaKey?P(0):e.altKey?I(-1):F(-1)};return B.createElement(p.div,{ref:t,tabIndex:-1,...v,"cmdk-root":``,onKeyDown:e=>{var t;(t=v.onKeyDown)==null||t.call(v,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:_&&e.ctrlKey&&te(e);break;case`ArrowDown`:te(e);break;case`p`:case`k`:_&&e.ctrlKey&&ne(e);break;case`ArrowUp`:ne(e);break;case`Home`:e.preventDefault(),P(0);break;case`End`:e.preventDefault(),ee();break;case`Enter`:{e.preventDefault();let t=j();if(t){let e=new Event(PT);t.dispatchEvent(e)}}}}},B.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:cE},c),sE(e,e=>B.createElement(zT.Provider,{value:w},B.createElement(LT.Provider,{value:T},e))))}),UT=B.forwardRef((e,t)=>{let n=N(),r=B.useRef(null),i=B.useContext(VT),a=RT(),o=eE(e),s=o.current?.forceMount??i?.forceMount;tE(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=iE(n,r,[e.value,e.children,r],e.keywords),l=BT(),u=rE(e=>e.value&&e.value===c.current),f=rE(e=>s||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);B.useEffect(()=>{let t=r.current;if(t&&!e.disabled)return t.addEventListener(PT,m),()=>t.removeEventListener(PT,m)},[f,e.onSelect,e.disabled]);function m(){var e,t;h(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function h(){l.setState(`value`,c.current,!0)}if(!f)return null;let{disabled:g,value:_,onSelect:v,forceMount:y,keywords:b,...x}=e;return B.createElement(p.div,{ref:d(r,t),...x,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!g,"aria-selected":!!u,"data-disabled":!!g,"data-selected":!!u,onPointerMove:g||a.getDisablePointerSelection()?void 0:h,onClick:g?void 0:m},e.children)}),WT=B.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=N(),s=B.useRef(null),c=B.useRef(null),l=N(),u=RT(),f=rE(e=>i||u.filter()===!1?!0:!e.search||e.filtered.groups.has(o));tE(()=>u.group(o),[]),iE(o,s,[e.value,e.heading,c]);let m=B.useMemo(()=>({id:o,forceMount:i}),[i]);return B.createElement(p.div,{ref:d(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:!f||void 0},n&&B.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),sE(e,e=>B.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},B.createElement(VT.Provider,{value:m},e))))}),GT=B.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=B.useRef(null),a=rE(e=>!e.search);return!n&&!a?null:B.createElement(p.div,{ref:d(i,t),...r,"cmdk-separator":``,role:`separator`})}),KT=B.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=BT(),o=rE(e=>e.search),s=rE(e=>e.selectedItemId),c=RT();return B.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),B.createElement(p.input,{ref:t,...r,"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":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),qT=B.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=B.useRef(null),o=B.useRef(null),s=rE(e=>e.selectedItemId),c=RT();return B.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),B.createElement(p.div,{ref:d(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},sE(e,e=>B.createElement(`div`,{ref:d(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),JT=B.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return B.createElement(Jr,{open:n,onOpenChange:r},B.createElement(Qr,{container:o},B.createElement(ei,{"cmdk-overlay":``,className:i}),B.createElement(ii,{"aria-label":e.label,"cmdk-dialog":``,className:a},B.createElement(HT,{ref:t,...s}))))}),YT=B.forwardRef((e,t)=>rE(e=>e.filtered.count===0)?B.createElement(p.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),XT=B.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return B.createElement(p.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},sE(e,e=>B.createElement(`div`,{"aria-hidden":!0},e)))}),ZT=Object.assign(HT,{List:qT,Item:UT,Input:KT,Group:WT,Separator:GT,Dialog:JT,Empty:YT,Loading:XT});function QT(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function $T(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function eE(e){let t=B.useRef(e);return tE(()=>{t.current=e}),t}var tE=typeof window>`u`?B.useEffect:B.useLayoutEffect;function nE(e){let t=B.useRef();return t.current===void 0&&(t.current=e()),t}function rE(e){let t=BT(),n=()=>e(t.snapshot());return B.useSyncExternalStore(t.subscribe,n,n)}function iE(e,t,n,r=[]){let i=B.useRef(),a=RT();return tE(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(FT,s),i.current=s}),i}var aE=()=>{let[e,t]=B.useState(),n=nE(()=>/* @__PURE__ */ new Map);return tE(()=>{n.current.forEach(e=>e()),n.current=/* @__PURE__ */ new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function oE(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function sE({asChild:e,children:t},n){return e&&B.isValidElement(t)?B.cloneElement(oE(t),{ref:t.ref},n(t.props.children)):n(t)}var cE={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function lE(e){let t=/* @__PURE__ */ new Map;for(let n of e)t.has(n.group||``)||t.set(n.group||``,[]),t.get(n.group||``).push(n);return[...t]}function uE({value:e,onChange:t,items:n,placeholder:r=`Choose…`,searchPlaceholder:a=`Search`,emptyText:o=`Nothing matches`,disabled:s,label:c,className:l}){let[u,d]=(0,B.useState)(!1),{portal:f}=i(),p=n.find(t=>t.value===e);return/* @__PURE__ */ (0,V.jsxs)(_o,{open:u,onOpenChange:d,children:[/* @__PURE__ */ (0,V.jsx)(yo,{asChild:!0,disabled:s,children:/* @__PURE__ */ (0,V.jsxs)(`button`,{type:`button`,role:`combobox`,"aria-expanded":u,"aria-label":c,className:E(`flex h-10 w-full items-center justify-between gap-2 rounded-lg border border-rule bg-panel px-3 text-left text-[14px] transition-colors hover:border-muted disabled:opacity-50`,l),children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:E(`truncate`,!p&&`text-muted`),children:p?p.label:r}),/* @__PURE__ */ (0,V.jsx)(BC,{className:`size-4 shrink-0 text-muted`,"aria-hidden":!0})]})}),/* @__PURE__ */ (0,V.jsx)(Co,{container:f,children:/* @__PURE__ */ (0,V.jsx)(To,{align:`start`,sideOffset:6,className:`z-50 w-[var(--radix-popover-trigger-width)] min-w-56 overflow-hidden rounded-xl border border-rule bg-panel shadow-[0_12px_32px_-12px_rgb(0_0_0/0.35)]`,children:/* @__PURE__ */ (0,V.jsxs)(ZT,{loop:!0,filter:(e,t)=>+!!e.toLowerCase().includes(t.toLowerCase()),children:[/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-rule px-3`,children:[/* @__PURE__ */ (0,V.jsx)(ww,{className:`size-4 text-muted`,"aria-hidden":!0}),/* @__PURE__ */ (0,V.jsx)(ZT.Input,{placeholder:a,className:`h-10 w-full bg-transparent text-[14px] outline-none placeholder:text-muted`})]}),/* @__PURE__ */ (0,V.jsxs)(ZT.List,{className:`max-h-72 overflow-y-auto p-1`,children:[/* @__PURE__ */ (0,V.jsx)(ZT.Empty,{className:`px-3 py-6 text-center text-[13px] text-muted`,children:o}),lE(n).map(([n,r])=>{let i=r.map(n=>/* @__PURE__ */ (0,V.jsxs)(ZT.Item,{value:`${n.label} ${n.hint||``} ${n.value}`,onSelect:()=>{t(n.value),d(!1)},className:`flex cursor-pointer items-center gap-2 rounded-md px-2.5 py-2 text-[14px] data-[selected=true]:bg-raise`,children:[/* @__PURE__ */ (0,V.jsx)(MC,{className:E(`size-4 shrink-0`,n.value===e?`opacity-100`:`opacity-0`),"aria-hidden":!0}),/* @__PURE__ */ (0,V.jsx)(`span`,{className:`truncate`,children:n.label}),n.hint&&/* @__PURE__ */ (0,V.jsx)(`span`,{className:`num ml-auto shrink-0 text-[12px] text-muted`,children:n.hint})]},n.value));return n?/* @__PURE__ */ (0,V.jsx)(ZT.Group,{heading:n,className:`[&_[cmdk-group-heading]]:px-2.5 [&_[cmdk-group-heading]]:pt-2 [&_[cmdk-group-heading]]:pb-1 [&_[cmdk-group-heading]]:text-[12px] [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted`,children:i},n):i})]})]})})})]})}var dE=`__empty`;function fE({value:e,onChange:t,options:n,label:r,className:i}){return/* @__PURE__ */ (0,V.jsx)(Lc,{type:`single`,"aria-label":r,value:e===``?dE:String(e),onValueChange:e=>{e&&t(e===dE?``:e)},className:E(`grid auto-cols-fr grid-flow-col rounded-lg bg-raise p-0.5`,i),children:n.map(e=>/* @__PURE__ */ (0,V.jsx)(Kc,{value:e.value===``?dE:String(e.value),className:`num h-8 rounded-md px-2 text-[13px] text-muted transition-colors hover:text-ink data-[state=on]:bg-panel data-[state=on]:text-ink data-[state=on]:shadow-[0_1px_2px_rgb(0_0_0/0.08)]`,children:e.label},e.value))})}var pE={BBL:`Bambu Lab`},mE=e=>pE[e]||e,hE=(e,t)=>e.label.localeCompare(t.label,void 0,{numeric:!0,sensitivity:`base`});function gE(e){let t=/* @__PURE__ */ new Map;for(let n of e){t.has(n.vendor)||t.set(n.vendor,{id:n.vendor,label:mE(n.vendor),models:/* @__PURE__ */ new Map});let e=t.get(n.vendor);if(!e.models.has(n.model)){let t=e.label.toLowerCase()+` `,r=n.model.toLowerCase().startsWith(t)?n.model.slice(t.length):n.model;e.models.set(n.model,{id:n.model,label:r,nozzles:[]})}e.models.get(n.model).nozzles.push({size:n.nozzleMm,name:n.name})}return[...t.values()].map(e=>({...e,models:[...e.models.values()].map(e=>({...e,nozzles:_E(e)})).sort(hE)})).sort(hE)}function _E(e){let t=/* @__PURE__ */ new Map;for(let n of e.nozzles)t.set(n.size,(t.get(n.size)||0)+1);let n=t=>(t.toLowerCase().startsWith(e.id.toLowerCase()+` `)?t.slice(e.id.length+1):t).replace(/\bnozzle\b/gi,``).replace(/\s+-\s+/g,` `).replace(/\s+/g,` `).trim();return e.nozzles.map(e=>({...e,label:t.get(e.size)>1?n(e.name):String(e.size)})).sort((e,t)=>e.size-t.size||hE(e,t))}function vE(e,t){for(let n of e)for(let e of n.models){let r=e.nozzles.find(e=>e.name===t);if(r)return{brand:n,model:e,nozzle:r}}return null}var yE=e=>e.nozzles.find(e=>e.label===`0.4`)||e.nozzles[0];function bE(e){return e.isLoading?`Loading printers…`:e.error?`The full printer list didn’t load, so only our printers are listed.`:null}function xE({printers:e,ourPrinters:t=[],printer:n,onChange:r}){let i=e.data,a=(0,B.useMemo)(()=>i&&n?vE(i,n):null,[i,n]),[o,s]=(0,B.useState)(``),[c,l]=(0,B.useState)(``);(0,B.useEffect)(()=>{a?(s(a.brand.id),l(a.model.id)):n===``&&(s(``),l(``))},[a,n]);let u=i&&i.find(e=>e.id===o),d=u&&u.models.find(e=>e.id===c),f=(e,t=u)=>{let n=t.models.find(t=>t.id===e);l(e),r(yE(n).name)},p=e=>{if(e.startsWith(`printer:`))return r(e.slice(8));s(e),l(``);let t=i.find(t=>t.id===e);t.models.length===1?f(t.models[0].id,t):r(null)},m=[...t.map(e=>({...e,group:`Our printers`})),...(i||[]).map(e=>({value:e.id,label:e.label,hint:`${e.models.length} ${e.models.length===1?`model`:`models`}`,group:t.length?`All printers`:void 0}))],h=bE(e),g=t.find(e=>e.value===`printer:${n}`),_=d?`${u.label} ${d.label}`:u?.label??g?.label;return/* @__PURE__ */ (0,V.jsx)(Fw,{n:3,title:`Printer`,done:n!==null,aside:_,children:/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`space-y-3`,children:[/* @__PURE__ */ (0,V.jsx)(Iw,{label:`Brand`,children:/* @__PURE__ */ (0,V.jsx)(uE,{label:`Printer brand`,value:a||!g?o:g.value,onChange:p,items:m,searchPlaceholder:`Search brands`,emptyText:`No brand by that name`,disabled:!m.length})}),h&&/* @__PURE__ */ (0,V.jsx)(`p`,{className:`text-[13px] text-muted`,children:h}),/* @__PURE__ */ (0,V.jsx)(Uy,{initial:!1,children:u&&/* @__PURE__ */ (0,V.jsxs)(Ix.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},transition:{duration:.2,ease:`easeOut`},className:`space-y-3 overflow-hidden`,children:[/* @__PURE__ */ (0,V.jsx)(Iw,{label:`Model`,children:/* @__PURE__ */ (0,V.jsx)(uE,{label:`Printer model`,value:c,onChange:e=>f(e),placeholder:`Choose a ${u.label} model`,items:u.models.map(e=>({value:e.id,label:e.label})),searchPlaceholder:`Search models`,emptyText:`No model by that name`})}),d&&/* @__PURE__ */ (0,V.jsx)(Iw,{label:`Nozzle`,hint:`mm`,children:/* @__PURE__ */ (0,V.jsx)(fE,{label:`Nozzle size`,value:n||``,onChange:r,className:d.nozzles.every(e=>e.label.length<=4)?void 0:`flex flex-wrap gap-1`,options:d.nozzles.map(e=>({value:e.name,label:e.label}))})})]},u.id)})]})})}var SE=`__empty`;function CE({value:e,onChange:t,options:n,label:r,className:a}){let{portal:o}=i();return/* @__PURE__ */ (0,V.jsxs)(Yo,{value:e===``?SE:e,onValueChange:e=>t(e===SE?``:e),children:[/* @__PURE__ */ (0,V.jsxs)(Zo,{"aria-label":r,className:E(`flex h-10 w-full items-center justify-between gap-2 rounded-lg border border-rule bg-panel px-3 text-left text-[14px] transition-colors hover:border-muted`,a),children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:`truncate`,children:/* @__PURE__ */ (0,V.jsx)($o,{})}),/* @__PURE__ */ (0,V.jsx)(es,{children:/* @__PURE__ */ (0,V.jsx)(PC,{className:`size-4 text-muted`,"aria-hidden":!0})})]}),/* @__PURE__ */ (0,V.jsx)(rs,{container:o,children:/* @__PURE__ */ (0,V.jsx)(as,{position:`popper`,sideOffset:6,className:`z-50 max-h-80 w-[var(--radix-select-trigger-width)] min-w-48 overflow-hidden rounded-xl border border-rule bg-panel shadow-[0_12px_32px_-12px_rgb(0_0_0/0.35)]`,children:/* @__PURE__ */ (0,V.jsx)(_s,{className:`p-1`,children:n.map(e=>/* @__PURE__ */ (0,V.jsxs)(Cs,{value:e.value===``?SE:e.value,className:`relative flex cursor-pointer items-center rounded-md py-2 pr-2.5 pl-8 text-[14px] outline-none data-[highlighted]:bg-raise`,children:[/* @__PURE__ */ (0,V.jsx)(Ds,{className:`absolute left-2.5`,children:/* @__PURE__ */ (0,V.jsx)(MC,{className:`size-4`,"aria-hidden":!0})}),/* @__PURE__ */ (0,V.jsx)(Ts,{children:e.label})]},e.value))})})})]})}function wE({settings:e,onChange:t,options:n}){let[r,i]=(0,B.useState)(!1),a=n.data,o=a?a.materials:[e.material],s=o.map(e=>({value:e,label:e})),c=e.process||e.filament;return/* @__PURE__ */ (0,V.jsx)(Fw,{n:4,title:`Material`,done:!0,aside:e.filament||null,children:/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`space-y-3`,children:[/* @__PURE__ */ (0,V.jsx)(Iw,{label:`Material`,children:o.length>8?/* @__PURE__ */ (0,V.jsx)(uE,{label:`Material`,value:e.material,onChange:e=>t({material:e,filament:``}),items:s,searchPlaceholder:`Search materials`}):/* @__PURE__ */ (0,V.jsx)(CE,{label:`Material`,value:e.material,onChange:e=>t({material:e,filament:``}),options:s})}),a&&/* @__PURE__ */ (0,V.jsxs)(`div`,{children:[/* @__PURE__ */ (0,V.jsxs)(`button`,{type:`button`,onClick:()=>i(e=>!e),"aria-expanded":r,className:`flex items-center gap-1 text-[13px] font-medium text-muted hover:text-ink`,children:[/* @__PURE__ */ (0,V.jsx)(IC,{className:E(`size-4 transition-transform`,r&&`rotate-90`),"aria-hidden":!0}),`Process and filament presets`,c&&!r?`, changed`:``]}),/* @__PURE__ */ (0,V.jsx)(Uy,{initial:!1,children:r&&/* @__PURE__ */ (0,V.jsx)(Ix.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},transition:{duration:.2,ease:`easeOut`},className:`overflow-hidden`,children:/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`space-y-3 pt-3`,children:[/* @__PURE__ */ (0,V.jsx)(Iw,{label:`Process`,children:/* @__PURE__ */ (0,V.jsx)(CE,{label:`Process preset`,value:e.process,onChange:e=>t({process:e}),options:[{value:``,label:`Printer default${a.defaultProcess?` (${a.defaultProcess})`:``}`},...a.processes.map(e=>({value:e,label:e}))]})}),/* @__PURE__ */ (0,V.jsx)(Iw,{label:`Filament`,hint:`${a.filaments.length} for ${e.material}`,children:/* @__PURE__ */ (0,V.jsx)(uE,{label:`Filament preset`,value:e.filament,onChange:e=>t({filament:e}),searchPlaceholder:`Search filaments`,items:[{value:``,label:`Generic ${e.material}`},...a.filaments.map(e=>({value:e.name,label:e.name}))]})})]})})})]})]})})}function TE({label:e,values:t,value:n,onChange:r,format:i,valueText:a=i,defaultValue:o,defaultLabel:s,captions:c,bare:l}){let u=s!==void 0,d=n!==``,f=Math.max(0,t.indexOf(d?Number(n):o));return/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[!l&&/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2`,children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:`text-[13px] font-semibold`,children:e}),/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`flex items-center gap-1`,children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:d?`num text-[13px] font-semibold`:`text-[13px] text-muted`,children:d?i(Number(n)):s}),u&&d&&/* @__PURE__ */ (0,V.jsx)(j,{label:`Back to default`,children:/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,onClick:()=>r(``),"aria-label":`${e} back to default`,className:`grid size-6 place-items-center rounded-md text-muted hover:bg-raise hover:text-ink`,children:/* @__PURE__ */ (0,V.jsx)(gw,{className:`size-3.5`,"aria-hidden":!0})})})]})]}),/* @__PURE__ */ (0,V.jsxs)(Ys,{min:0,max:t.length-1,step:1,value:[f],onValueChange:([e])=>r(t[e]),className:`relative flex h-6 touch-none items-center select-none`,"aria-label":e,children:[/* @__PURE__ */ (0,V.jsx)(nc,{className:`relative h-2 flex-1 overflow-hidden rounded-full bg-raise`,children:/* @__PURE__ */ (0,V.jsx)(ic,{className:d?`absolute h-full bg-accent`:`absolute h-full bg-rule`})}),/* @__PURE__ */ (0,V.jsx)(dc,{"aria-valuetext":d?a(Number(n)):s,className:d?`block size-5 rounded-full border-2 border-accent bg-panel shadow-sm`:`block size-5 rounded-full border-2 border-rule bg-panel`})]}),c&&/* @__PURE__ */ (0,V.jsx)(`div`,{className:`grid text-[11px] text-muted`,style:{gridTemplateColumns:`repeat(${c.length}, minmax(0, 1fr))`},children:c.map((e,i)=>{let a=i===0?`text-left`:i===c.length-1?`text-right`:`text-center`;return c.length===t.length?/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,onClick:()=>r(t[i]),tabIndex:-1,className:`${a} hover:text-ink ${t[i]===Number(n)?`font-semibold text-ink`:``}`,children:e},i):/* @__PURE__ */ (0,V.jsx)(`span`,{className:a,children:e},i)})})]})}var EE={printer:``,material:`PLA`,process:``,filament:``,quality:``,infill:``,walls:``,supports:``},DE=[10,15,20,30,40,50,60,70,80,90];function OE(e,t,n=[0,0,0]){let r={filename:e.name,size:e.size};for(let e of[`printer`,`material`,`process`,`filament`,`quality`,`infill`,`walls`,`mode`])t[e]!=null&&t[e]!==``&&(r[e]=t[e]);return t.supports&&(r.supports=t.supports===`true`),t.gcode&&(r.gcode=!0),t.plate&&(r.plate=!0),[`rotX`,`rotY`,`rotZ`].forEach((e,t)=>{n[t]&&(r[e]=n[t])}),r}var kE=[{id:`PLA`,hint:`Everyday parts, easiest to print`},{id:`PETG`,hint:`Tougher, handles water and some heat`},{id:`ABS`,hint:`Heat-resistant, best in an enclosed printer`},{id:`TPU`,hint:`Flexible, rubber-like`}],AE=[{id:`standard`,label:`Standard`,mm:.2},{id:`medium`,label:`Fine`,mm:.15},{id:`high`,label:`Extra fine`,mm:.1}],jE=[1,2,3,4,5,6],ME={printer:``,material:`PLA`,quality:`standard`,infill:15,walls:3};function NE(e){let t=kE.filter(t=>e.includes(t.id)),n=e.filter(e=>!kE.some(t=>t.id===e)).map(e=>({id:e,hint:``}));return[...t,...n]}var PE=(e,t)=>({uploading:`Uploading`,waiting:`Waiting for a free slot`})[e]||t;function FE(e){return/\b(P1S|X1|X1 Carbon|X1E|H2D|H2S|P2S)\b/.test(e)?!0:!/\b(A1|A1 mini|P1P)\b/.test(e)&&null}function IE(e,t){return e===`ABS`&&FE(t)===!1?`ABS can warp on an open-frame printer like ours; PETG is often a better choice.`:null}function LE(e){return e?e.printers.map(t=>({value:`printer:`+t,label:t,...t===e.defaultPrinter?{hint:`default`}:{}})):[]}function RE(e){let t=Math.round(e/60),n=Math.floor(t/60),r=t%60;return n?r?`${n} h ${r} min`:`${n} h`:r?`${r} min`:`under a minute`}var zE=e=>Math.round(e*100)/100;function BE(e,t){return e==null?null:t?{low:Math.floor(zE(e)),high:Math.ceil(zE(e*(100+t)/100))}:{low:e,high:e}}function VE(e,t){if(!t)return{low:e,high:e};let n=BE(e/60,t);return{low:n.low*60,high:n.high*60}}function HE(e,t){let n=e=>new Intl.NumberFormat(void 0,{style:`currency`,currency:t,minimumFractionDigits:0,maximumFractionDigits:0}).format(e);return e.low===e.high?n(e.low):`${n(e.low)} – ${n(e.high)}`}var UE=e=>e.low===e.high?`${e.low} g`:`${e.low} – ${e.high} g`;function WE(e){return e.low===e.high?RE(e.low):e.high<3600?`${e.low/60} – ${e.high/60} min`:`${RE(e.low)} – ${RE(e.high)}`}function GE(e,t,n,r){let i=zE(e.weightG*t),a=e.seconds*t,o=r&&r.range;return{grams:i,seconds:a,currency:n?n.currency:null,range:n?{low:n.min*t,high:n.max*t}:null,gramsRange:BE(i,o),secondsRange:VE(a,o)}}function KE(e,t){let n=e.map(e=>GE(e.stats,e.copies,e.price,t)),r=[...new Set(e.filter(e=>!e.price).map(e=>e.material))],i=e=>zE(n.reduce((t,n)=>t+e(n),0)),a=e=>({low:i(t=>t[e].low),high:i(t=>t[e].high)});return{grams:i(e=>e.grams),seconds:n.reduce((e,t)=>e+t.seconds,0),currency:n.map(e=>e.currency).find(Boolean)??null,unpriced:r,range:r.length?null:a(`range`),gramsRange:a(`gramsRange`),secondsRange:a(`secondsRange`)}}var qE=[{value:``,label:`Default`},{value:`standard`,label:`0.2`},{value:`medium`,label:`0.15`},{value:`high`,label:`0.1`}],JE=[{value:``,label:`Default`},{value:`false`,label:`Off`},{value:`true`,label:`On`}],YE=e=>`${e} ${e===1?`wall`:`walls`}`;function XE({settings:e,onChange:t}){return/* @__PURE__ */ (0,V.jsx)(Fw,{n:5,title:`Print settings`,done:!0,children:/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`space-y-4`,children:[/* @__PURE__ */ (0,V.jsx)(Iw,{label:`Layer height`,hint:`mm`,children:/* @__PURE__ */ (0,V.jsx)(fE,{label:`Layer height`,value:e.quality,onChange:e=>t({quality:e}),options:qE})}),/* @__PURE__ */ (0,V.jsx)(TE,{label:`Infill`,values:DE,value:e.infill,onChange:e=>t({infill:e}),format:e=>`${e}%`,defaultValue:15,defaultLabel:`Printer default`}),/* @__PURE__ */ (0,V.jsx)(TE,{label:`Walls`,values:jE,value:e.walls,onChange:e=>t({walls:e}),format:YE,defaultValue:3,defaultLabel:`Printer default`}),/* @__PURE__ */ (0,V.jsx)(Iw,{label:`Supports`,children:/* @__PURE__ */ (0,V.jsx)(fE,{label:`Supports`,value:e.supports,onChange:e=>t({supports:e}),options:JE})}),/* @__PURE__ */ (0,V.jsx)(`p`,{className:`text-[13px] text-muted`,children:`Default keeps the printer’s own process, and the shop’s setting for supports.`})]})})}function ZE(e){let[t,n]=(0,B.useState)(()=>matchMedia(e).matches);return(0,B.useEffect)(()=>{let t=matchMedia(e),r=()=>n(t.matches);return r(),t.addEventListener(`change`,r),()=>t.removeEventListener(`change`,r)},[e]),t}function QE({theme:e,onTheme:t}){let n=ZE(`(prefers-color-scheme: dark)`),r=e===`dark`||e===`system`&&n;return/* @__PURE__ */ (0,V.jsxs)(`button`,{type:`button`,role:`switch`,"aria-checked":r,"aria-label":`Dark theme`,title:r?`Switch to light`:`Switch to dark`,onClick:()=>t(r?`light`:`dark`),className:`relative inline-flex h-7 w-[52px] shrink-0 items-center rounded-full bg-raise p-0.5 transition-colors hover:bg-rule`,children:[/* @__PURE__ */ (0,V.jsx)(`span`,{"aria-hidden":!0,className:E(`absolute top-0.5 left-0.5 size-6 rounded-full bg-accent transition-transform duration-200`,r&&`translate-x-6`)}),/* @__PURE__ */ (0,V.jsx)(Ew,{className:E(`relative z-10 m-1 size-4 transition-colors`,r?`text-muted`:`text-accent-contrast`),"aria-hidden":!0}),/* @__PURE__ */ (0,V.jsx)(fw,{className:E(`relative z-10 m-1 size-4 transition-colors`,r?`text-accent-contrast`:`text-muted`),"aria-hidden":!0})]})}function $E(e){let[t,n]=(0,B.useState)(Date.now);return(0,B.useEffect)(()=>{if(!e)return;n(Date.now());let t=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(t)},[e]),e?Math.max(0,Math.round((t-e)/1e3)):0}function eD({plates:e,position:t,settings:n,onSettings:r,printers:i,ourPrinters:a=[],options:o,toSlice:s,slicingSince:c,phase:l,blocker:u,onSlice:d,onOpenGcode:f,theme:p,onTheme:m}){let h=$E(c);return/* @__PURE__ */ (0,V.jsxs)(`aside`,{className:`flex flex-col border-rule bg-panel md:min-h-0 md:w-[340px] md:shrink-0 md:border-r lg:w-[380px]`,children:[/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`md:min-h-0 md:flex-1 md:overflow-y-auto`,children:[/* @__PURE__ */ (0,V.jsx)(lT,{...e}),/* @__PURE__ */ (0,V.jsx)(pT,{n:2,...t}),/* @__PURE__ */ (0,V.jsx)(xE,{printers:i,ourPrinters:a,printer:n.printer,onChange:e=>r({printer:e,process:``,filament:``})}),/* @__PURE__ */ (0,V.jsx)(wE,{settings:n,onChange:r,options:o}),/* @__PURE__ */ (0,V.jsx)(XE,{settings:n,onChange:r})]}),/* @__PURE__ */ (0,V.jsxs)(`footer`,{className:`sticky bottom-0 border-t border-rule bg-panel px-5 py-4`,children:[u&&!c&&/* @__PURE__ */ (0,V.jsx)(`p`,{className:`mb-2.5 text-[13px] text-muted`,children:u}),/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[/* @__PURE__ */ (0,V.jsx)(j,{label:`Open G-code`,side:`top`,children:/* @__PURE__ */ (0,V.jsx)(zw,{size:`icon`,className:`size-11`,"aria-label":`Open G-code`,onClick:f,children:/* @__PURE__ */ (0,V.jsx)(ew,{className:`size-[18px]`,"aria-hidden":!0})})}),m&&/* @__PURE__ */ (0,V.jsx)(QE,{theme:p,onTheme:m}),/* @__PURE__ */ (0,V.jsx)(zw,{variant:`primary`,size:`lg`,className:`min-w-0 flex-1 justify-center px-3`,disabled:!!u||!!c,onClick:d,children:c?/* @__PURE__ */ (0,V.jsxs)(V.Fragment,{children:[/* @__PURE__ */ (0,V.jsx)(ee,{className:`size-[18px] shrink-0 animate-spin`,"aria-hidden":!0}),` `,/* @__PURE__ */ (0,V.jsx)(`span`,{className:`truncate`,children:PE(l,`Slicing`)}),` `,/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`num`,children:[h,` s`]})]}):/* @__PURE__ */ (0,V.jsxs)(V.Fragment,{children:[/* @__PURE__ */ (0,V.jsx)(ow,{className:`size-[18px] shrink-0`,"aria-hidden":!0}),` `,/* @__PURE__ */ (0,V.jsx)(`span`,{className:`truncate`,children:s>1?`Slice ${s} plates`:`Slice plate`})]})})]})]})]})}var tD=e=>{let t=ge.indexOf(e);return t<0?ge.length-1:t};function nD({features:e,hidden:t,onHidden:n,open:r,onOpen:i}){let a=e.reduce((e,t)=>e+t.e,0)||1,o=e.map((e,t)=>({...e,i:t})).sort((e,t)=>tD(e.name)-tD(t.name)),s=e.map((e,t)=>t),c=(e,r)=>{if(e.altKey){let e=t.size===s.length-1&&!t.has(r);n(new Set(e?[]:s.filter(e=>e!==r)))}else{let e=new Set(t);e.has(r)?e.delete(r):e.add(r),n(e)}};return/* @__PURE__ */ (0,V.jsxs)(`div`,{className:E(`overflow-hidden rounded-xl border border-rule bg-panel/90 backdrop-blur`,r?`w-64`:`w-auto`),children:[/* @__PURE__ */ (0,V.jsxs)(`button`,{type:`button`,onClick:()=>i(!r),"aria-expanded":r,className:`flex w-full items-center gap-2 px-3.5 py-2.5 text-[14px] font-semibold`,children:[`Features`,t.size>0&&/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`num text-[12px] font-normal text-muted`,children:[e.length-t.size,` of `,e.length,` shown`]}),/* @__PURE__ */ (0,V.jsx)(PC,{className:E(`ml-auto size-4 text-muted transition-transform`,r&&`rotate-180`),"aria-hidden":!0})]}),/* @__PURE__ */ (0,V.jsx)(Uy,{initial:!1,children:r&&/* @__PURE__ */ (0,V.jsxs)(Ix.div,{initial:{height:0},animate:{height:`auto`},exit:{height:0},transition:{duration:.2,ease:`easeOut`},children:[/* @__PURE__ */ (0,V.jsx)(`ul`,{className:`px-1.5 pb-1.5`,children:o.map(e=>{let n=t.has(e.i),r=e.e/a*100;return/* @__PURE__ */ (0,V.jsx)(`li`,{children:/* @__PURE__ */ (0,V.jsxs)(`button`,{type:`button`,onClick:t=>c(t,e.i),"aria-pressed":!n,className:E(`flex w-full items-center gap-2.5 rounded-md px-2 py-1.5 text-left text-[13px] hover:bg-raise`,n&&`text-muted`),children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:`size-3 shrink-0 rounded-[3px]`,style:{background:me(e.name),opacity:n?.3:1},"aria-hidden":!0}),/* @__PURE__ */ (0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:he(e.name)}),/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`num text-[12px] text-muted`,children:[r<.1?`<0.1`:r.toFixed(1),`%`]}),n?/* @__PURE__ */ (0,V.jsx)(XC,{className:`size-3.5 text-muted`,"aria-hidden":!0}):/* @__PURE__ */ (0,V.jsx)(QC,{className:`size-3.5 text-muted/60`,"aria-hidden":!0})]})},e.i)})}),/* @__PURE__ */ (0,V.jsx)(`p`,{className:`border-t border-rule px-3.5 py-2 text-[12px] text-muted`,children:t.size?/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,className:`font-medium text-ink underline underline-offset-2`,onClick:()=>n(/* @__PURE__ */ new Set),children:`Show all`}):`Alt-click a feature to see only it`})]})})]})}function rD(e){let t=e.length?e[e.length-1].z:0,n=[1,2,5,10,20,25,50,100].find(e=>t/e<=10)||200,r=[];for(let i=n;i<=t+1e-6;i+=n){let t=e.findIndex(e=>e.z>=i-1e-6);t>=0&&r.push({z:i,at:e.length>1?t/(e.length-1):0})}return r}function iD({layer:e,z:t,vertical:n,at:r}){return/* @__PURE__ */ (0,V.jsxs)(`span`,{className:E(`pointer-events-none absolute flex items-baseline gap-1.5 whitespace-nowrap rounded-md bg-ink px-2 py-1 text-ink-contrast shadow-sm`,n?`top-1/2 right-[calc(100%+10px)] -translate-y-1/2`:`bottom-[calc(100%+10px)] left-1/2`),style:n?void 0:{transform:`translateX(-${r*100}%)`},children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:`num text-[13px] font-semibold`,children:e}),/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`num text-[11px] opacity-70`,children:[t.toFixed(2),` mm`]})]})}function aD({layers:e,fallbackZ:t,value:n,onChange:r,vertical:i}){let a=Math.max(1,e.length),o=(0,B.useMemo)(()=>rD(e),[e]),s=n=>e[n-1]?e[n-1].z:t,c=e=>a>1?(e-1)/(a-1):0,[l,u]=n;return/* @__PURE__ */ (0,V.jsx)(`div`,{className:E(`flex rounded-xl border border-rule bg-panel/90 backdrop-blur`,i?`h-full w-16 flex-col items-center py-4`:`h-14 w-full items-center px-5`),children:/* @__PURE__ */ (0,V.jsxs)(Ys,{orientation:i?`vertical`:`horizontal`,min:1,max:a,step:1,minStepsBetweenThumbs:0,value:n,onValueChange:r,className:E(`relative flex touch-none select-none`,i?`h-full w-5 flex-col items-center`:`h-5 w-full items-center`),children:[/* @__PURE__ */ (0,V.jsx)(nc,{className:E(`relative grow rounded-full bg-raise`,i?`w-1.5`:`h-1.5`),children:/* @__PURE__ */ (0,V.jsx)(ic,{className:E(`absolute rounded-full bg-ink`,i?`w-full`:`h-full`)})}),o.map(e=>/* @__PURE__ */ (0,V.jsxs)(`span`,{className:E(`pointer-events-none absolute flex items-center gap-1 text-[10px] text-muted`,i?`left-[calc(100%+4px)] -translate-y-1/2`:`top-[calc(100%+3px)] -translate-x-1/2 flex-col`),style:i?{bottom:`${e.at*100}%`}:{left:`${e.at*100}%`},"aria-hidden":!0,children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:E(`bg-muted/60`,i?`h-px w-1.5`:`h-1.5 w-px`)}),/* @__PURE__ */ (0,V.jsx)(`span`,{className:`num`,children:e.z})]},e.z)),/* @__PURE__ */ (0,V.jsx)(dc,{"aria-label":`Bottom layer`,className:`relative block size-4 rounded-full border-2 border-ink bg-panel`,children:l>1&&/* @__PURE__ */ (0,V.jsx)(iD,{layer:l,z:s(l),vertical:i,at:c(l)})}),/* @__PURE__ */ (0,V.jsx)(dc,{"aria-label":`Top layer`,className:`relative block size-5 rounded-full border-2 border-ink bg-ink`,children:/* @__PURE__ */ (0,V.jsx)(iD,{layer:u,z:s(u),vertical:i,at:c(u)})})]})})}var oD=e=>e==null?null:`${+e.toFixed(3)} mm`;function sD(e){let t=Math.max(0,Math.round(e)),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60;return[n&&`${n}h`,(n||r)&&`${r}m`,`${i}s`].filter(Boolean).join(` `)}function cD(e){if(!e.bed)return null;let t=e.bed.map(e=>e[0]),n=e.bed.map(e=>e[1]);return[Math.max(...t)-Math.min(...t),Math.max(...n)-Math.min(...n),e.bedHeight].filter(e=>e!=null).map(e=>+e.toFixed(1)).join(` × `)+` mm`}function lD({value:e,unit:t,label:n}){return/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`min-w-0`,children:[/* @__PURE__ */ (0,V.jsxs)(`p`,{className:`num display text-[20px] leading-none font-semibold whitespace-nowrap`,children:[e,t&&/* @__PURE__ */ (0,V.jsx)(`span`,{className:`ml-0.5 text-[13px] font-medium text-muted`,children:t})]}),/* @__PURE__ */ (0,V.jsx)(`p`,{className:`mt-1 text-[12px] text-muted`,children:n})]})}function uD({result:e,quote:t}){let n=e.meta,r=t&&t.used,i=t&&t.stats,a=[[`Sliced with`,n.generatedBy&&n.generatedBy.split(` on `)[0]],[`Printer`,r&&r.printer||n.printer],[`Process`,r&&r.process||n.process],[`Filament`,r&&r.filament||n.filament],[`Material`,n.filamentType],[`Layer height`,oD(n.layerHeight)],[`Nozzle`,oD(n.nozzle)],[`Total time`,n.totalTime&&`${n.totalTime} with start and end`],[`Filament volume`,n.filamentCm3!=null&&`${n.filamentCm3} cm³`],[`Bed`,cD(n)],[`Model size`,i&&i.sizeMm.map(e=>+e.toFixed(1)).join(` × `)+` mm`],[`Model volume`,i&&`${i.volumeCm3} cm³`],[`Watertight`,i&&(i.watertight?`Yes`:`No, results may be off`)]].filter(([,e])=>e);return/* @__PURE__ */ (0,V.jsx)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-4 gap-y-1.5 text-[13px]`,children:a.flatMap(([e,t])=>[/* @__PURE__ */ (0,V.jsx)(`dt`,{className:`text-muted`,children:e},e),/* @__PURE__ */ (0,V.jsx)(`dd`,{className:`text-right font-medium [overflow-wrap:anywhere]`,children:t},e+`:`)])})}function dD({result:e,quote:t,thumbnail:n}){let{portal:r}=i(),a=e.meta,o=t&&t.stats,s=a.filamentG??(o&&o.weightG),c=a.printTime||o&&sD(o.seconds);return/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`flex w-full items-start gap-3 rounded-xl border border-rule bg-panel/90 px-4 py-3 backdrop-blur lg:w-auto lg:items-center`,children:[/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`grid flex-1 grid-cols-2 gap-x-6 gap-y-3 sm:grid-cols-4 lg:flex lg:gap-6`,children:[s!=null&&/* @__PURE__ */ (0,V.jsx)(lD,{value:s,unit:`g`,label:`Weight`}),c&&/* @__PURE__ */ (0,V.jsx)(lD,{value:c,label:`Print time`}),a.filamentMm!=null&&/* @__PURE__ */ (0,V.jsx)(lD,{value:(a.filamentMm/1e3).toFixed(2),unit:`m`,label:`Filament`}),/* @__PURE__ */ (0,V.jsx)(lD,{value:Math.max(1,e.layers.length),label:`Layers`})]}),/* @__PURE__ */ (0,V.jsxs)(_o,{children:[/* @__PURE__ */ (0,V.jsx)(j,{label:`Print details`,children:/* @__PURE__ */ (0,V.jsx)(yo,{asChild:!0,children:/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,"aria-label":`Print details`,className:`ml-auto grid size-8 place-items-center rounded-md text-muted hover:bg-raise hover:text-ink`,children:/* @__PURE__ */ (0,V.jsx)(iw,{className:`size-[18px]`,"aria-hidden":!0})})})}),/* @__PURE__ */ (0,V.jsx)(Co,{container:r,children:/* @__PURE__ */ (0,V.jsxs)(To,{side:`top`,align:`start`,sideOffset:10,className:`z-50 w-80 rounded-xl border border-rule bg-panel p-4 shadow-[0_12px_32px_-12px_rgb(0_0_0/0.35)]`,children:[/* @__PURE__ */ (0,V.jsx)(`p`,{className:`mb-3 text-[14px] font-semibold`,children:`Print details`}),n&&/* @__PURE__ */ (0,V.jsx)(`img`,{src:n,alt:`The sliced plate`,className:`mb-3 aspect-[4/3] w-full rounded-lg bg-viewer object-contain`}),/* @__PURE__ */ (0,V.jsx)(uD,{result:e,quote:t})]})})]})]})}function fD(){let{layout:e}=i(),[t,n]=(0,B.useState)(()=>({width:e.clientWidth,height:e.clientHeight}));return(0,B.useEffect)(()=>{let t=new ResizeObserver(()=>n(t=>t.width===e.clientWidth&&t.height===e.clientHeight?t:{width:e.clientWidth,height:e.clientHeight}));return t.observe(e),()=>t.disconnect()},[e]),t}var pD=(0,B.lazy)(()=>import(`./chunks/Viewer3D-MGmKZLAb.js`)),mD=(0,B.lazy)(()=>import(`./chunks/PlateEditor-BbouIi-O.js`)),hD=[{value:`iso`,label:`3D`},{value:`top`,label:`Top`},{value:`front`,label:`Front`}];function gD({children:e}){return/* @__PURE__ */ (0,V.jsx)(Ix.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.2},className:`absolute top-1/2 left-1/2 z-20 w-[min(360px,calc(100%-32px))] -translate-x-1/2 -translate-y-1/2 rounded-2xl border border-rule bg-panel p-6 text-center`,children:e})}function _D({slicing:e}){let t=$E(e.since);return/* @__PURE__ */ (0,V.jsxs)(gD,{children:[/* @__PURE__ */ (0,V.jsx)(ee,{className:`mx-auto size-7 animate-spin text-muted`,"aria-hidden":!0}),/* @__PURE__ */ (0,V.jsx)(`p`,{className:`mt-3 text-[15px] font-semibold`,children:e.title}),/* @__PURE__ */ (0,V.jsx)(`p`,{className:`mt-1 text-[13px] text-muted`,children:e.printer}),/* @__PURE__ */ (0,V.jsx)(`div`,{className:`mt-4 h-1.5 overflow-hidden rounded-full bg-raise`,children:/* @__PURE__ */ (0,V.jsx)(Ix.div,{className:`h-full w-1/3 rounded-full bg-ink`,animate:{x:[`-100%`,`300%`]},transition:{repeat:1/0,duration:1.4,ease:`easeInOut`}})}),/* @__PURE__ */ (0,V.jsxs)(`p`,{className:`num mt-2 text-[12px] text-muted`,children:[t,` s`]})]})}function vD({title:e,text:t,onChooseModel:n,onOpenGcode:r}){return/* @__PURE__ */ (0,V.jsx)(`div`,{className:`pointer-events-none absolute inset-0 grid place-items-center p-6`,children:/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`pointer-events-auto max-w-sm rounded-2xl bg-panel/85 p-5 text-center backdrop-blur`,children:[/* @__PURE__ */ (0,V.jsx)(ow,{className:`mx-auto size-9 text-muted`,strokeWidth:1.5,"aria-hidden":!0}),/* @__PURE__ */ (0,V.jsx)(`p`,{className:`display mt-3 text-[18px] font-semibold`,children:e}),/* @__PURE__ */ (0,V.jsx)(`p`,{className:`mt-2 text-[14px] text-muted`,children:t}),/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`mt-4 flex flex-wrap justify-center gap-2`,children:[n&&/* @__PURE__ */ (0,V.jsxs)(zw,{variant:`primary`,onClick:n,children:[/* @__PURE__ */ (0,V.jsx)(Ow,{className:`size-4`,"aria-hidden":!0}),` Choose models`]}),/* @__PURE__ */ (0,V.jsxs)(zw,{onClick:r,children:[/* @__PURE__ */ (0,V.jsx)(ew,{className:`size-4`,"aria-hidden":!0}),` Open G-code`]})]})]})})}function yD({mode:e,onMode:t}){return/* @__PURE__ */ (0,V.jsx)(fE,{label:`Prepare or preview`,value:e,onChange:t,className:`w-[188px] border border-rule bg-panel/90 backdrop-blur`,options:[{value:`prepare`,label:`Prepare`},{value:`preview`,label:`Preview`}]})}function bD({label:e,pressed:t,onClick:n,children:r,...i}){return/* @__PURE__ */ (0,V.jsx)(j,{label:e,children:/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,"aria-label":e,"aria-pressed":t,onClick:n,...i,className:E(`grid size-9 place-items-center rounded-lg border border-rule bg-panel/90 text-muted backdrop-blur hover:text-ink`,t&&`border-ink text-ink`),children:r})})}function xD({gcode:e,slicing:t,mode:n,onMode:r,editor:i,emptyPlate:a,note:o,onChooseModel:s,onOpenGcode:c}){let{status:l,result:u}=e,d=l===`ready`,f=fD(),p=f.width>=1024,m=f.height<520,h=f.width<768?Math.max(300,Math.round(Math.min(f.height,window.innerHeight)*.58)):void 0,g=ox(),[_,v]=(0,B.useState)([1,1]),[y,b]=(0,B.useState)(()=>/* @__PURE__ */ new Set),[x,S]=(0,B.useState)(!1),[C,w]=(0,B.useState)(`iso`),[T,E]=(0,B.useState)(0),[D,O]=(0,B.useState)(p&&!m),k=(0,B.useRef)(null);(0,B.useEffect)(()=>{if(!u)return;let e=Math.max(1,u.layers.length);if(b(/* @__PURE__ */ new Set),w(`iso`),g||e<3){v([1,e]);return}v([1,1]);let t=Fx(1,e,{duration:1.2,ease:[.22,1,.36,1],onUpdate:e=>v([1,Math.round(e)])});return k.current=t,()=>t.stop()},[u,g]);let A=n===`preview`,M=A&&d,N=(0,B.useMemo)(()=>e.download?URL.createObjectURL(e.download):null,[e.download]);return(0,B.useEffect)(()=>()=>{N&&URL.revokeObjectURL(N)},[N]),/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`relative flex min-h-0 flex-col md:h-full`,children:[/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`relative overflow-hidden bg-viewer md:flex-1`,style:{height:h},children:[M&&/* @__PURE__ */ (0,V.jsx)(`div`,{className:`absolute inset-0`,children:/* @__PURE__ */ (0,V.jsx)(B.Suspense,{fallback:null,children:/* @__PURE__ */ (0,V.jsx)(pD,{result:u,layerMin:_[0]-1,layerMax:_[1]-1,hidden:y,showTravels:x,view:C,fitKey:T})})}),!A&&i&&/* @__PURE__ */ (0,V.jsx)(B.Suspense,{fallback:null,children:/* @__PURE__ */ (0,V.jsx)(mD,{...i})}),!A&&a&&!t&&/* @__PURE__ */ (0,V.jsx)(vD,{title:`Put models on the plate`,onChooseModel:s,onOpenGcode:c,text:`Drop models anywhere on the page (STL, 3MF, OBJ, STEP or IGES), or choose them. Each lands where there is room, then you can move it.`}),!A&&o&&!t&&/* @__PURE__ */ (0,V.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 top-16 z-10 flex justify-center px-4`,children:/* @__PURE__ */ (0,V.jsx)(`p`,{className:`max-w-md rounded-xl bg-panel/90 px-4 py-2.5 text-center text-[13px] text-muted backdrop-blur`,children:o})}),A&&l===`empty`&&!t&&/* @__PURE__ */ (0,V.jsx)(vD,{title:`Slice a plate to see how it prints`,onOpenGcode:c,text:`Its G-code shows here, layer by layer. Already have G-code or a sliced 3MF? Open it to inspect it.`}),t&&/* @__PURE__ */ (0,V.jsx)(_D,{slicing:t}),A&&l===`loading`&&!t&&/* @__PURE__ */ (0,V.jsxs)(gD,{children:[/* @__PURE__ */ (0,V.jsxs)(`p`,{className:`text-[15px] font-semibold`,children:[`Reading `,e.name]}),/* @__PURE__ */ (0,V.jsx)(`div`,{className:`mt-4 h-1.5 overflow-hidden rounded-full bg-raise`,children:/* @__PURE__ */ (0,V.jsx)(`div`,{className:`h-full rounded-full bg-ink transition-[width]`,style:{width:`${Math.round(e.progress*100)}%`}})})]}),A&&l===`error`&&!t&&/* @__PURE__ */ (0,V.jsxs)(gD,{children:[/* @__PURE__ */ (0,V.jsx)(ne,{className:`mx-auto size-7 text-danger`,"aria-hidden":!0}),/* @__PURE__ */ (0,V.jsx)(`p`,{className:`mt-3 text-[14px]`,role:`alert`,children:e.error}),/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`mt-4 flex justify-center gap-2`,children:[/* @__PURE__ */ (0,V.jsx)(zw,{onClick:c,children:`Open another file`}),/* @__PURE__ */ (0,V.jsx)(zw,{variant:`ghost`,onClick:e.close,children:`Close`})]})]}),/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`absolute top-3 left-3 z-20 flex flex-col items-start gap-2`,children:[/* @__PURE__ */ (0,V.jsx)(yD,{mode:n,onMode:r}),M&&/* @__PURE__ */ (0,V.jsx)(nD,{features:u.features,hidden:y,onHidden:b,open:D,onOpen:O})]}),M&&/* @__PURE__ */ (0,V.jsxs)(V.Fragment,{children:[/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`absolute top-3 right-3 z-10 flex flex-col items-end gap-2 sm:flex-row sm:items-center`,children:[/* @__PURE__ */ (0,V.jsx)(fE,{label:`View`,value:C,onChange:e=>{w(e),E(e=>e+1)},options:hD,className:`w-40 border border-rule bg-panel/90 backdrop-blur`}),/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`flex gap-2`,children:[/* @__PURE__ */ (0,V.jsx)(bD,{label:x?`Hide travel moves`:`Show travel moves`,pressed:x,onClick:()=>S(e=>!e),children:/* @__PURE__ */ (0,V.jsx)(vw,{className:`size-[18px]`,"aria-hidden":!0})}),/* @__PURE__ */ (0,V.jsx)(bD,{label:`Fit to model`,onClick:()=>E(e=>e+1),children:/* @__PURE__ */ (0,V.jsx)(Sw,{className:`size-[18px]`,"aria-hidden":!0})})]})]}),/* @__PURE__ */ (0,V.jsx)(`div`,{className:p?`absolute top-[72px] right-3 bottom-28 z-10`:`absolute inset-x-3 bottom-3 z-10`,children:/* @__PURE__ */ (0,V.jsx)(aD,{layers:u.layers,fallbackZ:u.bounds?u.bounds.max[2]:0,value:_,vertical:p,onChange:e=>{k.current?.stop(),v(e)}})})]})]}),M&&/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 border-t border-rule bg-panel p-3 lg:absolute lg:bottom-3 lg:left-3 lg:z-10 lg:max-w-[calc(100%-110px)] lg:flex-nowrap lg:border-0 lg:bg-transparent lg:p-0`,children:[/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1 rounded-xl border border-rule bg-panel/90 py-1.5 pr-1.5 pl-3 backdrop-blur`,children:[/* @__PURE__ */ (0,V.jsx)(ew,{className:`size-4 shrink-0 text-muted`,"aria-hidden":!0}),/* @__PURE__ */ (0,V.jsx)(`span`,{className:`max-w-[220px] truncate text-[13px] font-medium`,title:e.name,children:e.name}),N&&/* @__PURE__ */ (0,V.jsx)(j,{label:`Download G-code`,children:/* @__PURE__ */ (0,V.jsx)(`a`,{href:N,download:e.name,"aria-label":`Download G-code`,className:`grid size-7 place-items-center rounded-md text-muted hover:bg-raise hover:text-ink`,children:/* @__PURE__ */ (0,V.jsx)(KC,{className:`size-4`,"aria-hidden":!0})})}),/* @__PURE__ */ (0,V.jsx)(j,{label:`Close`,children:/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,"aria-label":`Close file`,onClick:e.close,className:`grid size-7 place-items-center rounded-md text-muted hover:bg-raise hover:text-ink`,children:/* @__PURE__ */ (0,V.jsx)(Aw,{className:`size-4`,"aria-hidden":!0})})})]}),/* @__PURE__ */ (0,V.jsx)(dD,{result:u,quote:e.quote,thumbnail:e.thumbnail})]})]})}var SD=(e,t)=>`${String(e||``).replace(/\/+$/,``)}${t}`;async function CD(e,{body:t,csrf:n,...r}={}){let i={Accept:`application/json`};t&&(i[`Content-Type`]=`application/json`),n&&(i[`X-CSRF-TOKEN`]=n);let a=await fetch(e,{...r,headers:i,...t&&{body:JSON.stringify(t)}}).catch(()=>{throw Error(`The server can’t be reached.`)}),o=null;try{o=await a.json()}catch{}if(!a.ok){let e=Number(a.headers.get(`Retry-After`))||void 0;throw Object.assign(Error(o&&o.message||`Request failed (HTTP ${a.status})`),{status:a.status,retryAfter:e})}return o}var wD=e=>({401:`Sign in to slice`,403:`Your account can’t slice models`,419:`Your session has expired. Reload the page`})[e]||null;function TD(e,t){return e?t.error?t.error.status===503?`Slicing is off on this server`:wD(t.error.status)||`The server can’t be reached`:t.data&&!t.data.slicer?`Slicing is off on this server`:null:`Slicing isn’t set up on this page`}var ED=[`process`,`model`,`files`,`material`,`strength`,`cost`,`contact`],DD=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function OD(e){if(typeof e!=`string`||!e.trim())return null;try{let{protocol:t}=new URL(e.trim(),`https://page.invalid/`);return t===`https:`||t===`http:`?e.trim():null}catch{return null}}function kD(e,t=e=>console.warn(`slicer-studio: ${e}`)){let n=e;if(typeof e==`string`){if(!e.trim())return{};try{n=JSON.parse(e)}catch(e){return t(`config is not valid JSON: ${e.message}`),{}}}if(n==null)return{};if(!DD(n))return t(`config must be an object`),{};let{realtime:r,staffApi:i,contact:a,defaultPrinter:o,defaults:s,cards:c,button:l,advanced:u,...d}=n;for(let e of Object.keys(d))t(`unknown config key "${e}" left out`);let f={};if(r!==void 0){let{key:e,host:n,port:i,cluster:a,tls:o}=DD(r)?r:{};typeof e==`string`&&e.trim()?(f.realtime={key:e.trim()},typeof n==`string`&&n.trim()&&(f.realtime.host=n.trim()),Number.isInteger(i)&&i>0&&(f.realtime.port=i),typeof a==`string`&&a.trim()&&(f.realtime.cluster=a.trim()),typeof o==`boolean`&&(f.realtime.tls=o)):t(`realtime left out: it needs a key`)}if(i!==void 0){let{url:e,csrfToken:n}=DD(i)?i:{};typeof e==`string`&&e.trim()?f.staffApi={url:e.trim(),csrfToken:typeof n==`string`?n.trim():``}:t(`staffApi left out: it needs a url`)}if(DD(a)&&(f.contact={},typeof a.name==`string`&&(f.contact.name=a.name.trim()),typeof a.email==`string`&&a.email.includes(`@`)?f.contact.email=a.email.trim():a.email!==void 0&&t(`contact.email "${a.email}" left out: it is not an email address`)),typeof o==`string`&&o.trim()&&(f.defaultPrinter=o.trim()),DD(s)){f.defaults={},typeof s.material==`string`&&(f.defaults.material=s.material.toUpperCase());let e=(e,n)=>{n.includes(s[e])?f.defaults[e]=s[e]:s[e]!==void 0&&t(`defaults.${e} left out: it must be one of ${n.join(`, `)}`)};e(`quality`,AE.map(e=>e.id)),e(`infill`,DE),e(`walls`,jE)}if(Array.isArray(c)){f.cards=c.filter(e=>ED.includes(e));for(let e of c)ED.includes(e)||t(`card "${e}" left out: it must be one of ${ED.join(`, `)}`);!f.cards.includes(`model`)&&!f.cards.includes(`files`)&&(t(`cards need model or files, or there is nowhere to add a file: keeping model`),f.cards.push(`model`))}if(l!==void 0){let e=DD(l)&&typeof l.label==`string`?l.label.trim():``;if(!e||e.length>40)t(`button left out: it needs a label of 1 to 40 characters`);else if(f.button={label:e},l.url!==void 0){let e=OD(l.url);e?f.button.url=e:t(`button.url "${l.url}" left out: it must be an http(s) or relative address`)}}if(u!==void 0){let e=e=>{let n=DD(u)?u[e]:void 0;return typeof n==`string`&&n.trim()?n.trim():(t(`advanced.${e} must be a URL: Advanced stays closed until it is`),``)};f.advanced={authUrl:e(`authUrl`),verifyUrl:e(`verifyUrl`)}}return f}var AD=e=>new Set(e.cards||ED);function jD(e,t){return{...e,defaultPrinter:t.defaultPrinter||e.defaultPrinter||e.printers&&e.printers[0]||``,regularMode:{...e.regularMode},contact:{...e.contact,...t.contact}}}var MD=5e3,ND=3e4,PD=/* @__PURE__ */ new Map;async function FD({key:t,host:n,port:r=443,cluster:i=`mt1`,tls:a=!0}){let{default:o}=await import(`./chunks/pusher-BoV3x8Qs.js`).then(t=>/* @__PURE__ */ e(t.default,1));return new o(t,{cluster:i,wsHost:n,wsPort:r,wssPort:r,forceTLS:a,enabledTransports:[`ws`,`wss`],disableStats:!0})}function ID(e,t){let n=JSON.stringify(e),r=PD.get(n)||{pusher:t(e),users:0,idle:null};return PD.set(n,r),clearTimeout(r.idle),r.users++,{pusher:r.pusher,release:()=>{--r.users||(r.idle=setTimeout(()=>{PD.delete(n),r.pusher.then(e=>e.disconnect(),()=>{})},ND))}}}function LD(e,t,n,r,i=FD){if(!e)return{ready:Promise.resolve(!1),close:()=>{}};let{pusher:a,release:o}=ID(e,i),s=()=>{};return{ready:a.then(e=>new Promise(i=>{let a=e.subscribe(t),o=null,c=t=>{o!==null&&(clearTimeout(o),o=null,e.connection.bind(`connected`,r),i(t))};o=setTimeout(()=>c(!1),MD),a.bind(`quote.updated`,n),a.bind(`pusher:subscription_succeeded`,()=>c(!0)),a.bind(`pusher:subscription_error`,()=>c(!1)),s=()=>{e.connection.unbind(`connected`,r),a.unbind(),e.unsubscribe(t)}})).catch(()=>!1),close:()=>{s(),o()}}}var RD=6e4,zD=[1e3,2e3,4e3,8e3,15e3,3e4],BD=54e5,VD=60,HD=(e,t)=>t?RD:zD[e]??RD;async function UD(e,t,n,r){let i=()=>CD(e(`/quotes`),{method:`POST`,body:n,csrf:t});try{return await i()}catch(e){if(!e.retryAfter||e.retryAfter>VD)throw e;return r(`waiting`),await new Promise(t=>setTimeout(t,e.retryAfter*1e3)),i()}}async function WD({url:e,fields:t},n){let r=new FormData;Object.entries(t).forEach(([e,t])=>r.append(e,t)),r.append(`file`,n);let i=await fetch(e,{method:`POST`,body:r}).catch(()=>null);if(!i||!i.ok)throw Error(`The file could not be uploaded, please try again`)}async function GD({base:e,csrf:t,realtime:n,file:r,settings:i,rot:a,onStep:o=()=>{},watch:s=LD}){let c=t=>SD(e,t),l=await UD(c,t,OE(r,i,a),o);o(`uploading`);let u,d,f=new Promise((e,t)=>{u=e,d=t});f.catch(()=>{});let p=async()=>{try{let e=await CD(c(`/quotes/${l.id}`));(e.status===`done`||e.status===`failed`)&&u(e)}catch(e){e.status===404?d(/* @__PURE__ */ Error(`This quote has expired, please try again`)):e.status>=400&&e.status<500&&e.status!==429&&d(e)}},m=s(n,l.channel,p,p),h,g,_=!1,v=(e,t)=>{h=setTimeout(async()=>{await p(),_||v(e+1,t)},HD(e,t))};try{let e=await m.ready;e||console.warn(`slicer-studio: live updates are off, so prices are checked every few seconds at first, then each minute. Check the realtime option and connect-src.`),await WD(l.upload,r),o(`working`),await CD(c(`/quotes/${l.id}/start`),{method:`POST`,csrf:t}).catch(e=>{if(e.status!==409)throw e}),v(0,e),g=setTimeout(()=>d(/* @__PURE__ */ Error(`This is taking too long, please try again`)),BD);let n=await f;if(n.status===`failed`)throw Error(n.errorDetail||n.error||`This model could not be priced`);return n}finally{_=!0,clearTimeout(h),clearTimeout(g),m.close()}}async function KD(e,t){let n=await fetch(SD(e,`/quotes/${t}/gcode`)).catch(()=>null);if(!n||!n.ok)throw Error(`The G-code could not be downloaded`);return n.blob()}var qD=()=>{let{apiUrl:e}=i();return t=>SD(e,t)};function JD(){let e=qD(),{config:t}=i();return qt({queryKey:[`config`],queryFn:()=>CD(e(`/config`)),select:e=>jD(e,t)})}function YD(e){let t=qD();return qt({queryKey:[`materials`,e],queryFn:()=>CD(t(`/options?printer=${encodeURIComponent(e)}`)),enabled:!!e})}function XD(){let{apiUrl:e,config:t}=i();return Jt({mutationFn:({model:n,settings:r,rot:i,onStep:a})=>GD({base:e,realtime:t.realtime,file:n,settings:r,rot:i,onStep:a})})}function ZD(){let{staffApi:e}=i().config;return qt({queryKey:[`health`,e?.url],queryFn:()=>CD(SD(e.url,`/health`)),enabled:!!e,staleTime:6e4})}function QD(){let{staffApi:e}=i().config;return qt({queryKey:[`printers`,e?.url],queryFn:()=>CD(SD(e.url,`/printers`)),enabled:!!e,select:e=>gE(e.printers)})}function $D(e,t){let{staffApi:n}=i().config;return qt({queryKey:[`options`,n?.url,e,t],queryFn:()=>CD(SD(n.url,`/options?printer=${encodeURIComponent(e)}&material=${encodeURIComponent(t)}`)),enabled:!!n&&!!e,placeholderData:t=>t&&t.printer===e?t:void 0})}var eO=(e,t)=>({queryKey:[`bed`,e?.url,t],queryFn:()=>CD(SD(e.url,`/options?printer=${encodeURIComponent(t)}`)),enabled:!!e&&!!t});function tO(e){let{staffApi:t}=i().config,n=Gt({queries:e.map(e=>eO(t,e))}),r=e.map((e,t)=>[e,n[t].data&&n[t].data.bed]).filter(([,e])=>e),a=JSON.stringify(r);return(0,B.useMemo)(()=>Object.fromEntries(r),[a])}function nO(){let{staffApi:e,realtime:t}=i().config;return Jt({mutationFn:async({model:n,settings:r,rot:i,onStep:a})=>{let{url:o,csrfToken:s}=e,c=await GD({base:o,csrf:s,realtime:t,file:n,settings:{...r,mode:`exact`,gcode:!0},rot:i,onStep:a});if(!c.hasGcode)throw Error(`No G-code came back for this model`);return{...c,gcode:await KD(o,c.id)}}})}var rO='const e=Math.PI/18,t=1e-9;var n=class{constructor(e,t=4096){this.Type=e,this.a=new e(t),this.n=0}push(e){if(this.n===this.a.length){let e=new this.Type(this.n*2);e.set(this.a),this.a=e}this.a[this.n++]=e}done(){return this.a.slice(0,this.n)}};const r=e=>{let t=parseFloat(e);return Number.isFinite(t)?t:null},i=e=>Math.round(e*1e4)/1e4;function a(e){let t={};for(let[,n,r]of e.matchAll(/([A-Za-z])\\s*([-+]?(?:\\d+\\.?\\d*|\\.\\d+))/g))t[n.toUpperCase()]=Number(r);return t}function o(o,s){let c=/^;\\s*(?:CHANGE_LAYER|LAYER_CHANGE)\\s*$/m.test(o),l={start:new n(Float32Array),end:new n(Float32Array),feature:new n(Uint8Array),layer:new n(Float32Array),width:new n(Float32Array),height:new n(Float32Array)},u={pos:new n(Float32Array),layer:new n(Float32Array)},d=[],f=[],p=/* @__PURE__ */ new Map,m={},h={},g=[1/0,1/0,1/0],_=[-1/0,-1/0,-1/0],v=0,y=0,b=0,x=0,S=!1,C=!1,w=-1,T=null,E=null,D=!1,O=!1,k=()=>Math.max(0,d.length-1),A=e=>(p.has(e)||(p.set(e,f.length),f.push({name:e,e:0})),p.get(e));function j(e,t,n,a,o,s,u){if(!c&&(!d.length||Math.abs(s-d[d.length-1].z)>1e-4)){let e=d.length?d[d.length-1].z:0;d.push({z:i(s),height:i(Math.abs(s-e))})}w<0&&(w=A(`Custom`)),f[w].e+=u,l.start.push(e),l.start.push(t),l.start.push(n),l.end.push(a),l.end.push(o),l.end.push(s),l.feature.push(w),l.layer.push(k()),l.width.push(T??r(m.nozzle_diameter)??.4),l.height.push(E??r(m.layer_height)??.2),M(0,e),M(1,t),M(2,n),M(0,a),M(1,o),M(2,s)}function M(e,t){t<g[e]&&(g[e]=t),t>_[e]&&(_[e]=t)}function N(e,t,n,r,i,a){for(let o of[e,t,n,r,i,a])u.pos.push(o);u.layer.push(k())}function P(e,n,r,i,a,o,s){s>t&&(Math.abs(i-e)>t||Math.abs(a-n)>t)?j(e,n,r,i,a,o,s):(Math.abs(i-e)>t||Math.abs(a-n)>t||Math.abs(o-r)>t)&&N(e,n,r,i,a,o)}function F(e){let t;if(/^;\\s*(?:CHANGE_LAYER|LAYER_CHANGE)\\s*$/.test(e))d.push({z:i(b),height:E??r(m.layer_height)??.2}),D=O=!1;else if(t=e.match(/^;\\s*(?:Z_HEIGHT|Z):\\s*([-+\\d.]+)/))c&&d.length&&!D&&(d[d.length-1].z=r(t[1]),D=!0);else if(t=e.match(/^;\\s*(?:LAYER_HEIGHT|HEIGHT):\\s*([\\d.]+)/))E=r(t[1]),c&&d.length&&!O&&(d[d.length-1].height=E,O=!0);else if(t=e.match(/^;\\s*(?:FEATURE|TYPE):\\s*(.+?)\\s*$/))w=A(t[1]);else if(t=e.match(/^;\\s*(?:LINE_WIDTH|WIDTH):\\s*([\\d.]+)/))T=r(t[1]);else if(t=e.match(/^;\\s*(?:total )?filament used \\[(g|mm|cm3)\\]\\s*=\\s*([\\d.]+)/)){let e={g:`filamentG`,mm:`filamentMm`,cm3:`filamentCm3`}[t[1]];h[e]??(h[e]=r(t[2]))}else(t=e.match(/^;\\s*(\\w+)\\s*=\\s*(.*?)\\s*$/))?m[t[1]]=t[2].replace(/^"(.*)"$/,`$1`):(t=e.match(/^;\\s*generated by\\s+(.+?)\\s*$/i))?h.generatedBy=t[1]:/printing time/i.test(e)&&((t=e.match(/model printing time:\\s*([^;]+)/i))&&(h.printTime=t[1].trim()),(t=e.match(/total estimated time:\\s*([^;]+)/i))&&(h.totalTime=t[1].trim()),(t=e.match(/estimated printing time \\(normal mode\\)\\s*=\\s*(.+)/i))&&!h.printTime&&(h.printTime=t[1].trim()))}function I(n,r){let i=`X`in r?S?v+r.X:r.X:v,a=`Y`in r?S?y+r.Y:r.Y:y,o=`Z`in r?S?b+r.Z:r.Z:b,s=0;if(`E`in r){let e=S||C;s=e?r.E:r.E-x,x=e?x+r.E:r.E}if(!((n===2||n===3)&&(`I`in r||`J`in r)))P(v,y,b,i,a,o,s);else{let c=v+(r.I||0),l=y+(r.J||0),u=Math.hypot(v-c,y-l),d=Math.atan2(y-l,v-c),f=Math.atan2(a-l,i-c)-d;n===3&&f<=t&&(f+=2*Math.PI),n===2&&f>=-1e-9&&(f-=2*Math.PI);let p=Math.max(1,Math.ceil(Math.max(Math.abs(f)*u/1,Math.abs(f)/e))),m=v,h=y,g=b;for(let e=1;e<=p;e++){let t=d+f*e/p,n=e===p?i:c+u*Math.cos(t),r=e===p?a:l+u*Math.sin(t),_=b+(o-b)*e/p;P(m,h,g,n,r,_,s/p),m=n,h=r,g=_}}v=i,y=a,b=o}let L=0,R=0;for(;L<o.length;){let e=o.indexOf(`\n`,L);e<0&&(e=o.length);let t=o.slice(L,e).trim();if(L=e+1,s&&++R%5e4==0&&s(L/o.length),!t)continue;if(t[0]===`;`){F(t);continue}let n=t.indexOf(`;`),r=(n<0?t:t.slice(0,n)).trim(),i=r.match(/^([GMgm])(\\d+(?:\\.\\d+)?)(?=\\s|$)/);if(!i||i[2].includes(`.`))continue;let c=i[1].toUpperCase(),l=Number(i[2]);if(c===`G`&&l<=3)I(l,a(r.slice(i[0].length)));else if(c===`G`&&l===90)S=!1;else if(c===`G`&&l===91)S=!0;else if(c===`M`&&l===82)C=!1;else if(c===`M`&&l===83)C=!0;else if(c===`G`&&l===92){let e=a(r.slice(i[0].length));Object.keys(e).length||(v=y=b=x=0),`X`in e&&(v=e.X),`Y`in e&&(y=e.Y),`Z`in e&&(b=e.Z),`E`in e&&(x=e.E)}}s&&s(1);let z=m.printable_area?m.printable_area.split(`,`).map(e=>e.split(`x`).map(Number)):null;return Object.assign(h,{generatedBy:h.generatedBy??null,printer:m.printer_settings_id||null,process:m.print_settings_id||null,filament:m.filament_settings_id||null,filamentType:m.filament_type||null,nozzle:r(m.nozzle_diameter),layerHeight:r(m.layer_height),bed:z&&z.every(e=>e.length===2&&e.every(Number.isFinite))?z:null,bedHeight:r(m.printable_height),printTime:h.printTime??null,totalTime:h.totalTime??null,filamentG:h.filamentG??null,filamentMm:h.filamentMm??null,filamentCm3:h.filamentCm3??null}),{segments:{count:l.feature.n,start:l.start.done(),end:l.end.done(),feature:l.feature.done(),layer:l.layer.done(),width:l.width.done(),height:l.height.done()},travels:{count:u.layer.n,pos:u.pos.done(),layer:u.layer.done()},layers:d,features:f,meta:h,bounds:l.feature.n?{min:g,max:_}:null}}\n/*!\nfflate - fast JavaScript compression/decompression\n<https://101arrowz.github.io/fflate>\nLicensed under MIT. https://github.com/101arrowz/fflate/blob/master/LICENSE\nversion 0.8.2\n*/\nvar s=Uint8Array,c=Uint16Array,l=Int32Array,u=new s([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),d=new s([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),f=new s([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),p=function(e,t){for(var n=new c(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new l(n[30]),r=1;r<30;++r)for(var a=n[r];a<n[r+1];++a)i[a]=a-n[r]<<5|r;return{b:n,r:i}},m=p(u,2),h=m.b,g=m.r;h[28]=258,g[258]=28;var _=p(d,0),v=_.b;_.r;for(var y=new c(32768),b=0;b<32768;++b){var x=(b&43690)>>1|(b&21845)<<1;x=(x&52428)>>2|(x&13107)<<2,x=(x&61680)>>4|(x&3855)<<4,y[b]=((x&65280)>>8|(x&255)<<8)>>1}for(var S=(function(e,t,n){for(var r=e.length,i=0,a=new c(t);i<r;++i)e[i]&&++a[e[i]-1];var o=new c(t);for(i=1;i<t;++i)o[i]=o[i-1]+a[i-1]<<1;var s;if(n){s=new c(1<<t);var l=15-t;for(i=0;i<r;++i)if(e[i])for(var u=i<<4|e[i],d=t-e[i],f=o[e[i]-1]++<<d,p=f|(1<<d)-1;f<=p;++f)s[y[f]>>l]=u}else for(s=new c(r),i=0;i<r;++i)e[i]&&(s[i]=y[o[e[i]-1]++]>>15-e[i]);return s}),C=new s(288),b=0;b<144;++b)C[b]=8;for(var b=144;b<256;++b)C[b]=9;for(var b=256;b<280;++b)C[b]=7;for(var b=280;b<288;++b)C[b]=8;for(var w=new s(32),b=0;b<32;++b)w[b]=5;var T=/*#__PURE__*/ S(C,9,1),E=/*#__PURE__*/ S(w,5,1),D=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},O=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&n},k=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},A=function(e){return(e+7)/8|0},j=function(e,t,n){return(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new s(e.subarray(t,n))},M=[`unexpected EOF`,`invalid block type`,`invalid length/literal`,`invalid distance`,`stream finished`,`no stream handler`,,`no callback`,`invalid UTF-8 data`,`extra field too long`,`date not in range 1980-2099`,`filename too long`,`stream finishing`,`invalid zip data`],N=function(e,t,n){var r=Error(t||M[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,N),!n)throw r;return r},P=function(e,t,n,r){var i=e.length,a=r?r.length:0;if(!i||t.f&&!t.l)return n||new s(0);var o=!n,c=o||t.i!=2,l=t.i;o&&(n=new s(i*3));var p=function(e){var t=n.length;if(e>t){var r=new s(Math.max(t*2,e));r.set(n),n=r}},m=t.f||0,g=t.p||0,_=t.b||0,y=t.l,b=t.d,x=t.m,C=t.n,w=i*8;do{if(!y){m=O(e,g,1);var M=O(e,g+1,3);if(g+=3,!M){var P=A(g)+4,F=e[P-4]|e[P-3]<<8,I=P+F;if(I>i){l&&N(0);break}c&&p(_+F),n.set(e.subarray(P,I),_),t.b=_+=F,t.p=g=I*8,t.f=m;continue}if(M==1)y=T,b=E,x=9,C=5;else if(M==2){var L=O(e,g,31)+257,R=O(e,g+10,15)+4,z=L+O(e,g+5,31)+1;g+=14;for(var B=new s(z),V=new s(19),H=0;H<R;++H)V[f[H]]=O(e,g+H*3,7);g+=R*3;for(var U=D(V),W=(1<<U)-1,ee=S(V,U,1),H=0;H<z;){var G=ee[O(e,g,W)];g+=G&15;var P=G>>4;if(P<16)B[H++]=P;else{var K=0,q=0;for(P==16?(q=3+O(e,g,3),g+=2,K=B[H-1]):P==17?(q=3+O(e,g,7),g+=3):P==18&&(q=11+O(e,g,127),g+=7);q--;)B[H++]=K}}var te=B.subarray(0,L),J=B.subarray(L);x=D(te),C=D(J),y=S(te,x,1),b=S(J,C,1)}else N(1);if(g>w){l&&N(0);break}}c&&p(_+131072);for(var ne=(1<<x)-1,re=(1<<C)-1,Y=g;;Y=g){var K=y[k(e,g)&ne],X=K>>4;if(g+=K&15,g>w){l&&N(0);break}if(K||N(2),X<256)n[_++]=X;else if(X==256){Y=g,y=null;break}else{var ie=X-254;if(X>264){var H=X-257,Z=u[H];ie=O(e,g,(1<<Z)-1)+h[H],g+=Z}var Q=b[k(e,g)&re],$=Q>>4;Q||N(3),g+=Q&15;var J=v[$];if($>3){var Z=d[$];J+=k(e,g)&(1<<Z)-1,g+=Z}if(g>w){l&&N(0);break}c&&p(_+131072);var ae=_+ie;if(_<J){var oe=a-J,se=Math.min(J,ae);for(oe+_<0&&N(3);_<se;++_)n[_]=r[oe+_]}for(;_<ae;++_)n[_]=n[_-J]}}t.l=y,t.p=Y,t.b=_,t.f=m,y&&(m=1,t.m=x,t.d=b,t.n=C)}while(!m);return _!=n.length&&o?j(n,0,_):n.subarray(0,_)},F=/*#__PURE__*/ new s(0),I=function(e,t){return e[t]|e[t+1]<<8},L=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},R=function(e,t){return L(e,t)+L(e,t+4)*4294967296};function z(e,t){return P(e,{i:2},t&&t.out,t&&t.dictionary)}var B=typeof TextDecoder<`u`&&/*#__PURE__*/ new TextDecoder;try{B.decode(F,{stream:!0})}catch{}var V=function(e){for(var t=``,n=0;;){var r=e[n++],i=(r>127)+(r>223)+(r>239);if(n+i>e.length)return{s:t,r:j(e,n-1)};i?i==3?(r=((r&15)<<18|(e[n++]&63)<<12|(e[n++]&63)<<6|e[n++]&63)-65536,t+=String.fromCharCode(55296|r>>10,56320|r&1023)):i&1?t+=String.fromCharCode((r&31)<<6|e[n++]&63):t+=String.fromCharCode((r&15)<<12|(e[n++]&63)<<6|e[n++]&63):t+=String.fromCharCode(r)}};function H(e,t){if(t){for(var n=``,r=0;r<e.length;r+=16384)n+=String.fromCharCode.apply(null,e.subarray(r,r+16384));return n}if(B)return B.decode(e);var i=V(e),a=i.s,n=i.r;return n.length&&N(8),a}var U=function(e,t){return t+30+I(e,t+26)+I(e,t+28)},W=function(e,t,n){var r=I(e,t+28),i=H(e.subarray(t+46,t+46+r),!(I(e,t+8)&2048)),a=t+46+r,o=L(e,t+20),s=n&&o==4294967295?ee(e,a):[o,L(e,t+24),L(e,t+42)],c=s[0],l=s[1],u=s[2];return[I(e,t+10),c,l,i,a+I(e,t+30)+I(e,t+32),u]},ee=function(e,t){for(;I(e,t)!=1;t+=4+I(e,t+2));return[R(e,t+12),R(e,t+4),R(e,t+20)]};function G(e,t){for(var n={},r=e.length-22;L(e,r)!=101010256;--r)(!r||e.length-r>65558)&&N(13);var i=I(e,r+8);if(!i)return{};var a=L(e,r+16),o=a==4294967295||i==65535;if(o){var c=L(e,r-12);o=L(e,c)==101075792,o&&(i=L(e,c+32),a=L(e,c+48))}for(var l=t&&t.filter,u=0;u<i;++u){var d=W(e,a,o),f=d[0],p=d[1],m=d[2],h=d[3],g=d[4],_=d[5],v=U(e,_);a=g,(!l||l({name:h,size:p,originalSize:m,compression:f}))&&(f?f==8?n[h]=z(e.subarray(v,v+p),{out:new s(m)}):N(14,`unknown compression type `+f):n[h]=j(e,v,v+p))}return n}Object.keys({stl:`stl`,"3mf":`3mf`,obj:`obj`,step:`step`,stp:`step`,iges:`iges`,igs:`iges`}).map(e=>`.`+e).join(`,`);function K(e,t,n=()=>{}){try{return G(e,{filter:e=>(n(e),t(e.name))})}catch{return null}}function q(e,t){let n=K(e,e=>e===`Metadata/plate_${t}.gcode`||e===`Metadata/plate_${t}.png`)||{},r=n[`Metadata/plate_${t}.gcode`];if(!r)throw Error(`This file has no G-code for plate ${t}`);return{text:new TextDecoder().decode(r),thumbnail:n[`Metadata/plate_${t}.png`]||null}}self.onmessage=async({data:e})=>{try{let t=e.text,n=null;e.plate==null?e.file&&(t=await e.file.text()):{text:t,thumbnail:n}=q(new Uint8Array(await e.file.arrayBuffer()),e.plate);let r=o(t,e=>self.postMessage({type:`progress`,value:e})),i=r.segments,a=r.travels,s=[i.start.buffer,i.end.buffer,i.feature.buffer,i.layer.buffer,i.width.buffer,i.height.buffer,a.pos.buffer,a.layer.buffer];self.postMessage({type:`done`,result:r,thumbnail:n},n?[...s,n.buffer]:s)}catch(e){self.postMessage({type:`error`,message:e.message})}};',iO=typeof self<`u`&&self.Blob&&new Blob([`URL.revokeObjectURL(import.meta.url);`,rO],{type:`text/javascript;charset=utf-8`});function aO(e){let t;try{if(t=iO&&(self.URL||self.webkitURL).createObjectURL(iO),!t)throw``;let n=new Worker(t,{type:`module`,name:e?.name});return n.addEventListener(`error`,()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch{return new Worker(`data:text/javascript;charset=utf-8,`+encodeURIComponent(rO),{type:`module`,name:e?.name})}}function oO(){let[e,t]=(0,B.useState)({status:`empty`}),n=(0,B.useRef)(null),r=(0,B.useRef)(null),i=()=>{n.current?.terminate(),n.current=null},a=()=>{r.current&&URL.revokeObjectURL(r.current),r.current=null},o=(0,B.useCallback)((e,o,s=null,{plate:c=null}={})=>{i(),a();let l=typeof e==`string`?e:null,u=l==null?s?e:null:new Blob([l],{type:`text/plain`});t({status:`loading`,name:o,text:l,download:u,quote:s,plate:c,progress:0});let d=e=>{i(),t(t=>({...t,status:`error`,error:`Could not read this G-code: `+e}))},f=n.current=new aO;f.onmessage=({data:e})=>{if(e.type===`progress`)t(t=>({...t,progress:e.value}));else if(e.type===`error`)d(e.message);else if(e.type===`done`){i();let n=e.result;e.thumbnail&&(r.current=URL.createObjectURL(new Blob([e.thumbnail],{type:`image/png`}))),t(e=>n.segments.count?{...e,status:`ready`,result:n,thumbnail:r.current}:{...e,status:`error`,error:`No extrusion moves found. Is this a G-code file?`})}},f.onerror=e=>d(e.message||`parser failed`),f.postMessage(l==null?{file:e,plate:c}:{text:l})},[]),s=(0,B.useCallback)(()=>{i(),a(),t({status:`empty`})},[]);return(0,B.useEffect)(()=>()=>{i(),a()},[]),{...e,open:o,close:s}}var sO=52428800,cO=e=>Math.max(1,Math.ceil(e/2)),lO=e=>Math.floor(e/2),uO={items:[],selected:null},dO=(e,t,n)=>e.items.some(e=>e.id===t)?{...e,items:e.items.map(e=>e.id===t?n(e):e)}:e;function fO(e,t){switch(t.type){case`add`:{let n=(e.items.find(t=>t.id===e.selected)||{}).settings||t.defaults,r=t.files.slice(0,10-e.items.length).map(({id:e,file:t})=>({id:e,file:t,rot:[0,0,0],copies:1,settings:{...n},result:null,error:null}));return r.length?{items:[...e.items,...r],selected:r[0].id}:e}case`replace`:{let n=(e.items.find(t=>t.id===e.selected)||{}).settings||t.defaults;return{items:[{id:t.id,file:t.file,rot:[0,0,0],copies:1,settings:{...n},result:null,error:null}],selected:t.id}}case`remove`:{let n=e.items.findIndex(e=>e.id===t.id);if(n<0)return e;let r=e.items.filter(e=>e.id!==t.id),i=r[Math.min(n,r.length-1)];return{items:r,selected:e.selected===t.id?i?i.id:null:e.selected}}case`select`:return e.items.some(e=>e.id===t.id)?{...e,selected:t.id}:e;case`settings`:return dO(e,t.id,e=>({...e,settings:{...e.settings,...t.patch}}));case`applyToAll`:{let n=e.items.find(n=>n.id===(t.id??e.selected));return n?{...e,items:e.items.map(e=>({...e,settings:{...n.settings}}))}:e}case`copies`:return dO(e,t.id,e=>({...e,copies:typeof t.value==`function`?t.value(e.copies):t.value}));case`rotate`:return dO(e,t.id,e=>({...e,rot:t.rot}));case`result`:return dO(e,t.id,e=>({...e,result:t.result,error:null}));case`error`:return dO(e,t.id,e=>({...e,error:t.error}));default:return e}}var pO=(e,t)=>JSON.stringify([t,e.rot,[e.file.name,e.file.size,e.file.lastModified]]),mO=(e,t)=>!e.result||e.result.sig!==t||!!e.error,hO=[`printer`,`material`,`quality`,`infill`,`walls`,`supports`],gO=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function _O(e,t,{isKnown:n,defaultPrinter:r},i,a){let o={...t};if(e===void 0)return o;if(!gO(e))return a(`${i}: settings left out: they must be an object`),o;let s=(t,n)=>a(`${i}: ${t} ${JSON.stringify(e[t])} left out: ${n}`);for(let t of Object.keys(e))hO.includes(t)||a(`${i}: unknown setting "${t}" left out`);let{printer:c,material:l,quality:u,infill:d,walls:f,supports:p}=e;if(c!==void 0){if(typeof c!=`string`||!c.trim())s(`printer`,`it must be a printer name`);else{let e=c.trim();n&&!n(e)&&(a(`${i}: printer "${e}" isn't on this server, so the shop's default is used`),e=r),e&&e!==t.printer&&Object.assign(o,{printer:e,process:``,filament:``})}}if(l!==void 0){let e=typeof l==`string`?l.trim().toUpperCase():``;e?e!==o.material&&Object.assign(o,{material:e,filament:``}):s(`material`,`it must be a material, such as PLA`)}return u!==void 0&&(AE.some(e=>e.id===u)?o.quality=u:s(`quality`,`it must be one of ${AE.map(e=>e.id).join(`, `)}`)),d!==void 0&&(DE.includes(d)?o.infill=d:s(`infill`,`it must be one of ${DE.join(`, `)}`)),f!==void 0&&(jE.includes(f)?o.walls=f:s(`walls`,`it must be one of ${jE.join(`, `)}`)),p!==void 0&&(typeof p==`boolean`?o.supports=String(p):s(`supports`,`it must be true or false`)),o}function vO(e,t,n,r=e=>console.warn(`slicer-studio: ${e}`)){if(!Array.isArray(e))throw TypeError(`slicer-studio: open() takes a list of { file, copies, settings }`);let i=[];return e.forEach((e,a)=>{let o=`open() item ${a+1}`;if(!gO(e)||!(e.file instanceof File)){r(`${o} left out: it needs a file, as a File`);return}let s=1;e.copies!==void 0&&(Number.isInteger(e.copies)&&e.copies>=1&&e.copies<=100?s=e.copies:r(`${o}: copies ${JSON.stringify(e.copies)} left out: it must be a whole number from 1 to 100`)),i.push({file:e.file,copies:s,settings:_O(e.settings,t,n,o,r)})}),i}function yO(e){let t=/* @__PURE__ */ new Map;for(let{file:n,copies:r,settings:i}of e){let e=JSON.stringify(Object.keys(i).sort().map(e=>[e,i[e]]));t.has(e)||t.set(e,{settings:i,items:[]}),t.get(e).items.push({file:n,copies:r})}return[...t.values()]}var bO=5e5,xO=e=>!!e&&[`step`,`iges`].includes(ye(e.name).format),SO={outside:`is off the bed`,excluded:`is in a part of the bed the printer keeps clear`,tall:`is taller than the printer can print`},CO=e=>e.toLocaleString(`en`);function wO({defaults:e,slice:t}){let[n,r]=(0,B.useReducer)(qw,Vw),a=tO([.../* @__PURE__ */ new Set([...n.plates.map(e=>e.settings.printer),e.printer])].filter(Boolean)),{staffApi:o}=i().config,s=we(),c=(0,B.useRef)(n);c.current=n;let l=(0,B.useRef)(0),u=e=>`${e}-${++l.current}`,[d,f]=(0,B.useState)({}),p=(0,B.useRef)(d);p.current={...d,...p.current};let m=(0,B.useRef)(/* @__PURE__ */ new Map),h=(0,B.useRef)(/* @__PURE__ */ new Set),g=(0,B.useRef)([]),[_,v]=(0,B.useState)([]),[y,b]=(0,B.useState)(null);(0,B.useEffect)(()=>{let e=new Set(n.plates.map(e=>e.id));g.current=g.current.filter(t=>!e.has(t.id)||(t.resolve(),!1))},[n.plates]),(0,B.useEffect)(()=>{for(let e of h.current)Object.hasOwn(n.files,e)&&h.current.delete(e);let e=new Set($w(Object.keys(p.current),n.files,h.current));if(!e.size)return;let t=t=>Object.fromEntries(Object.entries(t).filter(([t])=>!e.has(t)));p.current=t(p.current),f(t);for(let t of[...m.current.keys()])e.has(tT(t))&&m.current.delete(t)},[n.files,_]);let x=e=>se(e&&a[e.settings.printer]),S=(e,t)=>{let n=p.current[e];if(!n)return null;let r=eT(e,t);return m.current.has(r)||m.current.set(r,ue(n.positions,t)),m.current.get(r)},C=(e,t)=>{let n=S(e.fileId,e.orient);return n?ce(n.hull,e.spin,t.center[0]+e.x,t.center[1]+e.y):null},w=(e,t,n=null)=>e.objects.filter(e=>e.id!==n).map(e=>C(e,t)).filter(Boolean),T=e=>e.objects.reduce((e,t)=>e+(p.current[t.fileId]?.triangles||0),0),E=(e,t)=>e.objects.some(e=>xO(t[e.fileId])),D=e=>{for(let t of c.current.plates){let n=t.objects.find(t=>t.id===e);if(n)return{plate:t,o:n}}return{}},O=t=>{let n=/* @__PURE__ */ new Set,i=c.current,a={...i.files,...Object.fromEntries(t.map(e=>[e.fileId,e.file]))},o=i.plates.map(e=>({...e,objects:[...e.objects]})),s=o.find(e=>e.id===i.selected.plate)||null,l=[],d=()=>{if(o.length>=10)return null;let t={id:u(`plate`),settings:{...s?s.settings:e},objects:[]};return o.push(t),l.push({type:`addPlate`,id:t.id,settings:t.settings}),t};for(let e of t){let t=null,r=null;if(e.cad)t=s&&!s.objects.length?s:d(),r={x:0,y:0};else{let n=S(e.fileId,L),i=p.current[e.fileId].triangles;if(s&&!E(s,a)&&s.objects.length<50&&T(s)+i<=1e6){let e=x(s);r=re(n.hull,0,w(s,e),e),r&&(t=s)}t||(t=d(),t&&(r=re(n.hull,0,[],x(t))||{x:0,y:0}))}if(!t){$x.error(`Up to 10 plates. Remove one to add more.`);break}let i=Hw(u(`object`),e.fileId,r);t.objects.push(i),l.push({type:`addObjects`,plate:t.id,files:{[e.fileId]:e.file},objects:[i]}),n.add(e.fileId),s=t}return l.forEach(r),n},k=(e,t=e=>e)=>{let n=10-Object.keys(c.current.files).length;if(n<=0)return $x.error(`Up to 10 files at a time. Remove one to add another.`),[];let r=e.filter(e=>t(e).size>sO);r.length&&$x.error(`${r.map(e=>t(e).name).join(`, `)}: over the 50 MB limit. Please choose a smaller file.`);let i=e.filter(e=>t(e).size<=sO);return i.length>n&&$x.error(`Up to 10 files at a time, so ${i.length-n} ${i.length-n===1?`was`:`were`} left out.`),i.slice(0,n)},A=async e=>{let t=u(`file`);if(xO(e))return{fileId:t,file:e,cad:!0};v(t=>[...t,e.name]);try{let{loadMesh:n}=await import(`./chunks/plate-mesh-BoEG27Tx.js`),r=await n(e);return r.triangles>bO?($x.error(`${e.name} has ${CO(r.triangles)} triangles, and the slicer takes up to ${CO(bO)}.`),null):(p.current={...p.current,[t]:r},f(e=>({...e,[t]:r})),h.current.add(t),{fileId:t,file:e})}catch{return $x.error(`${e.name} could not be read. Is it a 3D model?`),null}finally{v(t=>{let n=t.indexOf(e.name);return n<0?t:[...t.slice(0,n),...t.slice(n+1)]})}},j=(e,t)=>{for(let n of e)t.has(n.fileId)||h.current.delete(n.fileId)},M=async e=>{let t=[];for(let n of k(e)){let e=await A(n);e&&t.push(e)}let n=/* @__PURE__ */ new Set;try{t.length&&(n=O(t))}finally{j(t,n)}},N=async e=>{let t=yO(k(e,e=>e.file)),n=/* @__PURE__ */ new Map;for(let e of t.flatMap(e=>e.items)){let t=await A(e.file);t&&n.set(e,t)}let i=e=>o&&e?s.fetchQuery(eO(o,e)).then(e=>e&&e.bed,()=>null):Promise.resolve(null),a=[],l=[],d=!1,f=(e,t,n)=>{let r=u(`plate`);l.push(r),a.push({type:`addPlate`,id:r,settings:{...e}}),a.push({type:`addObjects`,plate:r,files:Object.fromEntries(t.map(e=>[e.fileId,e.file])),objects:t.map(e=>Hw(e.id,e.fileId,n(e)))})},m=()=>10-c.current.plates.length-l.length;try{for(let e of t){let t=[],r=[];for(let i of e.items){let e=n.get(i);if(!e)continue;if(e.cad){r.push({id:u(`object`),...e});continue}let{hull:a}=S(e.fileId,L);for(let n=0;n<i.copies;n++)t.push({id:u(`object`),...e,points:a,triangles:p.current[e.fileId].triangles})}if(t.length){let n=nT(t,se(await i(e.settings.printer)),m());for(let r of n.plates)f(e.settings,r.ids.map(e=>t.find(t=>t.id===e)),e=>r.positions[e.id]);n.left.length&&(d=!0)}for(let t of r){if(m()<=0){d=!0;break}f(e.settings,[t],()=>({x:0,y:0}))}}return d&&$x.error(`Up to 10 plates. Remove one to add more.`),a.forEach(r),l.length?(r({type:`selectPlate`,id:l[0]}),await new Promise(e=>g.current.push({id:l[0],resolve:e})),l[0]):null}finally{j([...n.values()],new Set(a.filter(e=>e.type===`addObjects`).flatMap(e=>Object.keys(e.files))))}},P=(e,t,n)=>{let i=c.current,a=i.plates.find(t=>t.id===e);if(!a)return;let o=a.objects.filter(e=>e.fileId===t);if(n<o.length){r({type:`removeObjects`,ids:o.slice(n).map(e=>e.id)});return}if(n===o.length||xO(i.files[t]))return;let s=x(a),l=o[o.length-1],d=S(t,l.orient),f=w(a,s),m=p.current[t].triangles,h=T(a),g=[];for(let e=o.length;e<n;e++){if(a.objects.length+g.length>=50){$x.error(`Up to 50 objects on a plate.`);break}if(h+m>1e6){$x.error(`A plate takes up to ${CO(Bw)} triangles, copies included.`);break}let e=re(d.hull,l.spin,f,s);if(!e){$x.error(`No room for another copy of ${i.files[t].name} on this plate.`);break}g.push(Hw(u(`object`),t,e,l.spin,l.orient)),f.push(ce(d.hull,l.spin,s.center[0]+e.x,s.center[1]+e.y)),h+=m}g.length&&r({type:`addObjects`,plate:e,files:{},objects:g})},F=(e,t)=>r({type:`updateObject`,id:e,patch:t}),I=(e,t,n)=>{let{plate:r}=D(e);if(!r)return;let i=x(r);F(e,{x:t-i.center[0],y:n-i.center[1]})},ee=(e,t,n)=>{let{o:r}=D(e);r&&F(e,{x:r.x+t,y:r.y+n})},te=(e,t)=>F(e,{spin:(Math.round(t*100)/100%360+360)%360}),ne=(e,t)=>{let{o:n}=D(e);n&&te(e,n.spin+t)},me=(e,t)=>{let{o:n}=D(e);n&&F(e,{orient:pe(t===`forward`?ae(90):oe(90),n.orient)})},he=(e,t)=>{let{o:n}=D(e);n&&F(e,{orient:le(n.orient,n.spin,de(t))})},ge=e=>F(e,{orient:L}),_e=e=>{let{o:t}=D(e),n=t&&S(t.fileId,t.orient);if(!n)return;let r=ce(n.hull,t.spin,0,0),i=r.map(e=>e[0]),a=r.map(e=>e[1]);F(e,{x:-(Math.min(...i)+Math.max(...i))/2,y:-(Math.min(...a)+Math.max(...a))/2})},ve=e=>{let t=c.current.plates.find(t=>t.id===e);if(!t)return;let n=x(t),i=t.objects.map(e=>({id:e.id,points:S(e.fileId,e.orient)?.hull,spin:e.spin})).filter(e=>e.points),{positions:a,overflow:o}=fe(i,n);if(r({type:`updateObjects`,patches:a}),!o.length)return;if(c.current.plates.length>=10){$x.error(`${o.length} ${o.length===1?`object doesn’t`:`objects don’t`} fit, and there are already 10 plates.`);return}let s=u(`plate`);r({type:`addPlate`,id:s,settings:{...t.settings}});let l=fe(i.filter(e=>o.includes(e.id)),n);r({type:`moveObjects`,ids:o,to:s,positions:l.positions}),$x(`${o.length} ${o.length===1?`object didn’t`:`objects didn’t`} fit, so ${o.length===1?`it`:`they`} moved to a new plate.`)},z=(e,t,n)=>{let i=c.current,a=i.plates.find(t=>t.id===e);if(!a)return;let o=a.objects.filter(e=>e.fileId===t),s;if(n===`new`){if(i.plates.length>=10){$x.error(`Up to 10 plates.`);return}s={id:u(`plate`),settings:{...a.settings},objects:[]},r({type:`addPlate`,id:s.id,settings:s.settings})}else s=i.plates.find(e=>e.id===n);if(!s)return;if(xO(i.files[t])||E(s,i.files)){if(s.objects.length){$x.error(`STEP and IGES files need a plate of their own.`);return}r({type:`moveObjects`,ids:o.map(e=>e.id),to:s.id,positions:{[o[0].id]:{x:0,y:0}}});return}let l=x(s),d=w(s,l),f={};for(let e of o){let n=S(e.fileId,e.orient),r=n&&re(n.hull,e.spin,d,l);if(!r){$x.error(`No room for ${Object.keys(f).length?`more copies of `:``}${i.files[t].name} on that plate.`);break}f[e.id]=r,d.push(ce(n.hull,e.spin,l.center[0]+r.x,l.center[1]+r.y))}let p=Object.keys(f);p.length&&r({type:`moveObjects`,ids:p,to:s.id,positions:f})},ye=()=>{if(c.current.plates.length>=10){$x.error(`Up to 10 plates.`);return}let t=c.current.plates.find(e=>e.id===c.current.selected.plate);r({type:`addPlate`,id:u(`plate`),settings:{...t?t.settings:e}})},be=(e,t)=>{if(!e.objects.length||E(e,t))return null;let n=c.current.plates.indexOf(e)+1,r=c.current.plates.length>1?` on plate ${n}`:``;if(e.objects.some(e=>!p.current[e.fileId]))return`A model${r} is still loading`;let i=x(e);if(i.standIn)return`The printer’s bed size hasn’t loaded yet${r?` for plate ${n}`:``}`;let a=T(e);if(a>1e6)return`Plate ${n} has ${CO(a)} triangles, and the limit is ${CO(Bw)}`;let o=R(e.objects.map(e=>({id:e.id,points:C(e,i),height:S(e.fileId,e.orient).size[2]})),i),s=e.objects.find(e=>o[e.id].problem);return s?`${t[s.fileId].name}${r} ${SO[o[s.id].problem]}`:null},xe=async(e,t,n)=>{let r=n[e.objects[0].fileId];if(xO(r))return{model:r,settings:e.settings};let{plate3mf:i}=await import(`./chunks/plate-3mf-GYeMGaLV.js`),a=x(e),o=[...new Set(e.objects.map(e=>e.fileId))],s=i(o.map((e,t)=>({id:t+1,name:n[e].name,...p.current[e]})),e.objects.map(e=>({objectId:o.indexOf(e.fileId)+1,...ie(e,S(e.fileId,e.orient).shift,a.center)})));return{model:new File([s],`plate-${t}.3mf`,{type:`model/3mf`}),settings:{...e.settings,plate:!0}}},Se=async()=>{let e=c.current,n=e.plates.filter(t=>Zw(t,e.files)),i=e.plates.find(t=>t.id===e.selected.plate),a=(n.length?n:i&&i.objects.length?[i]:[]).slice().sort((e,t)=>(t===i)-(e===i));if(!a.length)return;let o=Date.now(),s=0,l=null;for(let[n,i]of a.entries()){let c=e.plates.indexOf(i)+1,u=be(i,e.files);if(u)l=Error(u),r({type:`error`,plate:i.id,error:u});else{b({since:o,step:n+1,of:a.length,plate:c,printer:i.settings.printer,phase:`uploading`});try{let{model:n,settings:a}=await xe(i,c,e.files),o=await t.mutateAsync({model:n,settings:a,rot:[0,0,0],onStep:e=>b(t=>t&&{...t,phase:e})});r({type:`result`,plate:i.id,result:{stats:o.stats,used:o.used,price:o.price,quoteId:o.id,gcode:o.gcode||null,name:`plate-${c}.gcode`,sig:Xw(i,e.files)}}),s++}catch(e){l=e;let t=wD(e.status);if(r({type:`error`,plate:i.id,error:t||e.message}),t)break}}}b(null);let u=Math.max(1,Math.round((Date.now()-o)/1e3));l&&wD(l.status)?$x.error(wD(l.status)):s===a.length?$x.success(`Sliced ${a.length===1?`plate ${e.plates.indexOf(a[0])+1}`:`${a.length} plates`} in ${u} s`):a.length===1?$x.error(l.message):$x.error(s?`${s} of ${a.length} plates sliced. Each plate says what went wrong.`:`None of the ${a.length} plates could be sliced. Each plate says why.`)},{plates:V,files:Ce,selected:Te}=n,Ee=V.find(e=>e.id===Te.plate)||null,De=Ee&&Ee.objects.find(e=>e.id===Te.object)||null,Oe=(0,B.useMemo)(()=>x(Ee||{settings:e}),[Ee?Ee.settings.printer:e.printer,a]);return{plates:V,files:Ce,meshes:d,loading:_,slicing:y,plate:Ee,object:De,bed:Oe,scene:(0,B.useMemo)(()=>{if(!Ee)return[];let e=Ee.objects.map(e=>{let t=S(e.fileId,e.orient);return{o:e,f:t,points:t&&ce(t.hull,e.spin,Oe.center[0]+e.x,Oe.center[1]+e.y)}}),t=R(e.filter(e=>e.f).map(e=>({id:e.o.id,points:e.points,height:e.f.size[2]})),Oe);return e.map(({o:e,f:n})=>({id:e.id,fileId:e.fileId,name:Ce[e.fileId].name,cad:xO(Ce[e.fileId]),loaded:!!n,...n?ie(e,n.shift,Oe.center):{},size:n?n.size:null,at:[Oe.center[0]+e.x,Oe.center[1]+e.y],spin:e.spin,problem:t[e.id]?t[e.id].problem:null,overlap:!!(t[e.id]&&t[e.id].overlap)}))},[Ee,Oe,d,Ce]),plateFiles:Ee?Qw(Ee):[],toSlice:V.filter(e=>Zw(e,Ce)).length,stale:e=>Zw(e,Ce),blocker:()=>{for(let e of V.filter(e=>Zw(e,Ce))){let t=be(e,Ce);if(t)return t}return null},addFiles:M,openItems:N,setCopies:P,moveTo:I,moveBy:ee,setSpin:te,spinBy:ne,tip:me,layFlat:he,resetTurns:ge,centre:_e,arrangePlate:ve,moveFile:z,newPlate:ye,sliceAll:Se,selectPlate:e=>r({type:`selectPlate`,id:e}),selectObject:e=>r({type:`selectObject`,id:e}),removeFile:(e,t)=>{let n=c.current.plates.find(t=>t.id===e);n&&r({type:`removeObjects`,ids:n.objects.filter(e=>e.fileId===t).map(e=>e.id)})},removePlate:e=>r({type:`removePlate`,id:e}),setSettings:e=>Ee&&r({type:`settings`,plate:Ee.id,patch:e}),settingsForAll:()=>Ee&&r({type:`settingsForAll`,from:Ee.id})}}var TO=`print-preview.theme`,EO=()=>{try{return localStorage.getItem(TO)||`system`}catch{return`system`}};function DO(){let{root:e,theme:t}=i(),[n,r]=(0,B.useState)(EO),a=t||n;return(0,B.useLayoutEffect)(()=>{let t=matchMedia(`(prefers-color-scheme: dark)`),n=()=>{e.dataset.theme=a===`dark`||a===`system`&&t.matches?`dark`:`light`};if(n(),a===`system`)return t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)},[a,e]),(0,B.useEffect)(()=>{if(!t)try{n===`system`?localStorage.removeItem(TO):localStorage.setItem(TO,n)}catch{}},[n,t]),[a,t?null:r]}var OO=`print-preview.printer`,kO=()=>{try{return localStorage.getItem(OO)||null}catch{return null}};function AO(e,t){return e.error?`failed`:e.result?t?`stale`:`sliced`:null}function jO(e,t){if(!e.objects.length)return null;if(e.error)return{text:e.error,warn:!0};if(!e.result)return{text:`Not sliced yet.`};if(t)return{text:`Changed since it was sliced. Slice it again to see the change.`,warn:!0};let{stats:n,price:r}=e.result;return{text:`${n.weightG} g, ${RE(n.seconds)}${r?`, ${HE({low:r.min,high:r.max},r.currency)}`:``}`}}function MO(){let[e,t]=DO(),{config:{staffApi:n},actions:r}=i(),a=ZD(),o=JD(),s=QD(),c=oO(),l=nO(),[u,d]=(0,B.useState)(null),[f,p]=(0,B.useState)(`prepare`),[m,h]=(0,B.useState)(!1),g=(0,B.useRef)(null),_=(0,B.useRef)(null),[v,y]=(0,B.useState)(()=>({...EE,printer:kO()??``})),b=(0,B.useRef)(kO()!==null),x=wO({defaults:v,slice:l}),{plate:S,object:C}=x,w=S?S.settings:v,T=e=>S?x.setSettings(e):y(t=>({...t,...e})),E=$D(w.printer,w.material);(0,B.useEffect)(()=>{if(w.printer)try{localStorage.setItem(OO,w.printer)}catch{}},[w.printer]),(0,B.useEffect)(()=>{!b.current&&o.data&&(b.current=!0,o.data.defaultPrinter&&T({printer:o.data.defaultPrinter,process:``,filament:``}))},[o.data]),(0,B.useEffect)(()=>{o.data&&w.printer&&!s.isLoading&&(o.data.printers.includes(w.printer)||s.data&&vE(s.data,w.printer)||T({printer:o.data.defaultPrinter,process:``,filament:``}))},[o.data,s.data,s.isLoading,S&&S.id]);let D=E.data&&E.data.materials;(0,B.useEffect)(()=>{D&&D.length&&!D.includes(w.material)&&T({material:D.includes(`PLA`)?`PLA`:D[0],filament:``})},[D,w.material]);let O=!!(o.isError||o.data&&w.printer!==``)&&!s.isLoading,k=(0,B.useRef)(null);k.current={settings:w,openItems:x.openItems,shop:{isKnown:o.data?e=>o.data.printers.includes(e)||!!(s.data&&vE(s.data,e)):null,defaultPrinter:o.data?o.data.defaultPrinter:``}};let A=(0,B.useRef)(Promise.resolve());(0,B.useEffect)(()=>{if(O)return r.opener.set(e=>{let t=A.current.then(async()=>{let{settings:t,shop:n}=k.current,r=vO(e,t,n);r.length&&(p(`prepare`),h(!1),await k.current.openItems(r))});return A.current=t.catch(()=>{}),t}),()=>r.opener.set(null)},[O]);let j=(0,B.useRef)(!1),M=async e=>{let{models:t,others:n}=await z(e);if(t.length){p(`prepare`),x.addFiles(t),n.length&&$x.error(`${n.map(e=>e.file.name).join(`, `)}: not added. Open G-code files on their own.`);return}if(!n.length)return;let{file:r,what:i}=n[0],a=(...e)=>{j.current=!1,c.open(...e),p(`preview`)};i.kind===`gcode`?a(r,r.name):i.kind===`gcode3mf`&&i.plates.length===1?a(r,r.name,null,{plate:i.plates[0].plate}):i.kind===`gcode3mf`?d({file:r,plates:i.plates}):$x.error(`${r.name} is not a model or G-code file. Use STL, 3MF, OBJ, STEP, IGES or G-code.`)},N=OC({noClick:!0,noKeyboard:!0,multiple:!0,onDrop:M}),P=S&&S.result,F=(0,B.useRef)({plate:null,result:null});(0,B.useEffect)(()=>{let e=F.current;F.current={plate:S&&S.id,result:P},P&&P.gcode?(j.current=!0,c.open(P.gcode,P.name,{stats:P.stats,used:P.used}),e.plate===(S&&S.id)&&e.result!==P&&p(`preview`)):j.current&&(j.current=!1,c.close())},[S&&S.id,P]);let I=e=>(...t)=>{p(`prepare`),e(...t)},ee=TD(n,a),te=ee?`${ee}. You can still open G-code files.`:x.plates.some(e=>e.objects.length)?w.printer===null?`Choose a model for this brand.`:x.blocker():`Add a model to the plate.`,ne=x.slicing&&{...x.slicing,title:`${PE(x.slicing.phase,`Slicing`)} plate ${x.slicing.plate}${x.slicing.of>1?` (${x.slicing.step} of ${x.slicing.of})`:``}`,printer:x.slicing.printer||`The default printer`},re=C&&x.scene.find(e=>e.id===C.id),ie=C?S.objects.filter(e=>e.fileId===C.fileId):[],ae=x.scene.find(e=>e.cad),oe={plates:x.plates.map((e,t)=>({id:e.id,n:t+1,state:AO(e,x.stale(e))})),selected:S&&S.id,files:x.plateFiles.map(e=>{let t=x.scene.find(t=>t.id===e.objects[0].id);return{fileId:e.fileId,name:x.files[e.fileId].name,copies:e.objects.length,cad:t&&t.cad,size:t&&t.size,on:!!C&&C.fileId===e.fileId,firstId:e.objects[0].id}}),loading:x.loading,summary:S&&jO(S,x.stale(S)),onSelectPlate:x.selectPlate,onNewPlate:I(x.newPlate),onRemovePlate:x.removePlate,onSettingsForAll:()=>{x.settingsForAll(),$x.success(`Every plate now has these settings`)},onFiles:M,onChoose:()=>_.current.click(),onSelectFile:I(x.selectObject),onCopies:I((e,t)=>x.setCopies(S.id,e,t)),onMove:(e,t)=>x.moveFile(S.id,e,t),onRemove:e=>x.removeFile(S.id,e)},se={item:re,layMode:m,canArrange:!!S&&S.objects.length>0&&!ae,copy:C?{k:ie.indexOf(C)+1,of:ie.length}:null,problem:re&&(re.problem?`It ${SO[re.problem]}. Move it, or turn it.`:re.overlap?`It overlaps another object.`:null),onLayMode:I(h),onMoveTo:I((e,t)=>x.moveTo(C.id,e,t)),onSpin:I(e=>x.setSpin(C.id,e)),onSpinBy:I(e=>x.spinBy(C.id,e)),onTip:I(e=>x.tip(C.id,e)),onReset:I(()=>x.resetTurns(C.id)),onCentre:I(()=>x.centre(C.id)),onArrange:I(()=>x.arrangePlate(S.id))},ce={bed:x.bed,scene:x.scene,meshes:x.meshes,selected:C&&C.id,layMode:m,onSelect:e=>x.selectObject(e),onMove:(e,t,n)=>x.moveBy(e,t,n),onLay:(e,t)=>{x.layFlat(e,t),h(!1)},onLayMode:h};return/* @__PURE__ */ (0,V.jsxs)(`div`,{...N.getRootProps({className:`flex min-h-[max(100%,360px)] flex-col outline-none md:h-full`}),children:[/* @__PURE__ */ (0,V.jsx)(`input`,{ref:g,type:`file`,accept:be,hidden:!0,onChange:e=>{M([...e.target.files].slice(0,1)),e.target.value=``}}),/* @__PURE__ */ (0,V.jsx)(`input`,{ref:_,type:`file`,accept:ve,multiple:!0,hidden:!0,onChange:e=>{M([...e.target.files]),e.target.value=``}}),/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`flex flex-1 flex-col md:min-h-0 md:flex-row`,children:[/* @__PURE__ */ (0,V.jsx)(`main`,{className:`min-w-0 md:order-2 md:flex-1`,children:/* @__PURE__ */ (0,V.jsx)(xD,{gcode:c,slicing:ne,mode:f,onMode:p,editor:ce,emptyPlate:!S||!S.objects.length&&!x.loading.length,note:ae?`${ae.name} is placed by the slicer, in the middle of the bed. Its shape shows in Preview once it is sliced.`:null,onOpenGcode:()=>g.current.click(),onChooseModel:()=>_.current.click()})}),/* @__PURE__ */ (0,V.jsx)(`div`,{className:`md:order-1 md:flex md:min-h-0`,children:/* @__PURE__ */ (0,V.jsx)(eD,{plates:oe,position:se,settings:w,onSettings:T,printers:s,ourPrinters:LE(o.data),options:E,toSlice:x.toSlice,slicingSince:x.slicing&&x.slicing.since,phase:x.slicing&&x.slicing.phase,blocker:te,onSlice:x.sliceAll,onOpenGcode:()=>g.current.click(),theme:e,onTheme:t})})]}),/* @__PURE__ */ (0,V.jsx)(Pw,{show:N.isDragActive,text:`Drop models to put them on the plate, or G-code to open it`}),/* @__PURE__ */ (0,V.jsx)(Nw,{pick:u,onClose:()=>d(null),onPick:e=>{j.current=!1,c.open(u.file,`${u.file.name}, plate ${e}`,null,{plate:e}),d(null),p(`preview`)}})]})}var NO=8e3;async function PO(e,t,n,r){n?.throwIfAborted();let i=new AbortController,a=()=>i.abort(),o=setTimeout(a,r);n?.addEventListener(`abort`,a);try{let n=await fetch(e,{...t,method:`POST`,headers:{"content-type":`application/json`},signal:i.signal});return n.status===200?await n.json():null}catch(e){if(e.name===`SyntaxError`)return null;throw e}finally{clearTimeout(o),n?.removeEventListener(`abort`,a)}}async function FO({authUrl:e,verifyUrl:t},n,r=NO){if(!e||!t)return`not-set-up`;try{let i=await PO(e,{credentials:`include`,body:`{}`},n,r);if(!i||typeof i.token!=`string`||!i.token)return`refused`;let a=await PO(t,{credentials:`omit`,body:JSON.stringify({token:i.token})},n,r);return a&&a.valid===!0?`granted`:`refused`}catch{return`unreachable`}}var IO={refused:`Advanced is for staff. Sign in and try again.`,unreachable:`We couldn’t check your access. Please try again.`,"not-set-up":`Advanced isn’t set up on this page.`};function LO(){return DO(),/* @__PURE__ */ (0,V.jsx)(`div`,{role:`status`,className:`flex h-full min-h-[240px] items-center justify-center text-[14px] text-muted`,children:`Checking your access…`})}function RO({reason:e,onRetry:t}){return DO(),/* @__PURE__ */ (0,V.jsxs)(`div`,{role:`alert`,className:`flex h-full min-h-[240px] flex-col items-center justify-center gap-4 p-6 text-center`,children:[/* @__PURE__ */ (0,V.jsx)(`p`,{className:`max-w-sm text-[15px] font-medium`,children:IO[e]}),e!==`not-set-up`&&/* @__PURE__ */ (0,V.jsx)(zw,{onClick:t,children:`Try again`})]})}function zO(){let{config:e,emit:t,actions:n}=i(),{advanced:r}=e,a=r?JSON.stringify(r):null,[o,s]=(0,B.useState)(0),c=`${a} ${o}`,[l,u]=(0,B.useState)(null);(0,B.useEffect)(()=>{if(!a)return;let e=new AbortController;return FO(r,e.signal).then(n=>{e.signal.aborted||(u({asking:c,result:n}),n!==`granted`&&t(`advanceddenied`,{reason:n}))}),()=>e.abort()},[c]);let d=a&&l&&l.asking===c&&l.result!==`granted`?l.result:null;return(0,B.useEffect)(()=>{if(!d)return;let e=/* @__PURE__ */ Error(`slicer-studio: Advanced isn't open to this visitor (${d})`);return n.opener.fail(e),n.opener.set(()=>Promise.reject(e)),()=>n.opener.set(null)},[d]),a?!l||l.asking!==c?/* @__PURE__ */ (0,V.jsx)(LO,{}):l.result===`granted`?/* @__PURE__ */ (0,V.jsx)(MO,{}):/* @__PURE__ */ (0,V.jsx)(RO,{reason:l.result,onRetry:()=>s(e=>e+1)}):/* @__PURE__ */ (0,V.jsx)(MO,{})}function BO({title:e,aside:t,action:n}){return/* @__PURE__ */ (0,V.jsxs)(`header`,{className:`mb-3 flex items-baseline justify-between gap-4`,children:[/* @__PURE__ */ (0,V.jsx)(`h2`,{className:`font-display text-[16px] leading-tight font-semibold tracking-[-0.01em]`,children:e}),t&&/* @__PURE__ */ (0,V.jsx)(`span`,{className:`min-w-0 text-right text-[11px] text-muted`,children:t}),n]})}function VO({area:e,title:t,aside:n,action:r,className:i,children:a}){return/* @__PURE__ */ (0,V.jsxs)(`section`,{className:E(`min-w-0 rounded-[20px] bg-panel p-5`,i),style:{gridArea:e},children:[t&&/* @__PURE__ */ (0,V.jsx)(BO,{title:t,aside:n,action:r}),a]})}function HO({label:e,value:t,onChange:n,options:r,stack:i}){return/* @__PURE__ */ (0,V.jsx)(Lc,{type:`single`,"aria-label":e,value:String(t),onValueChange:e=>{e&&n(e)},className:i?`grid gap-1.5`:`flex flex-wrap gap-1.5`,children:r.map(e=>/* @__PURE__ */ (0,V.jsxs)(Kc,{value:String(e.value),className:E(`flex min-h-10 items-center justify-between gap-3 rounded-[12px] bg-raise px-3.5 text-[14px] font-medium text-ink transition-colors hover:bg-rule`,`data-[state=on]:bg-accent data-[state=on]:text-accent-contrast`,!i&&`flex-1 justify-center`),children:[/* @__PURE__ */ (0,V.jsx)(`span`,{children:e.label}),e.aside&&/* @__PURE__ */ (0,V.jsx)(`span`,{className:`num text-[12px] font-normal opacity-75`,children:e.aside})]},e.value))})}var UO=[{id:`FDM`,name:`Filament`,hint:`Strong everyday parts in PLA, PETG, ABS or TPU`,priced:!0},{id:`SLA`,name:`Resin`,hint:`Fine detail and smooth surfaces, for small precise parts`,priced:!1},{id:`SLS`,name:`Nylon powder`,hint:`Tough, functional nylon parts, no supports needed`,priced:!1}];function WO(e,t,n){if(!e||!e.email)return null;let r=`${e.name?`Hello ${e.name},`:`Hello,`}\n\n${n.length?`I'd like these printed in ${t}:\n${n.map(e=>`- ${e}`).join(`
55
- `)}`:`I'd like some parts printed in ${t}. I'll attach the models.`}\n\nWhat they're for, and how many I need:\n\n`;return`mailto:${e.email}?subject=${encodeURIComponent(`${t} print enquiry`)}&body=${encodeURIComponent(r)}`}function GO({id:e}){let t={width:28,height:28,viewBox:`0 0 28 28`,fill:`none`,stroke:`currentColor`,strokeWidth:1.6,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0};return e===`FDM`?/* @__PURE__ */ (0,V.jsxs)(`svg`,{...t,children:[/* @__PURE__ */ (0,V.jsx)(`path`,{d:`M10 4h8v5l-3 4h-2l-3-4z`}),/* @__PURE__ */ (0,V.jsx)(`path`,{d:`M14 13v3`}),/* @__PURE__ */ (0,V.jsx)(`path`,{d:`M5 20h18M7 23.5h14`})]}):e===`SLA`?/* @__PURE__ */ (0,V.jsxs)(`svg`,{...t,children:[/* @__PURE__ */ (0,V.jsx)(`path`,{d:`M8 5h12v6H8z`}),/* @__PURE__ */ (0,V.jsx)(`path`,{d:`M5 17h18l-2 6H7z`}),/* @__PURE__ */ (0,V.jsx)(`path`,{d:`M14 11v6`,strokeDasharray:`1.5 2`})]}):/* @__PURE__ */ (0,V.jsxs)(`svg`,{...t,children:[/* @__PURE__ */ (0,V.jsx)(`path`,{d:`M4 18h20v6H4z`}),/* @__PURE__ */ (0,V.jsx)(`path`,{d:`M9 21h.01M14 21h.01M19 21h.01`,strokeWidth:2.4}),/* @__PURE__ */ (0,V.jsx)(`path`,{d:`M20 4l-5 12`}),/* @__PURE__ */ (0,V.jsx)(`path`,{d:`M18 4h4`})]})}function KO({value:e,onChange:t,action:n}){let r=UO.find(t=>t.id===e);return/* @__PURE__ */ (0,V.jsxs)(VO,{area:`process`,title:`How should we print it?`,action:n,children:[/* @__PURE__ */ (0,V.jsx)(Lc,{type:`single`,"aria-label":`Printing process`,value:e,onValueChange:e=>{e&&t(e)},className:`grid grid-cols-3 gap-2`,children:UO.map(e=>/* @__PURE__ */ (0,V.jsxs)(Kc,{value:e.id,className:`flex flex-col items-start gap-2 rounded-[16px] bg-raise p-3 text-left outline-offset-2 transition-colors hover:bg-rule data-[state=on]:bg-panel data-[state=on]:ring-2 data-[state=on]:ring-silver-edge`,children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:`text-muted in-data-[state=on]:text-ink`,children:/* @__PURE__ */ (0,V.jsx)(GO,{id:e.id})}),/* @__PURE__ */ (0,V.jsxs)(`span`,{children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:`block font-display text-[18px] leading-none font-semibold`,children:e.id}),/* @__PURE__ */ (0,V.jsx)(`span`,{className:`mt-1 block text-[12px] text-muted`,children:e.name})]})]},e.id))}),/* @__PURE__ */ (0,V.jsxs)(`p`,{className:`mt-3 text-[13px] text-muted`,children:[r.hint,`.`,!r.priced&&/* @__PURE__ */ (0,V.jsx)(`span`,{className:`font-medium text-ink`,children:` Quoted by our team.`})]})]})}var qO=(0,B.lazy)(()=>import(`./chunks/ModelPreview-b3D28pKp.js`));function JO({model:e,single:t,onChoose:n}){return/* @__PURE__ */ (0,V.jsx)(`section`,{style:{gridArea:`model`},className:E(`relative overflow-hidden rounded-[28px] lg:min-h-[480px]`,e?`min-h-[480px] bg-viewer`:`min-h-[360px] bg-panel p-3`),children:e?/* @__PURE__ */ (0,V.jsxs)(V.Fragment,{children:[/* @__PURE__ */ (0,V.jsx)(B.Suspense,{fallback:null,children:/* @__PURE__ */ (0,V.jsx)(qO,{file:e,customer:!0})}),t&&/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,onClick:n,className:`absolute right-3 bottom-3 rounded-xl bg-panel px-3.5 py-2 text-[13px] font-medium transition-colors hover:bg-raise`,children:`Choose another file`})]}):/* @__PURE__ */ (0,V.jsxs)(`button`,{type:`button`,onClick:n,className:`group flex h-full min-h-[336px] w-full flex-col items-center justify-center gap-3 rounded-[20px] border-2 border-dashed border-rule bg-raise px-6 text-center transition-colors hover:border-accent lg:min-h-[456px]`,style:{backgroundImage:`linear-gradient(var(--rule) 1px, transparent 1px), linear-gradient(90deg, var(--rule) 1px, transparent 1px)`,backgroundSize:`28px 28px`,backgroundPosition:`center`},children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:`grid size-14 place-items-center rounded-2xl bg-accent text-accent-contrast transition-transform group-hover:-translate-y-0.5`,children:/* @__PURE__ */ (0,V.jsx)(Ow,{className:`size-6`,"aria-hidden":!0})}),/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`rounded-lg bg-raise px-2 font-display text-[24px] leading-tight font-semibold`,children:[`Drop your 3D `,t?`model`:`models`,` here`]}),/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`rounded-lg bg-raise px-2 text-[14px] text-muted`,children:[`or `,/* @__PURE__ */ (0,V.jsx)(`span`,{className:`font-medium text-ink underline underline-offset-4`,children:t?`choose a file`:`choose files`}),`. STL, 3MF, OBJ or STEP, up to `,t?`50 MB`:`10 files of 50 MB`]})]})})}function YO({icon:e,children:t}){return/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 whitespace-nowrap`,children:[/* @__PURE__ */ (0,V.jsx)(e,{className:`size-3 shrink-0`,"aria-hidden":!0}),` `,t]})}function XO({name:e,value:t,onChange:n}){let r=e=>n(t=>Math.min(50,Math.max(1,t+e))),i=`grid size-9 place-items-center rounded-lg text-ink transition-colors hover:bg-rule disabled:text-muted disabled:opacity-50`;return/* @__PURE__ */ (0,V.jsxs)(`div`,{role:`group`,"aria-label":`Copies of ${e}`,className:`flex shrink-0 items-center rounded-xl bg-raise p-0.5`,children:[/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,"aria-label":`One copy fewer`,disabled:t<=1,onClick:()=>r(-1),className:i,children:/* @__PURE__ */ (0,V.jsx)(uw,{className:`size-3`,"aria-hidden":!0})}),/* @__PURE__ */ (0,V.jsx)(`span`,{className:`num w-8 text-center text-[14px] font-semibold`,"aria-live":`polite`,children:t}),/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,"aria-label":`One copy more`,disabled:t>=50,onClick:()=>r(1),className:i,children:/* @__PURE__ */ (0,V.jsx)(mw,{className:`size-4`,"aria-hidden":!0})})]})}function ZO({name:e,onApplyAll:t,onRemove:n}){let{portal:r}=i(),a=`cursor-pointer rounded-lg px-3 py-2 text-[14px] outline-none data-[highlighted]:bg-raise`;return/* @__PURE__ */ (0,V.jsxs)(Za,{children:[/* @__PURE__ */ (0,V.jsx)($a,{"aria-label":`More for ${e}`,className:`grid size-9 shrink-0 place-items-center rounded-lg text-muted transition-colors hover:bg-raise hover:text-ink`,children:/* @__PURE__ */ (0,V.jsx)(JC,{className:`size-5`,"aria-hidden":!0})}),/* @__PURE__ */ (0,V.jsx)(eo,{container:r,children:/* @__PURE__ */ (0,V.jsxs)(no,{align:`end`,sideOffset:4,className:`z-50 min-w-[240px] rounded-xl border border-rule bg-panel p-1 shadow-[0_12px_32px_-12px_rgb(0_0_0/0.3)]`,children:[t&&/* @__PURE__ */ (0,V.jsx)(ro,{className:a,onSelect:t,children:`Use these settings for all files`}),/* @__PURE__ */ (0,V.jsx)(ro,{className:E(a,`text-danger`),onSelect:n,children:`Remove file`})]})})]})}function QO({row:{item:e,stale:t},line:n,thumb:r,on:i,priced:a,onSelect:o,onRemove:s,onCopies:c,onApplyAll:l}){let u=e.file.name,d=e.result&&e.result.stats.sizeMm||r&&r.size,f=d?/* @__PURE__ */ (0,V.jsxs)(YO,{icon:bw,children:[d.map(e=>e.toFixed(1)).join(` × `),` mm`]}):/* @__PURE__ */ (0,V.jsx)(`span`,{children:_e(e.file.size)}),p=a&&n&&!t&&!e.error;return/* @__PURE__ */ (0,V.jsxs)(`li`,{className:E(`flex flex-wrap items-center gap-x-3 gap-y-2 rounded-2xl border bg-panel p-2 transition-colors @xl:flex-nowrap`,i?`border-accent`:`border-rule`),children:[/* @__PURE__ */ (0,V.jsxs)(`button`,{type:`button`,"aria-current":i||void 0,onClick:o,className:`flex min-w-0 flex-1 basis-full items-center gap-3.5 rounded-xl text-left @xl:basis-0`,children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:`grid size-[62px] shrink-0 place-items-center overflow-hidden rounded-xl bg-raise`,children:r?/* @__PURE__ */ (0,V.jsx)(`img`,{src:r.url,alt:``,className:`size-full object-contain`}):/* @__PURE__ */ (0,V.jsx)(te,{className:`size-6 text-muted`,strokeWidth:1.6,"aria-hidden":!0})}),/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:`block truncate text-[14px] font-medium`,title:u,children:u}),e.error?/* @__PURE__ */ (0,V.jsx)(`span`,{className:`mt-1 line-clamp-2 block text-[13px] text-warn`,title:e.error,children:e.error}):/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`mt-1.5 flex flex-wrap items-center gap-x-4 gap-y-1 text-[12px] text-muted`,children:[p&&/* @__PURE__ */ (0,V.jsx)(YO,{icon:te,children:UE(n.gramsRange)}),p&&/* @__PURE__ */ (0,V.jsx)(YO,{icon:WC,children:WE(n.secondsRange)}),f,a&&!n&&/* @__PURE__ */ (0,V.jsx)(`span`,{children:`Not priced yet`}),a&&t&&/* @__PURE__ */ (0,V.jsx)(`span`,{className:`text-warn`,children:`Changed, update the price`}),p&&e.result.stats.watertight===!1&&/* @__PURE__ */ (0,V.jsx)(`span`,{className:`text-warn`,children:`Has holes, so it may not print as expected`})]})]})]}),/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`flex w-full items-center justify-end gap-3 @xl:w-auto`,children:[p&&n.range&&/* @__PURE__ */ (0,V.jsx)(`span`,{className:`num mr-auto text-[14px] font-semibold whitespace-nowrap @xl:mr-1`,children:HE(n.range,n.currency)}),a&&/* @__PURE__ */ (0,V.jsx)(XO,{name:u,value:e.copies,onChange:c}),/* @__PURE__ */ (0,V.jsx)(ZO,{name:u,onApplyAll:a?l:void 0,onRemove:s})]})]})}function $O({page:e,pages:t,first:n,last:r,count:i,onPage:a}){let o=`grid size-8 place-items-center rounded-lg text-muted transition-colors hover:bg-raise hover:text-ink disabled:opacity-40 disabled:hover:bg-transparent`;return/* @__PURE__ */ (0,V.jsxs)(`nav`,{"aria-label":`File pages`,className:`flex items-center justify-between gap-2 pt-1`,children:[/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`num text-[13px] text-muted`,children:[n===r?n:`${n}–${r}`,` of `,i]}),/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,"aria-label":`Previous files`,disabled:e===0,onClick:()=>a(e-1),className:o,children:/* @__PURE__ */ (0,V.jsx)(RC,{className:`size-4`,"aria-hidden":!0})}),Array.from({length:t},(t,n)=>/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,"aria-label":`Page ${n+1}`,"aria-current":n===e?`page`:void 0,onClick:()=>a(n),className:E(`num grid size-8 place-items-center rounded-lg text-[13px] font-medium transition-colors`,n===e?`bg-accent text-accent-contrast`:`text-muted hover:bg-raise hover:text-ink`),children:n+1},n)),/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,"aria-label":`Next files`,disabled:e===t-1,onClick:()=>a(e+1),className:o,children:/* @__PURE__ */ (0,V.jsx)(IC,{className:`size-4`,"aria-hidden":!0})})]})]})}function ek({files:e,lineCost:t,thumbs:n,priced:r}){let i=e.rows.length,a=cO(i),[o,s]=(0,B.useState)(0),c=Math.min(o,a-1);(0,B.useEffect)(()=>{let t=e.rows.findIndex(t=>t.item.id===e.selected);t>=0&&s(lO(t))},[e.selected]);let l=e.rows.slice(c*2,(c+1)*2),u=i>0&&/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`num rounded-full border border-rule px-2.5 py-0.5 text-[13px] text-muted`,children:[i,` of `,e.max]});return/* @__PURE__ */ (0,V.jsx)(VO,{area:`files`,title:`Your files`,action:u,children:/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`@container space-y-2`,children:[i<e.max&&/* @__PURE__ */ (0,V.jsxs)(`button`,{type:`button`,onClick:e.onAdd,className:`flex w-full items-center gap-4 rounded-2xl border border-dashed border-rule p-2.5 text-left transition-colors hover:border-accent`,children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:`grid size-12 shrink-0 place-items-center rounded-full bg-raise`,children:/* @__PURE__ */ (0,V.jsx)(mw,{className:`size-5`,"aria-hidden":!0})}),/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`min-w-0`,children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:`block text-[14px] font-semibold`,children:i?`Add more files`:`Add files`}),/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`block text-[13px] text-muted`,children:[`Upload STL, 3MF, OBJ or STEP (max `,e.max,` files)`]})]})]}),i>0&&/* @__PURE__ */ (0,V.jsx)(`ul`,{className:E(`space-y-2`,a>1&&`min-h-[284px] @xl:min-h-[188px]`),children:l.map(a=>/* @__PURE__ */ (0,V.jsx)(QO,{row:a,line:a.item.result?t(a.item):null,thumb:n[a.item.id],on:a.item.id===e.selected,priced:r,onSelect:()=>e.onSelect(a.item.id),onRemove:()=>e.onRemove(a.item.id),onCopies:t=>e.onCopies(a.item.id,t),onApplyAll:i>1?()=>e.onApplyAll(a.item.id):void 0},a.item.id))}),a>1&&/* @__PURE__ */ (0,V.jsx)($O,{page:c,pages:a,first:c*2+1,last:Math.min((c+1)*2,i),count:i,onPage:s})]})})}function tk({simple:e,onSimple:t,materials:n,printer:r}){let i=n.find(t=>t.id===e.material),a=IE(e.material,r),o=Math.max(0,AE.findIndex(t=>t.id===e.quality));return/* @__PURE__ */ (0,V.jsxs)(VO,{area:`material`,children:[/* @__PURE__ */ (0,V.jsx)(BO,{title:`Material`,aside:i&&i.hint}),/* @__PURE__ */ (0,V.jsx)(HO,{label:`Material`,value:e.material,onChange:e=>t({material:e}),options:n.map(e=>({value:e.id,label:e.id}))}),a&&/* @__PURE__ */ (0,V.jsx)(`p`,{className:`mt-2.5 text-[13px] text-warn`,children:a}),/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`mt-5 border-t border-rule pt-4`,children:[/* @__PURE__ */ (0,V.jsx)(BO,{title:`Finish`,aside:`${AE[o].mm} mm layers`}),/* @__PURE__ */ (0,V.jsx)(TE,{bare:!0,label:`Finish`,values:AE.map((e,t)=>t),value:o,onChange:e=>t({quality:AE[e].id}),format:e=>AE[e].label,valueText:e=>`${AE[e].label}, ${AE[e].mm} mm layers`,captions:AE.map(e=>e.label)})]})]})}function nk({simple:e,onSimple:t}){return/* @__PURE__ */ (0,V.jsx)(VO,{area:`strength`,title:`Strength`,children:/* @__PURE__ */ (0,V.jsx)(`div`,{className:`@container`,children:/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`grid gap-4 @md:grid-cols-2 @md:gap-6`,children:[/* @__PURE__ */ (0,V.jsx)(TE,{label:`Infill`,values:DE,value:e.infill,onChange:e=>t({infill:e}),format:e=>`${e}%`,captions:[`Lighter`,`Stronger`]}),/* @__PURE__ */ (0,V.jsx)(TE,{label:`Walls`,values:jE,value:e.walls,onChange:e=>t({walls:e}),format:e=>`${e} ${e===1?`wall`:`walls`}`,captions:[jE[0],jE[jE.length-1]]})]})})})}var rk=`silver-fill inline-flex h-11 w-full items-center justify-center gap-2 rounded-[14px] px-5 text-[15px] font-semibold transition-opacity hover:opacity-90 disabled:opacity-50`;function ik({children:e}){let{portal:t}=i();return/* @__PURE__ */ (0,V.jsxs)(_o,{children:[/* @__PURE__ */ (0,V.jsx)(yo,{"aria-label":`How this price is worked out`,className:`grid size-6 place-items-center rounded-full opacity-75 transition-opacity hover:opacity-100`,children:/* @__PURE__ */ (0,V.jsx)(iw,{className:`size-4`,"aria-hidden":!0})}),/* @__PURE__ */ (0,V.jsx)(Co,{container:t,children:/* @__PURE__ */ (0,V.jsx)(To,{side:`top`,sideOffset:4,collisionPadding:12,className:`z-50 max-w-[260px] space-y-1.5 rounded-xl border border-rule bg-panel p-3 text-[13px] text-ink shadow-[0_12px_32px_-12px_rgb(0_0_0/0.3)]`,children:e})})]})}function ak({children:e}){return/* @__PURE__ */ (0,V.jsxs)(`p`,{className:`mt-3 flex items-start gap-2 text-[13px] text-hero-warn`,children:[/* @__PURE__ */ (0,V.jsx)(HC,{className:`mt-px size-4 shrink-0`,"aria-hidden":!0}),/* @__PURE__ */ (0,V.jsx)(`span`,{children:e})]})}function ok({estimate:e,percent:t,files:n,missing:r,stale:i,pieces:a,quick:o,ready:s,slicing:c,blocker:l,button:u,onEstimate:d,onButton:f}){let p=$E(c&&c.since),m=i+r>0,h=e&&e.range,g=s&&e&&!c;return/* @__PURE__ */ (0,V.jsxs)(`section`,{style:{gridArea:`cost`},className:`hero @container flex min-w-0 flex-col justify-between gap-5 rounded-[28px] p-6`,children:[/* @__PURE__ */ (0,V.jsxs)(`div`,{children:[/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`flex items-center gap-1`,children:[/* @__PURE__ */ (0,V.jsx)(`h2`,{className:`text-[14px] font-medium opacity-75`,children:`Estimated price`}),e&&(h||o)&&/* @__PURE__ */ (0,V.jsxs)(ik,{children:[h&&/* @__PURE__ */ (0,V.jsxs)(`p`,{children:[`Worked out from the material your models use.`,t>0&&` The range runs from that price to ${t}% more.`]}),o&&/* @__PURE__ */ (0,V.jsx)(`p`,{children:`A quick estimate, from the shape of your models.`})]})]}),e?/* @__PURE__ */ (0,V.jsxs)(V.Fragment,{children:[h?/* @__PURE__ */ (0,V.jsx)(Ix.p,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.35},className:`num mt-1.5 font-display text-[34px] leading-[1.05] font-semibold tracking-[-0.02em] @sm:text-[40px]`,children:HE(h,e.currency)},`${h.low}-${h.high}`):/* @__PURE__ */ (0,V.jsxs)(`p`,{className:`mt-1.5 font-display text-[24px] leading-tight font-semibold`,children:[`No price set for `,e.unpriced.join(` or `),` yet`]}),/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-x-5 gap-y-1 text-[13px] opacity-85`,children:[/* @__PURE__ */ (0,V.jsxs)(YO,{icon:te,children:[UE(e.gramsRange),` of material`]}),/* @__PURE__ */ (0,V.jsxs)(YO,{icon:WC,children:[`About `,WE(e.secondsRange)]}),n>1&&/* @__PURE__ */ (0,V.jsxs)(YO,{icon:nw,children:[n,` files, `,a,` pieces`]}),o&&/* @__PURE__ */ (0,V.jsx)(YO,{icon:Mw,children:`Quick estimate`})]})]}):/* @__PURE__ */ (0,V.jsx)(`p`,{className:`mt-1.5 text-[15px] opacity-85`,children:n?`Your files are ready. Get the price when your choices are set.`:`Upload a model, and its price shows here.`}),m&&!c&&e&&/* @__PURE__ */ (0,V.jsxs)(ak,{children:[r?`${r} ${r===1?`file has`:`files have`} no price yet.`:`Your choices changed.`,` Update the price to include `,r+i===1?`it`:`them`,`.`]}),l&&!c&&n>0&&/* @__PURE__ */ (0,V.jsx)(ak,{children:l})]}),g?u&&/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,className:rk,disabled:!h||e.unpriced.length>0,onClick:f,children:u.label}):/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,className:rk,disabled:!n||!!l||!!c,onClick:d,children:c?/* @__PURE__ */ (0,V.jsxs)(V.Fragment,{children:[/* @__PURE__ */ (0,V.jsx)(ee,{className:`size-[18px] animate-spin`,"aria-hidden":!0}),` `,PE(c.phase,`Working it out`),c.of>1?`, ${c.step} of ${c.of}`:``,` `,/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`num`,children:[p,` s`]})]}):e?`Update the price`:`Get the price`})]})}var sk={SLA:`Resin is cured layer by layer with light, for fine detail and smooth surfaces: miniatures, small precise parts, moulds.`,SLS:`A laser fuses nylon powder, for tough, functional parts with no supports: clips, hinges, housings that take a beating.`};function ck({process:e,contact:t,fileNames:n}){let r=UO.find(t=>t.id===e),i=WO(t,e,n),a=t&&t.name||`our lab`;return/* @__PURE__ */ (0,V.jsxs)(`section`,{style:{gridArea:`contact`},className:`hero flex min-w-0 flex-col justify-between gap-6 rounded-[28px] p-6`,children:[/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`max-w-md`,children:[/* @__PURE__ */ (0,V.jsxs)(`h2`,{className:`font-display text-[24px] leading-tight font-semibold`,children:[r.id,` prints are quoted by our team`]}),/* @__PURE__ */ (0,V.jsx)(`p`,{className:`mt-3 text-[15px] leading-relaxed`,children:sk[e]}),/* @__PURE__ */ (0,V.jsxs)(`p`,{className:`mt-3 text-[15px] leading-relaxed`,children:[`Email `,a,` your models and what they’re for, and we’ll reply with a price.`,n.length?` The email lists your files; attach them before you send it.`:``]})]}),i?/* @__PURE__ */ (0,V.jsxs)(`a`,{href:i,className:`silver-fill inline-flex h-11 items-center justify-center gap-2 self-start rounded-[14px] px-5 text-[15px] font-semibold transition-opacity hover:opacity-90`,children:[/* @__PURE__ */ (0,V.jsx)(cw,{className:`size-[18px]`,"aria-hidden":!0}),` Email us about `,r.id]}):/* @__PURE__ */ (0,V.jsxs)(`p`,{className:`text-[14px] font-medium`,children:[`Ask at `,a,` for a price.`]})]})}var lk=e=>e.replace(/\.\w+$/,``);function uk(e){let t=e.filter(e=>e.size<=sO),n=e.filter(e=>e.size>sO).map(e=>e.name);return n.length&&$x.error(`${n.join(`, `)}: over the 50 MB limit. Please choose a smaller file.`),t}function dk({defaults:e,slice:t,requestFor:n}){let[r,i]=(0,B.useReducer)(fO,uO),a=(0,B.useRef)(0),[o,s]=(0,B.useState)(null),c=r.items.find(e=>e.id===r.selected)||null,l=e=>pO(e,n(e)),u=r.items.map(e=>({item:e,stale:!!e.result&&e.result.sig!==l(e)})),d=r.items.filter(e=>mO(e,l(e))),f=t=>{let n=uk(t);if(!n.length)return;let o=10-r.items.length;if(o<=0)return $x.error(`Up to 10 files at a time. Remove one to add another.`);i({type:`add`,defaults:e,files:n.slice(0,o).map(e=>({id:`file-${++a.current}`,file:e}))});let s=n.length-o;s>0&&$x.error(`Up to 10 files at a time, so ${s} ${s===1?`was`:`were`} left out.`)},p=t=>{uk([t]).length&&i({type:`replace`,defaults:e,id:`file-${++a.current}`,file:t})},m=async({verb:e,success:r})=>{let a=(d.length?d:[c]).slice().sort((e,t)=>(t===c)-(e===c)),o=Date.now(),u=0,f=null;for(let[e,r]of a.entries()){let c=n(r),d=l(r);s({since:o,step:e+1,of:a.length,file:r.file.name,printer:c.printer,phase:`uploading`});try{let e=await t.mutateAsync({model:r.file,settings:c,rot:r.rot,onStep:e=>s(t=>t&&{...t,phase:e})}),n={stats:e.stats,used:e.used,price:e.price,quoteId:e.id,gcode:e.gcode||null,name:lk(r.file.name)+`.gcode`,material:c.material,sig:d};i({type:`result`,id:r.id,result:n}),u++}catch(e){f=e;let t=wD(e.status);if(i({type:`error`,id:r.id,error:t||e.message}),t)break}}s(null);let p=Math.max(1,Math.round((Date.now()-o)/1e3));f&&wD(f.status)?$x.error(wD(f.status)):u===a.length?$x.success(r(a.length===1?a[0].file.name:`${a.length} files`,p)):a.length===1?$x.error(f.message):$x.error(u?`${u} of ${a.length} files ${e}. The list says what went wrong with the others.`:`None of the ${a.length} files could be ${e}. The list says why.`)},h=c&&c.id;return{items:r.items,selected:c,rows:u,todo:d,slicing:o,add:f,replace:p,sliceAll:m,setSettings:e=>i({type:`settings`,id:h,patch:e}),rotate:e=>i({type:`rotate`,id:h,rot:e}),list:{rows:u,selected:r.selected,max:10,onSelect:e=>i({type:`select`,id:e}),onRemove:e=>i({type:`remove`,id:e}),onCopies:(e,t)=>i({type:`copies`,id:e,value:t}),onApplyAll:e=>{i({type:`applyToAll`,id:e}),$x.success(`${r.items.find(t=>t.id===e).file.name}'s settings now apply to all ${r.items.length} files`)}}}}function fk(e){let[t,n]=(0,B.useState)({}),r=(0,B.useRef)(/* @__PURE__ */ new Set),i=(0,B.useRef)(Promise.resolve()),a=e.map(e=>e.id).join();return(0,B.useEffect)(()=>{for(let{id:t,file:a}of e)r.current.has(t)||(r.current.add(t),i.current=i.current.then(async()=>{if(await new Promise(e=>setTimeout(e)),!r.current.has(t))return;let{renderThumbnail:e}=await import(`./chunks/thumbnail-RKI9IqqD.js`),i=await e(a).catch(()=>null);i&&(r.current.has(t)?n(e=>({...e,[t]:i})):URL.revokeObjectURL(i.url))}));let t=new Set(e.map(e=>e.id));for(let e of r.current)t.has(e)||r.current.delete(e);n(e=>{let n=Object.keys(e).filter(e=>!t.has(e));return n.length?(n.forEach(t=>URL.revokeObjectURL(e[t].url)),Object.fromEntries(Object.entries(e).filter(([e])=>t.has(e)))):e})},[a]),t}var pk=e=>e.map(e=>`"${e.join(` `)}"`).join(` `),mk=(e,t)=>Array(t).fill(e);function hk(e,t){let n=t=>e.has(t),r=n(`model`)?`model`:null,i=n(`files`)?`files`:null,a=t?[`material`,`strength`].filter(n):[],o=n(t?`cost`:`contact`)?t?`cost`:`contact`:null,s=[`process`,`model`,`files`,...a,o].filter(e=>e&&n(e)),c=!t&&i&&o,l=s.filter(e=>!c||e!==i&&e!==o).map(e=>mk(e,2));c&&l.push([i,o]);let u=[...n(`process`)?[`process`]:[],...a];o&&(!i||!t&&r)&&u.push(o);let d=u.length?u.map(e=>r?[r,r,e,e]:mk(e,4)):r?[mk(r,4)]:[],f=i?o?[[i,i,o,o]]:[mk(i,4)]:[];return{one:pk(s.map(e=>[e])),two:pk(l),four:pk([...d,...f])}}function gk(e,t){let n=KE(e.map(e=>({stats:e.result.stats,copies:e.copies,material:e.result.material,price:e.result.price})),t);return{currency:n.currency,range:n.range,gramsRange:n.gramsRange,secondsRange:n.secondsRange,unpriced:n.unpriced,quick:e.some(e=>e.result.stats.estimated),files:e.map(e=>{let{range:n,gramsRange:r,secondsRange:i}=GE(e.result.stats,e.copies,e.result.price,t);return{name:e.file.name,file:e.file,quoteId:e.result.quoteId,copies:e.copies,settings:e.settings,range:n,gramsRange:r,secondsRange:i}})}}function _k(e,t,n){let r=new URL(e,n);return r.searchParams.set(`quotes`,t.map(e=>`${e.quoteId}:${e.copies}`).join(`,`)),r.href}function vk(){let{config:e,emit:t,actions:n}=i(),[r,a]=DO(),o=JD(),s=XD(),[c,l]=(0,B.useState)(`FDM`),[u,d]=(0,B.useState)(()=>({...ME,...e.defaults})),f=(0,B.useRef)(null),p=JSON.stringify(e.defaults);(0,B.useEffect)(()=>d(t=>({...t,...e.defaults})),[p]);let m=o.data,h=m?m.defaultPrinter:``,g=m?m.pricing:null,_=dk({defaults:u,slice:s,requestFor:e=>({...e.settings,printer:h})}),{selected:v}=_,y=v?v.settings:u,b=e=>v?_.setSettings(e):d(t=>({...t,...e})),x=fk(_.items),S=AD(e),C=!S.has(`files`),w=YD(h),T=NE(w.data?w.data.materials:kE.map(e=>e.id)),E=T.map(e=>e.id).join();(0,B.useEffect)(()=>{T.length&&!T.some(e=>e.id===y.material)&&b({material:T[0].id})},[E,y.material]);let D=async e=>{let{models:t,others:n}=await z(e);t.length&&(C?_.replace(t[0]):_.add(t)),n.length&&$x.error(`${n.map(e=>e.file.name).join(`, `)}: not a 3D model. Use STL, 3MF, OBJ, STEP or IGES.`)},O=OC({noClick:!0,noKeyboard:!0,multiple:!0,onDrop:D}),k=_.items.filter(e=>e.result),A=k.map(e=>({stats:e.result.stats,copies:e.copies,material:e.result.material,price:e.result.price})),j=e=>GE(e.result.stats,e.copies,e.result.price,g),M=_.items.length?o.isError?`The server can’t be reached.`:w.error&&w.error.status===503?`Prices can’t be worked out right now. Please try again later.`:null:`Upload a model to get a price.`,N={..._.list,onAdd:()=>f.current.click()},P=UO.find(e=>e.id===c).priced,F=hk(S,P),I=()=>_.sliceAll({verb:`priced`,success:e=>`Price ready for ${e}`}),ee=P&&k.length===_.items.length&&!_.todo.length&&!_.slicing&&_.items.length>0,te=(0,B.useRef)(null),ne=e=>{let n=gk(_.items,g),r=JSON.stringify({...n,files:n.files.map(({file:e,...t})=>t)});(e||r!==te.current)&&t(`estimate`,n),te.current=r};(0,B.useEffect)(()=>{ee&&ne(!1)});let re=()=>{if(!ee||!e.button)return;let n=gk(_.items,g);t(`buttonclick`,n,{cancelable:!0})&&e.button.url&&location.assign(_k(e.button.url,n.files,document.baseURI))};return(0,B.useEffect)(()=>{n.getPrice=()=>{if(P&&_.items.length&&!_.slicing&&!M)return _.todo.length?I():ne(!0)}}),/* @__PURE__ */ (0,V.jsxs)(`div`,{...O.getRootProps({className:`outline-none`}),children:[/* @__PURE__ */ (0,V.jsx)(`input`,{ref:f,type:`file`,accept:ve,multiple:!C,hidden:!0,onChange:e=>{D([...e.target.files]),e.target.value=``}}),/* @__PURE__ */ (0,V.jsx)(`main`,{className:`mx-auto w-full p-3 sm:p-4`,children:/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`bento`,style:{"--areas-one":F.one,"--areas-two":F.two,"--areas-four":F.four},children:[S.has(`process`)&&/* @__PURE__ */ (0,V.jsx)(KO,{value:c,onChange:l,action:a&&/* @__PURE__ */ (0,V.jsx)(QE,{theme:r,onTheme:a})}),S.has(`model`)&&/* @__PURE__ */ (0,V.jsx)(JO,{model:v&&v.file,single:C,onChoose:()=>f.current.click()}),S.has(`files`)&&/* @__PURE__ */ (0,V.jsx)(ek,{files:N,lineCost:j,thumbs:x,priced:P}),P?/* @__PURE__ */ (0,V.jsxs)(V.Fragment,{children:[S.has(`material`)&&/* @__PURE__ */ (0,V.jsx)(tk,{simple:y,onSimple:b,materials:T,printer:h}),S.has(`strength`)&&/* @__PURE__ */ (0,V.jsx)(nk,{simple:y,onSimple:b}),S.has(`cost`)&&/* @__PURE__ */ (0,V.jsx)(ok,{estimate:A.length?KE(A,g):null,percent:g?g.range:0,files:_.items.length,missing:_.items.length-k.length,stale:_.rows.filter(e=>e.stale).length,pieces:_.items.reduce((e,t)=>e+t.copies,0),quick:k.some(e=>e.result.stats.estimated),ready:!_.todo.length,slicing:_.slicing,blocker:M,button:e.button,onEstimate:I,onButton:re})]}):S.has(`contact`)&&/* @__PURE__ */ (0,V.jsx)(ck,{process:c,contact:m&&m.contact,fileNames:_.items.map(e=>e.file.name)})]})}),/* @__PURE__ */ (0,V.jsx)(Pw,{show:O.isDragActive,text:`Drop your models to get a price`})]})}var yk=()=>new Pt({defaultOptions:{queries:{staleTime:1/0,retry:!1,refetchOnWindowFocus:!1}}});function bk({mode:e,...t}){let[n]=(0,B.useState)(yk);return/* @__PURE__ */ (0,V.jsx)(o.Provider,{value:t,children:/* @__PURE__ */ (0,V.jsx)(Te,{client:n,children:/* @__PURE__ */ (0,V.jsx)(Xy,{reducedMotion:`user`,children:/* @__PURE__ */ (0,V.jsxs)(S,{delayDuration:300,children:[e===`advanced`?/* @__PURE__ */ (0,V.jsx)(zO,{}):/* @__PURE__ */ (0,V.jsx)(vk,{}),(0,hn.createPortal)(/* @__PURE__ */ (0,V.jsx)(mS,{position:`top-center`,toastOptions:{className:`!bg-panel !text-ink !border-rule`}}),t.portal)]})})})})}var xk=`/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
56
- @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:"Archivo Variable", ui-sans-serif, system-ui, sans-serif;--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--container-md:28rem;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--leading-tight:1.25;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--animate-spin:spin 1s linear infinite;--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:"Archivo Variable", ui-sans-serif, system-ui, sans-serif;--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}:host{flex-direction:column;width:100%;min-width:0;display:flex}:host([mode=advanced]){height:100dvh}.studio-theme{all:initial;color-scheme:inherit;background:var(--bench);height:100%;min-height:0;color:var(--ink);font-family:var(--font-sans);-webkit-font-smoothing:antialiased;flex-direction:column;flex:auto;font-size:14px;line-height:1.45;display:flex}.studio-layout{flex:auto;min-height:0;container:studio/inline-size}:host([mode=advanced]) .studio-layout{overflow-y:auto}:focus-visible{outline:2px solid var(--ink);outline-offset:2px}button{cursor:pointer}button:disabled{cursor:not-allowed}}@layer components{.bento{grid-template-columns:minmax(0,1fr);grid-template-areas:var(--areas-one);gap:12px;display:grid}@container studio (width>=640px){.bento{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-areas:var(--areas-two)}}@container studio (width>=1024px){.bento{grid-template-columns:minmax(0,1.2fr) minmax(0,1.2fr) minmax(0,1fr) minmax(0,1fr);grid-template-areas:var(--areas-four)}}@container studio (width>=1280px){.bento{grid-template-columns:minmax(0,1.5fr) minmax(0,1.5fr) minmax(0,1fr) minmax(0,1fr)}}}@layer utilities{.\\@container{container-type:inline-size}.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:0}.inset-x-0{inset-inline:0}.inset-x-3{inset-inline:calc(var(--spacing) * 3)}.-top-1{top:calc(var(--spacing) * -1)}.top-0\\.5{top:calc(var(--spacing) * .5)}.top-1\\/2{top:50%}.top-3{top:calc(var(--spacing) * 3)}.top-16{top:calc(var(--spacing) * 16)}.top-\\[72px\\]{top:72px}.top-\\[calc\\(100\\%\\+3px\\)\\]{top:calc(100% + 3px)}.-right-1{right:calc(var(--spacing) * -1)}.right-3{right:calc(var(--spacing) * 3)}.right-\\[calc\\(100\\%\\+10px\\)\\]{right:calc(100% + 10px)}.bottom-0{bottom:0}.bottom-3{bottom:calc(var(--spacing) * 3)}.bottom-28{bottom:calc(var(--spacing) * 28)}.bottom-\\[calc\\(100\\%\\+10px\\)\\]{bottom:calc(100% + 10px)}.left-0\\.5{left:calc(var(--spacing) * .5)}.left-1\\/2{left:50%}.left-2\\.5{left:calc(var(--spacing) * 2.5)}.left-3{left:calc(var(--spacing) * 3)}.left-14{left:calc(var(--spacing) * 14)}.left-\\[calc\\(100\\%\\+4px\\)\\]{left:calc(100% + 4px)}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.container{width:100%}.m-1{margin:var(--spacing)}.mx-0\\.5{margin-inline:calc(var(--spacing) * .5)}.mx-auto{margin-inline:auto}.my-1{margin-block:var(--spacing)}.mt-1{margin-top:var(--spacing)}.mt-1\\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-2\\.5{margin-top:calc(var(--spacing) * 2.5)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-5{margin-top:calc(var(--spacing) * 5)}.mt-px{margin-top:1px}.mr-auto{margin-right:auto}.mb-2\\.5{margin-bottom:calc(var(--spacing) * 2.5)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-3\\.5{margin-bottom:calc(var(--spacing) * 3.5)}.ml-0\\.5{margin-left:calc(var(--spacing) * .5)}.ml-auto{margin-left:auto}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-flex{display:inline-flex}.aspect-\\[4\\/3\\]{aspect-ratio:4/3}.aspect-square{aspect-ratio:1}.size-2\\.5{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.size-3{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.size-3\\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-5{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-7{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.size-11{width:calc(var(--spacing) * 11);height:calc(var(--spacing) * 11)}.size-12{width:calc(var(--spacing) * 12);height:calc(var(--spacing) * 12)}.size-14{width:calc(var(--spacing) * 14);height:calc(var(--spacing) * 14)}.size-\\[18px\\]{width:18px;height:18px}.size-\\[62px\\]{width:62px;height:62px}.size-full{width:100%;height:100%}.h-1\\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-11{height:calc(var(--spacing) * 11)}.h-14{height:calc(var(--spacing) * 14)}.h-full{height:100%}.h-px{height:1px}.max-h-72{max-height:calc(var(--spacing) * 72)}.max-h-80{max-height:calc(var(--spacing) * 80)}.min-h-0{min-height:0}.min-h-10{min-height:calc(var(--spacing) * 10)}.min-h-\\[240px\\]{min-height:240px}.min-h-\\[284px\\]{min-height:284px}.min-h-\\[336px\\]{min-height:336px}.min-h-\\[360px\\]{min-height:360px}.min-h-\\[480px\\]{min-height:480px}.min-h-\\[max\\(100\\%\\,360px\\)\\]{min-height:max(100%,360px)}.w-1\\.5{width:calc(var(--spacing) * 1.5)}.w-1\\/3{width:33.3333%}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-8{width:calc(var(--spacing) * 8)}.w-16{width:calc(var(--spacing) * 16)}.w-40{width:calc(var(--spacing) * 40)}.w-64{width:calc(var(--spacing) * 64)}.w-80{width:calc(var(--spacing) * 80)}.w-\\[52px\\]{width:52px}.w-\\[104px\\]{width:104px}.w-\\[188px\\]{width:188px}.w-\\[min\\(360px\\,calc\\(100\\%-32px\\)\\)\\]{width:min(360px,100% - 32px)}.w-\\[min\\(560px\\,calc\\(100\\%-32px\\)\\)\\]{width:min(560px,100% - 32px)}.w-\\[var\\(--radix-popover-trigger-width\\)\\]{width:var(--radix-popover-trigger-width)}.w-\\[var\\(--radix-select-trigger-width\\)\\]{width:var(--radix-select-trigger-width)}.w-auto{width:auto}.w-full{width:100%}.w-px{width:1px}.max-w-\\[220px\\]{max-width:220px}.max-w-\\[260px\\]{max-width:260px}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.min-w-0{min-width:0}.min-w-9{min-width:calc(var(--spacing) * 9)}.min-w-48{min-width:calc(var(--spacing) * 48)}.min-w-56{min-width:calc(var(--spacing) * 56)}.min-w-\\[220px\\]{min-width:220px}.min-w-\\[240px\\]{min-width:240px}.flex-1{flex:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.basis-full{flex-basis:100%}.-translate-x-1\\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-6{--tw-translate-x:calc(var(--spacing) * 6);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-90{rotate:90deg}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-spin{animation:var(--animate-spin)}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.auto-cols-fr{grid-auto-columns:minmax(0,1fr)}.grid-flow-col{grid-auto-flow:column}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-\\[auto_1fr\\]{grid-template-columns:auto 1fr}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-3\\.5{gap:calc(var(--spacing) * 3.5)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}:where(.space-y-1\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-x-4{column-gap:calc(var(--spacing) * 4)}.gap-x-5{column-gap:calc(var(--spacing) * 5)}.gap-x-6{column-gap:calc(var(--spacing) * 6)}.gap-y-1{row-gap:var(--spacing)}.gap-y-1\\.5{row-gap:calc(var(--spacing) * 1.5)}.gap-y-2{row-gap:calc(var(--spacing) * 2)}.gap-y-3{row-gap:calc(var(--spacing) * 3)}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-\\[3px\\]{border-radius:3px}.rounded-\\[12px\\]{border-radius:12px}.rounded-\\[14px\\]{border-radius:14px}.rounded-\\[16px\\]{border-radius:16px}.rounded-\\[20px\\]{border-radius:20px}.rounded-\\[28px\\]{border-radius:28px}.rounded-full{border-radius:2147483647px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.\\!border-rule{border-color:var(--rule)!important}.border-accent{border-color:var(--accent)}.border-ink{border-color:var(--ink)}.border-panel{border-color:var(--panel)}.border-rule{border-color:var(--rule)}.\\!bg-panel{background-color:var(--panel)!important}.bg-accent{background-color:var(--accent)}.bg-bench\\/80{background-color:var(--bench)}@supports (color:color-mix(in lab, red, red)){.bg-bench\\/80{background-color:color-mix(in oklab, var(--bench) 80%, transparent)}}.bg-black\\/40{background-color:#0006}@supports (color:color-mix(in lab, red, red)){.bg-black\\/40{background-color:color-mix(in oklab, var(--color-black) 40%, transparent)}}.bg-danger{background-color:var(--danger)}.bg-ink{background-color:var(--ink)}.bg-muted\\/60{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.bg-muted\\/60{background-color:color-mix(in oklab, var(--muted) 60%, transparent)}}.bg-ok{background-color:var(--ok)}.bg-panel,.bg-panel\\/85{background-color:var(--panel)}@supports (color:color-mix(in lab, red, red)){.bg-panel\\/85{background-color:color-mix(in oklab, var(--panel) 85%, transparent)}}.bg-panel\\/90{background-color:var(--panel)}@supports (color:color-mix(in lab, red, red)){.bg-panel\\/90{background-color:color-mix(in oklab, var(--panel) 90%, transparent)}}.bg-raise{background-color:var(--raise)}.bg-rule{background-color:var(--rule)}.bg-transparent{background-color:#0000}.bg-viewer{background-color:var(--viewer-bg)}.bg-warn{background-color:var(--warn)}.object-contain{object-fit:contain}.p-0\\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:var(--spacing)}.p-2{padding:calc(var(--spacing) * 2)}.p-2\\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.px-1{padding-inline:var(--spacing)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-3\\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-8{padding-inline:calc(var(--spacing) * 8)}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-5{padding-block:calc(var(--spacing) * 5)}.py-6{padding-block:calc(var(--spacing) * 6)}.pt-1{padding-top:var(--spacing)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pr-1{padding-right:var(--spacing)}.pr-1\\.5{padding-right:calc(var(--spacing) * 1.5)}.pr-2\\.5{padding-right:calc(var(--spacing) * 2.5)}.pb-1\\.5{padding-bottom:calc(var(--spacing) * 1.5)}.pl-1{padding-left:var(--spacing)}.pl-2{padding-left:calc(var(--spacing) * 2)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-8{padding-left:calc(var(--spacing) * 8)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-display{font-family:Bricolage Grotesque Variable,Archivo Variable,ui-sans-serif,system-ui,sans-serif}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[12px\\]{font-size:12px}.text-\\[13px\\]{font-size:13px}.text-\\[14px\\]{font-size:14px}.text-\\[15px\\]{font-size:15px}.text-\\[16px\\]{font-size:16px}.text-\\[18px\\]{font-size:18px}.text-\\[20px\\]{font-size:20px}.text-\\[24px\\]{font-size:24px}.text-\\[34px\\]{font-size:34px}.leading-\\[1\\.05\\]{--tw-leading:1.05;line-height:1.05}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.display{letter-spacing:-.01em;font-stretch:118%}.tracking-\\[-0\\.01em\\]{--tw-tracking:-.01em;letter-spacing:-.01em}.tracking-\\[-0\\.02em\\]{--tw-tracking:-.02em;letter-spacing:-.02em}.\\[overflow-wrap\\:anywhere\\]{overflow-wrap:anywhere}.whitespace-nowrap{white-space:nowrap}.hero{background:var(--hero);color:#f4f4f5;box-shadow:inset 0 1px 0 #ffffff1a, 0 0 0 1px var(--hero-edge)}.silver-fill{background:var(--silver);color:#111114}.\\!text-ink{color:var(--ink)!important}.text-accent-contrast{color:var(--accent-contrast)}.text-danger{color:var(--danger)}.text-hero-warn{color:var(--hero-warn)}.text-ink{color:var(--ink)}.text-ink-contrast{color:var(--ink-contrast)}.text-muted,.text-muted\\/60{color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.text-muted\\/60{color:color-mix(in oklab, var(--muted) 60%, transparent)}}.text-warn{color:var(--warn)}.text-white{color:var(--color-white)}.lowercase{text-transform:lowercase}.num{font-variant-numeric:tabular-nums;font-stretch:112%}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.opacity-85{opacity:.85}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_12px_32px_-12px_rgb\\(0_0_0\\/0\\.3\\)\\]{--tw-shadow:0 12px 32px -12px var(--tw-shadow-color,#0000004d);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_12px_32px_-12px_rgb\\(0_0_0\\/0\\.35\\)\\]{--tw-shadow:0 12px 32px -12px var(--tw-shadow-color,#00000059);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_24px_64px_-24px_rgb\\(0_0_0\\/0\\.5\\)\\]{--tw-shadow:0 24px 64px -24px var(--tw-shadow-color,#00000080);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-ink{--tw-ring-color:var(--ink)}.ring-offset-2{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.ring-offset-panel{--tw-ring-offset-color:var(--panel)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.outline-offset-2{outline-offset:2px}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[opacity\\,border-color\\,background-color\\]{transition-property:opacity,border-color,background-color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[width\\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}@media (hover:hover){.group-hover\\:-translate-y-0\\.5:is(:where(.group):hover *){--tw-translate-y:calc(var(--spacing) * -.5);translate:var(--tw-translate-x) var(--tw-translate-y)}}.placeholder\\:text-muted::placeholder{color:var(--muted)}.last\\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.focus-within\\:border-muted:focus-within{border-color:var(--muted)}@media (hover:hover){.hover\\:border-accent:hover{border-color:var(--accent)}.hover\\:border-ink:hover{border-color:var(--ink)}.hover\\:border-muted:hover{border-color:var(--muted)}.hover\\:bg-ink:hover{background-color:var(--ink)}.hover\\:bg-raise:hover{background-color:var(--raise)}.hover\\:bg-rule:hover{background-color:var(--rule)}.hover\\:text-ink:hover{color:var(--ink)}.hover\\:opacity-90:hover{opacity:.9}.hover\\:opacity-100:hover{opacity:1}}.disabled\\:text-muted:disabled{color:var(--muted)}.disabled\\:opacity-40:disabled{opacity:.4}.disabled\\:opacity-50:disabled{opacity:.5}@media (hover:hover){.disabled\\:hover\\:bg-transparent:disabled:hover{background-color:#0000}}:where([data-state=on]) .in-data-\\[state\\=on\\]\\:text-ink{color:var(--ink)}.data-\\[disabled\\]\\:cursor-default[data-disabled]{cursor:default}.data-\\[disabled\\]\\:opacity-50[data-disabled]{opacity:.5}.data-\\[highlighted\\]\\:bg-raise[data-highlighted],.data-\\[selected\\=true\\]\\:bg-raise[data-selected=true]{background-color:var(--raise)}.data-\\[state\\=on\\]\\:bg-accent[data-state=on]{background-color:var(--accent)}.data-\\[state\\=on\\]\\:bg-panel[data-state=on]{background-color:var(--panel)}.data-\\[state\\=on\\]\\:text-accent-contrast[data-state=on]{color:var(--accent-contrast)}.data-\\[state\\=on\\]\\:text-ink[data-state=on]{color:var(--ink)}.data-\\[state\\=on\\]\\:shadow-\\[0_1px_2px_rgb\\(0_0_0\\/0\\.08\\)\\][data-state=on]{--tw-shadow:0 1px 2px var(--tw-shadow-color,#00000014);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.data-\\[state\\=on\\]\\:ring-2[data-state=on]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.data-\\[state\\=on\\]\\:ring-silver-edge[data-state=on]{--tw-ring-color:var(--silver-edge)}@container (width>=24rem){.\\@sm\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.\\@sm\\:text-\\[40px\\]{font-size:40px}}@container (width>=28rem){.\\@md\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.\\@md\\:gap-6{gap:calc(var(--spacing) * 6)}}@container (width>=36rem){.\\@xl\\:mr-1{margin-right:var(--spacing)}.\\@xl\\:min-h-\\[188px\\]{min-height:188px}.\\@xl\\:w-auto{width:auto}.\\@xl\\:basis-0{flex-basis:0}.\\@xl\\:flex-nowrap{flex-wrap:nowrap}}@container studio (width>=640px){.sm\\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\\:flex-row{flex-direction:row}.sm\\:items-center{align-items:center}.sm\\:p-4{padding:calc(var(--spacing) * 4)}}@container studio (width>=768px){.md\\:order-1{order:1}.md\\:order-2{order:2}.md\\:flex{display:flex}.md\\:h-full{height:100%}.md\\:min-h-0{min-height:0}.md\\:w-\\[340px\\]{width:340px}.md\\:flex-1{flex:1}.md\\:shrink-0{flex-shrink:0}.md\\:flex-row{flex-direction:row}.md\\:overflow-y-auto{overflow-y:auto}.md\\:border-r{border-right-style:var(--tw-border-style);border-right-width:1px}}@container studio (width>=1024px){.lg\\:absolute{position:absolute}.lg\\:bottom-3{bottom:calc(var(--spacing) * 3)}.lg\\:left-3{left:calc(var(--spacing) * 3)}.lg\\:z-10{z-index:10}.lg\\:flex{display:flex}.lg\\:min-h-\\[456px\\]{min-height:456px}.lg\\:min-h-\\[480px\\]{min-height:480px}.lg\\:w-\\[380px\\]{width:380px}.lg\\:w-auto{width:auto}.lg\\:max-w-\\[calc\\(100\\%-110px\\)\\]{max-width:calc(100% - 110px)}.lg\\:flex-nowrap{flex-wrap:nowrap}.lg\\:items-center{align-items:center}.lg\\:gap-6{gap:calc(var(--spacing) * 6)}.lg\\:border-0{border-style:var(--tw-border-style);border-width:0}.lg\\:bg-transparent{background-color:#0000}.lg\\:p-0{padding:0}}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:px-2\\.5 [cmdk-group-heading]{padding-inline:calc(var(--spacing) * 2.5)}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:pt-2 [cmdk-group-heading]{padding-top:calc(var(--spacing) * 2)}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:pb-1 [cmdk-group-heading]{padding-bottom:var(--spacing)}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:text-\\[12px\\] [cmdk-group-heading]{font-size:12px}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:font-medium [cmdk-group-heading]{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:text-muted [cmdk-group-heading]{color:var(--muted)}.\\[\\&\\>\\*\\]\\:pointer-events-auto>*{pointer-events:auto}}html[dir=ltr],[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%)}html[dir=rtl],[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%)}[data-sonner-toaster]{width:var(--width);--gray1:#fcfcfc;--gray2:#f8f8f8;--gray3:#f3f3f3;--gray4:#ededed;--gray5:#e8e8e8;--gray6:#e2e2e2;--gray7:#dbdbdb;--gray8:#c7c7c7;--gray9:#8f8f8f;--gray10:#858585;--gray11:#6f6f6f;--gray12:#171717;--border-radius:8px;box-sizing:border-box;z-index:999999999;outline:none;margin:0;padding:0;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;list-style:none;transition:transform .4s;position:fixed}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translate(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);opacity:0;transform:var(--y);touch-action:none;box-sizing:border-box;overflow-wrap:anywhere;outline:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;position:absolute}[data-sonner-toast][data-styled=true]{background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);width:var(--width);align-items:center;gap:6px;padding:16px;font-size:13px;display:flex;box-shadow:0 4px 12px #0000001a}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}[data-sonner-toast][data-y-position=top]{--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap));top:0}[data-sonner-toast][data-y-position=bottom]{--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap));bottom:0}[data-sonner-toast][data-styled=true] [data-description]{color:#3f3f3f;font-weight:400;line-height:1.4}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{color:inherit;font-weight:500;line-height:1.5}[data-sonner-toast][data-styled=true] [data-icon]{width:16px;height:16px;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end);flex-shrink:0;justify-content:flex-start;align-items:center;display:flex;position:relative}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform-origin:50%;animation:.3s forwards sonner-fade-in;transform:scale(.8)}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}[data-sonner-toast][data-styled=true] [data-button]{height:24px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);cursor:pointer;border:none;border-radius:4px;outline:none;flex-shrink:0;align-items:center;padding-left:8px;padding-right:8px;font-size:12px;font-weight:500;transition:opacity .4s,box-shadow .2s;display:flex}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px #0006}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:#00000014}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:#ffffff4d}[data-sonner-toast][data-styled=true] [data-close-button]{left:var(--toast-close-button-start);right:var(--toast-close-button-end);width:20px;height:20px;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);cursor:pointer;z-index:1;border-radius:50%;justify-content:center;align-items:center;padding:0;transition:opacity .1s,background .2s,border-color .2s;display:flex;position:absolute;top:0}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]:before{content:"";z-index:-1;height:100%;position:absolute;left:-100%;right:-100%}[data-sonner-toast][data-y-position=top][data-swiping=true]:before{bottom:50%;transform:scaleY(3)translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]:before{top:50%;transform:scaleY(3)translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]:before{content:"";position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]:after{content:"";height:calc(var(--gap) + 1px);width:100%;position:absolute;bottom:100%;left:0}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[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)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]:before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0px)) translateX(var(--swipe-amount-x,0px));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;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) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{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 (width<=600px){[data-sonner-toaster]{right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%;position:fixed}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{width:calc(100% - var(--mobile-offset-left) * 2);left:0;right:0}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:#ecfdf3;--success-border:#bffcd9;--success-text:#008a2e;--info-bg:#f0f8ff;--info-border:#dde7fd;--info-text:#0973dc;--warning-bg:#fffcf0;--warning-border:#fbeeb1;--warning-text:#dc7609;--error-bg:#fff0f0;--error-border:#ffe0e1;--error-text:#e60000}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:#333;--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:#1f1f1f;--normal-border:#333;--normal-border-hover:#404040;--normal-text:var(--gray1);--success-bg:#001f0f;--success-border:#003d1c;--success-text:#59f3a6;--info-bg:#000d1f;--info-border:#19233e;--info-text:#5896f3;--warning-bg:#1d1f00;--warning-border:#2e2e00;--warning-text:#f3cf58;--error-bg:#2d0607;--error-border:#4d0408;--error-text:#ff9ea1}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[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);z-index:10;position:absolute;inset:0}.sonner-loading-wrapper[data-visible=false]{transform-origin:50%;animation:.2s forwards sonner-fade-out}.sonner-spinner{height:var(--size);width:var(--size);position:relative;top:50%;left:50%}.sonner-loading-bar{background:var(--gray11);border-radius:6px;width:24%;height:8%;animation:1.2s linear infinite sonner-spin;position:absolute;top:-3.9%;left:-10%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg)translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg)translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg)translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg)translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg)translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg)translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg)translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg)translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg)translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg)translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg)translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg)translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}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{transform-origin:50%;transition:opacity .2s,transform .2s;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8)translate(-50%,-50%)}:host{--bench:#f2f2f3;--panel:#fff;--raise:#f5f5f6;--ink:#141416;--ink-contrast:#fff;--muted:#6b6d73;--rule:#e3e3e6;--accent:#18181b;--accent-contrast:#fff;--silver-edge:#b4b6bd;--hero:linear-gradient(145deg, #2a2b30 0%, #121215 55%, #050506 100%);--hero-edge:#26272b;--hero-warn:#e08a4f;--silver:linear-gradient(135deg, #f5f5f7 0%, #c9cbd1 45%, #9a9ca3 100%);--ok:#2f8f5b;--warn:#b4561f;--danger:#b8322a;--viewer-bg:#ecedee;--bed:#dddee1;--grid:#c9cacf;--bed-edge:#9c9da3;--travel:#2f6fdb;--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light}[data-theme=dark]{--bench:#0b0b0d;--panel:#141417;--raise:#1c1c20;--ink:#ececef;--ink-contrast:#0b0b0d;--muted:#9a9ba2;--rule:#2a2a2f;--accent:#dcdde2;--accent-contrast:#111114;--silver-edge:#c9cbd1;--hero:linear-gradient(145deg, #3a3b41 0%, #1d1e22 60%, #101012 100%);--hero-edge:#3a3b41;--ok:#4cb27a;--warn:#e08a4f;--danger:#ef6b5f;--viewer-bg:#0f0f11;--bed:#1b1b1f;--grid:#2a2a2f;--bed-edge:#55565c;--travel:#6fa0ff;--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}`,Sk=/@(?:property\s+[^{]+|font-face\s*)\{[^}]*\}/g;function Ck(e){let t=e.match(Sk)||[];return{shadow:e.replace(Sk,``),page:t.join(``)}}var wk=e=>e===`advanced`?`advanced`:`simple`;function Tk(){let e=null,t=[],n=e=>{let n=t;t=[],n.forEach(e)};return{get:()=>e?Promise.resolve(e):new Promise((e,n)=>t.push({resolve:e,reject:n})),set:t=>{e=t||null,e&&n(t=>t.resolve(e))},fail:e=>n(t=>t.reject(e))}}var Ek=[`light`,`dark`,`system`],Dk=`slicer-studio: open() works in advanced mode only`,Ok=e=>{let t=new CSSStyleSheet;return t.replaceSync(e),t},kk=e=>{document.adoptedStyleSheets=[...document.adoptedStyleSheets,e]},Ak=null;function jk(){if(Ak)return Ak;let{shadow:e,page:t}=Ck(xk);return Ak=Ok(e),kk(Ok(t)),import(`./chunks/fonts-DxaZCWS1.js`).then(({default:e})=>kk(Ok(e))),Ak}function Mk(){customElements.define(`slicer-studio`,class extends HTMLElement{static observedAttributes=[`api-url`,`mode`,`theme`,`config`];#e=null;#t=null;#n=null;#r={};#i={opener:Tk()};get config(){return this.#r}set config(e){this.#r=kD(e),this.#t&&this.#o()}getPrice(){return this.#i.getPrice?.()}open(e){return wk(this.getAttribute(`mode`))===`advanced`?this.#i.opener.get().then(t=>t(e)):Promise.reject(/* @__PURE__ */ Error(Dk))}connectedCallback(){if(clearTimeout(this.#n),Object.hasOwn(this,`config`)){let e=this.config;delete this.config,this.config=e}this.#e||this.#a(),this.#t??=(0,gn.createRoot)(this.#e.layout),this.#o()}disconnectedCallback(){this.#n=setTimeout(()=>{this.#t.unmount(),this.#t=null})}attributeChangedCallback(e,t,n){e===`mode`&&wk(n)!==`advanced`&&this.#i.opener.fail(/* @__PURE__ */ Error(Dk)),e===`config`?this.config=n:this.#t&&this.#o()}#a(){let e=this.attachShadow({mode:`open`});e.adoptedStyleSheets=[jk()];let t=(e,t)=>t.appendChild(Object.assign(document.createElement(`div`),{className:e})),n=t(`studio-theme`,e);this.#e={root:n,layout:t(`studio-layout`,n),portal:t(`studio-portals`,n)}}#o(){let e=this.getAttribute(`api-url`)||``,t=this.getAttribute(`theme`);this.#t.render((0,B.createElement)(B.StrictMode,null,(0,B.createElement)(bk,{key:e,...this.#e,apiUrl:e,config:this.#r,actions:this.#i,mode:wk(this.getAttribute(`mode`)),theme:Ek.includes(t)?t:null,emit:(e,t,{cancelable:n=!1}={})=>this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0,cancelable:n}))})))}})}typeof customElements<`u`&&!customElements.get(`slicer-studio`)&&Mk();
51
+ `},Ji=0,Yi=[];function Xi(e){var t=G.useRef([]),n=G.useRef([0,0]),r=G.useRef(),i=G.useState(Ji++)[0],a=G.useState(vi)[0],o=G.useRef(e);G.useEffect(function(){o.current=e},[e]),G.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Jr([e.lockRef.current],(e.shards||[]).map(Gi),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=G.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Ui(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Ii(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Ii(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Hi(h,t,e,h===`h`?s:c,!0)},[]),c=G.useCallback(function(e){var n=e;if(Yi.length&&Yi[Yi.length-1]===a){var r=`deltaY`in n?Wi(n):Ui(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Ki(e.delta,r)})[0];if(i&&i.should)n.cancelable&&n.preventDefault();else if(!i){var c=(o.current.shards||[]).map(Gi).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=G.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Zi(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=G.useCallback(function(e){n.current=Ui(e),r.current=void 0},[]),d=G.useCallback(function(t){l(t.type,Wi(t),t.target,s(t,e.lockRef.current))},[]),f=G.useCallback(function(t){l(t.type,Ui(t),t.target,s(t,e.lockRef.current))},[]);G.useEffect(function(){return Yi.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,ji),document.addEventListener(`touchmove`,c,ji),document.addEventListener(`touchstart`,u,ji),function(){Yi=Yi.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,ji),document.removeEventListener(`touchmove`,c,ji),document.removeEventListener(`touchstart`,u,ji)}},[]);var p=e.removeScrollBar,m=e.inert;return G.createElement(G.Fragment,null,m?G.createElement(a,{styles:qi(i)}):null,p?G.createElement(Oi,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Zi(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var q=ci(li,Xi),Qi=G.forwardRef(function(e,t){return G.createElement(di,Kr({},e,{ref:t,sideCar:q}))});Qi.classNames=di.classNames;var $i=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},ea=/* @__PURE__ */ new WeakMap,ta=/* @__PURE__ */ new WeakMap,na={},ra=0,ia=function(e){return e&&(e.host||ia(e.parentNode))},aa=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=ia(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},oa=function(e,t,n,r){var i=aa(t,Array.isArray(e)?e:[e]);na[n]||(na[n]=/* @__PURE__ */ new WeakMap);var a=na[n],o=[],s=/* @__PURE__ */ new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(ea.get(e)||0)+1,l=(a.get(e)||0)+1;ea.set(e,c),a.set(e,l),o.push(e),c===1&&i&&ta.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),ra++,function(){o.forEach(function(e){var t=ea.get(e)-1,i=a.get(e)-1;ea.set(e,t),a.set(e,i),t||(ta.has(e)||e.removeAttribute(r),ta.delete(e)),i||e.removeAttribute(n)}),ra--,ra||(ea=/* @__PURE__ */ new WeakMap,ea=/* @__PURE__ */ new WeakMap,ta=/* @__PURE__ */ new WeakMap,na={})}},sa=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||$i(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),oa(r,i,n,`aria-hidden`)):function(){return null}},ca=Object.defineProperty,la=(e,t)=>ca(e,`name`,{value:t,configurable:!0}),ua=`Dialog`,[da,fa]=$e(ua),[pa,ma]=da(ua),ha=/* @__PURE__ */ la(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=G.useRef(null),c=G.useRef(null),{nodes:l,registry:u}=se(),[d,f]=he({prop:r,defaultProp:i??!1,onChange:a,caller:ua}),[p,m]=G.useState(0),[h,g]=G.useState(0);return/* @__PURE__ */ (0,K.jsx)(pa,{scope:t,triggerRef:s,contentRef:c,contentId:w(),titleId:w(),descriptionId:w(),titlePresent:p>0,descriptionPresent:h>0,setTitleCount:m,setDescriptionCount:g,open:d,onOpenChange:f,onOpenToggle:G.useCallback(()=>f(e=>!e),[f]),modal:o,branchNodes:l,branchRegistry:u,children:n})},`Dialog`),ga=`DialogPortal`,[_a,va]=da(ga,{forceMount:void 0}),ya=/* @__PURE__ */ la(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=ma(ga,t);return/* @__PURE__ */ (0,K.jsx)(_a,{scope:t,forceMount:n,children:G.Children.map(r,e=>/* @__PURE__ */ (0,K.jsx)(L,{present:n||a.open,children:/* @__PURE__ */ (0,K.jsx)(re,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),ba=`DialogOverlay`,xa=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ la(function(e,t){let n=va(ba,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ma(ba,e.__scopeDialog);return a.modal?/* @__PURE__ */ (0,K.jsx)(L,{present:r||a.open,children:/* @__PURE__ */ (0,K.jsx)(Ca,{...i,ref:t})}):null},`DialogOverlay`)),Sa=ve(`DialogOverlay.RemoveScroll`),Ca=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ la(function(e,t){let{__scopeDialog:n,...r}=e,i=ma(ba,n),a=f(),o=c(t,a);return/* @__PURE__ */ (0,K.jsx)(Qi,{as:Sa,allowPinchZoom:!0,shards:G.useMemo(()=>[i.contentRef,...i.branchNodes.map(e=>({current:e}))],[i.contentRef,i.branchNodes]),children:/* @__PURE__ */ (0,K.jsx)(V.div,{"data-state":Pa(i.open),...r,ref:o,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),wa=`DialogContent`,Ta=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ la(function(e,t){let n=va(wa,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ma(wa,e.__scopeDialog);return/* @__PURE__ */ (0,K.jsx)(L,{present:r||a.open,children:a.modal?/* @__PURE__ */ (0,K.jsx)(Ea,{...i,ref:t}):/* @__PURE__ */ (0,K.jsx)(Da,{...i,ref:t})})},`DialogContent`)),Ea=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ la(function(e,t){let n=ma(wa,e.__scopeDialog),r=G.useRef(null),i=c(t,n.contentRef,r);return G.useEffect(()=>{let e=r.current;if(e)return sa(e)},[]),/* @__PURE__ */ (0,K.jsx)(Oa,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:S(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:S(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:S(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),Da=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ la(function(e,t){let n=ma(wa,e.__scopeDialog),r=G.useRef(!1),i=G.useRef(!1);return/* @__PURE__ */ (0,K.jsx)(Oa,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),Oa=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ la(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,"aria-describedby":o,children:s,...c}=e,l=ma(wa,n);return Wr(),/* @__PURE__ */ (0,K.jsx)(E,{registry:l.branchRegistry,children:/* @__PURE__ */ (0,K.jsx)(b,{asChild:!0,loop:!0,trapped:r,branches:l.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:a,children:/* @__PURE__ */ (0,K.jsx)(gt,{role:`dialog`,id:l.contentId,"aria-labelledby":l.titlePresent?l.titleId:void 0,"aria-describedby":l.descriptionPresent?Na(o,l.descriptionId):o,"data-state":Pa(l.open),...c,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1),children:s})})})},`DialogContentImpl`)),ka=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ la(function(e,t){let{__scopeDialog:n,...r}=e,i=ma(`DialogTitle`,n),{setTitleCount:a}=i;return A(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),/* @__PURE__ */ (0,K.jsx)(V.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),Aa=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ la(function(e,t){let{__scopeDialog:n,...r}=e,i=ma(`DialogDescription`,n),{setDescriptionCount:a}=i;return A(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),/* @__PURE__ */ (0,K.jsx)(V.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),ja=`DialogClose`,Ma=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ la(function(e,t){let{__scopeDialog:n,...r}=e,i=ma(ja,n);return/* @__PURE__ */ (0,K.jsx)(V.button,{type:`button`,...r,ref:t,onClick:S(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function Na(...e){let t=/* @__PURE__ */ new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}la(Na,`concatAriaDescribedby`);function Pa(e){return e?`open`:`closed`}la(Pa,`getState`);var Fa=Object.defineProperty,Ia=(e,t)=>Fa(e,`name`,{value:t,configurable:!0}),La=!1;function Ra(){let[e,t]=G.useState(La);return G.useEffect(()=>{La||(La=!0,t(!0))},[]),e}Ia(Ra,`useIsHydrated`);var za=G.useSyncExternalStore;function Ba(){return()=>{}}Ia(Ba,`subscribe`);function Va(){return za(Ba,()=>!0,()=>!1)}Ia(Va,`useIsHydratedModern`);var Ha=typeof za==`function`?Va:Ra,Ua=Object.defineProperty,Wa=(e,t)=>Ua(e,`name`,{value:t,configurable:!0});function Ga(){let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e}var Ka=`rovingFocusGroup.onEntryFocus`,qa={bubbles:!1,cancelable:!0},Ja=`RovingFocusGroup`,[Ya,Xa,Za]=/* @__PURE__ */ br(Ja),[Qa,$a]=$e(Ja,[Za]),eo={Vertical:`vertical`,Horizontal:`horizontal`},to={LTR:`ltr`,RTL:`rtl`},[no,ro]=Qa(Ja),io=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ Wa(function(e,t){return/* @__PURE__ */ (0,K.jsx)(Ya.Provider,{scope:e.__scopeRovingFocusGroup,children:/* @__PURE__ */ (0,K.jsx)(Ya.Slot,{scope:e.__scopeRovingFocusGroup,children:/* @__PURE__ */ (0,K.jsx)(ao,{...e,ref:t})})})},`RovingFocusGroup`)),ao=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ Wa(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=e,p=G.useRef(null),m=c(t,p),h=Ir(a),[g,_]=he({prop:o,defaultProp:s??null,onChange:l,caller:Ja}),[v,y]=G.useState(!1),b=pe(u),x=Xa(n),C=G.useRef(!1),[w,T]=G.useState(0);return G.useEffect(()=>{let e=p.current;if(e)return e.addEventListener(Ka,b),()=>e.removeEventListener(Ka,b)},[b]),/* @__PURE__ */ (0,K.jsx)(no,{scope:n,orientation:r,dir:h,loop:i,currentTabStopId:g,onItemFocus:G.useCallback(e=>_(e),[_]),onItemShiftTab:G.useCallback(()=>y(!0),[]),onFocusableItemAdd:G.useCallback(()=>T(e=>e+1),[]),onFocusableItemRemove:G.useCallback(()=>T(e=>e-1),[]),children:/* @__PURE__ */ (0,K.jsx)(V.div,{tabIndex:v||w===0?-1:0,"data-orientation":r,...f,ref:m,style:{outline:`none`,...e.style},onMouseDown:S(e.onMouseDown,()=>{C.current=!0}),onFocus:S(e.onFocus,e=>{let t=!C.current;if(e.target===e.currentTarget&&t&&!v){let t=new CustomEvent(Ka,qa);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);fo([e.find(e=>e.active),e.find(e=>e.id===g),...e].filter(Boolean).map(e=>e.ref.current),d)}}C.current=!1}),onBlur:S(e.onBlur,()=>y(!1))})})},`RovingFocusGroupImpl`)),oo=`RovingFocusGroupItem`,so=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ Wa(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=w(),l=a||c,u=ro(oo,n),d=u.currentTabStopId===l,f=Xa(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u,g=Ha();return A(()=>{if(g&&r)return p(),()=>m()},[g,r,p,m]),G.useEffect(()=>{if(!g&&r)return p(),()=>m()},[g,r,p,m]),/* @__PURE__ */ (0,K.jsx)(Ya.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:/* @__PURE__ */ (0,K.jsx)(V.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:S(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:S(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:S(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=uo(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?po(n,r+1):n.slice(r+1)}setTimeout(()=>fo(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})},`RovingFocusGroupItem`)),co={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function lo(e,t){return t===to.RTL?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}Wa(lo,`getDirectionAwareKey`);function uo(e,t,n){let r=lo(e.key,n);if(!(t===eo.Vertical&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===eo.Horizontal&&[`ArrowUp`,`ArrowDown`].includes(r)))return co[r]}Wa(uo,`getFocusIntent`);function fo(e,t=!1){let n=Ga();for(let r of e)if(r===n||(r.focus({preventScroll:t}),Ga()!==n))return}Wa(fo,`focusFirst`);function po(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Wa(po,`wrapArray`);var mo=Object.defineProperty,ho=(e,t)=>mo(e,`name`,{value:t,configurable:!0});function go(){let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e}var _o=[`Enter`,` `],vo=[`ArrowDown`,`PageUp`,`Home`],yo=[`ArrowUp`,`PageDown`,`End`],bo=[...vo,...yo];[..._o],[..._o];var xo=`Menu`,[So,Co,wo]=/* @__PURE__ */ br(xo),[To,Eo]=$e(xo,[wo,P,$a]),Do=P(),Oo=$a(),[ko,Ao]=To(xo),[jo,Mo]=To(xo),No=/* @__PURE__ */ ho(e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=Do(t),[c,l]=G.useState(null),u=G.useRef(!1),d=pe(a),f=Ir(i);return G.useEffect(()=>{let e=/* @__PURE__ */ ho(()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=/* @__PURE__ */ ho(()=>u.current=!1,`handlePointer`);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})}},[]),G.useEffect(()=>{if(!n)return;let e=/* @__PURE__ */ ho(()=>d(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),/* @__PURE__ */ (0,K.jsx)(He,{...s,children:/* @__PURE__ */ (0,K.jsx)(ko,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:/* @__PURE__ */ (0,K.jsx)(jo,{scope:t,onClose:G.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})},`Menu`),Po=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ ho(function(e,t){let{__scopeMenu:n,...r}=e,i=Do(n);return/* @__PURE__ */ (0,K.jsx)(u,{...i,...r,ref:t})},`MenuAnchor`)),Fo=`MenuPortal`,[J,Io]=To(Fo,{forceMount:void 0}),Lo=/* @__PURE__ */ ho(e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Ao(Fo,t);return/* @__PURE__ */ (0,K.jsx)(J,{scope:t,forceMount:n,children:/* @__PURE__ */ (0,K.jsx)(L,{present:n||a.open,children:/* @__PURE__ */ (0,K.jsx)(re,{asChild:!0,container:i,children:r})})})},`MenuPortal`),Ro=`MenuContent`,[zo,Bo]=To(Ro),Vo=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ ho(function(e,t){let n=Io(Ro,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Ao(Ro,e.__scopeMenu),o=Mo(Ro,e.__scopeMenu);return/* @__PURE__ */ (0,K.jsx)(So.Provider,{scope:e.__scopeMenu,children:/* @__PURE__ */ (0,K.jsx)(L,{present:r||a.open,children:/* @__PURE__ */ (0,K.jsx)(So.Slot,{scope:e.__scopeMenu,children:o.modal?/* @__PURE__ */ (0,K.jsx)(Ho,{...i,ref:t}):/* @__PURE__ */ (0,K.jsx)(Uo,{...i,ref:t})})})})},`MenuContent`)),Ho=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ ho(function(e,t){let n=Ao(Ro,e.__scopeMenu),r=G.useRef(null),i=c(t,r);return G.useEffect(()=>{let e=r.current;if(e)return sa(e)},[]),/* @__PURE__ */ (0,K.jsx)(Go,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:S(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentModal`)),Uo=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ ho(function(e,t){let n=Ao(Ro,e.__scopeMenu);return/* @__PURE__ */ (0,K.jsx)(Go,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentNonModal`)),Wo=ve(`MenuContent.ScrollLock`),Go=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ ho(function(e,t){let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:p,onDismiss:m,disableOutsideScroll:h,...g}=e,_=Ao(Ro,n),v=Mo(Ro,n),y=Do(n),x=Oo(n),C=Co(n),[w,T]=G.useState(null),D=G.useRef(null),[O,k]=G.useState(null);M(O);let{nodes:A,registry:j}=se(),N=!!(i||h),P=c(t,D,_.onContentChange,k),F=G.useRef(0),I=G.useRef(``),ee=G.useRef(0),te=G.useRef(null),ne=G.useRef(`right`),re=G.useRef(0),ie=G.useMemo(()=>h?[D,...A.map(e=>({current:e}))]:[],[D,A,h]),ae=h?Qi:G.Fragment,oe=h?{as:Wo,allowPinchZoom:!0,shards:ie}:void 0,ce=/* @__PURE__ */ ho(e=>{let t=I.current+e,n=C().filter(e=>!e.disabled),r=go(),i=n.find(e=>e.ref.current===r)?.textValue,a=cs(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;function s(e){I.current=e,window.clearTimeout(F.current),e!==``&&(F.current=window.setTimeout(()=>s(``),1e3))}ho(s,`updateSearch`),s(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);G.useEffect(()=>()=>window.clearTimeout(F.current),[]),Wr();let le=G.useCallback(e=>ne.current===te.current?.side&&us(e,te.current?.area),[]);return/* @__PURE__ */ (0,K.jsx)(zo,{scope:n,searchRef:I,onItemEnter:G.useCallback(e=>{le(e)&&e.preventDefault()},[le]),onItemLeave:G.useCallback(e=>{le(e)||(D.current?.focus(),T(null))},[le]),onTriggerLeave:G.useCallback(e=>{le(e)&&e.preventDefault()},[le]),pointerGraceTimerRef:ee,onPointerGraceIntentChange:G.useCallback(e=>{te.current=e},[]),children:/* @__PURE__ */ (0,K.jsx)(E,{registry:N?j:null,children:/* @__PURE__ */ (0,K.jsx)(ae,{...oe,children:/* @__PURE__ */ (0,K.jsx)(b,{asChild:!0,trapped:i,branches:A,onMountAutoFocus:S(a,e=>{e.preventDefault(),D.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:/* @__PURE__ */ (0,K.jsx)(gt,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:p,onDismiss:m,children:/* @__PURE__ */ (0,K.jsx)(io,{asChild:!0,...x,dir:v.dir,orientation:`vertical`,loop:r,currentTabStopId:w,onCurrentTabStopIdChange:T,onEntryFocus:S(l,e=>{v.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:/* @__PURE__ */ (0,K.jsx)(Be,{role:`menu`,"aria-orientation":`vertical`,"data-state":rs(_.open),"data-radix-menu-content":``,dir:v.dir,...y,...g,ref:P,style:{outline:`none`,...g.style},onKeyDown:S(g.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&ce(e.key));let i=D.current;if(e.target!==i||!bo.includes(e.key))return;e.preventDefault();let a=C().filter(e=>!e.disabled).map(e=>e.ref.current);yo.includes(e.key)&&a.reverse(),os(a)}),onBlur:S(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(F.current),I.current=``)}),onPointerMove:S(e.onPointerMove,ds(e=>{let t=e.target,n=re.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>re.current?`right`:`left`;ne.current=t,re.current=e.clientX}}))})})})})})})})},`MenuContentImpl`)),Ko=`MenuItem`,qo=`menu.itemSelect`,Jo=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ ho(function(e,t){let{disabled:n=!1,onSelect:r,...i}=e,a=G.useRef(null),o=Mo(Ko,e.__scopeMenu),s=Bo(Ko,e.__scopeMenu),l=c(t,a),u=G.useRef(!1),d=/* @__PURE__ */ ho(()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(qo,{bubbles:!0,cancelable:!0});e.addEventListener(qo,e=>r?.(e),{once:!0}),z(e,t),t.defaultPrevented?u.current=!1:o.onClose()}},`handleSelect`);return/* @__PURE__ */ (0,K.jsx)(Yo,{...i,ref:l,disabled:n,onClick:S(e.onClick,d),onPointerDown:t=>{e.onPointerDown?.(t),u.current=!0},onPointerUp:S(e.onPointerUp,e=>{u.current||e.currentTarget?.click()}),onKeyDown:S(e.onKeyDown,e=>{n||e.target!==e.currentTarget||(s.searchRef.current===``||e.key!==` `)&&_o.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),Yo=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ ho(function(e,t){let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=Bo(Ko,n),s=Oo(n),l=G.useRef(null),u=c(t,l),[d,f]=G.useState(!1),[p,m]=G.useState(``);return G.useEffect(()=>{let e=l.current;e&&m((e.textContent??``).trim())},[a.children]),/* @__PURE__ */ (0,K.jsx)(So.ItemSlot,{scope:n,disabled:r,textValue:i??p,children:/* @__PURE__ */ (0,K.jsx)(so,{asChild:!0,...s,focusable:!r,children:/* @__PURE__ */ (0,K.jsx)(V.div,{role:`menuitem`,"data-highlighted":d?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:u,onPointerMove:S(e.onPointerMove,ds(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:S(e.onPointerLeave,ds(e=>o.onItemLeave(e))),onFocus:S(e.onFocus,()=>f(!0)),onBlur:S(e.onBlur,()=>f(!1))})})})},`MenuItemImpl`)),[Xo,Zo]=To(`MenuRadioGroup`,{value:void 0,onValueChange:/* @__PURE__ */ ho(()=>{},`onValueChange`)}),[Qo,$o]=To(`MenuItemIndicator`,{checked:!1}),es=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ ho(function(e,t){let{__scopeMenu:n,...r}=e;return/* @__PURE__ */ (0,K.jsx)(V.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})},`MenuSeparator`)),[ts,ns]=To(`MenuSub`);function rs(e){return e?`open`:`closed`}ho(rs,`getOpenState`);function is(e){return e===`indeterminate`}ho(is,`isIndeterminate`);function as(e){return is(e)?`indeterminate`:e?`checked`:`unchecked`}ho(as,`getCheckedState`);function os(e){let t=go();for(let n of e)if(n===t||(n.focus(),go()!==t))return}ho(os,`focusFirst`);function ss(e,t){return e.map((n,r)=>e[(t+r)%e.length])}ho(ss,`wrapArray`);function cs(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=ss(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}ho(cs,`getNextMatch`);function ls(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}ho(ls,`isPointInPolygon`);function us(e,t){return t?ls({x:e.clientX,y:e.clientY},t):!1}ho(us,`isPointerInGraceArea`);function ds(e){return t=>t.pointerType===`mouse`?e(t):void 0}ho(ds,`whenMouse`);var fs=Object.defineProperty,ps=(e,t)=>fs(e,`name`,{value:t,configurable:!0}),ms=`DropdownMenu`,[hs,gs]=$e(ms,[Eo]),_s=Eo(),[vs,ys]=hs(ms),bs=/* @__PURE__ */ ps(e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=_s(t),l=G.useRef(null),[u,d]=he({prop:i,defaultProp:a??!1,onChange:o,caller:ms});return/* @__PURE__ */ (0,K.jsx)(vs,{scope:t,triggerId:w(),triggerRef:l,contentId:w(),open:u,onOpenChange:d,onOpenToggle:G.useCallback(()=>d(e=>!e),[d]),modal:s,children:/* @__PURE__ */ (0,K.jsx)(No,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})},`DropdownMenu`),xs=`DropdownMenuTrigger`,Ss=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ ps(function(e,t){let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=ys(xs,n),o=_s(n),s=c(t,a.triggerRef);return/* @__PURE__ */ (0,K.jsx)(Po,{asChild:!0,...o,children:/* @__PURE__ */ (0,K.jsx)(V.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:s,onPointerDown:S(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:S(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),Cs=/* @__PURE__ */ ps(e=>{let{__scopeDropdownMenu:t,...n}=e,r=_s(t);return/* @__PURE__ */ (0,K.jsx)(Lo,{...r,...n})},`DropdownMenuPortal`),ws=`DropdownMenuContent`,Ts=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ ps(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=ys(ws,n),a=_s(n),o=G.useRef(!1);return/* @__PURE__ */ (0,K.jsx)(Vo,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:S(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:S(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.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)`}})},`DropdownMenuContent`)),Es=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ ps(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=_s(n);return/* @__PURE__ */ (0,K.jsx)(Jo,{...i,...r,ref:t})},`DropdownMenuItem`)),Ds=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ ps(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=_s(n);return/* @__PURE__ */ (0,K.jsx)(es,{...i,...r,ref:t})},`DropdownMenuSeparator`)),Os=Object.defineProperty,ks=(e,t)=>Os(e,`name`,{value:t,configurable:!0});function As(e,[t,n]){return Math.min(n,Math.max(t,e))}ks(As,`clamp`);var js=Object.defineProperty,Ms=(e,t)=>js(e,`name`,{value:t,configurable:!0}),Ns=`Popover`,[Ps,Fs]=$e(Ns,[P]),Is=P(),[Ls,Rs]=Ps(Ns),zs=/* @__PURE__ */ Ms(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=Is(t),c=G.useRef(null),[l,u]=G.useState(!1),[d,f]=G.useState(0),[p,m]=G.useState(0),[h,g]=he({prop:r,defaultProp:i??!1,onChange:a,caller:Ns});return/* @__PURE__ */ (0,K.jsx)(He,{...s,children:/* @__PURE__ */ (0,K.jsx)(Ls,{scope:t,contentId:w(),titleId:w(),descriptionId:w(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,triggerRef:c,open:h,onOpenChange:g,onOpenToggle:G.useCallback(()=>g(e=>!e),[g]),hasCustomAnchor:l,onCustomAnchorAdd:G.useCallback(()=>u(!0),[]),onCustomAnchorRemove:G.useCallback(()=>u(!1),[]),modal:o,children:n})})},`Popover`),Bs=`PopoverTrigger`,Vs=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ Ms(function(e,t){let{__scopePopover:n,...r}=e,i=Rs(Bs,n),a=Is(n),o=c(t,i.triggerRef),s=/* @__PURE__ */ (0,K.jsx)(V.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Qs(i.open),...r,ref:o,onClick:S(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:/* @__PURE__ */ (0,K.jsx)(u,{asChild:!0,...a,children:s})},`PopoverTrigger`)),Hs=`PopoverPortal`,[Us,Ws]=Ps(Hs,{forceMount:void 0}),Gs=/* @__PURE__ */ Ms(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=Rs(Hs,t);return/* @__PURE__ */ (0,K.jsx)(Us,{scope:t,forceMount:n,children:/* @__PURE__ */ (0,K.jsx)(L,{present:n||a.open,children:/* @__PURE__ */ (0,K.jsx)(re,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),Ks=`PopoverContent`,qs=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ Ms(function(e,t){let n=Ws(Ks,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=Rs(Ks,e.__scopePopover);return/* @__PURE__ */ (0,K.jsx)(L,{present:r||a.open,children:a.modal?/* @__PURE__ */ (0,K.jsx)(Ys,{...i,ref:t}):/* @__PURE__ */ (0,K.jsx)(Xs,{...i,ref:t})})},`PopoverContent`)),Js=ve(`PopoverContent.RemoveScroll`),Ys=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ Ms(function(e,t){let n=Rs(Ks,e.__scopePopover),r=G.useRef(null),i=c(t,r),a=G.useRef(!1),{nodes:o,registry:s}=se();return G.useEffect(()=>{let e=r.current;if(e)return sa(e)},[]),/* @__PURE__ */ (0,K.jsx)(Qi,{as:Js,allowPinchZoom:!0,shards:G.useMemo(()=>[r,...o.map(e=>({current:e}))],[r,o]),children:/* @__PURE__ */ (0,K.jsx)(Zs,{...e,ref:i,branchNodes:o,branchRegistry:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:S(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:S(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:S(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),Xs=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ Ms(function(e,t){let n=Rs(Ks,e.__scopePopover),r=G.useRef(!1),i=G.useRef(!1);return/* @__PURE__ */ (0,K.jsx)(Zs,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`PopoverContentNonModal`)),Zs=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ Ms(function(e,t){let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,"aria-describedby":f,branchNodes:p,branchRegistry:m,...h}=e,g=Rs(Ks,n),_=Is(n),[v,y]=G.useState(null),x=c(t,y);return M(v),Wr(),/* @__PURE__ */ (0,K.jsx)(E,{registry:m,children:/* @__PURE__ */ (0,K.jsx)(b,{asChild:!0,loop:!0,trapped:r,branches:p,onMountAutoFocus:i,onUnmountAutoFocus:a,children:/* @__PURE__ */ (0,K.jsx)(gt,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:d,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>g.onOpenChange(!1),deferPointerDownOutside:!0,children:/* @__PURE__ */ (0,K.jsx)(Be,{"data-state":Qs(g.open),role:`dialog`,id:g.contentId,"aria-labelledby":g.titlePresent?g.titleId:void 0,"aria-describedby":g.descriptionPresent?$s(f,g.descriptionId):f,..._,...h,ref:x,style:{...h.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)`}})})})})},`PopoverContentImpl`));function Qs(e){return e?`open`:`closed`}Ms(Qs,`getState`);function $s(...e){let t=/* @__PURE__ */ new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}Ms($s,`concatAriaDescribedby`);var ec=Object.defineProperty,tc=(e,t)=>ec(e,`name`,{value:t,configurable:!0});function nc(){let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e}var rc={ItemAligned:`item-aligned`,Popper:`popper`},ic={LTR:`ltr`,RTL:`rtl`},ac=[` `,`Enter`,`ArrowUp`,`ArrowDown`],oc=[` `,`Enter`],sc=`Select`,[cc,lc,uc]=/* @__PURE__ */ br(sc),[dc,fc]=$e(sc,[uc,P]),pc=P(),[mc,hc]=dc(sc),[gc,_c]=dc(sc);function vc(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m,internal_do_not_use_render:h}=e,g=pc(t),[_,v]=G.useState(null),[y,b]=G.useState(null),[x,S]=G.useState(!1),C=Ir(l),[T,E]=he({prop:r,defaultProp:i??!1,onChange:a,caller:sc}),[D,O]=he({prop:o,defaultProp:s,onChange:c,caller:sc}),k=G.useRef(null),A=G.useRef(!1),[j,M]=G.useState(null),N=/* @__PURE__ */ tc(e=>{M({value:e,hasConsumerStoppedPropagation:A.current}),O(e)},`handleUserSelect`),P=G.useRef(D);G.useEffect(()=>{let e=m?_?.ownerDocument.getElementById(m):_?.form;if(e instanceof HTMLFormElement){let t=/* @__PURE__ */ tc(()=>O(P.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[m,_,O]);let F=!_||!!m||!!_.closest(`form`),[I,ee]=G.useState(/* @__PURE__ */ new Set),te=w(),ne=Array.from(I).map(e=>e.props.value).join(`;`),re=G.useCallback(e=>{ee(t=>new Set(t).add(e))},[]),ie=G.useCallback(e=>{ee(t=>{let n=new Set(t);return n.delete(e),n})},[]),ae={required:p,trigger:_,onTriggerChange:v,valueNode:y,onValueNodeChange:b,valueNodeHasChildren:x,onValueNodeHasChildrenChange:S,contentId:te,value:D,onValueChange:O,hasConsumerStoppedPropagationRef:A,userSelection:j,onUserSelect:N,open:T,onOpenChange:E,dir:C,triggerPointerDownPosRef:k,disabled:f,name:u,autoComplete:d,form:m,nativeOptions:I,nativeSelectKey:ne,isFormControl:F};return/* @__PURE__ */ (0,K.jsx)(He,{...g,children:/* @__PURE__ */ (0,K.jsx)(mc,{scope:t,...ae,children:/* @__PURE__ */ (0,K.jsx)(cc.Provider,{scope:t,children:/* @__PURE__ */ (0,K.jsx)(gc,{scope:t,onNativeOptionAdd:re,onNativeOptionRemove:ie,children:el(h)?h(ae):n})})})})}tc(vc,`SelectProvider`);var yc=/* @__PURE__ */ tc(e=>{let{__scopeSelect:t,children:n,...r}=e;return/* @__PURE__ */ (0,K.jsx)(vc,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>/* @__PURE__ */ (0,K.jsxs)(K.Fragment,{children:[n,e?/* @__PURE__ */ (0,K.jsx)($c,{__scopeSelect:t}):null]})})},`Select`),bc=`SelectTrigger`,xc=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ tc(function(e,t){let{__scopeSelect:n,disabled:r=!1,...i}=e,a=pc(n),o=hc(bc,n),s=o.disabled||r,l=c(t,o.onTriggerChange),d=lc(n),f=G.useRef(`touch`),[p,m,h]=nl(e=>{let t=d().filter(e=>!e.disabled),n=rl(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onUserSelect(n.value)}),g=/* @__PURE__ */ tc(e=>{s||(o.onOpenChange(!0),h()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},`handleOpen`);return/* @__PURE__ */ (0,K.jsx)(u,{asChild:!0,...a,children:/* @__PURE__ */ (0,K.jsx)(V.button,{type:`button`,role:`combobox`,"aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":tl(o.value)?``:void 0,...i,ref:l,onClick:S(i.onClick,e=>{e.currentTarget.focus(),f.current!==`mouse`&&g(e)}),onPointerDown:S(i.onPointerDown,e=>{f.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(g(e),e.preventDefault())}),onKeyDown:S(i.onKeyDown,e=>{let t=p.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&(o.hasConsumerStoppedPropagationRef.current=e.isPropagationStopped(),m(e.key)),!(t&&e.key===` `)&&ac.includes(e.key)&&(g(),e.preventDefault())})})})},`SelectTrigger`)),Sc=`SelectValue`,Cc=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ tc(function(e,t){let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,l=hc(Sc,n),{onValueNodeHasChildrenChange:u}=l,d=a!==void 0,f=c(t,l.onValueNodeChange);A(()=>{u(d)},[u,d]);let p=tl(l.value);return/* @__PURE__ */ (0,K.jsx)(V.span,{...s,asChild:!p&&s.asChild,ref:f,style:{pointerEvents:`none`},children:/* @__PURE__ */ (0,K.jsx)(G.Fragment,{children:p?o:a},p?`placeholder`:`value`)})},`SelectValue`)),wc=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ tc(function(e,t){let{__scopeSelect:n,children:r,...i}=e;return/* @__PURE__ */ (0,K.jsx)(V.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})},`SelectIcon`)),[Tc,Ec]=dc(`SelectPortal`,{forceMount:void 0}),Dc=/* @__PURE__ */ tc(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return/* @__PURE__ */ (0,K.jsx)(Tc,{scope:e.__scopeSelect,forceMount:n,children:/* @__PURE__ */ (0,K.jsx)(re,{asChild:!0,...r})})},`SelectPortal`),Oc=`SelectContent`,kc=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ tc(function(e,t){let n=Ec(Oc,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=hc(Oc,e.__scopeSelect),[o,s]=G.useState();return A(()=>{s(new DocumentFragment)},[]),/* @__PURE__ */ (0,K.jsx)(L,{present:r||a.open,children:({present:e})=>e?/* @__PURE__ */ (0,K.jsx)(Fc,{...i,ref:t}):/* @__PURE__ */ (0,K.jsx)(Ac,{...i,fragment:o})})},`SelectContent`)),Ac=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ tc(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?Lr.createPortal(/* @__PURE__ */ (0,K.jsx)(Mc,{scope:n,children:/* @__PURE__ */ (0,K.jsx)(cc.Slot,{scope:n,children:/* @__PURE__ */ (0,K.jsx)(`div`,{ref:t,children:r})})}),i):null},`SelectContentFragment`)),jc=10,[Mc,Nc]=dc(Oc),Pc=ve(`SelectContent.RemoveScroll`),Fc=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ tc(function(e,t){let{__scopeSelect:n}=e,{position:r=rc.ItemAligned,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:h,hideWhenDetached:g,avoidCollisions:_,...v}=e,y=hc(Oc,n),[x,C]=G.useState(null),[w,T]=G.useState(null),E=c(t,C),[D,O]=G.useState(null),[k,A]=G.useState(null),j=lc(n),[M,N]=G.useState(!1),P=G.useRef(!1),F=G.useRef(!1),I=G.useRef(!1);G.useEffect(()=>{if(x)return sa(x)},[x]),Wr();let ee=G.useCallback(e=>{let[t,...n]=j().map(e=>e.ref.current),[r]=n.slice(-1),i=nc();for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&w&&(w.scrollTop=0),n===r&&w&&(w.scrollTop=w.scrollHeight),n?.focus(),nc()!==i))return},[j,w]),te=G.useCallback(()=>ee([D,x]),[ee,D,x]);G.useEffect(()=>{M&&te()},[M,te]);let{onOpenChange:ne,triggerPointerDownPosRef:re}=y;G.useEffect(()=>{if(x){let e={x:0,y:0},t=/* @__PURE__ */ tc(t=>{e={x:Math.abs(Math.round(t.pageX)-(re.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(re.current?.y??0))}},`handlePointerMove`),n=/* @__PURE__ */ tc(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(x)||ne(!1),document.removeEventListener(`pointermove`,t),re.current=null},`handlePointerUp`);return re.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[x,ne,re]),G.useEffect(()=>{let e=/* @__PURE__ */ tc(()=>ne(!1),`close`);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[ne]);let[ie,ae]=nl(e=>{let t=j().filter(e=>!e.disabled),n=rl(t,e,t.find(e=>e.ref.current===nc()));n&&setTimeout(()=>n.ref.current?.focus())}),oe=G.useCallback((e,t,n)=>{let r=!F.current;r&&(F.current=!0);let i=!P.current&&!n;y.value!==void 0&&y.value===t||i?(O(e),i&&(P.current=!0)):r&&O(e)},[y.value]),se=G.useCallback(()=>x?.focus(),[x]),ce=G.useCallback((e,t,n)=>{if(!e)return;let r=!I.current;r&&(I.current=!0);let i=!P.current&&!n;(y.value!==void 0&&y.value===t||i||r)&&A(e)},[y.value]),le=r===rc.Popper?Lc:Ic,ue=le===Lc?{side:s,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:h,hideWhenDetached:g,avoidCollisions:_}:{};return/* @__PURE__ */ (0,K.jsx)(Mc,{scope:n,content:x,viewport:w,onViewportChange:T,itemRefCallback:oe,selectedItem:D,onItemLeave:se,itemTextRefCallback:ce,focusSelectedItem:te,selectedItemText:k,position:r,isPositioned:M,searchRef:ie,children:/* @__PURE__ */ (0,K.jsx)(Qi,{as:Pc,allowPinchZoom:!0,children:/* @__PURE__ */ (0,K.jsx)(b,{asChild:!0,trapped:y.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:S(i,e=>{y.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:/* @__PURE__ */ (0,K.jsx)(gt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:/* @__PURE__ */ (0,K.jsx)(le,{role:`listbox`,id:y.contentId,"data-state":y.open?`open`:`closed`,dir:y.dir,onContextMenu:e=>e.preventDefault(),...v,...ue,onPlaced:()=>N(!0),ref:E,style:{display:`flex`,flexDirection:`column`,outline:`none`,...v.style},onKeyDown:S(v.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&ae(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=j().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>ee(t)),e.preventDefault()}})})})})})})},`SelectContentImpl`)),Ic=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ tc(function(e,t){let{__scopeSelect:n,onPlaced:r,...i}=e,a=hc(Oc,n),o=Nc(Oc,n),[s,l]=G.useState(null),[u,d]=G.useState(null),f=c(t,d),p=lc(n),m=G.useRef(!1),h=G.useRef(!0),{viewport:g,selectedItem:_,selectedItemText:v,focusSelectedItem:y}=o,b=G.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&u&&g&&_&&v){let e=a.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=v.getBoundingClientRect();if(a.dir!==ic.RTL){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-jc,d=As(a,[jc,Math.max(jc,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-jc,d=As(a,[jc,Math.max(jc,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=p(),c=window.innerHeight-jc*2,l=g.scrollHeight,d=window.getComputedStyle(u),f=parseInt(d.borderTopWidth,10),h=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=f+h+l+b+y,S=Math.min(_.offsetHeight*5,x),C=window.getComputedStyle(g),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-jc,D=c-E,O=_.offsetHeight/2,k=_.offsetTop+O,A=f+h+k,j=x-A;if(A<=E){let e=o.length>0&&_===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=u.clientHeight-g.offsetTop-g.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&_===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,f+g.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,g.scrollTop=A-E+g.offsetTop}s.style.margin=`${jc}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>m.current=!0)}},[p,a.trigger,a.valueNode,s,u,g,_,v,a.dir,r]);A(()=>b(),[b]);let[x,S]=G.useState();A(()=>{u&&S(window.getComputedStyle(u).zIndex)},[u]);let C=G.useCallback(e=>{e&&h.current===!0&&(b(),y?.(),h.current=!1)},[b,y]);return/* @__PURE__ */ (0,K.jsx)(Rc,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:m,onScrollButtonChange:C,children:/* @__PURE__ */ (0,K.jsx)(`div`,{ref:l,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:x},children:/* @__PURE__ */ (0,K.jsx)(V.div,{...i,ref:f,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})},`SelectItemAlignedPosition`)),Lc=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ tc(function(e,t){let{__scopeSelect:n,align:r=`start`,collisionPadding:i=jc,...a}=e,o=pc(n);return/* @__PURE__ */ (0,K.jsx)(Be,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.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)`}})},`SelectPopperPosition`)),[Rc,zc]=dc(Oc,{}),Bc=`SelectViewport`,Vc=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ tc(function(e,t){let{__scopeSelect:n,nonce:r,...i}=e,a=Nc(Bc,n),o=zc(Bc,n),s=c(t,a.onViewportChange),l=G.useRef(0);return/* @__PURE__ */ (0,K.jsxs)(K.Fragment,{children:[/* @__PURE__ */ (0,K.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:r}),/* @__PURE__ */ (0,K.jsx)(cc.Slot,{scope:n,children:/* @__PURE__ */ (0,K.jsx)(V.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:S(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(l.current-t.scrollTop);if(e>0){let r=window.innerHeight-jc*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}l.current=t.scrollTop})})})]})},`SelectViewport`)),[Hc,Uc]=dc(`SelectGroup`),Wc=`SelectItem`,[Gc,Kc]=dc(Wc),qc=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ tc(function(e,t){let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=hc(Wc,n),l=Nc(Wc,n),u=s.value===r,[d,f]=G.useState(a??``),[p,m]=G.useState(!1),h=pe(e=>l.itemRefCallback?.(e,r,i)),g=c(t,h),_=w(),v=G.useRef(`touch`);function y(e){s.hasConsumerStoppedPropagationRef.current=e.isPropagationStopped(),s.onUserSelect(r),s.onOpenChange(!1)}return tc(y,`handleSelect`),/* @__PURE__ */ (0,K.jsx)(Gc,{scope:n,value:r,disabled:i,textId:_,isSelected:u,onItemTextChange:G.useCallback(e=>{f(t=>t||(e?.textContent??``).trim())},[]),children:/* @__PURE__ */ (0,K.jsx)(cc.ItemSlot,{scope:n,value:r,disabled:i,textValue:d,children:/* @__PURE__ */ (0,K.jsx)(V.div,{role:`option`,"aria-labelledby":_,"data-highlighted":p?``:void 0,"aria-selected":u&&p,"data-state":u?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:g,onFocus:S(o.onFocus,()=>m(!0)),onBlur:S(o.onBlur,()=>m(!1)),onClick:S(o.onClick,e=>{i||v.current!==`mouse`&&y(e)}),onPointerUp:S(o.onPointerUp,e=>{i||v.current===`mouse`&&y(e)}),onPointerDown:S(o.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:S(o.onPointerMove,e=>{v.current=e.pointerType,i?l.onItemLeave?.():v.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:S(o.onPointerLeave,e=>{e.currentTarget===nc()&&l.onItemLeave?.()}),onKeyDown:S(o.onKeyDown,e=>{i||e.target!==e.currentTarget||(l.searchRef?.current===``||e.key!==` `)&&(oc.includes(e.key)&&y(e),e.key===` `&&e.preventDefault())})})})})},`SelectItem`)),Jc=`SelectItemText`,Yc=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ tc(function(e,t){let{__scopeSelect:n,className:r,style:i,...a}=e,o=hc(Jc,n),s=Nc(Jc,n),l=Kc(Jc,n),u=_c(Jc,n),[d,f]=G.useState(null),p=pe(e=>s.itemTextRefCallback?.(e,l.value,l.disabled)),m=c(t,f,l.onItemTextChange,p),h=d?.textContent,g=G.useMemo(()=>/* @__PURE__ */ (0,K.jsx)(`option`,{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:_,onNativeOptionRemove:v}=u;return A(()=>(_(g),()=>v(g)),[_,v,g]),/* @__PURE__ */ (0,K.jsxs)(K.Fragment,{children:[/* @__PURE__ */ (0,K.jsx)(V.span,{id:l.textId,...a,ref:m}),l.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!tl(o.value)?Lr.createPortal(a.children,o.valueNode):null]})},`SelectItemText`)),Xc=`SelectItemIndicator`,Zc=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ tc(function(e,t){let{__scopeSelect:n,...r}=e;return Kc(Xc,n).isSelected?/* @__PURE__ */ (0,K.jsx)(V.span,{"aria-hidden":!0,...r,ref:t}):null},`SelectItemIndicator`)),Qc=`SelectBubbleInput`,$c=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ tc(function({__scopeSelect:e,...t},n){let r=hc(Qc,e),{value:i,onValueChange:a,required:o,disabled:s,name:l,autoComplete:u,form:d,userSelection:f}=r,{nativeOptions:p,nativeSelectKey:m}=r,h=G.useRef(null),g=c(n,h),_=i??``,v=G.useRef(_),y=G.useRef(f),b=G.useRef(!1),x=Array.from(p).some(e=>(e.props.value??``)===``);return G.useEffect(()=>{let e=h.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set,r=f!==null&&f!==y.current;y.current=f;let i=v.current!==_;v.current=_;let a=r&&i;if(r&&!i&&f.value!==_&&!f.hasConsumerStoppedPropagation&&n){b.current=!0;try{n.call(e,f.value),e.dispatchEvent(new Event(`change`,{bubbles:!0}))}finally{b.current=!1,n.call(e,_)}return}let o=a&&!f.hasConsumerStoppedPropagation;if(i&&n){let t=new Event(`change`,{bubbles:o});n.call(e,_),e.dispatchEvent(t)}},[_,f]),/* @__PURE__ */ (0,K.jsxs)(V.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:l,autoComplete:u,disabled:s,form:d,onChange:e=>{b.current||a(e.target.value)},...t,style:{...O,...t.style},ref:g,defaultValue:_,children:[tl(i)&&!x?/* @__PURE__ */ (0,K.jsx)(`option`,{value:``}):null,Array.from(p)]},m)},`SelectBubbleInput`));function el(e){return typeof e==`function`}tc(el,`isFunction`);function tl(e){return e===``||e===void 0}tc(tl,`shouldShowPlaceholder`);function nl(e){let t=pe(e),n=G.useRef(``),r=G.useRef(0),i=G.useCallback(e=>{let i=n.current+e;t(i);function a(e){n.current=e,window.clearTimeout(r.current),e!==``&&(r.current=window.setTimeout(()=>a(``),1e3))}tc(a,`updateSearch`),a(i)},[t]),a=G.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return G.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}tc(nl,`useTypeaheadSearch`);function rl(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=il(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}tc(rl,`findNextItem`);function il(e,t){return e.map((n,r)=>e[(t+r)%e.length])}tc(il,`wrapArray`);var al=Object.defineProperty,Y=(e,t)=>al(e,`name`,{value:t,configurable:!0}),ol={Vertical:`vertical`,Horizontal:`horizontal`},sl={LTR:`ltr`,RTL:`rtl`},cl=[`PageUp`,`PageDown`],ll=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],ul={"from-left":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-right":[`Home`,`PageDown`,`ArrowDown`,`ArrowRight`],"from-bottom":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-top":[`Home`,`PageDown`,`ArrowUp`,`ArrowLeft`]},dl=`Slider`,[fl,pl,ml]=/* @__PURE__ */ br(dl),[hl,gl]=$e(dl,[ml]),[_l,vl]=hl(dl),yl=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ Y(function(e,t){let{name:n,min:r=0,max:i=100,step:a=1,orientation:o=ol.Horizontal,disabled:s=!1,minStepsBetweenThumbs:l=0,preserveThumbOrder:u=!1,defaultValue:d=[r],value:f,onValueChange:p=/* @__PURE__ */ Y(()=>{},`onValueChange`),onValueCommit:m=/* @__PURE__ */ Y(()=>{},`onValueCommit`),inverted:h=!1,form:g,..._}=e,v=G.useRef(/* @__PURE__ */ new Set),y=G.useRef(0),b=G.useRef(!1),[x,C]=G.useState(null),w=o===ol.Horizontal?Sl:Cl,[T,E]=G.useState(null),D=c(t,E),[O=[],k]=he({prop:f,defaultProp:d,onChange:/* @__PURE__ */ Y(e=>{[...v.current][y.current]?.focus({preventScroll:!0,focusVisible:b.current}),b.current=!1,p(e)},`onChange`)}),A=G.useRef(O),j=G.useRef(O);G.useEffect(()=>{let e=g?T?.ownerDocument.getElementById(g):T?.closest(`form`);if(e instanceof HTMLFormElement){let t=/* @__PURE__ */ Y(()=>k(j.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[T,g,k]);function M(e){F(e,Vl(O,e))}Y(M,`handleSlideStart`);function N(e){F(e,y.current)}Y(N,`handleSlideMove`);function P(){String(O)!==String(A.current)&&m(O)}Y(P,`handleSlideEnd`);function F(e,t,{commit:n}={commit:!1}){let o=Kl(a),s=As(ql(Math.round((e-r)/a)*a+r,o),[r,i]),c=l*a;function d(e){let n=u?As(s,[e[t-1]===void 0?r:e[t-1]+c,e[t+1]===void 0?i:e[t+1]-c]):s,a=Rl(e,n,t);return Wl(a,c)?{nextValues:a,changedIndex:u?t:a.indexOf(n),hasChanged:String(a)!==String(e)}:null}Y(d,`getNextValues`);let f=d(O);f?.hasChanged&&C(f.nextValues),k((e=[])=>{let t=d(e);return t?(y.current=t.changedIndex,t.hasChanged&&n&&m(t.nextValues),t.hasChanged?t.nextValues:e):e})}return Y(F,`updateValues`),/* @__PURE__ */ (0,K.jsx)(_l,{scope:e.__scopeSlider,name:n,disabled:s,min:r,max:i,valueIndexToChangeRef:y,thumbs:v.current,values:O,orientation:o,form:g,userRequestedValues:x,children:/* @__PURE__ */ (0,K.jsx)(fl.Provider,{scope:e.__scopeSlider,children:/* @__PURE__ */ (0,K.jsx)(fl.Slot,{scope:e.__scopeSlider,children:/* @__PURE__ */ (0,K.jsx)(w,{"aria-disabled":s,"data-disabled":s?``:void 0,..._,ref:D,onPointerDown:S(_.onPointerDown,()=>{s||(A.current=O,b.current=!1)}),min:r,max:i,inverted:h,onSlideStart:s?void 0:M,onSlideMove:s?void 0:N,onSlideEnd:s?void 0:P,onHomeKeyDown:()=>{s||(b.current=!0,F(r,0,{commit:!0}))},onEndKeyDown:()=>{s||(b.current=!0,F(i,O.length-1,{commit:!0}))},onStepKeyDown:({event:e,direction:t})=>{if(!s){b.current=!0;let n=cl.includes(e.key)||e.shiftKey&&ll.includes(e.key)?10:1,i=y.current,o=O[i];F(Jl(o,{min:r,step:a,direction:t,multiplier:n}),i,{commit:!0})}}})})})})},`Slider`)),[bl,xl]=hl(dl,{startEdge:`left`,endEdge:`right`,size:`width`,direction:1}),Sl=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ Y(function(e,t){let{min:n,max:r,dir:i,inverted:a,onSlideStart:o,onSlideMove:s,onSlideEnd:l,onStepKeyDown:u,...d}=e,[f,p]=G.useState(null),m=c(t,p),h=G.useRef(void 0),g=Ir(i),_=g===sl.LTR,v=_&&!a||!_&&a;function y(e){let t=h.current||f.getBoundingClientRect(),i=Gl([0,t.width],v?[n,r]:[r,n]);return h.current=t,i(e-t.left)}return Y(y,`getValueFromPointer`),/* @__PURE__ */ (0,K.jsx)(bl,{scope:e.__scopeSlider,startEdge:v?`left`:`right`,endEdge:v?`right`:`left`,direction:v?1:-1,size:`width`,children:/* @__PURE__ */ (0,K.jsx)(wl,{dir:g,"data-orientation":`horizontal`,...d,ref:m,style:{...d.style,"--radix-slider-thumb-transform":`translateX(-50%)`},onSlideStart:e=>{let t=y(e.clientX);o?.(t)},onSlideMove:e=>{let t=y(e.clientX);s?.(t)},onSlideEnd:()=>{h.current=void 0,l?.()},onStepKeyDown:e=>{let t=ul[v?`from-left`:`from-right`].includes(e.key);u?.({event:e,direction:t?-1:1})}})})},`SliderHorizontal`)),Cl=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ Y(function(e,t){let{min:n,max:r,inverted:i,onSlideStart:a,onSlideMove:o,onSlideEnd:s,onStepKeyDown:l,...u}=e,d=G.useRef(null),f=c(t,d),p=G.useRef(void 0),m=!i;function h(e){let t=p.current||d.current.getBoundingClientRect(),i=Gl([0,t.height],m?[r,n]:[n,r]);return p.current=t,i(e-t.top)}return Y(h,`getValueFromPointer`),/* @__PURE__ */ (0,K.jsx)(bl,{scope:e.__scopeSlider,startEdge:m?`bottom`:`top`,endEdge:m?`top`:`bottom`,size:`height`,direction:m?1:-1,children:/* @__PURE__ */ (0,K.jsx)(wl,{"data-orientation":`vertical`,...u,ref:f,style:{...u.style,"--radix-slider-thumb-transform":`translateY(50%)`},onSlideStart:e=>{let t=h(e.clientY);a?.(t)},onSlideMove:e=>{let t=h(e.clientY);o?.(t)},onSlideEnd:()=>{p.current=void 0,s?.()},onStepKeyDown:e=>{let t=ul[m?`from-bottom`:`from-top`].includes(e.key);l?.({event:e,direction:t?-1:1})}})})},`SliderVertical`)),wl=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ Y(function(e,t){let{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:a,onHomeKeyDown:o,onEndKeyDown:s,onStepKeyDown:c,...l}=e,u=vl(dl,n);return/* @__PURE__ */ (0,K.jsx)(V.span,{...l,ref:t,onKeyDown:S(e.onKeyDown,e=>{e.key===`Home`?(o(e),e.preventDefault()):e.key===`End`?(s(e),e.preventDefault()):cl.concat(ll).includes(e.key)&&(c(e),e.preventDefault())}),onPointerDown:S(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),u.thumbs.has(t)?t.focus({preventScroll:!0,focusVisible:!1}):r(e)}),onPointerMove:S(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&i(e)}),onPointerUp:S(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),a(e))})})},`SliderImpl`)),Tl=`SliderTrack`,El=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ Y(function(e,t){let{__scopeSlider:n,...r}=e,i=vl(Tl,n);return/* @__PURE__ */ (0,K.jsx)(V.span,{"data-disabled":i.disabled?``:void 0,"data-orientation":i.orientation,...r,ref:t})},`SliderTrack`)),Dl=`SliderRange`,Ol=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ Y(function(e,t){let{__scopeSlider:n,...r}=e,i=vl(Dl,n),a=xl(Dl,n),o=G.useRef(null),s=c(t,o),l=i.values.length,u=i.values.map(e=>zl(e,i.min,i.max)),d=l>1?Math.min(...u):0,f=100-Math.max(...u);return/* @__PURE__ */ (0,K.jsx)(V.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?``:void 0,...r,ref:s,style:{...e.style,[a.startEdge]:d+`%`,[a.endEdge]:f+`%`}})},`SliderRange`)),[kl,Al]=hl(`SliderThumb`),jl=`SliderThumbProvider`;function Ml(e){let{__scopeSlider:t,name:n,children:r,internal_do_not_use_render:i}=e,a=vl(jl,t),o=pl(t),[s,c]=G.useState(null),l=G.useMemo(()=>s?o().findIndex(e=>e.ref.current===s):-1,[o,s]),u=I(s),d=!s||!!a.form||!!s.closest(`form`),f=a.values[l],p=n??(a.name?a.name+(a.values.length>1?`[]`:``):void 0),m=f===void 0?0:zl(f,a.min,a.max);G.useEffect(()=>{if(s)return a.thumbs.add(s),()=>{a.thumbs.delete(s)}},[s,a.thumbs]);let h={value:f,name:p,form:a.form,isFormControl:d,index:l,thumb:s,onThumbChange:c,percent:m,size:u};return/* @__PURE__ */ (0,K.jsx)(kl,{scope:t,...h,children:Yl(i)?i(h):r})}Y(Ml,`SliderThumbProvider`);var Nl=`SliderThumbTrigger`,Pl=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ Y(function(e,t){let{__scopeSlider:n,...r}=e,i=vl(Nl,n),a=xl(Nl,n),{index:o,value:s,percent:l,size:u,onThumbChange:d}=Al(Nl,n),f=c(t,d),p=Bl(o,i.values.length),m=u?.[a.size],h=m?Hl(m,l,a.direction):0;return/* @__PURE__ */ (0,K.jsx)(`span`,{style:{transform:`var(--radix-slider-thumb-transform)`,position:`absolute`,[a.startEdge]:`calc(${l}% + ${h}px)`},children:/* @__PURE__ */ (0,K.jsx)(fl.ItemSlot,{scope:n,children:/* @__PURE__ */ (0,K.jsx)(V.span,{role:`slider`,"aria-label":e[`aria-label`]||p,"aria-valuemin":i.min,"aria-valuenow":s,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?``:void 0,tabIndex:i.disabled?void 0:0,...r,ref:f,style:s===void 0?{display:`none`}:e.style,onFocus:S(e.onFocus,()=>{i.valueIndexToChangeRef.current=o})})})})},`SliderThumbTrigger`)),Fl=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ Y(function(e,t){let{__scopeSlider:n,name:r,...i}=e;return/* @__PURE__ */ (0,K.jsx)(Ml,{__scopeSlider:n,name:r,internal_do_not_use_render:({index:e,isFormControl:r})=>/* @__PURE__ */ (0,K.jsxs)(K.Fragment,{children:[/* @__PURE__ */ (0,K.jsx)(Pl,{...i,ref:t,__scopeSlider:n}),r?/* @__PURE__ */ (0,K.jsx)(Ll,{__scopeSlider:n},e):null]})})},`SliderThumb`)),Il=`SliderBubbleInput`,Ll=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ Y(function({__scopeSlider:e,onInput:t,...n},r){let{index:i,value:a,name:o,form:s}=Al(Il,e),{userRequestedValues:l}=vl(Il,e),u=G.useRef(null),d=c(u,r),f=G.useRef(!1),p=G.useRef(a),m=G.useRef(l),h=G.useRef(l);return G.useEffect(()=>{let e=u.current;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set,r=p.current,o=r!==a;p.current=a;let s=l!==h.current;if(h.current=l,o&&n){let t=l!==m.current;m.current=l;let o=l?.[i];f.current=!(t&&(s&&o!==r||o===a));let c=new Event(`input`,{bubbles:!0});n.call(e,a),e.dispatchEvent(c),f.current=!1}},[i,a,l]),/* @__PURE__ */ (0,K.jsx)(V.input,{style:{display:`none`},name:o,form:s,...n,ref:d,defaultValue:a,onInput:S(t,e=>{f.current&&e.stopPropagation()})})},`SliderBubbleInput`));function Rl(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}Y(Rl,`getNextSortedValues`);function zl(e,t,n){return As(100/(n-t)*(e-t),[0,100])}Y(zl,`convertValueToPercentage`);function Bl(e,t){if(t>2)return`Value ${e+1} of ${t}`;if(t===2)return[`Minimum`,`Maximum`][e]}Y(Bl,`getLabel`);function Vl(e,t){if(e.length===1)return 0;let n=e.map(e=>Math.abs(e-t)),r=Math.min(...n);return n.indexOf(r)}Y(Vl,`getClosestValueIndex`);function Hl(e,t,n){let r=e/2;return(r-Gl([0,50],[0,r])(t)*n)*n}Y(Hl,`getThumbInBoundsOffset`);function Ul(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}Y(Ul,`getStepsBetweenValues`);function Wl(e,t){if(t>0){let n=Ul(e);return Math.min(...n)>=t}return!0}Y(Wl,`hasMinStepsBetweenValues`);function Gl(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}Y(Gl,`linearScale`);function Kl(e){if(!Number.isFinite(e))return 0;let t=e.toString();if(t.includes(`e`)){let[e,n]=t.split(`e`),r=e.split(`.`)[1]||``,i=Number(n);return Math.max(0,r.length-i)}let n=t.split(`.`)[1];return n?n.length:0}Y(Kl,`getDecimalCount`);function ql(e,t){let n=10**t;return Math.round(e*n)/n}Y(ql,`roundValue`);function Jl(e,{min:t,step:n,direction:r,multiplier:i}){let a=Kl(n),o=(e-t)/n,s=Math.round(o),c=ql(s*n+t,a)===ql(e,a),l;return l=c?s+i*r:r>0?Math.ceil(o):Math.floor(o),ql(l*n+t,a)}Y(Jl,`getNextStepValue`);function Yl(e){return typeof e==`function`}Y(Yl,`isFunction`);var Xl=Object.defineProperty,Zl=(e,t)=>Xl(e,`name`,{value:t,configurable:!0}),Ql=`Toggle`,$l=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ Zl(function(e,t){let{pressed:n,defaultPressed:r,onPressedChange:i,...a}=e,[o,s]=he({prop:n,onChange:i,defaultProp:r??!1,caller:Ql});return/* @__PURE__ */ (0,K.jsx)(V.button,{type:`button`,"aria-pressed":o,"data-state":o?`on`:`off`,"data-disabled":e.disabled?``:void 0,...a,ref:t,onClick:S(e.onClick,()=>{e.disabled||s(!o)})})},`Toggle`)),eu=Object.defineProperty,tu=(e,t)=>eu(e,`name`,{value:t,configurable:!0}),nu=`ToggleGroup`,ru={Single:`single`,Multiple:`multiple`},[iu,au]=$e(nu,[$a]),ou=$a(),su=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ tu(function(e,t){let{type:n,...r}=e;if(n===ru.Single)return/* @__PURE__ */ (0,K.jsx)(uu,{role:`radiogroup`,...r,ref:t});if(n===ru.Multiple)return/* @__PURE__ */ (0,K.jsx)(du,{role:`toolbar`,...r,ref:t});throw Error(`Missing prop \`type\` expected on \`${nu}\``)},`ToggleGroup`)),[cu,lu]=iu(nu),uu=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ tu(function(e,t){let{value:n,defaultValue:r,onValueChange:i=/* @__PURE__ */ tu(()=>{},`onValueChange`),...a}=e,[o,s]=he({prop:n,defaultProp:r??``,onChange:i,caller:nu});return/* @__PURE__ */ (0,K.jsx)(cu,{scope:e.__scopeToggleGroup,type:ru.Single,value:G.useMemo(()=>o?[o]:[],[o]),onItemActivate:s,onItemDeactivate:G.useCallback(()=>s(``),[s]),children:/* @__PURE__ */ (0,K.jsx)(mu,{...a,ref:t})})},`ToggleGroupImplSingle`)),du=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ tu(function(e,t){let{value:n,defaultValue:r,onValueChange:i=/* @__PURE__ */ tu(()=>{},`onValueChange`),...a}=e,[o,s]=he({prop:n,defaultProp:r??[],onChange:i,caller:nu}),c=G.useCallback(e=>s((t=[])=>[...t,e]),[s]),l=G.useCallback(e=>s((t=[])=>t.filter(t=>t!==e)),[s]);return/* @__PURE__ */ (0,K.jsx)(cu,{scope:e.__scopeToggleGroup,type:ru.Multiple,value:o,onItemActivate:c,onItemDeactivate:l,children:/* @__PURE__ */ (0,K.jsx)(mu,{...a,ref:t})})},`ToggleGroupImplMultiple`)),[fu,pu]=iu(nu),mu=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ tu(function(e,t){let{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:i=!0,orientation:a,dir:o,loop:s=!0,...c}=e,l=ou(n),u=Ir(o),d={dir:u,...c};return/* @__PURE__ */ (0,K.jsx)(fu,{scope:n,rovingFocus:i,disabled:r,children:i?/* @__PURE__ */ (0,K.jsx)(io,{asChild:!0,...l,orientation:a,dir:u,loop:s,children:/* @__PURE__ */ (0,K.jsx)(V.div,{...d,ref:t})}):/* @__PURE__ */ (0,K.jsx)(V.div,{...d,ref:t})})},`ToggleGroupImpl`)),hu=`ToggleGroupItem`,gu=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ tu(function(e,t){let n=lu(hu,e.__scopeToggleGroup),r=pu(hu,e.__scopeToggleGroup),i=ou(e.__scopeToggleGroup),a=n.value.includes(e.value),o=r.disabled||e.disabled,s={...e,pressed:a,disabled:o},c=G.useRef(null);return r.rovingFocus?/* @__PURE__ */ (0,K.jsx)(so,{asChild:!0,...i,focusable:!o,active:a,ref:c,children:/* @__PURE__ */ (0,K.jsx)(_u,{...s,ref:t})}):/* @__PURE__ */ (0,K.jsx)(_u,{...s,ref:t})},`ToggleGroupItem`)),_u=/* @__PURE__ */ G.forwardRef(/* @__PURE__ */ tu(function(e,t){let{__scopeToggleGroup:n,value:r,...i}=e,a=lu(hu,n),o={role:`radio`,"aria-checked":e.pressed,"aria-pressed":void 0},s=a.type===ru.Single?o:void 0;return/* @__PURE__ */ (0,K.jsx)($l,{...s,...i,ref:t,onPressedChange:e=>{e?a.onItemActivate(r):a.onItemDeactivate(r)}})},`ToggleGroupItemImpl`)),vu=/* @__PURE__ */ (0,G.createContext)({});function yu(e){let t=(0,G.useRef)(null);return t.current===null&&(t.current=e()),t.current}var bu=typeof window<`u`?G.useLayoutEffect:G.useEffect,xu=/* @__PURE__ */ (0,G.createContext)(null);function Su(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}function Cu(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function wu(e,t,n,r){let i=t=>typeof t==`function`?t(n===void 0?e.custom:n,...Cu(r)):t;return t=i(t),typeof t==`string`&&(t=e.variants&&e.variants[t]),i(t)}function Tu(e,t,n){return wu(e.getProps(),t,n,e)}var Eu=(e,t)=>t===`exit`?e.presenceContext?.custom:void 0,Du=e=>Array.isArray(e);function Ou(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,x(n))}function ku(e){return Du(e)?e[e.length-1]||0:e}function Au(e,t){let{transitionEnd:n={},transition:r={},...i}=Tu(e,t)||{};i={...i,...n};for(let t in i)Ou(e,t,ku(i[t]))}function ju(e){return!!(ht(e)&&e.add)}function Mu(e,t){let n=e.getValue(`willChange`);if(ju(n))return n.add(t);if(!n&&ut.WillChange){let n=new ut.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}var Nu=`data-framer-appear-id`;function Pu(e){return e.props[Nu]}var Fu=typeof window<`u`;function Iu({protectedKeys:e,needsAnimating:t},n){let r=n in e&&!t[n];return t[n]=!1,r}function Lu(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?me(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let f=[],p=i&&e.animationState?.getState()[i],m=a?.path;m&&(m.animateValues?m.animateValues(t=>e.getValue(t,e.latestValues[t]??0),s,a,n,f):m.animateVisualElement?.(e,s,a,n,f));for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||p&&Iu(p,t))continue;let o={delay:n,...fe(p?.out[t]||a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){Re.update(()=>r.set(i));continue}let m=!1;if(Fu&&window.MotionHandoffAnimation){let n=Pu(e);if(n){let e=window.MotionHandoffAnimation(n,t,Re);e!==null&&(o.startTime=e,m=!0)}}Mu(e,t);let h=l??e.shouldReduceMotion;r.start(C(t,r,i,h&&d.has(t)?{type:!1}:o,e,m));let g=r.animation;g&&f.push(g)}if(o){let t=()=>Re.update(()=>{o&&Au(e,o)});f.length?Promise.all(f).then(t):t()}return f}function Ru(e,t,n={}){let r=Tu(e,t,Eu(e,n.type)),i=n.transitionOverride||(r?.transition??(e.getDefaultTransition()||{})),a=()=>Promise.all(r?Lu(e,r,n):[]),o=(r=0)=>{let{variantChildren:a}=e,{delayChildren:o=0,staggerChildren:s,staggerDirection:c}=i,l=[];return a?.forEach(e=>{e.notify(`AnimationStart`,t),l.push(Ru(e,t,{...n,delay:r+(typeof o==`function`?0:o)+Su(a,e,o,s,c)}).then(()=>e.notify(`AnimationComplete`,t)))}),Promise.all(l)},{when:s}=i;return s?s===`beforeChildren`?a().then(()=>o()):o().then(a):Promise.all([a(),o(n.delay)])}function zu(e,t,n={}){return e.notify(`AnimationStart`,t),(Array.isArray(t)?Promise.all(t.map(t=>Ru(e,t,n))):typeof t==`string`?Ru(e,t,n):Promise.all(Lu(e,Tu(e,t,n.custom),n))).then(()=>{e.notify(`AnimationComplete`,t)})}var Bu=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`],{schedule:Vu,cancel:Hu}=/* @__PURE__ */ Ye(queueMicrotask,!1),Uu={},Wu={value:null,addProjectionMetrics:null};function Gu(e,t){let n=Ze.now();e=y(e);let r=({timestamp:i})=>{let a=i-n;a>=t&&(tt(r),e(a-t))};return Re.setup(r,!0),ne(()=>tt(r))}function Ku(e){return T(e)&&e.tagName===`svg`}function qu(e){return ht(e)?e.get():e}var Ju=e=>typeof e==`number`?e:parseFloat(e),Yu=Bu.length,X=e=>typeof e==`number`||ot.test(e);function Xu(e,t,n,r,i,a){i?(e.opacity=nt(0,n.opacity??1,Q(r)),e.opacityExit=nt(t.opacity??1,0,Zu(r))):a&&(e.opacity=nt(t.opacity??1,n.opacity??1,r));for(let i=0;i<Yu;i++){let a=Bu[i],o=Z(t,a),s=Z(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||X(o)===X(s)?(e[a]=Math.max(nt(Ju(o),Ju(s),r),0),(We.test(s)||We.test(o))&&(e[a]+=`%`)):e[a]=s)}for(let i=0;i<ce.length;i++){let a=ce[i];(t[a]||n[a])&&(e[a]=nt(t[a]||0,n[a]||0,r))}}function Z(e,t){return e[t]===void 0?e.borderRadius:e[t]}var Q=/*@__PURE__*/ Qu(0,.5,Ie),Zu=/*@__PURE__*/ Qu(.5,.95,ft);function Qu(e,t,n){return r=>r<e?0:r>t?1:n(mt(e,t,r))}function $u(e,t){e.min=t.min,e.max=t.max}function ed(e,t){$u(e.x,t.x),$u(e.y,t.y)}function td(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var nd=.9999,rd=1.0001,id=-.01,ad=.01;function od(e){return e.max-e.min}function sd(e,t,n){return Math.abs(e-t)<=n}function cd(e,t,n,r=.5){e.origin=r,e.originPoint=nt(t.min,t.max,e.origin),e.scale=od(n)/od(t),e.translate=nt(n.min,n.max,e.origin)-e.originPoint,(e.scale>=nd&&e.scale<=rd||isNaN(e.scale))&&(e.scale=1),(e.translate>=id&&e.translate<=ad||isNaN(e.translate))&&(e.translate=0)}function ld(e,t,n,r){cd(e.x,t.x,n.x,r?.originX),cd(e.y,t.y,n.y,r?.originY)}function ud(e,t,n,r=0){e.min=(r?nt(n.min,n.max,r):n.min)+t.min,e.max=e.min+od(t)}function dd(e,t,n,r){ud(e.x,t.x,n.x,r?.x),ud(e.y,t.y,n.y,r?.y)}function fd(e,t,n,r=0){let i=r?nt(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+od(t)}function pd(e,t,n,r){fd(e.x,t.x,n.x,r?.x),fd(e.y,t.y,n.y,r?.y)}function md(e,t,n,r,i){return e-=t,e=pt(e,1/n,r),i!==void 0&&(e=pt(e,1/i,r)),e}function hd(e,t=0,n=1,r=.5,i,a=e,o=e){if(We.test(t)&&(t=parseFloat(t),t=nt(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=nt(a.min,a.max,r);e===a&&(s-=t),e.min=md(e.min,t,n,s,i),e.max=md(e.max,t,n,s,i)}function gd(e,t,[n,r,i],a,o){hd(e,t[n],t[r],t[i],t.scale,a,o)}var _d=[`x`,`scaleX`,`originX`],vd=[`y`,`scaleY`,`originY`];function yd(e,t,n,r){gd(e.x,t,_d,n?.x,r?.x),gd(e.y,t,vd,n?.y,r?.y)}var bd=()=>({translate:0,scale:1,origin:0,originPoint:0}),xd=()=>({x:bd(),y:bd()}),Sd=()=>({min:0,max:0}),Cd=()=>({x:Sd(),y:Sd()});function wd(e){return e.translate===0&&e.scale===1}function Td(e){return wd(e.x)&&wd(e.y)}function Ed(e,t){return e.min===t.min&&e.max===t.max}function Dd(e,t){return Ed(e.x,t.x)&&Ed(e.y,t.y)}function Od(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function kd(e,t){return Od(e.x,t.x)&&Od(e.y,t.y)}function Ad(e){return od(e.x)/od(e.y)}function jd(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var Md=class{constructor(){this.members=[]}add(e){v(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;r&&r.isConnected!==!1||n.snapshot||(g(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(g(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}};function Nd(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var Pd={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(ot.test(e))e=parseFloat(e);else return e}return`${Nd(e,t.target.x)}% ${Nd(e,t.target.y)}%`}},Fd={borderRadius:/* @__PURE__ */ Object.assign({},Pd,{applyTo:/* @__PURE__ */ Bu.slice()}),borderTopLeftRadius:Pd,borderTopRightRadius:Pd,borderBottomLeftRadius:Pd,borderBottomRightRadius:Pd,boxShadow:{correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=Ee.parse(e);if(i.length>5)return r;let a=Ee.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=nt(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}}};function Id(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e}=n;e&&(r=`perspective(${e}px) ${r}`);for(let e=0;e<ce.length;e++){let t=ce[e],i=n[t];i&&(r+=`${t}(${i}deg) `),!e&&n.pathRotation&&(r+=`rotate(${n.pathRotation}deg) `)}}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}function Ld(e){return[e(`x`),e(`y`)]}var Rd=(e,t)=>e.depth-t.depth,zd=class{constructor(){this.children=[],this.isDirty=!1}add(e){v(this.children,e),this.isDirty=!0}remove(e){g(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Rd),this.isDirty=!1,this.children.forEach(e)}},Bd={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Vd={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},Hd=[`z`,`skew`,`skewZ`],Ud=1e3,Wd=0;function Gd(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}var Kd=e=>e.instance&&k.get(e.instance)?.demote()&&e.resetSkewAndRotation();function qd(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=Pu(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,Re,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&qd(r)}function Jd({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return Object.assign(Uu,{...Fd,...Uu}),class{constructor(e={},n=t?.()){this.id=Wd++,this.animationId=0,this.animationCommitId=0,this.children=/* @__PURE__ */ 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=/* @__PURE__ */ 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,Wu.value&&(Vd.nodes=Vd.calculatedTargetDeltas=Vd.calculatedProjections=0),this.nodes.forEach(Zd),this.nodes.forEach(lf),this.nodes.forEach(uf),this.nodes.forEach(Qd),Wu.addProjectionMetrics&&Wu.addProjectionMetrics(Vd)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=/* @__PURE__ */ new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new zd)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new ct),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){this.eventHandlers.get(e)?.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=T(t)&&!Ku(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent?.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;Re.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n?.(),n=Gu(i,250),Bd.hasAnimatedSinceResize&&(Bd.hasAnimatedSinceResize=!1,this.nodes.forEach(cf)))})}n&&this.root.registerSharedNode(n,this),this.addLayoutListener()}addLayoutListener(){let{layoutId:e,layout:t,visualElement:n,animate:r}=this.options;this.instance&&!this.hasLayoutListener&&r!==!1&&n&&(e||t)&&(this.hasLayoutListener=!0,this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:r,layout:i})=>{if(this.isAnimationBlocked){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||n.getDefaultTransition()||gf,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=n.getProps(),c=!this.targetLayout||!kd(this.targetLayout,i),l=!t&&r;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...fe(a,`layout`),onPlay:o,onComplete:s};(n.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||cf(this),this.isLead()&&this.options.onExitComplete?.();this.targetLayout=i}))}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),this.getStack()?.remove(this),this.parent?.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),this.hasLayoutListener=!1,tt(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes?.forEach(df),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete?.();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&qd(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;Kd(this),this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,Kd(t),(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1),t.isAnimationBlocked&&(t.dragSnapshot||=t.measure(),this.dragAncestor=t)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(tf),this.nodes.forEach(ef);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(nf);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(af),this.nodes.forEach(of),this.nodes.forEach(sf),this.nodes.forEach(Yd),this.nodes.forEach(Xd)):this.nodes.forEach(nf),this.clearAllSnapshots();let e=Ze.now();Ke.delta=de(0,1e3/60,e-Ke.timestamp),Ke.timestamp=e,Ke.isProcessing=!0,Se.update.process(Ke),Se.preRender.process(Ke),Se.render.process(Ke),Ke.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Vu.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach($d),this.sharedNodes.forEach((e,t)=>e.members.length?e.removeLeadSnapshot():this.sharedNodes.delete(t))}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Re.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Re.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),this.snapshot&&!od(this.snapshot.measuredBox.x)&&!od(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}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();let e=this.layout;this.layout=this.measure(!1),this.layoutCorrected||=Cd(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t?.notify(`LayoutMeasure`,this.layout.layoutBox,e?.layoutBox)}updateScroll(e=`measure`){let{scroll:t,instance:i}=this,{animationId:a}=this.root;if(this.options.layoutScroll&&i&&!(t&&t.animationId===a&&t.phase===e)){let o=r(i);this.scroll={animationId:a,phase:e,isRoot:o,offset:n(i),wasRoot:t?t.isRoot:o}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout;e&&Kd(this);let t=this.projectionDelta&&!Td(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||_(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),bf(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return Cd();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Cf))){let{scroll:e}=this.root;e&&(dt(t.x,e.offset.x),dt(t.y,e.offset.y))}return t}removeElementScroll(e){let t=Cd();if(ed(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&ed(t,e),dt(t.x,i.offset.x),dt(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n,r,i=0){let a=n||Cd();ed(a,e);for(let e=i;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(dt(a.x,-n.scroll.offset.x),dt(a.y,-n.scroll.offset.y)),_(n.latestValues)&&Ce(a,n.latestValues,n.layout?.layoutBox)}return!r&&_(this.latestValues)&&Ce(a,this.latestValues,this.layout?.layoutBox),a}removeTransform(e){let t=Cd();ed(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!_(n.latestValues))continue;let r;n.instance&&(ue(n.latestValues)&&n.updateSnapshot(),r=Cd(),ed(r,n.measurePageBox())),yd(t,n.latestValues,n.snapshot?.layoutBox,r)}return _(this.latestValues)&&yd(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade},this.addLayoutListener()}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!==Ke.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=Ke.timestamp;let a=this.getClosestProjectingParent();!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),(this.relativeTarget||this.targetDelta)&&(this.target||(this.target=Cd(),this.targetWithTransforms=Cd()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),dd(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target,!0):ed(this.target,this.layout.layoutBox),ye(this.target,this.targetDelta)):ed(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&(!a.resumingFrom==!this.resumingFrom||a.options.layoutRoot&&!a.resumingFrom)&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),Wu.value&&Vd.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||ue(this.parent.latestValues)||p(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Cd(),this.relativeTargetOrigin=Cd(),pd(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),ed(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===Ke.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent?.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;ed(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;st(this.layoutCorrected,this.treeScale,this.path,t&&(e.relativeTarget&&!e.relativeParent.resumingFrom?e.relativeParent:!0)),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=Cd());let{target:s}=e;s?(!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(td(this.prevProjectionDelta.x,this.projectionDelta.x),td(this.prevProjectionDelta.y,this.projectionDelta.y)),ld(this.projectionDelta,this.layoutCorrected,s,this.latestValues),this.treeScale.x===a&&this.treeScale.y===o&&jd(this.projectionDelta.x,this.prevProjectionDelta.x)&&jd(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),Wu.value&&Vd.calculatedProjections++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){this.options.visualElement?.scheduleRender(),e&&this.getStack()?.scheduleRender(),this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=xd(),this.projectionDelta=xd(),this.projectionDeltaWithTransform=xd()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=xd();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=Cd(),c=r?.source!==this.layout?.source,l=this.getStack(),u=!l||l.members.length<=1,d=!(!c||u||this.options.crossfade!==!0||this.path.some(hf));this.animationProgress=0;let f,p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n);ff(o.x,e.x,n),ff(o.y,e.y,n),r&&(o.x.translate=r.x,o.y.translate=r.y),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(pd(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),mf(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&Dd(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=Cd(),ed(f,this.relativeTarget)),c&&(this.animationValues=a,Xu(a,i,this.latestValues,n,d,u)),r?.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(tt(this.pendingAnimation),void 0),this.pendingAnimation=Re.update(()=>{Bd.hasAnimatedSinceResize=!0,this.motionValue||=x(0),this.motionValue.jump(0,!1),this.currentAnimation=Ge(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),Je(this.currentAnimation,this),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta?.(Ud),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,layout:n,latestValues:r}=e,{target:i}=e;if(t&&i&&n){if(this!==e&&this.layout&&n&&Sf(this.options.animationType,this.layout.layoutBox,n.layoutBox)){let{layoutBox:e}=this.layout,t=i;i=this.target||Cd(),xf(i.x,t.x,e.x),xf(i.y,t.y,e.y)}ed(t,i),Ce(t,r),ld(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Md),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?.transition,preserveFollowOpacity:n?.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){this.getStack()?.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){return this.getStack()?.relegate(this)||!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let{latestValues:t}=e;if(!lt(t))return;let n={};for(let t=0;t<Hd.length;t++)Gd(Hd[t],e,n,this.animationValues);for(let t=0;t<ce.length;t++)Gd(ce[t],e,n,this.animationValues);e.render();for(let t in n)e.setStaticValue(t,n[t]),this.animationValues&&(this.animationValues[t]=n[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;let n=this.getLead();if(!this.isVisible&&n!==this){e.visibility=`hidden`;return}let r=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=qu(t?.pointerEvents)||``,e.transform=r?r(this.latestValues,``):`none`;return}if(!this.projectionDelta||!this.layout||!n.target){(this.options.layoutId||this.needsShow)&&(this.needsShow=!1,e.visibility=``,e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=qu(t?.pointerEvents)||``),this.hasProjected&&!_(this.latestValues)&&(e.transform=r?r({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=n.animationValues||n.latestValues;this.applyTransformsToTarget();let a=Id(this.projectionDeltaWithTransform,this.treeScale,i);r&&(a=r(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=n.animationValues?n===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:n===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in Uu){if(i[t]===void 0)continue;let{correct:r,applyTo:o,isCSSVariable:s}=Uu[t],c=a===`none`?i[t]:r(i[t],n);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=n===this?qu(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=this.dragSnapshot=this.dragAncestor=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(ef),this.root.sharedNodes.clear()}}}function Yd(e){e.updateLayout(),rf(e)}function Xd(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source,o=(r,a)=>{if(i===`size`)Ld(e=>{let t=od(r[e]);r[e].min=a[e].min,r[e].max=r[e].min+t});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;$u(r[e],a[e])}else Sf(i,t.layoutBox,n)&&Ld(t=>{let n=od(a[t]);r[t].max=r[t].min+n,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[t].max=e.relativeTarget[t].min+n)})},s=a?t.measuredBox:t.layoutBox;o(s,n);let c=xd();ld(c,n,t.layoutBox);let l=xd();ld(l,a?e.applyTransform(r,!0):n,s);let u=!Td(c),d=!1,f=e.getClosestProjectingParent();if((!e.resumeFrom||f?.options.layoutRoot&&e.resumeFrom.path.includes(f))&&f&&!f.resumeFrom){let{snapshot:r,layout:i}=f;if(r&&i){let s=e.options.layoutAnchor||void 0,c=Cd();pd(c,a?e.resumeFrom.applyTransform(t.layoutBox,!0,void 0,!0,f.depth+1):t.layoutBox,r.layoutBox,s);let l=Cd();pd(l,n,i.layoutBox,s),a&&o(c,l),kd(c,l)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=l,e.relativeTargetOrigin=c,e.relativeParent=f)}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:l,layoutDelta:c,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else e.isLead()&&e.options.onExitComplete?.();e.options.transition=void 0}function Zd(e){Wu.value&&Vd.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function Qd(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function $d(e){e.clearSnapshot()}function ef(e){e.clearMeasurements()}function tf(e){e.isLayoutDirty=!0,e.updateLayout()}function nf(e){e.isLayoutDirty=!1}function rf(e){let{snapshot:t,dragAncestor:n}=e,r=n?.isAnimationBlocked&&n.layout;if(!t||!r||e.resumeFrom||e.isAnimationBlocked)return;let i=n.dragSnapshot;Ld(e=>dt(t.layoutBox[e],r.layoutBox[e].min-i.layoutBox[e].min))}function af(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.dragSnapshot||e.layout,e.isLayoutDirty=!0)}function of(e){e.relativeTarget&&e.relativeParent?.isLayoutDirty&&(e.currentAnimation?e.isLayoutDirty=!0:(e.targetDelta=void 0,e.removeRelativeTarget()))}function sf(e){let{visualElement:t}=e.options;t?.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function cf(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function lf(e){e.resolveTargetDelta()}function uf(e){e.calcProjection()}function df(e){e.resetSkewAndRotation()}function ff(e,t,n){e.translate=nt(t.translate,0,n),e.scale=nt(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function pf(e,t,n,r){e.min=nt(t.min,n.min,r),e.max=nt(t.max,n.max,r)}function mf(e,t,n,r){pf(e.x,t.x,n.x,r),pf(e.y,t.y,n.y,r)}function hf(e){return e.animationValues?.opacityExit!==void 0}var gf={duration:.45,ease:[.4,0,.1,1]},_f=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),vf=_f(`applewebkit/`)&&!_f(`chrome/`)?Math.round:ft;function yf(e){e.min=vf(e.min),e.max=vf(e.max)}function bf(e){yf(e.x),yf(e.y)}function xf(e,t,n){e.max=od(n)+(e.min=t.min)}function Sf(e,t,n){return e===`position`||e===`preserve-aspect`&&!sd(Ad(t),Ad(n),.2)}function Cf(e){return e!==e.root&&e.scroll?.wasRoot}function wf(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var Tf=/* @__PURE__ */ Jd({attachResizeListener:(e,t)=>wf(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Ef={current:void 0},Df=/* @__PURE__ */ Jd({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Ef.current){let e=new Tf({});e.mount(window),e.setOptions({layoutScroll:!0}),Ef.current=e}return Ef.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`});function Of(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function kf(e){return typeof e==`string`||Array.isArray(e)}var Af=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],jf=/* @__PURE__ */ [`initial`].concat(Af);function Mf(e){if(Of(e.animate))return!0;for(let t=0;t<jf.length;t++)if(kf(e[jf[t]]))return!0;return!1}function Nf(e){return!!(Mf(e)||e.variants)}function Pf(e,t,n){for(let r in t){let i=t[r],a=n[r];if(ht(i))e.addValue(r,i);else if(ht(a))e.addValue(r,x(i,{owner:e}));else if(a!==i){if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,x(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var Ff=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],If={};function Lf(e){If=e}function Rf(){return If}var zf=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=/* @__PURE__ */ new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=/* @__PURE__ */ new Map,this.KeyframeResolver=B,this.features={},this.valueSubscriptions=/* @__PURE__ */ new Map,this.prevMotionValues={},this.hasBeenMounted=!1,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=()=>{let e=Ze.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,Re.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=Mf(t),this.isVariantNode=Nf(t),this.isVariantNode&&(this.variantChildren=/* @__PURE__ */ new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&ht(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];if(this.current=e,Xe.set(e,this),this.projection?.instance||this.projection?.mount(e),this.isVariantNode&&!this.isControllingVariants){let e=this;do e=e.props.inherit!==!1&&e.parent;while(e&&!e.isVariantNode);if(e){let{variantChildren:t}=e;t.add(this),this.removeFromVariantTree=()=>t.delete(this)}}this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(De.current||at(),this.shouldReduceMotion=je.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection?.unmount(),tt(this.notifyUpdate),tt(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree?.(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),(this.enteringChildren||=/* @__PURE__ */ new Set).add(e)}removeChild(e){this.children.delete(e),this.enteringChildren?.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.get(e)?.(),t.accelerate&&Qe.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new D({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:be(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=_e.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&Re.preRender(this.notifyUpdate),n&&(this.projection&&(this.projection.isTransformDirty=!0),k.get(this.current)?.check()),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i?.()})}sortNodePosition(e){return!this.current||!e.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in If){let t=If[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let 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):Cd()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){let{transformTemplate:n,onUpdate:r}=this.props;(e.transformTemplate||n)&&this.scheduleRender(),(e.transformTemplate&&!n||e.onUpdate&&!r)&&k.get(this.current)?.demote(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<Ff.length;t++){let n=Ff[t];this.propEventSubscriptions[n]?.(),delete this.propEventSubscriptions[n];let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=Pf(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue?.()}getProps(){return this.props}getVariant(e){return this.props.variants?.[e]}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}addValue(e,t){let n=this.values.get(e);if(t!==n){n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t);let r=t.get();r!==void 0&&(this.latestValues[e]=r)}}removeValue(e){this.values.delete(e),this.valueSubscriptions.get(e)?.(),this.valueSubscriptions.delete(e),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){let n=this.props.values?.[e];return n||(n=this.values.get(e),n===void 0&&t!==void 0&&(n=x(t??this.getDefaultValue?.(e),{owner:this}),this.addValue(e,n)),n)}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(m(n)||le(n))?n=parseFloat(n):typeof n!=`number`&&!Ee.test(n)&&Ee.test(t)&&(n=Ae(e,t)),this.setBaseTarget(e,ht(n)?n.get():n)),ht(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}on(e,t){return(this.events[e]||(this.events[e]=new ct)).add(t)}notify(e,...t){this.events[e]?.notify(...t)}scheduleRenderMicrotask(){Vu.render(this.render)}},Bf=class extends zf{constructor(){super(...arguments),this.KeyframeResolver=oe}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;ht(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}};function $(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function Vf(e,{layout:t,layoutId:n}){return _e.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!Uu[e]||e===`opacity`)}function Hf(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(ht(r[t])||i&&ht(i[t])||Vf(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function Uf(e){return window.getComputedStyle(e)}var Wf=class extends Bf{constructor(){super(...arguments),this.type=`html`,this.renderInstance=$}mount(e){super.mount(e)}readValueFromInstance(e,t){if(_e.has(t))return this.projection?.isProjecting?ie(t):s(e,t);{let n=Uf(e),r=(Oe(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return Ne(e,t)}build(e,t,n){ze(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Hf(e,t,n)}},Gf=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1;function Kf(e){return{point:{x:e.pageX,y:e.pageY}}}var qf=e=>t=>Gf(t)&&e(t,Kf(t));function Jf(e,t,n,r){return wf(e,t,qf(n),r)}var Yf=/* @__PURE__ */ new WeakMap,Xf,Zf=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:T(r)&&`getBBox`in r?r.getBBox()[t]:r[n],Qf=/*@__PURE__*/ Zf(`inline`,`width`,`offsetWidth`),$f=/*@__PURE__*/ Zf(`block`,`height`,`offsetHeight`);function ep({target:e,borderBoxSize:t}){Yf.get(e)?.forEach(n=>{n(e,{get width(){return Qf(e,t)},get height(){return $f(e,t)}})})}function tp(e){e.forEach(ep)}function np(){typeof ResizeObserver<`u`&&(Xf=new ResizeObserver(tp))}function rp(e,t){Xf||np();let n=F(e);return n.forEach(e=>{let n=Yf.get(e);n||(n=/* @__PURE__ */ new Set,Yf.set(e,n)),n.add(t),Xf?.observe(e)}),()=>{n.forEach(e=>{let n=Yf.get(e);n?.delete(t),n?.size||Xf?.unobserve(e)})}}var ip=/* @__PURE__ */ new Set,ap;function op(){ap=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};ip.forEach(t=>t(e))},window.addEventListener(`resize`,ap)}function sp(e){return ip.add(e),ap||op(),()=>{ip.delete(e),!ip.size&&typeof ap==`function`&&(window.removeEventListener(`resize`,ap),ap=void 0)}}function cp(e,t){return ne(typeof e==`function`?sp(e):rp(e,t))}var lp=(e,t)=>Math.abs(e-t);function up(e,t){let n=lp(e.x,t.x),r=lp(e.y,t.y);return Math.sqrt(n**2+r**2)}var dp=/*#__PURE__*/ new Set([`auto`,`scroll`]),fp=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=/* @__PURE__ */ new Map,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=mp(this.lastRawMoveEventInfo,this.transformPagePoint));let e=gp(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=up(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e;this.history.push({...r,timestamp:Ze.now()});let{onStart:i,onMove:a}=this.handlers;t||(i?.(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),a?.(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.handleScroll(window),this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=mp(t,this.transformPagePoint),this.hasPendingMove=!0,Re.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.hasPendingMove&&this.updatePoint(),this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i?.(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=gp(e.type===`pointercancel`?this.lastMoveEventInfo:mp(t,this.transformPagePoint),this.history);this.startEvent&&n?.(e,a),r?.(e,a)},!Gf(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=mp(Kf(e),this.transformPagePoint),{point:c}=s;this.history=[{...c,timestamp:Ze.now()}];let{onSessionStart:l}=t;l&&l(e,gp(s,this.history));let u={passive:!0,capture:!0};this.removeListeners=we(Jf(this.contextWindow,`pointermove`,this.handlePointerMove,u),Jf(this.contextWindow,`pointerup`,this.handlePointerUp,u),Jf(this.contextWindow,`pointercancel`,this.handlePointerUp,u)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(dp.has(e.overflowX)||dp.has(e.overflowY))&&this.scrollPositions.set(t,pp(t)),t=t.parentElement}this.scrollPositions.set(window,pp(window)),this.removeScrollListeners=we(wf(window,`scroll`,this.onElementScroll,{capture:!0}),wf(window,`scroll`,this.onWindowScroll,{}))}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=pp(e),i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),Re.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners?.(),this.removeScrollListeners?.(),this.scrollPositions.clear(),tt(this.updatePoint)}},pp=e=>e===window?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop};function mp(e,t){return t?{point:t(e.point)}:e}function hp(e,t){return{x:e.x-t.x,y:e.y-t.y}}function gp({point:e},t){return{point:e,delta:hp(e,vp(t)),offset:hp(e,_p(t)),velocity:yp(t,.1)}}function _p(e){return e[0]}function vp(e){return e[e.length-1]}function yp(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=vp(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>be(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>be(t)*2&&(r=e[1]);let a=Pe(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}var bp=/* @__PURE__ */ new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function xp(e){return bp.has(e.tagName)||e.isContentEditable===!0}var Sp=/* @__PURE__ */ new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function Cp(e){return Sp.has(e.tagName)||e.isContentEditable===!0}var wp={x:!1,y:!1};function Tp(){return wp.x||wp.y}function Ep(e){return e===`x`||e===`y`?wp[e]?null:(wp[e]=!0,()=>{wp[e]=!1}):wp.x||wp.y?null:(wp.x=wp.y=!0,()=>{wp.x=wp.y=!1})}function Dp(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?nt(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?nt(n,e,r.max):Math.min(e,n)),e}function Op(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function kp(e,{top:t,left:n,bottom:r,right:i}){return{x:Op(e.x,n,i),y:Op(e.y,t,r)}}function Ap(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function jp(e,t){return{x:Ap(e.x,t.x),y:Ap(e.y,t.y)}}function Mp(e,t){let n=.5,r=od(e),i=od(t);return i>r?n=mt(t.min,t.max-r,e.min):r>i&&(n=mt(e.min,e.max-i,t.min)),de(0,1,n)}function Np(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var Pp=.35;function Fp(e=Pp){return e===!1?e=0:e===!0&&(e=Pp),{x:Ip(e,`left`,`right`),y:Ip(e,`top`,`bottom`)}}function Ip(e,t,n){return{min:Lp(e,t),max:Lp(e,n)}}function Lp(e,t){return typeof e==`number`?e:e[t]||0}function Rp(e){let t=``;for(let n of e.path){n.scroll=void 0,n.updateScroll();let{scroll:r}=n;n!==e.root&&r&&(t+=r.offset.x+`,`+r.offset.y+`,`)}return t}var zp=/* @__PURE__ */ new WeakMap,Bp=class{constructor(e,t=()=>e.getProps()){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Cd(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e,this.readProps=t}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){if(this.visualElement.presenceContext?.isPresent===!1)return;let r=e=>{t&&this.snapToCursor(e),this.stopAnimation()},i=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock?.(),this.openDragLock=Ep(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints();let{projection:a}=this.visualElement;a&&(a.isAnimationBlocked=!0,a.target=void 0),Ld(e=>{let t=this.getAxisMotionValue(e).get()||0;if(Me(t)&&(t=R(t,this.visualElement.current)||0),ot.test(t))t=parseFloat(t);else if(We.test(t)){let n=a?.layout?.layoutBox[e];n&&(t=od(n)*(parseFloat(t)/100))}this.originPoint[e]=t}),i&&Re.update(()=>i(e,t),!1,!0),Mu(this.visualElement,`transform`),this.visualElement.animationState?.setActive(`whileDrag`,!0)},a=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){if(this.currentDirection=Kp(o),this.currentDirection===null)return;i&&i(this.currentDirection)}this.updateAxis(`x`,o),this.updateAxis(`y`,o),this.visualElement.render(),a&&Re.update(()=>a(e,t),!1,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},s=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:c}=this.getProps();this.panSession=new fp(e,{onSessionStart:r,onStart:i,onMove:a,onSessionEnd:o,resumeAnimation:s},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,distanceThreshold:n,contextWindow:this.visualElement.current?.ownerDocument.defaultView,element:this.visualElement.current})}stop(e,t,n){let r=e||this.latestPointerEvent,i=t||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!i||!r)return;let{velocity:o}=i;this.startAnimation(o,n);let{onDragEnd:s}=this.getProps();s&&Re.postRender(()=>s(r,i))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession(),!this.getProps().dragPropagation&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t?.setActive(`whileDrag`,!1)}endPanSession(){this.panSession?.end(),this.panSession=void 0}updateAxis(e,t){let{drag:n}=this.readProps();if(!t||!Gp(e,n,this.currentDirection))return;let r=this.getAxisMotionValue(e),i=this.originPoint[e]+t[e],a=this.constraints&&this.constraints[e];a&&(i=Dp(i,a,this.elastic[e])),r.set(i)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),{projection:n}=this.visualElement,r=n&&(n.layout||n.measure(!1)),i=this.constraints;Vp(e)?this.constraints&&this.scroll===Rp(n)||(this.constraints=this.resolveRefConstraints()):this.constraints=e&&r?kp(r.layoutBox,e):!1,this.elastic=Fp(t),i!==this.constraints&&!Vp(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&Ld(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=Np(r.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!Vp(e))return!1;let n=Hp(e),{projection:r}=this.visualElement;if(!r||!r.layout)return!1;this.scroll=Rp(r);let i=Fe(n,r.root,this.visualElement.getTransformPagePoint()),a=jp(r.layout.layoutBox,r.removeElementScroll(i));if(t){let e=t(ee(a));this.hasMutatedConstraints=!!e,e&&(a=h(e))}return a}startAnimation(e,t){let{drag:n,dragMomentum:r,dragElastic:i,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:s}=this.getProps(),c=this.constraints||{},l=Ld(s=>{if(!Gp(s,t||n,this.currentDirection))return;let l=c[s]||{};(o===!0||o===s)&&(l={min:0,max:0});let u=i?200:1e6,d=i?40:1e7,f={type:`inertia`,velocity:r?e[s]:0,bounceStiffness:u,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...a,...l};return this.startAxisValueAnimation(s,f)});return Promise.all(l).then(s)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return Mu(this.visualElement,e),n.start(C(e,n,0,t,this.visualElement,!1))}stopAnimation(){Ld(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.readProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor({clientX:e,clientY:t}){let{drag:n}=this.getProps(),r={x:e,y:t},i=this.visualElement.getTransformPagePoint()?.(r)||r,a=this.visualElement.measureViewportBox();Ld(e=>{if(!Gp(e,n,this.currentDirection))return;let t=this.getAxisMotionValue(e),{min:r,max:o}=a[e];t.set((t.get()||0)+i[e]-nt(r,o,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!Vp(t)||!n||!this.constraints)return;this.stopAnimation();let r=this.constraints,i={x:0,y:0};Ld(e=>{let t=this.getAxisMotionValue(e).get();i[e]=Mp({min:t,max:t},r[e])});let{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},``):`none`,n.root?.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),Ld(t=>{let n=this.getAxisMotionValue(t);if(!Gp(t,e,null)||!n.get())return;let{min:r,max:a}=this.constraints[t];n.set(nt(r,a,i[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;zp.set(this.visualElement,this);let e=this.visualElement.current,t=Jf(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&Cp(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps(),r=Vp(t)&&Hp(t);r&&(this.constraints=this.resolveRefConstraints(),n||=Wp(e,r,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i.layout||(i.root?.updateScroll(),i.updateLayout()),Re.read(r);let o=wf(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Ld(t=>{if(!Gp(t,this.getProps().drag,this.currentDirection))return;let n=this.getAxisMotionValue(t);this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate)}),this.visualElement.render())}));return()=>{o(),t(),a(),s(),n?.()}}getProps(){let e=this.readProps(),{dragElastic:t=Pp,dragMomentum:n=!0}=e;return{...e,dragElastic:t,dragMomentum:n}}};function Vp(e){return!!e&&typeof e==`object`&&(`current`in e||`nodeType`in e)}var Hp=e=>`current`in e?e.current:e;function Up(e){let t=!0;return()=>{t?t=!1:e()}}function Wp(e,t,n){let r=cp(e,Up(n)),i=cp(t,Up(n));return()=>{r(),i()}}function Gp(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Kp(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}function qp(e,t){let n=F(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},ne(()=>r.abort())]}function Jp(e){return!(e.pointerType===`touch`||Tp())}function Yp(e,t,n={}){t=y(t);let[r,i,a]=qp(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{e.pointerType!==`touch`&&(n?r=!0:s(e))};e.addEventListener(`pointerenter`,n=>{if(!Jp(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var Xp=(e,t)=>t?e===t||Xp(e,t.parentElement):!1,Zp=/* @__PURE__ */ new WeakSet;function Qp(e){return t=>{t.key===`Enter`&&e(t)}}function $p(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var em=(e,t)=>{let n=!1,r=Qp(()=>{Zp.has(e)||(n=!0,$p(e,`down`))}),i=Qp(()=>{n&&(n=!1,$p(e,`up`))});e.addEventListener(`keydown`,r,t),e.addEventListener(`keyup`,i,t),e.addEventListener(`blur`,()=>{e.removeEventListener(`keydown`,r),e.removeEventListener(`keyup`,i),n&&$p(e,`cancel`)},{...t,once:!0})};function tm(e){return Gf(e)&&!Tp()}var nm=/* @__PURE__ */ new WeakSet;function rm(e,t,n={}){t=y(t);let[r,i,a]=qp(e,n),o=e=>{let r=e.currentTarget;if(!tm(e)||nm.has(e))return;Zp.add(r),n.stopPropagation&&nm.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),Zp.has(r)&&Zp.delete(r),tm(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||Xp(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),j(e)&&(e.addEventListener(`focus`,()=>em(e,i),i),!xp(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}var im=class{constructor(e){this.isMounted=!1,this.node=e}update(){}},am=/* @__PURE__ */ 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`]),om=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function sm(e,t,n,r){$(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(am.has(n)?n:N(n),t.attrs[n])}function cm(e,t,n){let r=Hf(e,t,n);for(let n in e)if(n!==`children`&&(ht(e[n])||ht(t[n]))){let t=ge.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var lm=class extends Bf{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=Cd}getBaseTargetFromProps(e,t){return _e.has(t)?super.getBaseTargetFromProps(e,t)??ie(t):e[t]}getDefaultValue(e){return _e.has(e)?this.latestValues[e]??ie(e):void 0}readValueFromInstance(e,t){if(_e.has(t)){let e=it(t);return e&&e.default||0}if(l.includes(t)){let n=getComputedStyle(e)[t];if(typeof n==`string`&&n)return n.trim()}return t=am.has(t)?t:N(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return cm(e,t,n)}build(e,t,n){Ve(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){sm(e,t,n,r)}mount(e){this.isSVGTag=om(e.tagName),super.mount(e)}};function um(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var dm=[...Af].reverse(),fm=e=>e?.out===!0?e:e?.out;function pm(e){let t=t=>Promise.all(t.map(({animation:t,options:n})=>zu(e,t,n))),n=hm(),r=!0,i=!1;function a(a){let{props:o,parent:s,manuallyAnimateOnMount:c}=e,{initial:l}=o,u=r||i,d=[],f=(t=l)=>typeof t!=`boolean`&&Tu(e,Array.isArray(t)?t[0]:t,e.presenceContext?.custom)||void 0,p=/* @__PURE__ */ new Map,m={},h=1/0,g=e;do g=g.props.inherit!==!1&&g.parent;while(g&&!g.isControllingVariants);let _=u&&fm(f(l??(g&&g.props.initial))?.transition);if(dm.forEach((t,r)=>{let i=n[t],l=o[t],f=g&&g.props[t],v=l===void 0?kf(f)||f===!1?f:void 0:l,y=kf(v),b=t===a?i.isActive:null,x=y&&l===void 0&&!(u&&c);if(i.protectedKeys={...m},!i.isActive&&b===null||!v&&!i.prevProp||Of(v)||typeof v==`boolean`)return;if(b===!1&&(h=r),t===`exit`&&i.isActive&&b!==!0){m={...m,...i.prevResolvedValues};return}let S=mm(i.prevProp,v),C=S||y&&(b&&!x||r>h),w=!1,T=Array.isArray(v)?v:[v],E={},D;if(b!==!1)for(let n of T){let{transition:r,transitionEnd:i,...a}=Tu(e,n,Eu(e,t))||{};E={...E,...a,...i},D=fm(r)||D}let{prevResolvedValues:O}=i;for(let t in{...O,...E}){if(t in m)continue;let n=E[t],r=O[t],a=Array.isArray(n)&&Array.isArray(r)?!um(n,r)||S:n!==r,o;if(a&&n==null)p.has(t)||p.set(t,i.prevOut);else if(a||n!==void 0&&p.has(t)){C=!0,o=p.get(t)||_,p.delete(t)&&(w=!0),i.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)}else i.protectedKeys[t]=!0;i.out[t]=o}if(i.prevProp=v,i.prevResolvedValues=E,i.prevOut=D,i.isActive&&(m={...m,...E}),C&&(!(x&&S)||w))for(let n of T){let r={type:t};if(typeof n==`string`&&u&&c&&s?.enteringChildren){let t=Tu(s,n)?.transition?.delayChildren;r.delay=Su(s.enteringChildren,e,t)}d.push({animation:n,options:r})}}),p.size){let t={},n=f(),r=n?.transition;p.forEach((i,a)=>{i&&(r={...r||e.getDefaultTransition(),[a]:i});let s=e.getValue(a);s&&(s.liveStyle=!0);let c=n&&!Array.isArray(l)?n[a]:void 0,u=e.getBaseTargetFromProps(o,a);t[a]=(c===void 0?u!==void 0&&!ht(u)?u:e.initialValues[a]===void 0?e.baseTarget[a]:void 0:c)??null}),r&&(t.transition=r),d.push({animation:t})}let v=u&&e.blockInitialAnimation||r&&!c&&(o.initial===!1||o.initial===o.animate);return r=i=!1,!v&&d.length?t(d):Promise.resolve()}function o(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=a(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:a,setActive:o,setAnimateFunction:n=>{t=n(e)},getState:()=>n,reset:()=>{n=hm(),i=!0}}}function mm(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!um(t,e):!1}function hm(){let e={};for(let t of Af)e[t]={isActive:t===`animate`,protectedKeys:{},needsAnimating:{},prevResolvedValues:{},out:{}};return e}var gm=e=>!e.isLayoutDirty&&e.willUpdate(!1);function _m(){let e=/* @__PURE__ */ new Set,t=/* @__PURE__ */ new WeakMap,n=()=>e.forEach(gm);return{add:r=>{e.add(r),t.set(r,r.addEventListener(`willUpdate`,n))},remove:r=>{e.delete(r);let i=t.get(r);i&&(i(),t.delete(r)),n()},dirty:n}}var vm=/* @__PURE__ */ (0,G.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function ym(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function bm(...e){return t=>{let n=!1,r=e.map(e=>{let r=ym(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():ym(e[t],null)}}}}function xm(...e){return G.useCallback(bm(...e),e)}var Sm=e=>{let{width:t,height:n}=e?.getBoundingClientRect()||{};return[t/e?.offsetWidth||1,n/e?.offsetHeight||1]},Cm=e=>{let{left:t,top:n}=e.getBoundingClientRect(),r=e;for(;r=r.parentElement||r.parentNode?.host;){let{scrollLeft:e,scrollTop:i}=r;if(e||i){let[a,o]=Sm(r);t+=e*a,n+=i*o}if(getComputedStyle(r).position===`fixed`)break}let[i,a]=Sm(e.offsetParent);return[t/i,n/a]},wm=class extends G.Component{getSnapshotBeforeUpdate(e){let t=this.props.getElement();if(j(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=j(e)&&e.offsetWidth||0,r=j(e)&&e.offsetHeight||0,i=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=r-a.height-a.top,a.direction=i.direction,a.point=Cm(t)}return null}componentDidUpdate(){}render(){return this.props.children}};function Tm({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:a,popNode:o}){let s=(0,G.useId)(),c=(0,G.useRef)(null),l=(0,G.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:`ltr`}),{nonce:u}=(0,G.useContext)(vm),d=xm(c,a===!1?void 0:e.props?.ref??e?.ref),f=()=>c.current||o?.current?.current,p=e=>{let{width:t,height:i,top:a,left:o,right:c,bottom:u,direction:d}=l.current,f=d===`rtl`,p=n===`left`?f?`right:${c}`:`left:${o}`:f?`left:${o}`:`right:${c}`,m=r===`bottom`?`bottom:${u}`:`top:${a}`;e?.insertRule(`[data-motion-pop-id="${s}"]{position:absolute!important;width:${t}px!important;height:${i}px!important;${p}px!important;${m}px!important}`)};return(0,G.useInsertionEffect)(()=>{let{width:e,height:n}=l.current,r=f();if(t||a===!1||!r||!e||!n)return;r.dataset.motionPopId=s;let o=r.ownerDocument,c=o.createElement(`style`);u&&(c.nonce=u);let d=i??o.head;d.appendChild(c),p(c.sheet);let m=0,h=0;return Vu.setup(()=>{let[e,t]=Cm(r);m=l.current.point[0]-e,h=l.current.point[1]-t}),Vu.read(()=>{let{sheet:e}=c;if(!e||!m&&!h)return;let t=l.current;t.left+=m,t.right-=m,t.top+=h,t.bottom-=h,e.deleteRule(0),p(e)}),()=>{r.removeAttribute(`data-motion-pop-id`),d.contains(c)&&d.removeChild(c)}},[t]),(0,K.jsx)(wm,{isPresent:t,getElement:f,sizeRef:l,pop:a,children:a===!1?e:G.cloneElement(e,{ref:d})})}var Em=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:s,anchorY:c,root:l})=>{let u=yu(Dm),d=(0,G.useId)(),f=(0,G.useRef)(),p=(0,G.useRef)(n),m=(0,G.useRef)(r);bu(()=>{p.current=n,m.current=r});let h=!0,g=(0,G.useMemo)(()=>(h=!1,{id:d,initial:t,isPresent:n,custom:i,onExitComplete:e=>{u.set(e,!0);for(let e of u.values())if(!e)return;r&&r()},register:(e,t)=>(u.set(e,!1),t&&t.parent?.presenceContext?.id!==d&&(f.current=t),()=>{u.delete(e),!p.current&&!u.size&&m.current?.()})}),[n,u,r]);return a&&h&&(g={...g}),(0,G.useMemo)(()=>{u.forEach((e,t)=>u.set(t,!1))},[n]),G.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=(0,K.jsx)(Tm,{pop:o===`popLayout`,isPresent:n,anchorX:s,anchorY:c,root:l,popNode:f,children:e}),(0,K.jsx)(xu.Provider,{value:g,children:e})};function Dm(){return/* @__PURE__ */ new Map}function Om(e=!0){let t=(0,G.useContext)(xu);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,G.useId)();(0,G.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,G.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var km=e=>e.key||``;function Am(e){let t=[];return G.Children.forEach(e,e=>{(0,G.isValidElement)(e)&&t.push(e)}),t}var jm=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a=`sync`,propagate:o=!1,anchorX:s=`left`,anchorY:c=`top`,root:l})=>{let[u,d]=Om(o),f=(0,G.useMemo)(()=>Am(e),[e]),p=o&&!u?[]:f.map(km),m=(0,G.useRef)(!0),h=yu(()=>/* @__PURE__ */ new Map),g=(0,G.useRef)(/* @__PURE__ */ new Set),[_,v]=(0,G.useState)(f),[y,b]=(0,G.useState)(f);bu(()=>{o&&!u&&!y.length&&d?.()},[u,o,y.length,d]);let x=(0,G.useRef)();(0,G.useEffect)(()=>()=>{let e=x.current;x.current=void 0,e?.()},[y]),bu(()=>{m.current=!1;for(let e=0;e<y.length;e++){let t=km(y[e]);p.includes(t)?(h.delete(t),g.current.delete(t)):h.get(t)!==!0&&h.set(t,!1)}},[y,p.length,p.join(`-`)]);let S=[];if(f!==_){let e=[...f],t=0;for(let n of y){let r=p.indexOf(km(n));r===-1?(e.splice(t++,0,n),S.push(n)):t=r+S.length+1}return S.every(e=>h.get(km(e)))?e=f:a===`wait`&&(e=S),b(Am(e)),v(f),null}let{forceRender:C}=(0,G.useContext)(vu);return(0,K.jsx)(K.Fragment,{children:y.map(e=>{let _=km(e),b=o&&!u?!1:f===y||p.includes(_);return(0,K.jsx)(Em,{isPresent:b,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:l,onExitComplete:b?void 0:()=>{if(g.current.has(_))return;if(h.has(_))g.current.add(_),h.set(_,!0);else return;let e=!0;h.forEach(t=>{t||(e=!1)}),e&&(C?.(),v([]),o&&d?.(),x.current=r)},anchorX:s,anchorY:c,children:e},_)})})},Mm=/* @__PURE__ */ (0,G.createContext)(null);function Nm(){let e=(0,G.useRef)(!1);return bu(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function Pm(){let e=Nm(),[t,n]=(0,G.useState)(0),r=(0,G.useCallback)(()=>{e.current&&n(t+1)},[t]);return[(0,G.useCallback)(()=>Re.postRender(r),[r]),t]}var Fm=e=>e===!0,Im=e=>Fm(e===!0)||e===`id`,Lm=({children:e,id:t,inherit:n=!0})=>{let r=(0,G.useContext)(vu),i=(0,G.useContext)(Mm),[a,o]=Pm(),s=(0,G.useRef)(null),c=r.id||i;s.current===null&&(Im(n)&&c&&(t=t?c+`-`+t:c),s.current={id:t,group:Fm(n)&&r.group||_m()});let l=(0,G.useMemo)(()=>({...s.current,forceRender:a}),[o]);return(0,K.jsx)(vu.Provider,{value:l,children:e})},Rm=/* @__PURE__ */ (0,G.createContext)({strict:!1}),zm={animation:[`variants`,...Af],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`]},Bm=!1;function Vm(){if(Bm)return;let e={};for(let t in zm)e[t]={isEnabled:e=>zm[t].some(t=>!!e[t])};Lf(e),Bm=!0}function Hm(){return Vm(),Rf()}function Um(e){let t=Hm();for(let n in e)t[n]={...t[n],...e[n]};Lf(t)}function Wm({children:e,...t}){let n=(0,G.useContext)(vm);t={...n,...t},t.transition=me(t.transition,n.transition),t.isStatic=yu(()=>t.isStatic);let r=(0,G.useMemo)(()=>t,[JSON.stringify(t.transition),t.transformPagePoint,t.reducedMotion,t.skipAnimations,t.isValidProp]);return(0,K.jsx)(vm.Provider,{value:r,children:e})}var Gm=/* @__PURE__ */ (0,G.createContext)({});function Km(e,t){if(Mf(e)){let{initial:t,animate:n}=e;return{initial:t===!1||kf(t)?t:void 0,animate:kf(n)?n:void 0}}return e.inherit===!1?{}:t}function qm(e){let{initial:t,animate:n}=Km(e,(0,G.useContext)(Gm));return(0,G.useMemo)(()=>({initial:t,animate:n}),[Jm(t),Jm(n)])}function Jm(e){return Array.isArray(e)?e.join(` `):e}var Ym=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Xm(e,t,n){for(let r in t)!ht(t[r])&&!Vf(r,n)&&(e[r]=t[r])}function Zm({transformTemplate:e},t){return(0,G.useMemo)(()=>{let n=Ym();return ze(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Qm(e,t){let n=e.style||{},r={};return Xm(r,n,e),Object.assign(r,Zm(e,t)),r}function $m(e,t){let n={},r=Qm(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var eh=()=>({...Ym(),attrs:{}});function th(e,t,n,r){let i=(0,G.useMemo)(()=>{let n=eh();return Ve(n,t,om(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};return Xm(t,e.style,e),{...i,style:{...t,...i.style}}}return i}var nh=/* @__PURE__ */ new Set(/* @__PURE__ */ `animate.exit.variants.initial.style.values.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function rh(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||nh.has(e)}function ih(e,t){return e.startsWith(`on`)?!rh(e):t?.(e)??!rh(e)}function ah(e,t,n,r){let i={};for(let a in e)a===`values`&&typeof e.values==`object`||ht(e[a])||(ih(a,r)||n===!0&&rh(a)||!t&&!rh(a)||e.draggable&&a.startsWith(`onDrag`))&&(i[a]=e[a]);return i}var oh=[`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 sh(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(oh.indexOf(e)>-1||/[A-Z]/u.test(e))}function ch(e,t,n,{latestValues:r},i,a=!1,o,s){let c=(o??sh(e)?th:$m)(t,r,i,e),l=ah(t,typeof e==`string`,a,s),u=e===G.Fragment?{}:{...l,...c,ref:n},{children:d}=t,f=(0,G.useMemo)(()=>ht(d)?d.get():d,[d]);return(0,G.createElement)(e,{...u,children:f})}function lh({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:uh(n,r,i,e),renderState:t()}}function uh(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=qu(a[e]);let{initial:o,animate:s}=e,c=Mf(e),l=Nf(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!Of(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=wu(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var dh=e=>(t,n)=>{let r=(0,G.useContext)(Gm),i=(0,G.useContext)(xu),a=()=>lh(e,t,r,i);return n?a():yu(a)},fh=/*@__PURE__*/ dh({scrapeMotionValuesFromProps:Hf,createRenderState:Ym}),ph=/*@__PURE__*/ dh({scrapeMotionValuesFromProps:cm,createRenderState:eh}),mh=/* @__PURE__ */ Symbol.for(`motionComponentSymbol`);function hh(e,t,n){let r=(0,G.useRef)(n);(0,G.useInsertionEffect)(()=>{r.current=n});let i=(0,G.useRef)(null);return(0,G.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}var gh=/* @__PURE__ */ (0,G.createContext)({});function _h(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function vh(e,t,n,r,i,a){let{visualElement:o}=(0,G.useContext)(Gm),s=(0,G.useContext)(Rm),c=(0,G.useContext)(xu),l=(0,G.useContext)(vm),u=l.reducedMotion,d=l.skipAnimations,f=(0,G.useRef)(null),p=(0,G.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,G.useContext)(gh);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&yh(f.current,n,i,h),(0,G.useInsertionEffect)(()=>{m&&m.props!==n&&m.update(n,c)});let g=n[Nu],_=(0,G.useRef)(!!g&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(g)&&window.MotionHasOptimisedAnimation?.(g));return bu(()=>{p.current&&m&&(m.animationState?.animateChanges(),m.enteringChildren=void 0)},[]),bu(()=>{p.current=!0,m&&(window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),_.current&&m.animationState&&m.animationState.animateChanges())}),(0,G.useEffect)(()=>{m&&(!_.current&&m.animationState&&m.animationState.animateChanges(),_.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(g)}),!1),m.enteringChildren=void 0)}),m}function yh(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t,f=e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:bh(e.parent));f.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&_h(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u});let p=f.getStack()?.lead;p&&!f.root.isUpdateBlocked()&&(p.willUpdate(),p.scheduleCheckAfterUnmount())}function bh(e){if(e)return e.options.allowProjection===!1?bh(e.parent):e.projection}function xh(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&Um(r);let a=n?n===`svg`:sh(e),o=a?ph:fh;function s(n,s){let c,l=Sh(n);yu(()=>!!Ef.current?.sharedNodes.get(l)?.lead&&n.initial)&&(n={...n,initial:!1});let u={...(0,G.useContext)(vm),...n,layoutId:l},{isStatic:d,isValidProp:f}=u,p=qm(n),m=o(n,d);if(!d&&typeof window<`u`){Ch(u,r);let t=wh(u);p.visualElement=vh(e,m,u,i,t.ProjectionNode,a),(t.isEnabled||p.visualElement?.projection?.options.layoutId)&&(c=t.MeasureLayout)}return(0,K.jsxs)(Gm.Provider,{value:p,children:[c&&p.visualElement?(0,K.jsx)(c,{visualElement:p.visualElement,...u}):null,ch(e,n,hh(m,p.visualElement,s),m,d,t,a,f)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,G.forwardRef)(s);return c[mh]=e,c}function Sh({layoutId:e}){let t=(0,G.useContext)(vu).id;return t&&e!==void 0?t+`-`+e:e}function Ch(e,t){(0,G.useContext)(Rm).strict}function wh(e){let{drag:t,layout:n}=Hm();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:r.MeasureLayout,isEnabled:t?.isEnabled(e)||n?.isEnabled(e),ProjectionNode:r.ProjectionNode}}function Th(e,t){if(typeof Proxy>`u`)return xh;let n=/* @__PURE__ */ new Map,r=(n,r)=>xh(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,xh(a,void 0,e,t)),n.get(a))})}var Eh=(e,t)=>t.isSVG??sh(e)?new lm(t):new Wf(t,{allowProjection:e!==G.Fragment}),Dh=class extends im{constructor(e){super(e),e.animationState||=pm(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();Of(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){this.node.getProps().animate!==this.node.prevProps?.animate&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},Oh=0,kh={animation:{Feature:Dh},exit:{Feature:class extends im{constructor(){super(...arguments),this.id=Oh++}update(){let{presenceContext:e,prevPresenceContext:t,animationState:n}=this.node;if(!e||!n)return;let{isPresent:r,onExitComplete:i}=e,a=t?.isPresent;if(r===a)return;if(r&&a===!1){if(this.exit===!0){let{initial:e}=this.node.getProps();if(e&&!Array.isArray(e)){let{transition:t,transitionEnd:n,...r}=Tu(this.node,e)||{};for(let e in r)this.node.getValue(e)?.jump(r[e])}this.node.blockInitialAnimation=!1,n.reset(),n.animateChanges()}else n.setActive(`exit`,!1);this.exit=void 0;return}let o=this.exit=n.setActive(`exit`,!r);i&&!r&&o.then(()=>{this.exit===o&&(this.exit=!0,i(this.id))})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id,this.node))}unmount(){}}}},Ah=class extends im{constructor(e){super(e),this.removeGroupControls=ft,this.removeListeners=ft,this.controls=new Bp(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ft}update(){let{dragControls:e,drag:t}=this.node.getProps(),{dragControls:n,drag:r}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls))),r&&!t&&this.controls.stop(void 0,void 0,r)}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},jh=e=>(t,n)=>{e&&Re.update(()=>e(t,n),!1,!0)},Mh=class extends im{constructor(){super(...arguments),this.removePointerDownListener=ft}onPointerDown(e){this.session=new fp(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:this.node.current?.ownerDocument.defaultView})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:jh(e),onStart:jh(t),onMove:jh(n),onEnd:(e,t)=>{delete this.session,r&&Re.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=Jf(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session?.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session?.end()}},Nh=!1,Ph=({layout:e,layoutDependency:t,layoutAnchor:n})=>({layout:e,layoutDependency:t,layoutAnchor:n,animationType:typeof e==`string`?e:`both`}),Fh=(e,t)=>{let{snapshot:n}=e,r=e.getStack();r?.remove(e);let i=r?.lead;if(r?.prevLead===e&&i.resumeFrom===e&&(i.resumeFrom=i.currentAnimation=e.resumingFrom=void 0),e.options.layoutId=t,!t)e.needsShow=!0;else return e.root.registerSharedNode(t,e),()=>{let{resumeFrom:t}=e;t?.isPresent!==!1&&e.getStack().members.includes(t)&&(t.hide(),e.resumeFrom=void 0,e.snapshot=n)}},Ih=class extends G.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group?.add(i),r&&n?.register?.(i),Nh&&i.root.didUpdate(),i.options.layoutId!==r&&Fh(i,r)?.(),i.addEventListener(`animationComplete`,()=>this.safeToRemove()),i.setOptions({...i.options,...Ph(this.props),onExitComplete:()=>this.safeToRemove()})),Bd.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,layoutId:n,visualElement:r,drag:i,isPresent:a}=this.props,{projection:o}=r;return o&&(o.isPresent=a,this.takeOver=e.layoutId===n?void 0:(o.willUpdate(),Fh(o,n)),o.setOptions({...o.options,...Ph(this.props)}),Nh=!0,i||e.layoutDependency!==t||t===void 0||e.isPresent!==a?o.willUpdate():this.safeToRemove(),e.isPresent!==a&&(a?o.promote():o.relegate()||Re.postRender(()=>{o.getStack()?.members.length||this.safeToRemove()}))),null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(this.takeOver?.(),e.root.didUpdate(),Vu.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;Nh=!0,r&&(r.scheduleCheckAfterUnmount(),t.group?.remove(r),n?.deregister?.(r))}safeToRemove(){this.props.safeToRemove?.()}render(){return null}};function Lh(e){let[t,n]=Om(),r=(0,G.useContext)(vu);return(0,K.jsx)(Ih,{...e,layoutGroup:r,switchLayoutGroup:(0,G.useContext)(gh),isPresent:t,safeToRemove:n})}var Rh={pan:{Feature:Mh},drag:{Feature:Ah,ProjectionNode:Df,MeasureLayout:Lh}};function zh(e,t,n,r){let{props:i}=e,a=`while`+n;e.animationState&&i[a]&&e.animationState.setActive(a,r===`Start`);let o=i[`on`+n+r];o&&Re.postRender(()=>o(t,Kf(t)))}var Bh=class extends im{mount(){let{current:e}=this.node;e&&(this.unmount=Yp(e,(e,t)=>(zh(this.node,t,`Hover`,`Start`),e=>zh(this.node,e,`Hover`,`End`))))}unmount(){}},Vh=class extends im{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=we(wf(this.node.current,`focus`,()=>this.onFocus()),wf(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function Hh(e,t,n){e.current instanceof HTMLButtonElement&&e.current.disabled||zh(e,t,`Tap`,n)}var Uh=class extends im{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=rm(e,(e,t)=>(Hh(this.node,t,`Start`),(e,{success:t})=>Hh(this.node,e,t?``:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},Wh=/* @__PURE__ */ new WeakMap,Gh=/* @__PURE__ */ new WeakMap,Kh=e=>{let t=Wh.get(e.target);t&&t(e)},qh=e=>{e.forEach(Kh)};function Jh({root:e,...t}){let n=e||document;Gh.has(n)||Gh.set(n,{});let r=Gh.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(qh,{root:e,...t})),r[i]}function Yh(e,t,n){let r=Jh(t);return Wh.set(e,n),r.observe(e),()=>{Wh.delete(e),r.unobserve(e)}}var Xh={some:0,all:1},Zh=class extends im{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:Xh[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=Yh(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(Qh(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function Qh({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var $h=/* @__PURE__ */ Th(/* @__PURE__ */ Object.assign({},kh,{inView:{Feature:Zh},tap:{Feature:Uh},focus:{Feature:Vh},hover:{Feature:Bh}},Rh,{layout:{ProjectionNode:Df,MeasureLayout:Lh}}),Eh);function eg(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var tg=e=>{switch(e){case`success`:return ig;case`info`:return og;case`warning`:return ag;case`error`:return sg;default:return null}},ng=Array(12).fill(0),rg=({visible:e,className:t})=>/*#__PURE__*/ G.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},/*#__PURE__*/ G.createElement(`div`,{className:`sonner-spinner`},ng.map((e,t)=>/*#__PURE__*/ G.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),ig=/*#__PURE__*/ G.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},/*#__PURE__*/ G.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`})),ag=/*#__PURE__*/ G.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},/*#__PURE__*/ G.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`})),og=/*#__PURE__*/ G.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},/*#__PURE__*/ G.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`})),sg=/*#__PURE__*/ G.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},/*#__PURE__*/ G.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`})),cg=/*#__PURE__*/ G.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`,"aria-hidden":`true`},/*#__PURE__*/ G.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),/*#__PURE__*/ G.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),lg=()=>{let[e,t]=G.useState(document.hidden);return G.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]),e},ug=1,dg=100,fg=e=>typeof e?.id==`number`||e?.id?.length>0?e.id:ug++,pg=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),this.getActiveToasts().forEach(t=>e(t)),()=>{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.trimHistory()},this.trimHistory=()=>{let e=this.toasts.length-dg;e<=0||(this.toasts=this.toasts.filter(t=>e>0&&this.dismissedToasts.has(t.id)?(this.dismissedToasts.delete(t.id),e--,!1):!0))},this.create=e=>{let{message:t,...n}=e,r=fg(e),i=this.pendingDismissals.get(r);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(r),this.dismissedToasts.delete(r));let a=this.dismissedToasts.has(r),o=e.dismissible===void 0||e.dismissible;return a&&(this.dismissedToasts.delete(r),this.toasts=this.toasts.filter(e=>e.id!==r)),!a&&this.toasts.find(e=>e.id===r)?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:o,title:t}):n):this.addToast({title:t,...n,dismissible:o,id:r}),r},this.dismiss=e=>{if(e==null)return this.getActiveToasts().forEach(e=>{this.dismissedToasts.add(e.id),this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e;this.dismissedToasts.add(e);let t=this.pendingDismissals.get(e);return t!==void 0&&cancelAnimationFrame(t),this.pendingDismissals.set(e,requestAnimationFrame(()=>{this.pendingDismissals.delete(e),this.subscribers.forEach(t=>t({id:e,dismiss:!0}))})),e},this.message=(e,t)=>this.create({...t,message:e,type:void 0}),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 n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],G.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(hg(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!G.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!G.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!G.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!G.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=fg(t);return this.create({...t,jsx:e(n),id:n,type:void 0}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=/* @__PURE__ */ new Set,this.pendingDismissals=/* @__PURE__ */ new Map}},mg=(e,t)=>pg.message(e,t),hg=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,gg=Object.assign(mg,{success:pg.success,info:pg.info,warning:pg.warning,error:pg.error,custom:pg.custom,message:pg.message,promise:pg.promise,dismiss:pg.dismiss,loading:pg.loading},{getHistory:()=>pg.toasts,getToasts:()=>pg.getActiveToasts()});eg(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function _g(e){return e.label!==void 0}var vg=3,yg=`24px`,bg=`16px`,xg=4e3,Sg=356,Cg=14,wg=45,Tg=200;function Eg(...e){return e.filter(Boolean).join(` `)}function Dg(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var Og=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:_=``,descriptionClassName:v=``,duration:y,position:b,gap:x,expandByDefault:S,classNames:C,icons:w,closeButtonAriaLabel:T=`Close toast`}=e,[E,D]=G.useState(null),[O,k]=G.useState(null),[A,j]=G.useState(!1),[M,N]=G.useState(!1),[P,F]=G.useState(!1),[I,ee]=G.useState(!1),[te,ne]=G.useState(!1),[re,ie]=G.useState(0),[ae,oe]=G.useState(0),se=G.useRef(n.duration||y||xg),ce=G.useRef(null),le=G.useRef(null),ue=c===0,de=c+1<=o,fe=n.type,L=fe??`default`,R=n.dismissible!==!1,pe=n.className||``,me=n.descriptionClassName||``,he=G.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),ge=G.useMemo(()=>n.closeButton??p,[n.closeButton,p]),z=G.useMemo(()=>n.duration||y||xg,[n.duration,y]),B=G.useRef(0),V=G.useRef(0),_e=G.useRef(0),ve=G.useRef(null),[ye,be]=b.split(`-`),xe=G.useMemo(()=>s.reduce((e,t,n)=>n>=he?e:e+t.height,0),[s,he]),Se=lg(),Ce=G.useMemo(()=>e.swipeDirections??Dg(b),[e.swipeDirections,b]),we=n.invert||t,Te=fe===`loading`;V.current=G.useMemo(()=>he*x+xe,[he,xe]),G.useEffect(()=>{se.current=z},[z]),G.useEffect(()=>{j(!0)},[]),G.useEffect(()=>{let e=le.current;if(e){let t=e.getBoundingClientRect().height;return oe(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),G.useLayoutEffect(()=>{if(!A)return;let e=le.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,oe(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[A,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let Ee=G.useCallback(()=>{N(!0),ie(V.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},Tg)},[n,d,a,V]);G.useEffect(()=>{if(n.promise&&fe===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||Se?(()=>{if(_e.current<B.current){let e=(/* @__PURE__ */ new Date()).getTime()-B.current;se.current-=e}_e.current=(/* @__PURE__ */ new Date()).getTime()})():se.current!==1/0&&(B.current=(/* @__PURE__ */ new Date()).getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),Ee()},se.current)),()=>clearTimeout(e)},[u,i,n,fe,Se,Ee]),G.useEffect(()=>{n.delete&&(Ee(),n.onDismiss==null||n.onDismiss.call(n,n))},[Ee,n.delete]);function De(){return w?.loading?/*#__PURE__*/ G.createElement(`div`,{className:Eg(C?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":fe===`loading`},w.loading):/*#__PURE__*/ G.createElement(rg,{className:Eg(C?.loader,n?.classNames?.loader),visible:fe===`loading`})}let Oe=n.icon||w?.[fe]||tg(fe);return/*#__PURE__*/ G.createElement(`li`,{tabIndex:0,ref:le,className:Eg(_,pe,C?.toast,n?.classNames?.toast,C?.[L],n?.classNames?.[L]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":A,"data-promise":!!n.promise,"data-swiped":te,"data-removed":M,"data-visible":de,"data-y-position":ye,"data-x-position":be,"data-index":c,"data-front":ue,"data-swiping":P,"data-dismissible":R,"data-type":fe,"data-invert":we,"data-swipe-out":I,"data-swipe-direction":O,"data-expanded":!!(u||S&&A),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${M?re:V.current}px`,"--initial-height":S?`auto`:`${ae}px`,...m,...n.style},onDragEnd:()=>{F(!1),D(null),ve.current=null},onPointerDown:e=>{e.button!==2&&!Te&&R&&(ce.current=/* @__PURE__ */ new Date,ie(V.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(F(!0),ve.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{if(I||!R)return;ve.current=null;let e=Number(le.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(le.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=(/* @__PURE__ */ new Date()).getTime()-ce.current?.getTime(),i=E===`x`?e:t,a=Math.abs(i)/r;if((E===`x`?Ce.includes(e>0?`right`:`left`):Ce.includes(t>0?`bottom`:`top`))&&(Math.abs(i)>=wg||a>.11))ie(V.current),n.onDismiss==null||n.onDismiss.call(n,n),k(E===`x`?e>0?`right`:`left`:t>0?`down`:`up`),Ee(),ee(!0);else{var o,s;(o=le.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=le.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`),ne(!1),F(!1),D(null)}},onPointerMove:e=>{var t,n;if(!ve.current||!R||window.getSelection()?.toString().length>0)return;let r=e.clientY-ve.current.y,i=e.clientX-ve.current.x;!E&&(Math.abs(i)>1||Math.abs(r)>1)&&D(Math.abs(i)>Math.abs(r)?`x`:`y`);let a={x:0,y:0},o=e=>1/(1.5+Math.abs(e)/20);if(E===`y`){if(Ce.includes(`top`)||Ce.includes(`bottom`)){if(Ce.includes(`top`)&&r<0||Ce.includes(`bottom`)&&r>0)a.y=r;else{let e=r*o(r);a.y=Math.abs(e)<Math.abs(r)?e:r}}}else if(E===`x`&&(Ce.includes(`left`)||Ce.includes(`right`))){if(Ce.includes(`left`)&&i<0||Ce.includes(`right`)&&i>0)a.x=i;else{let e=i*o(i);a.x=Math.abs(e)<Math.abs(i)?e:i}}(Math.abs(a.x)>0||Math.abs(a.y)>0)&&ne(!0),(t=le.current)==null||t.style.setProperty(`--swipe-amount-x`,`${a.x}px`),(n=le.current)==null||n.style.setProperty(`--swipe-amount-y`,`${a.y}px`)}},ge&&!n.jsx&&fe!==`loading`?/*#__PURE__*/ G.createElement(`button`,{"aria-label":T,"data-disabled":Te,"data-close-button":!0,onClick:Te||!R?()=>{}:()=>{Ee(),n.onDismiss==null||n.onDismiss.call(n,n)},className:Eg(C?.closeButton,n?.classNames?.closeButton)},w?.close??cg):null,(fe||n.icon||n.promise)&&n.icon!==null&&(w?.[fe]!==null||n.icon)?/*#__PURE__*/ G.createElement(`div`,{"data-icon":``,className:Eg(C?.icon,n?.classNames?.icon)},fe===`loading`?n.icon||De():n.promise?De():null,fe===`loading`?null:Oe):null,/*#__PURE__*/ G.createElement(`div`,{"data-content":``,className:Eg(C?.content,n?.classNames?.content)},/*#__PURE__*/ G.createElement(`div`,{"data-title":``,className:Eg(C?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?/*#__PURE__*/ G.createElement(`div`,{"data-description":``,className:Eg(v,me,C?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),/*#__PURE__*/ G.isValidElement(n.cancel)?n.cancel:n.cancel&&_g(n.cancel)?/*#__PURE__*/ G.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{_g(n.cancel)&&R&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),Ee())},className:Eg(C?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,/*#__PURE__*/ G.isValidElement(n.action)?n.action:n.action&&_g(n.action)?/*#__PURE__*/ G.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{_g(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&Ee())},className:Eg(C?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function kg(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function Ag(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?bg:yg;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var jg=/*#__PURE__*/ G.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:f,duration:p,style:m,visibleToasts:h=vg,toastOptions:g,dir:_=kg(),gap:v=Cg,icons:y,customAriaLabel:b,containerAriaLabel:x=`Notifications`}=e,[S,C]=G.useState([]),w=G.useMemo(()=>n?S.filter(e=>e.toasterId===n):S.filter(e=>!e.toasterId),[S,n]),T=G.useMemo(()=>Array.from(new Set([i].concat(w.filter(e=>e.position).map(e=>e.position)))),[w,i]),[E,D]=G.useState([]),[O,k]=G.useState(!1),[A,j]=G.useState(!1),[M,N]=G.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),P=G.useRef(null),F=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),I=G.useRef(null),ee=G.useRef(!1),te=G.useCallback(e=>{C(t=>(t.find(t=>t.id===e.id)?.delete||pg.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return G.useEffect(()=>pg.subscribe(e=>{e.dismiss?requestAnimationFrame(()=>{C(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))}):setTimeout(()=>{Lr.flushSync(()=>{C(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[]),G.useEffect(()=>{if(d!==`system`){N(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?N(`dark`):N(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{N(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{N(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),G.useEffect(()=>{S.length<=1&&k(!1)},[S]),G.useEffect(()=>{let e=e=>{if(a.length>0&&a.every(t=>e[t]||e.code===t)){var t;k(!0),(t=P.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===P.current||P.current?.contains(document.activeElement))&&k(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),G.useEffect(()=>{if(P.current)return()=>{I.current&&(I.current.focus({preventScroll:!0}),I.current=null,ee.current=!1)}},[P.current]),/*#__PURE__*/ G.createElement(`section`,{ref:t,"aria-label":b??`${x} ${F}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},T.map((t,n)=>{let[i,a]=t.split(`-`);return w.length?/*#__PURE__*/ G.createElement(`ol`,{key:t,dir:_===`auto`?kg():_,tabIndex:-1,ref:P,className:c,"data-sonner-toaster":!0,"data-sonner-theme":M,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${E[0]?.height||0}px`,"--width":`${Sg}px`,"--gap":`${v}px`,...m,...Ag(l,u)},onBlur:e=>{ee.current&&!e.currentTarget.contains(e.relatedTarget)&&(ee.current=!1,I.current&&=(I.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||ee.current||(ee.current=!0,I.current=e.relatedTarget)},onMouseEnter:()=>k(!0),onMouseMove:()=>k(!0),onMouseLeave:()=>{A||k(!1)},onDragEnd:()=>k(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||j(!0)},onPointerUp:()=>j(!1)},w.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>/*#__PURE__*/ G.createElement(Og,{key:n.id,icons:y,index:i,toast:n,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:A,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:te,toasts:w.filter(e=>e.position==n.position),heights:E.filter(e=>e.position==n.position),setHeights:D,expandByDefault:o,gap:v,expanded:O,swipeDirections:e.swipeDirections}))):null}))}),Mg=/* @__PURE__ */ new Map([[`avif`,`image/avif`],[`bmp`,`image/bmp`],[`css`,`text/css`],[`csv`,`text/csv`],[`doc`,`application/msword`],[`docx`,`application/vnd.openxmlformats-officedocument.wordprocessingml.document`],[`gif`,`image/gif`],[`gz`,`application/gzip`],[`htm`,`text/html`],[`html`,`text/html`],[`ico`,`image/x-icon`],[`jpeg`,`image/jpeg`],[`jpg`,`image/jpeg`],[`js`,`application/javascript`],[`json`,`application/json`],[`md`,`text/markdown`],[`mjs`,`application/javascript`],[`mp3`,`audio/mpeg`],[`mp4`,`video/mp4`],[`ogg`,`audio/ogg`],[`pdf`,`application/pdf`],[`png`,`image/png`],[`ppt`,`application/powerpoint`],[`pptx`,`application/vnd.openxmlformats-officedocument.presentationml.presentation`],[`svg`,`image/svg+xml`],[`tif`,`image/tiff`],[`tiff`,`image/tiff`],[`txt`,`text/plain`],[`wasm`,`application/wasm`],[`wav`,`audio/x-wav`],[`weba`,`audio/webm`],[`webm`,`video/webm`],[`webp`,`image/webp`],[`xls`,`application/vnd.ms-excel`],[`xlsx`,`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`],[`xml`,`application/xml`],[`zip`,`application/zip`]]),Ng=class extends Error{constructor(e){super(`DataTransferItem is not a file`),this.item=e,this.name=`UnexpectedObjectError`}};function Pg(e,t,n){let r=e,{webkitRelativePath:i}=e,a=typeof t==`string`?t:typeof i==`string`&&i.length>0?i:`./${e.name}`;return typeof r.path!=`string`&&Ig(r,`path`,a),n!==void 0&&Object.defineProperty(r,"handle",{value:n,writable:!1,configurable:!1,enumerable:!0}),Ig(r,`relativePath`,a),r}function Fg(e,t=Mg){let{name:n}=e;if(n&&n.lastIndexOf(`.`)!==-1&&!e.type){let r=n.split(`.`).pop().toLowerCase(),i=t.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}function Ig(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}var Lg=[`.DS_Store`,`Thumbs.db`];async function Rg(e,{mimeTypes:t=Mg}={}){return(await zg(e)).map(e=>e instanceof File?Fg(e,t):e)}async function zg(e){return Ug(e)&&Bg(e.dataTransfer)?Kg(e.dataTransfer,e.type):Vg(e)?qg(e.clipboardData):Hg(e)?Wg(e):Array.isArray(e)&&e.every(e=>`getFile`in e&&typeof e.getFile==`function`)?Gg(e):[]}function Bg(e){return Ug(e)}function Vg(e){return Ug(e)&&Bg(e.clipboardData)}function Hg(e){return Ug(e)&&Ug(e.target)}function Ug(e){return typeof e==`object`&&!!e}function Wg(e){return Yg(e.target.files).map(e=>Pg(e))}async function Gg(e){return(await Promise.all(e.map(e=>e.getFile()))).map(e=>Pg(e))}async function Kg(e,t){let n=Yg(e.items).filter(e=>e.kind===`file`);return t===`drop`?Jg(Zg(await Promise.all(n.map(Xg)))):n}function qg(e){let t=Yg(e.items).filter(e=>e.kind===`file`).map(e=>e.getAsFile()).filter(e=>e!==null);return Jg((t.length>0?t:Yg(e.files)).map(e=>Pg(e)))}function Jg(e){return e.filter(e=>Lg.indexOf(e.name)===-1)}function Yg(e){return e===null?[]:Array.from(e)}async function Xg(e){if(typeof e.webkitGetAsEntry!=`function`)return Qg(e);let t=e.webkitGetAsEntry();if(t?.isDirectory){let n=await $g(e);return n?.kind===`directory`?e_(n,`/${n.name}`):n_(t)}return Qg(e,t)}function Zg(e){let t=[];for(let n of e)Array.isArray(n)?t.push(...Zg(n)):t.push(n);return t}async function Qg(e,t){let n=e.getAsFile(),r=await $g(e);if(r!=null){let e=n??await r.getFile();return e.handle=r,Pg(e)}if(!n)throw new Ng(e);return Pg(n,t?.fullPath??void 0)}async function $g(e){if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle==`function`)return e.getAsFileSystemHandle()}async function e_(e,t){let n=[];for await(let r of e.values()){let e=`${t}/${r.name}`;if(r.kind===`directory`)n.push(...await e_(r,e));else{let t=await r.getFile();n.push(Pg(t,e,r))}}return n}async function t_(e){return e.isDirectory?n_(e):r_(e)}function n_(e){let t=e.createReader();return new Promise((e,n)=>{let r=[];function i(){t.readEntries(async t=>{if(t.length){let e=Promise.all(t.map(t_));r.push(e),i()}else try{e(await Promise.all(r))}catch(e){n(e)}},e=>{n(e)})}i()})}async function r_(e){return new Promise((t,n)=>{e.file(n=>{t(Pg(n,e.fullPath))},e=>{n(e)})})}function i_(e,t){if(e&&t){let n=(Array.isArray(t)?t:t.split(`,`)).filter(e=>e.trim()!==``);if(n.length===0)return!0;let r=e.name||``,i=(e.type||``).toLowerCase(),a=i.replace(/\/.*$/,``);return n.some(e=>{let t=e.trim().toLowerCase();return t.charAt(0)===`.`?r.toLowerCase().endsWith(t):t.endsWith(`/*`)?a===t.replace(/\/.*$/,``):i===t})}return!0}var a_=typeof i_==`function`?i_:i_.default,o_=`file-invalid-type`,s_=`file-too-large`,c_=`file-too-small`,l_=`too-many-files`;function u_(e=``){let t=e.split(`,`);return{code:o_,message:`File type must be ${t.length>1?`one of ${t.join(`, `)}`:t[0]}`}}var d_=[`KB`,`MB`,`GB`,`TB`,`PB`];function f_(e){if(e<1024)return`${e} ${e===1?`byte`:`bytes`}`;let t=e/1024,n=0;for(;t>=1024&&n<d_.length-1;)t/=1024,n++;return`${Number(t.toFixed(2))} ${d_[n]}`}function p_(e){return{code:s_,message:`File is larger than ${f_(e)}`}}function m_(e){return{code:c_,message:`File is smaller than ${f_(e)}`}}var h_={code:l_,message:`Too many files`};function g_(e){return e.type===``&&typeof e.getAsFile==`function`}function __(e,t){let n=e.type===`application/x-moz-file`||a_(e,t??``)||g_(e);return[n,n?null:u_(t)]}function v_(e,t,n){if(y_(e.size)){if(y_(t)&&y_(n)){if(e.size>n)return[!1,p_(n)];if(e.size<t)return[!1,m_(t)]}else if(y_(t)&&e.size<t)return[!1,m_(t)];else if(y_(n)&&e.size>n)return[!1,p_(n)]}return[!0,null]}function y_(e){return e!=null}function b_(e){return e!=null&&typeof e.then==`function`}function x_({files:e,accept:t,minSize:n,maxSize:r,multiple:i,maxFiles:a=0,validator:o,getErrorMessage:s}){let c=[],l=[],u=(e,t)=>s&&typeof File<`u`&&t instanceof File?{...e,message:s(e,t)}:e;e.forEach(e=>{let[i,a]=__(e,t),[o,s]=v_(e,n,r);i&&o?c.push(e):l.push({file:e,errors:[a,s].filter(e=>e!=null).map(t=>u(t,e))})});let d=i?a>=1?a:1/0:1;return c.length>d&&c.slice(d).forEach(e=>{l.push({file:e,errors:[u(h_,e)]})}),l.length>0?{verdict:`reject`,rejections:l}:{verdict:o?`unknown`:`accept`,rejections:l}}function S_(e){return typeof e.isPropagationStopped==`function`?e.isPropagationStopped():e.cancelBubble!==void 0&&e.cancelBubble}function C_(e){let t=e.dataTransfer??e.clipboardData;return t?Array.prototype.some.call(t.types,e=>e===`Files`||e===`application/x-moz-file`)||Array.prototype.some.call(t.items??[],w_):!!e.target&&!!e.target.files}function w_(e){return typeof e==`object`&&!!e&&e.kind===`file`}function T_(e){e.preventDefault()}function E_(e){return e.indexOf(`MSIE`)!==-1||e.indexOf(`Trident/`)!==-1}function D_(e){return e.indexOf(`Edge/`)!==-1}function O_(e=window.navigator.userAgent){return E_(e)||D_(e)}function k_(...e){return(t,...n)=>e.some(e=>(!S_(t)&&e&&e(t,...n),S_(t)))}function A_(){return`showOpenFilePicker`in window}function j_(e){return Array.isArray(e)?e:typeof e==`string`?[e]:[]}function M_(e){if(y_(e))return Array.isArray(e)?e.filter(e=>y_(e)&&y_(e.accept)):[{accept:e}]}function N_(e){let t=[],n=Object.keys(e);for(let n of Object.values(e))for(let e of j_(n))t.includes(e)||t.push(e);return t.length>0?t.join(`, `):n.length>0?n.join(`, `):`Files`}function P_(e){let t=M_(e);if(!y_(t))return;let n={};for(let e of t)for(let[t,r]of Object.entries(e.accept)){let e=n[t]??(n[t]=[]);for(let t of j_(r))e.includes(t)||e.push(t)}return n}function F_(e){let t=M_(e);if(!y_(t))return;let n=t.map(e=>{let t=Object.entries(e.accept).filter(([e,t])=>{let n=!0;return B_(e)||(console.warn(`Skipped "${e}" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.`),n=!1),(Array.isArray(t)||typeof t==`string`)&&j_(t).every(H_)||(console.warn(`Skipped "${e}" because an invalid file extension was provided.`),n=!1),n}).reduce((e,[t,n])=>(e[t]=j_(n),e),{});return{description:y_(e.description)&&e.description!==``?e.description:N_(t),accept:t}}).filter(e=>Object.keys(e.accept).length>0);return n.length>0?n:void 0}function I_(e,{omitWildcardMimeTypesWithExtensions:t=!1}={}){if(y_(e))return Object.entries(e).reduce((e,[n,r])=>{let i=j_(r);return t&&V_(n)&&i.some(H_)?e.push(...i):e.push(n,...i),e},[]).filter(e=>B_(e)||H_(e)).join(`,`)}function L_(e){return e instanceof DOMException&&(e.name===`AbortError`||e.code===e.ABORT_ERR)}function R_(e){return e instanceof DOMException&&(e.name===`SecurityError`||e.code===e.SECURITY_ERR)}function z_(e){return e instanceof DOMException&&e.name===`NotAllowedError`}function B_(e){return e===`audio/*`||e===`video/*`||e===`image/*`||e===`text/*`||e===`application/*`||/\w+\/[-+.\w]+/g.test(e)}function V_(e){return e.endsWith(`/*`)}function H_(e){return/^.*\.[\w]+$/.test(e)}var U_=(0,G.forwardRef)(({children:e,...t},n)=>{let{open:r,...i}=G_(t);return(0,G.useImperativeHandle)(n,()=>({open:r}),[r]),/* @__PURE__ */ (0,K.jsx)(K.Fragment,{children:e?.({...i,open:r})})});U_.displayName=`Dropzone`;var W_={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,isDragUnknown:!1,isDragGlobal:!1,isProcessing:!1,acceptedFiles:[],fileRejections:[],dragFileRejections:[]};function G_(e={}){let{accept:t,disabled:n=!1,getFilesFromEvent:r=Rg,maxSize:i=1/0,minSize:a=0,multiple:o=!0,maxFiles:s=0,onDragEnter:c,onDragLeave:l,onDragOver:u,onDrop:d,onDropAccepted:f,onDropRejected:p,onFileDialogCancel:m,onFileDialogOpen:h,useFsAccessApi:g=!1,autoFocus:_=!1,preventDropOnDocument:v=!0,noClick:y=!1,noKeyboard:b=!1,noDrag:x=!1,noDragEventsBubbling:S=!1,noPaste:C=!1,onError:w,validator:T,getErrorMessage:E}=e,D=(0,G.useMemo)(()=>P_(t),[t]),O=(0,G.useMemo)(()=>I_(D),[D]),k=(0,G.useMemo)(()=>I_(D,{omitWildcardMimeTypesWithExtensions:!0}),[D]),A=(0,G.useMemo)(()=>F_(t),[t]),j=(0,G.useMemo)(()=>typeof h==`function`?h:q_,[h]),M=(0,G.useMemo)(()=>typeof m==`function`?m:q_,[m]),N=(0,G.useRef)(null),P=(0,G.useRef)(null),[F,I]=(0,G.useReducer)(K_,W_),{isFocused:ee,isFileDialogActive:te}=F,ne=(0,G.useRef)(te);ne.current=te;let re=(0,G.useRef)(null),ie=(0,G.useCallback)(()=>{re.current?.abort();let e=new AbortController;return re.current=e,I({type:`setProcessing`,isProcessing:!0}),e.signal},[]),ae=(0,G.useCallback)(e=>{e.aborted||I({type:`setProcessing`,isProcessing:!1})},[]);(0,G.useEffect)(()=>()=>re.current?.abort(),[]);let oe=(0,G.useRef)(typeof window<`u`&&window.isSecureContext&&g&&A_()),se=()=>{!oe.current&&te&&setTimeout(()=>{if(P.current){let{files:e}=P.current;e?.length||(I({type:`closeDialog`}),M())}},300)};(0,G.useEffect)(()=>(window.addEventListener(`focus`,se,!1),()=>{window.removeEventListener(`focus`,se,!1)}),[P,te,M,oe]);let ce=(0,G.useRef)([]),le=(0,G.useRef)([]),ue=e=>{N.current&&e.target&&N.current.contains(e.target)&&e.defaultPrevented||(e.preventDefault(),ce.current=[])};(0,G.useEffect)(()=>(v&&(document.addEventListener(`dragover`,T_,!1),document.addEventListener(`drop`,ue,!1)),()=>{v&&(document.removeEventListener(`dragover`,T_),document.removeEventListener(`drop`,ue))}),[N,v]),(0,G.useEffect)(()=>{let e=e=>{e.target&&(le.current=[...le.current,e.target]),C_(e)&&I({isDragGlobal:!0,type:`setDragGlobal`})},t=e=>{le.current=le.current.filter(t=>t!==e.target&&t!==null),!(le.current.length>0)&&I({isDragGlobal:!1,type:`setDragGlobal`})},n=()=>{le.current=[],I({isDragGlobal:!1,type:`setDragGlobal`})},r=()=>{le.current=[],I({isDragGlobal:!1,type:`setDragGlobal`})};return document.addEventListener(`dragenter`,e,!1),document.addEventListener(`dragleave`,t,!1),document.addEventListener(`dragend`,n,!1),document.addEventListener(`drop`,r,!1),()=>{document.removeEventListener(`dragenter`,e),document.removeEventListener(`dragleave`,t),document.removeEventListener(`dragend`,n),document.removeEventListener(`drop`,r)}},[N]),(0,G.useEffect)(()=>(!n&&_&&N.current&&N.current.focus(),()=>{}),[N,_,n]);let de=(0,G.useCallback)(e=>{w?w(e):console.error(e)},[w]),fe=(0,G.useCallback)(e=>{e.preventDefault(),e.persist?.(),Se(e),!ne.current&&(ce.current=[...ce.current,e.target],C_(e)&&Promise.resolve(r(e)).then(t=>{if(S_(e)&&!S)return;let n=t.length>0?x_({files:t,accept:O,minSize:a,maxSize:i,multiple:o,maxFiles:s,validator:T,getErrorMessage:E}):null;I({isDragAccept:n?.verdict===`accept`,isDragReject:n?.verdict===`reject`,isDragUnknown:n?.verdict===`unknown`,isDragActive:!0,dragFileRejections:n?.rejections??[],type:`setDraggedFiles`}),c&&c(e)}).catch(e=>de(e)))},[r,c,de,S,O,a,i,o,s,T,E]),L=(0,G.useCallback)(e=>{if(e.preventDefault(),e.persist?.(),Se(e),ne.current)return!1;let t=C_(e);if(t&&e.dataTransfer)try{e.dataTransfer.dropEffect=`copy`}catch{}return t&&u&&u(e),!1},[u,S]),R=(0,G.useCallback)(e=>{e.preventDefault(),e.persist?.(),Se(e);let t=ce.current.filter(e=>N.current?.contains(e)),n=t.indexOf(e.target);n!==-1&&t.splice(n,1),ce.current=t,!(t.length>0)&&(I({type:`setDraggedFiles`,isDragActive:!1,isDragAccept:!1,isDragReject:!1,isDragUnknown:!1,dragFileRejections:[]}),C_(e)&&l&&l(e))},[N,l,S]),pe=(0,G.useCallback)(async(e,t,n)=>{let r=(e,t)=>E?{...e,message:E(e,t)}:e,c=e=>{let n=[],i=[];e.forEach(({file:e,accepted:t,acceptError:a,sizeMatch:o,sizeError:s,customErrors:c})=>{let l=!c||Array.isArray(c)&&c.length===0;if(t&&o&&l)n.push(e);else{let t=[a,s];c&&(t=t.concat(c)),i.push({file:e,errors:t.filter(e=>e!=null).map(t=>r(t,e))})}});let a=o?s>=1?s:1/0:1;n.length>a&&n.splice(a).forEach(e=>{i.push({file:e,errors:[r(h_,e)]})}),I({acceptedFiles:n,fileRejections:i,type:`setFiles`}),d&&d(n,i,t),i.length>0&&p&&p(i,t),n.length>0&&f&&f(n,t)},l=e.map(e=>{let[t,n]=__(e,k),[r,o]=v_(e,a,i);return{file:e,accepted:t,acceptError:n,sizeMatch:r,sizeError:o,customErrors:T?T(e):null}});if(!l.some(({customErrors:e})=>b_(e))){c(l);return}let u;try{u=await Promise.all(l.map(async({customErrors:e,...t})=>({...t,customErrors:await e})))}catch(e){n.aborted||(ae(n),de(e));return}n.aborted||c(u)},[I,o,k,a,i,s,d,f,p,T,E,de,ae]),me=(0,G.useCallback)(e=>{if(e.preventDefault(),e.persist?.(),Se(e),ce.current=[],!(ne.current&&e.dataTransfer)&&(I({type:`reset`}),C_(e))){let t=ie();Promise.resolve(r(e)).then(n=>{if(!t.aborted){if(S_(e)&&!S)ae(t);else return pe(n,e,t)}}).catch(e=>{t.aborted||(ae(t),de(e))})}},[r,pe,de,S,ie,ae]),he=(0,G.useCallback)(e=>{if(!C_(e))return;e.preventDefault(),e.persist?.(),Se(e);let t=ie();Promise.resolve(r(e)).then(n=>{if(!t.aborted){if(S_(e)&&!S)ae(t);else return pe(n,e,t)}}).catch(e=>{t.aborted||(ae(t),de(e))})},[r,pe,de,S,ie,ae]),ge=(0,G.useCallback)(()=>{if(oe.current){I({type:`openDialog`}),j();let e={multiple:o,types:A},t;window.showOpenFilePicker(e).then(e=>(t=ie(),r(e))).then(e=>{if(I({type:`closeDialog`}),!t.aborted)return pe(e,null,t)}).catch(e=>{t&&ae(t),L_(e)?(M(e),I({type:`closeDialog`})):R_(e)||z_(e)?(oe.current=!1,P.current?(P.current.value=``,P.current.click()):de(/* @__PURE__ */ Error(`Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided.`))):de(e)})}else P.current&&(I({type:`openDialog`}),j(),P.current.value=``,P.current.click())},[I,j,M,g,pe,de,A,o,ie,ae]),z=(0,G.useCallback)(e=>{N.current?.isEqualNode(e.target)&&(e.key===` `||e.key===`Enter`||e.keyCode===32||e.keyCode===13)&&(e.preventDefault(),ge())},[N,ge]),B=(0,G.useCallback)(()=>{I({type:`focus`})},[]),V=(0,G.useCallback)(()=>{I({type:`blur`})},[]),_e=(0,G.useCallback)(()=>{y||(O_()?setTimeout(ge,0):ge())},[y,ge]),ve=e=>n?null:e,ye=e=>b?null:ve(e),be=e=>x?null:ve(e),xe=e=>C?null:ve(e),Se=e=>{S&&e.stopPropagation()},Ce=(0,G.useMemo)(()=>({refKey:e=`ref`,role:t,onKeyDown:r,onFocus:i,onBlur:a,onClick:o,onDragEnter:s,onDragOver:c,onDragLeave:l,onDrop:u,onPaste:d,...f}={})=>({onKeyDown:ye(k_(r,z)),onFocus:ye(k_(i,B)),onBlur:ye(k_(a,V)),onClick:ve(k_(o,_e)),onDragEnter:be(k_(s,fe)),onDragOver:be(k_(c,L)),onDragLeave:be(k_(l,R)),onDrop:be(k_(u,me)),onPaste:xe(k_(d,he)),role:typeof t==`string`&&t!==``?t:`presentation`,[e]:N,...!n&&!b?{tabIndex:0}:{},...n?{"aria-disabled":!0}:{},...f}),[N,z,B,V,_e,fe,L,R,me,he,b,x,C,n]),we=(0,G.useCallback)(e=>{e.stopPropagation()},[]),Te=(0,G.useMemo)(()=>({refKey:e=`ref`,onChange:t,onClick:n,...r}={})=>({accept:k,multiple:o,type:`file`,"aria-label":`file upload`,style:{border:0,display:`block`,height:0,margin:0,maxWidth:0,opacity:0,overflow:`hidden`,padding:0,width:0},onChange:ve(k_(t,me)),onClick:ve(k_(n,we)),tabIndex:-1,[e]:P,...r}),[P,t,o,me,n]);return{...F,isFocused:ee&&!n,getRootProps:Ce,getInputProps:Te,rootRef:N,inputRef:P,open:ve(ge)}}function K_(e,t){switch(t.type){case`focus`:return{...e,isFocused:!0};case`blur`:return{...e,isFocused:!1};case`openDialog`:return{...W_,isFileDialogActive:!0};case`closeDialog`:return{...e,isFileDialogActive:!1};case`setDraggedFiles`:return{...e,isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject,isDragUnknown:t.isDragUnknown,dragFileRejections:t.dragFileRejections};case`setProcessing`:return{...e,isProcessing:t.isProcessing};case`setFiles`:return{...e,acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,dragFileRejections:[],isProcessing:!1,isDragReject:!1,isDragUnknown:!1};case`setDragGlobal`:return{...e,isDragGlobal:t.isDragGlobal};case`reset`:return{...W_};default:return e}}function q_(){}var J_={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};J_.node;var Y_=U(J_),X_={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};X_.node;var Z_=U(X_),Q_={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};Q_.node;var $_=U(Q_),ev={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};ev.node;var tv=U(ev),nv={name:`chevrons-up-down`,size:24,node:[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]};nv.node;var rv=U(nv),iv={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]};iv.node;var av=U(iv),ov={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};ov.node;var sv=U(ov),cv={name:`clock`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]};cv.node;var lv=U(cv),uv={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};uv.node;var dv=U(uv),fv={name:`ellipsis-vertical`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]],aliases:[`more-vertical`]};fv.node;var pv=U(fv),mv={name:`eye-off`,size:24,node:[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};mv.node;var hv=U(mv),gv={name:`eye`,size:24,node:[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};gv.node;var _v=U(gv),vv={name:`file-code-corner`,size:24,node:[[`path`,{d:`M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35`,key:`1wthlu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m5 16-3 3 3 3`,key:`331omg`}],[`path`,{d:`m9 22 3-3-3-3`,key:`lsp7cz`}]],aliases:[`file-code-2`]};vv.node;var yv=U(vv),bv={name:`files`,size:24,node:[[`path`,{d:`M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8`,key:`14sh0y`}],[`path`,{d:`M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z`,key:`1970lx`}],[`path`,{d:`M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1`,key:`l4dndm`}]]};bv.node;var xv=U(bv),Sv={name:`info`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]};Sv.node;var Cv=U(Sv),wv={name:`layers`,size:24,node:[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]],aliases:[`layers-3`]};wv.node;var Tv=U(wv),Ev={name:`mail`,size:24,node:[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]};Ev.node;var Dv=U(Ev),Ov={name:`minus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]};Ov.node;var kv=U(Ov),Av={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};Av.node;var jv=U(Av),Mv={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};Mv.node;var Nv=U(Mv),Pv={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};Pv.node;var Fv=U(Pv),Iv={name:`route`,size:24,node:[[`circle`,{cx:`6`,cy:`19`,r:`3`,key:`1kj8tv`}],[`path`,{d:`M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15`,key:`1d8sl`}],[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}]]};Iv.node;var Lv=U(Iv),Rv={name:`ruler`,size:24,node:[[`path`,{d:`M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z`,key:`icamh8`}],[`path`,{d:`m14.5 12.5 2-2`,key:`inckbg`}],[`path`,{d:`m11.5 9.5 2-2`,key:`fmmyf7`}],[`path`,{d:`m8.5 6.5 2-2`,key:`vc6u1g`}],[`path`,{d:`m17.5 15.5 2-2`,key:`wo5hmg`}]]};Rv.node;var zv=U(Rv),Bv={name:`scan`,size:24,node:[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}]]};Bv.node;var Vv=U(Bv),Hv={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};Hv.node;var Uv=U(Hv),Wv={name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]};Wv.node;var Gv=U(Wv),Kv={name:`upload`,size:24,node:[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]};Kv.node;var qv=U(Kv),Jv={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};Jv.node;var Yv=U(Jv),Xv={name:`zap`,size:24,node:[[`path`,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`,key:`1v7up4`}]]};Xv.node;var Zv=U(Xv);function Qv({pick:e,onPick:t,onClose:n}){let{portal:r}=i(),a=(0,G.useMemo)(()=>e?e.plates.map(e=>e.thumbnail?URL.createObjectURL(new Blob([e.thumbnail],{type:`image/png`})):null):[],[e]);return(0,G.useEffect)(()=>()=>a.forEach(e=>e&&URL.revokeObjectURL(e)),[a]),/* @__PURE__ */ (0,K.jsx)(ha,{open:!!e,onOpenChange:e=>{e||n()},children:/* @__PURE__ */ (0,K.jsxs)(ya,{container:r,children:[/* @__PURE__ */ (0,K.jsx)(xa,{className:`fixed inset-0 z-50 bg-scrim animate-[fade-in_200ms_ease-out] data-[state=closed]:animate-[fade-out_150ms_ease-in_forwards]`}),/* @__PURE__ */ (0,K.jsxs)(Ta,{className:`pop fixed top-1/2 left-1/2 z-50 w-[min(560px,calc(100%-32px))] -translate-x-1/2 -translate-y-1/2 rounded-tile border border-rule bg-panel p-5 shadow-overlay`,children:[/* @__PURE__ */ (0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[/* @__PURE__ */ (0,K.jsxs)(`div`,{children:[/* @__PURE__ */ (0,K.jsx)(ka,{className:`font-display text-heading`,children:`Which plate?`}),/* @__PURE__ */ (0,K.jsx)(Aa,{className:`mt-0.5 text-body text-muted`,children:e&&`${e.file.name} has ${e.plates.length} sliced plates. Open one; you can come back for the others.`})]}),/* @__PURE__ */ (0,K.jsx)(Ma,{className:`press grid size-8 place-items-center rounded-control text-muted hover:bg-raise hover:text-ink`,"aria-label":`Close`,children:/* @__PURE__ */ (0,K.jsx)(Yv,{className:`size-4`,"aria-hidden":!0})})]}),/* @__PURE__ */ (0,K.jsx)(`div`,{className:`@container`,children:/* @__PURE__ */ (0,K.jsx)(`div`,{className:`mt-4 grid grid-cols-2 gap-3 @sm:grid-cols-3`,children:e&&e.plates.map((e,n)=>/* @__PURE__ */ (0,K.jsxs)(`button`,{type:`button`,onClick:()=>t(e.plate),className:`press overflow-hidden rounded-card border border-rule bg-raise text-left hover:border-ink`,children:[a[n]?/* @__PURE__ */ (0,K.jsx)(`img`,{src:a[n],alt:``,className:`aspect-square w-full bg-viewer object-contain`}):/* @__PURE__ */ (0,K.jsx)(`div`,{className:`aspect-square w-full bg-viewer`}),/* @__PURE__ */ (0,K.jsxs)(`span`,{className:`num block px-2.5 py-1.5 text-body font-medium`,children:[`Plate `,e.plate]})]},e.plate))})})]})]})})}function $v({show:e,text:t}){return/* @__PURE__ */ (0,K.jsx)(jm,{children:e&&/* @__PURE__ */ (0,K.jsx)($h.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:`pointer-events-none fixed inset-0 z-50 grid place-items-center bg-bench/80 backdrop-blur-sm transparency-reduce:bg-bench transparency-reduce:backdrop-blur-none`,children:/* @__PURE__ */ (0,K.jsx)($h.p,{initial:{scale:.96},animate:{scale:1},exit:{scale:.96},className:`rounded-tile border-2 border-dashed border-ink bg-panel px-6 py-5 font-display text-heading shadow-overlay`,children:t})})})}function ey({n:e,title:t,done:n,aside:r,children:i}){return/* @__PURE__ */ (0,K.jsxs)(`section`,{className:`border-b border-rule p-4 last:border-b-0`,children:[/* @__PURE__ */ (0,K.jsxs)(`header`,{className:`mb-3 flex items-center gap-2`,children:[/* @__PURE__ */ (0,K.jsx)(`span`,{className:H(`num grid size-5 shrink-0 place-items-center rounded-full text-label font-semibold transition-colors`,n?`bg-ink text-ink-contrast`:`border border-rule text-muted`),"aria-hidden":!0,children:n?/* @__PURE__ */ (0,K.jsx)(Y_,{className:`size-3`,strokeWidth:3}):e}),/* @__PURE__ */ (0,K.jsx)(`h2`,{className:`font-display text-heading`,children:t}),r&&/* @__PURE__ */ (0,K.jsx)(`span`,{className:`ml-auto truncate text-label text-muted`,children:r})]}),i]})}function ty({label:e,hint:t,children:n}){return/* @__PURE__ */ (0,K.jsxs)(`div`,{className:`space-y-1.5`,children:[/* @__PURE__ */ (0,K.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2`,children:[/* @__PURE__ */ (0,K.jsx)(`span`,{className:`text-label`,children:e}),t&&/* @__PURE__ */ (0,K.jsx)(`span`,{className:`num text-label text-muted`,children:t})]}),n]})}var ny={primary:`bg-ink text-ink-contrast hover:opacity-90`,secondary:`bg-panel text-ink border border-rule hover:border-muted`,ghost:`text-ink hover:bg-raise`,silver:`silver-fill hover:opacity-90`},ry={md:`h-8 px-3 gap-1.5`,lg:`h-10 px-4 gap-2`,icon:`size-8 justify-center`},iy=({variant:e=`secondary`,size:t=`md`,className:n}={})=>H(`press inline-flex shrink-0 items-center rounded-control text-button`,ny[e],ry[t],n);function ay({variant:e,size:t,className:n,...r}){return/* @__PURE__ */ (0,K.jsx)(`button`,{type:`button`,className:iy({variant:e,size:t,className:n}),...r})}var oy={status:{icon:Cv,plain:`text-muted`,hero:`text-hero-muted`},done:{icon:sv,plain:`text-ok`,hero:`text-hero-ink`},warning:{icon:av,plain:`text-warn`,hero:`text-hero-warn`},error:{icon:yt,plain:`text-danger`,hero:`text-hero-warn`}};function sy({tone:e=`status`,onHero:t,className:n,children:r}){let{icon:i,plain:a,hero:o}=oy[e];return/* @__PURE__ */ (0,K.jsxs)(`p`,{role:e===`error`?`alert`:`status`,className:H(`flex items-start gap-1.5 text-body`,t?o:a,n),children:[/* @__PURE__ */ (0,K.jsx)(i,{className:`mt-0.5 size-3.5 shrink-0`,"aria-hidden":!0}),/* @__PURE__ */ (0,K.jsx)(`span`,{className:`min-w-0`,children:r})]})}var cy=400,ly=120;function uy({label:e,value:t,min:n=1,max:r=50,onChange:i,disabled:a,size:o=`md`,repeat:s=!1,className:c}){let l=(0,G.useRef)(t);l.current=t;let u=(0,G.useRef)(null),d=(0,G.useRef)(!1),f=()=>{clearTimeout(u.current),u.current=null};(0,G.useEffect)(()=>f,[]);let p=e=>{let t=Math.min(r,Math.max(n,l.current+e));if(t===l.current)return f();l.current=t,i(t)},m=e=>({onPointerDown:t=>{if((t.pointerType!==`mouse`||t.button===0)&&(d.current=t.pointerType!==`touch`,d.current&&p(e),s)){let t=()=>{d.current=!0,p(e),u.current=setTimeout(t,ly)};u.current=setTimeout(t,cy)}},onPointerUp:f,onPointerLeave:f,onPointerCancel:f,onClick:()=>{d.current||p(e),d.current=!1}}),h=H(`press grid place-items-center rounded-md text-ink hover:bg-rule disabled:text-muted`,o===`sm`?`size-7`:`size-8`);return/* @__PURE__ */ (0,K.jsxs)(`div`,{role:`group`,"aria-label":e,className:H(`flex shrink-0 items-center rounded-control bg-raise p-0.5`,c),children:[/* @__PURE__ */ (0,K.jsx)(`button`,{type:`button`,"aria-label":`One copy fewer`,disabled:a||t<=n,className:h,...m(-1),children:/* @__PURE__ */ (0,K.jsx)(kv,{className:`size-3.5`,"aria-hidden":!0})}),/* @__PURE__ */ (0,K.jsx)(`span`,{className:H(`num text-center text-body font-semibold`,o===`sm`?`w-6`:`w-7`),"aria-live":`polite`,children:t}),/* @__PURE__ */ (0,K.jsx)(`button`,{type:`button`,"aria-label":`One copy more`,disabled:a||t>=r,className:h,...m(1),children:/* @__PURE__ */ (0,K.jsx)(Nv,{className:`size-3.5`,"aria-hidden":!0})})]})}var dy=52428800;dy/1048576;var fy=(e=!1)=>e?`up to 50 MB`:`up to 10 files, 50 MB each`,py=e=>Math.max(1,Math.ceil(e/2)),my=e=>Math.floor(e/2),hy={items:[],selected:null},gy=(e,t,n)=>e.items.some(e=>e.id===t)?{...e,items:e.items.map(e=>e.id===t?n(e):e)}:e;function _y(e,t){switch(t.type){case`add`:{let n=(e.items.find(t=>t.id===e.selected)||{}).settings||t.defaults,r=t.files.slice(0,10-e.items.length).map(({id:e,file:t})=>({id:e,file:t,rot:[0,0,0],copies:1,settings:{...n},result:null,error:null}));return r.length?{items:[...e.items,...r],selected:r[0].id}:e}case`replace`:{let n=(e.items.find(t=>t.id===e.selected)||{}).settings||t.defaults;return{items:[{id:t.id,file:t.file,rot:[0,0,0],copies:1,settings:{...n},result:null,error:null}],selected:t.id}}case`remove`:{let n=e.items.findIndex(e=>e.id===t.id);if(n<0)return e;let r=e.items.filter(e=>e.id!==t.id),i=r[Math.min(n,r.length-1)];return{items:r,selected:e.selected===t.id?i?i.id:null:e.selected}}case`select`:return e.items.some(e=>e.id===t.id)?{...e,selected:t.id}:e;case`settings`:return gy(e,t.id,e=>({...e,settings:{...e.settings,...t.patch}}));case`applyToAll`:{let n=e.items.find(n=>n.id===(t.id??e.selected));return n?{...e,items:e.items.map(e=>({...e,settings:{...n.settings}}))}:e}case`copies`:return gy(e,t.id,e=>({...e,copies:typeof t.value==`function`?t.value(e.copies):t.value}));case`rotate`:return gy(e,t.id,e=>({...e,rot:t.rot}));case`result`:return gy(e,t.id,e=>({...e,result:t.result,error:null}));case`error`:return gy(e,t.id,e=>({...e,error:t.error}));default:return e}}var vy=(e,t)=>JSON.stringify([t,e.rot,[e.file.name,e.file.size,e.file.lastModified]]),yy=(e,t)=>!e.result||e.result.sig!==t||!!e.error,by=1e6,xy={plates:[],files:{},selected:{plate:null,object:null}},Sy=(e,t,n={x:0,y:0},r=0,i=Rt)=>({id:e,fileId:t,x:n.x,y:n.y,spin:r,orient:i}),Cy=(e,t,n)=>({...e,plates:e.plates.map(e=>e.id===t?n(e):e)}),wy=(e,t)=>({...e,plates:e.plates.map(e=>({...e,objects:e.objects.map(t)}))});function Ty(e){let t=new Set(e.plates.flatMap(e=>e.objects.map(e=>e.fileId))),n=Object.fromEntries(Object.entries(e.files).filter(([e])=>t.has(e)));return Object.keys(n).length===Object.keys(e.files).length?e:{...e,files:n}}function Ey(e){let{plate:t,object:n}=e.selected,r=e.plates.find(e=>e.objects.some(e=>e.id===n));if(r)return r.id===t?e:{...e,selected:{plate:r.id,object:n}};let i=e.plates.find(e=>e.id===t)||e.plates[0]||null;return{...e,selected:{plate:i?i.id:null,object:null}}}function Dy(e,t){switch(t.type){case`addPlate`:return e.plates.length>=10?e:{...e,plates:[...e.plates,{id:t.id,settings:t.settings,objects:[],result:null,error:null}],selected:{plate:t.id,object:null}};case`removePlate`:return Ey(Ty({...e,plates:e.plates.filter(e=>e.id!==t.id)}));case`selectPlate`:return e.plates.some(e=>e.id===t.id)?{...e,selected:{plate:t.id,object:null}}:e;case`selectObject`:return Ey({...e,selected:{...e.selected,object:t.id}});case`addObjects`:{let n=e.plates.find(e=>e.id===t.plate);if(!n||!t.objects.length)return e;let r=50-n.objects.length,i=t.objects.slice(0,Math.max(0,r));return i.length?{...Cy({...e,files:{...e.files,...t.files}},t.plate,e=>({...e,objects:[...e.objects,...i]})),selected:{plate:t.plate,object:i[0].id}}:e}case`updateObject`:return wy(e,e=>e.id===t.id?{...e,...t.patch}:e);case`updateObjects`:return wy(e,e=>t.patches[e.id]?{...e,...t.patches[e.id]}:e);case`removeObjects`:{let n=new Set(t.ids);return Ey(Ty({...e,plates:e.plates.map(e=>({...e,objects:e.objects.filter(e=>!n.has(e.id))}))}))}case`moveObjects`:{let n=new Set(t.ids);if(!e.plates.find(e=>e.id===t.to))return e;let r=e.plates.flatMap(e=>e.objects.filter(e=>n.has(e.id))).map(e=>({...e,...t.positions[e.id]})),i=e.plates.map(e=>{let i=e.objects.filter(e=>!n.has(e.id));return e.id===t.to?{...e,objects:[...i,...r]}:i.length===e.objects.length?e:{...e,objects:i}});return{...e,plates:i,selected:{plate:t.to,object:r.length?r[0].id:null}}}case`settings`:return Cy(e,t.plate,e=>({...e,settings:{...e.settings,...t.patch}}));case`settingsForAll`:{let n=e.plates.find(e=>e.id===t.from);return n?{...e,plates:e.plates.map(e=>({...e,settings:{...n.settings}}))}:e}case`result`:return Cy(e,t.plate,e=>({...e,result:t.result,error:null}));case`error`:return Cy(e,t.plate,e=>({...e,error:t.error}));default:return e}}var Oy=e=>Math.round(e*100)/100,ky=e=>e?[e.name,e.size,e.lastModified]:null,Ay=(e,t)=>JSON.stringify([e.settings,e.objects.map(e=>[ky(t[e.fileId]),Oy(e.x),Oy(e.y),Oy(e.spin),e.orient.map(e=>Math.round(e*1e6)/1e6)])]),jy=(e,t)=>e.objects.length>0&&(!e.result||e.result.sig!==Ay(e,t)||!!e.error);function My(e){let t=/* @__PURE__ */ new Map;for(let n of e.objects)t.has(n.fileId)||t.set(n.fileId,[]),t.get(n.fileId).push(n);return[...t].map(([e,t])=>({fileId:e,objects:t}))}var Ny=(e,t,n)=>e.filter(e=>!Object.hasOwn(t,e)&&!n.has(e)),Py=(e,t)=>`${e}|${t.join(`,`)}`,Fy=e=>e.slice(0,e.indexOf(`|`));function Iy(e,t,n){let r=[],i=e;for(;i.length&&r.length<n;){let e=[],n=0;for(let t of i){if(e.length>=50||e.length&&n+t.triangles>1e6)break;e.push(t),n+=t.triangles}let{positions:a,overflow:o}=It(e.map(e=>({id:e.id,points:e.points,spin:0})),t),s=e.map(e=>e.id).filter(e=>!o.includes(e));s.length||(s=[e[0].id],a[s[0]]={x:0,y:0}),r.push({ids:s,positions:Object.fromEntries(s.map(e=>[e,a[e]]))});let c=new Set(s);i=i.filter(e=>!c.has(e.id))}return{plates:r,left:i.map(e=>e.id)}}var Ly={"model/stl":[`.stl`],"model/3mf":[`.3mf`],"model/obj":[`.obj`],"model/step":[`.step`,`.stp`],"model/iges":[`.iges`,`.igs`]},Ry={sliced:[`bg-ok`,`sliced`],stale:[`bg-warn`,`changed since slicing`],failed:[`bg-danger`,`failed`]};function zy({n:e,on:t,state:n,onClick:r}){let[i,a]=Ry[n]||[];return/* @__PURE__ */ (0,K.jsxs)(`button`,{type:`button`,"aria-pressed":t,"aria-label":`Plate ${e}${a?`, ${a}`:``}`,onClick:r,className:H(`press num relative h-8 min-w-8 rounded-control border px-2.5 text-body font-medium`,t?`border-ink bg-ink text-ink-contrast`:`border-rule hover:border-muted`),children:[e,i&&/* @__PURE__ */ (0,K.jsx)(`span`,{className:H(`absolute -top-1 -right-1 size-2.5 rounded-full border-2 border-panel`,i),"aria-hidden":!0})]})}function By({name:e,others:t,canAdd:n,onMove:r,onRemove:a}){let{portal:o}=i(),s=`cursor-pointer rounded-control px-2.5 py-1.5 text-body outline-none data-[disabled]:cursor-default data-[highlighted]:bg-raise`;return/* @__PURE__ */ (0,K.jsxs)(bs,{children:[/* @__PURE__ */ (0,K.jsx)(Ss,{"aria-label":`More for ${e}`,className:`press grid size-7 shrink-0 place-items-center rounded-control text-muted hover:bg-raise hover:text-ink`,children:/* @__PURE__ */ (0,K.jsx)(pv,{className:`size-4`,"aria-hidden":!0})}),/* @__PURE__ */ (0,K.jsx)(Cs,{container:o,children:/* @__PURE__ */ (0,K.jsxs)(Ts,{align:`end`,sideOffset:4,className:`pop z-50 min-w-56 rounded-card border border-rule bg-panel p-1 shadow-popover`,children:[t.map(e=>/* @__PURE__ */ (0,K.jsxs)(Es,{className:s,onSelect:()=>r(e.id),children:[`Move to plate `,e.n]},e.id)),/* @__PURE__ */ (0,K.jsx)(Es,{className:s,disabled:!n,onSelect:()=>r(`new`),children:`Move to a new plate`}),/* @__PURE__ */ (0,K.jsx)(Ds,{className:`my-1 h-px bg-rule`}),/* @__PURE__ */ (0,K.jsx)(Es,{className:H(s,`text-danger`),onSelect:a,children:`Remove from this plate`})]})})]})}var Vy=e=>e?`${e.map(e=>e.toFixed(1)).join(` × `)} mm`:null;function Hy({plates:e,selected:t,files:n,loading:r,summary:i,onSelectPlate:a,onNewPlate:o,onRemovePlate:s,onSettingsForAll:c,onFiles:l,onChoose:u,onSelectFile:d,onCopies:f,onMove:p,onRemove:m}){let{getRootProps:h,getInputProps:g,isDragActive:_}=G_({accept:Ly,multiple:!0,noClick:!0,noKeyboard:!0,noDragEventsBubbling:!0,onDrop:e=>{e.length&&l(e)}}),v=e.find(e=>e.id===t),y=n.reduce((e,t)=>e+t.copies,0),b=e.filter(e=>e.id!==t);return/* @__PURE__ */ (0,K.jsxs)(ey,{n:1,title:`Plates`,done:y>0,aside:y?`${y} ${y===1?`object`:`objects`}`:void 0,children:[/* @__PURE__ */ (0,K.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center gap-1.5`,children:[e.map(e=>/* @__PURE__ */ (0,K.jsx)(zy,{n:e.n,on:e.id===t,state:e.state,onClick:()=>a(e.id)},e.id)),/* @__PURE__ */ (0,K.jsx)(xe,{label:`New plate`,children:/* @__PURE__ */ (0,K.jsx)(ay,{variant:`ghost`,size:`icon`,"aria-label":`New plate`,disabled:e.length>=10,onClick:o,children:/* @__PURE__ */ (0,K.jsx)(Nv,{className:`size-4`,"aria-hidden":!0})})})]}),/* @__PURE__ */ (0,K.jsxs)(`div`,{...h(),className:H(`rounded-card outline-none`,_&&`ring-2 ring-ink ring-offset-2 ring-offset-panel`),children:[/* @__PURE__ */ (0,K.jsx)(`input`,{...g()}),n.length||r.length?/* @__PURE__ */ (0,K.jsxs)(`ul`,{className:`space-y-1.5`,children:[n.map(t=>/* @__PURE__ */ (0,K.jsxs)(`li`,{className:H(`flex items-center gap-1 rounded-card border bg-raise p-1 transition-colors`,t.on?`border-ink`:`border-rule`),children:[/* @__PURE__ */ (0,K.jsxs)(`button`,{type:`button`,"aria-current":t.on||void 0,onClick:()=>d(t.firstId),className:`flex min-w-0 flex-1 items-center gap-2 rounded-control py-1 pl-1.5 text-left`,children:[/* @__PURE__ */ (0,K.jsx)(vt,{className:H(`size-4 shrink-0`,t.on?`text-ink`:`text-muted`),"aria-hidden":!0}),/* @__PURE__ */ (0,K.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[/* @__PURE__ */ (0,K.jsx)(`span`,{className:`block truncate text-body font-medium`,title:t.name,children:t.name}),/* @__PURE__ */ (0,K.jsx)(`span`,{className:`block truncate text-label text-muted`,children:t.cad?`Placed by the slicer`:Vy(t.size)})]})]}),/* @__PURE__ */ (0,K.jsx)(uy,{size:`sm`,label:`Copies of ${t.name}`,value:t.copies,disabled:t.cad,onChange:e=>f(t.fileId,e)}),/* @__PURE__ */ (0,K.jsx)(By,{name:t.name,others:b,canAdd:e.length<10,onMove:e=>p(t.fileId,e),onRemove:()=>m(t.fileId)})]},t.fileId)),r.map((e,t)=>/* @__PURE__ */ (0,K.jsxs)(`li`,{className:`flex items-center gap-2 rounded-card border border-dashed border-rule px-2.5 py-2 text-body text-muted`,children:[/* @__PURE__ */ (0,K.jsx)(_t,{className:`size-3.5 shrink-0 animate-spin`,"aria-hidden":!0}),` `,/* @__PURE__ */ (0,K.jsxs)(`span`,{className:`truncate`,children:[`Reading `,e]})]},`${e}-${t}`))]}):/* @__PURE__ */ (0,K.jsxs)(`button`,{type:`button`,onClick:u,className:H(`press flex w-full items-center gap-3 rounded-card border border-dashed border-rule p-2 text-left hover:border-muted`,_&&`border-ink bg-raise`),children:[/* @__PURE__ */ (0,K.jsx)(`span`,{className:`grid size-8 shrink-0 place-items-center rounded-control bg-raise`,children:/* @__PURE__ */ (0,K.jsx)(qv,{className:`size-4 text-muted`,"aria-hidden":!0})}),/* @__PURE__ */ (0,K.jsxs)(`span`,{className:`min-w-0`,children:[/* @__PURE__ */ (0,K.jsx)(`span`,{className:`block text-body font-medium`,children:_?`Drop the files to place them`:`Add models`}),/* @__PURE__ */ (0,K.jsxs)(`span`,{className:`block text-label text-muted`,children:[Ct,`, `,fy()]})]})]})]}),i&&/* @__PURE__ */ (0,K.jsx)(sy,{tone:i.warn?`warning`:`status`,className:`mt-2`,children:i.text}),/* @__PURE__ */ (0,K.jsxs)(`div`,{className:`mt-2 -ml-2 flex flex-wrap items-center gap-0.5`,children:[(n.length>0||r.length>0)&&/* @__PURE__ */ (0,K.jsxs)(ay,{variant:`ghost`,className:`px-2`,onClick:u,children:[/* @__PURE__ */ (0,K.jsx)(Nv,{className:`size-3.5`,"aria-hidden":!0}),` Add files`]}),e.length>1&&v&&/* @__PURE__ */ (0,K.jsxs)(K.Fragment,{children:[/* @__PURE__ */ (0,K.jsx)(ay,{variant:`ghost`,className:`px-2`,onClick:c,children:`Use these settings for all plates`}),/* @__PURE__ */ (0,K.jsxs)(ay,{variant:`ghost`,className:`px-2 text-danger`,onClick:()=>s(v.id),children:[`Remove plate `,v.n]})]})]})]})}var Uy=e=>String(Math.round(e*10)/10);function Wy({label:e,value:t,unit:n,onCommit:r}){let[i,a]=(0,G.useState)(Uy(t));return(0,G.useEffect)(()=>a(Uy(t)),[t]),/* @__PURE__ */ (0,K.jsxs)(`label`,{className:`flex h-8 min-w-0 flex-1 items-center gap-1 rounded-control border border-rule bg-panel px-2 focus-within:border-muted`,children:[/* @__PURE__ */ (0,K.jsx)(`span`,{className:`text-label text-muted`,children:e}),/* @__PURE__ */ (0,K.jsx)(`input`,{inputMode:`decimal`,"aria-label":e,value:i,onChange:e=>a(e.target.value),onBlur:()=>{let e=parseFloat(i.replace(`,`,`.`));Number.isFinite(e)&&Math.abs(e-t)>.04?r(e):a(Uy(t))},onKeyDown:e=>{e.key===`Enter`&&e.currentTarget.blur(),e.key===`Escape`&&(a(Uy(t)),e.currentTarget.blur())},className:`num min-w-0 flex-1 bg-transparent text-right text-body outline-none`}),/* @__PURE__ */ (0,K.jsx)(`span`,{className:`text-label text-muted`,children:n})]})}var Gy=`px-2.5`;function Ky({n:e,item:t,copy:n,problem:r,note:i,canArrange:a,onMoveTo:o,onSpin:s,onSpinBy:c,onTip:l,onReset:u,onCentre:d,onArrange:f}){let p=t?`${t.name}${n&&n.of>1?`, copy ${n.k} of ${n.of}`:``}`:void 0;return/* @__PURE__ */ (0,K.jsxs)(ey,{n:e,title:`Position`,done:!!t&&!r,aside:p,children:[!t&&/* @__PURE__ */ (0,K.jsx)(`p`,{className:`text-body text-muted`,children:`Select an object to move or turn it, or drag it on the plate.`}),t&&t.cad&&/* @__PURE__ */ (0,K.jsx)(`p`,{className:`text-body text-muted`,children:`The slicer places STEP and IGES files at the bed centre.`}),t&&!t.cad&&/* @__PURE__ */ (0,K.jsxs)(`div`,{className:`space-y-3.5`,children:[/* @__PURE__ */ (0,K.jsx)(ty,{label:`Where`,hint:`mm, from the printer's origin`,children:/* @__PURE__ */ (0,K.jsxs)(`div`,{className:`flex gap-2`,children:[/* @__PURE__ */ (0,K.jsx)(Wy,{label:`X`,value:t.at[0],unit:`mm`,onCommit:e=>o(e,t.at[1])}),/* @__PURE__ */ (0,K.jsx)(Wy,{label:`Y`,value:t.at[1],unit:`mm`,onCommit:e=>o(t.at[0],e)})]})}),/* @__PURE__ */ (0,K.jsx)(ty,{label:`Spin`,hint:`about the plate`,children:/* @__PURE__ */ (0,K.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[/* @__PURE__ */ (0,K.jsx)(`div`,{className:`w-24 shrink-0`,children:/* @__PURE__ */ (0,K.jsx)(Wy,{label:`Spin`,value:t.spin,unit:`°`,onCommit:s})}),[-90,-15,15,90].map(e=>/* @__PURE__ */ (0,K.jsxs)(ay,{className:H(Gy,`num min-w-0 flex-1 justify-center px-1`),onClick:()=>c(e),"aria-label":`Spin ${e>0?`left`:`right`} ${Math.abs(e)} degrees`,children:[e>0?`+${e}`:e,`°`]},e))]})}),/* @__PURE__ */ (0,K.jsx)(ty,{label:`Turn`,hint:t.size?`${t.size.map(e=>e.toFixed(1)).join(` × `)} mm`:void 0,children:/* @__PURE__ */ (0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[/* @__PURE__ */ (0,K.jsx)(xe,{label:`Tip it toward you, a quarter turn`,children:/* @__PURE__ */ (0,K.jsx)(ay,{className:Gy,onClick:()=>l(`forward`),children:`Tip forward`})}),/* @__PURE__ */ (0,K.jsx)(xe,{label:`Tip it onto its side, a quarter turn`,children:/* @__PURE__ */ (0,K.jsx)(ay,{className:Gy,onClick:()=>l(`sideways`),children:`Tip sideways`})}),/* @__PURE__ */ (0,K.jsx)(xe,{label:`Back to how the file has it`,children:/* @__PURE__ */ (0,K.jsx)(ay,{variant:`ghost`,size:`icon`,"aria-label":`Undo turns`,onClick:u,children:/* @__PURE__ */ (0,K.jsx)(Fv,{className:`size-3.5`,"aria-hidden":!0})})})]})}),r&&/* @__PURE__ */ (0,K.jsx)(sy,{tone:`error`,children:r}),i&&/* @__PURE__ */ (0,K.jsx)(sy,{children:i})]}),/* @__PURE__ */ (0,K.jsxs)(`div`,{className:`mt-3.5 flex flex-wrap gap-1.5`,children:[t&&!t.cad&&/* @__PURE__ */ (0,K.jsx)(ay,{className:Gy,onClick:d,children:`Centre`}),/* @__PURE__ */ (0,K.jsx)(ay,{className:Gy,disabled:!a,onClick:f,children:`Arrange plate`})]})]})}var qy=1,Jy=.9,Yy=.8,Xy=.17,Zy=.1,Qy=.999,$y=.9999,eb=.99,tb=/[\\\/_+.#"@\[\(\{&]/,nb=/[\\\/_+.#"@\[\(\{&]/g,rb=/[\s-]/,ib=/[\s-]/g;function ab(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?qy:eb;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=ab(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=qy:tb.test(e.charAt(l-1))?(d*=Yy,p=e.slice(i,l-1).match(nb),p&&i>0&&(d*=Qy**+p.length)):rb.test(e.charAt(l-1))?(d*=Jy,m=e.slice(i,l-1).match(ib),m&&i>0&&(d*=Qy**+m.length)):(d*=Xy,i>0&&(d*=Qy**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=$y)),(d<Zy&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=ab(e,t,n,r,l+1,a+2,o),f*Zy>d&&(d=f*Zy)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function ob(e){return e.toLowerCase().replace(ib,` `)}function sb(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,ab(e,t,ob(e),ob(t),0,0,{})}var cb=`[cmdk-group=""]`,lb=`[cmdk-group-items=""]`,ub=`[cmdk-group-heading=""]`,db=`[cmdk-item=""]`,fb=`${db}:not([aria-disabled="true"])`,pb=`cmdk-item-select`,mb=`data-value`,hb=(e,t,n)=>sb(e,t,n),gb=G.createContext(void 0),_b=()=>G.useContext(gb),vb=G.createContext(void 0),yb=()=>G.useContext(vb),bb=G.createContext(void 0),xb=G.forwardRef((e,t)=>{let n=Fb(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:/* @__PURE__ */ new Map,groups:/* @__PURE__ */ new Set}})),r=Fb(()=>/* @__PURE__ */ new Set),i=Fb(()=>/* @__PURE__ */ new Map),a=Fb(()=>/* @__PURE__ */ new Map),o=Fb(()=>/* @__PURE__ */ new Set),s=Nb(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,..._}=e,v=w(),y=w(),b=w(),x=G.useRef(null),S=Rb();Pb(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,C.emit()}},[u]),Pb(()=>{S(6,A)},[]);let C=G.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)k(),D(),S(1,O);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(b);e?e.focus():(i=document.getElementById(v))==null||i.focus()}if(S(7,()=>{n.current.selectedItemId=j()?.id,C.emit()}),r||S(5,A),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}C.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),T=G.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,E(t,r)),S(2,()=>{D(),C.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,/* @__PURE__ */ new Set([e]))),S(3,()=>{k(),D(),n.current.value||O(),C.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=j();S(4,()=>{k(),t?.getAttribute(`id`)===e&&O(),C.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,/* @__PURE__ */ new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:v,inputId:b,labelId:y,listInnerRef:x}),[]);function E(e,t){let r=s.current?.filter??hb;return e?r(e,n.current.search,t):0}function D(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=x.current;M().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(lb);t?t.appendChild(e.parentElement===t?e:e.closest(`${lb} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${lb} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=x.current?.querySelector(`${cb}[${mb}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function O(){let e=M().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(mb);C.setState(`value`,e||void 0)}function k(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=/* @__PURE__ */ new Set;let e=0;for(let t of r.current){let r=E(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function A(){var e;let t=j();t&&(t.parentElement?.firstChild===t&&((e=t.closest(cb)?.querySelector(ub))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function j(){return x.current?.querySelector(`${db}[aria-selected="true"]`)}function M(){return Array.from(x.current?.querySelectorAll(fb)||[])}function N(e){let t=M()[e];t&&C.setState(`value`,t.getAttribute(mb))}function P(e){var t;let n=j(),r=M(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&C.setState(`value`,a.getAttribute(mb))}function F(e){let t=j()?.closest(cb),n;for(;t&&!n;)t=e>0?jb(t,cb):Mb(t,cb),n=t?.querySelector(fb);n?C.setState(`value`,n.getAttribute(mb)):P(e)}let I=()=>N(M().length-1),ee=e=>{e.preventDefault(),e.metaKey?I():e.altKey?F(1):P(1)},te=e=>{e.preventDefault(),e.metaKey?N(0):e.altKey?F(-1):P(-1)};return G.createElement(V.div,{ref:t,tabIndex:-1,..._,"cmdk-root":``,onKeyDown:e=>{var t;(t=_.onKeyDown)==null||t.call(_,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:g&&e.ctrlKey&&ee(e);break;case`ArrowDown`:ee(e);break;case`p`:case`k`:g&&e.ctrlKey&&te(e);break;case`ArrowUp`:te(e);break;case`Home`:e.preventDefault(),N(0);break;case`End`:e.preventDefault(),I();break;case`Enter`:{e.preventDefault();let t=j();if(t){let e=new Event(pb);t.dispatchEvent(e)}}}}},G.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:Vb},c),Bb(e,e=>G.createElement(vb.Provider,{value:C},G.createElement(gb.Provider,{value:T},e))))}),Sb=G.forwardRef((e,t)=>{let n=w(),r=G.useRef(null),i=G.useContext(bb),a=_b(),o=Nb(e),s=o.current?.forceMount??i?.forceMount;Pb(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=Lb(n,r,[e.value,e.children,r],e.keywords),l=yb(),u=Ib(e=>e.value&&e.value===c.current),d=Ib(e=>s||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);G.useEffect(()=>{let t=r.current;if(t&&!e.disabled)return t.addEventListener(pb,f),()=>t.removeEventListener(pb,f)},[d,e.onSelect,e.disabled]);function f(){var e,t;p(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function p(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:m,value:h,onSelect:g,forceMount:_,keywords:v,...y}=e;return G.createElement(V.div,{ref:ae(r,t),...y,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!m,"aria-selected":!!u,"data-disabled":!!m,"data-selected":!!u,onPointerMove:m||a.getDisablePointerSelection()?void 0:p,onClick:m?void 0:f},e.children)}),Cb=G.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=w(),s=G.useRef(null),c=G.useRef(null),l=w(),u=_b(),d=Ib(e=>i||u.filter()===!1?!0:!e.search||e.filtered.groups.has(o));Pb(()=>u.group(o),[]),Lb(o,s,[e.value,e.heading,c]);let f=G.useMemo(()=>({id:o,forceMount:i}),[i]);return G.createElement(V.div,{ref:ae(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:!d||void 0},n&&G.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),Bb(e,e=>G.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},G.createElement(bb.Provider,{value:f},e))))}),wb=G.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=G.useRef(null),a=Ib(e=>!e.search);return!n&&!a?null:G.createElement(V.div,{ref:ae(i,t),...r,"cmdk-separator":``,role:`separator`})}),Tb=G.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=yb(),o=Ib(e=>e.search),s=Ib(e=>e.selectedItemId),c=_b();return G.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),G.createElement(V.input,{ref:t,...r,"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":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),Eb=G.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=G.useRef(null),o=G.useRef(null),s=Ib(e=>e.selectedItemId),c=_b();return G.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),G.createElement(V.div,{ref:ae(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},Bb(e,e=>G.createElement(`div`,{ref:ae(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),Db=G.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return G.createElement(ha,{open:n,onOpenChange:r},G.createElement(ya,{container:o},G.createElement(xa,{"cmdk-overlay":``,className:i}),G.createElement(Ta,{"aria-label":e.label,"cmdk-dialog":``,className:a},G.createElement(xb,{ref:t,...s}))))}),Ob=G.forwardRef((e,t)=>Ib(e=>e.filtered.count===0)?G.createElement(V.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),kb=G.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return G.createElement(V.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},Bb(e,e=>G.createElement(`div`,{"aria-hidden":!0},e)))}),Ab=Object.assign(xb,{List:Eb,Item:Sb,Input:Tb,Group:Cb,Separator:wb,Dialog:Db,Empty:Ob,Loading:kb});function jb(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Mb(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Nb(e){let t=G.useRef(e);return Pb(()=>{t.current=e}),t}var Pb=typeof window>`u`?G.useEffect:G.useLayoutEffect;function Fb(e){let t=G.useRef();return t.current===void 0&&(t.current=e()),t}function Ib(e){let t=yb(),n=()=>e(t.snapshot());return G.useSyncExternalStore(t.subscribe,n,n)}function Lb(e,t,n,r=[]){let i=G.useRef(),a=_b();return Pb(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(mb,s),i.current=s}),i}var Rb=()=>{let[e,t]=G.useState(),n=Fb(()=>/* @__PURE__ */ new Map);return Pb(()=>{n.current.forEach(e=>e()),n.current=/* @__PURE__ */ new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function zb(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function Bb({asChild:e,children:t},n){return e&&G.isValidElement(t)?G.cloneElement(zb(t),{ref:t.ref},n(t.props.children)):n(t)}var Vb={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function Hb(e){let t=/* @__PURE__ */ new Map;for(let n of e)t.has(n.group||``)||t.set(n.group||``,[]),t.get(n.group||``).push(n);return[...t]}function Ub({value:e,onChange:t,items:n,placeholder:r=`Choose…`,searchPlaceholder:a=`Search`,emptyText:o=`Nothing matches`,disabled:s,label:c,className:l}){let[u,d]=(0,G.useState)(!1),{portal:f}=i(),p=n.find(t=>t.value===e);return/* @__PURE__ */ (0,K.jsxs)(zs,{open:u,onOpenChange:d,children:[/* @__PURE__ */ (0,K.jsx)(Vs,{asChild:!0,disabled:s,children:/* @__PURE__ */ (0,K.jsxs)(`button`,{type:`button`,role:`combobox`,"aria-expanded":u,"aria-label":c,className:H(`press flex h-9 w-full items-center justify-between gap-2 rounded-control border border-rule bg-panel px-3 text-left text-body hover:border-muted`,l),children:[/* @__PURE__ */ (0,K.jsx)(`span`,{className:H(`truncate`,!p&&`text-muted`),children:p?p.label:r}),/* @__PURE__ */ (0,K.jsx)(rv,{className:`size-4 shrink-0 text-muted`,"aria-hidden":!0})]})}),/* @__PURE__ */ (0,K.jsx)(Gs,{container:f,children:/* @__PURE__ */ (0,K.jsx)(qs,{align:`start`,sideOffset:6,className:`pop z-50 w-[var(--radix-popover-trigger-width)] min-w-56 overflow-hidden rounded-card border border-rule bg-panel shadow-popover`,children:/* @__PURE__ */ (0,K.jsxs)(Ab,{loop:!0,filter:(e,t)=>+!!e.toLowerCase().includes(t.toLowerCase()),children:[/* @__PURE__ */ (0,K.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-rule px-3`,children:[/* @__PURE__ */ (0,K.jsx)(Uv,{className:`size-4 text-muted`,"aria-hidden":!0}),/* @__PURE__ */ (0,K.jsx)(Ab.Input,{placeholder:a,className:`h-9 w-full bg-transparent text-body outline-none placeholder:text-muted`})]}),/* @__PURE__ */ (0,K.jsxs)(Ab.List,{className:`max-h-72 overflow-y-auto p-1`,children:[/* @__PURE__ */ (0,K.jsx)(Ab.Empty,{className:`px-3 py-6 text-center text-body text-muted`,children:o}),Hb(n).map(([n,r])=>{let i=r.map(n=>/* @__PURE__ */ (0,K.jsxs)(Ab.Item,{value:`${n.label} ${n.hint||``} ${n.value}`,onSelect:()=>{t(n.value),d(!1)},className:`flex cursor-pointer items-center gap-2 rounded-control px-2.5 py-1.5 text-body data-[selected=true]:bg-raise`,children:[/* @__PURE__ */ (0,K.jsx)(Y_,{className:H(`size-3.5 shrink-0`,n.value===e?`opacity-100`:`opacity-0`),"aria-hidden":!0}),/* @__PURE__ */ (0,K.jsx)(`span`,{className:`truncate`,children:n.label}),n.hint&&/* @__PURE__ */ (0,K.jsx)(`span`,{className:`num ml-auto shrink-0 text-label text-muted`,children:n.hint})]},n.value));return n?/* @__PURE__ */ (0,K.jsx)(Ab.Group,{heading:n,className:`[&_[cmdk-group-heading]]:px-2.5 [&_[cmdk-group-heading]]:pt-2 [&_[cmdk-group-heading]]:pb-1 [&_[cmdk-group-heading]]:text-label [&_[cmdk-group-heading]]:text-muted`,children:i},n):i})]})]})})})]})}var Wb=`__empty`,Gb=e=>e===``?Wb:String(e);function Kb({value:e,onChange:t,options:n,label:r,floating:i,className:a}){let o=(0,G.useId)();return/* @__PURE__ */ (0,K.jsx)(Lm,{id:o,children:/* @__PURE__ */ (0,K.jsx)(su,{type:`single`,"aria-label":r,value:Gb(e),onValueChange:e=>{e&&t(e===Wb?``:e)},className:H(`grid auto-cols-fr grid-flow-col rounded-control p-0.5`,i?`material`:`bg-raise`,a),children:n.map(t=>/* @__PURE__ */ (0,K.jsxs)(gu,{value:Gb(t.value),className:`press num relative h-7 rounded-md px-2 text-body text-muted hover:text-ink data-[state=on]:text-ink`,children:[Gb(t.value)===Gb(e)&&/* @__PURE__ */ (0,K.jsx)($h.span,{layoutId:`thumb`,"aria-hidden":!0,className:`absolute inset-0 rounded-md bg-panel shadow-raised`}),/* @__PURE__ */ (0,K.jsx)(`span`,{className:`relative`,children:t.label})]},t.value))})})}var qb={BBL:`Bambu Lab`},Jb=e=>qb[e]||e,Yb=(e,t)=>e.label.localeCompare(t.label,void 0,{numeric:!0,sensitivity:`base`});function Xb(e){let t=/* @__PURE__ */ new Map;for(let n of e){t.has(n.vendor)||t.set(n.vendor,{id:n.vendor,label:Jb(n.vendor),models:/* @__PURE__ */ new Map});let e=t.get(n.vendor);if(!e.models.has(n.model)){let t=e.label.toLowerCase()+` `,r=n.model.toLowerCase().startsWith(t)?n.model.slice(t.length):n.model;e.models.set(n.model,{id:n.model,label:r,nozzles:[]})}e.models.get(n.model).nozzles.push({size:n.nozzleMm,name:n.name})}return[...t.values()].map(e=>({...e,models:[...e.models.values()].map(e=>({...e,nozzles:Zb(e)})).sort(Yb)})).sort(Yb)}function Zb(e){let t=/* @__PURE__ */ new Map;for(let n of e.nozzles)t.set(n.size,(t.get(n.size)||0)+1);let n=t=>(t.toLowerCase().startsWith(e.id.toLowerCase()+` `)?t.slice(e.id.length+1):t).replace(/\bnozzle\b/gi,``).replace(/\s+-\s+/g,` `).replace(/\s+/g,` `).trim();return e.nozzles.map(e=>({...e,label:t.get(e.size)>1?n(e.name):String(e.size)})).sort((e,t)=>e.size-t.size||Yb(e,t))}function Qb(e,t){for(let n of e)for(let e of n.models){let r=e.nozzles.find(e=>e.name===t);if(r)return{brand:n,model:e,nozzle:r}}return null}var $b=e=>e.nozzles.find(e=>e.label===`0.4`)||e.nozzles[0];function ex(e){return e.isLoading?`Loading printers…`:e.error?`The full printer list didn’t load, so only our printers are listed.`:null}function tx({printers:e,ourPrinters:t=[],printer:n,onChange:r}){let i=Ue(),a=e.data,o=(0,G.useMemo)(()=>a&&n?Qb(a,n):null,[a,n]),[s,c]=(0,G.useState)(``),[l,u]=(0,G.useState)(``);(0,G.useEffect)(()=>{o?(c(o.brand.id),u(o.model.id)):n===``&&(c(``),u(``))},[o,n]);let d=a&&a.find(e=>e.id===s),f=d&&d.models.find(e=>e.id===l),p=(e,t=d)=>{let n=t.models.find(t=>t.id===e);u(e),r($b(n).name)},m=e=>{if(e.startsWith(`printer:`))return r(e.slice(8));c(e),u(``);let t=a.find(t=>t.id===e);t.models.length===1?p(t.models[0].id,t):r(null)},h=[...t.map(e=>({...e,group:`Our printers`})),...(a||[]).map(e=>({value:e.id,label:e.label,hint:`${e.models.length} ${e.models.length===1?`model`:`models`}`,group:t.length?`All printers`:void 0}))],g=ex(e),_=t.find(e=>e.value===`printer:${n}`),v=f?`${d.label} ${f.label}`:d?.label??_?.label;return/* @__PURE__ */ (0,K.jsx)(ey,{n:3,title:`Printer`,done:n!==null,aside:v,children:/* @__PURE__ */ (0,K.jsxs)(`div`,{className:`space-y-3`,children:[/* @__PURE__ */ (0,K.jsx)(ty,{label:`Brand`,children:/* @__PURE__ */ (0,K.jsx)(Ub,{label:`Printer brand`,value:o||!_?s:_.value,onChange:m,items:h,searchPlaceholder:`Search brands`,emptyText:`No brand by that name`,disabled:!h.length})}),g&&/* @__PURE__ */ (0,K.jsx)(`p`,{className:`text-body text-muted`,children:g}),/* @__PURE__ */ (0,K.jsx)(jm,{initial:!1,children:d&&/* @__PURE__ */ (0,K.jsxs)($h.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},transition:Le(i),className:`space-y-3 overflow-hidden`,children:[/* @__PURE__ */ (0,K.jsx)(ty,{label:`Model`,children:/* @__PURE__ */ (0,K.jsx)(Ub,{label:`Printer model`,value:l,onChange:e=>p(e),placeholder:`Choose a ${d.label} model`,items:d.models.map(e=>({value:e.id,label:e.label})),searchPlaceholder:`Search models`,emptyText:`No model by that name`})}),f&&/* @__PURE__ */ (0,K.jsx)(ty,{label:`Nozzle`,hint:`mm`,children:/* @__PURE__ */ (0,K.jsx)(Kb,{label:`Nozzle size`,value:n||``,onChange:r,className:f.nozzles.every(e=>e.label.length<=4)?void 0:`flex flex-wrap gap-1`,options:f.nozzles.map(e=>({value:e.name,label:e.label}))})})]},d.id)})]})})}var nx=`__empty`;function rx({value:e,onChange:t,options:n,label:r,className:a}){let{portal:o}=i();return/* @__PURE__ */ (0,K.jsxs)(yc,{value:e===``?nx:e,onValueChange:e=>t(e===nx?``:e),children:[/* @__PURE__ */ (0,K.jsxs)(xc,{"aria-label":r,className:H(`press flex h-9 w-full items-center justify-between gap-2 rounded-control border border-rule bg-panel px-3 text-left text-body hover:border-muted`,a),children:[/* @__PURE__ */ (0,K.jsx)(`span`,{className:`truncate`,children:/* @__PURE__ */ (0,K.jsx)(Cc,{})}),/* @__PURE__ */ (0,K.jsx)(wc,{children:/* @__PURE__ */ (0,K.jsx)(Z_,{className:`size-4 text-muted`,"aria-hidden":!0})})]}),/* @__PURE__ */ (0,K.jsx)(Dc,{container:o,children:/* @__PURE__ */ (0,K.jsx)(kc,{position:`popper`,sideOffset:6,className:`pop z-50 max-h-80 w-[var(--radix-select-trigger-width)] min-w-48 overflow-hidden rounded-card border border-rule bg-panel shadow-popover`,children:/* @__PURE__ */ (0,K.jsx)(Vc,{className:`p-1`,children:n.map(e=>/* @__PURE__ */ (0,K.jsxs)(qc,{value:e.value===``?nx:e.value,className:`relative flex cursor-pointer items-center rounded-control py-1.5 pr-2.5 pl-8 text-body outline-none data-[highlighted]:bg-raise`,children:[/* @__PURE__ */ (0,K.jsx)(Zc,{className:`absolute left-2.5`,children:/* @__PURE__ */ (0,K.jsx)(Y_,{className:`size-3.5`,"aria-hidden":!0})}),/* @__PURE__ */ (0,K.jsx)(Yc,{children:e.label})]},e.value))})})})]})}function ix({settings:e,onChange:t,options:n}){let[r,i]=(0,G.useState)(!1),a=Ue(),o=n.data,s=o?o.materials:[e.material],c=s.map(e=>({value:e,label:e})),l=e.process||e.filament;return/* @__PURE__ */ (0,K.jsx)(ey,{n:4,title:`Material`,done:!0,aside:e.filament||null,children:/* @__PURE__ */ (0,K.jsxs)(`div`,{className:`space-y-3`,children:[/* @__PURE__ */ (0,K.jsx)(ty,{label:`Material`,children:s.length>8?/* @__PURE__ */ (0,K.jsx)(Ub,{label:`Material`,value:e.material,onChange:e=>t({material:e,filament:``}),items:c,searchPlaceholder:`Search materials`}):/* @__PURE__ */ (0,K.jsx)(rx,{label:`Material`,value:e.material,onChange:e=>t({material:e,filament:``}),options:c})}),o&&/* @__PURE__ */ (0,K.jsxs)(`div`,{children:[/* @__PURE__ */ (0,K.jsxs)(`button`,{type:`button`,onClick:()=>i(e=>!e),"aria-expanded":r,className:`press flex items-center gap-1 text-body font-medium text-muted hover:text-ink`,children:[/* @__PURE__ */ (0,K.jsx)($_,{className:H(`size-3.5 transition-transform duration-300 ease-spring motion-reduce:transition-none`,r&&`rotate-90`),"aria-hidden":!0}),`Process and filament presets`,l&&!r?`, changed`:``]}),/* @__PURE__ */ (0,K.jsx)(jm,{initial:!1,children:r&&/* @__PURE__ */ (0,K.jsx)($h.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},transition:Le(a),className:`overflow-hidden`,children:/* @__PURE__ */ (0,K.jsxs)(`div`,{className:`space-y-3 pt-3`,children:[/* @__PURE__ */ (0,K.jsx)(ty,{label:`Process`,children:/* @__PURE__ */ (0,K.jsx)(rx,{label:`Process preset`,value:e.process,onChange:e=>t({process:e}),options:[{value:``,label:`Printer default${o.defaultProcess?` (${o.defaultProcess})`:``}`},...o.processes.map(e=>({value:e,label:e}))]})}),/* @__PURE__ */ (0,K.jsx)(ty,{label:`Filament`,hint:`${o.filaments.length} for ${e.material}`,children:/* @__PURE__ */ (0,K.jsx)(Ub,{label:`Filament preset`,value:e.filament,onChange:e=>t({filament:e}),searchPlaceholder:`Search filaments`,items:[{value:``,label:`Generic ${e.material}`},...o.filaments.map(e=>({value:e.name,label:e.name}))]})})]})})})]})]})})}function ax({label:e,values:t,value:n,onChange:r,format:i,valueText:a=i,defaultValue:o,defaultLabel:s,captions:c,bare:l}){let u=s!==void 0,d=n!==``,f=Math.max(0,t.indexOf(d?Number(n):o));return/* @__PURE__ */ (0,K.jsxs)(`div`,{className:`space-y-1.5`,children:[!l&&/* @__PURE__ */ (0,K.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2`,children:[/* @__PURE__ */ (0,K.jsx)(`span`,{className:`text-body font-semibold`,children:e}),/* @__PURE__ */ (0,K.jsxs)(`span`,{className:`flex items-center gap-1`,children:[/* @__PURE__ */ (0,K.jsx)(`span`,{className:d?`num text-body font-semibold`:`text-body text-muted`,children:d?i(Number(n)):s}),u&&d&&/* @__PURE__ */ (0,K.jsx)(xe,{label:`Back to default`,children:/* @__PURE__ */ (0,K.jsx)(`button`,{type:`button`,onClick:()=>r(``),"aria-label":`${e} back to default`,className:`press grid size-6 place-items-center rounded-md text-muted hover:bg-raise hover:text-ink`,children:/* @__PURE__ */ (0,K.jsx)(Fv,{className:`size-3.5`,"aria-hidden":!0})})})]})]}),/* @__PURE__ */ (0,K.jsxs)(yl,{min:0,max:t.length-1,step:1,value:[f],onValueChange:([e])=>r(t[e]),className:`relative flex h-6 touch-none items-center select-none`,"aria-label":e,children:[/* @__PURE__ */ (0,K.jsx)(El,{className:`relative h-1.5 flex-1 overflow-hidden rounded-full bg-raise`,children:/* @__PURE__ */ (0,K.jsx)(Ol,{className:d?`absolute h-full bg-accent`:`absolute h-full bg-rule`})}),/* @__PURE__ */ (0,K.jsx)(Fl,{"aria-valuetext":d?a(Number(n)):s,className:H(`block size-5 cursor-grab rounded-full border-2 bg-panel transition-[scale] duration-200 ease-spring hover:scale-110 active:scale-110 active:cursor-grabbing motion-reduce:transition-none`,d?`border-accent shadow-raised`:`border-rule`)})]}),c&&/* @__PURE__ */ (0,K.jsx)(`div`,{className:`grid text-label text-muted`,style:{gridTemplateColumns:`repeat(${c.length}, minmax(0, 1fr))`},children:c.map((e,i)=>{let a=i===0?`text-left`:i===c.length-1?`text-right`:`text-center`;return c.length===t.length?/* @__PURE__ */ (0,K.jsx)(`button`,{type:`button`,onClick:()=>r(t[i]),tabIndex:-1,className:`${a} hover:text-ink ${t[i]===Number(n)?`font-semibold text-ink`:``}`,children:e},i):/* @__PURE__ */ (0,K.jsx)(`span`,{className:a,children:e},i)})})]})}var ox={printer:``,material:`PLA`,process:``,filament:``,quality:``,infill:``,walls:``,supports:``},sx=[10,15,20,30,40,50,60,70,80,90];function cx(e,t,n=[0,0,0]){let r={filename:e.name,size:e.size};for(let e of[`printer`,`material`,`process`,`filament`,`quality`,`infill`,`walls`,`mode`])t[e]!=null&&t[e]!==``&&(r[e]=t[e]);return t.supports&&(r.supports=t.supports===`true`),t.gcode&&(r.gcode=!0),t.plate&&(r.plate=!0),[`rotX`,`rotY`,`rotZ`].forEach((e,t)=>{n[t]&&(r[e]=n[t])}),r}var lx=[{id:`PLA`,hint:`Everyday parts, easiest to print`},{id:`PETG`,hint:`Tougher, handles water and some heat`},{id:`ABS`,hint:`Heat-resistant, best in an enclosed printer`},{id:`TPU`,hint:`Flexible, rubber-like`}],ux=[{id:`standard`,label:`Standard`,mm:.2},{id:`medium`,label:`Fine`,mm:.15},{id:`high`,label:`Extra fine`,mm:.1}],dx=[1,2,3,4,5,6],fx={printer:``,material:`PLA`,quality:`standard`,infill:15,walls:3};function px(e){let t=lx.filter(t=>e.includes(t.id)),n=e.filter(e=>!lx.some(t=>t.id===e)).map(e=>({id:e,hint:``}));return[...t,...n]}var mx=(e,t)=>({uploading:`Uploading`,waiting:`Waiting for a free slot`})[e]||t;function hx(e){return/\b(P1S|X1|X1 Carbon|X1E|H2D|H2S|P2S)\b/.test(e)?!0:!/\b(A1|A1 mini|P1P)\b/.test(e)&&null}function gx(e,t){return e===`ABS`&&hx(t)===!1?`ABS can warp on an open-frame printer like ours; PETG is often a better choice.`:null}function _x(e){return e?e.printers.map(t=>({value:`printer:`+t,label:t,...t===e.defaultPrinter?{hint:`default`}:{}})):[]}function vx(e){let t=Math.round(e/60),n=Math.floor(t/60),r=t%60;return n?r?`${n} h ${r} min`:`${n} h`:r?`${r} min`:`under a minute`}var yx=e=>Math.round(e*100)/100;function bx(e,t){return e==null?null:t?{low:Math.floor(yx(e)),high:Math.ceil(yx(e*(100+t)/100))}:{low:e,high:e}}function xx(e,t){if(!t)return{low:e,high:e};let n=bx(e/60,t);return{low:n.low*60,high:n.high*60}}function Sx(e,t){let n=e=>new Intl.NumberFormat(void 0,{style:`currency`,currency:t,minimumFractionDigits:0,maximumFractionDigits:0}).format(e);return e.low===e.high?n(e.low):`${n(e.low)} – ${n(e.high)}`}var Cx=e=>e.low===e.high?`${e.low} g`:`${e.low} – ${e.high} g`;function wx(e){return e.low===e.high?vx(e.low):e.high<3600?`${e.low/60} – ${e.high/60} min`:`${vx(e.low)} – ${vx(e.high)}`}function Tx(e,t,n,r){let i=yx(e.weightG*t),a=e.seconds*t,o=r&&r.range;return{grams:i,seconds:a,currency:n?n.currency:null,range:n?{low:n.min*t,high:n.max*t}:null,gramsRange:bx(i,o),secondsRange:xx(a,o)}}function Ex(e,t){let n=e.map(e=>Tx(e.stats,e.copies,e.price,t)),r=[...new Set(e.filter(e=>!e.price).map(e=>e.material))],i=e=>yx(n.reduce((t,n)=>t+e(n),0)),a=e=>({low:i(t=>t[e].low),high:i(t=>t[e].high)});return{grams:i(e=>e.grams),seconds:n.reduce((e,t)=>e+t.seconds,0),currency:n.map(e=>e.currency).find(Boolean)??null,unpriced:r,range:r.length?null:a(`range`),gramsRange:a(`gramsRange`),secondsRange:a(`secondsRange`)}}var Dx=[{value:``,label:`Default`},{value:`standard`,label:`0.2`},{value:`medium`,label:`0.15`},{value:`high`,label:`0.1`}],Ox=[{value:``,label:`Default`},{value:`false`,label:`Off`},{value:`true`,label:`On`}],kx=e=>`${e} ${e===1?`wall`:`walls`}`;function Ax({settings:e,onChange:t}){return/* @__PURE__ */ (0,K.jsx)(ey,{n:5,title:`Print settings`,done:!0,children:/* @__PURE__ */ (0,K.jsxs)(`div`,{className:`space-y-4`,children:[/* @__PURE__ */ (0,K.jsx)(ty,{label:`Layer height`,hint:`mm`,children:/* @__PURE__ */ (0,K.jsx)(Kb,{label:`Layer height`,value:e.quality,onChange:e=>t({quality:e}),options:Dx})}),/* @__PURE__ */ (0,K.jsx)(ax,{label:`Infill`,values:sx,value:e.infill,onChange:e=>t({infill:e}),format:e=>`${e}%`,defaultValue:15,defaultLabel:`Printer default`}),/* @__PURE__ */ (0,K.jsx)(ax,{label:`Walls`,values:dx,value:e.walls,onChange:e=>t({walls:e}),format:kx,defaultValue:3,defaultLabel:`Printer default`}),/* @__PURE__ */ (0,K.jsx)(ty,{label:`Supports`,children:/* @__PURE__ */ (0,K.jsx)(Kb,{label:`Supports`,value:e.supports,onChange:e=>t({supports:e}),options:Ox})}),/* @__PURE__ */ (0,K.jsx)(`p`,{className:`text-body text-muted`,children:`Default uses the printer’s profile and the shop’s supports setting.`})]})})}function jx(e){let[t,n]=(0,G.useState)(()=>matchMedia(e).matches);return(0,G.useEffect)(()=>{let t=matchMedia(e),r=()=>n(t.matches);return r(),t.addEventListener(`change`,r),()=>t.removeEventListener(`change`,r)},[e]),t}function Mx({theme:e,onTheme:t}){let n=jx(`(prefers-color-scheme: dark)`),r=e===`dark`||e===`system`&&n;return/* @__PURE__ */ (0,K.jsxs)(`button`,{type:`button`,role:`switch`,"aria-checked":r,"aria-label":`Dark theme`,title:r?`Switch to light`:`Switch to dark`,onClick:()=>t(r?`light`:`dark`),className:`press relative inline-flex h-6 w-11 shrink-0 items-center rounded-full bg-raise p-0.5 hover:bg-rule`,children:[/* @__PURE__ */ (0,K.jsx)(`span`,{"aria-hidden":!0,className:H(`absolute top-0.5 left-0.5 size-5 rounded-full bg-accent transition-transform duration-300 ease-spring motion-reduce:transition-none`,r&&`translate-x-5`)}),/* @__PURE__ */ (0,K.jsx)(Gv,{className:H(`relative z-10 m-[3px] size-3.5 transition-colors`,r?`text-muted`:`text-accent-contrast`),"aria-hidden":!0}),/* @__PURE__ */ (0,K.jsx)(jv,{className:H(`relative z-10 m-[3px] size-3.5 transition-colors`,r?`text-accent-contrast`:`text-muted`),"aria-hidden":!0})]})}function Nx(e){let[t,n]=(0,G.useState)(Date.now);return(0,G.useEffect)(()=>{if(!e)return;n(Date.now());let t=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(t)},[e]),e?Math.max(0,Math.round((t-e)/1e3)):0}function Px({plates:e,position:t,settings:n,onSettings:r,printers:i,ourPrinters:a=[],options:o,toSlice:s,slicingSince:c,phase:l,blocker:u,blockerTone:d=`warning`,onSlice:f,onOpenGcode:p,theme:m,onTheme:h}){let g=Nx(c);return/* @__PURE__ */ (0,K.jsxs)(`aside`,{className:`flex flex-col border-rule bg-panel md:min-h-0 md:w-[340px] md:shrink-0 md:border-r lg:w-[380px]`,children:[/* @__PURE__ */ (0,K.jsxs)(`div`,{className:`md:min-h-0 md:flex-1 md:overflow-y-auto`,children:[/* @__PURE__ */ (0,K.jsx)(Hy,{...e}),/* @__PURE__ */ (0,K.jsx)(Ky,{n:2,...t}),/* @__PURE__ */ (0,K.jsx)(tx,{printers:i,ourPrinters:a,printer:n.printer,onChange:e=>r({printer:e,process:``,filament:``})}),/* @__PURE__ */ (0,K.jsx)(ix,{settings:n,onChange:r,options:o}),/* @__PURE__ */ (0,K.jsx)(Ax,{settings:n,onChange:r})]}),/* @__PURE__ */ (0,K.jsxs)(`footer`,{className:`sticky bottom-0 bg-panel px-4 py-3 before:pointer-events-none before:absolute before:inset-x-0 before:-top-6 before:h-6 before:bg-linear-to-t before:from-panel before:to-transparent md:relative`,children:[u&&!c&&/* @__PURE__ */ (0,K.jsx)(sy,{tone:d,className:`mb-2`,children:u}),/* @__PURE__ */ (0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[/* @__PURE__ */ (0,K.jsx)(xe,{label:`Open G-code`,side:`top`,children:/* @__PURE__ */ (0,K.jsx)(ay,{size:`icon`,className:`size-10`,"aria-label":`Open G-code`,onClick:p,children:/* @__PURE__ */ (0,K.jsx)(yv,{className:`size-4`,"aria-hidden":!0})})}),h&&/* @__PURE__ */ (0,K.jsx)(Mx,{theme:m,onTheme:h}),/* @__PURE__ */ (0,K.jsx)(ay,{variant:`primary`,size:`lg`,className:`min-w-0 flex-1 justify-center px-3`,disabled:!!u||!!c,onClick:f,children:c?/* @__PURE__ */ (0,K.jsxs)(K.Fragment,{children:[/* @__PURE__ */ (0,K.jsx)(_t,{className:`size-4 shrink-0 animate-spin`,"aria-hidden":!0}),` `,/* @__PURE__ */ (0,K.jsx)(`span`,{className:`truncate`,children:mx(l,`Slicing`)}),` `,/* @__PURE__ */ (0,K.jsxs)(`span`,{className:`num`,children:[g,` s`]})]}):/* @__PURE__ */ (0,K.jsxs)(K.Fragment,{children:[/* @__PURE__ */ (0,K.jsx)(Tv,{className:`size-4 shrink-0`,"aria-hidden":!0}),` `,/* @__PURE__ */ (0,K.jsx)(`span`,{className:`truncate`,children:s>1?`Slice ${s} plates`:`Slice plate`})]})})]})]})]})}var Fx=e=>{let t=Vt.indexOf(e);return t<0?Vt.length-1:t};function Ix({features:e,hidden:t,onHidden:n,open:r,onOpen:i}){let a=e.reduce((e,t)=>e+t.e,0)||1,o=e.map((e,t)=>({...e,i:t})).sort((e,t)=>Fx(e.name)-Fx(t.name)),s=e.map((e,t)=>t),c=Ue(),l=(e,r)=>{if(e.altKey){let e=t.size===s.length-1&&!t.has(r);n(new Set(e?[]:s.filter(e=>e!==r)))}else{let e=new Set(t);e.has(r)?e.delete(r):e.add(r),n(e)}};return/* @__PURE__ */ (0,K.jsxs)(`div`,{className:H(`material overflow-hidden rounded-card`,r?`w-60`:`w-auto`),children:[/* @__PURE__ */ (0,K.jsxs)(`button`,{type:`button`,onClick:()=>i(!r),"aria-expanded":r,className:`press flex w-full items-center gap-2 px-3 py-2 text-body font-semibold`,children:[`Features`,t.size>0&&/* @__PURE__ */ (0,K.jsxs)(`span`,{className:`num text-label font-normal text-muted`,children:[e.length-t.size,` of `,e.length,` shown`]}),/* @__PURE__ */ (0,K.jsx)(Z_,{className:H(`ml-auto size-4 text-muted transition-transform`,r&&`rotate-180`),"aria-hidden":!0})]}),/* @__PURE__ */ (0,K.jsx)(jm,{initial:!1,children:r&&/* @__PURE__ */ (0,K.jsxs)($h.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:Le(c),children:[/* @__PURE__ */ (0,K.jsx)(`ul`,{className:`px-1.5 pb-1.5`,children:o.map(e=>{let n=t.has(e.i),r=e.e/a*100;return/* @__PURE__ */ (0,K.jsx)(`li`,{children:/* @__PURE__ */ (0,K.jsxs)(`button`,{type:`button`,onClick:t=>l(t,e.i),"aria-pressed":!n,className:H(`flex w-full items-center gap-2 rounded-control px-2 py-1 text-left text-body hover:bg-raise`,n&&`text-muted`),children:[/* @__PURE__ */ (0,K.jsx)(`span`,{className:`size-3 shrink-0 rounded-sm`,style:{background:Bt(e.name),opacity:n?.3:1},"aria-hidden":!0}),/* @__PURE__ */ (0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:W(e.name)}),/* @__PURE__ */ (0,K.jsxs)(`span`,{className:`num text-label text-muted`,children:[r<.1?`<0.1`:r.toFixed(1),`%`]}),n?/* @__PURE__ */ (0,K.jsx)(hv,{className:`size-3.5 text-muted`,"aria-hidden":!0}):/* @__PURE__ */ (0,K.jsx)(_v,{className:`size-3.5 text-muted/60`,"aria-hidden":!0})]})},e.i)})}),/* @__PURE__ */ (0,K.jsx)(`p`,{className:`border-t border-rule px-3 py-2 text-label text-muted`,children:t.size?/* @__PURE__ */ (0,K.jsx)(`button`,{type:`button`,className:`font-medium text-ink underline underline-offset-2`,onClick:()=>n(/* @__PURE__ */ new Set),children:`Show all`}):`Alt-click a feature to see only it`})]})})]})}function Lx(e){let t=e.length?e[e.length-1].z:0,n=[1,2,5,10,20,25,50,100].find(e=>t/e<=10)||200,r=[];for(let i=n;i<=t+1e-6;i+=n){let t=e.findIndex(e=>e.z>=i-1e-6);t>=0&&r.push({z:i,at:e.length>1?t/(e.length-1):0})}return r}function Rx({layer:e,z:t,vertical:n,at:r}){return/* @__PURE__ */ (0,K.jsxs)(`span`,{className:H(`pointer-events-none absolute flex items-baseline gap-1.5 whitespace-nowrap rounded-control bg-ink px-2 py-1 text-ink-contrast shadow-popover`,n?`top-1/2 right-[calc(100%+10px)] -translate-y-1/2`:`bottom-[calc(100%+10px)] left-1/2`),style:n?void 0:{transform:`translateX(-${r*100}%)`},children:[/* @__PURE__ */ (0,K.jsx)(`span`,{className:`num text-body font-semibold`,children:e}),/* @__PURE__ */ (0,K.jsxs)(`span`,{className:`num text-label opacity-70`,children:[t.toFixed(2),` mm`]})]})}function zx({layers:e,fallbackZ:t,value:n,onChange:r,vertical:i}){let a=Math.max(1,e.length),o=(0,G.useMemo)(()=>Lx(e),[e]),s=n=>e[n-1]?e[n-1].z:t,c=e=>a>1?(e-1)/(a-1):0,[l,u]=n;return/* @__PURE__ */ (0,K.jsx)(`div`,{className:H(`material flex rounded-card`,i?`h-full w-14 flex-col items-center py-4`:`h-12 w-full items-center px-4`),children:/* @__PURE__ */ (0,K.jsxs)(yl,{orientation:i?`vertical`:`horizontal`,min:1,max:a,step:1,minStepsBetweenThumbs:0,value:n,onValueChange:r,className:H(`relative flex touch-none select-none`,i?`h-full w-5 flex-col items-center`:`h-5 w-full items-center`),children:[/* @__PURE__ */ (0,K.jsx)(El,{className:H(`relative grow rounded-full bg-raise`,i?`w-1.5`:`h-1.5`),children:/* @__PURE__ */ (0,K.jsx)(Ol,{className:H(`absolute rounded-full bg-ink`,i?`w-full`:`h-full`)})}),o.map(e=>/* @__PURE__ */ (0,K.jsxs)(`span`,{className:H(`pointer-events-none absolute flex items-center gap-1 text-label text-muted`,i?`left-[calc(100%+4px)] -translate-y-1/2`:`top-[calc(100%+3px)] -translate-x-1/2 flex-col`),style:i?{bottom:`${e.at*100}%`}:{left:`${e.at*100}%`},"aria-hidden":!0,children:[/* @__PURE__ */ (0,K.jsx)(`span`,{className:H(`bg-muted/60`,i?`h-px w-1.5`:`h-1.5 w-px`)}),/* @__PURE__ */ (0,K.jsx)(`span`,{className:`num`,children:e.z})]},e.z)),/* @__PURE__ */ (0,K.jsx)(Fl,{"aria-label":`Bottom layer`,className:`relative block size-4 rounded-full border-2 border-ink bg-panel`,children:l>1&&/* @__PURE__ */ (0,K.jsx)(Rx,{layer:l,z:s(l),vertical:i,at:c(l)})}),/* @__PURE__ */ (0,K.jsx)(Fl,{"aria-label":`Top layer`,className:`relative block size-5 rounded-full border-2 border-ink bg-ink`,children:/* @__PURE__ */ (0,K.jsx)(Rx,{layer:u,z:s(u),vertical:i,at:c(u)})})]})})}var Bx=e=>e==null?null:`${+e.toFixed(3)} mm`;function Vx(e){let t=Math.max(0,Math.round(e)),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60;return[n&&`${n}h`,(n||r)&&`${r}m`,`${i}s`].filter(Boolean).join(` `)}function Hx(e){if(!e.bed)return null;let t=e.bed.map(e=>e[0]),n=e.bed.map(e=>e[1]);return[Math.max(...t)-Math.min(...t),Math.max(...n)-Math.min(...n),e.bedHeight].filter(e=>e!=null).map(e=>+e.toFixed(1)).join(` × `)+` mm`}function Ux({value:e,unit:t,label:n}){return/* @__PURE__ */ (0,K.jsxs)(`div`,{className:`min-w-0`,children:[/* @__PURE__ */ (0,K.jsxs)(`p`,{className:`num font-display text-heading leading-none whitespace-nowrap`,children:[e,t&&/* @__PURE__ */ (0,K.jsx)(`span`,{className:`ml-0.5 text-label font-medium text-muted`,children:t})]}),/* @__PURE__ */ (0,K.jsx)(`p`,{className:`mt-1 text-label text-muted`,children:n})]})}function Wx({result:e,quote:t}){let n=e.meta,r=t&&t.used,i=t&&t.stats,a=[[`Sliced with`,n.generatedBy&&n.generatedBy.split(` on `)[0]],[`Printer`,r&&r.printer||n.printer],[`Process`,r&&r.process||n.process],[`Filament`,r&&r.filament||n.filament],[`Material`,n.filamentType],[`Layer height`,Bx(n.layerHeight)],[`Nozzle`,Bx(n.nozzle)],[`Total time`,n.totalTime&&`${n.totalTime} with start and end`],[`Filament volume`,n.filamentCm3!=null&&`${n.filamentCm3} cm³`],[`Bed`,Hx(n)],[`Model size`,i&&i.sizeMm.map(e=>+e.toFixed(1)).join(` × `)+` mm`],[`Model volume`,i&&`${i.volumeCm3} cm³`],[`Watertight`,i&&(i.watertight?`Yes`:`No, results may be off`)]].filter(([,e])=>e);return/* @__PURE__ */ (0,K.jsx)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-4 gap-y-1 text-body`,children:a.flatMap(([e,t])=>[/* @__PURE__ */ (0,K.jsx)(`dt`,{className:`text-muted`,children:e},e),/* @__PURE__ */ (0,K.jsx)(`dd`,{className:`text-right font-medium [overflow-wrap:anywhere]`,children:t},e+`:`)])})}function Gx({result:e,quote:t,thumbnail:n}){let{portal:r}=i(),a=e.meta,o=t&&t.stats,s=a.filamentG??(o&&o.weightG),c=a.printTime||o&&Vx(o.seconds);return/* @__PURE__ */ (0,K.jsxs)(`div`,{className:`material flex w-full items-start gap-3 rounded-card px-3.5 py-2.5 lg:w-auto lg:items-center`,children:[/* @__PURE__ */ (0,K.jsxs)(`div`,{className:`grid flex-1 grid-cols-2 gap-x-6 gap-y-3 sm:grid-cols-4 lg:flex lg:gap-6`,children:[s!=null&&/* @__PURE__ */ (0,K.jsx)(Ux,{value:s,unit:`g`,label:`Weight`}),c&&/* @__PURE__ */ (0,K.jsx)(Ux,{value:c,label:`Print time`}),a.filamentMm!=null&&/* @__PURE__ */ (0,K.jsx)(Ux,{value:(a.filamentMm/1e3).toFixed(2),unit:`m`,label:`Filament`}),/* @__PURE__ */ (0,K.jsx)(Ux,{value:Math.max(1,e.layers.length),label:`Layers`})]}),/* @__PURE__ */ (0,K.jsxs)(zs,{children:[/* @__PURE__ */ (0,K.jsx)(xe,{label:`Print details`,children:/* @__PURE__ */ (0,K.jsx)(Vs,{asChild:!0,children:/* @__PURE__ */ (0,K.jsx)(`button`,{type:`button`,"aria-label":`Print details`,className:`press ml-auto grid size-7 place-items-center rounded-control text-muted hover:bg-raise hover:text-ink`,children:/* @__PURE__ */ (0,K.jsx)(Cv,{className:`size-4`,"aria-hidden":!0})})})}),/* @__PURE__ */ (0,K.jsx)(Gs,{container:r,children:/* @__PURE__ */ (0,K.jsxs)(qs,{side:`top`,align:`start`,sideOffset:10,className:`pop z-50 w-80 rounded-card border border-rule bg-panel p-4 shadow-popover`,children:[/* @__PURE__ */ (0,K.jsx)(`p`,{className:`mb-2.5 font-display text-heading`,children:`Print details`}),n&&/* @__PURE__ */ (0,K.jsx)(`img`,{src:n,alt:`The sliced plate`,className:`mb-2.5 aspect-[4/3] w-full rounded-control bg-viewer object-contain`}),/* @__PURE__ */ (0,K.jsx)(Wx,{result:e,quote:t})]})})]})]})}function Kx(){let{layout:e}=i(),[t,n]=(0,G.useState)(()=>({width:e.clientWidth,height:e.clientHeight}));return(0,G.useEffect)(()=>{let t=new ResizeObserver(()=>n(t=>t.width===e.clientWidth&&t.height===e.clientHeight?t:{width:e.clientWidth,height:e.clientHeight}));return t.observe(e),()=>t.disconnect()},[e]),t}var qx=(0,G.lazy)(()=>import(`./chunks/Viewer3D-MGmKZLAb.js`)),Jx=(0,G.lazy)(()=>import(`./chunks/PlateEditor-pZVMpN8B.js`)),Yx=[{value:`iso`,label:`3D`},{value:`top`,label:`Top`},{value:`front`,label:`Front`}];function Xx({children:e}){return/* @__PURE__ */ (0,K.jsx)($h.div,{initial:{opacity:0,scale:.96},animate:{opacity:1,scale:1},className:`material-thick absolute top-1/2 left-1/2 z-20 w-[min(340px,calc(100%-32px))] -translate-x-1/2 -translate-y-1/2 rounded-tile p-5 text-center`,children:e})}function Zx({slicing:e}){let t=Ue();return/* @__PURE__ */ (0,K.jsxs)(Xx,{children:[/* @__PURE__ */ (0,K.jsx)(_t,{className:`mx-auto size-6 animate-spin text-muted`,"aria-hidden":!0}),/* @__PURE__ */ (0,K.jsx)(`p`,{className:`mt-2.5 font-display text-heading`,children:e.title}),/* @__PURE__ */ (0,K.jsx)(`p`,{className:`mt-0.5 text-body text-muted`,children:e.printer}),/* @__PURE__ */ (0,K.jsx)(`div`,{className:`mt-3.5 h-1 overflow-hidden rounded-full bg-raise`,children:t?/* @__PURE__ */ (0,K.jsx)(`div`,{className:`h-full w-full animate-pulse rounded-full bg-ink/40`}):/* @__PURE__ */ (0,K.jsx)($h.div,{className:`h-full w-1/3 rounded-full bg-ink`,animate:{x:[`-100%`,`300%`]},transition:{repeat:1/0,duration:1.4,ease:`easeInOut`}})})]})}function Qx({title:e,text:t,onChooseModel:n,onOpenGcode:r}){return/* @__PURE__ */ (0,K.jsx)(`div`,{className:`pointer-events-none absolute inset-0 grid place-items-center p-6`,children:/* @__PURE__ */ (0,K.jsxs)($h.div,{initial:{opacity:0,scale:.96},animate:{opacity:1,scale:1},className:`material-thick pointer-events-auto max-w-xs rounded-tile p-5 text-center`,children:[/* @__PURE__ */ (0,K.jsx)(Tv,{className:`mx-auto size-8 text-muted`,strokeWidth:1.5,"aria-hidden":!0}),/* @__PURE__ */ (0,K.jsx)(`p`,{className:`mt-2.5 font-display text-heading`,children:e}),/* @__PURE__ */ (0,K.jsx)(`p`,{className:`mt-1 text-body text-muted`,children:t}),/* @__PURE__ */ (0,K.jsxs)(`div`,{className:`mt-3.5 flex flex-wrap justify-center gap-2`,children:[n&&/* @__PURE__ */ (0,K.jsxs)(ay,{variant:`primary`,onClick:n,children:[/* @__PURE__ */ (0,K.jsx)(qv,{className:`size-4`,"aria-hidden":!0}),` Choose models`]}),/* @__PURE__ */ (0,K.jsxs)(ay,{onClick:r,children:[/* @__PURE__ */ (0,K.jsx)(yv,{className:`size-4`,"aria-hidden":!0}),` Open G-code`]})]})]})})}function $x({mode:e,onMode:t}){return/* @__PURE__ */ (0,K.jsx)(Kb,{label:`Prepare or preview`,value:e,onChange:t,floating:!0,className:`w-44`,options:[{value:`prepare`,label:`Prepare`},{value:`preview`,label:`Preview`}]})}function eS({gcode:e,slicing:t,mode:n,onMode:r,editor:i,emptyPlate:a,note:o,onChooseModel:s,onOpenGcode:c}){let{status:l,result:u}=e,d=l===`ready`,f=Kx(),p=f.width>=1024,m=f.height<520,h=f.width<768?Math.max(300,Math.round(Math.min(f.height,window.innerHeight)*.58)):void 0,g=Ue(),[_,v]=(0,G.useState)([1,1]),[y,b]=(0,G.useState)(()=>/* @__PURE__ */ new Set),[x,S]=(0,G.useState)(!1),[C,w]=(0,G.useState)(`iso`),[T,E]=(0,G.useState)(0),[D,O]=(0,G.useState)(p&&!m),k=(0,G.useRef)(null);(0,G.useEffect)(()=>{if(!u)return;let e=Math.max(1,u.layers.length);if(b(/* @__PURE__ */ new Set),w(`iso`),g||e<3){v([1,e]);return}v([1,1]);let t=Te(1,e,{duration:1.2,ease:[.22,1,.36,1],onUpdate:e=>v([1,Math.round(e)])});return k.current=t,()=>t.stop()},[u,g]);let A=n===`preview`,j=A&&d,M=(0,G.useMemo)(()=>e.download?URL.createObjectURL(e.download):null,[e.download]);return(0,G.useEffect)(()=>()=>{M&&URL.revokeObjectURL(M)},[M]),/* @__PURE__ */ (0,K.jsxs)(`div`,{className:`relative flex min-h-0 flex-col md:h-full`,children:[/* @__PURE__ */ (0,K.jsxs)(`div`,{className:`relative overflow-hidden bg-viewer md:flex-1`,style:{height:h},children:[j&&/* @__PURE__ */ (0,K.jsx)(`div`,{className:`absolute inset-0`,children:/* @__PURE__ */ (0,K.jsx)(G.Suspense,{fallback:null,children:/* @__PURE__ */ (0,K.jsx)(qx,{result:u,layerMin:_[0]-1,layerMax:_[1]-1,hidden:y,showTravels:x,view:C,fitKey:T})})}),!A&&i&&/* @__PURE__ */ (0,K.jsx)(G.Suspense,{fallback:null,children:/* @__PURE__ */ (0,K.jsx)(Jx,{...i})}),!A&&a&&!t&&/* @__PURE__ */ (0,K.jsx)(Qx,{title:`Put models on the plate`,onChooseModel:s,onOpenGcode:c,text:`Drop models anywhere, or choose them. Each lands where there is room.`}),!A&&o&&!t&&/* @__PURE__ */ (0,K.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 top-16 z-10 flex justify-center px-4`,children:/* @__PURE__ */ (0,K.jsx)(`p`,{className:`material max-w-md rounded-card px-3 py-2 text-center text-body text-muted`,children:o})}),A&&l===`empty`&&!t&&/* @__PURE__ */ (0,K.jsx)(Qx,{title:`Slice a plate to see how it prints`,onOpenGcode:c,text:`Its G-code shows here, layer by layer. Or open G-code, or a sliced 3MF.`}),t&&/* @__PURE__ */ (0,K.jsx)(Zx,{slicing:t}),A&&l===`loading`&&!t&&/* @__PURE__ */ (0,K.jsxs)(Xx,{children:[/* @__PURE__ */ (0,K.jsxs)(`p`,{className:`truncate font-display text-heading`,children:[`Reading `,e.name]}),/* @__PURE__ */ (0,K.jsx)(`div`,{className:`mt-3.5 h-1 overflow-hidden rounded-full bg-raise`,children:/* @__PURE__ */ (0,K.jsx)(`div`,{className:`h-full rounded-full bg-ink transition-[width]`,style:{width:`${Math.round(e.progress*100)}%`}})})]}),A&&l===`error`&&!t&&/* @__PURE__ */ (0,K.jsxs)(Xx,{children:[/* @__PURE__ */ (0,K.jsx)(yt,{className:`mx-auto size-6 text-danger`,"aria-hidden":!0}),/* @__PURE__ */ (0,K.jsx)(`p`,{className:`mt-2.5 text-body`,role:`alert`,children:e.error}),/* @__PURE__ */ (0,K.jsxs)(`div`,{className:`mt-3.5 flex justify-center gap-2`,children:[/* @__PURE__ */ (0,K.jsx)(ay,{onClick:c,children:`Open another file`}),/* @__PURE__ */ (0,K.jsx)(ay,{variant:`ghost`,onClick:e.close,children:`Close`})]})]}),/* @__PURE__ */ (0,K.jsxs)(`div`,{className:`absolute top-3 left-3 z-20 flex flex-col items-start gap-2`,children:[/* @__PURE__ */ (0,K.jsx)($x,{mode:n,onMode:r}),j&&/* @__PURE__ */ (0,K.jsx)(Ix,{features:u.features,hidden:y,onHidden:b,open:D,onOpen:O})]}),j&&/* @__PURE__ */ (0,K.jsxs)(K.Fragment,{children:[/* @__PURE__ */ (0,K.jsxs)(`div`,{className:`absolute top-3 right-3 z-10 flex flex-col items-end gap-2 sm:flex-row sm:items-center`,children:[/* @__PURE__ */ (0,K.jsx)(Kb,{label:`View`,value:C,onChange:e=>{w(e),E(e=>e+1)},options:Yx,floating:!0,className:`w-36`}),/* @__PURE__ */ (0,K.jsxs)(qe,{children:[/* @__PURE__ */ (0,K.jsx)(rt,{label:x?`Hide travel moves`:`Show travel moves`,pressed:x,onClick:()=>S(e=>!e),children:/* @__PURE__ */ (0,K.jsx)(Lv,{className:`size-4`,"aria-hidden":!0})}),/* @__PURE__ */ (0,K.jsx)(rt,{label:`Fit to model`,onClick:()=>E(e=>e+1),children:/* @__PURE__ */ (0,K.jsx)(Vv,{className:`size-4`,"aria-hidden":!0})})]})]}),/* @__PURE__ */ (0,K.jsx)(`div`,{className:p?`absolute top-[72px] right-3 bottom-28 z-10`:`absolute inset-x-3 bottom-3 z-10`,children:/* @__PURE__ */ (0,K.jsx)(zx,{layers:u.layers,fallbackZ:u.bounds?u.bounds.max[2]:0,value:_,vertical:p,onChange:e=>{k.current?.stop(),v(e)}})})]})]}),j&&/* @__PURE__ */ (0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 border-t border-rule bg-panel p-3 lg:absolute lg:bottom-3 lg:left-3 lg:z-10 lg:max-w-[calc(100%-110px)] lg:flex-nowrap lg:border-0 lg:bg-transparent lg:p-0`,children:[/* @__PURE__ */ (0,K.jsxs)(`div`,{className:`material flex min-w-0 items-center gap-1 rounded-card py-1 pr-1 pl-2.5`,children:[/* @__PURE__ */ (0,K.jsx)(yv,{className:`size-3.5 shrink-0 text-muted`,"aria-hidden":!0}),/* @__PURE__ */ (0,K.jsx)(`span`,{className:`max-w-56 truncate text-body font-medium`,title:e.name,children:e.name}),M&&/* @__PURE__ */ (0,K.jsx)(xe,{label:`Download G-code`,children:/* @__PURE__ */ (0,K.jsx)(`a`,{href:M,download:e.name,"aria-label":`Download G-code`,className:`press grid size-7 place-items-center rounded-control text-muted hover:bg-raise hover:text-ink`,children:/* @__PURE__ */ (0,K.jsx)(dv,{className:`size-4`,"aria-hidden":!0})})}),/* @__PURE__ */ (0,K.jsx)(xe,{label:`Close`,children:/* @__PURE__ */ (0,K.jsx)(`button`,{type:`button`,"aria-label":`Close file`,onClick:e.close,className:`press grid size-7 place-items-center rounded-control text-muted hover:bg-raise hover:text-ink`,children:/* @__PURE__ */ (0,K.jsx)(Yv,{className:`size-4`,"aria-hidden":!0})})})]}),/* @__PURE__ */ (0,K.jsx)(Gx,{result:u,quote:e.quote,thumbnail:e.thumbnail})]})]})}var tS=(e,t)=>`${String(e||``).replace(/\/+$/,``)}${t}`;async function nS(e,{body:t,csrf:n,...r}={}){let i={Accept:`application/json`};t&&(i[`Content-Type`]=`application/json`),n&&(i[`X-CSRF-TOKEN`]=n);let a=await fetch(e,{...r,headers:i,...t&&{body:JSON.stringify(t)}}).catch(()=>{throw Error(`The server can’t be reached.`)}),o=null;try{o=await a.json()}catch{}if(!a.ok){let e=Number(a.headers.get(`Retry-After`))||void 0;throw Object.assign(Error(o&&o.message||`Request failed (HTTP ${a.status})`),{status:a.status,retryAfter:e})}return o}var rS=e=>({401:`Sign in to slice`,403:`Your account can’t slice models`,419:`Your session has expired. Reload the page`})[e]||null;function iS(e,t){return e?t.error?t.error.status===503?`Slicing is off on this server`:rS(t.error.status)||`The server can’t be reached`:t.data&&!t.data.slicer?`Slicing is off on this server`:null:`Slicing isn’t set up on this page`}var aS=[`process`,`model`,`files`,`material`,`strength`,`cost`,`contact`],oS=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function sS(e){if(typeof e!=`string`||!e.trim())return null;try{let{protocol:t}=new URL(e.trim(),`https://page.invalid/`);return t===`https:`||t===`http:`?e.trim():null}catch{return null}}function cS(e,t=e=>console.warn(`slicer-studio: ${e}`)){let n=e;if(typeof e==`string`){if(!e.trim())return{};try{n=JSON.parse(e)}catch(e){return t(`config is not valid JSON: ${e.message}`),{}}}if(n==null)return{};if(!oS(n))return t(`config must be an object`),{};let{realtime:r,staffApi:i,contact:a,defaultPrinter:o,defaults:s,cards:c,button:l,advanced:u,...d}=n;for(let e of Object.keys(d))t(`unknown config key "${e}" left out`);let f={};if(r!==void 0){let{key:e,host:n,port:i,cluster:a,tls:o}=oS(r)?r:{};typeof e==`string`&&e.trim()?(f.realtime={key:e.trim()},typeof n==`string`&&n.trim()&&(f.realtime.host=n.trim()),Number.isInteger(i)&&i>0&&(f.realtime.port=i),typeof a==`string`&&a.trim()&&(f.realtime.cluster=a.trim()),typeof o==`boolean`&&(f.realtime.tls=o)):t(`realtime left out: it needs a key`)}if(i!==void 0){let{url:e,csrfToken:n}=oS(i)?i:{};typeof e==`string`&&e.trim()?f.staffApi={url:e.trim(),csrfToken:typeof n==`string`?n.trim():``}:t(`staffApi left out: it needs a url`)}if(oS(a)&&(f.contact={},typeof a.name==`string`&&(f.contact.name=a.name.trim()),typeof a.email==`string`&&a.email.includes(`@`)?f.contact.email=a.email.trim():a.email!==void 0&&t(`contact.email "${a.email}" left out: it is not an email address`)),typeof o==`string`&&o.trim()&&(f.defaultPrinter=o.trim()),oS(s)){f.defaults={},typeof s.material==`string`&&(f.defaults.material=s.material.toUpperCase());let e=(e,n)=>{n.includes(s[e])?f.defaults[e]=s[e]:s[e]!==void 0&&t(`defaults.${e} left out: it must be one of ${n.join(`, `)}`)};e(`quality`,ux.map(e=>e.id)),e(`infill`,sx),e(`walls`,dx)}if(Array.isArray(c)){f.cards=c.filter(e=>aS.includes(e));for(let e of c)aS.includes(e)||t(`card "${e}" left out: it must be one of ${aS.join(`, `)}`);!f.cards.includes(`model`)&&!f.cards.includes(`files`)&&(t(`cards need model or files, or there is nowhere to add a file: keeping model`),f.cards.push(`model`))}if(l!==void 0){let e=oS(l)&&typeof l.label==`string`?l.label.trim():``;if(!e||e.length>40)t(`button left out: it needs a label of 1 to 40 characters`);else if(f.button={label:e},l.url!==void 0){let e=sS(l.url);e?f.button.url=e:t(`button.url "${l.url}" left out: it must be an http(s) or relative address`)}}if(u!==void 0){let e=e=>{let n=oS(u)?u[e]:void 0;return typeof n==`string`&&n.trim()?n.trim():(t(`advanced.${e} must be a URL: Advanced stays closed until it is`),``)};f.advanced={authUrl:e(`authUrl`),verifyUrl:e(`verifyUrl`)}}return f}var lS=e=>new Set(e.cards||aS);function uS(e,t){return{...e,defaultPrinter:t.defaultPrinter||e.defaultPrinter||e.printers&&e.printers[0]||``,regularMode:{...e.regularMode},contact:{...e.contact,...t.contact}}}var dS=5e3,fS=3e4,pS=/* @__PURE__ */ new Map;async function mS({key:t,host:n,port:r=443,cluster:i=`mt1`,tls:a=!0}){let{default:o}=await import(`./chunks/pusher-BoV3x8Qs.js`).then(t=>/* @__PURE__ */ e(t.default,1));return new o(t,{cluster:i,wsHost:n,wsPort:r,wssPort:r,forceTLS:a,enabledTransports:[`ws`,`wss`],disableStats:!0})}function hS(e,t){let n=JSON.stringify(e),r=pS.get(n)||{pusher:t(e),users:0,idle:null};return pS.set(n,r),clearTimeout(r.idle),r.users++,{pusher:r.pusher,release:()=>{--r.users||(r.idle=setTimeout(()=>{pS.delete(n),r.pusher.then(e=>e.disconnect(),()=>{})},fS))}}}function gS(e,t,n,r,i=mS){if(!e)return{ready:Promise.resolve(!1),close:()=>{}};let{pusher:a,release:o}=hS(e,i),s=()=>{};return{ready:a.then(e=>new Promise(i=>{let a=e.subscribe(t),o=null,c=t=>{o!==null&&(clearTimeout(o),o=null,e.connection.bind(`connected`,r),i(t))};o=setTimeout(()=>c(!1),dS),a.bind(`quote.updated`,n),a.bind(`pusher:subscription_succeeded`,()=>c(!0)),a.bind(`pusher:subscription_error`,()=>c(!1)),s=()=>{e.connection.unbind(`connected`,r),a.unbind(),e.unsubscribe(t)}})).catch(()=>!1),close:()=>{s(),o()}}}var _S=6e4,vS=[1e3,2e3,4e3,8e3,15e3,3e4],yS=54e5,bS=60,xS=(e,t)=>t?_S:vS[e]??_S;async function SS(e,t,n,r){let i=()=>nS(e(`/quotes`),{method:`POST`,body:n,csrf:t});try{return await i()}catch(e){if(!e.retryAfter||e.retryAfter>bS)throw e;return r(`waiting`),await new Promise(t=>setTimeout(t,e.retryAfter*1e3)),i()}}async function CS({url:e,fields:t},n){let r=new FormData;Object.entries(t).forEach(([e,t])=>r.append(e,t)),r.append(`file`,n);let i=await fetch(e,{method:`POST`,body:r}).catch(()=>null);if(!i||!i.ok)throw Error(`The file could not be uploaded, please try again`)}async function wS({base:e,csrf:t,realtime:n,file:r,settings:i,rot:a,onStep:o=()=>{},watch:s=gS}){let c=t=>tS(e,t),l=await SS(c,t,cx(r,i,a),o);o(`uploading`);let u,d,f=new Promise((e,t)=>{u=e,d=t});f.catch(()=>{});let p=async()=>{try{let e=await nS(c(`/quotes/${l.id}`));(e.status===`done`||e.status===`failed`)&&u(e)}catch(e){e.status===404?d(/* @__PURE__ */ Error(`This quote has expired, please try again`)):e.status>=400&&e.status<500&&e.status!==429&&d(e)}},m=s(n,l.channel,p,p),h,g,_=!1,v=(e,t)=>{h=setTimeout(async()=>{await p(),_||v(e+1,t)},xS(e,t))};try{let e=await m.ready;e||console.warn(`slicer-studio: live updates are off, so prices are checked every few seconds at first, then each minute. Check the realtime option and connect-src.`),await CS(l.upload,r),o(`working`),await nS(c(`/quotes/${l.id}/start`),{method:`POST`,csrf:t}).catch(e=>{if(e.status!==409)throw e}),v(0,e),g=setTimeout(()=>d(/* @__PURE__ */ Error(`This is taking too long, please try again`)),yS);let n=await f;if(n.status===`failed`)throw Error(n.errorDetail||n.error||`This model could not be priced`);return n}finally{_=!0,clearTimeout(h),clearTimeout(g),m.close()}}async function TS(e,t){let n=await fetch(tS(e,`/quotes/${t}/gcode`)).catch(()=>null);if(!n||!n.ok)throw Error(`The G-code could not be downloaded`);return n.blob()}var ES=()=>{let{apiUrl:e}=i();return t=>tS(e,t)};function DS(){let e=ES(),{config:t}=i();return gr({queryKey:[`config`],queryFn:()=>nS(e(`/config`)),select:e=>uS(e,t)})}function OS(e){let t=ES();return gr({queryKey:[`materials`,e],queryFn:()=>nS(t(`/options?printer=${encodeURIComponent(e)}`)),enabled:!!e})}function kS(){let{apiUrl:e,config:t}=i();return _r({mutationFn:({model:n,settings:r,rot:i,onStep:a})=>wS({base:e,realtime:t.realtime,file:n,settings:r,rot:i,onStep:a})})}function AS(){let{staffApi:e}=i().config;return gr({queryKey:[`health`,e?.url],queryFn:()=>nS(tS(e.url,`/health`)),enabled:!!e,staleTime:6e4})}function jS(){let{staffApi:e}=i().config;return gr({queryKey:[`printers`,e?.url],queryFn:()=>nS(tS(e.url,`/printers`)),enabled:!!e,select:e=>Xb(e.printers)})}function MS(e,t){let{staffApi:n}=i().config;return gr({queryKey:[`options`,n?.url,e,t],queryFn:()=>nS(tS(n.url,`/options?printer=${encodeURIComponent(e)}&material=${encodeURIComponent(t)}`)),enabled:!!n&&!!e,placeholderData:t=>t&&t.printer===e?t:void 0})}var NS=(e,t)=>({queryKey:[`bed`,e?.url,t],queryFn:()=>nS(tS(e.url,`/options?printer=${encodeURIComponent(t)}`)),enabled:!!e&&!!t});function PS(e){let{staffApi:t}=i().config,n=mr({queries:e.map(e=>NS(t,e))}),r=e.map((e,t)=>[e,n[t].data&&n[t].data.bed]).filter(([,e])=>e),a=JSON.stringify(r);return(0,G.useMemo)(()=>Object.fromEntries(r),[a])}function FS(){let{staffApi:e,realtime:t}=i().config;return _r({mutationFn:async({model:n,settings:r,rot:i,onStep:a})=>{let{url:o,csrfToken:s}=e,c=await wS({base:o,csrf:s,realtime:t,file:n,settings:{...r,mode:`exact`,gcode:!0},rot:i,onStep:a});if(!c.hasGcode)throw Error(`No G-code came back for this model`);return{...c,gcode:await TS(o,c.id)}}})}var IS='const e=Math.PI/18,t=1e-9;var n=class{constructor(e,t=4096){this.Type=e,this.a=new e(t),this.n=0}push(e){if(this.n===this.a.length){let e=new this.Type(this.n*2);e.set(this.a),this.a=e}this.a[this.n++]=e}done(){return this.a.slice(0,this.n)}};const r=e=>{let t=parseFloat(e);return Number.isFinite(t)?t:null},i=e=>Math.round(e*1e4)/1e4;function a(e){let t={};for(let[,n,r]of e.matchAll(/([A-Za-z])\\s*([-+]?(?:\\d+\\.?\\d*|\\.\\d+))/g))t[n.toUpperCase()]=Number(r);return t}function o(o,s){let c=/^;\\s*(?:CHANGE_LAYER|LAYER_CHANGE)\\s*$/m.test(o),l={start:new n(Float32Array),end:new n(Float32Array),feature:new n(Uint8Array),layer:new n(Float32Array),width:new n(Float32Array),height:new n(Float32Array)},u={pos:new n(Float32Array),layer:new n(Float32Array)},d=[],f=[],p=/* @__PURE__ */ new Map,m={},h={},g=[1/0,1/0,1/0],_=[-1/0,-1/0,-1/0],v=0,y=0,b=0,x=0,S=!1,C=!1,w=-1,T=null,E=null,D=!1,O=!1,k=()=>Math.max(0,d.length-1),A=e=>(p.has(e)||(p.set(e,f.length),f.push({name:e,e:0})),p.get(e));function j(e,t,n,a,o,s,u){if(!c&&(!d.length||Math.abs(s-d[d.length-1].z)>1e-4)){let e=d.length?d[d.length-1].z:0;d.push({z:i(s),height:i(Math.abs(s-e))})}w<0&&(w=A(`Custom`)),f[w].e+=u,l.start.push(e),l.start.push(t),l.start.push(n),l.end.push(a),l.end.push(o),l.end.push(s),l.feature.push(w),l.layer.push(k()),l.width.push(T??r(m.nozzle_diameter)??.4),l.height.push(E??r(m.layer_height)??.2),M(0,e),M(1,t),M(2,n),M(0,a),M(1,o),M(2,s)}function M(e,t){t<g[e]&&(g[e]=t),t>_[e]&&(_[e]=t)}function N(e,t,n,r,i,a){for(let o of[e,t,n,r,i,a])u.pos.push(o);u.layer.push(k())}function P(e,n,r,i,a,o,s){s>t&&(Math.abs(i-e)>t||Math.abs(a-n)>t)?j(e,n,r,i,a,o,s):(Math.abs(i-e)>t||Math.abs(a-n)>t||Math.abs(o-r)>t)&&N(e,n,r,i,a,o)}function F(e){let t;if(/^;\\s*(?:CHANGE_LAYER|LAYER_CHANGE)\\s*$/.test(e))d.push({z:i(b),height:E??r(m.layer_height)??.2}),D=O=!1;else if(t=e.match(/^;\\s*(?:Z_HEIGHT|Z):\\s*([-+\\d.]+)/))c&&d.length&&!D&&(d[d.length-1].z=r(t[1]),D=!0);else if(t=e.match(/^;\\s*(?:LAYER_HEIGHT|HEIGHT):\\s*([\\d.]+)/))E=r(t[1]),c&&d.length&&!O&&(d[d.length-1].height=E,O=!0);else if(t=e.match(/^;\\s*(?:FEATURE|TYPE):\\s*(.+?)\\s*$/))w=A(t[1]);else if(t=e.match(/^;\\s*(?:LINE_WIDTH|WIDTH):\\s*([\\d.]+)/))T=r(t[1]);else if(t=e.match(/^;\\s*(?:total )?filament used \\[(g|mm|cm3)\\]\\s*=\\s*([\\d.]+)/)){let e={g:`filamentG`,mm:`filamentMm`,cm3:`filamentCm3`}[t[1]];h[e]??(h[e]=r(t[2]))}else(t=e.match(/^;\\s*(\\w+)\\s*=\\s*(.*?)\\s*$/))?m[t[1]]=t[2].replace(/^"(.*)"$/,`$1`):(t=e.match(/^;\\s*generated by\\s+(.+?)\\s*$/i))?h.generatedBy=t[1]:/printing time/i.test(e)&&((t=e.match(/model printing time:\\s*([^;]+)/i))&&(h.printTime=t[1].trim()),(t=e.match(/total estimated time:\\s*([^;]+)/i))&&(h.totalTime=t[1].trim()),(t=e.match(/estimated printing time \\(normal mode\\)\\s*=\\s*(.+)/i))&&!h.printTime&&(h.printTime=t[1].trim()))}function I(n,r){let i=`X`in r?S?v+r.X:r.X:v,a=`Y`in r?S?y+r.Y:r.Y:y,o=`Z`in r?S?b+r.Z:r.Z:b,s=0;if(`E`in r){let e=S||C;s=e?r.E:r.E-x,x=e?x+r.E:r.E}if(!((n===2||n===3)&&(`I`in r||`J`in r)))P(v,y,b,i,a,o,s);else{let c=v+(r.I||0),l=y+(r.J||0),u=Math.hypot(v-c,y-l),d=Math.atan2(y-l,v-c),f=Math.atan2(a-l,i-c)-d;n===3&&f<=t&&(f+=2*Math.PI),n===2&&f>=-1e-9&&(f-=2*Math.PI);let p=Math.max(1,Math.ceil(Math.max(Math.abs(f)*u/1,Math.abs(f)/e))),m=v,h=y,g=b;for(let e=1;e<=p;e++){let t=d+f*e/p,n=e===p?i:c+u*Math.cos(t),r=e===p?a:l+u*Math.sin(t),_=b+(o-b)*e/p;P(m,h,g,n,r,_,s/p),m=n,h=r,g=_}}v=i,y=a,b=o}let L=0,R=0;for(;L<o.length;){let e=o.indexOf(`\n`,L);e<0&&(e=o.length);let t=o.slice(L,e).trim();if(L=e+1,s&&++R%5e4==0&&s(L/o.length),!t)continue;if(t[0]===`;`){F(t);continue}let n=t.indexOf(`;`),r=(n<0?t:t.slice(0,n)).trim(),i=r.match(/^([GMgm])(\\d+(?:\\.\\d+)?)(?=\\s|$)/);if(!i||i[2].includes(`.`))continue;let c=i[1].toUpperCase(),l=Number(i[2]);if(c===`G`&&l<=3)I(l,a(r.slice(i[0].length)));else if(c===`G`&&l===90)S=!1;else if(c===`G`&&l===91)S=!0;else if(c===`M`&&l===82)C=!1;else if(c===`M`&&l===83)C=!0;else if(c===`G`&&l===92){let e=a(r.slice(i[0].length));Object.keys(e).length||(v=y=b=x=0),`X`in e&&(v=e.X),`Y`in e&&(y=e.Y),`Z`in e&&(b=e.Z),`E`in e&&(x=e.E)}}s&&s(1);let z=m.printable_area?m.printable_area.split(`,`).map(e=>e.split(`x`).map(Number)):null;return Object.assign(h,{generatedBy:h.generatedBy??null,printer:m.printer_settings_id||null,process:m.print_settings_id||null,filament:m.filament_settings_id||null,filamentType:m.filament_type||null,nozzle:r(m.nozzle_diameter),layerHeight:r(m.layer_height),bed:z&&z.every(e=>e.length===2&&e.every(Number.isFinite))?z:null,bedHeight:r(m.printable_height),printTime:h.printTime??null,totalTime:h.totalTime??null,filamentG:h.filamentG??null,filamentMm:h.filamentMm??null,filamentCm3:h.filamentCm3??null}),{segments:{count:l.feature.n,start:l.start.done(),end:l.end.done(),feature:l.feature.done(),layer:l.layer.done(),width:l.width.done(),height:l.height.done()},travels:{count:u.layer.n,pos:u.pos.done(),layer:u.layer.done()},layers:d,features:f,meta:h,bounds:l.feature.n?{min:g,max:_}:null}}\n/*!\nfflate - fast JavaScript compression/decompression\n<https://101arrowz.github.io/fflate>\nLicensed under MIT. https://github.com/101arrowz/fflate/blob/master/LICENSE\nversion 0.8.2\n*/\nvar s=Uint8Array,c=Uint16Array,l=Int32Array,u=new s([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),d=new s([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),f=new s([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),p=function(e,t){for(var n=new c(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new l(n[30]),r=1;r<30;++r)for(var a=n[r];a<n[r+1];++a)i[a]=a-n[r]<<5|r;return{b:n,r:i}},m=p(u,2),h=m.b,g=m.r;h[28]=258,g[258]=28;var _=p(d,0),v=_.b;_.r;for(var y=new c(32768),b=0;b<32768;++b){var x=(b&43690)>>1|(b&21845)<<1;x=(x&52428)>>2|(x&13107)<<2,x=(x&61680)>>4|(x&3855)<<4,y[b]=((x&65280)>>8|(x&255)<<8)>>1}for(var S=(function(e,t,n){for(var r=e.length,i=0,a=new c(t);i<r;++i)e[i]&&++a[e[i]-1];var o=new c(t);for(i=1;i<t;++i)o[i]=o[i-1]+a[i-1]<<1;var s;if(n){s=new c(1<<t);var l=15-t;for(i=0;i<r;++i)if(e[i])for(var u=i<<4|e[i],d=t-e[i],f=o[e[i]-1]++<<d,p=f|(1<<d)-1;f<=p;++f)s[y[f]>>l]=u}else for(s=new c(r),i=0;i<r;++i)e[i]&&(s[i]=y[o[e[i]-1]++]>>15-e[i]);return s}),C=new s(288),b=0;b<144;++b)C[b]=8;for(var b=144;b<256;++b)C[b]=9;for(var b=256;b<280;++b)C[b]=7;for(var b=280;b<288;++b)C[b]=8;for(var w=new s(32),b=0;b<32;++b)w[b]=5;var T=/*#__PURE__*/ S(C,9,1),E=/*#__PURE__*/ S(w,5,1),D=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},O=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&n},k=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},A=function(e){return(e+7)/8|0},j=function(e,t,n){return(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new s(e.subarray(t,n))},M=[`unexpected EOF`,`invalid block type`,`invalid length/literal`,`invalid distance`,`stream finished`,`no stream handler`,,`no callback`,`invalid UTF-8 data`,`extra field too long`,`date not in range 1980-2099`,`filename too long`,`stream finishing`,`invalid zip data`],N=function(e,t,n){var r=Error(t||M[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,N),!n)throw r;return r},P=function(e,t,n,r){var i=e.length,a=r?r.length:0;if(!i||t.f&&!t.l)return n||new s(0);var o=!n,c=o||t.i!=2,l=t.i;o&&(n=new s(i*3));var p=function(e){var t=n.length;if(e>t){var r=new s(Math.max(t*2,e));r.set(n),n=r}},m=t.f||0,g=t.p||0,_=t.b||0,y=t.l,b=t.d,x=t.m,C=t.n,w=i*8;do{if(!y){m=O(e,g,1);var M=O(e,g+1,3);if(g+=3,!M){var P=A(g)+4,F=e[P-4]|e[P-3]<<8,I=P+F;if(I>i){l&&N(0);break}c&&p(_+F),n.set(e.subarray(P,I),_),t.b=_+=F,t.p=g=I*8,t.f=m;continue}if(M==1)y=T,b=E,x=9,C=5;else if(M==2){var L=O(e,g,31)+257,R=O(e,g+10,15)+4,z=L+O(e,g+5,31)+1;g+=14;for(var B=new s(z),V=new s(19),H=0;H<R;++H)V[f[H]]=O(e,g+H*3,7);g+=R*3;for(var U=D(V),ee=(1<<U)-1,te=S(V,U,1),H=0;H<z;){var W=te[O(e,g,ee)];g+=W&15;var P=W>>4;if(P<16)B[H++]=P;else{var G=0,K=0;for(P==16?(K=3+O(e,g,3),g+=2,G=B[H-1]):P==17?(K=3+O(e,g,7),g+=3):P==18&&(K=11+O(e,g,127),g+=7);K--;)B[H++]=G}}var q=B.subarray(0,L),J=B.subarray(L);x=D(q),C=D(J),y=S(q,x,1),b=S(J,C,1)}else N(1);if(g>w){l&&N(0);break}}c&&p(_+131072);for(var ne=(1<<x)-1,re=(1<<C)-1,Y=g;;Y=g){var G=y[k(e,g)&ne],X=G>>4;if(g+=G&15,g>w){l&&N(0);break}if(G||N(2),X<256)n[_++]=X;else if(X==256){Y=g,y=null;break}else{var ie=X-254;if(X>264){var H=X-257,Z=u[H];ie=O(e,g,(1<<Z)-1)+h[H],g+=Z}var Q=b[k(e,g)&re],$=Q>>4;Q||N(3),g+=Q&15;var J=v[$];if($>3){var Z=d[$];J+=k(e,g)&(1<<Z)-1,g+=Z}if(g>w){l&&N(0);break}c&&p(_+131072);var ae=_+ie;if(_<J){var oe=a-J,se=Math.min(J,ae);for(oe+_<0&&N(3);_<se;++_)n[_]=r[oe+_]}for(;_<ae;++_)n[_]=n[_-J]}}t.l=y,t.p=Y,t.b=_,t.f=m,y&&(m=1,t.m=x,t.d=b,t.n=C)}while(!m);return _!=n.length&&o?j(n,0,_):n.subarray(0,_)},F=/*#__PURE__*/ new s(0),I=function(e,t){return e[t]|e[t+1]<<8},L=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},R=function(e,t){return L(e,t)+L(e,t+4)*4294967296};function z(e,t){return P(e,{i:2},t&&t.out,t&&t.dictionary)}var B=typeof TextDecoder<`u`&&/*#__PURE__*/ new TextDecoder;try{B.decode(F,{stream:!0})}catch{}var V=function(e){for(var t=``,n=0;;){var r=e[n++],i=(r>127)+(r>223)+(r>239);if(n+i>e.length)return{s:t,r:j(e,n-1)};i?i==3?(r=((r&15)<<18|(e[n++]&63)<<12|(e[n++]&63)<<6|e[n++]&63)-65536,t+=String.fromCharCode(55296|r>>10,56320|r&1023)):i&1?t+=String.fromCharCode((r&31)<<6|e[n++]&63):t+=String.fromCharCode((r&15)<<12|(e[n++]&63)<<6|e[n++]&63):t+=String.fromCharCode(r)}};function H(e,t){if(t){for(var n=``,r=0;r<e.length;r+=16384)n+=String.fromCharCode.apply(null,e.subarray(r,r+16384));return n}if(B)return B.decode(e);var i=V(e),a=i.s,n=i.r;return n.length&&N(8),a}var U=function(e,t){return t+30+I(e,t+26)+I(e,t+28)},ee=function(e,t,n){var r=I(e,t+28),i=H(e.subarray(t+46,t+46+r),!(I(e,t+8)&2048)),a=t+46+r,o=L(e,t+20),s=n&&o==4294967295?te(e,a):[o,L(e,t+24),L(e,t+42)],c=s[0],l=s[1],u=s[2];return[I(e,t+10),c,l,i,a+I(e,t+30)+I(e,t+32),u]},te=function(e,t){for(;I(e,t)!=1;t+=4+I(e,t+2));return[R(e,t+12),R(e,t+4),R(e,t+20)]};function W(e,t){for(var n={},r=e.length-22;L(e,r)!=101010256;--r)(!r||e.length-r>65558)&&N(13);var i=I(e,r+8);if(!i)return{};var a=L(e,r+16),o=a==4294967295||i==65535;if(o){var c=L(e,r-12);o=L(e,c)==101075792,o&&(i=L(e,c+32),a=L(e,c+48))}for(var l=t&&t.filter,u=0;u<i;++u){var d=ee(e,a,o),f=d[0],p=d[1],m=d[2],h=d[3],g=d[4],_=d[5],v=U(e,_);a=g,(!l||l({name:h,size:p,originalSize:m,compression:f}))&&(f?f==8?n[h]=z(e.subarray(v,v+p),{out:new s(m)}):N(14,`unknown compression type `+f):n[h]=j(e,v,v+p))}return n}const G={stl:`stl`,"3mf":`3mf`,obj:`obj`,step:`step`,stp:`step`,iges:`iges`,igs:`iges`};Object.keys(G).map(e=>`.`+e).join(`,`);const K=[...new Set(Object.values(G))].map(e=>e.toUpperCase());`${K.slice(0,-1).join(`, `)}${K[K.length-1]}`;function q(e,t,n=()=>{}){try{return W(e,{filter:e=>(n(e),t(e.name))})}catch{return null}}function J(e,t){let n=q(e,e=>e===`Metadata/plate_${t}.gcode`||e===`Metadata/plate_${t}.png`)||{},r=n[`Metadata/plate_${t}.gcode`];if(!r)throw Error(`This file has no G-code for plate ${t}`);return{text:new TextDecoder().decode(r),thumbnail:n[`Metadata/plate_${t}.png`]||null}}self.onmessage=async({data:e})=>{try{let t=e.text,n=null;e.plate==null?e.file&&(t=await e.file.text()):{text:t,thumbnail:n}=J(new Uint8Array(await e.file.arrayBuffer()),e.plate);let r=o(t,e=>self.postMessage({type:`progress`,value:e})),i=r.segments,a=r.travels,s=[i.start.buffer,i.end.buffer,i.feature.buffer,i.layer.buffer,i.width.buffer,i.height.buffer,a.pos.buffer,a.layer.buffer];self.postMessage({type:`done`,result:r,thumbnail:n},n?[...s,n.buffer]:s)}catch(e){self.postMessage({type:`error`,message:e.message})}};',LS=typeof self<`u`&&self.Blob&&new Blob([`URL.revokeObjectURL(import.meta.url);`,IS],{type:`text/javascript;charset=utf-8`});function RS(e){let t;try{if(t=LS&&(self.URL||self.webkitURL).createObjectURL(LS),!t)throw``;let n=new Worker(t,{type:`module`,name:e?.name});return n.addEventListener(`error`,()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch{return new Worker(`data:text/javascript;charset=utf-8,`+encodeURIComponent(IS),{type:`module`,name:e?.name})}}function zS(){let[e,t]=(0,G.useState)({status:`empty`}),n=(0,G.useRef)(null),r=(0,G.useRef)(null),i=()=>{n.current?.terminate(),n.current=null},a=()=>{r.current&&URL.revokeObjectURL(r.current),r.current=null},o=(0,G.useCallback)((e,o,s=null,{plate:c=null}={})=>{i(),a();let l=typeof e==`string`?e:null,u=l==null?s?e:null:new Blob([l],{type:`text/plain`});t({status:`loading`,name:o,text:l,download:u,quote:s,plate:c,progress:0});let d=e=>{i(),t(t=>({...t,status:`error`,error:`Could not read this G-code: `+e}))},f=n.current=new RS;f.onmessage=({data:e})=>{if(e.type===`progress`)t(t=>({...t,progress:e.value}));else if(e.type===`error`)d(e.message);else if(e.type===`done`){i();let n=e.result;e.thumbnail&&(r.current=URL.createObjectURL(new Blob([e.thumbnail],{type:`image/png`}))),t(e=>n.segments.count?{...e,status:`ready`,result:n,thumbnail:r.current}:{...e,status:`error`,error:`No extrusion moves found. Is this a G-code file?`})}},f.onerror=e=>d(e.message||`parser failed`),f.postMessage(l==null?{file:e,plate:c}:{text:l})},[]),s=(0,G.useCallback)(()=>{i(),a(),t({status:`empty`})},[]);return(0,G.useEffect)(()=>()=>{i(),a()},[]),{...e,open:o,close:s}}var BS=[`printer`,`material`,`quality`,`infill`,`walls`,`supports`],VS=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function HS(e,t,{isKnown:n,defaultPrinter:r},i,a){let o={...t};if(e===void 0)return o;if(!VS(e))return a(`${i}: settings left out: they must be an object`),o;let s=(t,n)=>a(`${i}: ${t} ${JSON.stringify(e[t])} left out: ${n}`);for(let t of Object.keys(e))BS.includes(t)||a(`${i}: unknown setting "${t}" left out`);let{printer:c,material:l,quality:u,infill:d,walls:f,supports:p}=e;if(c!==void 0){if(typeof c!=`string`||!c.trim())s(`printer`,`it must be a printer name`);else{let e=c.trim();n&&!n(e)&&(a(`${i}: printer "${e}" isn't on this server, so the shop's default is used`),e=r),e&&e!==t.printer&&Object.assign(o,{printer:e,process:``,filament:``})}}if(l!==void 0){let e=typeof l==`string`?l.trim().toUpperCase():``;e?e!==o.material&&Object.assign(o,{material:e,filament:``}):s(`material`,`it must be a material, such as PLA`)}return u!==void 0&&(ux.some(e=>e.id===u)?o.quality=u:s(`quality`,`it must be one of ${ux.map(e=>e.id).join(`, `)}`)),d!==void 0&&(sx.includes(d)?o.infill=d:s(`infill`,`it must be one of ${sx.join(`, `)}`)),f!==void 0&&(dx.includes(f)?o.walls=f:s(`walls`,`it must be one of ${dx.join(`, `)}`)),p!==void 0&&(typeof p==`boolean`?o.supports=String(p):s(`supports`,`it must be true or false`)),o}function US(e,t,n,r=e=>console.warn(`slicer-studio: ${e}`)){if(!Array.isArray(e))throw TypeError(`slicer-studio: open() takes a list of { file, copies, settings }`);let i=[];return e.forEach((e,a)=>{let o=`open() item ${a+1}`;if(!VS(e)||!(e.file instanceof File)){r(`${o} left out: it needs a file, as a File`);return}let s=1;e.copies!==void 0&&(Number.isInteger(e.copies)&&e.copies>=1&&e.copies<=100?s=e.copies:r(`${o}: copies ${JSON.stringify(e.copies)} left out: it must be a whole number from 1 to 100`)),i.push({file:e.file,copies:s,settings:HS(e.settings,t,n,o,r)})}),i}function WS(e){let t=/* @__PURE__ */ new Map;for(let{file:n,copies:r,settings:i}of e){let e=JSON.stringify(Object.keys(i).sort().map(e=>[e,i[e]]));t.has(e)||t.set(e,{settings:i,items:[]}),t.get(e).items.push({file:n,copies:r})}return[...t.values()]}var GS=5e5,KS=`slicer-studio: the studio started afresh before the files were placed, so open() them again`,qS=e=>!!e&&[`step`,`iges`].includes(xt(e.name).format),JS={outside:`is off the bed`,excluded:`is in a part of the bed the printer keeps clear`,tall:`is taller than the printer can print`},YS=e=>e.toLocaleString(`en`);function XS({defaults:e,slice:t}){let[n,r]=(0,G.useReducer)(Dy,xy),a=PS([.../* @__PURE__ */ new Set([...n.plates.map(e=>e.settings.printer),e.printer])].filter(Boolean)),{staffApi:o}=i().config,s=Gt(),c=(0,G.useRef)(n);c.current=n;let l=(0,G.useRef)(0),u=e=>`${e}-${++l.current}`,[d,f]=(0,G.useState)({}),p=(0,G.useRef)(d);p.current={...d,...p.current};let m=(0,G.useRef)(/* @__PURE__ */ new Map),h=(0,G.useRef)(/* @__PURE__ */ new Set),g=(0,G.useRef)([]),_=(0,G.useRef)(!0),[v,y]=(0,G.useState)([]),[b,x]=(0,G.useState)(null);(0,G.useEffect)(()=>{let e=new Set(n.plates.map(e=>e.id));g.current=g.current.filter(t=>!e.has(t.id)||(t.resolve(),!1))},[n.plates]),(0,G.useEffect)(()=>(_.current=!0,()=>{_.current=!1;for(let e of g.current)e.reject(/* @__PURE__ */ Error(KS));g.current=[]}),[]),(0,G.useEffect)(()=>{for(let e of h.current)Object.hasOwn(n.files,e)&&h.current.delete(e);let e=new Set(Ny(Object.keys(p.current),n.files,h.current));if(!e.size)return;let t=t=>Object.fromEntries(Object.entries(t).filter(([t])=>!e.has(t)));p.current=t(p.current),f(t);for(let t of[...m.current.keys()])e.has(Fy(t))&&m.current.delete(t)},[n.files,v]);let S=e=>jt(e&&a[e.settings.printer]),C=(e,t)=>{let n=p.current[e];if(!n)return null;let r=Py(e,t);return m.current.has(r)||m.current.set(r,Pt(n.positions,t)),m.current.get(r)},w=(e,t)=>{let n=C(e.fileId,e.orient);return n?zt(n.hull,e.spin,t.center[0]+e.x,t.center[1]+e.y):null},T=(e,t,n=null)=>e.objects.filter(e=>e.id!==n).map(e=>w(e,t)).filter(Boolean),E=e=>e.objects.reduce((e,t)=>e+(p.current[t.fileId]?.triangles||0),0),D=(e,t)=>e.objects.some(e=>qS(t[e.fileId])),O=e=>{let t=S(e);return e.objects.filter(e=>{let n=w(e,t);return!n||!Mt(n,t)})},k=(e,t)=>{let n=O(e);return n.length>0&&jy({...e,objects:n},t)},A=e=>{for(let t of c.current.plates){let n=t.objects.find(t=>t.id===e);if(n)return{plate:t,o:n}}return{}},j=t=>{let n=/* @__PURE__ */ new Set,i=c.current,a={...i.files,...Object.fromEntries(t.map(e=>[e.fileId,e.file]))},o=i.plates.map(e=>({...e,objects:[...e.objects]})),s=o.find(e=>e.id===i.selected.plate)||null,l=[],d=()=>{if(o.length>=10)return null;let t={id:u(`plate`),settings:{...s?s.settings:e},objects:[]};return o.push(t),l.push({type:`addPlate`,id:t.id,settings:t.settings}),t};for(let e of t){let t=null,r=null;if(e.cad)t=s&&!s.objects.length?s:d(),r={x:0,y:0};else{let n=C(e.fileId,Rt),i=p.current[e.fileId].triangles;if(s&&!D(s,a)&&s.objects.length<50&&E(s)+i<=1e6){let e=S(s);r=Et(n.hull,0,T(s,e),e),r&&(t=s)}t||(t=d(),t&&(r=Et(n.hull,0,[],S(t))||{x:0,y:0}))}if(!t){gg.error(`Up to 10 plates. Remove one to add more.`);break}let i=Sy(u(`object`),e.fileId,r);t.objects.push(i),l.push({type:`addObjects`,plate:t.id,files:{[e.fileId]:e.file},objects:[i]}),n.add(e.fileId),s=t}return l.forEach(r),n},M=(e,t=e=>e)=>{let n=10-Object.keys(c.current.files).length;if(n<=0)return gg.error(`Up to 10 files at a time. Remove one to add another.`),[];let r=e.filter(e=>t(e).size>dy);r.length&&gg.error(`${r.map(e=>t(e).name).join(`, `)}: over the 50 MB limit. Please choose a smaller file.`);let i=e.filter(e=>t(e).size<=dy);return i.length>n&&gg.error(`Up to 10 files at a time, so ${i.length-n} ${i.length-n===1?`was`:`were`} left out.`),i.slice(0,n)},N=async e=>{let t=u(`file`);if(qS(e))return{fileId:t,file:e,cad:!0};y(t=>[...t,e.name]);try{let{loadMesh:n}=await import(`./chunks/plate-mesh-DKFeiUUC.js`),r=await n(e);return r.triangles>GS?(gg.error(`${e.name} has ${YS(r.triangles)} triangles, and the slicer takes up to ${YS(GS)}.`),null):(p.current={...p.current,[t]:r},f(e=>({...e,[t]:r})),h.current.add(t),{fileId:t,file:e})}catch{return gg.error(`${e.name} could not be read. Is it a 3D model?`),null}finally{y(t=>{let n=t.indexOf(e.name);return n<0?t:[...t.slice(0,n),...t.slice(n+1)]})}},P=(e,t)=>{for(let n of e)t.has(n.fileId)||h.current.delete(n.fileId)},F=async e=>{let t=[];for(let n of M(e)){let e=await N(n);e&&t.push(e)}let n=/* @__PURE__ */ new Set;try{t.length&&(n=j(t))}finally{P(t,n)}},I=async e=>{let t=WS(M(e,e=>e.file)),n=/* @__PURE__ */ new Map;for(let e of t.flatMap(e=>e.items)){let t=await N(e.file);t&&n.set(e,t)}let i=e=>o&&e?s.fetchQuery(NS(o,e)).then(e=>e&&e.bed,()=>null):Promise.resolve(null),a=[],l=[],d=!1,f=(e,t,n)=>{let r=u(`plate`);l.push(r),a.push({type:`addPlate`,id:r,settings:{...e}}),a.push({type:`addObjects`,plate:r,files:Object.fromEntries(t.map(e=>[e.fileId,e.file])),objects:t.map(e=>Sy(e.id,e.fileId,n(e)))})},m=()=>10-c.current.plates.length-l.length;try{if(!_.current)throw Error(KS);for(let e of t){let t=[],r=[];for(let i of e.items){let e=n.get(i);if(!e)continue;if(e.cad){r.push({id:u(`object`),...e});continue}let{hull:a}=C(e.fileId,Rt);for(let n=0;n<i.copies;n++)t.push({id:u(`object`),...e,points:a,triangles:p.current[e.fileId].triangles})}if(t.length){let n=Iy(t,jt(await i(e.settings.printer)),m());for(let r of n.plates)f(e.settings,r.ids.map(e=>t.find(t=>t.id===e)),e=>r.positions[e.id]);n.left.length&&(d=!0)}for(let t of r){if(m()<=0){d=!0;break}f(e.settings,[t],()=>({x:0,y:0}))}}if(!_.current)throw Error(KS);return d&&gg.error(`Up to 10 plates. Remove one to add more.`),a.forEach(r),l.length?(r({type:`selectPlate`,id:l[0]}),await new Promise((e,t)=>g.current.push({id:l[0],resolve:e,reject:t})),l[0]):null}finally{P([...n.values()],new Set(a.filter(e=>e.type===`addObjects`).flatMap(e=>Object.keys(e.files))))}},ee=(e,t,n)=>{let i=c.current,a=i.plates.find(t=>t.id===e);if(!a)return;let o=a.objects.filter(e=>e.fileId===t);if(n<o.length){r({type:`removeObjects`,ids:o.slice(n).map(e=>e.id)});return}if(n===o.length||qS(i.files[t]))return;let s=S(a),l=o[o.length-1],d=C(t,l.orient),f=T(a,s),m=p.current[t].triangles,h=E(a),g=[];for(let e=o.length;e<n;e++){if(a.objects.length+g.length>=50){gg.error(`Up to 50 objects on a plate.`);break}if(h+m>1e6){gg.error(`A plate takes up to ${YS(by)} triangles, copies included.`);break}let e=Et(d.hull,l.spin,f,s);if(!e){gg.error(`No room for another copy of ${i.files[t].name} on this plate.`);break}g.push(Sy(u(`object`),t,e,l.spin,l.orient)),f.push(zt(d.hull,l.spin,s.center[0]+e.x,s.center[1]+e.y)),h+=m}g.length&&r({type:`addObjects`,plate:e,files:{},objects:g})},te=(e,t)=>r({type:`updateObject`,id:e,patch:t}),ne=(e,t,n)=>{let{plate:r}=A(e);if(!r)return;let i=S(r);te(e,{x:t-i.center[0],y:n-i.center[1]})},re=(e,t,n)=>{let{o:r}=A(e);r&&te(e,{x:r.x+t,y:r.y+n})},ie=(e,t)=>te(e,{spin:(Math.round(t*100)/100%360+360)%360}),ae=(e,t)=>{let{o:n}=A(e);n&&ie(e,n.spin+t)},oe=(e,t)=>{let{o:n}=A(e);n&&te(e,{orient:Lt(t===`forward`?kt(90):Ft(90),n.orient)})},se=(e,t)=>{let{o:n}=A(e);n&&te(e,{orient:At(n.orient,n.spin,Nt(t))})},ce=e=>te(e,{orient:Rt}),le=e=>{let{o:t}=A(e),n=t&&C(t.fileId,t.orient);if(!n)return;let r=zt(n.hull,t.spin,0,0),i=r.map(e=>e[0]),a=r.map(e=>e[1]);te(e,{x:-(Math.min(...i)+Math.max(...i))/2,y:-(Math.min(...a)+Math.max(...a))/2})},ue=e=>{let t=c.current.plates.find(t=>t.id===e);if(!t)return;let n=S(t),i=t.objects.map(e=>({id:e.id,points:C(e.fileId,e.orient)?.hull,spin:e.spin})).filter(e=>e.points),{positions:a,overflow:o}=It(i,n);if(r({type:`updateObjects`,patches:a}),!o.length)return;if(c.current.plates.length>=10){gg.error(`${o.length} ${o.length===1?`object doesn’t`:`objects don’t`} fit, and there are already 10 plates.`);return}let s=u(`plate`);r({type:`addPlate`,id:s,settings:{...t.settings}});let l=It(i.filter(e=>o.includes(e.id)),n);r({type:`moveObjects`,ids:o,to:s,positions:l.positions}),gg(`${o.length} ${o.length===1?`object didn’t`:`objects didn’t`} fit, so ${o.length===1?`it`:`they`} moved to a new plate.`)},de=(e,t,n)=>{let i=c.current,a=i.plates.find(t=>t.id===e);if(!a)return;let o=a.objects.filter(e=>e.fileId===t),s;if(n===`new`){if(i.plates.length>=10){gg.error(`Up to 10 plates.`);return}s={id:u(`plate`),settings:{...a.settings},objects:[]},r({type:`addPlate`,id:s.id,settings:s.settings})}else s=i.plates.find(e=>e.id===n);if(!s)return;if(qS(i.files[t])||D(s,i.files)){if(s.objects.length){gg.error(`STEP and IGES files need a plate of their own.`);return}r({type:`moveObjects`,ids:o.map(e=>e.id),to:s.id,positions:{[o[0].id]:{x:0,y:0}}});return}let l=S(s),d=T(s,l),f={};for(let e of o){let n=C(e.fileId,e.orient),r=n&&Et(n.hull,e.spin,d,l);if(!r){gg.error(`No room for ${Object.keys(f).length?`more copies of `:``}${i.files[t].name} on that plate.`);break}f[e.id]=r,d.push(zt(n.hull,e.spin,l.center[0]+r.x,l.center[1]+r.y))}let p=Object.keys(f);p.length&&r({type:`moveObjects`,ids:p,to:s.id,positions:f})},fe=()=>{if(c.current.plates.length>=10){gg.error(`Up to 10 plates.`);return}let t=c.current.plates.find(e=>e.id===c.current.selected.plate);r({type:`addPlate`,id:u(`plate`),settings:{...t?t.settings:e}})},L=(e,t)=>{if(!e.objects.length||D(e,t))return null;let n=c.current.plates.indexOf(e)+1,r=c.current.plates.length>1?` on plate ${n}`:``;if(e.objects.some(e=>!p.current[e.fileId]))return`A model${r} is still loading`;let i=S(e);if(i.standIn)return`The printer’s bed size hasn’t loaded yet${r?` for plate ${n}`:``}`;let a=O(e);if(!a.length)return`Every model${r} is off the bed. Move one onto it to slice`;let o=E({objects:a});if(o>1e6)return`Plate ${n} has ${YS(o)} triangles, and the limit is ${YS(by)}`;let s=Ot(a.map(e=>({id:e.id,points:w(e,i),height:C(e.fileId,e.orient).size[2]})),i),l=a.find(e=>s[e.id].problem);return l?`${t[l.fileId].name}${r} ${JS[s[l.id].problem]}`:null},R=async(e,t,n)=>{let r=n[e.objects[0].fileId];if(qS(r))return{model:r,settings:e.settings};let{plate3mf:i}=await import(`./chunks/plate-3mf-GYeMGaLV.js`),a=S(e),o=O(e),s=[...new Set(o.map(e=>e.fileId))],c=i(s.map((e,t)=>({id:t+1,name:n[e].name,...p.current[e]})),o.map(e=>({objectId:s.indexOf(e.fileId)+1,...Dt(e,C(e.fileId,e.orient).shift,a.center)})));return{model:new File([c],`plate-${t}.3mf`,{type:`model/3mf`}),settings:{...e.settings,plate:!0}}},pe=async()=>{let e=c.current,n=e.plates.filter(t=>k(t,e.files)),i=e.plates.find(t=>t.id===e.selected.plate),a=(n.length?n:i&&O(i).length?[i]:[]).slice().sort((e,t)=>(t===i)-(e===i));if(!a.length)return;let o=Date.now(),s=0,l=null;for(let[n,i]of a.entries()){let c=e.plates.indexOf(i)+1,u=L(i,e.files);if(u)l=Error(u),r({type:`error`,plate:i.id,error:u});else{x({since:o,step:n+1,of:a.length,plate:c,printer:i.settings.printer,phase:`uploading`});try{let{model:n,settings:a}=await R(i,c,e.files),o=await t.mutateAsync({model:n,settings:a,rot:[0,0,0],onStep:e=>x(t=>t&&{...t,phase:e})});r({type:`result`,plate:i.id,result:{stats:o.stats,used:o.used,price:o.price,quoteId:o.id,gcode:o.gcode||null,name:`plate-${c}.gcode`,sig:Ay({...i,objects:O(i)},e.files)}}),s++}catch(e){l=e;let t=rS(e.status);if(r({type:`error`,plate:i.id,error:t||e.message}),t)break}}}x(null);let u=Math.max(1,Math.round((Date.now()-o)/1e3));l&&rS(l.status)?gg.error(rS(l.status)):s===a.length?gg.success(`Sliced ${a.length===1?`plate ${e.plates.indexOf(a[0])+1}`:`${a.length} plates`} in ${u} s`):a.length===1?gg.error(l.message):gg.error(s?`${s} of ${a.length} plates sliced. Each plate says what went wrong.`:`None of the ${a.length} plates could be sliced. Each plate says why.`)},{plates:me,files:he,selected:ge}=n,z=me.find(e=>e.id===ge.plate)||null,B=z&&z.objects.find(e=>e.id===ge.object)||null,V=(0,G.useMemo)(()=>S(z||{settings:e}),[z?z.settings.printer:e.printer,a]);return{plates:me,files:he,meshes:d,loading:v,slicing:b,plate:z,object:B,bed:V,scene:(0,G.useMemo)(()=>{if(!z)return[];let e=z.objects.map(e=>{let t=C(e.fileId,e.orient);return{o:e,f:t,points:t&&zt(t.hull,e.spin,V.center[0]+e.x,V.center[1]+e.y)}}),t=Ot(e.filter(e=>e.f).map(e=>({id:e.o.id,points:e.points,height:e.f.size[2]})),V);return e.map(({o:e,f:n})=>({id:e.id,fileId:e.fileId,name:he[e.fileId].name,cad:qS(he[e.fileId]),loaded:!!n,...n?Dt(e,n.shift,V.center):{},size:n?n.size:null,at:[V.center[0]+e.x,V.center[1]+e.y],spin:e.spin,problem:t[e.id]?t[e.id].problem:null,overlap:!!(t[e.id]&&t[e.id].overlap),away:!!(t[e.id]&&t[e.id].away)}))},[z,V,d,he]),plateFiles:z?My(z):[],toSlice:me.filter(e=>k(e,he)).length,stale:e=>k(e,he),blocker:()=>{for(let e of me.filter(e=>k(e,he))){let t=L(e,he);if(t)return t}return z&&!me.some(e=>k(e,he))&&z.objects.length&&!O(z).length?L(z,he):null},addFiles:F,openItems:I,setCopies:ee,moveTo:ne,moveBy:re,setSpin:ie,spinBy:ae,tip:oe,layFlat:se,resetTurns:ce,centre:le,arrangePlate:ue,moveFile:de,newPlate:fe,sliceAll:pe,selectPlate:e=>r({type:`selectPlate`,id:e}),selectObject:e=>r({type:`selectObject`,id:e}),removeFile:(e,t)=>{let n=c.current.plates.find(t=>t.id===e);n&&r({type:`removeObjects`,ids:n.objects.filter(e=>e.fileId===t).map(e=>e.id)})},removePlate:e=>r({type:`removePlate`,id:e}),setSettings:e=>z&&r({type:`settings`,plate:z.id,patch:e}),settingsForAll:()=>z&&r({type:`settingsForAll`,from:z.id})}}var ZS=`print-preview.theme`,QS=()=>{try{return localStorage.getItem(ZS)||`system`}catch{return`system`}};function $S(){let{root:e,theme:t}=i(),[n,r]=(0,G.useState)(QS),a=t||n;return(0,G.useLayoutEffect)(()=>{let t=matchMedia(`(prefers-color-scheme: dark)`),n=()=>{e.dataset.theme=a===`dark`||a===`system`&&t.matches?`dark`:`light`};if(n(),a===`system`)return t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)},[a,e]),(0,G.useEffect)(()=>{if(!t)try{n===`system`?localStorage.removeItem(ZS):localStorage.setItem(ZS,n)}catch{}},[n,t]),[a,t?null:r]}var eC=`print-preview.printer`,tC=()=>{try{return localStorage.getItem(eC)||null}catch{return null}};function nC(e,t){return e.error?`failed`:e.result?t?`stale`:`sliced`:null}function rC(e,t){if(!e.objects.length)return null;if(e.error)return{text:e.error,warn:!0};if(!e.result)return{text:`Not sliced yet.`};if(t)return{text:`Changed since slicing.`,warn:!0};let{stats:n,price:r}=e.result;return{text:`${n.weightG} g, ${vx(n.seconds)}${r?`, ${Sx({low:r.min,high:r.max},r.currency)}`:``}`}}function iC(e,t,n){let r=rC(e,t);if(!r||!n)return r;let i=/[.!?]$/.test(r.text)?r.text:`${r.text}.`;return{...r,text:`${i} ${n===1?`One object off the bed isn’t`:`${n} objects off the bed aren’t`} sliced.`}}function aC(){let[e,t]=$S(),{config:{staffApi:n},actions:r}=i(),a=AS(),o=DS(),s=jS(),c=zS(),l=FS(),[u,d]=(0,G.useState)(null),[f,p]=(0,G.useState)(`prepare`),[m,h]=(0,G.useState)(!1),g=(0,G.useRef)(null),_=(0,G.useRef)(null),[v,y]=(0,G.useState)(()=>({...ox,printer:tC()??``})),b=(0,G.useRef)(tC()!==null),x=XS({defaults:v,slice:l}),{plate:S,object:C}=x,w=S?S.settings:v,T=e=>S?x.setSettings(e):y(t=>({...t,...e})),E=MS(w.printer,w.material);(0,G.useEffect)(()=>{if(w.printer)try{localStorage.setItem(eC,w.printer)}catch{}},[w.printer]),(0,G.useEffect)(()=>{!b.current&&o.data&&(b.current=!0,o.data.defaultPrinter&&T({printer:o.data.defaultPrinter,process:``,filament:``}))},[o.data]),(0,G.useEffect)(()=>{o.data&&w.printer&&!s.isLoading&&(o.data.printers.includes(w.printer)||s.data&&Qb(s.data,w.printer)||T({printer:o.data.defaultPrinter,process:``,filament:``}))},[o.data,s.data,s.isLoading,S&&S.id]);let D=E.data&&E.data.materials;(0,G.useEffect)(()=>{D&&D.length&&!D.includes(w.material)&&T({material:D.includes(`PLA`)?`PLA`:D[0],filament:``})},[D,w.material]);let O=!!(o.isError||o.data&&w.printer!==``)&&!s.isLoading,k=(0,G.useRef)(null);k.current={settings:w,openItems:x.openItems,shop:{isKnown:o.data?e=>o.data.printers.includes(e)||!!(s.data&&Qb(s.data,e)):null,defaultPrinter:o.data?o.data.defaultPrinter:``}};let A=(0,G.useRef)(Promise.resolve());(0,G.useEffect)(()=>{if(O)return r.opener.set(e=>{let t=A.current.then(async()=>{let{settings:t,shop:n}=k.current,r=US(e,t,n);r.length&&(p(`prepare`),h(!1),await k.current.openItems(r))});return A.current=t.catch(()=>{}),t}),()=>r.opener.set(null)},[O]);let j=(0,G.useRef)(!1),M=async e=>{let{models:t,others:n}=await wt(e);if(t.length){p(`prepare`),x.addFiles(t),n.length&&gg.error(`${n.map(e=>e.file.name).join(`, `)}: not added. Open G-code files on their own.`);return}if(!n.length)return;let{file:r,what:i}=n[0],a=(...e)=>{j.current=!1,c.open(...e),p(`preview`)};i.kind===`gcode`?a(r,r.name):i.kind===`gcode3mf`&&i.plates.length===1?a(r,r.name,null,{plate:i.plates[0].plate}):i.kind===`gcode3mf`?d({file:r,plates:i.plates}):gg.error(`${r.name} is not a model or G-code file. Models can be ${Ct}.`)},N=G_({noClick:!0,noKeyboard:!0,multiple:!0,onDrop:M}),P=S&&S.result,F=(0,G.useRef)({plate:null,result:null});(0,G.useEffect)(()=>{let e=F.current;F.current={plate:S&&S.id,result:P},P&&P.gcode?(j.current=!0,c.open(P.gcode,P.name,{stats:P.stats,used:P.used}),e.plate===(S&&S.id)&&e.result!==P&&p(`preview`)):j.current&&(j.current=!1,c.close())},[S&&S.id,P]);let I=e=>(...t)=>{p(`prepare`),e(...t)},ee=iS(n,a),te=ee?`${ee}. G-code files still open.`:x.plates.some(e=>e.objects.length)?w.printer===null?`Choose a model for this brand.`:x.blocker():`Add a model to the plate.`,ne=x.slicing&&{...x.slicing,title:`${mx(x.slicing.phase,`Slicing`)} plate ${x.slicing.plate}${x.slicing.of>1?` (${x.slicing.step} of ${x.slicing.of})`:``}`,printer:x.slicing.printer||`The default printer`},re=C&&x.scene.find(e=>e.id===C.id),ie=C?S.objects.filter(e=>e.fileId===C.fileId):[],ae=x.scene.find(e=>e.cad),oe={plates:x.plates.map((e,t)=>({id:e.id,n:t+1,state:nC(e,x.stale(e))})),selected:S&&S.id,files:x.plateFiles.map(e=>{let t=x.scene.find(t=>t.id===e.objects[0].id);return{fileId:e.fileId,name:x.files[e.fileId].name,copies:e.objects.length,cad:t&&t.cad,size:t&&t.size,on:!!C&&C.fileId===e.fileId,firstId:e.objects[0].id}}),loading:x.loading,summary:S&&iC(S,x.stale(S),x.scene.filter(e=>e.away).length),onSelectPlate:x.selectPlate,onNewPlate:I(x.newPlate),onRemovePlate:x.removePlate,onSettingsForAll:()=>{x.settingsForAll(),gg.success(`Every plate now has these settings`)},onFiles:M,onChoose:()=>_.current.click(),onSelectFile:I(x.selectObject),onCopies:I((e,t)=>x.setCopies(S.id,e,t)),onMove:(e,t)=>x.moveFile(S.id,e,t),onRemove:e=>x.removeFile(S.id,e)},se={item:re,canArrange:!!S&&S.objects.length>0&&!ae,copy:C?{k:ie.indexOf(C)+1,of:ie.length}:null,problem:re&&(re.problem?`It ${JS[re.problem]}. Move it, or turn it.`:re.overlap?`It overlaps another object.`:null),note:re&&re.away?`Off the bed, so it won’t be sliced.`:null,onMoveTo:I((e,t)=>x.moveTo(C.id,e,t)),onSpin:I(e=>x.setSpin(C.id,e)),onSpinBy:I(e=>x.spinBy(C.id,e)),onTip:I(e=>x.tip(C.id,e)),onReset:I(()=>x.resetTurns(C.id)),onCentre:I(()=>x.centre(C.id)),onArrange:I(()=>x.arrangePlate(S.id))},ce={bed:x.bed,scene:x.scene,meshes:x.meshes,selected:C&&C.id,layMode:m,onSelect:e=>x.selectObject(e),onMove:(e,t,n)=>x.moveBy(e,t,n),onLay:(e,t)=>{x.layFlat(e,t),h(!1)},onLayMode:h};return/* @__PURE__ */ (0,K.jsxs)(`div`,{...N.getRootProps({className:`flex min-h-[max(100%,360px)] flex-col outline-none md:h-full`}),children:[/* @__PURE__ */ (0,K.jsx)(`input`,{ref:g,type:`file`,accept:Tt,hidden:!0,onChange:e=>{M([...e.target.files].slice(0,1)),e.target.value=``}}),/* @__PURE__ */ (0,K.jsx)(`input`,{ref:_,type:`file`,accept:St,multiple:!0,hidden:!0,onChange:e=>{M([...e.target.files]),e.target.value=``}}),/* @__PURE__ */ (0,K.jsxs)(`div`,{className:`flex flex-1 flex-col md:min-h-0 md:flex-row`,children:[/* @__PURE__ */ (0,K.jsx)(`main`,{className:`min-w-0 md:order-2 md:flex-1`,children:/* @__PURE__ */ (0,K.jsx)(eS,{gcode:c,slicing:ne,mode:f,onMode:p,editor:ce,emptyPlate:!S||!S.objects.length&&!x.loading.length,note:ae?`${ae.name} is placed at the bed centre by the slicer. See it in Preview after slicing.`:null,onOpenGcode:()=>g.current.click(),onChooseModel:()=>_.current.click()})}),/* @__PURE__ */ (0,K.jsx)(`div`,{className:`md:order-1 md:flex md:min-h-0`,children:/* @__PURE__ */ (0,K.jsx)(Px,{plates:oe,position:se,settings:w,onSettings:T,printers:s,ourPrinters:_x(o.data),options:E,toSlice:x.toSlice,slicingSince:x.slicing&&x.slicing.since,phase:x.slicing&&x.slicing.phase,blocker:te,blockerTone:!ee&&!x.plates.some(e=>e.objects.length)?`status`:`warning`,onSlice:x.sliceAll,onOpenGcode:()=>g.current.click(),theme:e,onTheme:t})})]}),/* @__PURE__ */ (0,K.jsx)($v,{show:N.isDragActive,text:`Drop models to put them on the plate, or G-code to open it`}),/* @__PURE__ */ (0,K.jsx)(Qv,{pick:u,onClose:()=>d(null),onPick:e=>{j.current=!1,c.open(u.file,`${u.file.name}, plate ${e}`,null,{plate:e}),d(null),p(`preview`)}})]})}var oC=8e3;async function sC(e,t,n,r){n?.throwIfAborted();let i=new AbortController,a=()=>i.abort(),o=setTimeout(a,r);n?.addEventListener(`abort`,a);try{let n=await fetch(e,{...t,method:`POST`,headers:{"content-type":`application/json`},signal:i.signal});return n.status===200?await n.json():null}catch(e){if(e.name===`SyntaxError`)return null;throw e}finally{clearTimeout(o),n?.removeEventListener(`abort`,a)}}async function cC({authUrl:e,verifyUrl:t},n,r=oC){if(!e||!t)return`not-set-up`;try{let i=await sC(e,{credentials:`include`,body:`{}`},n,r);if(!i||typeof i.token!=`string`||!i.token)return`refused`;let a=await sC(t,{credentials:`omit`,body:JSON.stringify({token:i.token})},n,r);return a&&a.valid===!0?`granted`:`refused`}catch{return`unreachable`}}var lC={refused:`Advanced is for staff. Sign in and try again.`,unreachable:`We couldn’t check your access. Please try again.`,"not-set-up":`Advanced isn’t set up on this page.`};function uC(){return $S(),/* @__PURE__ */ (0,K.jsx)(`div`,{role:`status`,className:`flex h-full min-h-[240px] items-center justify-center text-body text-muted`,children:`Checking your access…`})}function dC({reason:e,onRetry:t}){return $S(),/* @__PURE__ */ (0,K.jsxs)(`div`,{role:`alert`,className:`flex h-full min-h-[240px] flex-col items-center justify-center gap-4 p-6 text-center`,children:[/* @__PURE__ */ (0,K.jsx)(`p`,{className:`max-w-sm font-display text-heading`,children:lC[e]}),e!==`not-set-up`&&/* @__PURE__ */ (0,K.jsx)(ay,{onClick:t,children:`Try again`})]})}function fC(){let{config:e,emit:t,actions:n}=i(),{advanced:r}=e,a=r?JSON.stringify(r):null,[o,s]=(0,G.useState)(0),c=`${a} ${o}`,[l,u]=(0,G.useState)(null);(0,G.useEffect)(()=>{if(!a)return;let e=new AbortController;return cC(r,e.signal).then(n=>{e.signal.aborted||(u({asking:c,result:n}),n!==`granted`&&t(`advanceddenied`,{reason:n}))}),()=>e.abort()},[c]);let d=a&&l&&l.asking===c&&l.result!==`granted`?l.result:null;return(0,G.useEffect)(()=>{if(!d)return;let e=/* @__PURE__ */ Error(`slicer-studio: Advanced isn't open to this visitor (${d})`);return n.opener.fail(e),n.opener.set(()=>Promise.reject(e)),()=>n.opener.set(null)},[d]),a?!l||l.asking!==c?/* @__PURE__ */ (0,K.jsx)(uC,{}):l.result===`granted`?/* @__PURE__ */ (0,K.jsx)(aC,{}):/* @__PURE__ */ (0,K.jsx)(dC,{reason:l.result,onRetry:()=>s(e=>e+1)}):/* @__PURE__ */ (0,K.jsx)(aC,{})}function pC({title:e,aside:t,action:n}){return/* @__PURE__ */ (0,K.jsxs)(`header`,{className:`mb-2.5 flex items-baseline justify-between gap-4`,children:[/* @__PURE__ */ (0,K.jsx)(`h2`,{className:`font-display text-heading`,children:e}),t&&/* @__PURE__ */ (0,K.jsx)(`span`,{className:`min-w-0 text-right text-label text-muted`,children:t}),n]})}function mC({area:e,title:t,aside:n,action:r,className:i,children:a}){return/* @__PURE__ */ (0,K.jsxs)(`section`,{className:H(`min-w-0 rounded-tile bg-panel p-4`,i),style:{gridArea:e},children:[t&&/* @__PURE__ */ (0,K.jsx)(pC,{title:t,aside:n,action:r}),a]})}function hC({label:e,value:t,onChange:n,options:r,stack:i}){return/* @__PURE__ */ (0,K.jsx)(su,{type:`single`,"aria-label":e,value:String(t),onValueChange:e=>{e&&n(e)},className:i?`grid gap-1.5`:`flex flex-wrap gap-1.5`,children:r.map(e=>/* @__PURE__ */ (0,K.jsxs)(gu,{value:String(e.value),className:H(`press flex min-h-9 items-center justify-between gap-3 rounded-card bg-raise px-3 text-body font-medium text-ink hover:bg-rule`,`data-[state=on]:bg-accent data-[state=on]:text-accent-contrast`,!i&&`flex-1 justify-center`),children:[/* @__PURE__ */ (0,K.jsx)(`span`,{children:e.label}),e.aside&&/* @__PURE__ */ (0,K.jsx)(`span`,{className:`num text-label font-normal text-muted in-data-[state=on]:text-accent-contrast/75`,children:e.aside})]},e.value))})}var gC=[{id:`FDM`,name:`Filament`,hint:`Strong everyday parts in PLA, PETG, ABS or TPU`,priced:!0},{id:`SLA`,name:`Resin`,hint:`Fine detail and smooth surfaces, for small precise parts`,priced:!1},{id:`SLS`,name:`Nylon powder`,hint:`Tough, functional nylon parts, no supports needed`,priced:!1}];function _C(e,t,n){if(!e||!e.email)return null;let r=`${e.name?`Hello ${e.name},`:`Hello,`}\n\n${n.length?`I'd like these printed in ${t}:\n${n.map(e=>`- ${e}`).join(`
52
+ `)}`:`I'd like some parts printed in ${t}. I'll attach the models.`}\n\nWhat they're for, and how many I need:\n\n`;return`mailto:${e.email}?subject=${encodeURIComponent(`${t} print enquiry`)}&body=${encodeURIComponent(r)}`}function vC({id:e}){let t={width:22,height:22,viewBox:`0 0 28 28`,fill:`none`,stroke:`currentColor`,strokeWidth:1.6,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0};return e===`FDM`?/* @__PURE__ */ (0,K.jsxs)(`svg`,{...t,children:[/* @__PURE__ */ (0,K.jsx)(`path`,{d:`M10 4h8v5l-3 4h-2l-3-4z`}),/* @__PURE__ */ (0,K.jsx)(`path`,{d:`M14 13v3`}),/* @__PURE__ */ (0,K.jsx)(`path`,{d:`M5 20h18M7 23.5h14`})]}):e===`SLA`?/* @__PURE__ */ (0,K.jsxs)(`svg`,{...t,children:[/* @__PURE__ */ (0,K.jsx)(`path`,{d:`M8 5h12v6H8z`}),/* @__PURE__ */ (0,K.jsx)(`path`,{d:`M5 17h18l-2 6H7z`}),/* @__PURE__ */ (0,K.jsx)(`path`,{d:`M14 11v6`,strokeDasharray:`1.5 2`})]}):/* @__PURE__ */ (0,K.jsxs)(`svg`,{...t,children:[/* @__PURE__ */ (0,K.jsx)(`path`,{d:`M4 18h20v6H4z`}),/* @__PURE__ */ (0,K.jsx)(`path`,{d:`M9 21h.01M14 21h.01M19 21h.01`,strokeWidth:2.4}),/* @__PURE__ */ (0,K.jsx)(`path`,{d:`M20 4l-5 12`}),/* @__PURE__ */ (0,K.jsx)(`path`,{d:`M18 4h4`})]})}function yC({value:e,onChange:t,action:n}){let r=gC.find(t=>t.id===e);return/* @__PURE__ */ (0,K.jsxs)(mC,{area:`process`,title:`How should we print it?`,action:n,children:[/* @__PURE__ */ (0,K.jsx)(su,{type:`single`,"aria-label":`Printing process`,value:e,onValueChange:e=>{e&&t(e)},className:`grid grid-cols-3 gap-2`,children:gC.map(e=>/* @__PURE__ */ (0,K.jsxs)(gu,{value:e.id,className:`press flex flex-col items-start gap-1.5 rounded-card bg-raise p-2.5 text-left outline-offset-2 hover:bg-rule data-[state=on]:bg-panel data-[state=on]:ring-2 data-[state=on]:ring-silver-edge`,children:[/* @__PURE__ */ (0,K.jsx)(`span`,{className:`text-muted in-data-[state=on]:text-ink`,children:/* @__PURE__ */ (0,K.jsx)(vC,{id:e.id})}),/* @__PURE__ */ (0,K.jsxs)(`span`,{children:[/* @__PURE__ */ (0,K.jsx)(`span`,{className:`block font-display text-heading leading-none`,children:e.id}),/* @__PURE__ */ (0,K.jsx)(`span`,{className:`mt-1 block text-label text-muted`,children:e.name})]})]},e.id))}),/* @__PURE__ */ (0,K.jsxs)(`p`,{className:`mt-2.5 text-body text-muted`,children:[r.hint,`.`]})]})}var bC=(0,G.lazy)(()=>import(`./chunks/ModelPreview-CjA0mplM.js`));function xC({model:e,single:t,onChoose:n}){return/* @__PURE__ */ (0,K.jsx)(`section`,{style:{gridArea:`model`},className:H(`relative overflow-hidden rounded-hero lg:min-h-[420px]`,e?`min-h-[360px] bg-viewer`:`min-h-[240px] bg-panel p-3`),children:e?/* @__PURE__ */ (0,K.jsxs)(K.Fragment,{children:[/* @__PURE__ */ (0,K.jsx)(G.Suspense,{fallback:null,children:/* @__PURE__ */ (0,K.jsx)(bC,{file:e,customer:!0})}),t&&/* @__PURE__ */ (0,K.jsx)(`button`,{type:`button`,onClick:n,className:`press material absolute right-3 bottom-3 rounded-control px-3 py-1.5 text-body font-medium hover:bg-raise`,children:`Choose another file`})]}):/* @__PURE__ */ (0,K.jsxs)(`button`,{type:`button`,onClick:n,className:`group flex h-full min-h-[216px] w-full flex-col items-center justify-center gap-2.5 rounded-card border-2 border-dashed border-rule bg-raise px-6 text-center transition-colors hover:border-accent lg:min-h-[396px]`,style:{backgroundImage:`linear-gradient(var(--rule) 1px, transparent 1px), linear-gradient(90deg, var(--rule) 1px, transparent 1px)`,backgroundSize:`24px 24px`,backgroundPosition:`center`},children:[/* @__PURE__ */ (0,K.jsx)(`span`,{className:`grid size-10 place-items-center rounded-card bg-accent text-accent-contrast transition-transform duration-300 ease-spring group-hover:-translate-y-0.5 group-active:scale-95`,children:/* @__PURE__ */ (0,K.jsx)(qv,{className:`size-5`,"aria-hidden":!0})}),/* @__PURE__ */ (0,K.jsxs)(`span`,{className:`rounded-md bg-raise px-1.5 font-display text-heading`,children:[`Drop your 3D `,t?`model`:`models`,` here`]}),/* @__PURE__ */ (0,K.jsxs)(`span`,{className:`rounded-md bg-raise px-1.5 text-body text-muted`,children:[`or `,/* @__PURE__ */ (0,K.jsx)(`span`,{className:`font-medium text-ink underline underline-offset-4`,children:t?`choose a file`:`choose files`}),`. `,Ct,`, `,fy(t)]})]})})}function SC({icon:e,children:t}){return/* @__PURE__ */ (0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 whitespace-nowrap`,children:[/* @__PURE__ */ (0,K.jsx)(e,{className:`size-3 shrink-0`,"aria-hidden":!0}),` `,t]})}function CC({name:e,onApplyAll:t,onRemove:n}){let{portal:r}=i(),a=`cursor-pointer rounded-control px-2.5 py-1.5 text-body outline-none data-[highlighted]:bg-raise`;return/* @__PURE__ */ (0,K.jsxs)(bs,{children:[/* @__PURE__ */ (0,K.jsx)(Ss,{"aria-label":`More for ${e}`,className:`press grid size-8 shrink-0 place-items-center rounded-control text-muted hover:bg-raise hover:text-ink`,children:/* @__PURE__ */ (0,K.jsx)(pv,{className:`size-4`,"aria-hidden":!0})}),/* @__PURE__ */ (0,K.jsx)(Cs,{container:r,children:/* @__PURE__ */ (0,K.jsxs)(Ts,{align:`end`,sideOffset:4,className:`pop z-50 min-w-60 rounded-card border border-rule bg-panel p-1 shadow-popover`,children:[t&&/* @__PURE__ */ (0,K.jsx)(Es,{className:a,onSelect:t,children:`Use these settings for all files`}),/* @__PURE__ */ (0,K.jsx)(Es,{className:H(a,`text-danger`),onSelect:n,children:`Remove file`})]})})]})}function wC({row:{item:e,stale:t},line:n,thumb:r,on:i,busy:a,priced:o,onSelect:s,onRemove:c,onCopies:l,onApplyAll:u}){let d=e.file.name,f=e.result&&e.result.stats.sizeMm||r&&r.size,p=f?/* @__PURE__ */ (0,K.jsxs)(SC,{icon:zv,children:[f.map(e=>e.toFixed(1)).join(` × `),` mm`]}):/* @__PURE__ */ (0,K.jsx)(`span`,{children:bt(e.file.size)}),m=o&&n&&!t&&!e.error;return/* @__PURE__ */ (0,K.jsxs)(`li`,{className:H(`flex flex-wrap items-center gap-x-3 gap-y-2 rounded-card border bg-panel p-2 transition-colors @xl:flex-nowrap`,i?`border-accent`:`border-rule`),children:[/* @__PURE__ */ (0,K.jsxs)(`button`,{type:`button`,"aria-current":i||void 0,onClick:s,className:`flex min-w-0 flex-1 basis-full items-center gap-3 rounded-control text-left @xl:basis-0`,children:[/* @__PURE__ */ (0,K.jsx)(`span`,{className:`grid size-13 shrink-0 place-items-center overflow-hidden rounded-control bg-raise`,children:r?/* @__PURE__ */ (0,K.jsx)(`img`,{src:r.url,alt:``,className:`size-full object-contain`}):/* @__PURE__ */ (0,K.jsx)(vt,{className:`size-5 text-muted`,strokeWidth:1.6,"aria-hidden":!0})}),/* @__PURE__ */ (0,K.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[/* @__PURE__ */ (0,K.jsx)(`span`,{className:`block truncate text-body font-medium`,title:d,children:d}),e.error?/* @__PURE__ */ (0,K.jsx)(`span`,{className:`mt-0.5 line-clamp-2 block text-label text-warn`,title:e.error,children:e.error}):/* @__PURE__ */ (0,K.jsxs)(`span`,{className:`mt-1 flex flex-wrap items-center gap-x-3 gap-y-0.5 text-label text-muted`,children:[m&&/* @__PURE__ */ (0,K.jsx)(SC,{icon:vt,children:Cx(n.gramsRange)}),m&&/* @__PURE__ */ (0,K.jsx)(SC,{icon:lv,children:wx(n.secondsRange)}),p,o&&a&&/* @__PURE__ */ (0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-ink`,children:[/* @__PURE__ */ (0,K.jsx)(_t,{className:`size-3 animate-spin`,"aria-hidden":!0}),` Pricing…`]}),o&&!a&&!n&&/* @__PURE__ */ (0,K.jsx)(`span`,{children:`Not priced yet`}),o&&!a&&t&&/* @__PURE__ */ (0,K.jsx)(`span`,{className:`text-warn`,children:`Changed: update the price`}),m&&e.result.stats.watertight===!1&&/* @__PURE__ */ (0,K.jsx)(`span`,{className:`text-warn`,children:`Has holes, so it may not print as expected`})]})]})]}),/* @__PURE__ */ (0,K.jsxs)(`div`,{className:`flex w-full items-center justify-end gap-3 @xl:w-auto`,children:[m&&n.range&&/* @__PURE__ */ (0,K.jsx)(`span`,{className:`num mr-auto text-body font-semibold whitespace-nowrap @xl:mr-1`,children:Sx(n.range,n.currency)}),o&&/* @__PURE__ */ (0,K.jsx)(uy,{label:`Copies of ${d}`,value:e.copies,onChange:l,repeat:!0}),/* @__PURE__ */ (0,K.jsx)(CC,{name:d,onApplyAll:o?u:void 0,onRemove:c})]})]})}function TC({page:e,pages:t,first:n,last:r,count:i,onPage:a}){let o=`press grid size-7 place-items-center rounded-control text-muted hover:bg-raise hover:text-ink disabled:hover:bg-transparent`;return/* @__PURE__ */ (0,K.jsxs)(`nav`,{"aria-label":`File pages`,className:`flex items-center justify-between gap-2 pt-1`,children:[/* @__PURE__ */ (0,K.jsxs)(`span`,{className:`num text-label text-muted`,children:[n===r?n:`${n}–${r}`,` of `,i]}),/* @__PURE__ */ (0,K.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[/* @__PURE__ */ (0,K.jsx)(`button`,{type:`button`,"aria-label":`Previous files`,disabled:e===0,onClick:()=>a(e-1),className:o,children:/* @__PURE__ */ (0,K.jsx)(tv,{className:`size-4`,"aria-hidden":!0})}),Array.from({length:t},(t,n)=>/* @__PURE__ */ (0,K.jsx)(`button`,{type:`button`,"aria-label":`Page ${n+1}`,"aria-current":n===e?`page`:void 0,onClick:()=>a(n),className:H(`press num grid size-7 place-items-center rounded-control text-label`,n===e?`bg-accent text-accent-contrast`:`text-muted hover:bg-raise hover:text-ink`),children:n+1},n)),/* @__PURE__ */ (0,K.jsx)(`button`,{type:`button`,"aria-label":`Next files`,disabled:e===t-1,onClick:()=>a(e+1),className:o,children:/* @__PURE__ */ (0,K.jsx)($_,{className:`size-4`,"aria-hidden":!0})})]})]})}function EC({files:e,lineCost:t,thumbs:n,priced:r}){let i=e.rows.length,a=py(i),[o,s]=(0,G.useState)(0),c=Math.min(o,a-1);(0,G.useEffect)(()=>{let t=e.rows.findIndex(t=>t.item.id===e.selected);t>=0&&s(my(t))},[e.selected]);let l=e.rows.slice(c*2,(c+1)*2),u=i>0&&/* @__PURE__ */ (0,K.jsxs)(`span`,{className:`num text-label text-muted`,children:[i,` of `,e.max]});return/* @__PURE__ */ (0,K.jsx)(mC,{area:`files`,title:`Your files`,action:u,children:/* @__PURE__ */ (0,K.jsxs)(`div`,{className:`@container space-y-2`,children:[i<e.max&&/* @__PURE__ */ (0,K.jsxs)(`button`,{type:`button`,onClick:e.onAdd,className:`press flex w-full items-center gap-3 rounded-card border border-dashed border-rule p-2 text-left hover:border-accent`,children:[/* @__PURE__ */ (0,K.jsx)(`span`,{className:`grid size-9 shrink-0 place-items-center rounded-control bg-raise`,children:/* @__PURE__ */ (0,K.jsx)(Nv,{className:`size-4`,"aria-hidden":!0})}),/* @__PURE__ */ (0,K.jsxs)(`span`,{className:`min-w-0`,children:[/* @__PURE__ */ (0,K.jsx)(`span`,{className:`block text-body font-semibold`,children:i?`Add more files`:`Add files`}),/* @__PURE__ */ (0,K.jsxs)(`span`,{className:`block text-label text-muted`,children:[Ct,`, `,fy()]})]})]}),i>0&&/* @__PURE__ */ (0,K.jsx)(`ul`,{className:H(`space-y-2`,a>1&&`min-h-[236px] @xl:min-h-[148px]`),children:l.map(a=>/* @__PURE__ */ (0,K.jsx)(wC,{row:a,line:a.item.result?t(a.item):null,thumb:n[a.item.id],on:a.item.id===e.selected,busy:a.item.id===e.busy,priced:r,onSelect:()=>e.onSelect(a.item.id),onRemove:()=>e.onRemove(a.item.id),onCopies:t=>e.onCopies(a.item.id,t),onApplyAll:i>1?()=>e.onApplyAll(a.item.id):void 0},a.item.id))}),a>1&&/* @__PURE__ */ (0,K.jsx)(TC,{page:c,pages:a,first:c*2+1,last:Math.min((c+1)*2,i),count:i,onPage:s})]})})}function DC({simple:e,onSimple:t,materials:n,printer:r}){let i=n.find(t=>t.id===e.material),a=gx(e.material,r),o=Math.max(0,ux.findIndex(t=>t.id===e.quality));return/* @__PURE__ */ (0,K.jsxs)(mC,{area:`material`,children:[/* @__PURE__ */ (0,K.jsx)(pC,{title:`Material`,aside:i&&i.hint}),/* @__PURE__ */ (0,K.jsx)(hC,{label:`Material`,value:e.material,onChange:e=>t({material:e}),options:n.map(e=>({value:e.id,label:e.id}))}),a&&/* @__PURE__ */ (0,K.jsx)(sy,{tone:`warning`,className:`mt-2`,children:a}),/* @__PURE__ */ (0,K.jsxs)(`div`,{className:`mt-4 border-t border-rule pt-3.5`,children:[/* @__PURE__ */ (0,K.jsx)(pC,{title:`Finish`,aside:`${ux[o].mm} mm layers`}),/* @__PURE__ */ (0,K.jsx)(ax,{bare:!0,label:`Finish`,values:ux.map((e,t)=>t),value:o,onChange:e=>t({quality:ux[e].id}),format:e=>ux[e].label,valueText:e=>`${ux[e].label}, ${ux[e].mm} mm layers`,captions:ux.map(e=>e.label)})]})]})}function OC({simple:e,onSimple:t}){return/* @__PURE__ */ (0,K.jsx)(mC,{area:`strength`,title:`Strength`,children:/* @__PURE__ */ (0,K.jsx)(`div`,{className:`@container`,children:/* @__PURE__ */ (0,K.jsxs)(`div`,{className:`grid gap-4 @md:grid-cols-2 @md:gap-6`,children:[/* @__PURE__ */ (0,K.jsx)(ax,{label:`Infill`,values:sx,value:e.infill,onChange:e=>t({infill:e}),format:e=>`${e}%`,captions:[`Lighter`,`Stronger`]}),/* @__PURE__ */ (0,K.jsx)(ax,{label:`Walls`,values:dx,value:e.walls,onChange:e=>t({walls:e}),format:e=>`${e} ${e===1?`wall`:`walls`}`,captions:[dx[0],dx[dx.length-1]]})]})})})}var kC=iy({variant:`silver`,size:`lg`,className:`w-full justify-center`});function AC({children:e}){let{portal:t}=i();return/* @__PURE__ */ (0,K.jsxs)(zs,{children:[/* @__PURE__ */ (0,K.jsx)(Vs,{"aria-label":`How this price is worked out`,className:`press grid size-5 place-items-center rounded-full text-hero-muted hover:text-hero-ink`,children:/* @__PURE__ */ (0,K.jsx)(Cv,{className:`size-3.5`,"aria-hidden":!0})}),/* @__PURE__ */ (0,K.jsx)(Gs,{container:t,children:/* @__PURE__ */ (0,K.jsx)(qs,{side:`top`,sideOffset:4,collisionPadding:12,className:`pop z-50 max-w-64 space-y-1.5 rounded-card border border-rule bg-panel p-3 text-body text-ink shadow-popover`,children:e})})]})}function jC({estimate:e,percent:t,files:n,missing:r,stale:i,pieces:a,quick:o,ready:s,slicing:c,blocker:l,button:u,onEstimate:d,onButton:f}){let p=Nx(c&&c.since),m=i+r>0,h=e&&e.range,g=s&&e&&!c;return/* @__PURE__ */ (0,K.jsxs)(`section`,{style:{gridArea:`cost`},className:`hero @container flex min-w-0 flex-col justify-between gap-4 rounded-hero p-5`,children:[/* @__PURE__ */ (0,K.jsxs)(`div`,{children:[/* @__PURE__ */ (0,K.jsxs)(`div`,{className:`flex items-center gap-1`,children:[/* @__PURE__ */ (0,K.jsx)(`h2`,{className:`text-label text-hero-muted`,children:`Estimated price`}),e&&(h||o)&&/* @__PURE__ */ (0,K.jsxs)(AC,{children:[h&&/* @__PURE__ */ (0,K.jsxs)(`p`,{children:[`Worked out from the material your models use.`,t>0&&` The range runs from that price to ${t}% more.`]}),o&&/* @__PURE__ */ (0,K.jsx)(`p`,{children:`A quick estimate, from the shape of your models.`})]})]}),e?/* @__PURE__ */ (0,K.jsxs)(K.Fragment,{children:[h?/* @__PURE__ */ (0,K.jsx)($h.p,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},className:`num mt-1 font-display text-price`,children:Sx(h,e.currency)},`${h.low}-${h.high}`):/* @__PURE__ */ (0,K.jsxs)(`p`,{className:`mt-1 font-display text-heading`,children:[`No price set for `,e.unpriced.join(` or `),` yet`]}),/* @__PURE__ */ (0,K.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-x-4 gap-y-0.5 text-label text-hero-muted`,children:[/* @__PURE__ */ (0,K.jsxs)(SC,{icon:vt,children:[Cx(e.gramsRange),` of material`]}),/* @__PURE__ */ (0,K.jsxs)(SC,{icon:lv,children:[`About `,wx(e.secondsRange)]}),n>1&&/* @__PURE__ */ (0,K.jsxs)(SC,{icon:xv,children:[n,` files, `,a,` pieces`]}),o&&/* @__PURE__ */ (0,K.jsx)(SC,{icon:Zv,children:`Quick estimate`})]})]}):/* @__PURE__ */ (0,K.jsx)(`p`,{className:`mt-1 text-body text-hero-muted`,children:n?`Set your choices, then get the price.`:`Upload a model to see its price.`}),m&&!c&&e&&/* @__PURE__ */ (0,K.jsx)(sy,{tone:`warning`,onHero:!0,className:`mt-2.5`,children:r?`${r} ${r===1?`file isn’t`:`files aren’t`} priced yet.`:`Your choices changed.`}),l&&!c&&n>0&&/* @__PURE__ */ (0,K.jsx)(sy,{tone:`warning`,onHero:!0,className:`mt-2.5`,children:l})]}),g?u&&/* @__PURE__ */ (0,K.jsx)(`button`,{type:`button`,className:kC,disabled:!h||e.unpriced.length>0,onClick:f,children:u.label}):/* @__PURE__ */ (0,K.jsx)(`button`,{type:`button`,className:kC,disabled:!n||!!l||!!c,onClick:d,children:c?/* @__PURE__ */ (0,K.jsxs)(K.Fragment,{children:[/* @__PURE__ */ (0,K.jsx)(_t,{className:`size-4 animate-spin`,"aria-hidden":!0}),` `,mx(c.phase,`Working it out`),c.of>1?`, ${c.step} of ${c.of}`:``,` `,/* @__PURE__ */ (0,K.jsxs)(`span`,{className:`num`,children:[p,` s`]})]}):e?`Update the price`:`Get the price`})]})}var MC={SLA:`Light-cured resin: fine detail and smooth surfaces. For miniatures, precise parts and moulds.`,SLS:`Laser-fused nylon: tough parts, no supports needed. For clips, hinges and housings.`};function NC({process:e,contact:t,fileNames:n}){let r=gC.find(t=>t.id===e),i=_C(t,e,n),a=t&&t.name||`our lab`;return/* @__PURE__ */ (0,K.jsxs)(`section`,{style:{gridArea:`contact`},className:`hero flex min-w-0 flex-col justify-between gap-5 rounded-hero p-5`,children:[/* @__PURE__ */ (0,K.jsxs)(`div`,{className:`max-w-md`,children:[/* @__PURE__ */ (0,K.jsxs)(`h2`,{className:`font-display text-heading`,children:[r.id,` is quoted by our team`]}),/* @__PURE__ */ (0,K.jsx)(`p`,{className:`mt-2 text-body text-hero-muted`,children:MC[e]}),/* @__PURE__ */ (0,K.jsxs)(`p`,{className:`mt-2 text-body text-hero-muted`,children:[`Email `,a,` your models and what they’re for, and we’ll reply with a price.`,n.length?` The email lists your files; attach them before sending.`:``]})]}),i?/* @__PURE__ */ (0,K.jsxs)(`a`,{href:i,className:iy({variant:`silver`,size:`lg`,className:`self-start`}),children:[/* @__PURE__ */ (0,K.jsx)(Dv,{className:`size-4`,"aria-hidden":!0}),` Email us about `,r.id]}):/* @__PURE__ */ (0,K.jsxs)(`p`,{className:`text-body font-medium`,children:[`Ask at `,a,` for a price.`]})]})}var PC=e=>e.replace(/\.\w+$/,``);function FC(e){let t=e.filter(e=>e.size<=dy),n=e.filter(e=>e.size>dy).map(e=>e.name);return n.length&&gg.error(`${n.join(`, `)}: over the 50 MB limit. Please choose a smaller file.`),t}function IC({defaults:e,slice:t,requestFor:n}){let[r,i]=(0,G.useReducer)(_y,hy),a=(0,G.useRef)(0),[o,s]=(0,G.useState)(null),c=r.items.find(e=>e.id===r.selected)||null,l=e=>vy(e,n(e)),u=r.items.map(e=>({item:e,stale:!!e.result&&e.result.sig!==l(e)})),d=r.items.filter(e=>yy(e,l(e))),f=t=>{let n=FC(t);if(!n.length)return;let o=10-r.items.length;if(o<=0)return gg.error(`Up to 10 files at a time. Remove one to add another.`);i({type:`add`,defaults:e,files:n.slice(0,o).map(e=>({id:`file-${++a.current}`,file:e}))});let s=n.length-o;s>0&&gg.error(`Up to 10 files at a time, so ${s} ${s===1?`was`:`were`} left out.`)},p=t=>{FC([t]).length&&i({type:`replace`,defaults:e,id:`file-${++a.current}`,file:t})},m=async({verb:e,success:r})=>{let a=(d.length?d:[c]).slice().sort((e,t)=>(t===c)-(e===c)),o=Date.now(),u=0,f=null;for(let[e,r]of a.entries()){let c=n(r),d=l(r);s({since:o,step:e+1,of:a.length,id:r.id,file:r.file.name,printer:c.printer,phase:`uploading`});try{let e=await t.mutateAsync({model:r.file,settings:c,rot:r.rot,onStep:e=>s(t=>t&&{...t,phase:e})}),n={stats:e.stats,used:e.used,price:e.price,quoteId:e.id,gcode:e.gcode||null,name:PC(r.file.name)+`.gcode`,material:c.material,sig:d};i({type:`result`,id:r.id,result:n}),u++}catch(e){f=e;let t=rS(e.status);if(i({type:`error`,id:r.id,error:t||e.message}),t)break}}s(null);let p=Math.max(1,Math.round((Date.now()-o)/1e3));f&&rS(f.status)?gg.error(rS(f.status)):u===a.length?gg.success(r(a.length===1?a[0].file.name:`${a.length} files`,p)):a.length===1?gg.error(f.message):gg.error(u?`${u} of ${a.length} files ${e}. The list says what went wrong with the others.`:`None of the ${a.length} files could be ${e}. The list says why.`)},h=c&&c.id;return{items:r.items,selected:c,rows:u,todo:d,slicing:o,add:f,replace:p,sliceAll:m,setSettings:e=>i({type:`settings`,id:h,patch:e}),rotate:e=>i({type:`rotate`,id:h,rot:e}),list:{rows:u,selected:r.selected,max:10,busy:o&&o.id,onSelect:e=>i({type:`select`,id:e}),onRemove:e=>i({type:`remove`,id:e}),onCopies:(e,t)=>i({type:`copies`,id:e,value:t}),onApplyAll:e=>{i({type:`applyToAll`,id:e}),gg.success(`${r.items.find(t=>t.id===e).file.name}'s settings now apply to all ${r.items.length} files`)}}}}function LC(e){let[t,n]=(0,G.useState)({}),r=(0,G.useRef)(/* @__PURE__ */ new Set),i=(0,G.useRef)(Promise.resolve()),a=e.map(e=>e.id).join();return(0,G.useEffect)(()=>{for(let{id:t,file:a}of e)r.current.has(t)||(r.current.add(t),i.current=i.current.then(async()=>{if(await new Promise(e=>setTimeout(e)),!r.current.has(t))return;let{renderThumbnail:e}=await import(`./chunks/thumbnail-CTbhmZcq.js`),i=await e(a).catch(()=>null);i&&(r.current.has(t)?n(e=>({...e,[t]:i})):URL.revokeObjectURL(i.url))}));let t=new Set(e.map(e=>e.id));for(let e of r.current)t.has(e)||r.current.delete(e);n(e=>{let n=Object.keys(e).filter(e=>!t.has(e));return n.length?(n.forEach(t=>URL.revokeObjectURL(e[t].url)),Object.fromEntries(Object.entries(e).filter(([e])=>t.has(e)))):e})},[a]),t}var RC=e=>e.map(e=>`"${e.join(` `)}"`).join(` `),zC=(e,t)=>Array(t).fill(e);function BC(e,t){let n=t=>e.has(t),r=n(`model`)?`model`:null,i=n(`files`)?`files`:null,a=t?[`material`,`strength`].filter(n):[],o=n(t?`cost`:`contact`)?t?`cost`:`contact`:null,s=[`process`,`model`,`files`,...a,o].filter(e=>e&&n(e)),c=!t&&i&&o,l=s.filter(e=>!c||e!==i&&e!==o).map(e=>zC(e,2));c&&l.push([i,o]);let u=[...n(`process`)?[`process`]:[],...a];o&&(!i||!t&&r)&&u.push(o);let d=u.length?u.map(e=>r?[r,r,e,e]:zC(e,4)):r?[zC(r,4)]:[],f=i?o?[[i,i,o,o]]:[zC(i,4)]:[];return{one:RC(s.map(e=>[e])),two:RC(l),four:RC([...d,...f])}}function VC(e,t){let n=Ex(e.map(e=>({stats:e.result.stats,copies:e.copies,material:e.result.material,price:e.result.price})),t);return{currency:n.currency,range:n.range,gramsRange:n.gramsRange,secondsRange:n.secondsRange,unpriced:n.unpriced,quick:e.some(e=>e.result.stats.estimated),files:e.map(e=>{let{range:n,gramsRange:r,secondsRange:i}=Tx(e.result.stats,e.copies,e.result.price,t);return{name:e.file.name,file:e.file,quoteId:e.result.quoteId,copies:e.copies,settings:e.settings,range:n,gramsRange:r,secondsRange:i}})}}function HC(e,t,n){let r=new URL(e,n);return r.searchParams.set(`quotes`,t.map(e=>`${e.quoteId}:${e.copies}`).join(`,`)),r.href}function UC(){let{config:e,emit:t,actions:n}=i(),[r,a]=$S(),o=DS(),s=kS(),[c,l]=(0,G.useState)(`FDM`),[u,d]=(0,G.useState)(()=>({...fx,...e.defaults})),f=(0,G.useRef)(null),p=JSON.stringify(e.defaults);(0,G.useEffect)(()=>d(t=>({...t,...e.defaults})),[p]);let m=o.data,h=m?m.defaultPrinter:``,g=m?m.pricing:null,_=IC({defaults:u,slice:s,requestFor:e=>({...e.settings,printer:h})}),{selected:v}=_,y=v?v.settings:u,b=e=>v?_.setSettings(e):d(t=>({...t,...e})),x=LC(_.items),S=lS(e),C=!S.has(`files`),w=OS(h),T=px(w.data?w.data.materials:lx.map(e=>e.id)),E=T.map(e=>e.id).join();(0,G.useEffect)(()=>{T.length&&!T.some(e=>e.id===y.material)&&b({material:T[0].id})},[E,y.material]);let D=async e=>{let{models:t,others:n}=await wt(e);t.length&&(C?_.replace(t[0]):_.add(t)),n.length&&gg.error(`${n.map(e=>e.file.name).join(`, `)}: not a 3D model. Use ${Ct}.`)},O=G_({noClick:!0,noKeyboard:!0,multiple:!0,onDrop:D}),k=_.items.filter(e=>e.result),A=k.map(e=>({stats:e.result.stats,copies:e.copies,material:e.result.material,price:e.result.price})),j=e=>Tx(e.result.stats,e.copies,e.result.price,g),M=_.items.length?o.isError?`The server can’t be reached.`:w.error&&w.error.status===503?`Prices can’t be worked out right now. Please try again later.`:null:`Upload a model to get a price.`,N={..._.list,onAdd:()=>f.current.click()},P=gC.find(e=>e.id===c).priced,F=BC(S,P),I=()=>_.sliceAll({verb:`priced`,success:e=>`Price ready for ${e}`}),ee=P&&k.length===_.items.length&&!_.todo.length&&!_.slicing&&_.items.length>0,te=(0,G.useRef)(null),ne=e=>{let n=VC(_.items,g),r=JSON.stringify({...n,files:n.files.map(({file:e,...t})=>t)});(e||r!==te.current)&&t(`estimate`,n),te.current=r};(0,G.useEffect)(()=>{ee&&ne(!1)});let re=()=>{if(!ee||!e.button)return;let n=VC(_.items,g);t(`buttonclick`,n,{cancelable:!0})&&e.button.url&&location.assign(HC(e.button.url,n.files,document.baseURI))};return(0,G.useEffect)(()=>{n.getPrice=()=>{if(P&&_.items.length&&!_.slicing&&!M)return _.todo.length?I():ne(!0)}}),/* @__PURE__ */ (0,K.jsxs)(`div`,{...O.getRootProps({className:`outline-none`}),children:[/* @__PURE__ */ (0,K.jsx)(`input`,{ref:f,type:`file`,accept:St,multiple:!C,hidden:!0,onChange:e=>{D([...e.target.files]),e.target.value=``}}),/* @__PURE__ */ (0,K.jsx)(`main`,{className:`mx-auto w-full p-3 sm:p-4`,children:/* @__PURE__ */ (0,K.jsxs)(`div`,{className:`bento`,style:{"--areas-one":F.one,"--areas-two":F.two,"--areas-four":F.four},children:[S.has(`process`)&&/* @__PURE__ */ (0,K.jsx)(yC,{value:c,onChange:l,action:a&&/* @__PURE__ */ (0,K.jsx)(Mx,{theme:r,onTheme:a})}),S.has(`model`)&&/* @__PURE__ */ (0,K.jsx)(xC,{model:v&&v.file,single:C,onChoose:()=>f.current.click()}),S.has(`files`)&&/* @__PURE__ */ (0,K.jsx)(EC,{files:N,lineCost:j,thumbs:x,priced:P}),P?/* @__PURE__ */ (0,K.jsxs)(K.Fragment,{children:[S.has(`material`)&&/* @__PURE__ */ (0,K.jsx)(DC,{simple:y,onSimple:b,materials:T,printer:h}),S.has(`strength`)&&/* @__PURE__ */ (0,K.jsx)(OC,{simple:y,onSimple:b}),S.has(`cost`)&&/* @__PURE__ */ (0,K.jsx)(jC,{estimate:A.length?Ex(A,g):null,percent:g?g.range:0,files:_.items.length,missing:_.items.length-k.length,stale:_.rows.filter(e=>e.stale).length,pieces:_.items.reduce((e,t)=>e+t.copies,0),quick:k.some(e=>e.result.stats.estimated),ready:!_.todo.length,slicing:_.slicing,blocker:M,button:e.button,onEstimate:I,onButton:re})]}):S.has(`contact`)&&/* @__PURE__ */ (0,K.jsx)(NC,{process:c,contact:m&&m.contact,fileNames:_.items.map(e=>e.file.name)})]})}),/* @__PURE__ */ (0,K.jsx)($v,{show:O.isDragActive,text:`Drop your models to get a price`})]})}var WC=()=>new nr({defaultOptions:{queries:{staleTime:1/0,retry:!1,refetchOnWindowFocus:!1}}});function GC({mode:e,...t}){let[n]=(0,G.useState)(WC);return/* @__PURE__ */ (0,K.jsx)(o.Provider,{value:t,children:/* @__PURE__ */ (0,K.jsx)(Kt,{client:n,children:/* @__PURE__ */ (0,K.jsx)(Wm,{reducedMotion:`user`,transition:et,children:/* @__PURE__ */ (0,K.jsxs)(te,{delayDuration:300,children:[e===`advanced`?/* @__PURE__ */ (0,K.jsx)(fC,{}):/* @__PURE__ */ (0,K.jsx)(UC,{}),(0,Lr.createPortal)(/* @__PURE__ */ (0,K.jsx)(jg,{position:`top-center`,toastOptions:{className:`!bg-panel !text-ink !border-rule !rounded-card !text-body !shadow-popover`}}),t.portal)]})})})})}var KC=`/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
53
+ @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-content:"";--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%}}}@layer theme{:root,:host{--font-sans:"Archivo Variable", ui-sans-serif, system-ui, sans-serif;--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--radius-sm:.25rem;--radius-md:.375rem;--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:"Archivo Variable", ui-sans-serif, system-ui, sans-serif;--default-mono-font-family:var(--font-mono);--text-label:11px;--text-label--line-height:calc(16 / 11);--text-label--letter-spacing:.01em;--text-label--font-weight:500;--text-body:13px;--text-body--line-height:calc(18 / 13);--text-body--letter-spacing:0em;--text-heading:15px;--text-heading--line-height:calc(20 / 15);--text-heading--letter-spacing:-.01em;--text-heading--font-weight:600;--text-price:28px;--text-price--line-height:calc(30 / 28);--text-price--letter-spacing:-.02em;--text-price--font-weight:600;--text-button:13px;--text-button--line-height:calc(16 / 13);--text-button--font-weight:600;--radius-control:8px;--radius-card:12px;--radius-tile:20px;--radius-hero:24px;--shadow-raised:0 1px 2px #00000014;--shadow-popover:0 12px 32px -12px #00000052;--shadow-overlay:0 24px 64px -24px #00000080;--ease-spring:cubic-bezier(.22, 1, .36, 1)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}:host{flex-direction:column;width:100%;min-width:0;display:flex}:host([mode=advanced]){height:100dvh}.studio-theme{all:initial;color-scheme:inherit;background:var(--bench);height:100%;min-height:0;color:var(--ink);font-family:var(--font-sans);font-size:var(--text-body);line-height:var(--text-body--line-height);-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:transparent;flex-direction:column;flex:auto;display:flex}.studio-layout{flex:auto;min-height:0;container:studio/inline-size}:host([mode=advanced]) .studio-layout{overflow-y:auto}:focus-visible{outline:2px solid var(--ink);outline-offset:2px}button{cursor:pointer}button:disabled{cursor:not-allowed}button:disabled,[data-disabled]:not([data-disabled=false]){opacity:.4}}@layer components{.bento{grid-template-columns:minmax(0,1fr);grid-template-areas:var(--areas-one);gap:12px;display:grid}@container studio (width>=640px){.bento{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-areas:var(--areas-two)}}@container studio (width>=1024px){.bento{grid-template-columns:minmax(0,1.2fr) minmax(0,1.2fr) minmax(0,1fr) minmax(0,1fr);grid-template-areas:var(--areas-four)}}@container studio (width>=1280px){.bento{grid-template-columns:minmax(0,1.5fr) minmax(0,1.5fr) minmax(0,1fr) minmax(0,1fr)}}}@layer utilities{.\\@container{container-type:inline-size}.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:0}.inset-x-0{inset-inline:0}.inset-x-3{inset-inline:calc(var(--spacing) * 3)}.-top-1{top:calc(var(--spacing) * -1)}.top-0\\.5{top:calc(var(--spacing) * .5)}.top-1\\/2{top:50%}.top-3{top:calc(var(--spacing) * 3)}.top-16{top:calc(var(--spacing) * 16)}.top-\\[72px\\]{top:72px}.top-\\[calc\\(100\\%\\+3px\\)\\]{top:calc(100% + 3px)}.-right-1{right:calc(var(--spacing) * -1)}.right-3{right:calc(var(--spacing) * 3)}.right-\\[calc\\(100\\%\\+10px\\)\\]{right:calc(100% + 10px)}.bottom-0{bottom:0}.bottom-3{bottom:calc(var(--spacing) * 3)}.bottom-28{bottom:calc(var(--spacing) * 28)}.bottom-\\[calc\\(100\\%\\+10px\\)\\]{bottom:calc(100% + 10px)}.left-0\\.5{left:calc(var(--spacing) * .5)}.left-1\\/2{left:50%}.left-2\\.5{left:calc(var(--spacing) * 2.5)}.left-3{left:calc(var(--spacing) * 3)}.left-\\[136px\\]{left:136px}.left-\\[calc\\(100\\%\\+4px\\)\\]{left:calc(100% + 4px)}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.container{width:100%}.m-\\[3px\\]{margin:3px}.mx-0\\.5{margin-inline:calc(var(--spacing) * .5)}.mx-auto{margin-inline:auto}.my-1{margin-block:var(--spacing)}.mt-0\\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-2\\.5{margin-top:calc(var(--spacing) * 2.5)}.mt-3\\.5{margin-top:calc(var(--spacing) * 3.5)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mr-auto{margin-right:auto}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-2\\.5{margin-bottom:calc(var(--spacing) * 2.5)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.-ml-2{margin-left:calc(var(--spacing) * -2)}.ml-0\\.5{margin-left:calc(var(--spacing) * .5)}.ml-auto{margin-left:auto}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-flex{display:inline-flex}.aspect-\\[4\\/3\\]{aspect-ratio:4/3}.aspect-square{aspect-ratio:1}.size-2\\.5{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.size-3{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.size-3\\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-5{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-7{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.size-10{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.size-13{width:calc(var(--spacing) * 13);height:calc(var(--spacing) * 13)}.size-full{width:100%;height:100%}.h-1{height:var(--spacing)}.h-1\\.5{height:calc(var(--spacing) * 1.5)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-12{height:calc(var(--spacing) * 12)}.h-full{height:100%}.h-px{height:1px}.max-h-72{max-height:calc(var(--spacing) * 72)}.max-h-80{max-height:calc(var(--spacing) * 80)}.min-h-0{min-height:0}.min-h-9{min-height:calc(var(--spacing) * 9)}.min-h-\\[216px\\]{min-height:216px}.min-h-\\[236px\\]{min-height:236px}.min-h-\\[240px\\]{min-height:240px}.min-h-\\[360px\\]{min-height:360px}.min-h-\\[max\\(100\\%\\,360px\\)\\]{min-height:max(100%,360px)}.w-1\\.5{width:calc(var(--spacing) * 1.5)}.w-1\\/3{width:33.3333%}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-11{width:calc(var(--spacing) * 11)}.w-14{width:calc(var(--spacing) * 14)}.w-24{width:calc(var(--spacing) * 24)}.w-36{width:calc(var(--spacing) * 36)}.w-44{width:calc(var(--spacing) * 44)}.w-60{width:calc(var(--spacing) * 60)}.w-80{width:calc(var(--spacing) * 80)}.w-\\[min\\(340px\\,calc\\(100\\%-32px\\)\\)\\]{width:min(340px,100% - 32px)}.w-\\[min\\(560px\\,calc\\(100\\%-32px\\)\\)\\]{width:min(560px,100% - 32px)}.w-\\[var\\(--radix-popover-trigger-width\\)\\]{width:var(--radix-popover-trigger-width)}.w-\\[var\\(--radix-select-trigger-width\\)\\]{width:var(--radix-select-trigger-width)}.w-auto{width:auto}.w-full{width:100%}.w-px{width:1px}.max-w-56{max-width:calc(var(--spacing) * 56)}.max-w-64{max-width:calc(var(--spacing) * 64)}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:0}.min-w-8{min-width:calc(var(--spacing) * 8)}.min-w-48{min-width:calc(var(--spacing) * 48)}.min-w-56{min-width:calc(var(--spacing) * 56)}.min-w-60{min-width:calc(var(--spacing) * 60)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.basis-full{flex-basis:100%}.pop{transform-origin:var(--radix-popover-content-transform-origin,var(--radix-dropdown-menu-content-transform-origin,var(--radix-select-content-transform-origin,var(--radix-tooltip-content-transform-origin,center))));animation:pop-in .3s var(--ease-spring)}.pop[data-state=closed]{animation:.15s ease-in forwards pop-out}.pop[data-state=instant-open]{animation:none}@media (prefers-reduced-motion:reduce){.pop{animation:.15s ease-out fade-in}.pop[data-state=closed]{animation:.12s ease-in forwards fade-out}}.-translate-x-1\\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-5{--tw-translate-x:calc(var(--spacing) * 5);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.press{transition-property:scale,color,background-color,border-color,opacity,box-shadow;transition-duration:.25s;transition-timing-function:var(--ease-spring)}.press:active:not(:disabled,[data-disabled]:not([data-disabled=false])){transition-duration:.1s;scale:.97}@media (prefers-reduced-motion:reduce){.press:active:not(:disabled,[data-disabled]:not([data-disabled=false])){opacity:.8;scale:none}}.rotate-90{rotate:90deg}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-\\[fade-in_200ms_ease-out\\]{animation:.2s ease-out fade-in}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-grab{cursor:grab}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.auto-cols-fr{grid-auto-columns:minmax(0,1fr)}.grid-flow-col{grid-auto-flow:column}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-\\[auto_1fr\\]{grid-template-columns:auto 1fr}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}:where(.space-y-1\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-x-4{column-gap:calc(var(--spacing) * 4)}.gap-x-6{column-gap:calc(var(--spacing) * 6)}.gap-y-0\\.5{row-gap:calc(var(--spacing) * .5)}.gap-y-1{row-gap:var(--spacing)}.gap-y-2{row-gap:calc(var(--spacing) * 2)}.gap-y-3{row-gap:calc(var(--spacing) * 3)}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.\\!rounded-card{border-radius:var(--radius-card)!important}.rounded{border-radius:.25rem}.rounded-card{border-radius:var(--radius-card)}.rounded-control{border-radius:var(--radius-control)}.rounded-full{border-radius:2147483647px}.rounded-hero{border-radius:var(--radius-hero)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-tile{border-radius:var(--radius-tile)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.material{background-color:var(--panel)}@supports (color:color-mix(in lab, red, red)){.material{background-color:color-mix(in oklab, var(--panel) 78%, transparent)}}.material{-webkit-backdrop-filter:blur(20px)saturate(1.8);backdrop-filter:blur(20px)saturate(1.8);border:1px solid var(--ink)}@supports (color:color-mix(in lab, red, red)){.material{border:1px solid color-mix(in oklab, var(--ink) 10%, transparent)}}.material{box-shadow:var(--shadow-raised)}@media (prefers-reduced-transparency:reduce){.material{background-color:var(--panel);-webkit-backdrop-filter:none;backdrop-filter:none}}@media (prefers-contrast:more){.material{background-color:var(--panel);border-color:var(--ink)}}.material-thick{background-color:var(--panel)}@supports (color:color-mix(in lab, red, red)){.material-thick{background-color:color-mix(in oklab, var(--panel) 92%, transparent)}}.material-thick{-webkit-backdrop-filter:blur(28px)saturate(1.8);backdrop-filter:blur(28px)saturate(1.8);border:1px solid var(--ink)}@supports (color:color-mix(in lab, red, red)){.material-thick{border:1px solid color-mix(in oklab, var(--ink) 10%, transparent)}}.material-thick{box-shadow:var(--shadow-popover)}@media (prefers-reduced-transparency:reduce){.material-thick{background-color:var(--panel);-webkit-backdrop-filter:none;backdrop-filter:none}}@media (prefers-contrast:more){.material-thick{background-color:var(--panel);border-color:var(--ink)}}.\\!border-rule{border-color:var(--rule)!important}.border-accent{border-color:var(--accent)}.border-ink{border-color:var(--ink)}.border-panel{border-color:var(--panel)}.border-rule{border-color:var(--rule)}.\\!bg-panel{background-color:var(--panel)!important}.bg-accent{background-color:var(--accent)}.bg-bench\\/80{background-color:var(--bench)}@supports (color:color-mix(in lab, red, red)){.bg-bench\\/80{background-color:color-mix(in oklab, var(--bench) 80%, transparent)}}.bg-danger{background-color:var(--danger)}.bg-ink,.bg-ink\\/40{background-color:var(--ink)}@supports (color:color-mix(in lab, red, red)){.bg-ink\\/40{background-color:color-mix(in oklab, var(--ink) 40%, transparent)}}.bg-muted\\/60{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.bg-muted\\/60{background-color:color-mix(in oklab, var(--muted) 60%, transparent)}}.bg-ok{background-color:var(--ok)}.bg-panel{background-color:var(--panel)}.bg-raise{background-color:var(--raise)}.bg-rule{background-color:var(--rule)}.bg-scrim{background-color:var(--scrim)}.bg-transparent{background-color:#0000}.bg-viewer{background-color:var(--viewer-bg)}.bg-warn{background-color:var(--warn)}.object-contain{object-fit:contain}.p-0\\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:var(--spacing)}.p-2{padding:calc(var(--spacing) * 2)}.p-2\\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.px-1{padding-inline:var(--spacing)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-3\\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-1{padding-block:var(--spacing)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-5{padding-block:calc(var(--spacing) * 5)}.py-6{padding-block:calc(var(--spacing) * 6)}.pt-1{padding-top:var(--spacing)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-3\\.5{padding-top:calc(var(--spacing) * 3.5)}.pr-1{padding-right:var(--spacing)}.pr-2\\.5{padding-right:calc(var(--spacing) * 2.5)}.pb-1\\.5{padding-bottom:calc(var(--spacing) * 1.5)}.pl-1\\.5{padding-left:calc(var(--spacing) * 1.5)}.pl-2\\.5{padding-left:calc(var(--spacing) * 2.5)}.pl-8{padding-left:calc(var(--spacing) * 8)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-display{font-family:Bricolage Grotesque Variable,Archivo Variable,ui-sans-serif,system-ui,sans-serif}.text-heading{font-size:var(--text-heading);line-height:var(--tw-leading,var(--text-heading--line-height));letter-spacing:var(--tw-tracking,var(--text-heading--letter-spacing));font-weight:var(--tw-font-weight,var(--text-heading--font-weight))}.text-label{font-size:var(--text-label);line-height:var(--tw-leading,var(--text-label--line-height));letter-spacing:var(--tw-tracking,var(--text-label--letter-spacing));font-weight:var(--tw-font-weight,var(--text-label--font-weight))}.text-price{font-size:var(--text-price);line-height:var(--tw-leading,var(--text-price--line-height));letter-spacing:var(--tw-tracking,var(--text-price--letter-spacing));font-weight:var(--tw-font-weight,var(--text-price--font-weight))}.text-button{font-size:var(--text-button);line-height:var(--tw-leading,var(--text-button--line-height));font-weight:var(--tw-font-weight,var(--text-button--font-weight))}.\\!text-body{font-size:var(--text-body)!important;line-height:var(--tw-leading,var(--text-body--line-height))!important;letter-spacing:var(--tw-tracking,var(--text-body--letter-spacing))!important}.text-body{font-size:var(--text-body);line-height:var(--tw-leading,var(--text-body--line-height));letter-spacing:var(--tw-tracking,var(--text-body--letter-spacing))}.leading-none{--tw-leading:1;line-height:1}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.\\[overflow-wrap\\:anywhere\\]{overflow-wrap:anywhere}.whitespace-nowrap{white-space:nowrap}.hero{background:var(--hero);color:var(--hero-ink);box-shadow:inset 0 1px 0 #ffffff1a, 0 0 0 1px var(--hero-edge)}.silver-fill{background:var(--silver);color:#111114}.\\!text-ink{color:var(--ink)!important}.text-accent-contrast{color:var(--accent-contrast)}.text-danger{color:var(--danger)}.text-hero-ink{color:var(--hero-ink)}.text-hero-muted{color:var(--hero-muted)}.text-hero-warn{color:var(--hero-warn)}.text-ink{color:var(--ink)}.text-ink-contrast{color:var(--ink-contrast)}.text-muted,.text-muted\\/60{color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.text-muted\\/60{color:color-mix(in oklab, var(--muted) 60%, transparent)}}.text-ok{color:var(--ok)}.text-warn{color:var(--warn)}.text-white{color:var(--color-white)}.lowercase{text-transform:lowercase}.num{font-variant-numeric:tabular-nums;font-stretch:112%}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-70{opacity:.7}.opacity-100{opacity:1}.\\!shadow-popover{--tw-shadow:0 12px 32px -12px var(--tw-shadow-color,#00000052)!important;box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)!important}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-overlay{--tw-shadow:0 24px 64px -24px var(--tw-shadow-color,#00000080);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-popover{--tw-shadow:0 12px 32px -12px var(--tw-shadow-color,#00000052);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-raised{--tw-shadow:0 1px 2px var(--tw-shadow-color,#00000014);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-ink{--tw-ring-color:var(--ink)}.ring-offset-2{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.ring-offset-panel{--tw-ring-offset-color:var(--panel)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.outline-offset-2{outline-offset:2px}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[scale\\]{transition-property:scale;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[width\\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.ease-spring{--tw-ease:var(--ease-spring);transition-timing-function:var(--ease-spring)}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}@media (hover:hover){.group-hover\\:-translate-y-0\\.5:is(:where(.group):hover *){--tw-translate-y:calc(var(--spacing) * -.5);translate:var(--tw-translate-x) var(--tw-translate-y)}}.group-active\\:scale-95:is(:where(.group):active *){--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x) var(--tw-scale-y)}.placeholder\\:text-muted::placeholder{color:var(--muted)}.before\\:pointer-events-none:before{content:var(--tw-content);pointer-events:none}.before\\:absolute:before{content:var(--tw-content);position:absolute}.before\\:inset-x-0:before{content:var(--tw-content);inset-inline:0}.before\\:-top-6:before{content:var(--tw-content);top:calc(var(--spacing) * -6)}.before\\:h-6:before{content:var(--tw-content);height:calc(var(--spacing) * 6)}.before\\:bg-linear-to-t:before{content:var(--tw-content);--tw-gradient-position:to top}@supports (background-image:linear-gradient(in lab, red, red)){.before\\:bg-linear-to-t:before{--tw-gradient-position:to top in oklab}}.before\\:bg-linear-to-t:before{background-image:linear-gradient(var(--tw-gradient-stops))}.before\\:from-panel:before{content:var(--tw-content);--tw-gradient-from:var(--panel);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.before\\:to-transparent:before{content:var(--tw-content);--tw-gradient-to:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.last\\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.focus-within\\:border-muted:focus-within{border-color:var(--muted)}@media (hover:hover){.hover\\:scale-110:hover{--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x) var(--tw-scale-y)}.hover\\:border-accent:hover{border-color:var(--accent)}.hover\\:border-ink:hover{border-color:var(--ink)}.hover\\:border-muted:hover{border-color:var(--muted)}.hover\\:bg-raise:hover{background-color:var(--raise)}.hover\\:bg-rule:hover{background-color:var(--rule)}.hover\\:text-hero-ink:hover{color:var(--hero-ink)}.hover\\:text-ink:hover{color:var(--ink)}.hover\\:opacity-90:hover{opacity:.9}}.active\\:scale-110:active{--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x) var(--tw-scale-y)}.active\\:cursor-grabbing:active{cursor:grabbing}.disabled\\:text-muted:disabled{color:var(--muted)}@media (hover:hover){.disabled\\:hover\\:bg-transparent:disabled:hover{background-color:#0000}}:where([data-state=on]) .in-data-\\[state\\=on\\]\\:text-accent-contrast\\/75{color:var(--accent-contrast)}@supports (color:color-mix(in lab, red, red)){:where([data-state=on]) .in-data-\\[state\\=on\\]\\:text-accent-contrast\\/75{color:color-mix(in oklab, var(--accent-contrast) 75%, transparent)}}:where([data-state=on]) .in-data-\\[state\\=on\\]\\:text-ink{color:var(--ink)}.aria-pressed\\:bg-ink[aria-pressed=true]{background-color:var(--ink)}.aria-pressed\\:text-ink-contrast[aria-pressed=true]{color:var(--ink-contrast)}.data-\\[disabled\\]\\:cursor-default[data-disabled]{cursor:default}.data-\\[highlighted\\]\\:bg-raise[data-highlighted],.data-\\[selected\\=true\\]\\:bg-raise[data-selected=true]{background-color:var(--raise)}.data-\\[state\\=closed\\]\\:animate-\\[fade-out_150ms_ease-in_forwards\\][data-state=closed]{animation:.15s ease-in forwards fade-out}.data-\\[state\\=on\\]\\:bg-accent[data-state=on]{background-color:var(--accent)}.data-\\[state\\=on\\]\\:bg-panel[data-state=on]{background-color:var(--panel)}.data-\\[state\\=on\\]\\:text-accent-contrast[data-state=on]{color:var(--accent-contrast)}.data-\\[state\\=on\\]\\:text-ink[data-state=on]{color:var(--ink)}.data-\\[state\\=on\\]\\:ring-2[data-state=on]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.data-\\[state\\=on\\]\\:ring-silver-edge[data-state=on]{--tw-ring-color:var(--silver-edge)}@media (prefers-reduced-motion:reduce){.motion-reduce\\:transition-none{transition-property:none}}@container (width>=24rem){.\\@sm\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@container (width>=28rem){.\\@md\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.\\@md\\:gap-6{gap:calc(var(--spacing) * 6)}}@container (width>=36rem){.\\@xl\\:mr-1{margin-right:var(--spacing)}.\\@xl\\:min-h-\\[148px\\]{min-height:148px}.\\@xl\\:w-auto{width:auto}.\\@xl\\:basis-0{flex-basis:0}.\\@xl\\:flex-nowrap{flex-wrap:nowrap}}@container studio (width>=640px){.sm\\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\\:flex-row{flex-direction:row}.sm\\:items-center{align-items:center}.sm\\:p-4{padding:calc(var(--spacing) * 4)}}@container studio (width>=768px){.md\\:relative{position:relative}.md\\:order-1{order:1}.md\\:order-2{order:2}.md\\:flex{display:flex}.md\\:h-full{height:100%}.md\\:min-h-0{min-height:0}.md\\:w-\\[340px\\]{width:340px}.md\\:flex-1{flex:1}.md\\:shrink-0{flex-shrink:0}.md\\:flex-row{flex-direction:row}.md\\:overflow-y-auto{overflow-y:auto}.md\\:border-r{border-right-style:var(--tw-border-style);border-right-width:1px}}@container studio (width>=1024px){.lg\\:absolute{position:absolute}.lg\\:bottom-3{bottom:calc(var(--spacing) * 3)}.lg\\:left-3{left:calc(var(--spacing) * 3)}.lg\\:z-10{z-index:10}.lg\\:flex{display:flex}.lg\\:min-h-\\[396px\\]{min-height:396px}.lg\\:min-h-\\[420px\\]{min-height:420px}.lg\\:w-\\[380px\\]{width:380px}.lg\\:w-auto{width:auto}.lg\\:max-w-\\[calc\\(100\\%-110px\\)\\]{max-width:calc(100% - 110px)}.lg\\:flex-nowrap{flex-wrap:nowrap}.lg\\:items-center{align-items:center}.lg\\:gap-6{gap:calc(var(--spacing) * 6)}.lg\\:border-0{border-style:var(--tw-border-style);border-width:0}.lg\\:bg-transparent{background-color:#0000}.lg\\:p-0{padding:0}}@media (prefers-reduced-transparency:reduce){.transparency-reduce\\:bg-bench{background-color:var(--bench)}.transparency-reduce\\:backdrop-blur-none{--tw-backdrop-blur: ;-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:px-2\\.5 [cmdk-group-heading]{padding-inline:calc(var(--spacing) * 2.5)}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:pt-2 [cmdk-group-heading]{padding-top:calc(var(--spacing) * 2)}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:pb-1 [cmdk-group-heading]{padding-bottom:var(--spacing)}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:text-label [cmdk-group-heading]{font-size:var(--text-label);line-height:var(--tw-leading,var(--text-label--line-height));letter-spacing:var(--tw-tracking,var(--text-label--letter-spacing));font-weight:var(--tw-font-weight,var(--text-label--font-weight))}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:text-muted [cmdk-group-heading]{color:var(--muted)}.\\[\\&\\>\\*\\]\\:pointer-events-auto>*{pointer-events:auto}}html[dir=ltr],[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%)}html[dir=rtl],[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%)}[data-sonner-toaster]{width:var(--width);--gray1:#fcfcfc;--gray2:#f8f8f8;--gray3:#f3f3f3;--gray4:#ededed;--gray5:#e8e8e8;--gray6:#e2e2e2;--gray7:#dbdbdb;--gray8:#c7c7c7;--gray9:#8f8f8f;--gray10:#858585;--gray11:#6f6f6f;--gray12:#171717;--border-radius:8px;box-sizing:border-box;z-index:999999999;outline:none;margin:0;padding:0;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;list-style:none;transition:transform .4s;position:fixed}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translate(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);opacity:0;transform:var(--y);touch-action:none;box-sizing:border-box;overflow-wrap:anywhere;outline:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;position:absolute}[data-sonner-toast][data-styled=true]{background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);width:var(--width);align-items:center;gap:6px;padding:16px;font-size:13px;display:flex;box-shadow:0 4px 12px #0000001a}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}[data-sonner-toast][data-y-position=top]{--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap));top:0}[data-sonner-toast][data-y-position=bottom]{--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap));bottom:0}[data-sonner-toast][data-styled=true] [data-description]{color:#3f3f3f;font-weight:400;line-height:1.4}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{color:inherit;font-weight:500;line-height:1.5}[data-sonner-toast][data-styled=true] [data-icon]{width:16px;height:16px;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end);flex-shrink:0;justify-content:flex-start;align-items:center;display:flex;position:relative}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform-origin:50%;animation:.3s forwards sonner-fade-in;transform:scale(.8)}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}[data-sonner-toast][data-styled=true] [data-button]{height:24px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);cursor:pointer;border:none;border-radius:4px;outline:none;flex-shrink:0;align-items:center;padding-left:8px;padding-right:8px;font-size:12px;font-weight:500;transition:opacity .4s,box-shadow .2s;display:flex}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px #0006}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:#00000014}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:#ffffff4d}[data-sonner-toast][data-styled=true] [data-close-button]{left:var(--toast-close-button-start);right:var(--toast-close-button-end);width:20px;height:20px;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);cursor:pointer;z-index:1;border-radius:50%;justify-content:center;align-items:center;padding:0;transition:opacity .1s,background .2s,border-color .2s;display:flex;position:absolute;top:0}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]:before{content:"";z-index:-1;height:100%;position:absolute;left:-100%;right:-100%}[data-sonner-toast][data-y-position=top][data-swiping=true]:before{bottom:50%;transform:scaleY(3)translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]:before{top:50%;transform:scaleY(3)translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]:before{content:"";position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]:after{content:"";height:calc(var(--gap) + 1px);width:100%;position:absolute;bottom:100%;left:0}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[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)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]:before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0px)) translateX(var(--swipe-amount-x,0px));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;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) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{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 (width<=600px){[data-sonner-toaster]{right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%;position:fixed}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{width:calc(100% - var(--mobile-offset-left) * 2);left:0;right:0}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:#ecfdf3;--success-border:#bffcd9;--success-text:#008a2e;--info-bg:#f0f8ff;--info-border:#dde7fd;--info-text:#0973dc;--warning-bg:#fffcf0;--warning-border:#fbeeb1;--warning-text:#dc7609;--error-bg:#fff0f0;--error-border:#ffe0e1;--error-text:#e60000}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:#333;--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:#1f1f1f;--normal-border:#333;--normal-border-hover:#404040;--normal-text:var(--gray1);--success-bg:#001f0f;--success-border:#003d1c;--success-text:#59f3a6;--info-bg:#000d1f;--info-border:#19233e;--info-text:#5896f3;--warning-bg:#1d1f00;--warning-border:#2e2e00;--warning-text:#f3cf58;--error-bg:#2d0607;--error-border:#4d0408;--error-text:#ff9ea1}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[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);z-index:10;position:absolute;inset:0}.sonner-loading-wrapper[data-visible=false]{transform-origin:50%;animation:.2s forwards sonner-fade-out}.sonner-spinner{height:var(--size);width:var(--size);position:relative;top:50%;left:50%}.sonner-loading-bar{background:var(--gray11);border-radius:6px;width:24%;height:8%;animation:1.2s linear infinite sonner-spin;position:absolute;top:-3.9%;left:-10%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg)translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg)translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg)translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg)translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg)translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg)translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg)translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg)translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg)translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg)translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg)translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg)translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}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{transform-origin:50%;transition:opacity .2s,transform .2s;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8)translate(-50%,-50%)}@supports (transition-timing-function:linear(0, 1)){:host{--ease-spring:linear(0, .044 5%, .143 10%, .383 20%, .592 30%, .743 40%, .844 50%, .907 60%, .946 70%, .969 80%, .982 90%, 1)}}:host{--bench:#f2f2f3;--panel:#fff;--raise:#f5f5f6;--ink:#141416;--ink-contrast:#fff;--muted:#6b6d73;--rule:#e3e3e6;--accent:#18181b;--accent-contrast:#fff;--silver-edge:#b4b6bd;--hero:linear-gradient(145deg, #2a2b30 0%, #121215 55%, #050506 100%);--hero-edge:#26272b;--hero-warn:#e08a4f;--silver:linear-gradient(135deg, #f5f5f7 0%, #c9cbd1 45%, #9a9ca3 100%);--hero-ink:#f4f4f5;--hero-muted:#a7a8ae;--scrim:#0006;--ok:#2f8f5b;--warn:#b4561f;--danger:#b8322a;--viewer-bg:#ecedee;--bed:#dddee1;--grid:#c9cacf;--bed-edge:#9c9da3;--travel:#2f6fdb;--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light}[data-theme=dark]{--bench:#0b0b0d;--panel:#141417;--raise:#1c1c20;--ink:#ececef;--ink-contrast:#0b0b0d;--muted:#9a9ba2;--rule:#2a2a2f;--accent:#dcdde2;--accent-contrast:#111114;--silver-edge:#c9cbd1;--hero:linear-gradient(145deg, #3a3b41 0%, #1d1e22 60%, #101012 100%);--hero-edge:#3a3b41;--scrim:#0009;--ok:#4cb27a;--warn:#e08a4f;--danger:#ef6b5f;--viewer-bg:#0f0f11;--bed:#1b1b1f;--grid:#2a2a2f;--bed-edge:#55565c;--travel:#6fa0ff;--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}@media (prefers-contrast:more){:host{--muted:#45474c;--rule:#a4a6ab;--hero-muted:#d6d7db}[data-theme=dark]{--muted:#c6c7cd;--rule:#5c5d63}}@keyframes pop-in{0%{opacity:0;transform:scale(.96)}}@keyframes pop-out{to{opacity:0;transform:scale(.96)}}@keyframes fade-in{0%{opacity:0}}@keyframes fade-out{to{opacity:0}}@media (prefers-reduced-motion:reduce){.animate-spin{animation-duration:2.5s}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}`,qC=/@(?:property\s+[^{]+|font-face\s*)\{[^}]*\}/g;function JC(e){let t=e.match(qC)||[];return{shadow:e.replace(qC,``),page:t.join(``)}}var YC=e=>e===`advanced`?`advanced`:`simple`;function XC(){let e=null,t=[],n=e=>{let n=t;t=[],n.forEach(e)};return{get:()=>e?Promise.resolve(e):new Promise((e,n)=>t.push({resolve:e,reject:n})),set:t=>{e=t||null,e&&n(t=>t.resolve(e))},fail:e=>n(t=>t.reject(e))}}var ZC=[`light`,`dark`,`system`],QC=`slicer-studio: open() works in advanced mode only`,$C=e=>{let t=new CSSStyleSheet;return t.replaceSync(e),t},ew=e=>{document.adoptedStyleSheets=[...document.adoptedStyleSheets,e]},tw=null;function nw(){if(tw)return tw;let{shadow:e,page:t}=JC(KC);return tw=$C(e),ew($C(t)),import(`./chunks/fonts-DxaZCWS1.js`).then(({default:e})=>ew($C(e))),tw}function rw(){customElements.define(`slicer-studio`,class extends HTMLElement{static observedAttributes=[`api-url`,`mode`,`theme`,`config`];#e=null;#t=null;#n=null;#r={};#i={opener:XC()};get config(){return this.#r}set config(e){this.#r=cS(e),this.#t&&this.#o()}getPrice(){return this.#i.getPrice?.()}open(e){return YC(this.getAttribute(`mode`))===`advanced`?this.#i.opener.get().then(t=>t(e)):Promise.reject(/* @__PURE__ */ Error(QC))}connectedCallback(){if(clearTimeout(this.#n),Object.hasOwn(this,`config`)){let e=this.config;delete this.config,this.config=e}this.#e||this.#a(),this.#t??=(0,Rr.createRoot)(this.#e.layout),this.#o()}disconnectedCallback(){this.#n=setTimeout(()=>{this.#t.unmount(),this.#t=null})}attributeChangedCallback(e,t,n){e===`mode`&&YC(n)!==`advanced`&&this.#i.opener.fail(/* @__PURE__ */ Error(QC)),e===`api-url`&&n!==t&&this.#i.opener.set(null),e===`config`?this.config=n:this.#t&&this.#o()}#a(){let e=this.attachShadow({mode:`open`});e.adoptedStyleSheets=[nw()];let t=(e,t)=>t.appendChild(Object.assign(document.createElement(`div`),{className:e})),n=t(`studio-theme`,e);this.#e={root:n,layout:t(`studio-layout`,n),portal:t(`studio-portals`,n)}}#o(){let e=this.getAttribute(`api-url`)||``,t=this.getAttribute(`theme`);this.#t.render((0,G.createElement)(G.StrictMode,null,(0,G.createElement)(GC,{key:e,...this.#e,apiUrl:e,config:this.#r,actions:this.#i,mode:YC(this.getAttribute(`mode`)),theme:ZC.includes(t)?t:null,emit:(e,t,{cancelable:n=!1}={})=>this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0,cancelable:n}))})))}})}typeof customElements<`u`&&!customElements.get(`slicer-studio`)&&rw();