foss-design 0.9.11 → 0.9.13

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.
Files changed (26) hide show
  1. package/dist/cli.js +1064 -176
  2. package/dist/viewer/assets/index-BOLNePag.css +2 -0
  3. package/dist/viewer/assets/index-BrtsfBgT.js +163 -0
  4. package/dist/viewer/index.html +2 -2
  5. package/dist/viewer-lib/index.js +4280 -1822
  6. package/dist/viewer-lib/styles.css +140 -5
  7. package/dist/viewer-lib/types/src/shared/drawings.d.ts +153 -0
  8. package/dist/viewer-lib/types/viewer/src/lib/drawings.d.ts +61 -0
  9. package/dist/viewer-lib/types/viewer/src/lib/source.d.ts +6 -0
  10. package/dist/viewer-lib/types/viewer/src/lib/viewer.d.ts +3 -0
  11. package/dist/viewer-lib/types/viewer/src/library.d.ts +1 -0
  12. package/dist/viewer-lib/types/viewer/src/pages/canvas/board.d.ts +16 -0
  13. package/dist/viewer-lib/types/viewer/src/pages/canvas/camera.d.ts +7 -0
  14. package/dist/viewer-lib/types/viewer/src/pages/canvas/canvas-bar.d.ts +14 -3
  15. package/dist/viewer-lib/types/viewer/src/pages/canvas/drawing/editor.d.ts +68 -0
  16. package/dist/viewer-lib/types/viewer/src/pages/canvas/drawing/strokes.d.ts +15 -0
  17. package/dist/viewer-lib/types/viewer/src/pages/canvas/drawing-capture.d.ts +18 -0
  18. package/dist/viewer-lib/types/viewer/src/pages/canvas/layout.d.ts +2 -0
  19. package/dist/viewer-lib/types/viewer/src/pages/canvas/markup.d.ts +26 -0
  20. package/dist/viewer-lib/types/viewer/src/pages/canvas/view-state.d.ts +2 -0
  21. package/dist/viewer-lib/types/viewer/src/pages/canvas/viewport.d.ts +4 -2
  22. package/dist/viewer-lib/types/viewer/src/ui/combobox.d.ts +25 -0
  23. package/dist/viewer-lib/types/viewer/src/ui/icon-paths.d.ts +8 -0
  24. package/package.json +4 -1
  25. package/dist/viewer/assets/index-Cy6JlR85.css +0 -2
  26. package/dist/viewer/assets/index-mvGp1q3N.js +0 -159
@@ -0,0 +1,163 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var j=/\/+/g;function M(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function ee(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+M(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(j,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(j,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+M(a,u),c+=N(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+M(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(ee(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function te(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var ne=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)};function F(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,ne)}catch(e){ne(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function re(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else F(re.bind(null,e))}var ie={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ie,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=re,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=k,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:te}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=F,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.0`})),d=o(((e,t)=>{t.exports=u()})),f=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d();function n(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 r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:o,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=u(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=u(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.0`})),h=o(((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=m()})),g=o((e=>{var t=p(),n=d(),r=h();function i(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 a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(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 s(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 c(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 l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(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 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(i(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`),ee=Symbol.for(`react.profiler`),N=Symbol.for(`react.consumer`),P=Symbol.for(`react.context`),te=Symbol.for(`react.forward_ref`),ne=Symbol.for(`react.suspense`),F=Symbol.for(`react.suspense_list`),re=Symbol.for(`react.memo`),ie=Symbol.for(`react.lazy`),ae=Symbol.for(`react.activity`),oe=Symbol.for(`react.legacy_hidden`),se=Symbol.for(`react.memo_cache_sentinel`),ce=Symbol.for(`react.view_transition`),le=Symbol.for(`react.recoverable`),ue=Symbol.iterator;function de(e){return typeof e!=`object`||!e?null:(e=ue&&e[ue]||e[`@@iterator`],typeof e==`function`?e:null)}var fe=Symbol.for(`react.client.reference`);function pe(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===fe?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case j:return`Fragment`;case ee:return`Profiler`;case M:return`StrictMode`;case ne:return`Suspense`;case F:return`SuspenseList`;case ae:return`Activity`;case ce:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case A:return`Portal`;case P:return e.displayName||`Context`;case N:return(e._context.displayName||`Context`)+`.Consumer`;case te:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case re:return t=e.displayName||null,t===null?pe(e.type)||`Memo`:t;case ie:t=e._payload,e=e._init;try{return pe(e(t))}catch{}}return null}var me=Array.isArray,I=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,he=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ge={pending:!1,data:null,method:null,action:null},_e=[],ve=-1;function L(e){return{current:e}}function ye(e){0>ve||(e.current=_e[ve],_e[ve]=null,ve--)}function be(e,t){ve++,_e[ve]=e.current,e.current=t}var xe=L(null),Se=L(null),Ce=L(null),we=L(null);function Te(e,t){switch(be(Ce,t),be(Se,e),be(xe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?gp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=gp(t),e=_p(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ye(xe),be(xe,e)}function Ee(){ye(xe),ye(Se),ye(Ce)}function De(e){var t=e.memoizedState;t!==null&&(ph._currentValue=t.memoizedState,be(we,e)),t=xe.current;var n=_p(t,e.type);t!==n&&(be(Se,e),be(xe,n))}function Oe(e){Se.current===e&&(ye(xe),ye(Se)),we.current===e&&(ye(we),ph._currentValue=ge)}var ke,Ae;function R(e){if(ke===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ke=t&&t[1]||``,Ae=-1<e.stack.indexOf(`
2
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
+ `+ke+e+Ae}var je=!1;function Me(e,t){if(!e||je)return``;je=!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
+ `),l=s.split(`
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{je=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?R(n):``}function Ne(e,t){switch(e.tag){case 26:case 27:case 5:return R(e.type);case 16:return R(`Lazy`);case 13:return e.child!==t&&t!==null?R(`Suspense Fallback`):R(`Suspense`);case 19:return R(`SuspenseList`);case 0:case 15:return Me(e.type,!1);case 11:return Me(e.type.render,!1);case 1:return Me(e.type,!0);case 31:return R(`Activity`);case 30:return R(`ViewTransition`);default:return``}}function Pe(e){try{var t=``,n=null;do t+=Ne(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
+ Error generating stack: `+e.message+`
8
+ `+e.stack}}var Fe=Object.prototype.hasOwnProperty,Ie=t.unstable_scheduleCallback,Le=t.unstable_cancelCallback,Re=t.unstable_shouldYield,ze=t.unstable_requestPaint,Be=t.unstable_now,Ve=t.unstable_getCurrentPriorityLevel,He=t.unstable_ImmediatePriority,Ue=t.unstable_UserBlockingPriority,We=t.unstable_NormalPriority,Ge=t.unstable_LowPriority,Ke=t.unstable_IdlePriority,qe=t.log,Je=t.unstable_setDisableYieldValue,Ye=null,Xe=null;function Ze(e){if(typeof qe==`function`&&Je(e),Xe&&typeof Xe.setStrictMode==`function`)try{Xe.setStrictMode(Ye,e)}catch{}}var Qe=Math.clz32?Math.clz32:tt,$e=Math.log,et=Math.LN2;function tt(e){return e>>>=0,e===0?32:31-($e(e)/et|0)|0}var nt=256,rt=262144,it=4194304;function at(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 ot(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=at(n))):i=at(o):i=at(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=at(n))):i=at(o)):i=at(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 st(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ct(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-Qe(n),i=1<<r;t|=e[r],n&=~i}return t}function lt(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 ut(){var e=it;return it<<=1,!(it&62914560)&&(it=4194304),e}function dt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ft(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function pt(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-Qe(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&&mt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function mt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Qe(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function ht(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Qe(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function gt(e,t){var n=t&-t;return n=n&42?1:_t(n),(n&(e.suspendedLanes|t))===0?n:0}function _t(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 vt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function yt(){var e=he.p;return e===0?(e=window.event,e===void 0?32:kh(e.type)):e}function bt(e,t){var n=he.p;try{return he.p=e,t()}finally{he.p=n}}var xt=Math.random().toString(36).slice(2),St=`__reactFiber$`+xt,Ct=`__reactProps$`+xt,wt=`__reactContainer$`+xt,Tt=`__reactEvents$`+xt,Et=`__reactListeners$`+xt,Dt=`__reactHandles$`+xt,Ot=`__reactResources$`+xt,kt=`__reactMarker$`+xt,At=`__reactLoad$`+xt;function jt(e){delete e[St],delete e[Ct],delete e[Et],delete e[Dt]}function Mt(e){var t;if(t=e[St])return t;for(var n=e.parentNode;n;){if(t=n[wt]||n[St]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=vm(e);e!==null;){if(n=e[St])return n;e=vm(e)}return t}e=n,n=e.parentNode}return null}function Nt(e){if(e=e[St]||e[wt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Pt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Ft(e){var t=e[Ot];return t||=e[Ot]={hoistableStyles:new Map,hoistableScripts:new Map},t}function It(e){e[kt]=!0}function Lt(e){e[At]=void 0}var Rt=new Set,zt={};function Bt(e,t){Vt(e,t),Vt(e+`Capture`,t)}function Vt(e,t){for(zt[e]=t,e=0;e<t.length;e++)Rt.add(t[e])}var Ht=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]*$`),Ut={},Wt={};function Gt(e){return Fe.call(Wt,e)?!0:Fe.call(Ut,e)?!1:Ht.test(e)?Wt[e]=!0:(Ut[e]=!0,!1)}var Kt=!1;function qt(){var e=Kt;return Kt=!1,e}function Jt(e,t,n){if(Gt(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 Yt(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 Xt(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 Zt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Qt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function $t(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 en(e){if(!e._valueTracker){var t=Qt(e)?`checked`:`value`;e._valueTracker=$t(e,t,``+e[t])}}function tn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Qt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var nn=/[\n"\\]/g;function rn(e){return e.replace(nn,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function an(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=``+Zt(t)):e.value!==``+Zt(t)&&(e.value=``+Zt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):sn(e,Zt(n)):o===`number`&&e.value==t?sn(e,Zt(e.value)):sn(e,Zt(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=``+Zt(s):e.removeAttribute(`name`)}function on(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)){en(e);return}n=n==null?``:``+Zt(n),t=t==null?n:``+Zt(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),en(e)}function sn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function cn(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=``+Zt(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 ln(e,t,n){if(t!=null&&(t=``+Zt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Zt(n)}function un(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(me(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Zt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),en(e)}function dn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var fn=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 pn(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||fn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function mn(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(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]=``,Kt=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(pn(e,a,r),Kt=!0)}else for(var o in t)t.hasOwnProperty(o)&&pn(e,o,t[o])}function hn(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 gn=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`]]),_n=/^[\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 vn(e){return _n.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function yn(){}var bn=null;function xn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Sn=null,Cn=null;function wn(e){var t=Nt(e);if(t&&(e=t.stateNode)){var n=e[Ct]||null;a:switch(e=t.stateNode,t.type){case`input`:if(an(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="`+rn(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[Ct]||null;if(!a)throw Error(i(90));an(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&tn(r)}break a;case`textarea`:ln(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&cn(e,!!n.multiple,t,!1)}}}var Tn=!1;function En(e,t,n){if(Tn)return e(t,n);Tn=!0;try{return e(t)}finally{if(Tn=!1,(Sn!==null||Cn!==null)&&(Wd(),Sn&&(t=Sn,e=Cn,Cn=Sn=null,wn(t),e)))for(t=0;t<e.length;t++)wn(e[t])}}function Dn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Ct]||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(i(231,t,typeof n));return n}var On=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,kn=!1;if(On)try{var An={};Object.defineProperty(An,"passive",{get:function(){kn=!0}}),window.addEventListener(`test`,An,An),window.removeEventListener(`test`,An,An)}catch{kn=!1}var jn=null,Mn=null,Nn=null;function Pn(){if(Nn)return Nn;var e,t=Mn,n=t.length,r,i=`value`in jn?jn.value:jn.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 Nn=i.slice(e,1<r?1-r:void 0)}function Fn(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 In(){return!0}function Ln(){return!1}function Rn(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)?In:Ln,this.isPropagationStopped=Ln,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=In)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=In)},persist:function(){},isPersistent:In}),t}var zn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bn=Rn(zn),Vn=D({},zn,{view:0,detail:0}),Hn=Rn(Vn),Un,Wn,Gn,Kn=D({},Vn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:rr,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!==Gn&&(Gn&&e.type===`mousemove`?(Un=e.screenX-Gn.screenX,Wn=e.screenY-Gn.screenY):Wn=Un=0,Gn=e),Un)},movementY:function(e){return`movementY`in e?e.movementY:Wn}}),qn=Rn(Kn),Jn=Rn(D({},Kn,{dataTransfer:0})),Yn=Rn(D({},Vn,{relatedTarget:0})),Xn=Rn(D({},zn,{animationName:0,elapsedTime:0,pseudoElement:0})),Zn=Rn(D({},zn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Qn=Rn(D({},zn,{data:0})),$n={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},er={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`},tr={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function nr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=tr[e])?!!t[e]:!1}function rr(){return nr}var ir=Rn(D({},Vn,{key:function(e){if(e.key){var t=$n[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Fn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?er[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:rr,charCode:function(e){return e.type===`keypress`?Fn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Fn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),ar=Rn(D({},Kn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),or=Rn(D({},zn,{submitter:0})),sr=Rn(D({},Vn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:rr})),cr=Rn(D({},zn,{propertyName:0,elapsedTime:0,pseudoElement:0})),lr=Rn(D({},Kn,{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})),ur=Rn(D({},zn,{newState:0,oldState:0,source:0})),dr=[9,13,27,32],fr=On&&`CompositionEvent`in window,pr=null;On&&`documentMode`in document&&(pr=document.documentMode);var mr=On&&`TextEvent`in window&&!pr,hr=On&&(!fr||pr&&8<pr&&11>=pr),gr=` `,_r=!1;function vr(e,t){switch(e){case`keyup`:return dr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function yr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var br=!1;function z(e,t){switch(e){case`compositionend`:return yr(t);case`keypress`:return t.which===32?(_r=!0,gr):null;case`textInput`:return e=t.data,e===gr&&_r?null:e;default:return null}}function xr(e,t){if(br)return e===`compositionend`||!fr&&vr(e,t)?(e=Pn(),Nn=Mn=jn=null,br=!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 hr&&t.locale!==`ko`?null:t.data;default:return null}}var Sr={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 Cr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Sr[e.type]:t===`textarea`}function wr(e,t,n,r){Sn?Cn?Cn.push(r):Cn=[r]:Sn=r,t=$f(t,`onChange`),0<t.length&&(n=new Bn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Tr=null,Er=null;function Dr(e){qf(e,0)}function Or(e){if(tn(Pt(e)))return e}function kr(e,t){if(e===`change`)return t}var Ar=!1;if(On){var jr;if(On){var Mr=`oninput`in document;if(!Mr){var Nr=document.createElement(`div`);Nr.setAttribute(`oninput`,`return;`),Mr=typeof Nr.oninput==`function`}jr=Mr}else jr=!1;Ar=jr&&(!document.documentMode||9<document.documentMode)}function Pr(){Tr&&(Tr.detachEvent(`onpropertychange`,Fr),Er=Tr=null)}function Fr(e){if(e.propertyName===`value`&&Or(Er)){var t=[];wr(t,Er,e,xn(e)),En(Dr,t)}}function Ir(e,t,n){e===`focusin`?(Pr(),Tr=t,Er=n,Tr.attachEvent(`onpropertychange`,Fr)):e===`focusout`&&Pr()}function Lr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Or(Er)}function Rr(e,t){if(e===`click`)return Or(t)}function zr(e,t){if(e===`input`||e===`change`)return Or(t)}function Br(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Vr=typeof Object.is==`function`?Object.is:Br;function Hr(e,t){if(Vr(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(!Fe.call(t,i)||!Vr(e[i],t[i]))return!1}return!0}function Ur(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 Wr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Gr(e,t){var n=Wr(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=Wr(n)}}function Kr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Kr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function qr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ur(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=Ur(e.document)}return t}function Jr(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 Yr=On&&`documentMode`in document&&11>=document.documentMode,Xr=null,Zr=null,Qr=null,$r=!1;function ei(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;$r||Xr==null||Xr!==Ur(r)||(r=Xr,`selectionStart`in r&&Jr(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}),Qr&&Hr(Qr,r)||(Qr=r,r=$f(Zr,`onSelect`),0<r.length&&(t=new Bn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Xr)))}function ti(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var ni={animationend:ti(`Animation`,`AnimationEnd`),animationiteration:ti(`Animation`,`AnimationIteration`),animationstart:ti(`Animation`,`AnimationStart`),transitionrun:ti(`Transition`,`TransitionRun`),transitionstart:ti(`Transition`,`TransitionStart`),transitioncancel:ti(`Transition`,`TransitionCancel`),transitionend:ti(`Transition`,`TransitionEnd`)},ri={},ii={};On&&(ii=document.createElement(`div`).style,`AnimationEvent`in window||(delete ni.animationend.animation,delete ni.animationiteration.animation,delete ni.animationstart.animation),`TransitionEvent`in window||delete ni.transitionend.transition);function ai(e){if(ri[e])return ri[e];if(!ni[e])return e;var t=ni[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ii)return ri[e]=t[n];return e}var oi=ai(`animationend`),si=ai(`animationiteration`),ci=ai(`animationstart`),li=ai(`transitionrun`),ui=ai(`transitionstart`),di=ai(`transitioncancel`),fi=ai(`transitionend`),pi=new Map,mi=`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(` `);mi.push(`scrollEnd`);function hi(e,t){pi.set(e,t),Bt(t,[e])}var gi=0;function _i(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=Td.identifierPrefix;var n=gi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function vi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Nd;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 yi(e,t){return e=vi(e),t=vi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var bi=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)},xi=[],Si=0,Ci=0;function wi(){for(var e=Si,t=Ci=Si=0;t<e;){var n=xi[t];xi[t++]=null;var r=xi[t];xi[t++]=null;var i=xi[t];xi[t++]=null;var a=xi[t];if(xi[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&&Oi(n,i,a)}}function Ti(e,t,n,r){xi[Si++]=e,xi[Si++]=t,xi[Si++]=n,xi[Si++]=r,Ci|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Ei(e,t,n,r){return Ti(e,t,n,r),ki(e)}function Di(e,t){return Ti(e,null,null,t),ki(e)}function Oi(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-Qe(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ki(e){if(50<Pd)throw Pd=0,Fd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ai={};function ji(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 Mi(e,t,n,r){return new ji(e,t,n,r)}function Ni(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Pi(e,t){var n=e.alternate;return n===null?(n=Mi(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 Fi(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 Ii(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Ni(r)&&(s=1);else if(typeof r==`string`)s=$m(e,n,xe.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case ae:return e=Mi(31,n,t,a),e.elementType=ae,e.lanes=o,e;case j:return Li(n.children,a,o,t);case M:s=8,a|=24;break;case ee:return e=Mi(12,n,t,a|2),e.elementType=ee,e.lanes=o,e;case ne:return e=Mi(13,n,t,a),e.elementType=ne,e.lanes=o,e;case F:return e=Mi(19,n,t,a),e.elementType=F,e.lanes=o,e;case oe:case ce:return e=a|32,e=Mi(30,n,t,e),e.elementType=ce,e.lanes=o,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 te:s=11;break a;case re:s=14;break a;case ie:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Mi(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Li(e,t,n,r){return e=Mi(7,e,r,t),e.lanes=n,e}function Ri(e,t,n){return e=Mi(6,e,null,t),e.lanes=n,e}function zi(e){var t=Mi(18,null,null,0);return t.stateNode=e,t}function Bi(e,t,n){return t=Mi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Vi=new WeakMap;function Hi(e,t){if(typeof e==`object`&&e){var n=Vi.get(e);return n===void 0?(t={value:e,source:t,stack:Pe(t)},Vi.set(e,t),t):n}return{value:e,source:t,stack:Pe(t)}}var Ui=[],Wi=0,Gi=null,Ki=0,qi=[],Ji=0,Yi=null,Xi=1,Zi=``;function Qi(e,t){Ui[Wi++]=Ki,Ui[Wi++]=Gi,Gi=e,Ki=t}function $i(e,t,n){qi[Ji++]=Xi,qi[Ji++]=Zi,qi[Ji++]=Yi,Yi=e;var r=Xi;e=Zi;var i=32-Qe(r)-1;r&=~(1<<i),n+=1;var a=32-Qe(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Xi=1<<32-Qe(t)+i|n<<i|r,Zi=a+e}else Xi=1<<a|n<<i|r,Zi=e}function ea(e){e.return!==null&&(Qi(e,1),$i(e,1,0))}function ta(e){for(;e===Gi;)Gi=Ui[--Wi],Ui[Wi]=null,Ki=Ui[--Wi],Ui[Wi]=null;for(;e===Yi;)Yi=qi[--Ji],qi[Ji]=null,Zi=qi[--Ji],qi[Ji]=null,Xi=qi[--Ji],qi[Ji]=null}function na(e,t){qi[Ji++]=Xi,qi[Ji++]=Zi,qi[Ji++]=Yi,Xi=t.id,Zi=t.overflow,Yi=e}var ra=null,ia=null,B=!1,aa=null,oa=!1,sa=Error(i(519));function ca(e){throw ma(Hi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),sa}function la(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[St]=e,t[Ct]=r,n){case`dialog`:K(`cancel`,t),K(`close`,t);break;case`iframe`:case`object`:case`embed`:K(`load`,t);break;case`video`:case`audio`:for(n=0;n<Gf.length;n++)K(Gf[n],t);break;case`source`:K(`error`,t);break;case`img`:case`image`:case`link`:K(`error`,t),K(`load`,t);break;case`details`:K(`toggle`,t);break;case`input`:K(`invalid`,t),on(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:K(`invalid`,t);break;case`textarea`:K(`invalid`,t),un(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||ap(t.textContent,n)?(r.popover!=null&&(K(`beforetoggle`,t),K(`toggle`,t)),r.onScroll!=null&&K(`scroll`,t),r.onScrollEnd!=null&&K(`scrollend`,t),r.onClick!=null&&(t.onclick=yn),t=!0):t=!1,t||ca(e,!0)}function ua(e){for(ra=e.return;ra;)switch(ra.tag){case 5:case 31:case 13:oa=!1;return;case 27:case 3:oa=!0;return;default:ra=ra.return}}function da(e){if(e!==ra)return!1;if(!B)return ua(e),B=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||yp(e.type,e.memoizedProps)),n=!n),n&&ia&&ca(e),ua(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ia=_m(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ia=_m(e)}else t===27?(t=ia,Op(e.type)?(e=gm,gm=null,ia=e):ia=t):ia=ra?hm(e.stateNode.nextSibling):null;return!0}function fa(){ia=ra=null,B=!1}function pa(){var e=aa;return e!==null&&(_d===null?_d=e:_d.push.apply(_d,e),aa=null),e}function ma(e){aa===null?aa=[e]:aa.push(e)}var ha=L(null),ga=null,_a=null;function va(e,t,n){be(ha,t._currentValue),t._currentValue=n}function ya(e){e._currentValue=ha.current,ye(ha)}function ba(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 xa(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),ba(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),ba(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),ba(a.return,n,e),s=a.child,s=s===null?null:s.sibling):s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Sa(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Vr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===we.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[ph]:e.push(ph))}a=a.return}return e!==null&&xa(t,e,n,r),t.flags|=262144,e!==null}function Ca(e){for(e=e.firstContext;e!==null;){if(!Vr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function wa(e){ga=e,_a=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ta(e){return Da(ga,e)}function Ea(e,t){return ga===null&&wa(e),Da(e,t)}function Da(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},_a===null){if(e===null)throw Error(i(308));_a=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else _a=_a.next=t;return n}var Oa=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()})}},ka=t.unstable_scheduleCallback,Aa=t.unstable_NormalPriority,ja={$$typeof:P,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ma(){return{controller:new Oa,data:new Map,refCount:0}}function Na(e){e.refCount--,e.refCount===0&&ka(Aa,function(){e.controller.abort()})}function Pa(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 Fa=null;function Ia(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var La=null,Ra=0,za=0,Ba=null;function Va(e,t){if(La===null){var n=La=[];Ra=0,za=Bf(),Ba={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Ra++,t.then(Ha,Ha),t}function Ha(){if(--Ra===0&&(Fa=null,La!==null)){Ba!==null&&(Ba.status=`fulfilled`);var e=La;La=null,za=0,Ba=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ua(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 Wa=I.S;I.S=function(e,t){if(bd=Be(),typeof t==`object`&&t&&typeof t.then==`function`&&Va(e,t),Fa!==null)for(var n=Ef;n!==null;)Pa(n,Fa),n=n.next;if(n=e.types,n!==null){for(var r=Ef;r!==null;)Pa(r,n),r=r.next;if(za!==0){r=Fa,r===null&&(r=Fa=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Wa!==null&&Wa(e,t)};var Ga=L(null);function Ka(){var e=Ga.current;return e===null?rd.pooledCache:e}function qa(e,t){t===null?be(Ga,Ga.current):be(Ga,t.pool)}function Ja(){var e=Ka();return e===null?null:{parent:ja._currentValue,pool:e}}var Ya=Error(i(460)),Xa=Error(i(474)),Za=Error(i(542)),Qa={then:function(){}};function $a(e){return e=e.status,e===`fulfilled`||e===`rejected`}function eo(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(yn,yn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,io(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(yn,yn);else{if(e=rd,e!==null&&100<e.shellSuspendCounter)throw Error(i(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,io(e),e}throw no=t,Ya}}function to(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(no=e,Ya):e}}var no=null;function ro(){if(no===null)throw Error(i(459));var e=no;return no=null,e}function io(e){if(e===Ya||e===Za)throw Error(i(483))}var ao=null,oo=0;function so(e){var t=oo;return oo+=1,ao===null&&(ao=[]),eo(ao,e,t)}function co(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function lo(e,t){throw t.$$typeof===O?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function uo(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=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=Pi(e,t),e.index=0,e.sibling=null,e}function o(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=Ri(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===j?(e=d(e,t,n.props.children,r,n.key),co(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===ie&&to(i)===t.type)?(t=a(t,n.props),co(t,n),t.return=e,t):(t=Ii(n.type,n.key,n.props,null,e.mode,r),co(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=Bi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=Li(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Ri(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case k:return n=Ii(t.type,t.key,t.props,null,e.mode,n),co(n,t),n.return=e,n;case A:return t=Bi(t,e.mode,n),t.return=e,t;case ie:return t=to(t),f(e,t,n)}if(me(t)||de(t))return t=Li(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,so(t),n);if(t.$$typeof===P)return f(e,Ea(e,t),n);lo(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 ie:return n=to(n),p(e,t,n,r)}if(me(n)||de(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,so(n),r);if(n.$$typeof===P)return p(e,t,Ea(e,n),r);lo(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 ie:return r=to(r),m(e,t,n,r,i)}if(me(r)||de(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,so(r),i);if(r.$$typeof===P)return m(e,t,n,Ea(t,r),i);lo(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=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),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),B&&Qi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return B&&Qi(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)),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),B&&Qi(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(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(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),B&&Qi(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return B&&Qi(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),B&&Qi(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===j&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case k:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===j){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),co(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===ie&&to(l)===r.type){n(e,r.sibling),c=a(r,o.props),co(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===j?(c=Li(o.props.children,e.mode,c,o.key),co(c,o),c.return=e,e=c):(c=Ii(o.type,o.key,o.props,null,e.mode,c),co(c,o),c.return=e,e=c)}return s(e);case A:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Bi(o,e.mode,c),c.return=e,e=c}return s(e);case ie:return o=to(o),_(e,r,o,c)}if(me(o))return h(e,r,o,c);if(de(o)){if(l=de(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,so(o),c);if(o.$$typeof===P)return _(e,r,Ea(e,o),c);lo(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=Ri(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{oo=0;var i=_(e,t,n,r);return ao=null,i}catch(t){if(t===Ya||t===Za)throw t;var a=Mi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var fo=uo(!0),po=uo(!1),mo=!1;function ho(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function go(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 _o(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function vo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,U&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ki(e),Oi(e,null,n),t}return Ti(e,r,t,n),ki(e)}function yo(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,ht(e,n)}}function bo(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;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var xo=!1;function So(){if(xo){var e=Ba;if(e!==null)throw e}}function Co(e,t,n,r){xo=!1;var i=e.updateQueue;mo=!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?(G&f)===f:(r&f)===f){f!==0&&f===za&&(xo=!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:mo=!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),dd|=o,e.lanes=o,e.memoizedState=d}}function wo(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function To(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)wo(n[e],t)}var Eo=L(null),Do=L(0);function Oo(e,t){e=ld,be(Do,e),be(Eo,t),ld=e|t.baseLanes}function ko(){be(Do,ld),be(Eo,Eo.current)}function Ao(){ld=Do.current,ye(Eo),ye(Do)}var jo=L(null),Mo=null;function No(e){var t=e.alternate;be(Ro,Ro.current&1),be(jo,e),Mo===null&&(t===null||Eo.current!==null||t.memoizedState!==null)&&(Mo=e)}function Po(e){be(Ro,Ro.current),be(jo,e),Mo===null&&(Mo=e)}function Fo(e){e.tag===22?(be(Ro,Ro.current),be(jo,e),Mo===null&&(Mo=e)):Io()}function Io(){be(Ro,Ro.current),be(jo,jo.current)}function Lo(e){ye(jo),Mo===e&&(Mo=null),ye(Ro)}var Ro=L(0);function zo(e,t){be(jo,jo.current),be(Ro,t)}function Bo(e){ye(Ro),ye(jo),Mo===e&&(Mo=null)}function Vo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||fm(n)||pm(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 Ho=0,V=null,Uo=null,Wo=null,Go=!1,Ko=!1,qo=!1,Jo=0,Yo=0,Xo=null,Zo=0;function Qo(){throw Error(i(321))}function $o(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Vr(e[n],t[n]))return!1;return!0}function es(e,t,n,r,i,a){return Ho=a,V=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,I.H=e===null||e.memoizedState===null?_c:vc,qo=!1,a=n(r,i),qo=!1,Ko&&(a=ns(t,n,r,i)),ts(e),a}function ts(e){I.H=gc;var t=Uo!==null&&Uo.next!==null;if(Ho=0,Wo=Uo=V=null,Go=!1,Yo=0,Xo=null,t)throw Error(i(300));e===null||Fc||(e=e.dependencies,e!==null&&Ca(e)&&(Fc=!0))}function ns(e,t,n,r){V=e;var a=0;do{if(Ko&&(Xo=null),Yo=0,Ko=!1,25<=a)throw Error(i(301));if(a+=1,Wo=Uo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}I.H=yc,o=t(n,r)}while(Ko);return o}function rs(){var e=I.H,t=e.useState()[0];return t=typeof t.then==`function`?us(t):t,e=e.useState()[0],(Uo===null?null:Uo.memoizedState)!==e&&(V.flags|=1024),t}function is(){var e=Jo!==0;return Jo=0,e}function as(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function os(e){if(Go){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Go=!1}Ho=0,Wo=Uo=V=null,Ko=!1,Yo=Jo=0,Xo=null}function ss(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Wo===null?V.memoizedState=Wo=e:Wo=Wo.next=e,Wo}function cs(){if(Uo===null){var e=V.alternate;e=e===null?null:e.memoizedState}else e=Uo.next;var t=Wo===null?V.memoizedState:Wo.next;if(t!==null)Wo=t,Uo=e;else{if(e===null)throw V.alternate===null?Error(i(467)):Error(i(310));Uo=e,e={memoizedState:Uo.memoizedState,baseState:Uo.baseState,baseQueue:Uo.baseQueue,queue:Uo.queue,next:null},Wo===null?V.memoizedState=Wo=e:Wo=Wo.next=e}return Wo}function ls(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function us(e){var t=Yo;return Yo+=1,Xo===null&&(Xo=[]),e=eo(Xo,e,t),t=V,(Wo===null?t.memoizedState:Wo.next)===null&&(t=t.alternate,I.H=t===null||t.memoizedState===null?_c:vc),e}function ds(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return us(e);if(e.$$typeof===le)return;if(e.$$typeof===P)return Ta(e)}throw Error(i(438,String(e)))}function fs(e){var t=null,n=V.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=V.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=ls(),V.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]=se;return t.index++,n}function ps(e,t){return typeof t==`function`?t(e):t}function ms(e){return hs(cs(),Uo,e)}function hs(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Ho&f)===f:(G&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===za&&(d=!0);else if((Ho&p)===p){u=u.next,p===za&&(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=o):l=l.next=f,V.lanes|=p,dd|=p;f=u.action,qo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,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=o):l=l.next=p,V.lanes|=f,dd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Vr(o,e.memoizedState)&&(Fc=!0,d&&(n=Ba,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function gs(e){var t=cs(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Vr(o,t.memoizedState)||(Fc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function _s(e,t,n){var r=V,a=cs(),o=B;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Vr((Uo||a).memoizedState,n);if(s&&(a.memoizedState=n,Fc=!0),a=a.queue,Hs(bs.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Wo!==null&&!!(Wo.memoizedState.tag&1),Ls(e?9:8,{destroy:void 0},ys.bind(null,r,a,n,t),null),e){if(r.flags|=2048,rd===null)throw Error(i(349));o||Ho&127||vs(r,t,n)}return n}function vs(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=V.updateQueue,t===null?(t=ls(),V.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ys(e,t,n,r){t.value=n,t.getSnapshot=r,xs(t)&&Ss(e)}function bs(e,t,n){return n(function(){xs(t)&&Ss(e)})}function xs(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Vr(e,n)}catch{return!0}}function Ss(e){var t=Di(e,2);t!==null&&zd(t,e,2)}function Cs(e){var t=ss();if(typeof e==`function`){var n=e;if(e=n(),qo){Ze(!0);try{n()}finally{Ze(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ps,lastRenderedState:e},t}function ws(e,t,n,r){return e.baseState=n,hs(e,Uo,typeof r==`function`?r:ps)}function Ts(e,t,n,r,a){if(pc(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};I.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Es(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Es(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=I.T,o={};o.types=a===null?null:a.types,I.T=o;try{var s=n(i,r),c=I.S;c!==null&&c(o,s),Ds(e,t,s)}catch(n){ks(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),I.T=a}}else try{a=n(i,r),Ds(e,t,a)}catch(n){ks(e,t,n)}}function Ds(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Os(e,t,n)},function(n){return ks(e,t,n)}):Os(e,t,n)}function Os(e,t,n){t.status=`fulfilled`,t.value=n,As(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Es(e,n)))}function ks(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,As(t),t=t.next;while(t!==r)}e.action=null}function As(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function js(e,t){return t}function Ms(e,t){if(B){var n=rd.formState;if(n!==null){a:{var r=V;if(B){if(ia){b:{for(var i=ia,a=oa;i.nodeType!==8;){if(!a){i=null;break b}if(i=hm(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ia=hm(i.nextSibling),r=i.data===`F!`;break a}}ca(r)}r=!1}r&&(t=n[0])}}return n=ss(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:js,lastRenderedState:t},n.queue=r,n=uc.bind(null,V,r),r.dispatch=n,r=Cs(!1),a=fc.bind(null,V,!1,r.queue),r=ss(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Ts.bind(null,V,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ns(e){return Ps(cs(),Uo,e)}function Ps(e,t,n){if(t=hs(e,t,js)[0],e=ms(ps)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=us(t)}catch(e){throw e===Ya?Za:e}else r=t;t=cs();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(V.flags|=2048,Ls(9,{destroy:void 0},Fs.bind(null,i,n),null)),[r,a,e]}function Fs(e,t){e.action=t}function Is(e){var t=cs(),n=Uo;if(n!==null)return Ps(t,n,e);cs(),t=t.memoizedState,n=cs();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Ls(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=V.updateQueue,t===null&&(t=ls(),V.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 Rs(){return cs().memoizedState}function zs(e,t,n,r){var i=ss();V.flags|=e,i.memoizedState=Ls(1|t,{destroy:void 0},n,r===void 0?null:r)}function Bs(e,t,n,r){var i=cs();r=r===void 0?null:r;var a=i.memoizedState.inst;Uo!==null&&r!==null&&$o(r,Uo.memoizedState.deps)?i.memoizedState=Ls(t,a,n,r):(V.flags|=e,i.memoizedState=Ls(1|t,a,n,r))}function Vs(e,t){zs(8390656,8,e,t)}function Hs(e,t){Bs(2048,8,e,t)}function Us(e){V.flags|=4;var t=V.updateQueue;if(t===null)t=ls(),V.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Ws(e){var t=cs().memoizedState;return Us({ref:t,nextImpl:e}),function(){if(U&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Gs(e,t){return Bs(4,2,e,t)}function Ks(e,t){return Bs(4,4,e,t)}function qs(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 Js(e,t,n){n=n==null?null:n.concat([e]),Bs(4,4,qs.bind(null,t,e),n)}function Ys(){}function Xs(e,t){var n=cs();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&$o(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Zs(e,t){var n=cs();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&$o(t,r[1]))return r[0];if(r=e(),qo){Ze(!0);try{e()}finally{Ze(!1)}}return n.memoizedState=[r,t],r}function Qs(e,t,n){return n===void 0||Ho&1073741824&&!(G&261930)?e.memoizedState=t:(e.memoizedState=n,e=Ld(),V.lanes|=e,dd|=e,n)}function $s(e,t,n,r){return Vr(n,t)?n:Eo.current===null?!(Ho&106)||Ho&1073741824&&!(G&261930)?(Fc=!0,e.memoizedState=n):(e=Ld(),V.lanes|=e,dd|=e,t):(e=Qs(e,n,r),Vr(e,t)||(Fc=!0),e)}function ec(e,t,n,r,i){var a=he.p;he.p=a!==0&&8>a?a:8;var o=I.T,s={};s.types=o===null?null:o.types,I.T=s,fc(e,!1,t,n);try{var c=i(),l=I.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?dc(e,t,Ua(c,r),Id(e)):dc(e,t,r,Id(e))}catch(n){dc(e,t,{then:function(){},status:`rejected`,reason:n},Id())}finally{he.p=a,o!==null&&s.types!==null&&(o.types=s.types),I.T=o}}function tc(){}function nc(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=rc(e).queue;ec(e,a,t,ge,n===null?tc:function(){return ic(e),n(r)})}function rc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ge,baseState:ge,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ps,lastRenderedState:ge},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ps,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ic(e){var t=rc(e);t.next===null&&(t=e.alternate.memoizedState),dc(e,t.next.queue,{},Id())}function ac(){return Ta(ph)}function oc(){return cs().memoizedState}function sc(){return cs().memoizedState}function cc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Id();e=_o(n);var r=vo(t,e,n);r!==null&&(zd(r,t,n),yo(r,t,n)),t={cache:Ma()},e.payload=t;return}t=t.return}}function lc(e,t,n){var r=Id();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},pc(e)?mc(t,n):(n=Ei(e,t,n,r),n!==null&&(zd(n,e,r),hc(n,t,r)))}function uc(e,t,n){dc(e,t,n,Id())}function dc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(pc(e))mc(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,Vr(s,o))return Ti(e,t,i,0),rd===null&&wi(),!1}catch{}if(n=Ei(e,t,i,r),n!==null)return zd(n,e,r),hc(n,t,r),!0}return!1}function fc(e,t,n,r){if(r={lane:2,revertLane:Bf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},pc(e)){if(t)throw Error(i(479))}else t=Ei(e,n,r,2),t!==null&&zd(t,e,2)}function pc(e){var t=e.alternate;return e===V||t!==null&&t===V}function mc(e,t){Ko=Go=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function hc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ht(e,n)}}var gc={readContext:Ta,use:ds,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},_c={readContext:Ta,use:ds,useCallback:function(e,t){return ss().memoizedState=[e,t===void 0?null:t],e},useContext:Ta,useEffect:Vs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),zs(4194308,4,qs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return zs(4194308,4,e,t)},useInsertionEffect:function(e,t){zs(4,2,e,t)},useMemo:function(e,t){var n=ss();t=t===void 0?null:t;var r=e();if(qo){Ze(!0);try{e()}finally{Ze(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=ss();if(n!==void 0){var i=n(t);if(qo){Ze(!0);try{n(t)}finally{Ze(!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=lc.bind(null,V,e),[r.memoizedState,e]},useRef:function(e){var t=ss();return e={current:e},t.memoizedState=e},useState:function(e){e=Cs(e);var t=e.queue,n=uc.bind(null,V,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ys,useDeferredValue:function(e,t){return Qs(ss(),e,t)},useTransition:function(){var e=Cs(!1);return e=ec.bind(null,V,e.queue,!0,!1),ss().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=V,a=ss();if(B){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),rd===null)throw Error(i(349));G&127||vs(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Vs(bs.bind(null,r,o,e),[e]),r.flags|=2048,Ls(9,{destroy:void 0},ys.bind(null,r,o,n,t),null),n},useId:function(){var e=ss(),t=rd.identifierPrefix;if(B){var n=Zi,r=Xi;n=(r&~(1<<32-Qe(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Jo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Zo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ac,useFormState:Ms,useActionState:Ms,useOptimistic:function(e){var t=ss();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=fc.bind(null,V,!0,n),n.dispatch=t,[e,t]},useMemoCache:fs,useCacheRefresh:function(){return ss().memoizedState=cc.bind(null,V)},useEffectEvent:function(e){var t=ss(),n={impl:e};return t.memoizedState=n,function(){if(U&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},vc={readContext:Ta,use:ds,useCallback:Xs,useContext:Ta,useEffect:Hs,useImperativeHandle:Js,useInsertionEffect:Gs,useLayoutEffect:Ks,useMemo:Zs,useReducer:ms,useRef:Rs,useState:function(){return ms(ps)},useDebugValue:Ys,useDeferredValue:function(e,t){return $s(cs(),Uo.memoizedState,e,t)},useTransition:function(){var e=ms(ps)[0],t=cs().memoizedState;return[typeof e==`boolean`?e:us(e),t]},useSyncExternalStore:_s,useId:oc,useHostTransitionStatus:ac,useFormState:Ns,useActionState:Ns,useOptimistic:function(e,t){return ws(cs(),Uo,e,t)},useMemoCache:fs,useCacheRefresh:sc,useEffectEvent:Ws},yc={readContext:Ta,use:ds,useCallback:Xs,useContext:Ta,useEffect:Hs,useImperativeHandle:Js,useInsertionEffect:Gs,useLayoutEffect:Ks,useMemo:Zs,useReducer:gs,useRef:Rs,useState:function(){return gs(ps)},useDebugValue:Ys,useDeferredValue:function(e,t){var n=cs();return Uo===null?Qs(n,e,t):$s(n,Uo.memoizedState,e,t)},useTransition:function(){var e=gs(ps)[0],t=cs().memoizedState;return[typeof e==`boolean`?e:us(e),t]},useSyncExternalStore:_s,useId:oc,useHostTransitionStatus:ac,useFormState:Is,useActionState:Is,useOptimistic:function(e,t){var n=cs();return Uo===null?(n.baseState=e,[e,n.queue.dispatch]):ws(n,Uo,e,t)},useMemoCache:fs,useCacheRefresh:sc,useEffectEvent:Ws};function bc(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 xc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Id(),i=_o(r);i.payload=t,n!=null&&(i.callback=n),t=vo(e,i,r),t!==null&&(zd(t,e,r),yo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Id(),i=_o(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=vo(e,i,r),t!==null&&(zd(t,e,r),yo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Id(),r=_o(n);r.tag=2,t!=null&&(r.callback=t),t=vo(e,r,n),t!==null&&(zd(t,e,n),yo(t,e,n))}};function Sc(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?!Hr(n,r)||!Hr(i,a):!0}function Cc(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&&xc.enqueueReplaceState(t,t.state,null)}function wc(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 Tc(e){bi(e)}function Ec(e){console.error(e)}function Dc(e){bi(e)}function Oc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function kc(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 Ac(e,t,n){return n=_o(n),n.tag=3,n.payload={element:null},n.callback=function(){Oc(e,t)},n}function jc(e){return e=_o(e),e.tag=3,e}function Mc(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(){kc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){kc(t,n,r),typeof i!=`function`&&(Cd===null?Cd=new Set([this]):Cd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Nc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Sa(t,n,a,!0),n=jo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Mo===null?Zd():n.alternate===null&&ud===0&&(ud=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Qa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),bf(e,r,a)),!1;case 22:return n.flags|=65536,r===Qa?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),bf(e,r,a)),!1}throw Error(i(435,n.tag))}return bf(e,r,a),Zd(),!1}if(B)return t=jo.current,t===null?(r!==sa&&(t=Error(i(423),{cause:r}),ma(Hi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Hi(r,n),a=Ac(e.stateNode,r,a),bo(e,a),ud!==4&&(ud=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==sa&&(e=Error(i(422),{cause:r}),ma(Hi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Hi(o,n),gd===null?gd=[o]:gd.push(o),ud!==4&&(ud=2),t===null)return!0;r=Hi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Ac(n.stateNode,r,e),bo(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(Cd===null||!Cd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=jc(a),Mc(a,e,n,r),bo(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Pc=Error(i(461)),Fc=!1;function Ic(e,t,n,r){t.child=e===null?po(t,null,n,r):fo(t,e.child,n,r)}function Lc(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 wa(t),r=es(e,t,n,o,a,i),s=is(),e!==null&&!Fc?(as(e,t,i),dl(e,t,i)):(B&&s&&ea(t),t.flags|=1,Ic(e,t,r,i),t.child)}function Rc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Ni(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,zc(e,t,a,r,i)):(e=Ii(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!fl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Hr:n,n(o,r)&&e.ref===t.ref)return dl(e,t,i)}return t.flags|=1,e=Pi(a,r),e.ref=t.ref,e.return=t,t.child=e}function zc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Hr(a,r)&&e.ref===t.ref){if(Fc=!1,t.pendingProps=r=a,fl(e,i))e.flags&131072&&(Fc=!0);else return t.lanes=e.lanes,dl(e,t,i)}}return qc(e,t,n,r,i)}function Bc(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 Hc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&qa(t,a===null?null:a.cachePool),a===null?ko():Oo(t,a),Fo(t);else return r=t.lanes=536870912,Hc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&qa(t,null),ko(),Io()):(qa(t,a.cachePool),Oo(t,a),Io(),t.memoizedState=null);return Ic(e,t,i,n),t.child}function Vc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Hc(e,t,n,r,i){var a=Ka();return a=a===null?null:{parent:ja._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&qa(t,null),ko(),Fo(t),e!==null&&Sa(e,t,r,!0),t.childLanes=i,null}function Uc(e,t){return t=nl({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Wc(e,t,n){return fo(t,e.child,null,n),e=Uc(t,t.pendingProps),e.flags|=2,Lo(t),t.memoizedState=null,e}function Gc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(B){if(r.mode===`hidden`)return e=Uc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Vc(null,e);if(Po(t),(e=ia)?(e=dm(e,oa),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Yi===null?null:{id:Xi,overflow:Zi},retryLane:536870912,hydrationErrors:null},n=zi(e),n.return=t,t.child=n,ra=t,ia=null)):e=null,e===null)throw ca(t);return t.lanes=536870912,null}return Uc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Po(t),a){if(t.flags&256)t.flags&=-257,t=Wc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Fc||Sa(e,t,n,!1),a=(n&e.childLanes)!==0,Fc||a){if(Eo.current===null){if(r=rd,r!==null&&(s=gt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Di(e,s),zd(r,e,s),Pc;Zd()}t=Wc(e,t,n)}else e=o.treeContext,ia=hm(s.nextSibling),ra=t,B=!0,aa=null,oa=!1,e!==null&&na(t,e),t=Uc(t,r),t.flags|=134221824;return t}return e=Pi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Kc(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(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function qc(e,t,n,r,i){return wa(t),n=es(e,t,n,r,void 0,i),r=is(),e!==null&&!Fc?(as(e,t,i),dl(e,t,i)):(B&&r&&ea(t),t.flags|=1,Ic(e,t,n,i),t.child)}function Jc(e,t,n,r,i,a){return wa(t),t.updateQueue=null,n=ns(t,r,n,i),ts(e),r=is(),e!==null&&!Fc?(as(e,t,a),dl(e,t,a)):(B&&r&&ea(t),t.flags|=1,Ic(e,t,n,a),t.child)}function Yc(e,t,n,r,i){if(wa(t),t.stateNode===null){var a=Ai,o=n.contextType;typeof o==`object`&&o&&(a=Ta(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=xc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},ho(t),o=n.contextType,a.context=typeof o==`object`&&o?Ta(o):Ai,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(bc(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&&xc.enqueueReplaceState(a,a.state,null),Co(t,r,a,i),So(),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=wc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Ai,typeof u==`object`&&u&&(o=Ta(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)&&Cc(t,a,r,o),mo=!1;var f=t.memoizedState;a.state=f,Co(t,r,a,i),So(),l=t.memoizedState,s||f!==l||mo?(typeof d==`function`&&(bc(t,n,d,r),l=t.memoizedState),(c=mo||Sc(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,go(e,t),o=t.memoizedProps,u=wc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Ai,typeof l==`object`&&l&&(c=Ta(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)&&Cc(t,a,r,c),mo=!1,f=t.memoizedState,a.state=f,Co(t,r,a,i),So();var p=t.memoizedState;o!==d||f!==p||mo||e!==null&&e.dependencies!==null&&Ca(e.dependencies)?(typeof s==`function`&&(bc(t,n,s,r),p=t.memoizedState),(u=mo||Sc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Ca(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,Kc(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=fo(t,e.child,null,i),t.child=fo(t,null,n,i)):Ic(e,t,n,i),t.memoizedState=a.state,e=t.child):e=dl(e,t,i),e}function Xc(e,t,n,r){return fa(),t.flags|=256,Ic(e,t,n,r),t.child}var Zc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Qc(e){return{baseLanes:e,cachePool:Ja()}}function $c(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=md),e}function el(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Ro.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(B){if(i?No(t):Io(),(e=ia)?(e=dm(e,oa),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Yi===null?null:{id:Xi,overflow:Zi},retryLane:536870912,hydrationErrors:null},n=zi(e),n.return=t,t.child=n,ra=t,ia=null)):e=null,e===null)throw ca(t);return t.lanes=pm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Io(),i=t.mode,a=nl({mode:`hidden`,children:a},i),r=Li(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Qc(n),r.childLanes=$c(e,o,n),t.memoizedState=Zc,Vc(null,r)):(No(t),tl(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return il(e,t,a,o,r,c,s,n)}return i?(Io(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Pi(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Li(i,a,n,null),i.flags|=2):i=Pi(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Vc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Qc(n):(a=i.cachePool,a===null?a=Ja():(s=ja._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=$c(e,o,n),t.memoizedState=Zc,Vc(e.child,r)):(No(t),n=e.child,e=n.sibling,n=Pi(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 tl(e,t){return t=nl({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function nl(e,t){return e=Mi(22,e,null,t),e.lanes=0,e}function rl(e,t,n){return fo(t,e.child,null,n),e=tl(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function il(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(No(t),t.flags&=-257,rl(e,t,c)):t.memoizedState===null?(Io(),o=a.fallback,s=t.mode,a=nl({mode:`visible`,children:a.children},s),o=Li(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,fo(t,e.child,null,c),a=t.child,a.memoizedState=Qc(c),a.childLanes=$c(e,r,c),t.memoizedState=Zc,Vc(null,a)):(Io(),t.child=e.child,t.flags|=128,null);if(No(t),pm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,ma({value:a,source:null,stack:null})),rl(e,t,c)}if(Fc||Sa(e,t,c,!1),r=(c&e.childLanes)!==0,Fc||r){if(Eo.current!==null)return rl(e,t,c);if(r=rd,r!==null&&(a=gt(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Di(e,a),zd(r,e,a),Pc;return fm(o)||Zd(),rl(e,t,c)}return fm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,ia=hm(o.nextSibling),ra=t,B=!0,aa=null,oa=!1,e!==null&&na(t,e),t=tl(t,a.children),t.flags|=134221824,t)}function al(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ba(e.return,t,n)}function ol(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Vo(n)===null&&(t=e),e=e.sibling}return t}function sl(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 cl(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 ll(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Ro.current;if(t.flags&128)return zo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,zo(t,o),i===`backwards`&&e!==null?(cl(e),Ic(e,t,r,n),cl(e)):Ic(e,t,r,n),r=B?Ki:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&al(e,n,t);else if(e.tag===19)al(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=ol(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,cl(t)),sl(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&&Vo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}sl(t,!0,n,null,a,r);break;case`together`:sl(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=ol(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),sl(t,!1,i,n,a,r)}return t.child}function ul(e,t,n){var r=t.pendingProps;return va(t,t.type,r.value),Ic(e,t,r.children,n),t.child}function dl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),dd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Sa(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=Pi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Pi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function fl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Ca(e)))}function pl(e,t,n){switch(t.tag){case 3:Te(t,t.stateNode.containerInfo),va(t,ja,e.memoizedState.cache),fa();break;case 27:case 5:De(t);break;case 4:Te(t,t.stateNode.containerInfo);break;case 10:va(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Po(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return No(t),t.flags|=128,null;r=Sa(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?el(e,t,n):(No(t),e=dl(e,t,n),e===null?null:e.sibling)}No(t);break;case 19:if(t.flags&128)return ll(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(Sa(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return ll(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),zo(t,Ro.current),r)break;return null;case 22:return t.lanes=0,Bc(e,t,n,t.pendingProps);case 24:va(t,ja,e.memoizedState.cache)}return dl(e,t,n)}function ml(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Fc=!0;else{if(!fl(e,n)&&!(t.flags&128))return Fc=!1,pl(e,t,n);Fc=!!(e.flags&131072)}}else Fc=!1,B&&t.flags&1048576&&$i(t,Ki,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=to(t.elementType),t.type=e,typeof e==`function`)Ni(e)?(r=wc(e,r),t.tag=1,t=Yc(null,t,e,r,n)):(t.tag=0,t=qc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===te){t.tag=11,t=Lc(null,t,e,r,n);break a}if(a===re){t.tag=14,t=Rc(null,t,e,r,n);break a}if(a===P){t.tag=10,t.type=e,t=ul(null,t,n);break a}}throw t=pe(e)||e,Error(i(306,t,``))}}return t;case 0:return qc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=wc(r,t.pendingProps),Yc(e,t,r,a,n);case 3:a:{if(Te(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,go(e,t),Co(t,r,null,n);var s=t.memoizedState;if(r=s.cache,va(t,ja,r),r!==o.cache&&xa(t,[ja],n,!0),So(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Xc(e,t,r,n);break a}if(r!==a){a=Hi(Error(i(424)),t),ma(a),t=Xc(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(ia=hm(e.firstChild),ra=t,B=!0,aa=null,oa=!0,n=po(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(fa(),r===a){t=dl(e,t,n);break a}Ic(e,t,r,n)}t=t.child}return t;case 26:return Kc(e,t),e===null?(n=zm(t.type,null,t.pendingProps,null))?t.memoizedState=n:B||(t.stateNode=vp(t.type,t.pendingProps,Ce.current,t)):t.memoizedState=zm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return De(t),e===null&&B&&(r=t.stateNode=xm(t.type,t.pendingProps,Ce.current),ra=t,oa=!0,a=ia,Op(t.type)?(gm=a,ia=hm(r.firstChild)):ia=a),Ic(e,t,t.pendingProps.children,n),Kc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&B&&((a=r=ia)&&(r=lm(r,t.type,t.pendingProps,oa),r===null?a=!1:(t.stateNode=r,ra=t,ia=hm(r.firstChild),oa=!1,a=!0)),a||ca(t)),De(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,yp(a,o)?r=null:s!==null&&yp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=es(e,t,rs,null,null,n),ph._currentValue=a),Kc(e,t),Ic(e,t,r,n),t.child;case 6:return e===null&&B&&((e=n=ia)&&(n=um(n,t.pendingProps,oa),n===null?e=!1:(t.stateNode=n,ra=t,ia=null,e=!0)),e||ca(t)),null;case 13:return el(e,t,n);case 4:return Te(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=fo(t,null,r,n):Ic(e,t,r,n),t.child;case 11:return Lc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Kc(e,t),Ic(e,t,r,n),t.child;case 8:return Ic(e,t,t.pendingProps.children,n),t.child;case 12:return Ic(e,t,t.pendingProps.children,n),t.child;case 10:return ul(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,wa(t),a=Ta(a),r=r(a),t.flags|=1,Ic(e,t,r,n),t.child;case 14:return Rc(e,t,t.type,t.pendingProps,n);case 15:return zc(e,t,t.type,t.pendingProps,n);case 19:return ll(e,t,n);case 31:return Gc(e,t,n);case 22:return Bc(e,t,n,t.pendingProps);case 24:return wa(t),r=Ta(ja),e===null?(a=Ka(),a===null&&(a=rd,o=Ma(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},ho(t),va(t,ja,a)):((e.lanes&n)!==0&&(go(e,t),Co(t,null,null,n),So()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,va(t,ja,r),r!==a.cache&&xa(t,[ja],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),va(t,ja,r))),Ic(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:B&&ea(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Kc(e,t),Ic(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function hl(e){e.flags|=4}function gl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?eh(t,r):eh(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(Jd())e.flags|=8192;else throw no=Qa,Xa}}else e.flags&=-16777217}function _l(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!th(t)){if(Jd())e.flags|=8192;else throw no=Qa,Xa}}function vl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:ut(),e.lanes|=t,hd|=t)}function yl(e,t){if(!B)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 bl(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 xl(e,t,n){var r=t.pendingProps;switch(ta(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return bl(t),null;case 1:return bl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ya(ja),Ee(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(da(t)?hl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,pa())),bl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(hl(t),o===null?(bl(t),gl(t,a,null,r,n)):(bl(t),_l(t,o))):o?o===e.memoizedState?(bl(t),t.flags&=-16777217):(hl(t),bl(t),_l(t,o)):(e=e.memoizedProps,e!==r&&hl(t),bl(t),gl(t,a,e,r,n)),null;case 27:if(Oe(t),n=Ce.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&hl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return bl(t),t.subtreeFlags&=-33554433,null}e=xe.current,da(t)?la(t,e):(e=xm(a,r,n),t.stateNode=e,hl(t))}return bl(t),t.subtreeFlags&=-33554433,null;case 5:if(Oe(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&hl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return bl(t),t.subtreeFlags&=-33554433,null}if(o=xe.current,da(t))la(t,o);else{var s=hp(Ce.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[St]=t,o[Ct]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.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=o;a:switch(cp(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&hl(t)}}return bl(t),t.subtreeFlags&=-33554433,gl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&hl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=Ce.current,da(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=ra,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[St]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||ap(e.nodeValue,n)),e||ca(t,!0)}else e=hp(e).createTextNode(r),e[St]=t,t.stateNode=e}return bl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=da(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[St]=t}else fa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;bl(t),e=!1}else n=pa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Lo(t),t):(Lo(t),null);if(t.flags&128)throw Error(i(558))}return bl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=da(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[St]=t}else fa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;bl(t),a=!1}else a=pa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Lo(t),t):(Lo(t),null)}return Lo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),vl(t,t.updateQueue),bl(t),null);case 4:return Ee(),e===null&&Yf(t.stateNode.containerInfo),t.flags|=67108864,bl(t),null;case 10:return ya(t.type),bl(t),null;case 19:if(Bo(t),r=t.memoizedState,r===null)return bl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)yl(r,!1);else{if(ud!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Vo(e),o!==null){for(t.flags|=128,yl(r,!1),e=o.updateQueue,t.updateQueue=e,vl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Fi(n,e),n=n.sibling;return zo(t,Ro.current&1|2),B&&Qi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Be()>xd&&(t.flags|=128,a=!0,yl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Vo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,vl(t,e),yl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!B)return bl(t),null}else 2*Be()-r.renderingStartTime>xd&&n!==536870912&&(t.flags|=128,a=!0,yl(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}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=Be(),e.sibling=null,o=Ro.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||B?zo(t,o):(n=o,be(jo,t),be(Ro,n),Mo===null&&(Mo=t)),B&&Qi(t,r.treeForkCount),e}return bl(t),null;case 22:case 23:return Lo(t),Ao(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(bl(t),t.subtreeFlags&6&&(t.flags|=8192)):bl(t),n=t.updateQueue,n!==null&&vl(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&&ye(Ga),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ya(ja),bl(t),null;case 25:return null;case 30:return t.flags|=33554432,bl(t),null}throw Error(i(156,t.tag))}function Sl(e,t){switch(ta(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ya(ja),Ee(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Oe(t),null;case 31:if(t.memoizedState!==null){if(Lo(t),t.alternate===null)throw Error(i(340));fa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Lo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));fa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Bo(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 Ee(),null;case 10:return ya(t.type),null;case 22:case 23:return Lo(t),Ao(),e!==null&&ye(Ga),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ya(ja),null;case 25:return null;default:return null}}function Cl(e,t){switch(ta(t),t.tag){case 3:ya(ja),Ee();break;case 26:case 27:case 5:Oe(t);break;case 4:Ee();break;case 31:t.memoizedState!==null&&Lo(t);break;case 13:Lo(t);break;case 19:Bo(t);break;case 10:ya(t.type);break;case 22:case 23:Lo(t),Ao(),e!==null&&ye(Ga);break;case 24:ya(ja)}}function wl(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){yf(t,t.return,e)}}function Tl(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){yf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){yf(t,t.return,e)}}function El(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{To(t,n)}catch(t){yf(e,e.return,t)}}}function Dl(e,t,n){n.props=wc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){yf(e,t,n)}}function Ol(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=_i(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Bp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Vp(e);m(e.child,!1,im,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){yf(e,t,n)}}function kl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){yf(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){yf(e,t,n)}else n.current=null}}function Al(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++)om(e.stateNode,t[n])}function jl(e){for(var t=e.return;t!==null&&(Pl(t)&&om(e.stateNode,t.stateNode),!Nl(t));)t=t.return}function Ml(e){for(var t=e.return;t!==null&&(Pl(t)&&sm(e.stateNode,t.stateNode),!Nl(t));)t=t.return}function Nl(e){return e.tag===5||e.tag===3||e.tag===27}function Pl(e){return e&&e.tag===7&&e.stateNode!==null}function Fl(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){yf(e,e.return,t)}}function Il(e,t,n){try{var r=e.stateNode;up(r,e.type,n,t),r[Ct]=t}catch(t){yf(e,e.return,t)}}function Ll(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Op(e.type)||e.tag===4}function Rl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Ll(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&&Op(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 zl(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=yn)),Al(e,r),Kt=!0;else if(i!==4&&(i===27&&(Al(e,r),r=null,Op(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(zl(e,t,n,r),e=e.sibling;e!==null;)zl(e,t,n,r),e=e.sibling}function Bl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Al(e,r),Kt=!0;else if(i!==4&&(i===27&&(Al(e,r),r=null,Op(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Bl(e,t,n,r),e=e.sibling;e!==null;)Bl(e,t,n,r),e=e.sibling}function Vl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);cp(t,r,n),t[St]=e,t[Ct]=n}catch(t){yf(e,e.return,t)}}var Hl=!1,Ul=null;function Wl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Hl=!0)}var Gl=null;function Kl(){var e=Gl;return Gl=null,e}var ql=0;function Jl(e,t,n,r,i){return ql=0,Yl(e.child,t,n,r,i)}function Yl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Pp(o);r.push(s),s.view&&(a=!0)}else a||Pp(o).view&&(a=!0);Hl=!0,jp(o,ql===0?t:t+`_`+ql,n),ql++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||Yl(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Xl(e,t){for(;e!==null;)e.tag===5?Mp(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Xl(e.child,t)),e=e.sibling}function Zl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Zl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=yi(t.default,t.share),t!==`none`&&(Jl(e,n,t,null,!1)||Xl(e.child,!1))}e=e.sibling}}function Ql(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=_i(r,n),a=yi(r.default,n.paired?r.share:r.enter);a===`none`?Zl(e):Jl(e,i,a,null,!1)?(Zl(e),n.paired||t||Rd(e,r.onEnter)):Xl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Ql(e,t),e=e.sibling;else Zl(e)}function $l(e){if(Ul!==null&&Ul.size!==0){var t=Ul;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=yi(n.default,n.share);if(a!==`none`&&(Jl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Rd(e,n.onShare)):Xl(e.child,!1)),t.delete(r),t.size===0)break}}}$l(e)}e=e.sibling}}}function eu(e){if(e.tag===30){var t=e.memoizedProps,n=_i(t,e.stateNode),r=Ul===null?void 0:Ul.get(n),i=yi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Jl(e,n,i,null,!1)?r===void 0?Rd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Ul.delete(n),Rd(e,t.onShare)):Xl(e.child,!1)),Ul!==null&&$l(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)eu(e),e=e.sibling;else Ul!==null&&$l(e)}function tu(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=_i(t,e.stateNode);t=yi(t.default,t.update),e.flags&=-5,t!==`none`&&Jl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&tu(e);e=e.sibling}}function nu(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,Xl(e.child,!1))}nu(e)}e=e.sibling}}function ru(e){if(e.tag===30)e.stateNode.paired=null,Xl(e.child,!1),nu(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)ru(e),e=e.sibling;else nu(e)}function iu(e){for(e=e.child;e!==null;)e.tag===30?Xl(e.child,!1):e.subtreeFlags&33554432&&iu(e),e=e.sibling}function au(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&ql<a.length){var l=a[ql],u=Pp(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&&jp(c,ql===0?n:n+`_`+ql,i),s&&e.flags&4||(Gl===null&&(Gl=[]),Gl.push(c,ql===0?r:r+`_`+ql,t.memoizedProps)),ql++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:au(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function ou(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=_i(n,r),a=yi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Fp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;ql=0,i=au(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Rd(e,n.onUpdate))}else e.subtreeFlags&33554432&&ou(e,t);e=e.sibling}}var su=!1,H=!1,cu=!1,lu=!1,uu=typeof WeakSet==`function`?WeakSet:Set,du=null,fu=!1,pu=!1,mu=!1,hu=!1;function gu(e,t,n){if(e=e.containerInfo,pp=Sh,e=qr(e),Jr(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(mp={focusedElem:e,selectionRange:r},Sh=!1,n=(n&335544064)===n,du=t,t=n?9270:1024;du!==null;){if(e=du,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&eu(r[a]);if(e.alternate===null&&e.flags&2)n&&Wl(e),_u(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&eu(r),_u(n);continue}if(r!==null&&r.memoizedState!==null){n&&Wl(e),_u(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,du=r):(n&&tu(e),_u(n))}}Ul=null}function _u(e){for(;du!==null;){var t=du,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=wc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){yf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)cm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:cm(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=_i(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=yi(a.default,a.update),a!==`none`&&Jl(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,du=r;break}du=t.return}}function vu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Ru(e,n),r&4&&wl(5,n);break;case 1:if(Ru(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){yf(n,n.return,e)}else{var i=wc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){yf(n,n.return,e)}}}r&64&&El(n),r&512&&Ol(n,n.return);break;case 3:if(Ru(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{To(e,t)}catch(e){yf(n,n.return,e)}}break;case 27:t===null&&r&4&&Vl(n);case 26:case 5:Ru(e,n),t===null&&r&4&&Fl(n),r&512&&Ol(n,n.return);break;case 12:Ru(e,n);break;case 31:Ru(e,n),r&4&&Du(e,n);break;case 13:Ru(e,n),r&4&&Ou(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Cf.bind(null,n),mm(e,n))));break;case 22:if(r=n.memoizedState!==null||su,!r){var a=t!==null&&t.memoizedState!==null||H;t=su,i=H,su=r,(H=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Bu(e,n,r)):Ru(e,n),su=t,H=i}break;case 30:Ru(e,n),r&512&&Ol(n,n.return);break;case 7:r&512&&Ol(n,n.return);default:Ru(e,n)}}function yu(e,t){for(e=e.child;e!==null;)bu(e,t),e=e.sibling}function bu(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){yf(e,e.return,t)}xu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,Kt=!0}catch(t){yf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Ap(s,!0):Ap(e.stateNode,!1)}catch(t){yf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&yu(e,t);break;default:yu(e,t)}}function xu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:bu(n,r);break a;case 22:n.memoizedState===null&&xu(n,r);break a;default:xu(n,r)}}e=e.sibling}}function Su(e){var t=e.alternate;t!==null&&(e.alternate=null,Su(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&jt(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 Cu=null,wu=!1;function Tu(e,t,n){for(n=n.child;n!==null;)Eu(e,t,n),n=n.sibling}function Eu(e,t,n){if(Xe&&typeof Xe.onCommitFiberUnmount==`function`)try{Xe.onCommitFiberUnmount(Ye,n)}catch{}switch(n.tag){case 26:H||kl(n,t),Tu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!H&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:H||kl(n,t),Ml(n);var r=Cu,i=wu;Op(n.type)&&(Cu=n.stateNode,wu=!1),Tu(e,t,n),Sm(n.stateNode,n.type,n.memoizedProps),Cu=r,wu=i;break;case 5:H||kl(n,t),Ml(n);case 6:if(n.tag===6&&Ml(n),r=Cu,i=wu,Cu=null,Tu(e,t,n),Cu=r,wu=i,Cu!==null){if(wu)try{(Cu.nodeType===9?Cu.body:Cu.nodeName===`HTML`?Cu.ownerDocument.body:Cu).removeChild(n.stateNode),Kt=!0}catch(e){yf(n,t,e)}else try{Cu.removeChild(n.stateNode),Kt=!0}catch(e){yf(n,t,e)}}break;case 18:Cu!==null&&(wu?(e=Cu,kp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Jh(e)):kp(Cu,n.stateNode));break;case 4:r=Cu,i=wu,Cu=n.stateNode.containerInfo,wu=!0,Tu(e,t,n),Cu=r,wu=i;break;case 0:case 11:case 14:case 15:Tl(2,n,t),H||Tl(4,n,t),Tu(e,t,n);break;case 1:H||(kl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Dl(n,t,r)),Tu(e,t,n);break;case 21:Tu(e,t,n);break;case 22:H=(r=H)||n.memoizedState!==null,Tu(e,t,n),H=r;break;case 30:kl(n,t),Tu(e,t,n);break;case 7:H||kl(n,t),Tu(e,t,n);break;default:Tu(e,t,n)}}function Du(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Jh(e)}catch(e){yf(t,t.return,e)}}}function Ou(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Jh(e)}catch(e){yf(t,t.return,e)}}function ku(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new uu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new uu),t;default:throw Error(i(435,e.tag))}}function Au(e,t){var n=ku(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=wf.bind(null,e,t);t.then(r,r)}})}function ju(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Op(l.type)){Cu=l.stateNode,wu=!1;break a}break;case 5:Cu=l.stateNode,wu=!1;break a;case 3:case 4:Cu=l.stateNode.containerInfo,wu=!0;break a}l=l.return}if(Cu===null)throw Error(i(160));Eu(s,c,o),Cu=null,wu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Nu(t,e,n),t=t.sibling}var Mu=null;function Nu(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}ju(t,e,n),Pu(e),a&4&&(Tl(3,e,e.return),wl(3,e),Tl(5,e,e.return));break;case 1:ju(t,e,n),Pu(e),a&512&&(H||r===null||kl(r,r.return)),a&64&&su&&(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(o=Mu,ju(t,e,n),Pu(e),a&512&&(H||r===null||kl(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(su)e.stateNode=vp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[kt]||r[St]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),cp(r,t,n),r[St]=e,It(r),t=r;break a;case`link`:if(o=Zm(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[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)){o.splice(s,1);break b}}r=a.createElement(t),cp(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=Zm(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[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)){o.splice(s,1);break b}}r=a.createElement(t),cp(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[St]=e,It(r),t=r}e.stateNode=t}}else su||Qm(o,e.type,e.stateNode)}else e.stateNode=Km(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Il(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||H||t.parentNode.removeChild(t)):a.count--,n===null?su||Qm(o,e.type,e.stateNode):Km(o,n,e.memoizedProps))}break;case 27:ju(t,e,n),Pu(e),a&512&&(H||r===null||kl(r,r.return)),r!==null&&a&4&&Il(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=cu,cu=!1,ju(t,e,n),cu=o,Pu(e),a&512&&(H||r===null||kl(r,r.return)),e.flags&32){t=e.stateNode;try{dn(t,``),Kt=!0}catch(t){yf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Il(e,t,r===null?t:r.memoizedProps)),a&1024&&(lu=!0);break;case 6:if(ju(t,e,n),Pu(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Kt=!0}catch(t){yf(e,e.return,t)}}break;case 3:if(Kt=!1,Xm=null,o=Mu,Mu=Em(t.containerInfo),ju(t,e,n),Mu=o,Pu(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Jh(t.containerInfo)}catch(t){yf(e,e.return,t)}lu&&(lu=!1,Fu(e)),Kt=!1;break;case 4:a=cu,cu=su,r=qt(),o=Mu,Mu=Em(e.stateNode.containerInfo),ju(t,e,n),Pu(e),Mu=o,Kt&&pu&&(mu=!0),Kt=r,cu=a;break;case 12:ju(t,e,n),Pu(e);break;case 31:ju(t,e,n),Pu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Au(e,t)));break;case 13:ju(t,e,n),Pu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(yd=Be()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Au(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=su,l=H,u=cu;su=c||o,cu=u||o,H=l||s,ju(t,e,n),H=l,cu=u,su=c,Pu(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||su||H||(t=s||H,n=su,r=H,su=o||su,H=t,zu(e,2),su=n,H=r),!o&&cu||yu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Au(e,n))));break;case 19:ju(t,e,n),Pu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Au(e,t)));break;case 30:a&512&&(H||r===null||kl(r,r.return)),a=qt(),o=pu,s=(n&335544064)===n,c=e.memoizedProps,pu=s&&yi(c.default,c.update)!==`none`,ju(t,e,n),Pu(e),s&&r!==null&&Kt&&(e.flags|=4),pu=o,Kt=a;break;case 21:break;case 7:a&512&&(H||r===null||kl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:ju(t,e,n),Pu(e)}}function Pu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Ll(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Pl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Nl(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Bl(e,Rl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(dn(l,``),n.flags&=-33),Bl(e,Rl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;zl(e,Rl(e),u,s);break;default:throw Error(i(161))}}catch(t){yf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Fu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Fu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Sh=!0,t.reset(),Sh=!1),e=e.sibling}}function Iu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Lu(t,e),t=t.sibling;else ou(t,!1)}function Lu(e,t){var n=e.alternate;if(n===null)Ql(e,!1);else switch(e.tag){case 3:if(hu=fu=!1,Kl(),Iu(t,e),!fu&&!mu){if(e=Gl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Mp(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`})),hu=!0}Gl=null;break;case 5:Iu(t,e);break;case 4:r=fu,fu=!1,Iu(t,e),fu&&(mu=!0),fu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Iu(t,e):Ql(e,!1));break;case 30:r=fu,i=Kl(),fu=!1,Iu(t,e),fu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=_i(a,o),o=_i(n.memoizedProps,o);var s=yi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,ql=0,t=au(e,n,t,o,s,a,!0),ql!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Rd(e,e.memoizedProps.onUpdate),Gl=i):i!==null&&(i.push.apply(i,Gl),Gl=i),fu=e.flags&32?!0:r;break;default:Iu(t,e)}}function Ru(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)vu(e,t.alternate,t),t=t.sibling}function zu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:Tl(4,n,n.return),zu(n,r);break;case 1:kl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&Dl(n,n.return,i),zu(n,r);break;case 27:r&2&&Sm(n.stateNode,n.type,n.memoizedProps);case 5:kl(n,n.return),n.tag!==5&&n.tag!==27||Ml(n),zu(n,r);break;case 6:Ml(n);break;case 26:kl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||H||i.parentNode.removeChild(i),zu(n,r);break;case 22:n.memoizedState===null&&zu(n,r);break;case 30:kl(n,n.return),zu(n,r);break;case 7:kl(n,n.return);default:zu(n,r)}e=e.sibling}}function Bu(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:Bu(i,a,n),wl(4,a);break;case 1:if(Bu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){yf(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++)wo(l[i],c)}catch(e){yf(r,r.return,e)}}s&&o&64&&El(a),Ol(a,a.return);break;case 27:n&2&&Vl(a);case 5:a.tag!==5&&a.tag!==27||jl(a),Bu(i,a,n),s&&r===null&&o&4&&Fl(a),Ol(a,a.return);break;case 6:jl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||su||Qm(Em(c.ownerDocument),a.type,c),Bu(i,a,n),s&&r===null&&o&4&&Fl(a),Ol(a,a.return);break;case 12:Bu(i,a,n);break;case 31:Bu(i,a,n),s&&o&4&&Du(i,a);break;case 13:Bu(i,a,n),s&&o&4&&Ou(i,a);break;case 22:a.memoizedState===null&&Bu(i,a,n),Ol(a,a.return);break;case 30:Bu(i,a,n),Ol(a,a.return);break;case 7:Ol(a,a.return);default:Bu(i,a,n)}t=t.sibling}}function Vu(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&&Na(n))}function Hu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Na(e))}function Uu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Wu(e,t,n,r),t=t.sibling;else i&&iu(t)}function Wu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&ru(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Uu(e,t,n,r),a&2048&&wl(9,t);break;case 1:Uu(e,t,n,r);break;case 3:Uu(e,t,n,r),i&&hu&&(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&&Na(a)));break;case 12:if(a&2048){Uu(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){yf(t,t.return,e)}}else Uu(e,t,n,r);break;case 31:Uu(e,t,n,r);break;case 13:Uu(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&&ru(t),o._visibility&2?Uu(e,t,n,r):(o._visibility|=2,Gu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&ru(s),o._visibility&2?Uu(e,t,n,r):Ku(e,t)),a&2048&&Vu(s,t);break;case 24:Uu(e,t,n,r),a&2048&&Hu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Xl(a.child,!0),Xl(t.child,!0))),Uu(e,t,n,r);break;default:Uu(e,t,n,r)}}function Gu(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:Gu(a,o,s,c,i),wl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Gu(a,o,s,c,i)):u._visibility&2?Gu(a,o,s,c,i):Ku(a,o),i&&l&2048&&Vu(o.alternate,o);break;case 24:Gu(a,o,s,c,i),i&&l&2048&&Hu(o.alternate,o);break;default:Gu(a,o,s,c,i)}t=t.sibling}}function Ku(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:Ku(n,r),i&2048&&Vu(r.alternate,r);break;case 24:Ku(n,r),i&2048&&Hu(r.alternate,r);break;default:Ku(n,r)}t=t.sibling}}var qu=8192;function Ju(e,t,n){if(e.subtreeFlags&qu)for(e=e.child;e!==null;)Yu(e,t,n),e=e.sibling}function Yu(e,t,n){switch(e.tag){case 26:Ju(e,t,n),e.flags&qu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&rh(n,e)):ih(n,Mu,e.memoizedState,e.memoizedProps));break;case 5:Ju(e,t,n),e.flags&qu&&(e=e.stateNode,(t&335544128)===t&&rh(n,e));break;case 3:case 4:var r=Mu;Mu=Em(e.stateNode.containerInfo),Ju(e,t,n),Mu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=qu,qu=16777216,Ju(e,t,n),qu=r):Ju(e,t,n));break;case 30:if((e.flags&qu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Ul===null&&(Ul=new Map),Ul.set(r,i)}Ju(e,t,n);break;default:Ju(e,t,n)}}function Xu(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 Zu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];du=r,ed(r,e)}Xu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Qu(e),e=e.sibling}function Qu(e){switch(e.tag){case 0:case 11:case 15:Zu(e),e.flags&2048&&Tl(9,e,e.return);break;case 3:Zu(e);break;case 12:Zu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,$u(e)):Zu(e);break;default:Zu(e)}}function $u(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];du=r,ed(r,e)}Xu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Tl(8,t,t.return),$u(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,$u(t));break;default:$u(t)}e=e.sibling}}function ed(e,t){for(;du!==null;){var n=du;switch(n.tag){case 0:case 11:case 15:Tl(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:Na(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,du=r;else a:for(n=e;du!==null;){r=du;var i=r.sibling,a=r.return;if(Su(r),r===n){du=null;break a}if(i!==null){i.return=a,du=i;break a}du=a}}}var td={getCacheForType:function(e){var t=Ta(ja),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Ta(ja).controller.signal}},nd=typeof WeakMap==`function`?WeakMap:Map,U=0,rd=null,W=null,G=0,id=0,ad=null,od=!1,sd=!1,cd=!1,ld=0,ud=0,dd=0,fd=0,pd=0,md=0,hd=0,gd=null,_d=null,vd=!1,yd=0,bd=0,xd=1/0,Sd=null,Cd=null,wd=0,Td=null,Ed=null,Dd=0,Od=0,kd=null,Ad=null,jd=null,Md=null,Nd=null,Pd=0,Fd=null;function Id(){return U&2&&G!==0?G&-G:I.T===null?yt():Bf()}function Ld(){if(md===0){if(!(G&536870912)||B){var e=rt;rt<<=1,!(rt&3932160)&&(rt=262144),md=e}else md=536870912}return e=jo.current,e!==null&&(e.flags|=32),md}function Rd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Bp(_i(e.memoizedProps,n))),Md===null&&(Md=[]),Md.push(t.bind(null,r))}}function zd(e,t,n){(e===rd&&(id===2||id===9)||e.cancelPendingCommit!==null)&&(Kd(e,0),Ud(e,G,md,!1)),ft(e,n),(!(U&2)||e!==rd)&&(e===rd&&(!(U&2)&&(fd|=n),ud===4&&Ud(e,G,md,!1)),Mf(e))}function Bd(e,t,n){if(U&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||st(e,t),a=r?ef(e,t):Qd(e,t,!0),o=r;do{if(a===0){sd&&!r&&Ud(e,t,0,!1);break}if(n=e.current.alternate,o&&!Hd(n)){a=Qd(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)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;a=gd;var l=c.current.memoizedState.isDehydrated;if(l&&(Kd(c,s).flags|=256),s=Qd(c,s,!1),s!==2&&s!==6){if(cd&&!l){c.errorRecoveryDisabledLanes|=o,fd|=o,a=4;break a}o=_d,_d=a,o!==null&&(_d===null?_d=o:_d.push.apply(_d,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Kd(e,0),Ud(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Ud(r,t,md,!od);break a;case 2:_d=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=yd+300-Be(),10<a)){if(Ud(r,t,md,!od),ot(r,0,!0)!==0)break a;Dd=t,r.timeoutHandle=Sp(Vd.bind(null,r,n,_d,Sd,vd,t,md,fd,hd,od,o,`Throttled`,-0,0),a);break a}Vd(r,n,_d,Sd,vd,t,md,fd,hd,od,o,null,-0,0)}break}while(1);Mf(e)}function Vd(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;if(d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:yn},Ul=null,Yu(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=ch.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?yd-Be():(a&4194048)===a?bd-Be():0,m=oh(d,m),m!==null)){Dd=a,e.cancelPendingCommit=m(cf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Ud(e,a,o,!l);return}cf(e,t,a,n,r,i,o,s,c,l,u,d)}function Hd(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(!Vr(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 Ud(e,t,n,r){t=ct(e,t),t&=~pd,t&=~fd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Qe(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&mt(e,n,t)}function Wd(){return U&6?!0:(Nf(0,!1),!1)}function Gd(){if(W!==null){if(id===0)var e=W.return;else e=W,_a=ga=null,os(e),ao=null,oo=0,e=W;for(;e!==null;)Cl(e.alternate,e),e=e.return;W=null}}function Kd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Cp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Dd=0,Gd(),rd=e,W=n=Pi(e.current,null),G=t,id=0,ad=null,od=!1,sd=st(e,t),cd=!1,hd=md=pd=fd=dd=ud=0,_d=gd=null,vd=!1,ld=ct(e,t),wi(),n}function qd(e,t){V=null,I.H=gc,t===Ya||t===Za?(t=ro(),id=3):t===Xa?(t=ro(),id=4):id=t===Pc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,ad=t,W===null&&(ud=1,Oc(e,Hi(t,e.current)))}function Jd(){var e=jo.current;return e===null?!0:(G&4194048)===G?Mo===null:(G&62914560)===G||G&536870912?e===Mo:!1}function Yd(){var e=I.H;return I.H=gc,e===null?gc:e}function Xd(){var e=I.A;return I.A=td,e}function Zd(){ud=4,od||(G&4194048)!==G&&jo.current!==null||(sd=!0),!(dd&134217727)&&!(fd&134217727)||rd===null||Ud(rd,G,md,!1)}function Qd(e,t,n){var r=U;U|=2;var i=Yd(),a=Xd();(rd!==e||G!==t)&&(Sd=null,Kd(e,t)),t=!1;var o=ud;a:do try{if(id!==0&&W!==null){var s=W,c=ad;switch(id){case 8:Gd(),o=6;break a;case 3:case 2:case 9:case 6:jo.current===null&&(t=!0);var l=id;if(id=0,ad=null,af(e,s,c,l),n&&sd){o=0;break a}break;default:l=id,id=0,ad=null,af(e,s,c,l)}}$d(),o=ud;break}catch(t){qd(e,t)}while(1);return t&&e.shellSuspendCounter++,_a=ga=null,U=r,I.H=i,I.A=a,W===null&&(rd=null,G=0,wi()),o}function $d(){for(;W!==null;)nf(W)}function ef(e,t){var n=U;U|=2;var r=Yd(),a=Xd();rd!==e||G!==t?(Sd=null,xd=Be()+500,Kd(e,t)):sd=st(e,t);a:do try{if(id!==0&&W!==null){t=W;var o=ad;b:switch(id){case 1:id=0,ad=null,af(e,t,o,1);break;case 2:case 9:if($a(o)){id=0,ad=null,rf(t);break}t=function(){id!==2&&id!==9||rd!==e||(id=7),Mf(e)},o.then(t,t);break a;case 3:id=7;break a;case 4:id=5;break a;case 7:$a(o)?(id=0,ad=null,rf(t)):(id=0,ad=null,af(e,t,o,7));break;case 5:var s=null;switch(W.tag){case 26:s=W.memoizedState;case 5:case 27:var c=W;if(s?th(s):c.stateNode.complete){id=0,ad=null;var l=c.sibling;if(l!==null)W=l;else{var u=c.return;u===null?W=null:(W=u,of(u))}break b}}id=0,ad=null,af(e,t,o,5);break;case 6:id=0,ad=null,af(e,t,o,6);break;case 8:Gd(),ud=6;break a;default:throw Error(i(462))}}tf();break}catch(t){qd(e,t)}while(1);return _a=ga=null,I.H=r,I.A=a,U=n,W===null?(rd=null,G=0,wi(),ud):0}function tf(){for(;W!==null&&!Re();)nf(W)}function nf(e){var t=ml(e.alternate,e,ld);e.memoizedProps=e.pendingProps,t===null?of(e):W=t}function rf(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Jc(n,t,t.pendingProps,t.type,void 0,G);break;case 11:t=Jc(n,t,t.pendingProps,t.type.render,t.ref,G);break;case 5:os(t);var r=t;r===ra&&(B?(ua(r),r.tag===5&&r.stateNode!=null&&(ia=r.stateNode)):(ua(r),B=!0));default:Cl(n,t),t=W=Fi(t,ld),t=ml(n,t,ld)}e.memoizedProps=e.pendingProps,t===null?of(e):W=t}function af(e,t,n,r){_a=ga=null,os(t),ao=null,oo=0;var i=t.return;try{if(Nc(e,i,t,n,G)){ud=1,Oc(e,Hi(n,e.current)),W=null;return}}catch(t){if(i!==null)throw W=i,t;ud=1,Oc(e,Hi(n,e.current)),W=null;return}t.flags&32768?(B||r===1?e=!0:sd||G&536870912?e=!1:(od=e=!0,(r===2||r===9||r===3||r===6)&&(r=jo.current,r!==null&&r.tag===13&&(r.flags|=16384))),sf(t,e)):of(t)}function of(e){var t=e;do{if(t.flags&32768){sf(t,od);return}e=t.return;var n=xl(t.alternate,t,ld);if(n!==null){W=n;return}if(t=t.sibling,t!==null){W=t;return}W=t=e}while(t!==null);ud===0&&(ud=5)}function sf(e,t){do{var n=Sl(e.alternate,e);if(n!==null){n.flags&=32767,W=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){W=e;return}W=e=n}while(e!==null);ud=6,W=null}function cf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do gf();while(wd!==0);if(U&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===rd&&(W=rd=null,G=0),Ed=t,Td=e,Dd=n,kd=a,Ad=r,lf(e,t,n,s,c,l,f)}}function lf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Od=s,s|=Ci,pt(e,n,s,r,i,a),Md=null,(n&335544064)===n?(Nd=Ia(e),r=10262):(Nd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,Tf(We,function(){return _f(),null})):(e.callbackNode=null,e.callbackPriority=0),Hl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=I.T,I.T=null,i=he.p,he.p=2,a=U,U|=4;try{gu(e,t,n)}finally{U=a,he.p=i,I.T=r}}wd=1,Hl?jd=Rp(o,e.containerInfo,Nd,ff,pf,df,mf,_f,uf,null,null):(ff(),pf(),mf())}function uf(e){if(wd!==0){var t=Td.onRecoverableError;t(e,{componentStack:null})}}function df(){wd===3&&(wd=0,Lu(Ed,Td),wd=4)}function ff(){if(wd===1){wd=0;var e=Td,t=Ed,n=Dd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=I.T,I.T=null;var i=he.p;he.p=2;var a=U;U|=4;try{pu=mu=!1,Nu(t,e,n),n=mp;var o=qr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Kr(s.ownerDocument.documentElement,s)){if(c!==null&&Jr(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 _=Gr(s,h),v=Gr(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}}Sh=!!pp,mp=pp=null}finally{U=a,he.p=i,I.T=r}}e.current=t,wd=2}}function pf(){if(wd===2){wd=0;var e=Td,t=Ed,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=I.T,I.T=null;var r=he.p;he.p=2;var i=U;U|=4;try{vu(e,t.alternate,t)}finally{U=i,he.p=r,I.T=n}}wd=3}}function mf(){if(wd===4||wd===3){wd=0;var e=jd;jd=null,ze();var t=Td,n=Ed,r=Dd,i=Ad,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?wd=5:(wd=0,Ed=Td=null,hf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(Cd=null),vt(r),n=n.stateNode,Xe&&typeof Xe.onCommitFiberRoot==`function`)try{Xe.onCommitFiberRoot(Ye,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=I.T,a=he.p,he.p=2,I.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{I.T=n,he.p=a}}if(i=Md,o=Nd,Nd=null,i!==null&&(Md=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);Dd&3&&gf(),Mf(t),a=t.pendingLanes,r&261930&&a&42?t===Fd?Pd++:(Pd=0,Fd=t):(Pd=0,Fd=null),Nf(0,!1)}}function hf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Na(t)))}function gf(){return jd!==null&&(jd.skipTransition(),jd=null),ff(),pf(),mf(),_f()}function _f(){if(wd!==5)return!1;var e=Td,t=Od;Od=0;var n=vt(Dd),r=I.T,a=he.p;try{he.p=32>n?32:n,I.T=null,n=kd,kd=null;var o=Td,s=Dd;if(wd=0,Ed=Td=null,Dd=0,U&6)throw Error(i(331));var c=U;if(U|=4,Qu(o.current),Wu(o,o.current,s,n),U=c,Nf(0,!1),Xe&&typeof Xe.onPostCommitFiberRoot==`function`)try{Xe.onPostCommitFiberRoot(Ye,o)}catch{}return!0}finally{he.p=a,I.T=r,hf(e,t)}}function vf(e,t,n){t=Hi(n,t),t=Ac(e.stateNode,t,2),e=vo(e,t,2),e!==null&&(ft(e,2),Mf(e))}function yf(e,t,n){if(e.tag===3)vf(e,e,n);else for(;t!==null;){if(t.tag===3){vf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Cd===null||!Cd.has(r))){e=Hi(n,e),n=jc(2),r=vo(t,n,2),r!==null&&(Mc(n,r,t,e),ft(r,2),Mf(r));break}}t=t.return}}function bf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new nd;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(cd=!0,i.add(n),e=xf.bind(null,e,t,n),t.then(e,e))}function xf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,rd===e&&(G&n)===n&&(ud===4||ud===3&&(G&62914560)===G&&300>Be()-yd?U&2?pd|=n:Kd(e,0):pd|=n,hd===G&&(hd=0)),Mf(e)}function Sf(e,t){t===0&&(t=ut()),e=Di(e,t),e!==null&&(ft(e,t),Mf(e))}function Cf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Sf(e,n)}function wf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Sf(e,n)}function Tf(e,t){return Ie(e,t)}var Ef=null,Df=null,Of=!1,kf=!1,Af=!1,jf=0;function Mf(e){e!==Df&&e.next===null&&(Df===null?Ef=Df=e:Df=Df.next=e),kf=!0,Of||(Of=!0,zf())}function Nf(e,t){if(!Af&&kf){Af=!0;do for(var n=!1,r=Ef;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-Qe(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Rf(r,a))}else a=G,a=ot(r,r===rd?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||st(r,a)||(n=!0,Rf(r,a))}r=r.next}while(n);Af=!1}}function Pf(){Ff()}function Ff(){kf=Of=!1;var e=0;jf!==0&&xp()&&(e=jf);for(var t=Be(),n=null,r=Ef;r!==null;){var i=r.next,a=If(r,t);a===0?(r.next=null,n===null?Ef=i:n.next=i,i===null&&(Df=n)):(n=r,(e!==0||a&3)&&(kf=!0)),r=i}wd!==0&&wd!==5||Nf(e,!1),jf!==0&&(jf=0)}function If(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Qe(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=lt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=rd,n=G,n=ot(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(id===2||id===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Le(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||st(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Le(r),vt(n)){case 2:case 8:n=Ue;break;case 32:n=We;break;case 268435456:n=Ke;break;default:n=We}return r=Lf.bind(null,e),n=Ie(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Le(r),e.callbackPriority=2,e.callbackNode=null,2}function Lf(e,t){if(wd!==0&&wd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(gf()&&e.callbackNode!==n)return null;var r=G;return r=ot(e,e===rd?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Bd(e,r,t),If(e,Be()),e.callbackNode!=null&&e.callbackNode===n?Lf.bind(null,e):null)}function Rf(e,t){if(gf())return null;Bd(e,t,!0)}function zf(){Ep(function(){U&6?Ie(He,Pf):Ff()})}function Bf(){if(jf===0){var e=za;e===0&&(e=nt,nt<<=1,!(nt&261888)&&(nt=256)),jf=e}return jf}function Vf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:vn(e)}function Hf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Vf((i[Ct]||null).action),o=r.submitter;o&&(t=(t=o[Ct]||null)?Vf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Bn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(jf!==0){var e=new FormData(i,o);nc(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),nc(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Uf=0;Uf<mi.length;Uf++){var Wf=mi[Uf];hi(Wf.toLowerCase(),`on`+(Wf[0].toUpperCase()+Wf.slice(1)))}hi(oi,`onAnimationEnd`),hi(si,`onAnimationIteration`),hi(ci,`onAnimationStart`),hi(`dblclick`,`onDoubleClick`),hi(`focusin`,`onFocus`),hi(`focusout`,`onBlur`),hi(li,`onTransitionRun`),hi(ui,`onTransitionStart`),hi(di,`onTransitionCancel`),hi(fi,`onTransitionEnd`),Vt(`onMouseEnter`,[`mouseout`,`mouseover`]),Vt(`onMouseLeave`,[`mouseout`,`mouseover`]),Vt(`onPointerEnter`,[`pointerout`,`pointerover`]),Vt(`onPointerLeave`,[`pointerout`,`pointerover`]),Bt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Bt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Bt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Bt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Bt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Bt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Gf=`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(` `),Kf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Gf));function qf(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){bi(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){bi(e)}i.currentTarget=null,a=c}}}}function K(e,t){var n=t[Tt];n===void 0&&(n=t[Tt]=new Set);var r=e+`__bubble`;n.has(r)||(Xf(t,e,2,!1),n.add(r))}function Jf(e,t,n){var r=0;t&&(r|=4),Xf(n,e,r,t)}var q=`_reactListening`+Math.random().toString(36).slice(2);function Yf(e){if(!e[q]){e[q]=!0,Rt.forEach(function(t){t!==`selectionchange`&&(Kf.has(t)||Jf(t,!1,e),Jf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[q]||(t[q]=!0,Jf(`selectionchange`,!1,t))}}function Xf(e,t,n,r){switch(kh(t)){case 2:var i=Ch;break;case 8:i=wh;break;default:i=Th}n=i.bind(null,t,n,e),i=void 0,!kn||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 Zf(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=Mt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}En(function(){var r=a,i=xn(n),s=[];a:{var c=pi.get(e);if(c!==void 0){var l=Bn,u=e;switch(e){case`keypress`:if(Fn(n)===0)break a;case`keydown`:case`keyup`:l=ir;break;case`focusin`:u=`focus`,l=Yn;break;case`focusout`:u=`blur`,l=Yn;break;case`beforeblur`:case`afterblur`:l=Yn;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=qn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Jn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=sr;break;case oi:case si:case ci:l=Xn;break;case fi:l=cr;break;case`scroll`:case`scrollend`:l=Hn;break;case`wheel`:l=lr;break;case`copy`:case`cut`:case`paste`:l=Zn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=ar;break;case`submit`:l=or;break;case`toggle`:case`beforetoggle`:l=ur}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;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=Dn(m,p),g!=null&&d.push(Qf(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==bn&&(u=n.relatedTarget||n.fromElement)&&(Mt(u)||u[wt]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Mt(l):null,l!==null&&(f=o(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=qn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=ar,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Pt(c),h=l==null?u:Pt(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Mt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?E(c,l,ep):null,c!==null&&tp(s,u,c,d,!1),l!==null&&f!==null&&tp(s,f,l,d,!0)))}a:{if(c=r?Pt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=kr;else if(Cr(c)){if(Ar)_=zr;else{_=Lr;var v=Ir}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&hn(r.elementType)&&(_=kr):_=Rr;if(_&&=_(e,r)){wr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Pt(r):window,e){case`focusin`:(Cr(v)||v.contentEditable===`true`)&&(Xr=v,Zr=r,Qr=null);break;case`focusout`:Qr=Zr=Xr=null;break;case`mousedown`:$r=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:$r=!1,ei(s,n,i);break;case`selectionchange`:if(Yr)break;case`keydown`:case`keyup`:ei(s,n,i)}var y;if(fr)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 br?vr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(hr&&n.locale!==`ko`&&(br||b!==`onCompositionStart`?b===`onCompositionEnd`&&br&&(y=Pn()):(jn=i,Mn=`value`in jn?jn.value:jn.textContent,br=!0)),v=$f(r,b),0<v.length&&(b=new Qn(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=yr(n),y!==null&&(b.data=y)))),(y=mr?z(e,n):xr(e,n))&&(b=$f(r,`onBeforeInput`),0<b.length&&(v=new Qn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Hf(s,e,r,n,i)}qf(s,t)})}function Qf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function $f(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=Dn(e,n),i!=null&&r.unshift(Qf(e,i,a)),i=Dn(e,t),i!=null&&r.push(Qf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function ep(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function tp(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=Dn(n,a),l!=null&&o.unshift(Qf(n,l,c))):i||(l=Dn(n,a),l!=null&&o.push(Qf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var np=/\r\n?/g,rp=/\u0000|\uFFFD/g;function ip(e){return(typeof e==`string`?e:``+e).replace(np,`
9
+ `).replace(rp,``)}function ap(e,t){return t=ip(t),ip(e)===t}function op(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||dn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&dn(e,``+r);else return;break;case`className`:Yt(e,`class`,r);break;case`tabIndex`:Yt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Yt(e,n,r);break;case`style`:mn(e,r,o);return;case`data`:if(t!==`object`){Yt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=vn(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 o==`function`&&(n===`formAction`?(t!==`input`&&op(e,t,`name`,a.name,a,null),op(e,t,`formEncType`,a.formEncType,a,null),op(e,t,`formMethod`,a.formMethod,a,null),op(e,t,`formTarget`,a.formTarget,a,null)):(op(e,t,`encType`,a.encType,a,null),op(e,t,`method`,a.method,a,null),op(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=vn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=yn);return;case`onScroll`:r!=null&&K(`scroll`,e);return;case`onScrollEnd`:r!=null&&K(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__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=vn(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`:K(`beforetoggle`,e),K(`toggle`,e),Jt(e,`popover`,r);break;case`xlinkActuate`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Xt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Xt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Xt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Jt(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=gn.get(n)||n,Jt(e,n,r);else return}Kt=!0}function sp(e,t,n,r,a,o){switch(n){case`style`:mn(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)dn(e,r);else if(typeof r==`number`||typeof r==`bigint`)dn(e,``+r);else return;break;case`onScroll`:r!=null&&K(`scroll`,e);return;case`onScrollEnd`:r!=null&&K(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=yn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!zt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[Ct]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}Kt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Jt(e,n,r)}return}Kt=!0}function cp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:K(`error`,e),K(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:op(e,t,o,s,n,null)}}a&&op(e,t,`srcSet`,n.srcSet,n,null),r&&op(e,t,`src`,n.src,n,null);return;case`input`:K(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:op(e,t,r,d,n,null)}}on(e,o,c,l,u,s,a,!1);return;case`select`:for(a in K(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:op(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&cn(e,!!r,n,!0):cn(e,!!r,t,!1);return;case`textarea`:for(s in K(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:op(e,t,s,c,n,null)}un(e,r,a,o);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:op(e,t,l,r,n,null)}return;case`dialog`:K(`beforetoggle`,e),K(`toggle`,e),K(`cancel`,e),K(`close`,e);break;case`iframe`:case`object`:K(`load`,e);break;case`video`:case`audio`:for(r=0;r<Gf.length;r++)K(Gf[r],e);break;case`image`:K(`error`,e),K(`load`,e);break;case`details`:K(`toggle`,e);break;case`embed`:case`source`:case`link`:K(`error`,e),K(`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(i(137,t));default:op(e,t,u,r,n,null)}return;default:if(hn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&sp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&op(e,t,c,r,n,null))}var lp={};function up(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 a=null,o=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)||op(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&&(Kt=!0),o=m;break;case`name`:m!==f&&(Kt=!0),a=m;break;case`checked`:m!==f&&(Kt=!0),u=m;break;case`defaultChecked`:m!==f&&(Kt=!0),d=m;break;case`value`:m!==f&&(Kt=!0),s=m;break;case`defaultValue`:m!==f&&(Kt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&op(e,t,p,m,r,f)}}an(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||op(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&(Kt=!0),p=o;break;case`defaultValue`:o!==l&&(Kt=!0),c=o;break;case`multiple`:o!==l&&(Kt=!0),s=o;default:o!==l&&op(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?cn(e,!!n,n?[]:``,!1):cn(e,!!n,t,!0)):cn(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:op(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&(Kt=!0),p=a;break;case`defaultValue`:a!==o&&(Kt=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&op(e,t,s,a,r,o)}ln(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:op(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&&(Kt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:op(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)&&op(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(i(137,t));break;default:op(e,t,u,p,r,m)}return;default:if(hn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&sp(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||sp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&op(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||op(e,t,f,p,r,m)}function dp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function fp(){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&&dp(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&&dp(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 pp=null,mp=null;function hp(e){return e.nodeType===9?e:e.ownerDocument}function gp(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 _p(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 vp(e,t,n,r){return n=hp(n).createElement(e),n[St]=r,n[Ct]=t,cp(n,e,t),It(n),n}function yp(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 bp=null;function xp(){var e=window.event;return e&&e.type===`popstate`?e!==bp&&(bp=e,!0):(bp=null,!1)}var Sp=typeof setTimeout==`function`?setTimeout:void 0,Cp=typeof clearTimeout==`function`?clearTimeout:void 0,wp=typeof Promise==`function`?Promise:void 0,Tp=typeof requestAnimationFrame==`function`?requestAnimationFrame:Sp,Ep=typeof queueMicrotask==`function`?queueMicrotask:wp===void 0?Sp:function(e){return wp.resolve(null).then(e).catch(Dp)};function Dp(e){setTimeout(function(){throw e})}function Op(e){return e===`head`}function kp(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),Jh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Cm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Cm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[kt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Cm(e.ownerDocument.body)}n=i}while(n);Jh(t)}function Ap(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 jp(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 Mp(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 Np(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 Pp(e){return Np(e.getBoundingClientRect(),getComputedStyle(e),e)}function Fp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Np(t,n,e)}function Ip(e){return e.documentElement.clientHeight}function Lp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Rp(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`&&(Ip(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+=nh(f),u>ah){s.length=o;break}f=new Promise(Lp.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 zp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}zp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},zp.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},zp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Bp(e){return{name:e,group:new zp(`group`,e),imagePair:new zp(`image-pair`,e),old:new zp(`old`,e),new:new zp(`new`,e)}}function Vp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Vp.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(Kp(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=Wp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),m(this._fragmentFiber.child,!1,Hp,e,s,r)}this._eventListeners=a}};function Hp(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Vp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Kp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Wp(i.optionsOrUseCapture),m(this._fragmentFiber.child,!1,Up,e,n,i),r.splice(t,1),a!==null&&a()}};function Up(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Wp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Gp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Kp(e,t,n,r){if(e.length===0)return-1;r=Gp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Gp(a.optionsOrUseCapture)===r)return i}return-1}Vp.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,Wp(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,Wp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Vp.prototype.focus=function(e){m(this._fragmentFiber.child,!0,qp,e,void 0,void 0)};function qp(e,t){return e.tag!==6&&(e=b(e),ym(e,t))}Vp.prototype.focusLast=function(e){var t=[];m(this._fragmentFiber.child,!0,Jp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!qp(t[n],e);n--);};function Jp(e,t){return t.push(e),!1}Vp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=hp(e).activeElement,e!==null&&m(this._fragmentFiber.child,!1,Yp,e,void 0,void 0))};function Yp(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Vp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),m(this._fragmentFiber.child,!1,Xp,e,void 0,void 0)};function Xp(e,t){return e.tag!==6&&(e=b(e),t.observe(e),!1)}Vp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),m(this._fragmentFiber.child,!1,Zp,e,void 0,void 0);for(var n=t=0;n<Qp.length;n++){var r=Qp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Qp[t++]=r}Qp.length=t}};function Zp(e,t){return e.tag!==6&&(e=b(e),t.unobserve(e),!1)}var Qp=[],$p=!1;function em(e,t,n){Qp.push({fragmentInstance:e,observer:t,instance:n}),$p||($p=!0,bm(function(){$p=!1;var e=Qp;Qp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Vp.prototype.getClientRects=function(){var e=[];return m(this._fragmentFiber.child,!1,tm,e,void 0,void 0),e};function tm(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}Vp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Vp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];m(this._fragmentFiber.child,!1,Jp,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||nm(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function nm(e,t,n,r,i){var a=Mt(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:(m(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:(m(t,!0,w,a,r),a=x,S=x=null,t=a!==null)),t):!1}function rm(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)}Vp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];m(this._fragmentFiber.child,!1,Jp,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),rm(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 a=t[r];a.tag===6?(a=b(a),rm(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function im(e,t){return e=b(e),am(e,t),!1}function am(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function om(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,Wp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Qp.length;i++){var a=Qp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Qp[r++]=a)}Qp.length=r,n.observe(e)}),am(e,t))}function sm(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,Wp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?em(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function cm(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`:cm(n),jt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function lm(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[kt])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=hm(e.nextSibling),e===null)break}return null}function um(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=hm(e.nextSibling),e===null))return null;return e}function dm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=hm(e.nextSibling),e===null))return null;return e}function fm(e){return e.data===`$?`||e.data===`$~`}function pm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function mm(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 hm(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 gm=null;function _m(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return hm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function vm(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 ym(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 bm(e){Tp(function(){Tp(function(t){return e(t)})})}function xm(e,t,n){switch(t=hp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function Sm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&op(e,t,r,null,lp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===yn&&(e.onclick=null),jt(e)}function Cm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);jt(e)}var wm=new Map,Tm=new Set;function Em(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 Dm=he.d;he.d={f:Om,r:km,D:Mm,C:Nm,L:Pm,m:Fm,X:Lm,S:Im,M:Rm};function Om(){var e=Dm.f(),t=Wd();return e||t}function km(e){var t=Nt(e);t!==null&&t.tag===5&&t.type===`form`?ic(t):Dm.r(e)}var Am=typeof document>`u`?null:document;function jm(e,t,n){var r=Am;if(r&&typeof t==`string`&&t){var i=rn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Tm.has(i)||(Tm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),cp(t,`link`,e),It(t),r.head.appendChild(t)))}}function Mm(e){Dm.D(e),jm(`dns-prefetch`,e,null)}function Nm(e,t){Dm.C(e,t),jm(`preconnect`,e,t)}function Pm(e,t,n){Dm.L(e,t,n);var r=Am;if(r&&e&&t){var i=`link[rel="preload"][as="`+rn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+rn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+rn(n.imageSizes)+`"]`)):i+=`[href="`+rn(e)+`"]`;var a=i;switch(t){case`style`:a=Bm(e);break;case`script`:a=Wm(e)}if(!(wm.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),wm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Vm(a))||t===`script`&&r.querySelector(Gm(a))))){var o=r.createElement(`link`);cp(o,`link`,e),t===`style`&&(o[At]=!0,o.onload=o.onerror=function(){Lt(o)}),It(o),r.head.appendChild(o)}}}function Fm(e,t){Dm.m(e,t);var n=Am;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+rn(r)+`"][href="`+rn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Wm(e)}if(!wm.has(a)&&(e=D({rel:`modulepreload`,href:e},t),wm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Gm(a)))return}r=n.createElement(`link`),cp(r,`link`,e),It(r),n.head.appendChild(r)}}}function Im(e,t,n){Dm.S(e,t,n);var r=Am;if(r&&e){var i=Ft(r).hoistableStyles,a=Bm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Vm(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=wm.get(a))&&Jm(e,n);var c=o=r.createElement(`link`);It(c),cp(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,qm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Lm(e,t){Dm.X(e,t);var n=Am;if(n&&e){var r=Ft(n).hoistableScripts,i=Wm(e),a=r.get(i);a||(a=n.querySelector(Gm(i)),a||(e=D({src:e,async:!0},t),(t=wm.get(i))&&Ym(e,t),a=n.createElement(`script`),It(a),cp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Rm(e,t){Dm.M(e,t);var n=Am;if(n&&e){var r=Ft(n).hoistableScripts,i=Wm(e),a=r.get(i);a||(a=n.querySelector(Gm(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=wm.get(i))&&Ym(e,t),a=n.createElement(`script`),It(a),cp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function zm(e,t,n,r){var a=(a=Ce.current)?Em(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Bm(n.href),t=Ft(a).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=Bm(n.href);var o=Ft(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Vm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=wm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},wm.set(e,o)),Um(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Wm(n),t=Ft(a).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(i(444,e))}}function Bm(e){return`href="`+rn(e)+`"`}function Vm(e){return`link[rel="stylesheet"][`+e+`]`}function Hm(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Um(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[At]){r.loading=1;return}}else t=e.createElement(`link`),t[At]=!0,t.onload=t.onerror=Lt.bind(null,t),cp(t,`link`,n),It(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 Wm(e){return`[src="`+rn(e)+`"]`}function Gm(e){return`script[async]`+e}function Km(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+rn(n.href)+`"]`);if(r)return t.instance=r,It(r),r;var a=D({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),It(r),cp(r,`style`,a),qm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Bm(n.href);var o=e.querySelector(Vm(a));if(o)return t.state.loading|=4,t.instance=o,It(o),o;r=Hm(n),(a=wm.get(a))&&Jm(r,a),o=(e.ownerDocument||e).createElement(`link`),It(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),cp(o,`link`,r),t.state.loading|=4,qm(o,n.precedence,e),t.instance=o;case`script`:return o=Wm(n.src),(a=e.querySelector(Gm(o)))?(t.instance=a,It(a),a):(r=n,(a=wm.get(o))&&(r=D({},n),Ym(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),It(a),cp(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,qm(r,n.precedence,e));return t.instance}function qm(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 Jm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Ym(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Xm=null;function Zm(e,t,n){if(Xm===null){var r=new Map,i=Xm=new Map;i.set(n,r)}else i=Xm,r=i.get(n),r||(r=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[kt]||a[St]||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 Qm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function $m(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 eh(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function th(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function nh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function rh(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=nh(t),e.suspenseyImages.push(t)),e=lh.bind(e),t.decode().then(e,e))}function ih(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=Bm(r.href),a=t.querySelector(Vm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=ch.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,It(a);return}a=t.ownerDocument||t,r=Hm(r),(i=wm.get(i))&&Jm(r,i),a=a.createElement(`link`),It(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),cp(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=ch.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var ah=0;function oh(e,t){return e.stylesheets&&e.count===0&&dh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&dh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&ah===0&&(ah=62500*fp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&dh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>ah?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function sh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)dh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function ch(){this.count--,sh(this)}function lh(){this.imgCount--,sh(this)}var uh=null;function dh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,uh=new Map,t.forEach(fh,e),uh=null,ch.call(e))}function fh(e,t){if(!(t.state.loading&4)){var n=uh.get(e);if(n)var r=n.get(null);else{n=new Map,uh.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=ch.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 ph={$$typeof:P,Provider:null,Consumer:null,_currentValue:ge,_currentValue2:ge,_threadCount:0};function mh(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=dt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=dt(0),this.hiddenUpdates=dt(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=new Map}function hh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new mh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Mi(3,null,null,t),e.current=a,a.stateNode=e,t=Ma(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},ho(a),e}function gh(e){return e?(e=Ai,e):Ai}function _h(e,t,n,r,i,a){i=gh(i),r.context===null?r.context=i:r.pendingContext=i,r=_o(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=vo(e,r,t),n!==null&&(zd(n,e,t),yo(n,e,t))}function vh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function yh(e,t){vh(e,t),(e=e.alternate)&&vh(e,t)}function bh(e){if(e.tag===13||e.tag===31){var t=Di(e,67108864);t!==null&&zd(t,e,67108864),yh(e,67108864)}}function xh(e){if(e.tag===13||e.tag===31){var t=Id();t=_t(t);var n=Di(e,t);n!==null&&zd(n,e,t),yh(e,t)}}var Sh=!0;function Ch(e,t,n,r){var i=I.T;I.T=null;var a=he.p;try{he.p=2,Th(e,t,n,r)}finally{he.p=a,I.T=i}}function wh(e,t,n,r){var i=I.T;I.T=null;var a=he.p;try{he.p=8,Th(e,t,n,r)}finally{he.p=a,I.T=i}}function Th(e,t,n,r){if(Sh){var i=Eh(r);if(i===null)Zf(e,t,r,Dh,n),Rh(e,r);else if(Bh(i,e,t,n,r))r.stopPropagation();else if(Rh(e,r),t&4&&-1<Lh.indexOf(e)){for(;i!==null;){var a=Nt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=at(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Qe(o);s.entanglements[1]|=c,o&=~c}Mf(a),!(U&6)&&(xd=Be()+500,Nf(0,!1))}}break;case 31:case 13:s=Di(a,2),s!==null&&zd(s,a,2),Wd(),yh(a,2)}if(a=Eh(r),a===null&&Zf(e,t,r,Dh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Zf(e,t,r,null,n)}}function Eh(e){return e=xn(e),Oh(e)}var Dh=null;function Oh(e){if(Dh=null,e=Mt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(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 Dh=e,null}function kh(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(Ve()){case He:return 2;case Ue:return 8;case We:case Ge:return 32;case Ke:return 268435456;default:return 32}default:return 32}}var Ah=!1,jh=null,Mh=null,Nh=null,Ph=new Map,Fh=new Map,Ih=[],Lh=`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 Rh(e,t){switch(e){case`focusin`:case`focusout`:jh=null;break;case`dragenter`:case`dragleave`:Mh=null;break;case`mouseover`:case`mouseout`:Nh=null;break;case`pointerover`:case`pointerout`:Ph.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Fh.delete(t.pointerId)}}function zh(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=Nt(t),t!==null&&bh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Bh(e,t,n,r,i){switch(t){case`focusin`:return jh=zh(jh,e,t,n,r,i),!0;case`dragenter`:return Mh=zh(Mh,e,t,n,r,i),!0;case`mouseover`:return Nh=zh(Nh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Ph.set(a,zh(Ph.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Fh.set(a,zh(Fh.get(a)||null,e,t,n,r,i)),!0}return!1}function Vh(e){var t=Mt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,bt(e.priority,function(){xh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,bt(e.priority,function(){xh(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 Hh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Eh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);bn=r,n.target.dispatchEvent(r),bn=null}else return t=Nt(n),t!==null&&bh(t),e.blockedOn=n,!1;t.shift()}return!0}function Uh(e,t,n){Hh(e)&&n.delete(t)}function Wh(){Ah=!1,jh!==null&&Hh(jh)&&(jh=null),Mh!==null&&Hh(Mh)&&(Mh=null),Nh!==null&&Hh(Nh)&&(Nh=null),Ph.forEach(Uh),Fh.forEach(Uh)}function Gh(e,n){e.blockedOn===n&&(e.blockedOn=null,Ah||(Ah=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Wh)))}var Kh=null;function qh(e){Kh!==e&&(Kh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Kh===e&&(Kh=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(Oh(r||n)===null)continue;break}var a=Nt(n);a!==null&&(e.splice(t,3),t-=3,nc(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Jh(e){function t(t){return Gh(t,e)}jh!==null&&Gh(jh,e),Mh!==null&&Gh(Mh,e),Nh!==null&&Gh(Nh,e),Ph.forEach(t),Fh.forEach(t);for(var n=0;n<Ih.length;n++){var r=Ih[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ih.length&&(n=Ih[0],n.blockedOn===null);)Vh(n),n.blockedOn===null&&Ih.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[Ct]||null;if(typeof a==`function`)o||qh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[Ct]||null)s=o.formAction;else if(Oh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),qh(n)}}}function Yh(){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 Xh(e){this._internalRoot=e}Zh.prototype.render=Xh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;_h(n,Id(),e,t,null,null)},Zh.prototype.unmount=Xh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;_h(e.current,2,null,e,null,null),Wd(),t[wt]=null}};function Zh(e){this._internalRoot=e}Zh.prototype.unstable_scheduleHydration=function(e){if(e){var t=yt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ih.length&&t!==0&&t<Ih[n].priority;n++);Ih.splice(n,0,e),n===0&&Vh(e)}};var Qh=n.version;if(Qh!==`19.3.0`)throw Error(i(527,Qh,`19.3.0`));he.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var $h={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:I,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var eg=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!eg.isDisabled&&eg.supportsFiber)try{Ye=eg.inject($h),Xe=eg}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Tc,s=Ec,c=Dc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=hh(e,1,!1,null,null,n,r,null,o,s,c,Yh),e[wt]=t.current,Yf(e),new Xh(t)}})),_=o(((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=g()})),v=l(d(),1),y=_();function b(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var n,r,i,a,o=[],s=``,c=e.split(`/`);for(c[0]||c.shift();i=c.shift();)n=i[0],n===`*`?(o.push(n),s+=i[1]===`?`?`(?:/(.*))?`:`/(.*)`):n===`:`?(r=i.indexOf(`?`,1),a=i.indexOf(`.`,1),o.push(i.substring(1,~r?r:~a?a:i.length)),s+=~r&&!~a?`(?:/([^/]+?))?`:`/([^/]+?)`,~a&&(s+=(~r?`?`:``)+`\\`+i.substring(a))):s+=`/`+i;return{keys:o,pattern:RegExp(`^`+s+(t?`(?=$|/)`:`/?$`),`i`)}}var x=o((e=>{var t=d();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),S=o(((e,t)=>{t.exports=x()}))(),C=v.useInsertionEffect,w=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?v.useLayoutEffect:v.useEffect,T=C||w,E=e=>{let t=v.useRef([e,(...e)=>t[0](...e)]).current;return T(()=>{t[0]=e}),t[1]},D=[`popstate`,`pushState`,`replaceState`,`hashchange`],O=[],k=()=>O.forEach(e=>e()),A=e=>(O.push(e)===1&&D.forEach(e=>addEventListener(e,k)),()=>{O=O.filter(t=>t!==e),O.length||D.forEach(e=>removeEventListener(e,k))}),j=(e,t)=>(0,S.useSyncExternalStore)(A,e,t),M=()=>location.search,ee=({ssrSearch:e}={})=>j(M,e==null?M:()=>e),N=()=>location.pathname,P=({ssrPath:e}={})=>j(N,e==null?N:()=>e),te=(e,{replace:t=!1,state:n=null}={})=>history[t?`replaceState`:`pushState`](n,``,e),ne=e=>[P(e),te],F=Symbol.for(`wouter_v3`);if(typeof history<`u`&&window[F]===void 0){for(let e of[`pushState`,`replaceState`]){let t=history[e];history[e]=function(){let n=t.apply(this,arguments),r=new Event(e);return r.arguments=arguments,dispatchEvent(r),n}}Object.defineProperty(window,F,{value:!0})}var re=(e=``)=>e===`/`?``:e,ie=(e,t)=>e[0]===`~`?e.slice(1):re(t)+e,ae=(e,t)=>(e=oe(re(e)),t=oe(t),!e||!t.toLowerCase().indexOf(e.toLowerCase())?t.slice(e.length)||`/`:`~`+t),oe=e=>{try{return e.includes(`%`)?decodeURI(e):e}catch{return e}},se={hook:ne,searchHook:ee,parser:b,base:``,ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:e=>e,aroundNav:(e,t,n)=>e(t,n)},ce=(0,v.createContext)(se),le=()=>(0,v.useContext)(ce),ue={},de=(0,v.createContext)(ue),fe=()=>(0,v.useContext)(de),pe=(e,t=e.base)=>ae(t,e.hook(e)[0]),me=e=>{let[t,n]=e.hook(e);return[ae(e.base,t),E((t,r)=>e.aroundNav(n,ie(t,e.base),r))]},I=()=>me(le()),he=(e,t,n,r)=>{let{pattern:i,keys:a}=t instanceof RegExp?{pattern:t}:e(t||`*`,r),o=i.exec(n);if(!o)return[!1,null];let s={};for(let e=1;e<o.length;e++)s[e-1]=o[e];if(a)for(let e=0;e<a.length;e++)s[a[e]]=o[e+1];else Object.assign(s,o.groups);return r?[!0,s,o[0]]:[!0,s]},ge=({children:e,...t})=>{let n=le(),r=t.hook?se:n,i=r;if(t.ssrPath){let[e,n=t.ssrSearch??``]=t.ssrPath.split(`?`);e&&(t.ssrSearch=n,t.ssrPath=e)}t.hrefs=t.hrefs??t.hook?.hrefs,t.searchHook=t.searchHook??t.hook?.searchHook;let a=(0,v.useRef)(r),o=a.current,s=o;for(let e in r){let n=e===`base`?r[e]+(t[e]??``):t[e]??r[e];n!==s[e]&&(o===s&&(a.current=s={...s}),s[e]=n),(n!==r[e]||n!==i[e])&&(i=s)}return(0,v.createElement)(ce.Provider,{value:i},e)},_e=({children:e,component:t},n)=>t?(0,v.createElement)(t,{params:n}):typeof e==`function`?e(n):e,ve=e=>{let t=(0,v.useRef)(ue),n=t.current,r=Object.keys(e);return t.current=r.length!==Object.keys(n).length||r.some(t=>e[t]!==n[t])?e:n},L=({path:e,nest:t,match:n,...r})=>{let i=le(),a=pe(i),[o,s,c]=n??he(i.parser,e,a,t),l=ve({...fe(),...s});if(!o)return null;let u=_e(r,l);return(0,v.createElement)(de.Provider,{value:l},c?(0,v.createElement)(ge,{base:c},u):u)},ye=(0,v.forwardRef)((e,t)=>{let n=le(),[r,i]=me(n),{to:a=``,href:o=a,onClick:s,asChild:c,children:l,className:u,replace:d,state:f,transition:p,...m}=e;return m.onClick=E(t=>{t.ctrlKey||t.metaKey||t.altKey||t.shiftKey||t.button!==0||(s?.(t),t.defaultPrevented||(t.preventDefault(),i(o,e)))}),m.href=n.hrefs(o[0]===`~`?o.slice(1):n.base+o,n),u!==void 0&&(m.className=u?.call?u(r===o):u),t&&(m.ref=t),c&&(0,v.isValidElement)(l)?(0,v.cloneElement)(l,m):(0,v.createElement)(`a`,m,l)}),be=(e,t=[])=>{if(Array.isArray(e))for(let n of e)be(n&&n.type===v.Fragment?n.props.children:n,t);else t.push(e);return t},xe=({children:e,location:t})=>{let n=le(),r=pe(n);for(let i of be(e)){let e=0;if((0,v.isValidElement)(i)&&(e=he(n.parser,i.props.path,t||r,i.props.nest))[0])return(0,v.cloneElement)(i,{match:e})}return null},Se=e=>{let{to:t,href:n=t}=e,r=le(),[,i]=me(r),a=E(()=>i(t||n,e)),{ssrContext:o}=r;return w(()=>{a()},[]),o&&(o.redirectTo=t),null},Ce=[],we=()=>Ce.forEach(e=>e()),Te=e=>(Ce.push(e)===1&&addEventListener(`hashchange`,we),()=>{Ce=Ce.filter(t=>t!==e),Ce.length||removeEventListener(`hashchange`,we)}),Ee=/^#?\/?/,De=()=>`/`+location.hash.replace(Ee,``),Oe=(e,{state:t=null,replace:n=!1}={})=>{let r=location.href,[i,a]=e.replace(Ee,``).split(`?`),o=new URL(r);o.hash=`/${i}`,a!==void 0&&(o.search=a);let s=o.href;history[n?`replaceState`:`pushState`](t,``,s);let c=typeof HashChangeEvent<`u`?new HashChangeEvent(`hashchange`,{oldURL:r,newURL:s}):new Event(`hashchange`,{detail:{oldURL:r,newURL:s}});dispatchEvent(c)},ke=({ssrPath:e=`/`}={})=>[(0,S.useSyncExternalStore)(Te,De,()=>e),Oe];ke.hrefs=e=>`#`+e;var Ae=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),R=o(((e,t)=>{t.exports=Ae()}))(),je=v.createContext(void 0),Me=e=>{let t=v.useContext(je);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Ne=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,R.jsx)(je.Provider,{value:e,children:t})),Pe={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Fe=new class{#e=Pe;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 Ie(e){setTimeout(e,0)}var Le=typeof window>`u`||`Deno`in globalThis;function Re(){}function ze(e,t){return typeof e==`function`?e(t):e}function Be(e){return typeof e==`number`&&e>=0&&e!==1/0}function Ve(e,t){return Math.max(e+(t||0)-Date.now(),0)}function He(e,t){return typeof e==`function`?e(t):e}function Ue(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==Ge(o,t.options))return!1}else if(!qe(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 We(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Ke(t.options.mutationKey)!==Ke(a))return!1}else if(!qe(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Ge(e,t){return(t?.queryKeyHashFn||Ke)(e)}function Ke(e){return JSON.stringify(e,(e,t)=>Qe(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function qe(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(!qe(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!qe(e[r],t[r]))return!1;return!0}return!1}var Je=Object.prototype.hasOwnProperty;function Ye(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=Ze(e)&&Ze(t);if(!r&&!(Qe(e)&&Qe(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:Je.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=Ye(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function Xe(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 Ze(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Qe(e){if(!$e(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!(!$e(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function $e(e){return Object.prototype.toString.call(e)===`[object Object]`}function et(e){return new Promise(t=>{Fe.setTimeout(t,e)})}function tt(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:Ye(e,t)}function nt(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function rt(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var it=Symbol();function at(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===it?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ot(e,t){return typeof e==`function`?e(...t):!!e}function st(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var ct=()=>Le,lt=()=>ct(),ut=class{constructor(){this.listeners=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(){}},dt=new class extends ut{#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`}},ft=Ie;function pt(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=ft,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 mt=pt(),ht=new class extends ut{#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 gt(e){return Math.min(1e3*2**e,3e4)}function _t(e){return(e??`online`)!==`online`||ht.isOnline()}var vt=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function yt(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(Re);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new vt(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>dt.isFocused()&&(e.networkMode===`always`||ht.isOnline())&&e.canRun(),p=()=>_t(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(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??(lt()?0:3),a=e.retryDelay??gt,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!s){h(r);return}n++,e.onFail?.(n,r),et(o).then(()=>f()?void 0:g()).then(()=>{t?h(r):_()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g().then(_),s)}}var bt=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Be(this.gcTime)&&(this.#e=Fe.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(lt()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(Fe.clearTimeout(this.#e),this.#e=void 0)}};function xt(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=>{st(e,()=>t.signal,()=>n=!0)},u=at(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?rt:nt;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?Ct:St,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]??r.initialPageParam:St(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 St(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 Ct(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var wt=class extends bt{#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=Dt(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=Dt(this.options);e.data!==void 0&&(this.setState(Et(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=tt(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(Re).catch(Re):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=>He(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===it||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>He(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:!Ve(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=at(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`?xt(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=yt({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof vt&&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 vt){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,...Tt(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Et(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),mt.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Tt(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:_t(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Et(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Dt(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 Ot=class extends ut{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=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),At(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return jt(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return jt(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=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 He(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&&!Xe(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Mt(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||He(this.options.enabled,this.#t)!==He(t.enabled,this.#t)||He(this.options.staleTime,this.#t)!==He(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||He(this.options.enabled,this.#t)!==He(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 Xe(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().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(Re)),t}#h(e){return!lt()&&He(this.options.enabled,this.#t)!==!1&&Be(e)}#g(){this.#b();let e=He(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=Ve(this.#r.dataUpdatedAt,e)+1;this.#u=Fe.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return He(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=Fe.setInterval(()=>{(this.options.refetchIntervalInBackground||dt.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(Fe.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(Fe.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&&At(e,t),o=i&&Mt(e,n,t,r);(a||o)&&(l={...l,...Tt(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=tt(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=tt(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:Nt(e,t),refetch:this.refetch,isEnabled:He(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),Xe(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)})})();mt.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 kt(e,t){return He(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||He(t.retryOnMount,e)!==!1)}function At(e,t){return kt(e,t)||e.state.data!==void 0&&jt(e,t,t.refetchOnMount)}function jt(e,t,n){if(He(t.enabled,e)!==!1&&He(t.staleTime,e)!==`static`){let r=He(n,e);return r===`always`||r!==!1&&Nt(e,t)}return!1}function Mt(e,t,n,r){return(e!==t||He(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Nt(e,n)}function Nt(e,t){return He(t.enabled,e)!==!1&&e.isStaleByTime(He(t.staleTime,e))}var Pt=class extends bt{#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||Ft(),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=yt({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(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),mt.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Ft(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var It=class extends ut{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new Pt({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=Lt(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=Lt(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=Lt(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=Lt(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){mt.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>We(t,e))}findAll(e={}){return this.getAll().filter(t=>We(e,t))}notify(e){mt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return mt.batch(()=>Promise.all(e.map(e=>e.continue().catch(Re))))}};function Lt(e){return e.options.scope?.id}var Rt=class extends ut{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??Ge(r,t),a=this.get(i);return a||(a=new wt({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(){mt.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=>Ue(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>Ue(e,t)):t}notify(e){mt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){mt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){mt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},zt=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Rt,this.#t=e.mutationCache||new It,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=dt.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=ht.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(He(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=ze(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return mt.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;mt.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return mt.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=mt.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(Re).catch(Re)}invalidateQueries(e,t={}){return mt.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=mt.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(Re)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(Re)}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(He(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(He(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Re).catch(Re)}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(Re).catch(Re)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return ht.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(Ke(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{qe(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(Ke(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{qe(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||=Ge(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===it&&(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()}},Bt=v.createContext(!1),Vt=()=>v.useContext(Bt);Bt.Provider;function Ht(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Ut=v.createContext(Ht()),Wt=()=>v.useContext(Ut),Gt=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?ot(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},Kt=e=>{v.useEffect(()=>{e.clearReset()},[e])},qt=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||ot(n,[e.error,r])),Jt=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))}},Yt=(e,t)=>e?.suspense&&t.isPending,Xt=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Zt(e,t,n){let r=Vt(),i=Wt(),a=Me(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,Jt(o),Gt(o,i,s),Kt(i);let[l]=v.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(v.useSyncExternalStore(v.useCallback(e=>{let t=d?l.subscribe(mt.batchCalls(e)):Re;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),v.useEffect(()=>{l.setOptions(o)},[o,l]),Yt(o,u))throw Xt(o,l,i);if(qt({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 Zt(e,Ot,t)}var $t=(0,v.createContext)({});function en(e){let t=(0,v.useRef)(null);return t.current===null&&(t.current=e()),t.current}var tn=typeof window<`u`?v.useLayoutEffect:v.useEffect,nn=(0,v.createContext)(null);function rn(e,t){e.indexOf(t)===-1&&e.push(t)}function an(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var on=(e,t,n)=>n>t?t:n<e?e:n,sn={},cn=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),ln=e=>typeof e==`object`&&!!e,un=e=>/^0[^.\s]+$/u.test(e);function dn(e){let t;return()=>(t===void 0&&(t=e()),t)}var fn=e=>e,pn=(...e)=>e.reduce((e,t)=>n=>t(e(n))),mn=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1},hn=class{constructor(){this.subscriptions=[]}add(e){return rn(this.subscriptions,e),()=>this.remove(e)}remove(e){an(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}},gn=e=>e*1e3,_n=e=>e/1e3,vn=(e,t)=>t?1e3/t*e:0,yn=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,bn=1e-7,xn=12;function Sn(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=yn(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>bn&&++s<xn);return o}function Cn(e,t,n,r){if(e===t&&n===r)return fn;let i=t=>Sn(t,0,1,e,n);return e=>e===0||e===1?e:yn(i(e),t,r)}var wn=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Tn=e=>t=>1-e(1-t),En=Cn(.33,1.53,.69,.99),Dn=Tn(En),On=wn(Dn),kn=e=>e>=1?1:(e*=2)<1?.5*Dn(e):.5*(2-2**(-10*(e-1))),An=e=>1-Math.sin(Math.acos(e)),jn=Tn(An),Mn=wn(An),Nn=Cn(.42,0,1,1),Pn=Cn(0,0,.58,1),Fn=Cn(.42,0,.58,1),In=e=>Array.isArray(e)&&typeof e[0]!=`number`,Ln=e=>Array.isArray(e)&&typeof e[0]==`number`,Rn={linear:fn,easeIn:Nn,easeInOut:Fn,easeOut:Pn,circIn:An,circInOut:Mn,circOut:jn,backIn:Dn,backInOut:On,backOut:En,anticipate:kn},zn=e=>typeof e==`string`,Bn=e=>{if(Ln(e)){e.length;let[t,n,r,i]=e;return Cn(t,n,r,i)}return zn(e)?(Rn[e],`${e}`,Rn[e]):e},Vn=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function Hn(e){let t=new Set,n=new Set,r=!1,i=!1,a=new Set,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(n.add(t),e()),t(o)}let c={schedule:(e,i=!1,o=!1)=>{let s=o&&r?t:n;return i&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r){i=!0;return}r=!0;let a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(e))}};return c}var Un=40;function Wn(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=Vn.reduce((e,t)=>(e[t]=Hn(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=sn.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,Un),1)),i.timestamp=o,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:Vn.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<Vn.length;t++)o[Vn[t]].cancel(e)},state:i,steps:o}}var{schedule:Gn,cancel:Kn,state:qn,steps:Jn}=Wn(typeof requestAnimationFrame<`u`?requestAnimationFrame:fn,!0),Yn;function Xn(){Yn=void 0}var Zn={now:()=>(Yn===void 0&&Zn.set(qn.isProcessing||sn.useManualTiming?qn.timestamp:performance.now()),Yn),set:e=>{Yn=e,queueMicrotask(Xn)}},Qn=e=>Math.round(e*1e5)/1e5,$n=e=>t=>typeof t==`string`&&t.startsWith(e),er=$n(`--`),tr=$n(`var(--`),nr=e=>tr(e)?rr.test(e.split(`/*`)[0].trim()):!1,rr=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function ir(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}var ar={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},or={...ar,transform:e=>on(0,1,e)},sr={...ar,default:1},cr=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function lr(e){return e==null}var ur=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,dr=(e,t)=>n=>!!(typeof n==`string`&&ur.test(n)&&n.startsWith(e)||t&&!lr(n)&&Object.prototype.hasOwnProperty.call(n,t)),fr=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(cr);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},pr=e=>on(0,255,e),mr={...ar,transform:e=>Math.round(pr(e))},hr={test:dr(`rgb`,`red`),parse:fr(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+mr.transform(e)+`, `+mr.transform(t)+`, `+mr.transform(n)+`, `+Qn(or.transform(r))+`)`};function gr(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var _r={test:dr(`#`),parse:gr,transform:hr.transform},vr=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),yr=vr(`deg`),br=vr(`%`),z=vr(`px`),xr=vr(`vh`),Sr=vr(`vw`),Cr={...br,parse:e=>br.parse(e)/100,transform:e=>br.transform(e*100)},wr={test:dr(`hsl`,`hue`),parse:fr(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+br.transform(Qn(t))+`, `+br.transform(Qn(n))+`, `+Qn(or.transform(r))+`)`},Tr={test:e=>hr.test(e)||_r.test(e)||wr.test(e),parse:e=>hr.test(e)?hr.parse(e):wr.test(e)?wr.parse(e):_r.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?hr.transform(e):wr.transform(e),getAnimatableNone:e=>{let t=Tr.parse(e);return t.alpha=0,Tr.transform(t)}},Er=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,Dr=new RegExp(cr.source),Or=new RegExp(Er.source,`i`);function kr(e){return isNaN(e)&&typeof e==`string`&&(Dr.test(e)||Or.test(e))}var Ar=`number`,jr=`color`,Mr=`var`,Nr=`var(`,Pr="${}",Fr=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Ir(e){let t=e.toString();return Dr.test(t)||Or.test(t)}function Lr(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(Fr,e=>(Tr.test(e)?(r.color.push(a),i.push(jr),n.push(Tr.parse(e))):e.startsWith(Nr)?(r.var.push(a),i.push(Mr),n.push(e)):(r.number.push(a),i.push(Ar),n.push(parseFloat(e))),++a,Pr)).split(Pr),indexes:r,types:i}}function Rr(e){return Lr(e).values}function zr({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===Ar?Qn(r[a]):e===jr?Tr.transform(r[a]):r[a]}return i}}function Br(e){return zr(Lr(e))}var Vr=e=>typeof e==`number`?0:Tr.test(e)?Tr.getAnimatableNone(e):e,Hr=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:Vr(e);function Ur(e){let t=Lr(e);return zr(t)(t.values.map((e,n)=>Hr(e,t.split[n])))}var Wr={test:kr,parse:Rr,createTransformer:Br,getAnimatableNone:Ur};function Gr(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 Kr({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=Gr(s,r,e+1/3),a=Gr(s,r,e),o=Gr(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function qr(e,t){return n=>n>0?t:e}var Jr=(e,t,n)=>e+(t-e)*n,Yr=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Xr=[_r,hr,wr],Zr=e=>Xr.find(t=>t.test(e));function Qr(e){let t=Zr(e);if(!t)return`${e}`,!1;let n=t.parse(e);return t===wr&&(n=Kr(n)),n}var $r=(e,t)=>{let n=Qr(e),r=Qr(t);if(!n||!r)return qr(e,t);let i={...n};return e=>(i.red=Yr(n.red,r.red,e),i.green=Yr(n.green,r.green,e),i.blue=Yr(n.blue,r.blue,e),i.alpha=Jr(n.alpha,r.alpha,e),hr.transform(i))},ei=new Set([`none`,`hidden`]);function ti(e,t){return ei.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function ni(e,t){return n=>Jr(e,t,n)}function ri(e){return typeof e==`number`?ni:typeof e==`string`?nr(e)?qr:Tr.test(e)?$r:si:Array.isArray(e)?ii:typeof e==`object`?Tr.test(e)?$r:ai:qr}function ii(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>ri(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function ai(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=ri(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function oi(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 si=(e,t)=>{let n=Wr.createTransformer(t),r=Lr(e),i=Lr(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?ei.has(e)&&!i.values.length||ei.has(t)&&!r.values.length?ti(e,t):pn(ii(oi(r,i),i.values),n):(`${e}${t}`,qr(e,t))},ci=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function li(e,t){let n=ci.exec(e);if(!n)return;let r=ci.exec(t);if(!r||n[2]!==r[2])return;let i=n[2],a=parseFloat(n[1]),o=parseFloat(r[1]);return e=>Qn(Jr(a,o,e))+i}function ui(e,t,n){if(typeof e==`number`&&typeof t==`number`&&typeof n==`number`)return Jr(e,t,n);if(typeof e==`string`&&typeof t==`string`){let n=li(e,t);if(n)return n}return ri(e)(e,t)}var di=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>Gn.update(t,e),stop:()=>Kn(t),now:()=>qn.isProcessing?qn.timestamp:Zn.now()}},fi=(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)})`},pi=2e4;function mi(e,t=50,n=pi,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 hi(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(mi(r),pi);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:_n(i)}}var gi={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function _i(e,t){return e*Math.sqrt(1-t*t)}var vi=12;function yi(e,t,n){let r=n;for(let n=1;n<vi;n++)r-=e(r)/t(r);return r}var bi=.001;function xi({duration:e=gi.duration,bounce:t=gi.bounce,velocity:n=gi.velocity,mass:r=gi.mass}){let i,a;gi.maxDuration;let o=1-t;o=on(gi.minDamping,gi.maxDamping,o),e=on(gi.minDuration,gi.maxDuration,_n(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=_i(t,o),c=Math.exp(-i);return bi-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o*o*t*t*e,c=Math.exp(-r),l=_i(t*t,o);return(-i(t)+bi>0?-1:1)*((a-s)*c)/l}):(i=t=>-.001+Math.exp(-t*e)*((t-n)*e+1),a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=yi(i,a,s);if(e=gn(e),isNaN(c))return{stiffness:gi.stiffness,damping:gi.damping,duration:e};{let t=c*c*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var Si=[`duration`,`bounce`];function Ci(e,t){return t.some(t=>e[t]!==void 0)}var wi=(e,t)=>(t?e>=0:e>0)&&e<1/0;function Ti(e,t){if(wi(e,t))return e}function Ei(e){let t=Ti(e.stiffness),n=Ti(e.damping,!0),r=Ti(e.mass),i={...e,stiffness:t??gi.stiffness,damping:n??gi.damping,mass:r??gi.mass,isResolvedFromDuration:!1,isTimeDefined:(t??n??r)===void 0&&Ci(e,Si)};if(i.isTimeDefined){if(i.velocity=0,e.visualDuration){let t=e.visualDuration,n=2*Math.PI/(t*1.2),r=n*n,a=2*on(.05,1,1-(e.bounce||0))*Math.sqrt(r);i={...i,mass:gi.mass,stiffness:r,damping:a}}else{let e=xi(i);i={...i,...e,mass:gi.mass},i.isResolvedFromDuration=!0}(!wi(i.stiffness)||!wi(i.damping,!0))&&(i.stiffness=gi.stiffness,i.damping=gi.damping)}return i}function Di(e=gi.visualDuration,t=gi.bounce){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,velocity:u,isResolvedFromDuration:d,isTimeDefined:f}=Ei({...n,velocity:-_n(n.velocity||0)}),p=s/(2*Math.sqrt(o*c)),m=_n(Math.sqrt(o/c)),h=p*m,g={target:i,delta:i-r,velocity:u||0,restSpeed:0,restDelta:0},_=()=>{let e=Math.abs(g.delta)<5;g.restSpeed=n.restSpeed||(e?gi.restSpeed.granular:gi.restSpeed.default),g.restDelta=n.restDelta||(e?gi.restDelta.granular:gi.restDelta.default)};_();let v,y,b;if(p<1){let e=_i(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);v=t=>{let n=Math.exp(-h*t),r=Math.min(e*t,300);return g.target-n*((g.velocity+h*g.delta)*Math.sinh(r)+e*g.delta*Math.cosh(r))/e};let t={P:0,sinh:0,cosh:0};b=()=>{t.P=(g.velocity+h*g.delta)/e,t.sinh=h*t.P-g.delta*e,t.cosh=h*g.delta-t.P*e},y=n=>{let r=Math.exp(-h*n),i=Math.min(e*n,300);return r*(t.sinh*Math.sinh(i)+t.cosh*Math.cosh(i))}}b();let x=d&&l||null,S={calculatedDuration:x,retarget:(e,t)=>{g.target=e[e.length-1],g.delta=g.target-e[0],g.velocity=f?0:-_n(t),n.restSpeed&&n.restDelta||_(),S.calculatedDuration=x,a.done=!1,b()},velocity:e=>gn(y(e)),next:e=>{let t=v(e);if(d)a.done=e>=l;else{let n=gn(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(mi(S),pi),t=fi(t=>S.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return S}Di.applyToOptions=e=>{let t=hi(e,100,Di);return e.ease=t.ease,e.duration=gn(t.duration),e.type=`keyframes`,e};function Oi({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===void 0?g:o(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?_:_+t},b,x,S=e=>{p(f.value)&&(b=e,x=Di({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 ki(e,t,n){let r=[],i=n||sn.mix||ui,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=pn(Array.isArray(t)?t[n]||fn:t,a)),r.push(a)}return r}function Ai(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,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=ki(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=mn(e[r],e[r+1],n);return s[r](i)};return n?t=>l(on(e[0],e[a-1],t)):l}function ji(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=mn(0,t,r);e.push(Jr(n,1,i))}}function Mi(e){let t=[0];return ji(t,e.length-1),t}function Ni(e,t){return e.map(e=>e*t)}function Pi(e,t){return e.map(()=>t||Fn).splice(0,e.length-1)}function Fi({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=In(r)?r.map(Bn):Bn(r)||Fn,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:(sn.mix||ui)(n,r);return{calculatedDuration:e,next:t=>(a.value=o?o(i(e>0?on(0,1,t/e):1)):r,a.done=t>=e,a)}}let o=Ai(Ni(n&&n.length===t.length?n:Mi(t),e),t,{ease:Array.isArray(i)?i:Pi(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var Ii=5;function Li(e,t,n){let r=Math.max(t-Ii,0);return vn(n-e(r),t-r)}function Ri(e,t,n=0){return t<=0?n:e.velocity?e.velocity(t):Li(t=>e.next(t).value,t,e.next(t).value)}var zi=e=>e!==null;function Bi(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(zi),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var Vi={decay:Oi,inertia:Oi,tween:Fi,keyframes:Fi,spring:Di};function Hi(e){typeof e.type==`string`&&(e.type=Vi[e.type])}function Ui(e,t){return{kind:e,animation:t,timestamp:Zn.now(),frameTimestamp:qn.timestamp,frameIsProcessing:qn.isProcessing}}function Wi(e,t,n){let r=globalThis.__MOTION_INSPECT__;if(r)try{r({...Ui(`animation-start`,e),options:n?{...t,...n}:t})}catch{}}function Gi(e,t){let n=globalThis.__MOTION_INSPECT__;if(n)try{n({...Ui(`layout-animation-start`,e),node:t})}catch{}}var Ki=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)}},qi=e=>e/100,Ji=class extends Ki{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!==Zn.now()&&this.tick(Zn.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause(),Wi(this,this.options)}initAnimation(){let{options:e}=this;Hi(e);let{type:t=Fi,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||Fi;s!==Fi&&typeof o[0]!=`number`&&(this.mixKeyframes=pn(qi,ui(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=mi(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.currentTime=this.holdTime===null?t:this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;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 g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=on(0,1,n)*o}let b;_?(this.delayState.value=l[0],b=this.delayState):b=y.next(v),i&&!_&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==Oi&&(b.value=Bi(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return _n(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+_n(e)}get time(){return _n(this.currentTime)}set time(e){e=gn(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 Ri(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(Zn.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=_n(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=di,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??n:this.startTime=n-this.holdTime,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(Zn.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.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}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)}},Yi=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function Xi(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(cr)||[];if(!r)return e;let i=n.replace(r,``),a=+!!Yi.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var Zi=/\b([a-z-]*)\(.*?\)/gu,Qi={...Wr,getAnimatableNone:e=>{let t=e.match(Zi);return t?t.map(Xi).join(` `):e}},$i={...Wr,getAnimatableNone:e=>{let t=Wr.parse(e);return Wr.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},ea={...ar,transform:Math.round},ta={borderWidth:z,borderTopWidth:z,borderRightWidth:z,borderBottomWidth:z,borderLeftWidth:z,borderRadius:z,borderTopLeftRadius:z,borderTopRightRadius:z,borderBottomRightRadius:z,borderBottomLeftRadius:z,width:z,maxWidth:z,height:z,maxHeight:z,top:z,right:z,bottom:z,left:z,inset:z,insetBlock:z,insetBlockStart:z,insetBlockEnd:z,insetInline:z,insetInlineStart:z,insetInlineEnd:z,padding:z,paddingTop:z,paddingRight:z,paddingBottom:z,paddingLeft:z,paddingBlock:z,paddingBlockStart:z,paddingBlockEnd:z,paddingInline:z,paddingInlineStart:z,paddingInlineEnd:z,margin:z,marginTop:z,marginRight:z,marginBottom:z,marginLeft:z,marginBlock:z,marginBlockStart:z,marginBlockEnd:z,marginInline:z,marginInlineStart:z,marginInlineEnd:z,fontSize:z,backgroundPositionX:z,backgroundPositionY:z,rotate:yr,pathRotation:yr,rotateX:yr,rotateY:yr,rotateZ:yr,scale:sr,scaleX:sr,scaleY:sr,scaleZ:sr,skew:yr,skewX:yr,skewY:yr,distance:z,translateX:z,translateY:z,translateZ:z,x:z,y:z,z,perspective:z,transformPerspective:z,opacity:or,originX:Cr,originY:Cr,originZ:z,zIndex:ea,fillOpacity:or,strokeOpacity:or,numOctaves:ea},na={...ta,color:Tr,backgroundColor:Tr,outlineColor:Tr,fill:Tr,stroke:Tr,borderColor:Tr,borderTopColor:Tr,borderRightColor:Tr,borderBottomColor:Tr,borderLeftColor:Tr,filter:Qi,WebkitFilter:Qi,mask:$i,WebkitMask:$i},ra=e=>na[e],ia=new Set([Qi,$i]);function B(e,t){let n=ra(e);return ia.has(n)||(n=Wr),n.getAnimatableNone?n.getAnimatableNone(t):void 0}function aa(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var oa=e=>e*180/Math.PI,sa=e=>la(oa(Math.atan2(e[1],e[0]))),ca={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:sa,rotateZ:sa,skewX:e=>oa(Math.atan(e[1])),skewY:e=>oa(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},la=e=>(e%=360,e<0&&(e+=360),e),ua=sa,da=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),fa=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),pa={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:da,scaleY:fa,scale:e=>(da(e)+fa(e))/2,rotateX:e=>la(oa(Math.atan2(e[6],e[5]))),rotateY:e=>la(oa(Math.atan2(-e[2],e[0]))),rotateZ:ua,rotate:ua,skewX:e=>oa(Math.atan(e[4])),skewY:e=>oa(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function ma(e){return+!!e.includes(`scale`)}function ha(e,t){if(!e||e===`none`)return ma(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=pa,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=ca,i=t}if(!i)return ma(t);let a=r[t],o=i[1].split(`,`).map(_a);return typeof a==`function`?a(o):o[a]}var ga=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return ha(n,t)};function _a(e){return parseFloat(e.trim())}var va=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],ya=new Set([...va,`pathRotation`]),ba=e=>e===ar||e===z,xa=new Set([`x`,`y`,`z`]),Sa=va.filter(e=>!xa.has(e));function Ca(e){let t=[];return Sa.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 wa=new Set([`bottom`,`right`]);function Ta(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 Ea={width:({width:e,paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r},i)=>Ta(e,i,`x`,t,n,r),height:({height:e,paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r},i)=>Ta(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:({transform:e})=>ha(e,`x`),y:({transform:e})=>ha(e,`y`)};Ea.translateX=Ea.x,Ea.translateY=Ea.y;var Da=new Set,Oa=!1,ka=!1,Aa=!1;function ja(){if(ka){let e=[],t=new Set,n=new Set;Da.forEach(r=>{r.needsMeasurement&&(e.push(r),t.add(r.element),wa.has(r.name)&&n.add(r.element))});let r=new Map;n.forEach(e=>{let t=Ca(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)})}ka=!1,Oa=!1,Da.forEach(e=>e.complete(Aa)),Da.clear()}function Ma(){Da.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(ka=!0)})}function Na(){Aa=!0,Ma(),ja(),Aa=!1}function Pa(e,t,n){if(typeof e==`string`){if(cn(e)||un(e))return parseFloat(e);if(!Wr.test(e)&&Wr.test(n))return B(t,n)}return e??void 0}var Fa=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?(Da.add(this),Oa||(Oa=!0,Gn.read(Ma),Gn.resolveKeyframes(ja))):(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=Pa(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])}aa(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Da.delete(this)}cancel(){this.state===`scheduled`&&(Da.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},Ia=e=>e.startsWith(`--`);function La(e,t,n){Ia(t)?e.style.setProperty(t,n):e.style[t]=n}var Ra={};function za(e,t){let n=dn(e);return()=>Ra[t]??n()}var Ba=za(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),Va=za(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),Ha=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Ua={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:Ha([0,.65,.55,1]),circOut:Ha([.55,0,1,.45]),backIn:Ha([.31,.01,.66,-.59]),backOut:Ha([.33,1.53,.69,.99])};function Wa(e,t){if(e)return typeof e==`function`?Va()?fi(e,t):`ease-out`:Ln(e)?Ha(e):Array.isArray(e)?e.map(e=>Wa(e,t)||Ua.easeOut):Ua[e]}function Ga(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=Wa(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 Ka(e){return typeof e==`function`&&`applyToOptions`in e}function qa({type:e,...t}){return Ka(e)&&Va()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var Ja=class extends Ki{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,e.type;let c=qa(e);this.animation=Ga(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=Bi(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),La(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()},Wi(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(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e!==`idle`&&e!==`finished`&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||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 _n(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+_n(e)}get time(){return _n(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=gn(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,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&Ba()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),fn):r(this)}},Ya={anticipate:kn,backInOut:On,circInOut:Mn};function Xa(e){return e in Ya}function Za(e){typeof e.ease==`string`&&Xa(e.ease)&&(e.ease=Ya[e.ease])}var Qa=10,$a=class extends Ja{constructor(e){Za(e),Hi(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new Ji({...a,autoplay:!1}),s=Math.max(Qa,Zn.now()-this.startTime),c=on(0,Qa,s-Qa),l=o.sample(s).value,{name:u}=this.options;i&&u&&La(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},eo=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(Wr.test(e)||e===`0`)&&!e.startsWith(`url(`));function to(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 no(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=eo(i,t),s=eo(a,t);return!o||!s?(o!==s&&`${t}${i}${a}${o?a:i}`,!1):to(e)||(n===`spring`||Ka(n))&&r}function ro(e){e.duration=0,e.type=`keyframes`}var io=new Set([`opacity`,`clipPath`,`filter`,`transform`,`backgroundColor`]),ao=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function oo(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&ao.test(e[t]))return!0;return!1}var so=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),co=dn(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function lo(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!n||!(io.has(n)||so.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 co()&&(io.has(n)||so.has(n)&&oo(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var uo=40,fo=class extends Ki{constructor(e){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Zn.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||Fa;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=Zn.now();let u=!0;no(e,i,a,o)||(u=!1,(sn.instantAnimations||!s)&&l?.(Bi(e,n,t)),e[0]=e[e.length-1],ro(n),n.repeat=0);let d=r?this.resolvedAt&&this.resolvedAt-this.createdAt>uo?this.resolvedAt:this.createdAt:void 0,{onComplete:f}=n;n.startTime??=d,n.finalKeyframe=t,n.keyframes=e,n.onComplete=()=>{f?.(),this.notifyFinished()};let p=u&&!c&&lo(n),m;if(p){n.element=n.motionValue?.owner?.current;try{m=new $a(n)}catch{m=new Ji(n)}}else m=new Ji(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(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Na()),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&&this.animation.cancel(),this.keyframeResolver?.cancel()}};function po(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 mo=30,ho=e=>!isNaN(parseFloat(e)),go={current:void 0},_o=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=Zn.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.notifyChange(),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=Zn.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=ho(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 hn)).add(t)}onChangeSubscribe(e){let{events:t}=this;return!t.change&&!this.changeSubscriber?this.changeSubscriber=e:(t.change||(t.change=new hn,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(){Gn.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&&this.stopPassiveEffect()}dirty(){this.notifyChange()}notifyChange(){let{current:e,changeSubscriber:t}=this;t?t(e):this.events.change?.notify(e)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return go.current&&go.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=Zn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>mo)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,mo);return vn(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.clearAnimation(),t()}),n||(this.animation=r),this.events.animationStart?.notify()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=void 0}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function vo(e,t){return new _o(e,t)}function yo(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function bo(e,t){let n=e?.[t]??e?.default??e;return n===e?n:yo(n,e)}var xo={type:`spring`,stiffness:500,damping:25,restSpeed:10},So=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Co={type:`keyframes`,duration:.8},wo={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},To=(e,{keyframes:t})=>t.length>2?Co:ya.has(e)?e.startsWith(`scale`)?So(t[1]):xo:wo,Eo=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function Do(e){for(let t in e)if(!Eo.has(t))return!0;return!1}var Oo=(e,t,n,r={},i,a)=>o=>{let s=bo(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=gn(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};Do(s)||Object.assign(u,To(e,u)),u.duration&&=gn(u.duration),u.repeatDelay&&=gn(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(ro(u),u.delay===0&&(d=!0)),(sn.instantAnimations||sn.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,ro(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=Bi(u.keyframes,s);if(e!==void 0){Gn.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new Ji(u):new fo(u)},ko=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ao(e){let t=ko.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function jo(e,t,n=1){`${e}`;let[r,i]=Ao(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return cn(e)?parseFloat(e):e}return nr(i)?jo(i,t,n+1):i}function Mo(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function No(e,t,n,r){if(typeof t==`function`){let[i,a]=Mo(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=Mo(r);t=t(n===void 0?e.custom:n,i,a)}return t}function Po(e,t,n){let r=e.getProps();return No(r,t,n===void 0?r.custom:n,e)}var Fo=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...va]),Io=e=>Array.isArray(e);function Lo(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,vo(n))}function Ro(e){return Io(e)?e[e.length-1]||0:e}function zo(e,t){let{transitionEnd:n={},transition:r={},...i}=Po(e,t)||{};i={...i,...n};for(let t in i)Lo(e,t,Ro(i[t]))}var Bo=e=>!!(e&&e.getVelocity);function Vo(e){return!!(Bo(e)&&e.add)}function Ho(e,t){let n=e.getValue(`willChange`);if(Vo(n))return n.add(t);if(!n&&sn.WillChange){let n=new sn.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function V(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var Uo=`data-`+V(`framerAppearId`);function Wo(e){return e.props[Uo]}var Go=typeof window<`u`;function Ko({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function qo(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?yo(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState&&e.animationState.getState()[i],p=a?.path;p&&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&&Ko(f,t))continue;let o={delay:n,...bo(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){Gn.update(()=>r.set(i));continue}let p=!1;if(Go&&window.MotionHandoffAnimation){let n=Wo(e);if(n){let e=window.MotionHandoffAnimation(n,t,Gn);e!==null&&(o.startTime=e,p=!0)}}Ho(e,t);let m=l??e.shouldReduceMotion;r.start(Oo(t,r,i,m&&Fo.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>Gn.update(()=>{o&&zo(e,o)});d.length?Promise.all(d).then(t):t()}return d}function Jo(e,t,n={}){let r=Po(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(qo(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return Yo(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}return Promise.all([a(),o(n.delay)])}function Yo(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push(Jo(c,t,{...o,delay:n+(typeof r==`function`?0:r)+po(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function Xo(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>Jo(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=Jo(e,t,n);else{let i=typeof t==`function`?Po(e,t,n.custom):t;r=Promise.all(qo(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}var Zo={test:e=>e===`auto`,parse:e=>e},Qo=e=>t=>t.test(e),$o=[ar,z,br,yr,Sr,xr,Zo],es=e=>$o.find(Qo(e));function ts(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||un(e)}var ns=new Set([`auto`,`none`,`0`]);function rs(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!ns.has(t)&&Ir(t)&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]!==i&&(e[r]=B(n,i))}var is=class extends Fa{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),nr(r))){let i=jo(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!Fo.has(n)||e.length!==2)return;let[r,i]=e;if(typeof r==`number`&&typeof i==`number`)return;let a=es(r),o=es(i);if(ir(r)!==ir(i)&&Ea[n]){this.needsMeasurement=!0;return}if(a!==o){if(ba(a)&&ba(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else Ea[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||ts(e[t]))&&n.push(t);n.length&&rs(e,n,t)}measure(){let{element:e,name:t}=this;return Ea[t](window.getComputedStyle(e.current),()=>e.measureViewportBox())}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!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||!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.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}},as=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`];function os(e){return ln(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}function ss(e){return ln(e)&&`ownerSVGElement`in e}var cs=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function ls(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var us={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},ds=va.length;function fs(e,t,n){let r=``,i=!0;for(let a=0;a<ds;a++){let o=va[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=cs(s,ta[o]);if(!c){i=!1;let t=us[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${cs(a,ta.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function ps(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(ya.has(e)){o=!0;continue}if(er(e)){i[e]=n;continue}{let t=cs(n,ta[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=fs(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 ms={offset:`stroke-dashoffset`,array:`stroke-dasharray`},hs={offset:`strokeDashoffset`,array:`strokeDasharray`};function gs(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?ms:hs;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var _s=[`transform`,`opacity`,`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function vs(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(ps(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 _s)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&&gs(d,i,a,o,!1)}function ys({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function bs({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function xs(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 Ss(e){return e===void 0||e===1}function Cs({scale:e,scaleX:t,scaleY:n}){return!Ss(e)||!Ss(t)||!Ss(n)}function ws(e){return Cs(e)||Ts(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Ts(e){return Es(e.x)||Es(e.y)}function Es(e){return e&&e!==`0%`}function Ds(e,t,n){return n+t*(e-n)}function Os(e,t,n,r,i){return i!==void 0&&(e=Ds(e,i,r)),Ds(e,n,r)+t}function ks(e,t=0,n=1,r,i){e.min=Os(e.min,t,n,r,i),e.max=Os(e.max,t,n,r,i)}function As(e,{x:t,y:n}){ks(e.x,t.translate,t.scale,t.originPoint),ks(e.y,n.translate,n.scale,n.originPoint)}var js=.999999999999,Ms=1.0000000000001;function Ns(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;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(Ps(e.x,-a.scroll.offset.x),Ps(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,As(e,o)),r&&ws(a.latestValues)&&Ls(e,a.latestValues,a.layout?.layoutBox))}t.x<Ms&&t.x>js&&(t.x=1),t.y<Ms&&t.y>js&&(t.y=1)}function Ps(e,t){e.min+=t,e.max+=t}function Fs(e,t,n,r,i=.5){ks(e,t,n,Jr(e.min,e.max,i),r)}function Is(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function Ls(e,t,n){let r=n??e;Fs(e.x,Is(t.x,r.x),t.scaleX,t.scale,t.originX),Fs(e.y,Is(t.y,r.y),t.scaleY,t.scale,t.originY)}function Rs(e,t){return ys(xs(e.getBoundingClientRect(),t))}function zs(e,t,n){let r=Rs(e,n),{scroll:i}=t;return i&&(Ps(r.x,i.offset.x),Ps(r.y,i.offset.y)),r}var{schedule:Bs,cancel:Vs}=Wn(queueMicrotask,!1),Hs={x:!1,y:!1};function Us(){return Hs.x||Hs.y}function Ws(e){return e===`x`||e===`y`?Hs[e]?null:(Hs[e]=!0,()=>{Hs[e]=!1}):Hs.x||Hs.y?null:(Hs.x=Hs.y=!0,()=>{Hs.x=Hs.y=!1})}function Gs(e,t){let n=ls(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function Ks(e){return!(e.pointerType===`touch`||Us())}function qs(e,t,n={}){let[r,i,a]=Gs(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=>{if(e.pointerType!==`touch`){if(n){r=!0;return}s(e)}};e.addEventListener(`pointerenter`,n=>{if(!Ks(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 Js=(e,t)=>t?e===t||Js(e,t.parentElement):!1,Ys=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,Xs=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function Zs(e){return Xs.has(e.tagName)||e.isContentEditable===!0}var Qs=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function $s(e){return Qs.has(e.tagName)||e.isContentEditable===!0}var ec=new WeakSet;function tc(e){return t=>{t.key===`Enter`&&e(t)}}function nc(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var rc=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=tc(()=>{if(ec.has(n))return;nc(n,`down`);let e=tc(()=>{nc(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>nc(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function ic(e){return Ys(e)&&!Us()}var ac=new WeakSet;function oc(e,t,n={}){let[r,i,a]=Gs(e,n),o=e=>{let r=e.currentTarget;if(!ic(e)||ac.has(e))return;ec.add(r),n.stopPropagation&&ac.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),ec.has(r)&&ec.delete(r),ic(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||Js(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),os(e)&&(e.addEventListener(`focus`,e=>rc(e,i)),!Zs(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}var sc=new WeakMap,cc,lc=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:ss(r)&&`getBBox`in r?r.getBBox()[t]:r[n],uc=lc(`inline`,`width`,`offsetWidth`),dc=lc(`block`,`height`,`offsetHeight`);function fc({target:e,borderBoxSize:t}){sc.get(e)?.forEach(n=>{n(e,{get width(){return uc(e,t)},get height(){return dc(e,t)}})})}function pc(e){e.forEach(fc)}function mc(){typeof ResizeObserver<`u`&&(cc=new ResizeObserver(pc))}function hc(e,t){cc||mc();let n=ls(e);return n.forEach(e=>{let n=sc.get(e);n||(n=new Set,sc.set(e,n)),n.add(t),cc?.observe(e)}),()=>{n.forEach(e=>{let n=sc.get(e);n?.delete(t),n?.size||cc?.unobserve(e)})}}var gc=new Set,_c;function vc(){_c=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};gc.forEach(t=>t(e))},window.addEventListener(`resize`,_c)}function yc(e){return gc.add(e),_c||vc(),()=>{gc.delete(e),!gc.size&&typeof _c==`function`&&(window.removeEventListener(`resize`,_c),_c=void 0)}}function bc(e,t){return typeof e==`function`?yc(e):hc(e,t)}var xc={value:null,addProjectionMetrics:null};function Sc(e){return ss(e)&&e.tagName===`svg`}var Cc=()=>({translate:0,scale:1,origin:0,originPoint:0}),wc=()=>({x:Cc(),y:Cc()}),Tc=()=>({min:0,max:0}),Ec=()=>({x:Tc(),y:Tc()}),Dc=new WeakMap;function Oc(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function kc(e){return typeof e==`string`||Array.isArray(e)}var Ac=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],jc=[`initial`,...Ac];function Mc(e){if(Oc(e.animate))return!0;for(let t=0;t<jc.length;t++)if(kc(e[jc[t]]))return!0;return!1}function Nc(e){return!!(Mc(e)||e.variants)}function Pc(e,t,n){for(let r in t){let i=t[r],a=n[r];if(Bo(i))e.addValue(r,i);else if(Bo(a))e.addValue(r,vo(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,vo(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var Fc={current:null},Ic={current:!1},Lc=typeof window<`u`;function Rc(){if(Ic.current=!0,Lc){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>Fc.current=e.matches;e.addEventListener(`change`,t),t()}else Fc.current=!1}}var zc=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],Bc={};function Vc(e){Bc=e}function Hc(){return Bc}var Uc=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=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Fa,this.features={},this.valueSubscriptions=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=Zn.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,Gn.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=Mc(t),this.isVariantNode=Nc(t),this.isVariantNode&&(this.variantChildren=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&&Bo(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];this.current=e,Dc.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(Ic.current||Rc(),this.shouldReduceMotion=Fc.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),Kn(this.notifyUpdate),Kn(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&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??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&io.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new Ja({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:gn(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=ya.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&Gn.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in Bc){let t=Bc[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):Ec()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<zc.length;t++){let n=zc[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=Pc(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=vo(t===null?void 0:t,{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`&&(cn(n)||un(n))?n=parseFloat(n):typeof n!=`number`&&!Wr.test(n)&&Wr.test(t)&&(n=B(e,t)),this.setBaseTarget(e,Bo(n)?n.get():n)),Bo(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=No(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!Bo(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new hn),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){Bs.render(this.render)}},Wc=class extends Uc{constructor(){super(...arguments),this.KeyframeResolver=is}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;Bo(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},Gc=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function Kc(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 qc(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var Jc={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(z.test(e))e=parseFloat(e);else return e}return`${qc(e,t.target.x)}% ${qc(e,t.target.y)}%`}},Yc={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=Wr.parse(e);if(i.length>5)return r;let a=Wr.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=Jr(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},Xc={borderRadius:{...Jc,applyTo:[...as]},borderTopLeftRadius:Jc,borderTopRightRadius:Jc,borderBottomLeftRadius:Jc,borderBottomRightRadius:Jc,boxShadow:Yc};function Zc(e,{layout:t,layoutId:n}){return ya.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!Xc[e]||e===`opacity`)}function Qc(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(Bo(r[t])||i&&Bo(i[t])||Zc(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function $c(e){return window.getComputedStyle(e)}var el=class extends Wc{constructor(){super(...arguments),this.type=`html`,this.renderInstance=Kc}mount(e){e.style,super.mount(e)}readValueFromInstance(e,t){if(ya.has(t))return this.projection?.isProjecting?ma(t):ga(e,t);{let n=$c(e),r=(er(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return Rs(e,t)}build(e,t,n){ps(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Qc(e,t,n)}},tl=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`]),nl=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function rl(e,t,n,r){Kc(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(tl.has(n)?n:V(n),t.attrs[n])}function il(e,t,n){let r=Qc(e,t,n);for(let n in e)if(Bo(e[n])||Bo(t[n])){let t=va.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var al=class extends Wc{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=Ec}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(ya.has(t)){let e=ra(t);return e&&e.default||0}if(_s.includes(t)){let n=getComputedStyle(e)[t];if(typeof n==`string`&&n)return n.trim()}return t=tl.has(t)?t:V(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return il(e,t,n)}build(e,t,n){vs(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){rl(e,t,n,r)}mount(e){this.isSVGTag=nl(e.tagName),super.mount(e)}},ol=jc.length;function sl(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&sl(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<ol;n++){let r=jc[n],i=e.props[r];(kc(i)||i===!1)&&(t[r]=i)}return t}function cl(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 ll=[...Ac].reverse(),ul=Ac.length;function dl(e){return t=>Promise.all(t.map(({animation:t,options:n})=>Xo(e,t,n)))}function fl(e){let t=dl(e),n=hl(),r=!0,i=!1,a=t=>(n,r)=>{let i=Po(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function o(n){t=n(e)}function s(o){let{props:s}=e,c=sl(e.parent)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;t<ul;t++){let p=ll[t],m=n[p],h=s[p]===void 0?c[p]:s[p],g=kc(h),_=p===o?m.isActive:null;_===!1&&(f=t);let v=h===c[p]&&h!==s[p]&&g;if(v&&(r||i)&&e.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...d},!m.isActive&&_===null||!h&&!m.prevProp||Oc(h)||typeof h==`boolean`)continue;if(p===`exit`&&m.isActive&&_!==!0){m.prevResolvedValues&&(d={...d,...m.prevResolvedValues});continue}let y=pl(m.prevProp,h),b=y||p===o&&m.isActive&&!v&&g||t>f&&g,x=!1,S=Array.isArray(h)?h:[h],C=S.reduce(a(p),{});_===!1&&(C={});let{prevResolvedValues:w={}}=m,T={...w,...C},E=t=>{b=!0,u.has(t)&&(x=!0,u.delete(t)),m.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in T){let t=C[e],n=w[e];if(d.hasOwnProperty(e))continue;let r=!1;r=Io(t)&&Io(n)?!cl(t,n)||y:t!==n,r?t==null?u.add(e):E(e):t!==void 0&&u.has(e)?E(e):m.protectedKeys[e]=!0}m.prevProp=h,m.prevResolvedValues=C,m.isActive&&(d={...d,...C}),(r||i)&&e.blockInitialAnimation&&(b=!1);let D=v&&y;b&&(!D||x)&&l.push(...S.map(t=>{let n={type:p};if(typeof t==`string`&&(r||i)&&!D&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=Po(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=po(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=Po(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),l.push({animation:t})}let p=!!l.length;return r&&(s.initial===!1||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,i=!1,p?t(l):Promise.resolve()}function c(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=s(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:s,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=hl(),i=!0}}}function pl(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!cl(t,e):!1}function ml(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function hl(){return{animate:ml(!0),whileInView:ml(),whileHover:ml(),whileTap:ml(),whileDrag:ml(),whileFocus:ml(),exit:ml()}}function gl(e,t){e.min=t.min,e.max=t.max}function _l(e,t){gl(e.x,t.x),gl(e.y,t.y)}function vl(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var yl=.9999,bl=1.0001,xl=-.01,Sl=.01;function Cl(e){return e.max-e.min}function wl(e,t,n){return Math.abs(e-t)<=n}function Tl(e,t,n,r=.5){e.origin=r,e.originPoint=Jr(t.min,t.max,e.origin),e.scale=Cl(n)/Cl(t),e.translate=Jr(n.min,n.max,e.origin)-e.originPoint,(e.scale>=yl&&e.scale<=bl||isNaN(e.scale))&&(e.scale=1),(e.translate>=xl&&e.translate<=Sl||isNaN(e.translate))&&(e.translate=0)}function El(e,t,n,r){Tl(e.x,t.x,n.x,r?r.originX:void 0),Tl(e.y,t.y,n.y,r?r.originY:void 0)}function Dl(e,t,n,r=0){e.min=(r?Jr(n.min,n.max,r):n.min)+t.min,e.max=e.min+Cl(t)}function Ol(e,t,n,r){Dl(e.x,t.x,n.x,r?.x),Dl(e.y,t.y,n.y,r?.y)}function kl(e,t,n,r=0){let i=r?Jr(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+Cl(t)}function Al(e,t,n,r){kl(e.x,t.x,n.x,r?.x),kl(e.y,t.y,n.y,r?.y)}function jl(e,t,n,r,i){return e-=t,e=Ds(e,1/n,r),i!==void 0&&(e=Ds(e,1/i,r)),e}function Ml(e,t=0,n=1,r=.5,i,a=e,o=e){if(br.test(t)&&(t=parseFloat(t),t=Jr(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=Jr(a.min,a.max,r);e===a&&(s-=t),e.min=jl(e.min,t,n,s,i),e.max=jl(e.max,t,n,s,i)}function Nl(e,t,[n,r,i],a,o){Ml(e,t[n],t[r],t[i],t.scale,a,o)}var Pl=[`x`,`scaleX`,`originX`],Fl=[`y`,`scaleY`,`originY`];function Il(e,t,n,r){Nl(e.x,t,Pl,n?n.x:void 0,r?r.x:void 0),Nl(e.y,t,Fl,n?n.y:void 0,r?r.y:void 0)}function Ll(e){return e.translate===0&&e.scale===1}function Rl(e){return Ll(e.x)&&Ll(e.y)}function zl(e,t){return e.min===t.min&&e.max===t.max}function Bl(e,t){return zl(e.x,t.x)&&zl(e.y,t.y)}function Vl(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Hl(e,t){return Vl(e.x,t.x)&&Vl(e.y,t.y)}function Ul(e){return Cl(e.x)/Cl(e.y)}function Wl(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Gl(e){return[e(`x`),e(`y`)]}function Kl(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,rotate:t,pathRotation:i,rotateX:a,rotateY:o,skewX:s,skewY:c}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotate(${i}deg) `),a&&(r+=`rotateX(${a}deg) `),o&&(r+=`rotateY(${o}deg) `),s&&(r+=`skewX(${s}deg) `),c&&(r+=`skewY(${c}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`}var ql=as.length,Jl=e=>typeof e==`string`?parseFloat(e):e,Yl=e=>typeof e==`number`||z.test(e);function Xl(e,t,n,r,i,a){i?(e.opacity=Jr(0,n.opacity??1,Ql(r)),e.opacityExit=Jr(t.opacity??1,0,$l(r))):a&&(e.opacity=Jr(t.opacity??1,n.opacity??1,r));for(let i=0;i<ql;i++){let a=as[i],o=Zl(t,a),s=Zl(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||Yl(o)===Yl(s)?(e[a]=Math.max(Jr(Jl(o),Jl(s),r),0),(br.test(s)||br.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=Jr(t.rotate||0,n.rotate||0,r))}function Zl(e,t){return e[t]===void 0?e.borderRadius:e[t]}var Ql=eu(0,.5,jn),$l=eu(.5,.95,fn);function eu(e,t,n){return r=>r<e?0:r>t?1:n(mn(e,t,r))}function tu(e,t,n){let r=Bo(e)?e:vo(e);return r.start(Oo(``,r,t,n)),r.animation}function nu(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var ru=(e,t)=>e.depth-t.depth,iu=class{constructor(){this.children=[],this.isDirty=!1}add(e){rn(this.children,e),this.isDirty=!0}remove(e){an(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(ru),this.isDirty=!1,this.children.forEach(e)}};function au(e,t){let n=Zn.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(Kn(r),e(a-t))};return Gn.setup(r,!0),()=>Kn(r)}function ou(e){return Bo(e)?e.get():e}var su=class{constructor(){this.members=[]}add(e){rn(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&&(an(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(an(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)}},H={hasAnimatedSinceResize:!0,hasEverUpdated:!1},cu={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},lu=[``,`X`,`Y`,`Z`],uu=1e3,du=0;function fu(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function pu(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=Wo(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,Gn,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&pu(r)}function mu({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=du++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,xc.value&&(cu.nodes=cu.calculatedTargetDeltas=cu.calculatedProjections=0),this.nodes.forEach(_u),this.nodes.forEach(Eu),this.nodes.forEach(Du),this.nodes.forEach(vu),xc.addProjectionMetrics&&xc.addProjectionMetrics(cu)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=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 iu)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new hn),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=ss(t)&&!Sc(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&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;Gn.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=au(i,250),H.hasAnimatedSinceResize&&(H.hasAnimatedSinceResize=!1,this.nodes.forEach(Tu)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||Pu,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!Hl(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...bo(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||Tu(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Kn(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Ou),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&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&pu(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}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(xu),this.nodes.forEach(bu);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Su);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Cu),this.nodes.forEach(wu),this.nodes.forEach(hu),this.nodes.forEach(gu)):this.nodes.forEach(Su),this.clearAllSnapshots();let e=Zn.now();qn.delta=on(0,1e3/60,e-qn.timestamp),qn.timestamp=e,qn.isProcessing=!0,Jn.update.process(qn),Jn.preRender.process(qn),Jn.render.process(qn),qn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Bs.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(yu),this.sharedNodes.forEach(ku)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Gn.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Gn.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),this.snapshot&&!Cl(this.snapshot.measuredBox.x)&&!Cl(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.layoutVersion++,this.layoutCorrected||=Ec(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!Rl(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||ws(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)),Ru(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return Ec();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Bu))){let{scroll:e}=this.root;e&&(Ps(t.x,e.offset.x),Ps(t.y,e.offset.y))}return t}removeElementScroll(e){let t=Ec();if(_l(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&&_l(t,e),Ps(t.x,i.offset.x),Ps(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||Ec();_l(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(Ps(r.x,-n.scroll.offset.x),Ps(r.y,-n.scroll.offset.y)),ws(n.latestValues)&&Ls(r,n.latestValues,n.layout?.layoutBox)}return ws(this.latestValues)&&Ls(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=Ec();_l(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!ws(n.latestValues))continue;let r;n.instance&&(Cs(n.latestValues)&&n.updateSnapshot(),r=Ec(),_l(r,n.measurePageBox())),Il(t,n.latestValues,n.snapshot?.layoutBox,r)}return ws(this.latestValues)&&Il(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}}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!==qn.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=qn.timestamp;let a=this.getClosestProjectingParent();a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),!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=Ec(),this.targetWithTransforms=Ec()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Ol(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):_l(this.target,this.layout.layoutBox),As(this.target,this.targetDelta)):_l(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),xc.value&&cu.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||Cs(this.parent.latestValues)||Ts(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.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ec(),this.relativeTargetOrigin=Ec(),Al(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),_l(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===qn.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;_l(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;Ns(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=Ec());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(vl(this.prevProjectionDelta.x,this.projectionDelta.x),vl(this.prevProjectionDelta.y,this.projectionDelta.y)),El(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!Wl(this.projectionDelta.x,this.prevProjectionDelta.x)||!Wl(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),xc.value&&cu.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=wc(),this.projectionDelta=wc(),this.projectionDeltaWithTransform=wc()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=wc();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=Ec(),c=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,d=!(!c||u||this.options.crossfade!==!0||this.path.some(Nu));this.animationProgress=0;let f,p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n);r?(o.x.translate=r.x,o.x.scale=Jr(e.x.scale,1,n),o.x.origin=e.x.origin,o.x.originPoint=e.x.originPoint,o.y.translate=r.y,o.y.scale=Jr(e.y.scale,1,n),o.y.origin=e.y.origin,o.y.originPoint=e.y.originPoint):(Au(o.x,e.x,n),Au(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Al(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Mu(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&Bl(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=Ec(),_l(f,this.relativeTarget)),c&&(this.animationValues=a,Xl(a,i,this.latestValues,n,d,u)),r&&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&&=(Kn(this.pendingAnimation),void 0),this.pendingAnimation=Gn.update(()=>{H.hasAnimatedSinceResize=!0,this.motionValue||=vo(0),this.motionValue.jump(0,!1),this.currentAnimation=tu(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()}}),Gi(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&&this.mixTargetDelta(uu),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&&zu(this.options.animationType,this.layout.layoutBox,n.layoutBox)){i=this.target||Ec();let t=Cl(this.layout.layoutBox.x);i.x.min=e.target.x.min,i.x.max=i.x.min+t;let n=Cl(this.layout.layoutBox.y);i.y.min=e.target.y.min,i.y.max=i.y.min+n}_l(t,i),Ls(t,r),El(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new su),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&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}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&fu(`z`,e,r,this.animationValues);for(let t=0;t<lu.length;t++)fu(`rotate${lu[t]}`,e,r,this.animationValues),fu(`skew${lu[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=ou(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=ou(t?.pointerEvents)||``),this.hasProjected&&!ws(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=Kl(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=r.animationValues?r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in Xc){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=Xc[t],c=a===`none`?i[t]:n(i[t],r);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=r===this?ou(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(bu),this.root.sharedNodes.clear()}}}function hu(e){e.updateLayout()}function gu(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;if(i===`size`)Gl(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=Cl(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;gl(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else zu(i,t.layoutBox,n)&&Gl(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=Cl(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=wc();El(o,n,t.layoutBox);let s=wc();a?El(s,e.applyTransform(r,!0),t.measuredBox):El(s,n,t.layoutBox);let c=!Rl(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=Ec();Al(s,t.layoutBox,i.layoutBox,o);let c=Ec();Al(c,n,a.layoutBox,o),Hl(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function _u(e){xc.value&&cu.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 vu(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function yu(e){e.clearSnapshot()}function bu(e){e.clearMeasurements()}function xu(e){e.isLayoutDirty=!0,e.updateLayout()}function Su(e){e.isLayoutDirty=!1}function Cu(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function wu(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function Tu(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Eu(e){e.resolveTargetDelta()}function Du(e){e.calcProjection()}function Ou(e){e.resetSkewAndRotation()}function ku(e){e.removeLeadSnapshot()}function Au(e,t,n){e.translate=Jr(t.translate,0,n),e.scale=Jr(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function ju(e,t,n,r){e.min=Jr(t.min,n.min,r),e.max=Jr(t.max,n.max,r)}function Mu(e,t,n,r){ju(e.x,t.x,n.x,r),ju(e.y,t.y,n.y,r)}function Nu(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var Pu={duration:.45,ease:[.4,0,.1,1]},Fu=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Iu=Fu(`applewebkit/`)&&!Fu(`chrome/`)?Math.round:fn;function Lu(e){e.min=Iu(e.min),e.max=Iu(e.max)}function Ru(e){Lu(e.x),Lu(e.y)}function zu(e,t,n){return e===`position`||e===`preserve-aspect`&&!wl(Ul(t),Ul(n),.2)}function Bu(e){return e!==e.root&&e.scroll?.wasRoot}var Vu=mu({attachResizeListener:(e,t)=>nu(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Hu={current:void 0},Uu=mu({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Hu.current){let e=new Vu({});e.mount(window),e.setOptions({layoutScroll:!0}),Hu.current=e}return Hu.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),Wu=(0,v.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function Gu(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Ku(...e){return t=>{let n=!1,r=e.map(e=>{let r=Gu(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():Gu(e[t],null)}}}}function qu(...e){return v.useCallback(Ku(...e),e)}var Ju=class extends v.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(os(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=os(e)&&e.offsetWidth||0,r=os(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}return null}componentDidUpdate(){}render(){return this.props.children}};function Yu({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:a}){let o=(0,v.useId)(),s=(0,v.useRef)(null),c=(0,v.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:`ltr`}),{nonce:l}=(0,v.useContext)(Wu),u=qu(s,a===!1?void 0:e.props?.ref??e?.ref);return(0,v.useInsertionEffect)(()=>{let{width:e,height:u,top:d,left:f,right:p,bottom:m,direction:h}=c.current;if(t||a===!1||!s.current||!e||!u)return;let g=h===`rtl`,_=n===`left`?g?`right: ${p}`:`left: ${f}`:g?`left: ${f}`:`right: ${p}`,v=r===`bottom`?`bottom: ${m}`:`top: ${d}`;s.current.dataset.motionPopId=o;let y=document.createElement(`style`);l&&(y.nonce=l);let b=i??document.head;return b.appendChild(y),y.sheet&&y.sheet.insertRule(`
10
+ [data-motion-pop-id="${o}"] {
11
+ position: absolute !important;
12
+ width: ${e}px !important;
13
+ height: ${u}px !important;
14
+ ${_}px !important;
15
+ ${v}px !important;
16
+ }
17
+ `),()=>{s.current?.removeAttribute(`data-motion-pop-id`),b.contains(y)&&b.removeChild(y)}},[t]),(0,R.jsx)(Ju,{isPresent:t,childRef:s,sizeRef:c,pop:a,children:a===!1?e:v.cloneElement(e,{ref:u})})}var Xu=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:s,anchorY:c,root:l})=>{let u=en(Zu),d=(0,v.useId)(),f=(0,v.useRef)(n),p=(0,v.useRef)(r);tn(()=>{f.current=n,p.current=r});let m=!0,h=(0,v.useMemo)(()=>(m=!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=>(u.set(e,!1),()=>{u.delete(e),!f.current&&!u.size&&p.current?.()})}),[n,u,r]);return a&&m&&(h={...h}),(0,v.useMemo)(()=>{u.forEach((e,t)=>u.set(t,!1))},[n]),v.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=(0,R.jsx)(Yu,{pop:o===`popLayout`,isPresent:n,anchorX:s,anchorY:c,root:l,children:e}),(0,R.jsx)(nn.Provider,{value:h,children:e})};function Zu(){return new Map}function Qu(e=!0){let t=(0,v.useContext)(nn);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,v.useId)();(0,v.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,v.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var $u=e=>e.key||``;function ed(e){let t=[];return v.Children.forEach(e,e=>{(0,v.isValidElement)(e)&&t.push(e)}),t}var td=({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]=Qu(o),f=(0,v.useMemo)(()=>ed(e),[e]),p=o&&!u?[]:f.map($u),m=(0,v.useRef)(!0),h=(0,v.useRef)(f),g=en(()=>new Map),_=(0,v.useRef)(new Set),[y,b]=(0,v.useState)(f),[x,S]=(0,v.useState)(f);tn(()=>{o&&!u&&!x.length&&d?.()},[u,o,x.length,d]),tn(()=>{m.current=!1,h.current=f;for(let e=0;e<x.length;e++){let t=$u(x[e]);p.includes(t)?(g.delete(t),_.current.delete(t)):g.get(t)!==!0&&g.set(t,!1)}},[x,p.length,p.join(`-`)]);let C=[];if(f!==y){let e=[...f],t=0;for(let n of x){let r=p.indexOf($u(n));r===-1?(e.splice(t++,0,n),C.push(n)):t=r+C.length+1}return a===`wait`&&C.length&&(e=C),S(ed(e)),b(f),null}let{forceRender:w}=(0,v.useContext)($t);return(0,R.jsx)(R.Fragment,{children:x.map(e=>{let v=$u(e),y=o&&!u?!1:f===x||p.includes(v);return(0,R.jsx)(Xu,{isPresent:y,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:l,onExitComplete:y?void 0:()=>{if(_.current.has(v))return;if(g.has(v))_.current.add(v),g.set(v,!0);else return;let e=!0;g.forEach(t=>{t||(e=!1)}),e&&(w?.(),S(h.current),o&&d?.(),r&&r())},anchorX:s,anchorY:c,children:e},v)})})},nd=(0,v.createContext)({strict:!1}),U={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},rd=!1;function W(){if(rd)return;let e={};for(let t in U)e[t]={isEnabled:e=>U[t].some(t=>!!e[t])};Vc(e),rd=!0}function G(){return W(),Hc()}function id(e){let t=G();for(let n in e)t[n]={...t[n],...e[n]};Vc(t)}function ad({children:e,...t}){let n=(0,v.useContext)(Wu);t={...n,...t},t.transition=yo(t.transition,n.transition),t.isStatic=en(()=>t.isStatic);let r=(0,v.useMemo)(()=>t,[JSON.stringify(t.transition),t.transformPagePoint,t.reducedMotion,t.skipAnimations,t.isValidProp]);return(0,R.jsx)(Wu.Provider,{value:r,children:e})}var od=(0,v.createContext)({});function sd(e,t){if(Mc(e)){let{initial:t,animate:n}=e;return{initial:t===!1||kc(t)?t:void 0,animate:kc(n)?n:void 0}}return e.inherit===!1?{}:t}function cd(e){let{initial:t,animate:n}=sd(e,(0,v.useContext)(od));return(0,v.useMemo)(()=>({initial:t,animate:n}),[ld(t),ld(n)])}function ld(e){return Array.isArray(e)?e.join(` `):e}var ud=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function dd(e,t,n){for(let r in t)!Bo(t[r])&&!Zc(r,n)&&(e[r]=t[r])}function fd({transformTemplate:e},t){return(0,v.useMemo)(()=>{let n=ud();return ps(n,t,e),Object.assign({},n.vars,n.style)},[t])}function pd(e,t){let n=e.style||{},r={};return dd(r,n,e),Object.assign(r,fd(e,t)),r}function md(e,t){let n={},r=pd(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 hd=()=>({...ud(),attrs:{}});function gd(e,t,n,r){let i=(0,v.useMemo)(()=>{let n=hd();return vs(n,t,nl(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};dd(t,e.style,e),i.style={...t,...i.style}}return i}var _d=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function vd(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||_d.has(e)}function yd(e,t){return e.startsWith(`on`)?!vd(e):t?.(e)??!vd(e)}function bd(e,t,n,r){let i={};for(let a in e)(a!==`values`||typeof e.values!=`object`)&&(Bo(e[a])||(yd(a,r)||n===!0&&vd(a)||!t&&!vd(a)||e.draggable&&a.startsWith(`onDrag`))&&(i[a]=e[a]));return i}var xd=[`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 Sd(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(xd.indexOf(e)>-1||/[A-Z]/u.test(e))}function Cd(e,t,n,{latestValues:r},i,a=!1,o,s){let c=(o??Sd(e)?gd:md)(t,r,i,e),l=bd(t,typeof e==`string`,a,s),u=e===v.Fragment?{}:{...l,...c,ref:n},{children:d}=t,f=(0,v.useMemo)(()=>Bo(d)?d.get():d,[d]);return(0,v.createElement)(e,{...u,children:f})}function wd({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:Td(n,r,i,e),renderState:t()}}function Td(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=ou(a[e]);let{initial:o,animate:s}=e,c=Mc(e),l=Nc(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`&&!Oc(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=No(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 Ed=e=>(t,n)=>{let r=(0,v.useContext)(od),i=(0,v.useContext)(nn),a=()=>wd(e,t,r,i);return n?a():en(a)},Dd=Ed({scrapeMotionValuesFromProps:Qc,createRenderState:ud}),Od=Ed({scrapeMotionValuesFromProps:il,createRenderState:hd}),kd=Symbol.for(`motionComponentSymbol`);function Ad(e,t,n){let r=(0,v.useRef)(n);(0,v.useInsertionEffect)(()=>{r.current=n});let i=(0,v.useRef)(null);return(0,v.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 jd=(0,v.createContext)({});function Md(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function Nd(e,t,n,r,i,a){let{visualElement:o}=(0,v.useContext)(od),s=(0,v.useContext)(nd),c=(0,v.useContext)(nn),l=(0,v.useContext)(Wu),u=l.reducedMotion,d=l.skipAnimations,f=(0,v.useRef)(null),p=(0,v.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,v.useContext)(jd);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&Pd(f.current,n,i,h);let g=(0,v.useRef)(!1);(0,v.useInsertionEffect)(()=>{m&&g.current&&m.update(n,c)});let _=n[Uo],y=(0,v.useRef)(!!_&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(_)&&window.MotionHasOptimisedAnimation?.(_));return tn(()=>{p.current&&m&&(m.animationState?.animateChanges(),m.enteringChildren=void 0)},[]),tn(()=>{p.current=!0,m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),y.current&&m.animationState&&m.animationState.animateChanges())}),(0,v.useEffect)(()=>{m&&(!y.current&&m.animationState&&m.animationState.animateChanges(),y.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(_)}),!1),m.enteringChildren=void 0)}),m}function Pd(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:Fd(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&Md(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function Fd(e){if(e)return e.options.allowProjection===!1?Fd(e.parent):e.projection}function Id(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&id(r);let a=n?n===`svg`:Sd(e),o=a?Od:Dd;function s(n,s){let c,l={...(0,v.useContext)(Wu),...n,layoutId:Ld(n)},{isStatic:u,isValidProp:d}=l,f=cd(n),p=o(n,u);if(!u&&typeof window<`u`){Rd(l,r);let t=zd(l);c=t.MeasureLayout,f.visualElement=Nd(e,p,l,i,t.ProjectionNode,a)}return(0,R.jsxs)(od.Provider,{value:f,children:[c&&f.visualElement?(0,R.jsx)(c,{visualElement:f.visualElement,...l}):null,Cd(e,n,Ad(p,f.visualElement,s),p,u,t,a,d)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,v.forwardRef)(s);return c[kd]=e,c}function Ld({layoutId:e}){let t=(0,v.useContext)($t).id;return t&&e!==void 0?t+`-`+e:e}function Rd(e,t){(0,v.useContext)(nd).strict}function zd(e){let{drag:t,layout:n}=G();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function Bd(e,t){if(typeof Proxy>`u`)return Id;let n=new Map,r=(n,r)=>Id(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,Id(a,void 0,e,t)),n.get(a))})}var Vd=(e,t)=>t.isSVG??Sd(e)?new al(t):new el(t,{allowProjection:e!==v.Fragment}),Hd=class extends Gc{constructor(e){super(e),e.animationState||=fl(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();Oc(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},Ud=0,Wd={animation:{Feature:Hd},exit:{Feature:class extends Gc{constructor(){super(...arguments),this.id=Ud++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;if(e&&n===!1){if(this.isExitComplete){let{initial:e,custom:t}=this.node.getProps();if(typeof e==`string`||typeof e==`object`&&e&&!Array.isArray(e)){let n=Po(this.node,e,t);if(n){let{transition:e,transitionEnd:t,...r}=n;for(let e in r)this.node.getValue(e)?.jump(r[e])}}this.node.blockInitialAnimation=!1,this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive(`exit`,!1);this.isExitComplete=!1,this.exitAnimation=void 0;return}let r=this.exitAnimation=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{this.exitAnimation===r&&(this.isExitComplete=!0,t(this.id))})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function Gd(e){return{point:{x:e.pageX,y:e.pageY}}}var Kd=e=>t=>Ys(t)&&e(t,Gd(t));function qd(e,t,n,r){return nu(e,t,Kd(n),r)}var Jd=({current:e})=>e?e.ownerDocument.defaultView:null,Yd=(e,t)=>Math.abs(e-t);function Xd(e,t){let n=Yd(e.x,t.x),r=Yd(e.y,t.y);return Math.sqrt(n**2+r**2)}var Zd=new Set([`auto`,`scroll`]),Qd=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=new Map,this.removeScrollListeners=null,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=$d(this.lastRawMoveEventInfo,this.transformPagePoint));let e=tf(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=Xd(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e;this.history.push({...r,timestamp:Zn.now()});let{onStart:i,onMove:a}=this.handlers;t||(i&&i(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),a&&a(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=$d(t,this.transformPagePoint),this.hasPendingMove=!0,Gn.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&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=tf(e.type===`pointercancel`?this.lastMoveEventInfo:$d(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!Ys(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=$d(Gd(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=qn;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,tf(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=pn(qd(this.contextWindow,`pointermove`,this.handlePointerMove,d),qd(this.contextWindow,`pointerup`,this.handlePointerUp,d),qd(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(Zd.has(e.overflowX)||Zd.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},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),Gn.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Kn(this.updatePoint)}};function $d(e,t){return t?{point:t(e.point)}:e}function ef(e,t){return{x:e.x-t.x,y:e.y-t.y}}function tf({point:e},t){return{point:e,delta:ef(e,rf(t)),offset:ef(e,nf(t)),velocity:af(t,.1)}}function nf(e){return e[0]}function rf(e){return e[e.length-1]}function af(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=rf(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>gn(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>gn(t)*2&&(r=e[1]);let a=_n(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}function of(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Jr(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Jr(n,e,r.max):Math.min(e,n)),e}function sf(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 cf(e,{top:t,left:n,bottom:r,right:i}){return{x:sf(e.x,n,i),y:sf(e.y,t,r)}}function lf(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 uf(e,t){return{x:lf(e.x,t.x),y:lf(e.y,t.y)}}function df(e,t){let n=.5,r=Cl(e),i=Cl(t);return i>r?n=mn(t.min,t.max-r,e.min):r>i&&(n=mn(e.min,e.max-i,t.min)),on(0,1,n)}function ff(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 pf=.35;function mf(e=pf){return e===!1?e=0:e===!0&&(e=pf),{x:hf(e,`left`,`right`),y:hf(e,`top`,`bottom`)}}function hf(e,t,n){return{min:gf(e,t),max:gf(e,n)}}function gf(e,t){return typeof e==`number`?e:e[t]||0}var _f=new WeakMap,vf=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Ec(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(e),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Ws(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Gl(e=>{let t=this.getAxisMotionValue(e).get()||0;if(br.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=Cl(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&Gn.update(()=>i(e,t),!1,!0),Ho(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(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){this.currentDirection=Sf(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&Gn.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new Qd(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:Jd(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&Gn.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!xf(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=of(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&Md(e)?this.constraints||=this.resolveRefConstraints():this.constraints=e&&n?cf(n.layoutBox,e):!1,this.elastic=mf(t),r!==this.constraints&&!Md(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&Gl(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=ff(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!Md(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());let i=zs(n,r.root,this.visualElement.getTransformPagePoint()),a=uf(r.layout.layoutBox,i);if(t){let e=t(bs(a));this.hasMutatedConstraints=!!e,e&&(a=ys(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=Gl(o=>{if(!xf(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return Ho(this.visualElement,e),n.start(Oo(e,n,0,t,this.visualElement,!1))}stopAnimation(){Gl(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.visualElement.getProps()[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();Gl(e=>{if(!xf(e,n,this.currentDirection))return;let t=this.getAxisMotionValue(e),{min:r,max:o}=a[e];t.set((t.get()||0)+i[e]-Jr(r,o,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!Md(t)||!n||!this.constraints)return;this.stopAnimation();let r=this.constraints,i={x:0,y:0};Gl(e=>{let t=this.getAxisMotionValue(e).get();i[e]=df({min:t,max:t},r[e])});let{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),Gl(t=>{let n=this.getAxisMotionValue(t);if(!xf(t,e,null)||!n.get())return;let{min:r,max:a}=this.constraints[t];n.set(Jr(r,a,i[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;_f.set(this.visualElement,this);let e=this.visualElement.current,t=qd(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&$s(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();Md(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=bf(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Gn.read(r);let o=nu(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Gl(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=pf,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function yf(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function bf(e,t,n){let r=bc(e,yf(n)),i=bc(t,yf(n));return()=>{r(),i()}}function xf(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Sf(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var Cf=class extends Gc{constructor(e){super(e),this.removeGroupControls=fn,this.removeListeners=fn,this.controls=new vf(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||fn}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},wf=e=>(t,n)=>{e&&Gn.update(()=>e(t,n),!1,!0)},Tf=class extends Gc{constructor(){super(...arguments),this.removePointerDownListener=fn}onPointerDown(e){this.session=new Qd(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Jd(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:wf(e),onStart:wf(t),onMove:wf(n),onEnd:(e,t)=>{delete this.session,r&&Gn.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=qd(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},Ef=!1,Df=class extends v.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),Ef&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),H.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),Ef=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||Gn.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),Bs.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;Ef=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function Of(e){let[t,n]=Qu(),r=(0,v.useContext)($t);return(0,R.jsx)(Df,{...e,layoutGroup:r,switchLayoutGroup:(0,v.useContext)(jd),isPresent:t,safeToRemove:n})}var kf={pan:{Feature:Tf},drag:{Feature:Cf,ProjectionNode:Uu,MeasureLayout:Of}};function Af(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&Gn.postRender(()=>i(t,Gd(t)))}var jf=class extends Gc{mount(){let{current:e}=this.node;e&&(this.unmount=qs(e,(e,t)=>(Af(this.node,t,`Start`),e=>Af(this.node,e,`End`))))}unmount(){}},Mf=class extends Gc{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=pn(nu(this.node.current,`focus`,()=>this.onFocus()),nu(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function Nf(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&Gn.postRender(()=>i(t,Gd(t)))}var Pf=class extends Gc{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=oc(e,(e,t)=>(Nf(this.node,t,`Start`),(e,{success:t})=>Nf(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},Ff=new WeakMap,If=new WeakMap,Lf=e=>{let t=Ff.get(e.target);t&&t(e)},Rf=e=>{e.forEach(Lf)};function zf({root:e,...t}){let n=e||document;If.has(n)||If.set(n,{});let r=If.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Rf,{root:e,...t})),r[i]}function Bf(e,t,n){let r=zf(t);return Ff.set(e,n),r.observe(e),()=>{Ff.delete(e),r.unobserve(e)}}var Vf={some:0,all:1},Hf=class extends Gc{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:Vf[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=Bf(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(Uf(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function Uf({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var Wf={inView:{Feature:Hf},tap:{Feature:Pf},focus:{Feature:Mf},hover:{Feature:jf}},Gf={layout:{ProjectionNode:Uu,MeasureLayout:Of}},Kf=Bd({...Wd,...Wf,...kf,...Gf},Vd),qf=Object.defineProperty,K=(e,t)=>qf(e,`name`,{value:t,configurable:!0}),Jf=!!(typeof window<`u`&&window.document&&window.document.createElement);function q(e,t,{checkForDefaultPrevented:n=!0}={}){return K(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}K(q,`composeEventHandlers`);function Yf(e){if(!Jf)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}K(Yf,`getOwnerWindow`);function Xf(e){if(!Jf)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}K(Xf,`getOwnerDocument`);function Zf(e,t=!1){let{activeElement:n}=Xf(e);if(!n?.nodeName)return null;if(Qf(n)&&n.contentDocument)return Zf(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=Xf(n).getElementById(e);if(t)return t}}return n}K(Zf,`getActiveElement`);function Qf(e){return e.tagName===`IFRAME`}K(Qf,`isFrame`);var $f=Object.defineProperty,ep=(e,t)=>$f(e,`name`,{value:t,configurable:!0});function tp(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}ep(tp,`setRef`);function np(...e){return t=>{let n=!1,r=e.map(e=>{let r=tp(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():tp(e[t],null)}}}}ep(np,`composeRefs`);function rp(...e){return v.useCallback(np(...e),e)}ep(rp,`useComposedRefs`);var ip=Object.defineProperty,ap=(e,t)=>ip(e,`name`,{value:t,configurable:!0});function op(e,t){let n=v.createContext(t);n.displayName=e+`Context`;let r=ap(e=>{let{children:t,...r}=e,i=v.useMemo(()=>r,Object.values(r));return(0,R.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=v.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return ap(i,`useContext`),[r,i]}ap(op,`createContext`);function sp(e,t=[]){let n=[];function r(t,r){let i=v.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=ap(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=v.useMemo(()=>o,Object.values(o));return(0,R.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=v.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return ap(s,`useContext`),[o,s]}ap(r,`createContext`);let i=ap(()=>{let t=n.map(e=>v.createContext(e));return ap(function(n){let r=n?.[e]||t;return v.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,cp(i,...t)]}ap(sp,`createContextScope`);function cp(...e){let t=e[0];if(e.length===1)return t;let n=ap(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return ap(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}ap(cp,`composeContextScopes`);var lp=globalThis?.document?v.useLayoutEffect:()=>{},up=Object.defineProperty,dp=(e,t)=>up(e,`name`,{value:t,configurable:!0}),fp=v.useId||(()=>void 0),pp=0;function mp(e){let[t,n]=v.useState(fp());return lp(()=>{e||n(e=>e??String(pp++))},[e]),e||(t?`radix-${t}`:``)}dp(mp,`useId`);var hp=Object.defineProperty,gp=(e,t)=>hp(e,`name`,{value:t,configurable:!0}),_p=v.useEffectEvent,vp=v.useInsertionEffect;function yp(e){if(typeof _p==`function`)return _p(e);let t=v.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof vp==`function`?vp(()=>{t.current=e}):lp(()=>{t.current=e}),v.useMemo(()=>((...e)=>t.current?.(...e)),[])}gp(yp,`useEffectEvent`);var bp=Object.defineProperty,xp=(e,t)=>bp(e,`name`,{value:t,configurable:!0}),Sp=v.useInsertionEffect||lp;function Cp({prop:e,defaultProp:t,onChange:n=xp(()=>{},`onChange`),caller:r}){let[i,a,o]=wp({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,v.useCallback(t=>{if(s){let n=Tp(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}xp(Cp,`useControllableState`);function wp({defaultProp:e,onChange:t}){let[n,r]=v.useState(e),i=v.useRef(n),a=v.useRef(t);return Sp(()=>{a.current=t},[t]),v.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}xp(wp,`useUncontrolledState`);function Tp(e){return typeof e==`function`}xp(Tp,`isFunction`);var Ep=Symbol(`RADIX:SYNC_STATE`);function Dp(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=yp(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=v.useReducer((t,n)=>{if(n.type===Ep)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=v.useRef(p);v.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=v.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return v.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:Ep,state:i})},[i,d.state,c]),[h,f]}xp(Dp,`useControllableStateReducer`);var Op=l(h(),1),kp=Object.defineProperty,Ap=(e,t)=>kp(e,`name`,{value:t,configurable:!0});function jp(e){let t=v.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];zp(r)&&typeof Up==`function`&&(r=Up(r._payload)),v.Children.forEach(r,e=>{if(Lp(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;zp(n)&&typeof Up==`function`&&(n=Up(n._payload)),a=Pp(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=v.cloneElement(a,void 0,s):!o&&v.Children.count(r)===1&&v.isValidElement(r)&&(a=r);let c=a?Ip(a):void 0,l=rp(n,c);if(!a){if(r||r===0)throw Error(o?Hp(e):Vp(e));return r}let u=Fp(i,a.props??{});return a.type!==v.Fragment&&(u.ref=n?l:c),v.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}Ap(jp,`createSlot`);var Mp=Symbol.for(`radix.slottable`);function Np(e){let t=Ap(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=Mp,t}Ap(Np,`createSlottable`);var Pp=Ap((e,t)=>{if(`child`in e.props){let t=e.props.child;return v.isValidElement(t)?v.cloneElement(t,void 0,e.props.children(t.props.children)):null}return v.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function Fp(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}Ap(Fp,`mergeProps`);function Ip(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Ap(Ip,`getElementRef`);function Lp(e){return v.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Mp}Ap(Lp,`isSlottable`);var Rp=Symbol.for(`react.lazy`);function zp(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Rp&&`_payload`in e&&Bp(e._payload)}Ap(zp,`isLazyComponent`);function Bp(e){return typeof e==`object`&&!!e&&`then`in e}Ap(Bp,`isPromiseLike`);var Vp=Ap(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),Hp=Ap(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Up=v.use,Wp=Object.defineProperty,Gp=(e,t)=>Wp(e,`name`,{value:t,configurable:!0}),Kp=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=jp(`Primitive.${t}`),r=v.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,R.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function qp(e,t){e&&Op.flushSync(()=>e.dispatchEvent(t))}Gp(qp,`dispatchDiscreteCustomEvent`);var Jp=Object.defineProperty,Yp=(e,t)=>Jp(e,`name`,{value:t,configurable:!0});function Xp(e){let t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>((...e)=>t.current?.(...e)),[])}Yp(Xp,`useCallbackRef`);var Zp=Object.defineProperty,Qp=(e,t)=>Zp(e,`name`,{value:t,configurable:!0}),$p=`dismissableLayer.update`,em=`dismissableLayer.pointerDownOutside`,tm=`dismissableLayer.focusOutside`,nm,rm=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),im=v.forwardRef(Qp(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=v.useContext(rm),[d,f]=v.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=v.useState({}),h=rp(t,f),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=_?g.indexOf(_):-1,b=d?g.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=v.useRef(!1),w=sm(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:v.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return S&&!t},[u.branches,S])}),T=cm(e=>{if(r&&C.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),E=d?b===g.length-1:!1,D=Xp(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return v.useEffect(()=>{if(E)return p.addEventListener(`keydown`,D,{capture:!0}),()=>p.removeEventListener(`keydown`,D,{capture:!0})},[p,E,D]),v.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(nm=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),lm(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=nm))}},[d,p,n,u]),v.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),lm())},[d,u]),v.useEffect(()=>{let e=Qp(()=>m({}),`handleUpdate`);return document.addEventListener($p,e),()=>document.removeEventListener($p,e)},[]),(0,R.jsx)(Kp.div,{...l,ref:h,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:q(e.onFocusCapture,T.onFocusCapture),onBlurCapture:q(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:q(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function am(){let e=v.useContext(rm),[t,n]=v.useState(null);return v.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Qp(am,`useDismissableLayerSurface`);var om=Qp(()=>!0,`IS_TRUE`);function sm(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=om}=t,s=Xp(e),c=v.useRef(!1),l=v.useRef(!1),u=v.useRef(new Map),d=v.useRef(()=>{});return v.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}Qp(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}Qp(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}Qp(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}Qp(p,`handleInteractionBubble`);let m=Qp(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||um(em,s,p,{discrete:!0})};if(Qp(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:Qp(()=>c.current=!0,`onPointerDownCapture`)}}Qp(sm,`usePointerDownOutside`);function cm(e,t=globalThis?.document){let n=Xp(e),r=v.useRef(!1);return v.useEffect(()=>{let e=Qp(e=>{e.target&&!r.current&&um(tm,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:Qp(()=>r.current=!0,`onFocusCapture`),onBlurCapture:Qp(()=>r.current=!1,`onBlurCapture`)}}Qp(cm,`useFocusOutside`);function lm(){let e=new CustomEvent($p);document.dispatchEvent(e)}Qp(lm,`dispatchUpdate`);function um(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?qp(i,a):i.dispatchEvent(a)}Qp(um,`handleAndDispatchCustomEvent`);var dm=Object.defineProperty,fm=(e,t)=>dm(e,`name`,{value:t,configurable:!0}),pm=`focusScope.autoFocusOnMount`,mm=`focusScope.autoFocusOnUnmount`,hm={bubbles:!1,cancelable:!0},gm=v.forwardRef(fm(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=v.useState(null),l=Xp(i),u=Xp(a),d=v.useRef(null),f=rp(t,c),p=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:Cm(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||Cm(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Cm(s)};fm(e,`handleFocusIn`),fm(t,`handleFocusOut`),fm(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),v.useEffect(()=>{if(s){wm.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(pm,hm);s.addEventListener(pm,l),s.dispatchEvent(t),t.defaultPrevented||(_m(Dm(ym(s)),{select:!0}),document.activeElement===e&&Cm(s))}return()=>{s.removeEventListener(pm,l),setTimeout(()=>{let t=new CustomEvent(mm,hm);s.addEventListener(mm,u),s.dispatchEvent(t),t.defaultPrevented||Cm(e??document.body,{select:!0}),s.removeEventListener(mm,u),wm.remove(p)},0)}}},[s,l,u,p]);let m=v.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=vm(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Cm(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Cm(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,R.jsx)(Kp.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})},`FocusScope`));function _m(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Cm(r,{select:t}),document.activeElement!==n)return}fm(_m,`focusFirst`);function vm(e){let t=ym(e);return[bm(t,e),bm(t.reverse(),e)]}fm(vm,`getTabbableEdges`);function ym(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:fm(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}fm(ym,`getTabbableCandidates`);function bm(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):xm(r,{upTo:t})))return r}fm(bm,`findVisible`);function xm(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}fm(xm,`isHidden`);function Sm(e){return e instanceof HTMLInputElement&&`select`in e}fm(Sm,`isSelectableInput`);function Cm(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Sm(e)&&t&&e.select()}}fm(Cm,`focus`);var wm=Tm();function Tm(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Em(e,t),e.unshift(t)},remove(t){e=Em(e,t),e[0]?.resume()}}}fm(Tm,`createFocusScopesStack`);function Em(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}fm(Em,`arrayRemove`);function Dm(e){return e.filter(e=>e.tagName!==`A`)}fm(Dm,`removeLinks`);var Om=Object.defineProperty,km=v.forwardRef(((e,t)=>Om(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=v.useState(!1);lp(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Op.createPortal((0,R.jsx)(Kp.div,{...r,ref:t}),o):null},`Portal`)),Am=Object.defineProperty,jm=(e,t)=>Am(e,`name`,{value:t,configurable:!0});function Mm(e,t){return v.useReducer((e,n)=>t[e][n]??e,e)}jm(Mm,`useStateMachine`);var Nm=jm(e=>{let{present:t,children:n}=e,r=Pm(t),i=typeof n==`function`?n({present:r.isPresent}):v.Children.only(n),a=Im(r.ref,Rm(i));return typeof n==`function`||r.isPresent?v.cloneElement(i,{ref:a}):null},`Presence`);function Pm(e){let[t,n]=v.useState(),r=v.useRef(null),i=v.useRef(e),a=v.useRef(`none`),o=v.useRef(void 0),[s,c]=Mm(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return v.useEffect(()=>{s===`mounted`?(a.current=o.current??Lm(r.current),o.current=void 0):a.current=`none`},[s]),lp(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Lm(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),lp(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=jm(a=>{let o=Lm(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=jm(e=>{e.target===t&&(a.current=Lm(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:v.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=Lm(t)}else r.current=null;n(e)},[])}}jm(Pm,`usePresence`);function Fm(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}jm(Fm,`setRef`);function Im(...e){let t=v.useRef(e);return t.current=e,v.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Fm(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Fm(n[e],null)}}},[])}jm(Im,`useStableComposedRefs`);function Lm(e){return e?.animationName||`none`}jm(Lm,`getAnimationName`);function Rm(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}jm(Rm,`getElementRef`);var zm=Object.defineProperty,Bm=(e,t)=>zm(e,`name`,{value:t,configurable:!0}),Vm=0,Hm=null;function Um(e){return Wm(),e.children}Bm(Um,`FocusGuards`);function Wm(){v.useEffect(()=>{Hm||={start:Gm(),end:Gm()};let{start:e,end:t}=Hm;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Vm++,()=>{Vm===1&&(Hm?.start.remove(),Hm?.end.remove(),Hm=null),Vm=Math.max(0,Vm-1)}},[])}Bm(Wm,`useFocusGuards`);function Gm(){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}Bm(Gm,`createFocusGuard`);var Km=function(){return Km=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},Km.apply(this,arguments)};function qm(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 Jm(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 Ym=`right-scroll-bar-position`,Xm=`width-before-scroll-bar`,Zm=`with-scroll-bars-hidden`,Qm=`--removed-body-scroll-bar-size`;function $m(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function eh(e,t){var n=(0,v.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 th=typeof window<`u`?v.useLayoutEffect:v.useEffect,nh=new WeakMap;function rh(e,t){var n=eh(t||null,function(t){return e.forEach(function(e){return $m(e,t)})});return th(function(){var t=nh.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||$m(e,null)}),i.forEach(function(e){r.has(e)||$m(e,a)})}nh.set(n,e)},[e]),n}function ih(e){return e}function ah(e,t){t===void 0&&(t=ih);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 oh(e){e===void 0&&(e={});var t=ah(null);return t.options=Km({async:!0,ssr:!1},e),t}var sh=function(e){var t=e.sideCar,n=qm(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 v.createElement(r,Km({},n))};sh.isSideCarExport=!0;function ch(e,t){return e.useMedium(t),sh}var lh=oh(),uh=function(){},dh=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:uh,onWheelCapture:uh,onTouchMoveCapture:uh}),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,y=_===void 0?`div`:_,b=e.gapMode,x=qm(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=rh([n,t]),w=Km(Km({},x),i);return v.createElement(v.Fragment,null,u&&v.createElement(S,{sideCar:lh,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:b}),o?v.cloneElement(v.Children.only(s),Km(Km({},w),{ref:C})):v.createElement(y,Km({},w,{className:c,ref:C}),s))});dh.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},dh.classNames={fullWidth:Xm,zeroRight:Ym};var fh=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function ph(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=fh();return t&&e.setAttribute(`nonce`,t),e}function mh(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function hh(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var gh=function(){var e=0,t=null;return{add:function(n){e==0&&(t=ph())&&(mh(t,n),hh(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},_h=function(){var e=gh();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},vh=function(){var e=_h();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},yh={left:0,top:0,right:0,gap:0},bh=function(e){return parseInt(e||``,10)||0},xh=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[bh(n),bh(r),bh(i)]},Sh=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return yh;var t=xh(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])}},Ch=vh(),wh=`data-scroll-locked`,Th=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
18
+ .${Zm} {
19
+ overflow: hidden ${r};
20
+ padding-right: ${s}px ${r};
21
+ }
22
+ body[${wh}] {
23
+ overflow: hidden ${r};
24
+ overscroll-behavior: contain;
25
+ ${[t&&`position: relative ${r};`,n===`margin`&&`
26
+ padding-left: ${i}px;
27
+ padding-top: ${a}px;
28
+ padding-right: ${o}px;
29
+ margin-left:0;
30
+ margin-top:0;
31
+ margin-right: ${s}px ${r};
32
+ `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
33
+ }
34
+
35
+ .${Ym} {
36
+ right: ${s}px ${r};
37
+ }
38
+
39
+ .${Xm} {
40
+ margin-right: ${s}px ${r};
41
+ }
42
+
43
+ .${Ym} .${Ym} {
44
+ right: 0 ${r};
45
+ }
46
+
47
+ .${Xm} .${Xm} {
48
+ margin-right: 0 ${r};
49
+ }
50
+
51
+ body[${wh}] {
52
+ ${Qm}: ${s}px;
53
+ }
54
+ `},Eh=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Dh=function(){v.useEffect(function(){return document.body.setAttribute(wh,(Eh()+1).toString()),function(){var e=Eh()-1;e<=0?document.body.removeAttribute(wh):document.body.setAttribute(wh,e.toString())}},[])},Oh=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Dh();var a=v.useMemo(function(){return Sh(i)},[i]);return v.createElement(Ch,{styles:Th(a,!t,i,n?``:`!important`)})},kh=!1;if(typeof window<`u`)try{var Ah=Object.defineProperty({},"passive",{get:function(){return kh=!0,!0}});window.addEventListener(`test`,Ah,Ah),window.removeEventListener(`test`,Ah,Ah)}catch{kh=!1}var jh=kh?{passive:!1}:!1,Mh=function(e){return e.tagName===`TEXTAREA`},Nh=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Mh(e)&&n[t]===`visible`)},Ph=function(e){return Nh(e,`overflowY`)},Fh=function(e){return Nh(e,`overflowX`)},Ih=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),zh(e,r)){var i=Bh(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Lh=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Rh=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},zh=function(e,t){return e===`v`?Ph(t):Fh(t)},Bh=function(e,t){return e===`v`?Lh(t):Rh(t)},Vh=function(e,t){return e===`h`&&t===`rtl`?-1:1},Hh=function(e,t,n,r,i){var a=Vh(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=Bh(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&zh(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},Uh=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Wh=function(e){return[e.deltaX,e.deltaY]},Gh=function(e){return e&&`current`in e?e.current:e},Kh=function(e,t){return e[0]===t[0]&&e[1]===t[1]},qh=function(e){return`
55
+ .block-interactivity-${e} {pointer-events: none;}
56
+ .allow-interactivity-${e} {pointer-events: all;}
57
+ `},Jh=0,Yh=[];function Xh(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),i=v.useState(Jh++)[0],a=v.useState(vh)[0],o=v.useRef(e);v.useEffect(function(){o.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Jm([e.lockRef.current],(e.shards||[]).map(Gh),!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=v.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Uh(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=Ih(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Ih(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 Hh(h,t,e,h===`h`?s:c,!0)},[]),c=v.useCallback(function(e){var n=e;if(Yh.length&&Yh[Yh.length-1]===a){var r=`deltaY`in n?Wh(n):Uh(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Kh(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Gh).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=v.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Zh(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=v.useCallback(function(e){n.current=Uh(e),r.current=void 0},[]),d=v.useCallback(function(t){l(t.type,Wh(t),t.target,s(t,e.lockRef.current))},[]),f=v.useCallback(function(t){l(t.type,Uh(t),t.target,s(t,e.lockRef.current))},[]);v.useEffect(function(){return Yh.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,jh),document.addEventListener(`touchmove`,c,jh),document.addEventListener(`touchstart`,u,jh),function(){Yh=Yh.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,jh),document.removeEventListener(`touchmove`,c,jh),document.removeEventListener(`touchstart`,u,jh)}},[]);var p=e.removeScrollBar,m=e.inert;return v.createElement(v.Fragment,null,m?v.createElement(a,{styles:qh(i)}):null,p?v.createElement(Oh,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Zh(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Qh=ch(lh,Xh),$h=v.forwardRef(function(e,t){return v.createElement(dh,Km({},e,{ref:t,sideCar:Qh}))});$h.classNames=dh.classNames;var eg=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},tg=new WeakMap,ng=new WeakMap,rg={},ig=0,ag=function(e){return e&&(e.host||ag(e.parentNode))},og=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=ag(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})},sg=function(e,t,n,r){var i=og(t,Array.isArray(e)?e:[e]);rg[n]||(rg[n]=new WeakMap);var a=rg[n],o=[],s=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=(tg.get(e)||0)+1,l=(a.get(e)||0)+1;tg.set(e,c),a.set(e,l),o.push(e),c===1&&i&&ng.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(),ig++,function(){o.forEach(function(e){var t=tg.get(e)-1,i=a.get(e)-1;tg.set(e,t),a.set(e,i),t||(ng.has(e)||e.removeAttribute(r),ng.delete(e)),i||e.removeAttribute(n)}),ig--,ig||(tg=new WeakMap,tg=new WeakMap,ng=new WeakMap,rg={})}},cg=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||eg(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),sg(r,i,n,`aria-hidden`)):function(){return null}},lg=Object.defineProperty,ug=(e,t)=>lg(e,`name`,{value:t,configurable:!0}),dg=`Dialog`,[fg,pg]=sp(dg),[mg,hg]=fg(dg),gg=ug(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=v.useRef(null),c=v.useRef(null),[l,u]=Cp({prop:r,defaultProp:i??!1,onChange:a,caller:dg}),[d,f]=v.useState(0),[p,m]=v.useState(0);return(0,R.jsx)(mg,{scope:t,triggerRef:s,contentRef:c,contentId:mp(),titleId:mp(),descriptionId:mp(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,open:l,onOpenChange:u,onOpenToggle:v.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),_g=`DialogPortal`,[vg,yg]=fg(_g,{forceMount:void 0}),bg=ug(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=hg(_g,t);return(0,R.jsx)(vg,{scope:t,forceMount:n,children:v.Children.map(r,e=>(0,R.jsx)(Nm,{present:n||a.open,children:(0,R.jsx)(km,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),xg=`DialogOverlay`,Sg=v.forwardRef(ug(function(e,t){let n=yg(xg,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=hg(xg,e.__scopeDialog);return a.modal?(0,R.jsx)(Nm,{present:r||a.open,children:(0,R.jsx)(wg,{...i,ref:t})}):null},`DialogOverlay`)),Cg=jp(`DialogOverlay.RemoveScroll`),wg=v.forwardRef(ug(function(e,t){let{__scopeDialog:n,...r}=e,i=hg(xg,n),a=rp(t,am());return(0,R.jsx)($h,{as:Cg,allowPinchZoom:!0,shards:[i.contentRef],children:(0,R.jsx)(Kp.div,{"data-state":Pg(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),Tg=`DialogContent`,Eg=v.forwardRef(ug(function(e,t){let n=yg(Tg,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=hg(Tg,e.__scopeDialog);return(0,R.jsx)(Nm,{present:r||a.open,children:a.modal?(0,R.jsx)(Dg,{...i,ref:t}):(0,R.jsx)(Og,{...i,ref:t})})},`DialogContent`)),Dg=v.forwardRef(ug(function(e,t){let n=hg(Tg,e.__scopeDialog),r=v.useRef(null),i=rp(t,n.contentRef,r);return v.useEffect(()=>{let e=r.current;if(e)return cg(e)},[]),(0,R.jsx)(kg,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:q(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:q(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:q(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),Og=v.forwardRef(ug(function(e,t){let n=hg(Tg,e.__scopeDialog),r=v.useRef(!1),i=v.useRef(!1);return(0,R.jsx)(kg,{...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`)),kg=v.forwardRef(ug(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=hg(Tg,n);return Wm(),(0,R.jsx)(R.Fragment,{children:(0,R.jsx)(gm,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,R.jsx)(im,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":Pg(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),Ag=`DialogTitle`,jg=v.forwardRef(ug(function(e,t){let{__scopeDialog:n,...r}=e,i=hg(Ag,n),{setTitleCount:a}=i;return lp(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,R.jsx)(Kp.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),Mg=`DialogClose`,Ng=v.forwardRef(ug(function(e,t){let{__scopeDialog:n,...r}=e,i=hg(Mg,n);return(0,R.jsx)(Kp.button,{type:`button`,...r,ref:t,onClick:q(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function Pg(e){return e?`open`:`closed`}ug(Pg,`getState`);var Fg=window.__DESIGN_STATIC__===!0,Ig=class extends Error{status;constructor(e,t){super(t),this.status=e}};async function Lg(e,t){let n=await fetch(e,{cache:t});if(!n.ok){let e=`${n.status} ${n.statusText}`;try{let t=await n.json();t.error&&(e=t.error)}catch{}throw new Ig(n.status,e)}return await n.json()}async function Rg(e){try{return await e}catch(e){if(e instanceof Ig&&e.status===404)return null;throw e}}var zg=``;function Bg(e){return zg!==e.version&&(zg=e.version,console.info(`foss-design ${e.version}${Fg?` (static build)`:``}`)),e}var Vg={live:!0,project:()=>Lg(`/api/project`,`no-store`).then(Bg),canvas:async e=>({doc:await Lg(`/api/canvas/${encodeURIComponent(e)}`,`no-store`),base:``}),system:async()=>{let e=await Rg(Lg(`/api/system`,`no-store`));return e?{doc:e,base:``}:null},async source(e){let t=await fetch(`/api/source?path=${encodeURIComponent(e)}`,{cache:`no-store`});if(!t.ok)throw new Ig(t.status,`Could not read ${e}`);return t.text()},drawings:e=>`${window.location.protocol===`https:`?`wss`:`ws`}://${window.location.host}/api/drawings/${encodeURIComponent(e)}`,async setIcon(e){let t=await fetch(`/api/icon`,{method:e?`PUT`:`DELETE`,headers:e?{"content-type":e.type||`application/octet-stream`}:void 0,body:e});if(!t.ok){let e=await t.json().catch(()=>({}));throw new Ig(t.status,e.error??`${t.status} ${t.statusText}`)}}},Hg=null,Ug={live:!1,project:()=>Lg(`api/project.json`,`default`).then(Bg),canvas:async e=>({doc:await Lg(`api/canvas/${encodeURIComponent(e)}.json`,`default`),base:``}),system:async()=>{let e=await Rg(Lg(`api/system.json`,`default`));return e?{doc:e,base:``}:null},async source(e){Hg??=Lg(`api/sources.json`,`default`).catch(()=>({}));let t=(await Hg)[e];if(t===void 0)throw new Ig(404,`${e} is not in this build`);return t}};function Wg(e,t){try{let n=typeof document>`u`?`http://localhost/`:document.baseURI;if(!t){let t=new URL(e,n);return t.protocol===`http:`||t.protocol===`https:`?e:``}let r=new URL(t.endsWith(`/`)?t:`${t}/`,n),i=new URL(e,r);return i.origin===r.origin&&i.href.startsWith(r.href)?i.href:``}catch{return``}}function Gg(e){try{let t=new URL(e);return t.protocol===`http:`||t.protocol===`https:`?t.href:``}catch{return``}}function Kg(e,t){let n=e=>Wg(e,t);return{...e,pages:e.pages.map(e=>({...e,sections:e.sections.map(e=>({...e,items:e.items.map(e=>{if(e.kind===`screen`){let t=e=>e?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,t&&n(t)]).filter(([,e])=>e)):void 0,r=n(e.url);return{...e,url:r,missing:e.missing||!r,snapshots:t(e.snapshots),thumbs:t(e.thumbs)}}return e.kind===`image`?{...e,url:n(e.url)}:e.kind===`url`?{...e,url:Gg(e.url)}:e})}))}))}}function qg(e,t){let n=e=>Wg(e,t);return{...e,components:e.components.map(e=>({...e,url:n(e.url)})),assets:e.assets.map(e=>({...e,url:n(e.url)})),typographyUrl:e.typographyUrl&&n(e.typographyUrl)}}function Jg(e){return{all:[`design`,e],project:[`design`,e,`project`],canvas:t=>[`design`,e,`canvas`,t],system:[`design`,e,`system`],sources:[`design`,e,`source`],source:(t,n)=>[`design`,e,`source`,t,n]}}var Yg=`clipboard-read; clipboard-write; fullscreen`,Xg=new WeakMap,Zg=0;function Qg(e){let t=Xg.get(e);return t||(Zg+=1,t=String(Zg),Xg.set(e,t)),t}var $g=(0,v.createContext)(null);function e_(){let e=(0,v.useContext)($g);if(!e)throw Error(`foss-design: this component renders inside <DesignViewer>`);return e}function t_(e,t){if(e===t)return!0;try{return decodeURIComponent(e)===t}catch{return!1}}function n_(e){return new zt({defaultOptions:{queries:{staleTime:e?0:1/0,retry:1,refetchOnWindowFocus:!1}}})}function r_(){let{source:e,keys:t,scope:n}=e_();return Qt({queryKey:t.project,queryFn:()=>e.project(),enabled:!n})}function i_(e,t=!0){let{source:n,keys:r}=e_();return Qt({queryKey:r.canvas(e),queryFn:async()=>{let{doc:t,base:r}=await n.canvas(e);return Kg(t,r)},placeholderData:e=>e,enabled:t})}function a_(e=!0){let{source:t,keys:n}=e_();return Qt({queryKey:n.system,queryFn:async()=>{let e=await t.system();return e?qg(e.doc,e.base):null},enabled:e})}function o_(e,t=`system`){let{source:n,keys:r}=e_();return Qt({queryKey:r.source(t,e??``),queryFn:()=>n.source(e,t),enabled:!!e})}function s_(e,t){let n=null,r=!1;return n=new EventSource(`/api/events`),n.onopen=()=>{r&&(r=!1,e.invalidateQueries({queryKey:t.all}))},n.onerror=()=>{r=!0},n.onmessage=n=>{let r;try{r=JSON.parse(n.data)}catch{return}if(r.type===`project`)e.invalidateQueries({queryKey:t.project});else if(r.type===`system`)e.invalidateQueries({queryKey:t.system}),e.invalidateQueries({queryKey:t.sources});else if(r.type===`canvas`||r.type===`snapshot`){let n=r.type===`canvas`?r.id:r.canvas;e.invalidateQueries({queryKey:t.canvas(n)}),r.type===`snapshot`&&e.invalidateQueries({queryKey:t.project})}},()=>n?.close()}function J(...e){return e.filter(Boolean).join(` `)}var c_=null;function l_(e,t){c_={canvas:e,item:t},window.dispatchEvent(new CustomEvent(`design:focus`,{detail:c_}))}function u_(e){if(!c_||c_.canvas!==e)return null;let t=c_.item;return c_=null,t}var d_=class{value;listeners=new Set;constructor(e){this.value=e}get=()=>this.value;set=e=>{let t=typeof e==`function`?e(this.value):e;if(!Object.is(t,this.value)){this.value=t;for(let e of this.listeners)e()}};subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)})};function Y(e,t=e=>e){return(0,v.useSyncExternalStore)(e.subscribe,()=>t(e.get()),()=>t(e.get()))}var f_=`foss-design.theme`;function p_(){try{let e=localStorage.getItem(f_);if(e===`light`||e===`dark`||e===`system`)return e}catch{}return`system`}var m_=new d_(p_()),h_=window.matchMedia(`(prefers-color-scheme: dark)`);function g_(e){return e===`system`?h_.matches?`dark`:`light`:e}function __(){document.documentElement.dataset.theme=g_(m_.get())}h_.addEventListener(`change`,__),m_.subscribe(__),__();function v_(e){try{localStorage.setItem(f_,e)}catch{}m_.set(e)}function y_(){return Y(m_)}function b_(){let e=Y(m_),t=(0,v.useSyncExternalStore)(e=>(h_.addEventListener(`change`,e),()=>h_.removeEventListener(`change`,e)),()=>h_.matches);return e===`system`?t?`dark`:`light`:e}var x_={plus:`<path d="M5 12h14"/><path d="M12 5v14"/>`,check:`<path d="M20 6 9 17l-5-5"/>`,x:`<path d="M18 6 6 18"/><path d="m6 6 12 12"/>`,"chevron-down":`<path d="m6 9 6 6 6-6"/>`,"chevron-up":`<path d="m18 15-6-6-6 6"/>`,"chevron-right":`<path d="m9 18 6-6-6-6"/>`,"arrow-right":`<path d="M5 12h14"/><path d="m12 5 7 7-7 7"/>`,chevrons:`<path d="m7 15 5 5 5-5"/><path d="m7 9 5-5 5 5"/>`,copy:`<rect width="14" height="14" x="8" y="8" rx="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/>`,search:`<circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/>`,bell:`<path d="M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9"/><path d="M10.3 21a1.94 1.94 0 0 0 3.4 0"/>`,refresh:`<path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"/><path d="M21 3v5h-5"/><path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"/><path d="M8 16H3v5"/>`,"up-right":`<path d="M7 7h10v10"/><path d="M7 17 17 7"/>`,"down-left":`<path d="M17 7 7 17"/><path d="M17 17H7V7"/>`,external:`<path d="M15 3h6v6"/><path d="M10 14 21 3"/><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/>`,"user-plus":`<path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M19 8v6"/><path d="M22 11h-6"/>`,user:`<circle cx="12" cy="8" r="5"/><path d="M20 21a8 8 0 0 0-16 0"/>`,trash:`<path d="M3 6h18"/><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/>`,more:`<circle cx="12" cy="12" r="1"/><circle cx="19" cy="12" r="1"/><circle cx="5" cy="12" r="1"/>`,alert:`<path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"/><path d="M12 9v4"/><path d="M12 17h.01"/>`,info:`<circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/>`,upload:`<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><path d="m17 8-5-5-5 5"/><path d="M12 3v12"/>`,download:`<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><path d="m7 10 5 5 5-5"/><path d="M12 15V3"/>`,shield:`<path d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"/><path d="m9 12 2 2 4-4"/>`,logout:`<path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"/><path d="m16 17 5-5-5-5"/><path d="M21 12H9"/>`,loader:`<path d="M21 12a9 9 0 1 1-6.219-8.56"/>`,"circle-check":`<circle cx="12" cy="12" r="10"/><path d="m9 12 2 2 4-4"/>`,"circle-dashed":`<circle cx="12" cy="12" r="9" stroke-dasharray="3 3"/>`,clock:`<circle cx="12" cy="12" r="10"/><path d="M12 6v6l4 2"/>`,mail:`<rect width="20" height="16" x="2" y="4" rx="2"/><path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"/>`,send:`<path d="m22 2-7 20-4-9-9-4Z"/><path d="M22 2 11 13"/>`,chat:`<path d="M7.9 20A9 9 0 1 0 4 16.1L2 22Z"/>`,wallet:`<path d="M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1"/><path d="M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4"/>`,"file-code":`<path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/><path d="m10 13-2 2 2 2"/><path d="m14 17 2-2-2-2"/>`,ban:`<circle cx="12" cy="12" r="10"/><path d="m4.9 4.9 14.2 14.2"/>`,code:`<path d="m16 18 6-6-6-6"/><path d="m8 6-6 6 6 6"/>`,"chevron-left":`<path d="m15 18-6-6 6-6"/>`,bluetooth:`<path d="m7 7 10 10-5 5V2l5 5L7 17"/>`,face:`<path d="M3 7V5a2 2 0 0 1 2-2h2"/><path d="M17 3h2a2 2 0 0 1 2 2v2"/><path d="M21 17v2a2 2 0 0 1-2 2h-2"/><path d="M7 21H5a2 2 0 0 1-2-2v-2"/><path d="M8 14s1.5 2 4 2 4-2 4-2"/><path d="M9 9h.01"/><path d="M15 9h.01"/>`,eye:`<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"/><circle cx="12" cy="12" r="3"/>`,clipboard:`<rect width="8" height="4" x="8" y="2" rx="1" ry="1"/><path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"/>`,grip:`<circle cx="9" cy="5" r="1"/><circle cx="9" cy="12" r="1"/><circle cx="9" cy="19" r="1"/><circle cx="15" cy="5" r="1"/><circle cx="15" cy="12" r="1"/><circle cx="15" cy="19" r="1"/>`,list:`<path d="M3 12h.01"/><path d="M3 18h.01"/><path d="M3 6h.01"/><path d="M8 12h13"/><path d="M8 18h13"/><path d="M8 6h13"/>`,lock:`<rect width="18" height="11" x="3" y="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/>`,hw:`<rect width="20" height="10" x="2" y="7" rx="2"/><path d="M15 7v10"/><circle cx="8" cy="12" r="1.5"/>`,link:`<path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/>`,signal:`<path d="M2 20h.01"/><path d="M7 20v-4"/><path d="M12 20v-8"/><path d="M17 20V8"/>`,grid:`<rect x="3" y="3" width="7" height="7" rx="1.5"/><rect x="14" y="3" width="7" height="7" rx="1.5"/><rect x="3" y="14" width="7" height="7" rx="1.5"/><rect x="14" y="14" width="7" height="7" rx="1.5"/>`,coins:`<circle cx="8" cy="8" r="6"/><path d="M18.09 10.37A6 6 0 1 1 10.34 18"/><path d="M7 6h1v4"/><path d="m16.71 13.88.7.71-2.82 2.82"/>`,arrows:`<path d="M8 3 4 7l4 4"/><path d="M4 7h16"/><path d="m16 21 4-4-4-4"/><path d="M20 17H4"/>`,key:`<path d="m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4"/><path d="m21 2-9.6 9.6"/><circle cx="7.5" cy="15.5" r="5.5"/>`,blocks:`<rect width="7" height="7" x="14" y="3" rx="1"/><path d="M10 21V8a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-5a1 1 0 0 0-1-1H3"/>`,settings:`<path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"/><circle cx="12" cy="12" r="3"/>`,qr:`<rect width="5" height="5" x="3" y="3" rx="1"/><rect width="5" height="5" x="16" y="3" rx="1"/><rect width="5" height="5" x="3" y="16" rx="1"/><path d="M21 16h-3a2 2 0 0 0-2 2v3"/><path d="M21 21v.01"/><path d="M12 7v3a2 2 0 0 1-2 2H7"/><path d="M3 12h.01"/><path d="M12 3h.01"/><path d="M12 16v.01"/><path d="M16 12h1"/><path d="M21 12v.01"/><path d="M12 21v-1"/>`,edit:`<path d="M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"/>`,star:`<path d="M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z"/>`,home:`<path d="M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8"/><path d="M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/>`,moon:`<path d="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"/>`,sun:`<circle cx="12" cy="12" r="4"/><path d="M12 2v2"/><path d="M12 20v2"/><path d="m4.93 4.93 1.41 1.41"/><path d="m17.66 17.66 1.41 1.41"/><path d="M2 12h2"/><path d="M20 12h2"/><path d="m6.34 17.66-1.41 1.41"/><path d="m19.07 4.93-1.41 1.41"/>`,languages:`<path d="m5 8 6 6"/><path d="m4 14 6-6 2-3"/><path d="M2 5h12"/><path d="M7 2h1"/><path d="m22 22-5-10-5 10"/><path d="M14 18h6"/>`,"arrow-left":`<path d="m12 19-7-7 7-7"/><path d="M19 12H5"/>`,play:`<polygon points="6 3 20 12 6 21 6 3"/>`,"zoom-in":`<circle cx="11" cy="11" r="8"/><path d="m21 21-4.35-4.35"/><path d="M11 8v6"/><path d="M8 11h6"/>`,"zoom-out":`<circle cx="11" cy="11" r="8"/><path d="m21 21-4.35-4.35"/><path d="M8 11h6"/>`,fit:`<path d="M8 3H5a2 2 0 0 0-2 2v3"/><path d="M21 8V5a2 2 0 0 0-2-2h-3"/><path d="M3 16v3a2 2 0 0 0 2 2h3"/><path d="M16 21h3a2 2 0 0 0 2-2v-3"/>`,"panel-left":`<rect width="18" height="18" x="3" y="3" rx="2"/><path d="M9 3v18"/>`,layers:`<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"/><path d="m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65"/><path d="m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65"/>`,file:`<path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/>`,palette:`<circle cx="13.5" cy="6.5" r="1"/><circle cx="17.5" cy="10.5" r="1"/><circle cx="8.5" cy="7.5" r="1"/><circle cx="6.5" cy="12.5" r="1"/><path d="M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.93 0 1.65-.75 1.65-1.69 0-.44-.18-.84-.44-1.13-.29-.29-.44-.65-.44-1.13a1.64 1.64 0 0 1 1.67-1.67h2c3.05 0 5.55-2.5 5.55-5.55C21.96 6.01 17.46 2 12 2z"/>`,type:`<path d="M4 7V4h16v3"/><path d="M9 20h6"/><path d="M12 4v16"/>`,shape:`<path d="M5 3a2 2 0 0 0-2 2"/><path d="M19 3a2 2 0 0 1 2 2"/><path d="M21 19a2 2 0 0 1-2 2"/><path d="M5 21a2 2 0 0 1-2-2"/><path d="M9 3h1"/><path d="M9 21h1"/><path d="M14 3h1"/><path d="M14 21h1"/><path d="M3 9v1"/><path d="M21 9v1"/><path d="M3 14v1"/><path d="M21 14v1"/>`,motion:`<path d="M2 12c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1 .6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1"/><path d="M2 18c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1 .6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1"/><path d="M2 6c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1 .6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1"/>`,book:`<path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"/><path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"/>`,image:`<rect width="18" height="18" x="3" y="3" rx="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.09-3.09a2 2 0 0 0-2.82 0L6 21"/>`,monitor:`<rect width="20" height="14" x="2" y="3" rx="2"/><path d="M8 21h8"/><path d="M12 17v4"/>`,smartphone:`<rect width="14" height="20" x="5" y="2" rx="2"/><path d="M12 18h.01"/>`,tablet:`<rect width="16" height="20" x="4" y="2" rx="2"/><path d="M12 18h.01"/>`,note:`<path d="M16 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8Z"/><path d="M15 3v4a2 2 0 0 0 2 2h4"/>`,globe:`<circle cx="12" cy="12" r="10"/><path d="M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"/><path d="M2 12h20"/>`,share:`<path d="M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"/><path d="m16 6-4-4-4 4"/><path d="M12 2v13"/>`,pointer:`<path d="M4.04 4.69a.5.5 0 0 1 .65-.65l16 6.5a.5.5 0 0 1-.06.95l-6.12 1.58a2 2 0 0 0-1.44 1.44l-1.58 6.12a.5.5 0 0 1-.95.06z"/>`,component:`<path d="M5.5 8.5 9 12l-3.5 3.5L2 12l3.5-3.5Z"/><path d="m12 2 3.5 3.5L12 9 8.5 5.5 12 2Z"/><path d="M18.5 8.5 22 12l-3.5 3.5L15 12l3.5-3.5Z"/><path d="m12 15 3.5 3.5L12 22l-3.5-3.5L12 15Z"/>`,keyboard:`<rect width="20" height="16" x="2" y="4" rx="2"/><path d="M6 8h.01"/><path d="M10 8h.01"/><path d="M14 8h.01"/><path d="M18 8h.01"/><path d="M8 12h.01"/><path d="M12 12h.01"/><path d="M16 12h.01"/><path d="M7 16h10"/>`,folder:`<path d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"/>`,canvas:`<rect width="7" height="9" x="3" y="3" rx="1"/><rect width="7" height="5" x="14" y="3" rx="1"/><rect width="7" height="9" x="14" y="12" rx="1"/><rect width="7" height="5" x="3" y="16" rx="1"/>`,eraser:`<path d="m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21"/><path d="M22 21H7"/><path d="m5 11 9 9"/>`,square:`<rect width="18" height="18" x="3" y="3" rx="2"/>`,"arrow-up-right":`<path d="M13 5h6v6"/><path d="M19 5 5 19"/>`,undo:`<path d="M9 14 4 9l5-5"/><path d="M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5 5.5 5.5 0 0 1-5.5 5.5H11"/>`,redo:`<path d="m15 14 5-5-5-5"/><path d="M20 9H9.5A5.5 5.5 0 0 0 4 14.5 5.5 5.5 0 0 0 9.5 20H13"/>`,minimize:`<path d="m14 10 7-7"/><path d="M20 10h-6V4"/><path d="m3 21 7-7"/><path d="M4 14h6v6"/>`,lightbulb:`<path d="M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5"/><path d="M9 18h6"/><path d="M10 22h4"/>`};function X({name:e,size:t=16,strokeWidth:n=1.75,className:r}){return(0,R.jsx)(`svg`,{width:t,height:t,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:n,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,className:`shrink-0 ${e===`loader`?`animate-spin`:``} ${r??``}`,dangerouslySetInnerHTML:{__html:x_[e]}})}function Z({children:e,size:t=12.5,className:n,title:r,wrap:i}){return(0,R.jsx)(`span`,{title:r,className:J(i?`break-all`:`whitespace-nowrap`,`font-mono`,n),style:{fontSize:t},children:e})}function S_({children:e}){return(0,R.jsx)(`kbd`,{className:`rounded-[4px] border border-rule bg-surface px-[5px] py-px font-mono text-[11px] text-ink2`,children:e})}function C_({top:e,bottom:t,weight:n=500}){return(0,R.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-px`,children:[(0,R.jsx)(`span`,{className:`truncate leading-[1.35]`,style:{fontWeight:n},children:e}),t?(0,R.jsx)(`span`,{className:`flex min-w-0 items-center gap-2.5 overflow-hidden whitespace-nowrap text-[12.5px] leading-[1.35] text-muted`,children:t}):null]})}var w_={canvas:`This canvas`,canvases:`Canvases`,system:`Design system`,actions:`Actions`};function T_(e){let t=/^\/c\/([^/]+)/.exec(e);return t?decodeURIComponent(t[1]):null}function E_({onClose:e}){let[t,n]=I(),r=e_().scope,i=r_().data,a=r?.canvas??T_(t),o=i_(a??``,!!a).data,s=a_(!!i?.system).data,[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)(0),f=t=>()=>{e(),t()},p=[];if(o)for(let e of o.pages){p.push({id:`page:${e.id}`,group:`canvas`,label:e.title,icon:`file`,hint:`Page`,run:f(()=>n(`/c/${encodeURIComponent(o.id)}/p/${encodeURIComponent(e.id)}`))});for(let t of e.sections)for(let r of t.items)(r.kind===`screen`||r.kind===`url`)&&p.push({id:`item:${e.id}:${r.id}`,group:`canvas`,label:r.title,icon:r.kind===`url`?`globe`:`monitor`,hint:t.title?`${e.title} · ${t.title}`:e.title,keywords:`${r.id} ${t.title??``}`,searchOnly:!0,run:f(()=>{n(`/c/${encodeURIComponent(o.id)}/p/${encodeURIComponent(e.id)}`),l_(o.id,r.id)})})}for(let e of i?.canvases??[])e.id!==a&&p.push({id:`canvas:${e.id}`,group:`canvases`,label:e.title,icon:`canvas`,hint:`${e.screens} screens`,keywords:e.id,run:f(()=>n(`/c/${encodeURIComponent(e.id)}`))});if(i?.system){for(let[e,t,r]of[[`Overview`,`/system`,`book`],[`Colors`,`/system/colors`,`palette`],[`Typography`,`/system/typography`,`type`],[`Spacing & shape`,`/system/shape`,`shape`]])p.push({id:`sys:${t}`,group:`system`,label:e,icon:r,run:f(()=>n(t))});for(let e of s?.components??[])p.push({id:`component:${e.id}`,group:`system`,label:e.title,icon:`component`,hint:e.group,searchOnly:!0,run:f(()=>n(`/system/components/${encodeURIComponent(e.id)}`))});for(let e of s?.guidelines??[])p.push({id:`guide:${e.slug}`,group:`system`,label:e.title,icon:`book`,hint:`Guideline`,searchOnly:!0,run:f(()=>n(`/system/guidelines/${encodeURIComponent(e.slug)}`))})}r||p.push({id:`home`,group:`actions`,label:`All canvases`,icon:`home`,run:f(()=>n(`/`))}),p.push({id:`light`,group:`actions`,label:`Light appearance`,icon:`sun`,searchOnly:!0,run:f(()=>v_(`light`))},{id:`dark`,group:`actions`,label:`Dark appearance`,icon:`moon`,searchOnly:!0,run:f(()=>v_(`dark`))},{id:`system-theme`,group:`actions`,label:`System appearance`,icon:`monitor`,searchOnly:!0,run:f(()=>v_(`system`))});let m=c.trim().toLowerCase(),h=p.filter(e=>m?`${e.label} ${e.keywords??``} ${typeof e.hint==`string`?e.hint:``}`.toLowerCase().includes(m):!e.searchOnly),g=[`canvas`,`canvases`,`system`,`actions`].map(e=>({group:e,items:h.filter(t=>t.group===e)})).filter(e=>e.items.length),_=g.flatMap(e=>e.items),y=Math.min(u,Math.max(_.length-1,0)),b=-1;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(jg,{className:`sr-only`,children:`Search and jump`}),(0,R.jsxs)(`div`,{className:`flex h-12 shrink-0 items-center gap-2.5 border-b border-rule px-4`,children:[(0,R.jsx)(X,{name:`search`,size:16,className:`text-muted`}),(0,R.jsx)(`input`,{value:c,onChange:e=>{l(e.target.value),d(0)},onKeyDown:e=>{e.key===`ArrowDown`?(e.preventDefault(),d((y+1)%Math.max(_.length,1))):e.key===`ArrowUp`?(e.preventDefault(),d((y-1+_.length)%Math.max(_.length,1))):e.key===`Enter`&&(e.preventDefault(),_[y]?.run())},placeholder:`Canvases, screens, components…`,"aria-label":`Search and jump`,role:`combobox`,"aria-expanded":`true`,"aria-controls":`palette-list`,autoComplete:`off`,spellCheck:!1,className:`h-full min-w-0 grow border-0 bg-transparent text-[15px] text-ink outline-none placeholder:text-muted`}),(0,R.jsx)(S_,{children:`esc`})]}),(0,R.jsx)(`div`,{id:`palette-list`,role:`listbox`,className:`min-h-0 grow overflow-y-auto py-1.5`,children:g.length?g.map(({group:e,items:t})=>(0,R.jsxs)(`div`,{role:`presentation`,children:[(0,R.jsx)(`div`,{className:`px-4 pt-2.5 pb-1 text-[12px] text-muted`,children:w_[e]}),t.map(e=>{b+=1;let t=b,n=t===y;return(0,R.jsxs)(`button`,{type:`button`,role:`option`,tabIndex:-1,"aria-selected":n,ref:n?e=>e?.scrollIntoView({block:`nearest`}):void 0,onMouseMove:()=>n?void 0:d(t),onClick:e.run,className:J(`flex h-10 w-full cursor-pointer items-center gap-3 border-0 px-4 text-left text-[13.5px] text-ink`,n?`bg-soft`:`bg-transparent`),children:[(0,R.jsx)(`span`,{className:`flex w-5 shrink-0 justify-center text-ink2`,children:(0,R.jsx)(X,{name:e.icon,size:16})}),(0,R.jsx)(`span`,{className:`min-w-0 grow truncate`,children:e.label}),e.hint?(0,R.jsx)(`span`,{className:`flex shrink-0 items-center text-[12.5px] text-muted`,children:e.hint}):null]},e.id)})]},e)):(0,R.jsx)(`div`,{className:`px-6 py-10 text-center text-[13px] text-muted`,children:`Nothing matches.`})}),(0,R.jsxs)(`div`,{className:`flex h-9 shrink-0 items-center gap-4 border-t border-rule bg-soft px-4 text-[12px] text-muted`,children:[(0,R.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,R.jsx)(S_,{children:`↑`}),(0,R.jsx)(S_,{children:`↓`}),`move`]}),(0,R.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,R.jsx)(S_,{children:`↵`}),`open`]})]})]})}function D_(){let[e,t]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{let e=()=>t(e=>!e),n=t=>{(t.metaKey||t.ctrlKey)&&t.key.toLowerCase()===`k`&&(t.preventDefault(),e())};return window.addEventListener(`keydown`,n),window.addEventListener(`design:palette`,e),()=>{window.removeEventListener(`keydown`,n),window.removeEventListener(`design:palette`,e)}},[]),(0,R.jsx)(gg,{open:e,onOpenChange:t,children:(0,R.jsx)(td,{children:e?(0,R.jsx)(bg,{forceMount:!0,children:(0,R.jsx)(Sg,{asChild:!0,forceMount:!0,children:(0,R.jsx)(Kf.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.14},className:`fixed inset-0 z-50 flex items-start justify-center bg-overlay p-6 pt-[12vh]`,children:(0,R.jsx)(Eg,{asChild:!0,forceMount:!0,"aria-describedby":void 0,children:(0,R.jsx)(Kf.div,{initial:{opacity:0,scale:.98,y:-6},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.98,transition:{duration:.1}},transition:{type:`spring`,stiffness:560,damping:40},className:`flex max-h-[min(560px,76vh)] w-[560px] max-w-full flex-col overflow-hidden rounded-[12px] border border-rule bg-surface shadow-pop outline-none`,children:(0,R.jsx)(E_,{onClose:()=>t(!1)})})})})})}):null})})}var O_={primary:`border border-primary bg-primary text-primary-ink hover:opacity-90`,secondary:`border border-rule-strong bg-surface text-ink hover:bg-soft`,ghost:`border border-transparent bg-transparent text-ink2 hover:bg-soft2`,dashed:`border border-dashed border-rule-strong bg-transparent text-ink2 hover:bg-soft`,danger:`border border-danger bg-danger text-on-danger hover:opacity-90`},k_=(e=`secondary`,t)=>J(`inline-flex h-ctrl shrink-0 cursor-pointer items-center justify-center gap-1.5 whitespace-nowrap rounded-[6px] px-ctrl text-ctrl font-medium leading-none no-underline transition-[background-color,opacity,scale] duration-100 active:not-disabled:scale-[0.97]`,`disabled:cursor-not-allowed disabled:opacity-45 aria-disabled:cursor-not-allowed aria-disabled:opacity-45`,O_[e],t),A_=(0,v.forwardRef)(function({kind:e=`secondary`,icon:t,loading:n,disabled:r,className:i,children:a,type:o=`button`,...s},c){return(0,R.jsxs)(`button`,{ref:c,type:o,disabled:r||n,"aria-busy":n||void 0,className:k_(e,i),...s,children:[n?(0,R.jsx)(X,{name:`loader`,size:15,className:`animate-spin`}):t?(0,R.jsx)(X,{name:t,size:15}):null,a]})}),j_={ghost:`border border-transparent bg-transparent text-muted hover:bg-soft2 hover:text-ink2`,secondary:`border border-rule-strong bg-surface text-ink2 hover:bg-soft`},M_=(e=`ghost`,t)=>J(`inline-flex h-ctrl w-ctrl shrink-0 cursor-pointer items-center justify-center rounded-[6px] p-0 transition-[color,background-color,scale] duration-100 active:not-disabled:scale-[0.94] disabled:cursor-not-allowed disabled:opacity-45`,j_[e],t),N_=(0,v.forwardRef)(function({icon:e,label:t,kind:n=`ghost`,size:r=16,className:i,type:a=`button`,...o},s){return(0,R.jsx)(`button`,{ref:s,type:a,"aria-label":t,title:t,className:M_(n,i),...o,children:(0,R.jsx)(X,{name:e,size:r})})});function P_({to:e,kind:t=`secondary`,icon:n,className:r,children:i}){return(0,R.jsxs)(ye,{href:e,className:k_(t,r),children:[n?(0,R.jsx)(X,{name:n,size:15}):null,i]})}function F_({kind:e=`secondary`,icon:t,className:n,children:r,...i}){return(0,R.jsxs)(`a`,{className:k_(e,n),...i,children:[t?(0,R.jsx)(X,{name:t,size:15}):null,r]})}var I_={neutral:`bg-soft2 text-ink2`,action:`bg-action-soft text-action`,ok:`bg-ok-soft text-ok-text`,danger:`bg-danger-soft text-danger-text`};function L_({tone:e=`neutral`,children:t,className:n}){return(0,R.jsx)(`span`,{className:J(`inline-flex h-[22px] shrink-0 items-center gap-1 whitespace-nowrap rounded-[6px] px-2 text-[12px] font-medium`,I_[e],n),children:t})}function R_({value:e,tone:t=`neutral`}){return(0,R.jsx)(`span`,{className:J(`inline-flex h-[18px] min-w-[18px] items-center justify-center rounded-[4px] px-[5px] text-[11.5px] font-semibold tabular`,t===`action`?`bg-action-soft text-action`:t===`danger`?`bg-danger-soft text-danger-text`:`bg-soft2 text-ink2`),children:e})}function z_({children:e,className:t,style:n}){return(0,R.jsx)(`section`,{className:J(`min-w-0 shrink-0 overflow-hidden rounded-[10px] border border-rule bg-surface`,t),style:n,children:e})}function B_({title:e,count:t,sub:n,right:r,as:i=`h2`}){return(0,R.jsxs)(`div`,{className:`flex min-h-[46px] items-center justify-between gap-3 px-4`,children:[(0,R.jsxs)(i,{className:`m-0 flex min-w-0 items-center gap-2 whitespace-nowrap text-[14px] font-semibold`,children:[e,t===void 0?null:(0,R.jsx)(R_,{value:t}),n?(0,R.jsx)(`span`,{className:`truncate text-[12.5px] font-normal text-muted`,children:n}):null]}),r?(0,R.jsx)(`div`,{className:`flex items-center gap-2`,children:r}):null]})}function V_({items:e,value:t,onChange:n,right:r}){let i=(0,v.useId)();return(0,R.jsxs)(`div`,{className:`flex h-[46px] items-center justify-between gap-3 px-4`,children:[(0,R.jsx)(`div`,{role:`tablist`,className:`flex gap-5`,children:e.map(e=>{let r=e.value===t;return(0,R.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":r,onClick:()=>n(e.value),className:J(`relative flex h-[46px] cursor-pointer items-center gap-1.5 border-0 bg-transparent px-0.5 text-[14px] transition-colors`,r?`font-semibold text-ink`:`font-medium text-ink2 hover:text-ink`),children:[e.label,e.count===void 0?null:(0,R.jsx)(R_,{value:e.count}),r?(0,R.jsx)(Kf.span,{layoutId:i,className:`absolute inset-x-0 bottom-0 h-[2px] bg-ink`,transition:{type:`spring`,stiffness:520,damping:42}}):null]},e.value)})}),r?(0,R.jsx)(`div`,{className:`flex items-center gap-2`,children:r}):null]})}function H_({align:e,children:t}){return(0,R.jsx)(`div`,{className:J(`flex min-w-0 items-center gap-2`,e===`r`&&`justify-end text-right`,e===`c`&&`justify-center`),children:t})}function U_(e,t){return v.Children.toArray(e).map((e,n)=>(0,R.jsx)(H_,{align:t?.[n]??`l`,children:e},n))}function W_({cols:e,align:t,labels:n}){return(0,R.jsx)(`div`,{className:`grid h-8 items-center gap-x-4 border-t border-rule bg-soft px-4 text-[12.5px] text-muted`,style:{gridTemplateColumns:e},children:n.map((e,n)=>(0,R.jsx)(H_,{align:t?.[n]??`l`,children:(0,R.jsx)(`span`,{className:`whitespace-nowrap`,children:e})},n))})}var G_=(e,t,n)=>J(`grid items-center gap-x-4 border-rule`,!e&&`border-t`,t&&`cursor-pointer transition-colors hover:bg-soft`,n);function K_({cols:e,align:t,minH:n=44,pad:r=`10px 16px`,children:i,first:a,className:o,onClick:s,title:c}){return(0,R.jsx)(`div`,{className:G_(a,!!s,o),style:{gridTemplateColumns:e,minHeight:n,padding:r},onClick:s,title:c,children:U_(i,t)})}function q_({to:e,cols:t,align:n,minH:r=44,pad:i=`10px 16px`,first:a,className:o,children:s}){return(0,R.jsx)(ye,{href:e,className:J(G_(a,!0,o),`text-inherit no-underline`),style:{gridTemplateColumns:t,minHeight:r,padding:i},children:U_(s,n)})}function J_({label:e,children:t,labelWidth:n=180,minH:r=40,end:i=!1}){return(0,R.jsxs)(`div`,{className:`grid content-center items-baseline gap-x-4 border-t border-rule px-4 py-2`,style:{gridTemplateColumns:`min(${n}px, 42%) minmax(0, 1fr)`,minHeight:r},children:[(0,R.jsx)(`span`,{className:`text-[13px] text-muted`,children:e}),(0,R.jsx)(`div`,{className:J(`flex min-w-0 flex-wrap items-center gap-2`,i&&`justify-end`),children:t})]})}function Y_({children:e,pad:t=`16px`,gap:n=16,top:r=!0,className:i}){return(0,R.jsx)(`div`,{className:J(`flex flex-col`,r&&`border-t border-rule`,i),style:{padding:t,gap:n},children:e})}function X_({children:e,className:t,gap:n=20,wide:r=!1}){return(0,R.jsx)(`main`,{className:J(`mx-auto flex w-full min-h-0 grow flex-col px-8 pt-6 pb-7 animate-[q-fade-in_160ms_ease-out] max-md:px-4 max-md:pt-4`,r?`max-w-[1440px]`:`max-w-[1200px]`,t),style:{gap:n},children:e})}function Z_({title:e,sub:t,right:n,badge:r,crumbs:i}){return(0,R.jsxs)(`div`,{className:`flex shrink-0 items-end justify-between gap-6 max-md:flex-col max-md:items-stretch max-md:gap-3`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[i?(0,R.jsx)(`div`,{className:`flex items-center gap-1.5 text-[13px] text-muted`,children:i}):null,(0,R.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,R.jsx)(`h1`,{className:`m-0 text-[22px] font-semibold tracking-[-0.01em]`,children:e}),r]}),t?(0,R.jsx)(`div`,{className:`text-[13px] [overflow-wrap:anywhere] text-muted`,children:t}):null]}),n?(0,R.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:n}):null]})}function Q_({items:e,label:t}){let[n]=I();return(0,R.jsx)(`nav`,{"aria-label":t,className:`flex flex-col gap-0.5`,children:e.map(e=>{let t=n===e.to;return(0,R.jsxs)(ye,{href:e.to,"aria-current":t?`page`:void 0,className:J(`relative flex h-8 items-center gap-2 whitespace-nowrap rounded-[6px] px-3 text-[13.5px] no-underline transition-colors focus-visible:outline-offset-[-2px]`,t?`font-medium text-ink`:`text-ink2 hover:bg-soft2`),children:[t?(0,R.jsx)(Kf.span,{layoutId:`sub-nav-active`,"aria-hidden":!0,className:`absolute inset-0 z-0 rounded-[6px] bg-soft2`,transition:{type:`spring`,stiffness:520,damping:42}}):null,(0,R.jsx)(`span`,{className:`relative z-[1] min-w-0 truncate`,children:e.label}),e.hint?(0,R.jsx)(`span`,{className:`relative z-[1] ml-auto text-[12px] font-normal text-muted`,children:e.hint}):null]},e.to)})})}function $_({children:e}){return(0,R.jsx)(`div`,{className:`px-3 pt-4 pb-1 text-[12px] text-muted`,children:e})}function ev({title:e,text:t,action:n}){return(0,R.jsxs)(z_,{className:`flex w-[480px] max-w-full flex-col items-center gap-2 px-6 py-8 text-center`,children:[(0,R.jsx)(`h1`,{className:`m-0 text-[16px] font-semibold`,children:e}),t?(0,R.jsx)(`div`,{className:`m-0 max-w-[400px] text-[14px] text-ink2`,children:t}):null,n?(0,R.jsx)(`div`,{className:`mt-3 flex flex-wrap justify-center gap-2`,children:n}):null]})}function tv(e){return(0,R.jsx)(`div`,{className:`flex min-h-[50vh] grow items-center justify-center p-6 max-md:px-4`,children:(0,R.jsx)(ev,{...e})})}function nv({error:e}){let t=!!e_().scope;return(0,R.jsx)(tv,{title:`This page failed to show`,text:(0,R.jsx)(`span`,{className:`font-mono text-[12.5px] break-words`,children:e.message.slice(0,500)}),action:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(A_,{onClick:()=>window.location.reload(),children:`Reload`}),t?null:(0,R.jsx)(P_,{to:`/`,children:`All canvases`})]})})}var rv=class extends v.Component{state={error:null};static getDerivedStateFromError(e){return{error:e instanceof Error?e:Error(String(e))}}componentDidCatch(e,t){console.error(`[design] a page failed to render`,e,t.componentStack)}componentDidUpdate(e){this.state.error&&e.at!==this.props.at&&this.setState({error:null})}render(){return this.state.error?(0,R.jsx)(nv,{error:this.state.error}):this.props.children}};function iv({children:e}){let[t]=I();return(0,R.jsx)(rv,{at:t,children:e})}var av=/Mac|iPhone|iPad/.test(navigator.platform)?`⌘`:`Ctrl`,ov=[`top`,`right`,`bottom`,`left`],sv=Math.min,cv=Math.max,lv=Math.round,uv=Math.floor,dv=e=>({x:e,y:e}),fv={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function pv(e,t,n){return cv(e,sv(t,n))}function mv(e,t){return typeof e==`function`?e(t):e}function hv(e){return e.split(`-`)[0]}function gv(e){return e.split(`-`)[1]}function _v(e){return e===`x`?`y`:`x`}function vv(e){return e===`y`?`height`:`width`}function yv(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function bv(e){return _v(yv(e))}function xv(e,t,n){n===void 0&&(n=!1);let r=gv(e),i=bv(e),a=vv(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Av(o)),[o,Av(o)]}function Sv(e){let t=Av(e);return[Cv(e),t,Cv(t)]}function Cv(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var wv=[`left`,`right`],Tv=[`right`,`left`],Ev=[`top`,`bottom`],Dv=[`bottom`,`top`];function Ov(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Tv:wv:t?wv:Tv;case`left`:case`right`:return t?Ev:Dv;default:return[]}}function kv(e,t,n,r){let i=gv(e),a=Ov(hv(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Cv)))),a}function Av(e){let t=hv(e);return fv[t]+e.slice(t.length)}function jv(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Mv(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:jv(e)}function Nv(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Pv(e,t,n){let{reference:r,floating:i}=e,a=yv(t),o=bv(t),s=vv(o),c=hv(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=gv(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Fv(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=mv(t,e),p=Mv(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Nv(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Nv(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Iv=50,Lv=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Fv},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Pv(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Iv&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Pv(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Rv=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=mv(e,t)||{};if(l==null)return{};let d=Mv(u),f={x:n,y:r},p=bv(i),m=vv(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=sv(d[_],T),D=sv(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=pv(E,k,O),j=!c.arrow&&gv(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,M=j?k<E?k-E:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),zv=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=mv(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=hv(r),_=yv(o),v=hv(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Av(o)]:Sv(o)),x=p!==`none`;!d&&x&&b.push(...kv(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=xv(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===yv(t)||T.every(e=>yv(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=yv(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function Bv(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Vv(e){return ov.some(t=>e[t]>=0)}var Hv=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=mv(e,t);switch(i){case`referenceHidden`:{let e=Bv(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Vv(e)}}}case`escaped`:{let e=Bv(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Vv(e)}}}default:return{}}}}},Uv=new Set([`left`,`top`]);async function Wv(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=hv(n),s=gv(n),c=yv(n)===`y`,l=Uv.has(o)?-1:1,u=a&&c?-1:1,d=mv(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Gv=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Wv(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Kv=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=mv(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=yv(i),p=_v(f),m=u[p],h=u[f],g=(e,t)=>pv(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},qv=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=mv(e,t),u={x:n,y:r},d=yv(i),f=_v(d),p=u[f],m=u[d],h=mv(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Uv.has(hv(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Jv=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=mv(e,t),c=await i.detectOverflow(t,s),l=hv(n),u=gv(n),d=yv(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=sv(p-c[m],g),y=sv(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*cv(c.left,c.right):S=p-2*cv(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Yv(){return typeof window<`u`}function Xv(e){return $v(e)?(e.nodeName||``).toLowerCase():`#document`}function Zv(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Qv(e){return(($v(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function $v(e){return Yv()?e instanceof Node||e instanceof Zv(e).Node:!1}function ey(e){return Yv()?e instanceof Element||e instanceof Zv(e).Element:!1}function ty(e){return Yv()?e instanceof HTMLElement||e instanceof Zv(e).HTMLElement:!1}function ny(e){return!Yv()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Zv(e).ShadowRoot}function ry(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=my(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function iy(e){return/^(table|td|th)$/.test(Xv(e))}function ay(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var oy=/transform|translate|scale|rotate|perspective|filter/,sy=/paint|layout|strict|content/,cy=e=>!!e&&e!==`none`,ly;function uy(e){let t=ey(e)?my(e):e;return cy(t.transform)||cy(t.translate)||cy(t.scale)||cy(t.rotate)||cy(t.perspective)||!fy()&&(cy(t.backdropFilter)||cy(t.filter))||oy.test(t.willChange||``)||sy.test(t.contain||``)}function dy(e){let t=gy(e);for(;ty(t)&&!py(t);){if(uy(t))return t;if(ay(t))return null;t=gy(t)}return null}function fy(){return ly??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),ly}function py(e){return/^(html|body|#document)$/.test(Xv(e))}function my(e){return Zv(e).getComputedStyle(e)}function hy(e){return ey(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function gy(e){if(Xv(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ny(e)&&e.host||Qv(e);return ny(t)?t.host:t}function _y(e){let t=gy(e);return py(t)?(e.ownerDocument||e).body:ty(t)&&ry(t)?t:_y(t)}function vy(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=_y(e),i=r===e.ownerDocument?.body,a=Zv(r);if(i){let e=yy(a);return t.concat(a,a.visualViewport||[],ry(r)?r:[],e&&n?vy(e):[])}return t.concat(r,vy(r,[],n))}function yy(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function by(e){let t=my(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=ty(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=lv(n)!==a||lv(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function xy(e){return ey(e)?e:e.contextElement}function Sy(e){let t=xy(e);if(!ty(t))return dv(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=by(t),o=(a?lv(n.width):n.width)/r,s=(a?lv(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Cy=dv(0);function wy(e){let t=Zv(e);return!fy()||!t.visualViewport?Cy:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ty(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Zv(e)}function Ey(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=xy(e),o=dv(1);t&&(r?ey(r)&&(o=Sy(r)):o=Sy(e));let s=Ty(a,n,r)?wy(a):dv(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=Zv(a),t=ey(r)?Zv(r):r,n=e,i=yy(n);for(;i&&t!==n;){let e=Sy(i),t=i.getBoundingClientRect(),r=my(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Zv(i),i=yy(n)}}return Nv({width:u,height:d,x:c,y:l})}function Dy(e,t){let n=hy(e).scrollLeft;return t?t.left+n:Ey(Qv(e)).left+n}function Oy(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Dy(e,n),y:n.top+t.scrollTop}}function ky(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Qv(r),s=t?ay(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=dv(1),u=dv(0),d=ty(r);if((d||!a)&&((Xv(r)!==`body`||ry(o))&&(c=hy(r)),d)){let e=Ey(r);l=Sy(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Oy(o,c):dv(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Ay(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function jy(e){let t=hy(e),n=e.ownerDocument.body,r=cv(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=cv(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Dy(e),o=-t.scrollTop;return my(n).direction===`rtl`&&(a+=cv(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var My=25;function Ny(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Zv(e),a=Qv(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!fy()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Dy(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=My&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Py(e,t){let n=Ey(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Sy(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Fy(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Ny(e,n,t);else if(t===`document`)r=jy(Qv(e));else if(ey(t))r=Py(t,n);else{let n=wy(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Nv(r)}function Iy(e,t){let n=t.get(e);if(n)return n;let r=vy(e,[],!1).filter(e=>ey(e)&&Xv(e)!==`body`),i=null,a=my(e).position===`fixed`,o=a?gy(e):e;for(;ey(o)&&!py(o);){let e=my(o),t=uy(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=gy(o)}return t.set(e,r),r}function Ly(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?ay(t)?[]:Iy(t,this._c):[].concat(n),r],o=Fy(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Fy(t,a[e],i);s=cv(n.top,s),c=sv(n.right,c),l=sv(n.bottom,l),u=cv(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Ry(e){let{width:t,height:n}=by(e);return{width:t,height:n}}function zy(e,t,n){let r=ty(t),i=Qv(t),a=n===`fixed`,o=Ey(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=dv(0);if((r||!a)&&((Xv(t)!==`body`||ry(i))&&(s=hy(t)),r)){let e=Ey(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Dy(i));let l=i&&!r&&!a?Oy(i,s):dv(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function By(e){return my(e).position===`static`}function Vy(e,t){if(!ty(e)||my(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Qv(e)===n&&(n=n.ownerDocument.body),n}function Hy(e,t){let n=Zv(e);if(ay(e))return n;if(!ty(e)){let t=gy(e);for(;t&&!py(t);){if(ey(t)&&!By(t))return t;t=gy(t)}return n}let r=Vy(e,t);for(;r&&iy(r)&&By(r);)r=Vy(r,t);return r&&py(r)&&By(r)&&!uy(r)?n:r||dy(e)||n}var Uy=async function(e){let t=this.getOffsetParent||Hy,n=this.getDimensions,r=await n(e.floating);return{reference:zy(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Wy(e){return my(e).direction===`rtl`}var Gy={convertOffsetParentRelativeRectToViewportRelativeRect:ky,getDocumentElement:Qv,getClippingRect:Ly,getOffsetParent:Hy,getElementRects:Uy,getClientRects:Ay,getDimensions:Ry,getScale:Sy,isElement:ey,isRTL:Wy};function Ky(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function qy(e,t,n){let r=null,i,a=Qv(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=uv(d),h=uv(a.clientWidth-(u+f)),g=uv(a.clientHeight-(d+p)),_=uv(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:cv(0,sv(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Ky(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=Zv(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Jy(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=xy(e),u=i||a?[...l?vy(l):[],...t?vy(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?qy(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Ey(e):null;c&&g();function g(){let t=Ey(e);h&&!Ky(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Yy=Gv,Xy=Kv,Zy=zv,Qy=Jv,$y=Hv,eb=Rv,tb=qv,nb=(e,t,n)=>{let r=new Map,i=n??{},a={...Gy,...i.platform,_c:r};return Lv(e,t,{...i,platform:a})},rb=typeof document<`u`?v.useLayoutEffect:function(){};function ib(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!ib(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!ib(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function ab(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ob(e,t){let n=ab(e);return Math.round(t*n)/n}function sb(e){let t=v.useRef(e);return rb(()=>{t.current=e}),t}function cb(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=v.useState(r);ib(f,r)||p(r);let[m,h]=v.useState(null),[g,_]=v.useState(null),y=v.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=v.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=a||m,S=o||g,C=v.useRef(null),w=v.useRef(null),T=v.useRef(u),E=c!=null,D=sb(c),O=sb(i),k=sb(l),A=v.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),nb(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!ib(T.current,t)&&(T.current=t,Op.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);rb(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=v.useRef(!1);rb(()=>(j.current=!0,()=>{j.current=!1}),[]),rb(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=v.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),ee=v.useMemo(()=>({reference:x,floating:S}),[x,S]),N=v.useMemo(()=>{let e={position:n,left:0,top:0};if(!ee.floating)return e;let t=ob(ee.floating,u.x),r=ob(ee.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...ab(ee.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,ee.floating,u.x,u.y]);return v.useMemo(()=>({...u,update:A,refs:M,elements:ee,floatingStyles:N}),[u,A,M,ee,N])}var lb=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:eb({element:r.current,padding:i}).fn(n):r?eb({element:r,padding:i}).fn(n):{}}}},ub=(e,t)=>{let n=Yy(e);return{name:n.name,fn:n.fn,options:[e,t]}},db=(e,t)=>{let n=Xy(e);return{name:n.name,fn:n.fn,options:[e,t]}},fb=(e,t)=>({fn:tb(e).fn,options:[e,t]}),pb=(e,t)=>{let n=Zy(e);return{name:n.name,fn:n.fn,options:[e,t]}},mb=(e,t)=>{let n=Qy(e);return{name:n.name,fn:n.fn,options:[e,t]}},hb=(e,t)=>{let n=$y(e);return{name:n.name,fn:n.fn,options:[e,t]}},gb=(e,t)=>{let n=lb(e);return{name:n.name,fn:n.fn,options:[e,t]}},_b=Object.defineProperty,vb=(e,t)=>_b(e,`name`,{value:t,configurable:!0});function yb(e){let[t,n]=v.useState(void 0);return lp(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}vb(yb,`useSize`);var bb=Object.defineProperty,xb=(e,t)=>bb(e,`name`,{value:t,configurable:!0}),Sb=`Popper`,[Cb,wb]=sp(Sb),[Tb,Eb]=Cb(Sb),Db=xb(e=>{let{__scopePopper:t,children:n}=e,[r,i]=v.useState(null),[a,o]=v.useState(void 0);return(0,R.jsx)(Tb,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),Ob=`PopperAnchor`,kb=v.forwardRef(xb(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=Eb(Ob,n),o=v.useRef(null),s=a.onAnchorChange,c=rp(t,v.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=v.useRef(null);v.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&Ib(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,R.jsx)(Kp.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),Ab=`PopperContent`,[jb,Mb]=Cb(Ab),Nb=v.forwardRef(xb(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=Eb(Ab,n),[_,y]=v.useState(null),b=rp(t,y),[x,S]=v.useState(null),C=yb(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],k=O.length>0,A={padding:D,boundary:O.filter(Pb),altBoundary:k},{refs:j,floatingStyles:M,placement:ee,isPositioned:N,middlewareData:P}=cb({strategy:`fixed`,placement:E,whileElementsMounted:xb((...e)=>Jy(...e,{animationFrame:p===`always`}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[ub({mainAxis:i+T,alignmentAxis:o}),c&&db({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?fb():void 0,...A}),c&&pb({...A}),mb({...A,apply:xb(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),x&&gb({element:x,padding:s}),Fb({arrowWidth:w,arrowHeight:T}),f&&hb({strategy:`referenceHidden`,...A,boundary:k?A.boundary:void 0})]}),te=g.setPlacementState;lp(()=>(te(ee),()=>{te(void 0)}),[ee,te]);let[ne,F]=Ib(ee),re=Xp(m);lp(()=>{N&&re?.()},[N,re]);let ie=P.arrow?.x,ae=P.arrow?.y,oe=P.arrow?.centerOffset!==0,[se,ce]=v.useState();return lp(()=>{_&&ce(window.getComputedStyle(_).zIndex)},[_]),(0,R.jsx)(`div`,{ref:j.setFloating,"data-radix-popper-content-wrapper":``,style:{...M,transform:N?M.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:se,"--radix-popper-transform-origin":[P.transformOrigin?.x,P.transformOrigin?.y].join(` `),...P.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,R.jsx)(jb,{scope:n,placedSide:ne,placedAlign:F,onArrowChange:S,arrowX:ie,arrowY:ae,shouldHideArrow:oe,children:(0,R.jsx)(Kp.div,{"data-side":ne,"data-align":F,...h,ref:b,style:{...h.style,animation:N?h.style?.animation:`none`}})})})},`PopperContent`));function Pb(e){return e!==null}xb(Pb,`isNotNull`);var Fb=xb(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Ib(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function Ib(e){let[t,n=`center`]=e.split(`-`);return[t,n]}xb(Ib,`getSideAndAlignFromPlacement`);var Lb=Db,Rb=kb,zb=Nb,Bb=Object.defineProperty,Vb=(e,t)=>Bb(e,`name`,{value:t,configurable:!0}),Hb=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),Ub=v.forwardRef(Vb(function(e,t){return(0,R.jsx)(Kp.span,{...e,ref:t,style:{...Hb,...e.style}})},`VisuallyHidden`)),Wb=Object.defineProperty,Gb=(e,t)=>Wb(e,`name`,{value:t,configurable:!0}),[Kb,qb]=sp(`Tooltip`,[wb]),Jb=wb(),Yb=`TooltipProvider`,Xb=700,Zb=`tooltip.open`,[Qb,$b]=Kb(Yb),ex=Gb(e=>{let{__scopeTooltip:t,delayDuration:n=Xb,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=v.useRef(!0),s=v.useRef(!1),c=v.useRef(0);return v.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,R.jsx)(Qb,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:v.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:v.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:v.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),tx=`Tooltip`,[nx,rx]=Kb(tx),ix=Gb(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=$b(tx,e.__scopeTooltip),l=Jb(t),[u,d]=v.useState(null),[f,p]=v.useState(void 0),m=mp(),h=v.useRef(0),g=o??c.disableHoverableContent,_=s??c.delayDuration,y=v.useRef(!1),[b,x]=Cp({prop:r,defaultProp:i??!1,onChange:Gb(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(Zb))):c.onClose(),a?.(e)},`onChange`),caller:tx}),S=v.useMemo(()=>b?y.current?`delayed-open`:`instant-open`:`closed`,[b]),C=v.useCallback(()=>{window.clearTimeout(h.current),h.current=0,y.current=!1,x(!0)},[x]),w=v.useCallback(()=>{window.clearTimeout(h.current),h.current=0,x(!1)},[x]),T=v.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{y.current=!0,x(!0),h.current=0},_)},[_,x]);v.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]);let E=f??m;return(0,R.jsx)(Lb,{...l,children:(0,R.jsx)(nx,{scope:t,contentId:E,setContentId:p,open:b,stateAttribute:S,trigger:u,onTriggerChange:d,onTriggerEnter:v.useCallback(()=>{c.isOpenDelayedRef.current?T():C()},[c.isOpenDelayedRef,T,C]),onTriggerLeave:v.useCallback(()=>{g?w():(window.clearTimeout(h.current),h.current=0)},[w,g]),onOpen:C,onClose:w,disableHoverableContent:g,children:n})})},`Tooltip`),ax=`TooltipTrigger`,ox=v.forwardRef(Gb(function(e,t){let{__scopeTooltip:n,...r}=e,i=rx(ax,n),a=$b(ax,n),o=Jb(n),s=rp(t,v.useRef(null),i.onTriggerChange),c=v.useRef(!1),l=v.useRef(!1),u=v.useCallback(()=>c.current=!1,[]);return v.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,R.jsx)(Rb,{asChild:!0,...o,children:(0,R.jsx)(Kp.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:q(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:q(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:q(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:q(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:q(e.onBlur,i.onClose),onClick:q(e.onClick,i.onClose)})})},`TooltipTrigger`)),sx=`TooltipPortal`,[cx,lx]=Kb(sx,{forceMount:void 0}),ux=Gb(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=rx(sx,t);return(0,R.jsx)(cx,{scope:t,forceMount:n,children:(0,R.jsx)(Nm,{present:n||a.open,children:(0,R.jsx)(km,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),dx=`TooltipContent`,fx=v.forwardRef(Gb(function(e,t){let n=lx(dx,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=rx(dx,e.__scopeTooltip);return(0,R.jsx)(Nm,{present:r||o.open,children:o.disableHoverableContent?(0,R.jsx)(hx,{side:i,...a,ref:t}):(0,R.jsx)(px,{side:i,...a,ref:t})})},`TooltipContent`)),px=v.forwardRef(Gb(function(e,t){let n=rx(dx,e.__scopeTooltip),r=$b(dx,e.__scopeTooltip),i=v.useRef(null),a=rp(t,i),[o,s]=v.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=v.useCallback(()=>{s(null),d(!1)},[d]),p=v.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=_x(r,gx(r,n.getBoundingClientRect())),a=vx(t.getBoundingClientRect()),o=bx([...i,...a]);s(o),d(!0)},[d]);return v.useEffect(()=>()=>f(),[f]),v.useEffect(()=>{if(c&&u){let e=Gb(e=>p(e,u),`handleTriggerLeave`),t=Gb(e=>p(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),v.useEffect(()=>{if(o){let e=Gb(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!yx(n,o);r?f():i&&(f(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,R.jsx)(hx,{...e,ref:a})},`TooltipContentHoverable`)),mx=Np(`TooltipContent`),hx=v.forwardRef(Gb(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=rx(dx,n),u=Jb(n),{onClose:d}=l;v.useEffect(()=>(document.addEventListener(Zb,d),()=>document.removeEventListener(Zb,d)),[d]),v.useEffect(()=>{if(l.trigger){let e=Gb(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]);let{setContentId:f}=l;return lp(()=>(f(a),()=>{f(void 0)}),[a,f]),(0,R.jsx)(im,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,R.jsxs)(zb,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,R.jsx)(mx,{children:r}),i?(0,R.jsx)(Ub,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`));function gx(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}Gb(gx,`getExitSideFromRect`);function _x(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}Gb(_x,`getPaddedExitPoints`);function vx(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}Gb(vx,`getPointsFromRect`);function yx(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}Gb(yx,`isPointInPolygon`);function bx(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),xx(t)}Gb(bx,`getHull`);function xx(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}Gb(xx,`getHullPresorted`);var Sx=ex,Cx=ix,wx=ox,Tx=ux,Ex=fx;function Dx({children:e}){return(0,R.jsx)(Sx,{delayDuration:250,children:e})}var Ox=`z-50 max-w-[280px] rounded-[8px] border border-rule bg-surface px-[10px] py-[7px] text-[12.5px] leading-[1.35] text-ink shadow-pop outline-none data-[state=delayed-open]:animate-[q-pop_120ms_ease-out] data-[state=closed]:animate-[q-pop-out_100ms_ease-in_forwards]`;function kx({content:e,children:t,side:n=`top`,align:r=`center`,className:i}){return(0,R.jsxs)(Cx,{children:[(0,R.jsx)(wx,{asChild:!0,children:t}),(0,R.jsx)(Tx,{children:(0,R.jsx)(Ex,{side:n,align:r,sideOffset:6,collisionPadding:12,className:J(Ox,i),children:e})})]})}function Ax(){window.dispatchEvent(new CustomEvent(`design:palette`))}var jx=av===`⌘`?`⌘K`:`Ctrl K`;function Mx({width:e=240,label:t=`Search and jump`,compact:n}){if(n)return(0,R.jsx)(kx,{content:(0,R.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[t,` `,(0,R.jsx)(S_,{children:jx})]}),children:(0,R.jsx)(`button`,{type:`button`,onClick:Ax,"aria-label":t,className:`inline-flex h-ctrl w-ctrl shrink-0 cursor-pointer items-center justify-center rounded-[6px] border border-rule bg-soft text-muted transition-colors hover:border-rule-strong`,children:(0,R.jsx)(X,{name:`search`,size:15})})});let r=n===!1;return(0,R.jsxs)(`button`,{type:`button`,onClick:Ax,style:{width:e},"aria-label":t,className:J(`flex h-ctrl min-w-0 cursor-pointer items-center gap-2 rounded-[6px] border border-rule bg-soft pr-1.5 pl-3 text-ctrl text-muted transition-colors hover:border-rule-strong`,r?`shrink-0`:`shrink max-lg:w-auto! max-md:w-ctrl! max-md:justify-center max-md:border-0! max-md:bg-transparent! max-md:p-0!`),children:[(0,R.jsx)(X,{name:`search`,size:15}),(0,R.jsx)(`span`,{className:J(`min-w-0 grow truncate text-left`,!r&&`max-lg:hidden`),children:t}),(0,R.jsx)(`span`,{className:J(`flex`,!r&&`max-md:hidden`),children:(0,R.jsx)(S_,{children:jx})})]})}var Nx=Object.defineProperty,Px=(e,t)=>Nx(e,`name`,{value:t,configurable:!0});function Fx(e){let t=e+`CollectionProvider`,[n,r]=sp(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=Px(e=>{let{scope:t,children:n}=e,r=v.useRef(null),a=v.useRef(new Map).current;return(0,R.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=jp(s),l=v.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=rp(t,a(s,n).collectionRef);return(0,R.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=jp(u),p=v.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=v.useRef(null),s=rp(t,o),c=a(u,n);return v.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,R.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return v.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return Px(m,`useCollection`),[{Provider:o,Slot:l,ItemSlot:p},m,r]}Px(Fx,`createCollection`);var Ix=new WeakMap,Lx=class e extends Map{static{Px(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],Ix.set(this,!0)}set(e,t){return Ix.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=Bx(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}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);return r===-1?this:this.insert(r,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);return r===-1?this:this.insert(r+1,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=Rx(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=Rx(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return Rx(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=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){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,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}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 Rx(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=zx(e,t);return n===-1?void 0:e[n]}Px(Rx,`at`);function zx(e,t){let n=e.length,r=Bx(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}Px(zx,`toSafeIndex`);function Bx(e){return e!==e||e===0?0:Math.trunc(e)}Px(Bx,`toSafeInteger`);function Vx(e){let t=e+`CollectionProvider`,[n,r]=sp(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new Lx,setItemMap:Px(()=>void 0,`setItemMap`)}),o=Px(({state:e,...t})=>e?(0,R.jsx)(c,{...t,state:e}):(0,R.jsx)(s,{...t}),`CollectionProvider`);o.displayName=t;let s=Px(e=>{let t=h();return(0,R.jsx)(c,{...e,state:t})},`CollectionInit`);s.displayName=t+`Init`;let c=Px(e=>{let{scope:t,children:n,state:r}=e,a=v.useRef(null),[o,s]=v.useState(null),c=rp(a,s),[l,u]=r;return v.useEffect(()=>{if(!o)return;let e=Gx(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,R.jsx)(i,{scope:t,itemMap:l,setItemMap:u,collectionRef:c,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);c.displayName=t+`Impl`;let l=e+`CollectionSlot`,u=jp(l),d=v.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=rp(t,a(l,n).collectionRef);return(0,R.jsx)(u,{ref:i,children:r})});d.displayName=l;let f=e+`CollectionItemSlot`,p=jp(f),m=v.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=v.useRef(null),[s,c]=v.useState(null),l=rp(t,o,c),{setItemMap:u}=a(f,n),d=v.useRef(i);Hx(d.current,i)||(d.current=i);let m=d.current;return v.useEffect(()=>{let e=m;return u(t=>s?t.has(s)?t.set(s,{...e,element:s}).toSorted(Wx):(t.set(s,{...e,element:s}),t.toSorted(Wx)):t),()=>{u(e=>!s||!e.has(s)?e:(e.delete(s),new Lx(e)))}},[s,m,u]),(0,R.jsx)(p,{"data-radix-collection-item":``,ref:l,children:r})});m.displayName=f;function h(){return v.useState(new Lx)}Px(h,`useInitCollection`);function g(t){let{itemMap:n}=a(e+`CollectionConsumer`,t);return n}return Px(g,`useCollection`),[{Provider:o,Slot:d,ItemSlot:m},{createCollectionScope:r,useCollection:g,useInitCollection:h}]}Px(Vx,`createCollection`);function Hx(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}Px(Hx,`shallowEqual`);function Ux(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Px(Ux,`isElementPreceding`);function Wx(e,t){return!e[1].element||!t[1].element?0:Ux(e[1].element,t[1].element)?-1:1}Px(Wx,`sortByDocumentPosition`);function Gx(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}Px(Gx,`getChildListObserver`);var Kx=Object.defineProperty,qx=(e,t)=>Kx(e,`name`,{value:t,configurable:!0}),Jx=v.createContext(void 0);function Yx(e){let t=v.useContext(Jx);return e||t||`ltr`}qx(Yx,`useDirection`);var Xx=Object.defineProperty,Zx=(e,t)=>Xx(e,`name`,{value:t,configurable:!0}),Qx=!1;function $x(){let[e,t]=v.useState(Qx);return v.useEffect(()=>{Qx||(Qx=!0,t(!0))},[]),e}Zx($x,`useIsHydrated`);var eS=v.useSyncExternalStore;function tS(){return()=>{}}Zx(tS,`subscribe`);function nS(){return eS(tS,()=>!0,()=>!1)}Zx(nS,`useIsHydratedModern`);var rS=typeof eS==`function`?nS:$x,iS=Object.defineProperty,aS=(e,t)=>iS(e,`name`,{value:t,configurable:!0}),oS=`rovingFocusGroup.onEntryFocus`,sS={bubbles:!1,cancelable:!0},cS=`RovingFocusGroup`,[lS,uS,dS]=Fx(cS),[fS,pS]=sp(cS,[dS]),[mS,hS]=fS(cS),gS=v.forwardRef(aS(function(e,t){return(0,R.jsx)(lS.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,R.jsx)(lS.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,R.jsx)(_S,{...e,ref:t})})})},`RovingFocusGroup`)),_S=v.forwardRef(aS(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=v.useRef(null),p=rp(t,f),m=Yx(a),[h,g]=Cp({prop:o,defaultProp:s??null,onChange:c,caller:cS}),[_,y]=v.useState(!1),b=Xp(l),x=uS(n),S=v.useRef(!1),[C,w]=v.useState(0);return v.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(oS,b),()=>e.removeEventListener(oS,b)},[b]),(0,R.jsx)(mS,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:v.useCallback(e=>g(e),[g]),onItemShiftTab:v.useCallback(()=>y(!0),[]),onFocusableItemAdd:v.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:v.useCallback(()=>w(e=>e-1),[]),children:(0,R.jsx)(Kp.div,{tabIndex:_||C===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:q(e.onMouseDown,()=>{S.current=!0}),onFocus:q(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(oS,sS);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);CS([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}S.current=!1}),onBlur:q(e.onBlur,()=>y(!1))})})},`RovingFocusGroupImpl`)),vS=`RovingFocusGroupItem`,yS=v.forwardRef(aS(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=mp(),l=a||c,u=hS(vS,n),d=u.currentTabStopId===l,f=uS(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u,g=rS();return lp(()=>{if(g&&r)return p(),()=>m()},[g,r,p,m]),v.useEffect(()=>{if(!g&&r)return p(),()=>m()},[g,r,p,m]),(0,R.jsx)(lS.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,R.jsx)(Kp.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:q(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:q(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:q(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=SS(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?wS(n,r+1):n.slice(r+1)}setTimeout(()=>CS(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})},`RovingFocusGroupItem`)),bS={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function xS(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}aS(xS,`getDirectionAwareKey`);function SS(e,t,n){let r=xS(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return bS[r]}aS(SS,`getFocusIntent`);function CS(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}aS(CS,`focusFirst`);function wS(e,t){return e.map((n,r)=>e[(t+r)%e.length])}aS(wS,`wrapArray`);var TS=gS,ES=yS,DS=Object.defineProperty,OS=(e,t)=>DS(e,`name`,{value:t,configurable:!0}),kS=[`Enter`,` `],AS=[`ArrowDown`,`PageUp`,`Home`],jS=[`ArrowUp`,`PageDown`,`End`],MS=[...AS,...jS];[...kS],[...kS];var NS=`Menu`,[PS,FS,IS]=Fx(NS),[LS,RS]=sp(NS,[IS,wb,pS]),zS=wb(),BS=pS(),[VS,HS]=LS(NS),[US,WS]=LS(NS),GS=OS(e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=zS(t),[c,l]=v.useState(null),u=v.useRef(!1),d=Xp(a),f=Yx(i);return v.useEffect(()=>{let e=OS(()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=OS(()=>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})}},[]),v.useEffect(()=>{if(!n)return;let e=OS(()=>d(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),(0,R.jsx)(Lb,{...s,children:(0,R.jsx)(VS,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,R.jsx)(US,{scope:t,onClose:v.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})},`Menu`),KS=v.forwardRef(OS(function(e,t){let{__scopeMenu:n,...r}=e,i=zS(n);return(0,R.jsx)(Rb,{...i,...r,ref:t})},`MenuAnchor`)),qS=`MenuPortal`,[JS,YS]=LS(qS,{forceMount:void 0}),XS=OS(e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=HS(qS,t);return(0,R.jsx)(JS,{scope:t,forceMount:n,children:(0,R.jsx)(Nm,{present:n||a.open,children:(0,R.jsx)(km,{asChild:!0,container:i,children:r})})})},`MenuPortal`),ZS=`MenuContent`,[QS,$S]=LS(ZS),eC=v.forwardRef(OS(function(e,t){let n=YS(ZS,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=HS(ZS,e.__scopeMenu),o=WS(ZS,e.__scopeMenu);return(0,R.jsx)(PS.Provider,{scope:e.__scopeMenu,children:(0,R.jsx)(Nm,{present:r||a.open,children:(0,R.jsx)(PS.Slot,{scope:e.__scopeMenu,children:o.modal?(0,R.jsx)(tC,{...i,ref:t}):(0,R.jsx)(nC,{...i,ref:t})})})})},`MenuContent`)),tC=v.forwardRef(OS(function(e,t){let n=HS(ZS,e.__scopeMenu),r=v.useRef(null),i=rp(t,r);return v.useEffect(()=>{let e=r.current;if(e)return cg(e)},[]),(0,R.jsx)(iC,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:q(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentModal`)),nC=v.forwardRef(OS(function(e,t){let n=HS(ZS,e.__scopeMenu);return(0,R.jsx)(iC,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentNonModal`)),rC=jp(`MenuContent.ScrollLock`),iC=v.forwardRef(OS(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=HS(ZS,n),_=WS(ZS,n),y=zS(n),b=BS(n),x=FS(n),[S,C]=v.useState(null),w=v.useRef(null),T=rp(t,w,g.onContentChange),E=v.useRef(0),D=v.useRef(``),O=v.useRef(0),k=v.useRef(null),A=v.useRef(`right`),j=v.useRef(0),M=m?$h:v.Fragment,ee=m?{as:rC,allowPinchZoom:!0}:void 0,N=OS(e=>{let t=D.current+e,n=x().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=SC(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;OS((function e(t){D.current=t,window.clearTimeout(E.current),t!==``&&(E.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);v.useEffect(()=>()=>window.clearTimeout(E.current),[]),Wm();let P=v.useCallback(e=>A.current===k.current?.side&&wC(e,k.current?.area),[]);return(0,R.jsx)(QS,{scope:n,searchRef:D,onItemEnter:v.useCallback(e=>{P(e)&&e.preventDefault()},[P]),onItemLeave:v.useCallback(e=>{P(e)||(w.current?.focus(),C(null))},[P]),onTriggerLeave:v.useCallback(e=>{P(e)&&e.preventDefault()},[P]),pointerGraceTimerRef:O,onPointerGraceIntentChange:v.useCallback(e=>{k.current=e},[]),children:(0,R.jsx)(M,{...ee,children:(0,R.jsx)(gm,{asChild:!0,trapped:i,onMountAutoFocus:q(a,e=>{e.preventDefault(),w.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,R.jsx)(im,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,R.jsx)(TS,{asChild:!0,...b,dir:_.dir,orientation:`vertical`,loop:r,currentTabStopId:S,onCurrentTabStopIdChange:C,onEntryFocus:q(c,e=>{_.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,R.jsx)(zb,{role:`menu`,"aria-orientation":`vertical`,"data-state":_C(g.open),"data-radix-menu-content":``,dir:_.dir,...y,...h,ref:T,style:{outline:`none`,...h.style},onKeyDown:q(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&&N(e.key));let i=w.current;if(e.target!==i||!MS.includes(e.key))return;e.preventDefault();let a=x().filter(e=>!e.disabled).map(e=>e.ref.current);jS.includes(e.key)&&a.reverse(),bC(a)}),onBlur:q(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(E.current),D.current=``)}),onPointerMove:q(e.onPointerMove,TC(e=>{let t=e.target,n=j.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>j.current?`right`:`left`;A.current=t,j.current=e.clientX}}))})})})})})})},`MenuContentImpl`)),aC=v.forwardRef(OS(function(e,t){let{__scopeMenu:n,...r}=e;return(0,R.jsx)(Kp.div,{...r,ref:t})},`MenuLabel`)),oC=`MenuItem`,sC=`menu.itemSelect`,cC=v.forwardRef(OS(function(e,t){let{disabled:n=!1,onSelect:r,...i}=e,a=v.useRef(null),o=WS(oC,e.__scopeMenu),s=$S(oC,e.__scopeMenu),c=rp(t,a),l=v.useRef(!1),u=OS(()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(sC,{bubbles:!0,cancelable:!0});e.addEventListener(sC,e=>r?.(e),{once:!0}),qp(e,t),t.defaultPrevented?l.current=!1:o.onClose()}},`handleSelect`);return(0,R.jsx)(lC,{...i,ref:c,disabled:n,onClick:q(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:q(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:q(e.onKeyDown,e=>{n||e.target!==e.currentTarget||(s.searchRef.current===``||e.key!==` `)&&kS.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),lC=v.forwardRef(OS(function(e,t){let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=$S(oC,n),s=BS(n),c=v.useRef(null),l=rp(t,c),[u,d]=v.useState(!1),[f,p]=v.useState(``);return v.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,R.jsx)(PS.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,R.jsx)(ES,{asChild:!0,...s,focusable:!r,children:(0,R.jsx)(Kp.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:q(e.onPointerMove,TC(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:q(e.onPointerLeave,TC(e=>o.onItemLeave(e))),onFocus:q(e.onFocus,()=>d(!0)),onBlur:q(e.onBlur,()=>d(!1))})})})},`MenuItemImpl`)),[uC,dC]=LS(`MenuRadioGroup`,{value:void 0,onValueChange:OS(()=>{},`onValueChange`)}),[fC,pC]=LS(`MenuItemIndicator`,{checked:!1}),mC=v.forwardRef(OS(function(e,t){let{__scopeMenu:n,...r}=e;return(0,R.jsx)(Kp.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})},`MenuSeparator`)),[hC,gC]=LS(`MenuSub`);function _C(e){return e?`open`:`closed`}OS(_C,`getOpenState`);function vC(e){return e===`indeterminate`}OS(vC,`isIndeterminate`);function yC(e){return vC(e)?`indeterminate`:e?`checked`:`unchecked`}OS(yC,`getCheckedState`);function bC(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}OS(bC,`focusFirst`);function xC(e,t){return e.map((n,r)=>e[(t+r)%e.length])}OS(xC,`wrapArray`);function SC(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=xC(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}OS(SC,`getNextMatch`);function CC(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}OS(CC,`isPointInPolygon`);function wC(e,t){return t?CC({x:e.clientX,y:e.clientY},t):!1}OS(wC,`isPointerInGraceArea`);function TC(e){return t=>t.pointerType===`mouse`?e(t):void 0}OS(TC,`whenMouse`);var EC=GS,DC=KS,OC=XS,kC=eC,AC=aC,jC=cC,MC=mC,NC=Object.defineProperty,PC=(e,t)=>NC(e,`name`,{value:t,configurable:!0}),FC=`DropdownMenu`,[IC,LC]=sp(FC,[RS]),RC=RS(),[zC,BC]=IC(FC),VC=PC(e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=RC(t),l=v.useRef(null),[u,d]=Cp({prop:i,defaultProp:a??!1,onChange:o,caller:FC});return(0,R.jsx)(zC,{scope:t,triggerId:mp(),triggerRef:l,contentId:mp(),open:u,onOpenChange:d,onOpenToggle:v.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,R.jsx)(EC,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})},`DropdownMenu`),HC=`DropdownMenuTrigger`,UC=v.forwardRef(PC(function(e,t){let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=BC(HC,n),o=RC(n),s=rp(t,a.triggerRef);return(0,R.jsx)(DC,{asChild:!0,...o,children:(0,R.jsx)(Kp.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:q(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:q(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),WC=PC(e=>{let{__scopeDropdownMenu:t,...n}=e,r=RC(t);return(0,R.jsx)(OC,{...r,...n})},`DropdownMenuPortal`),GC=`DropdownMenuContent`,KC=v.forwardRef(PC(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=BC(GC,n),a=RC(n),o=v.useRef(!1);return(0,R.jsx)(kC,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:q(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:q(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`)),qC=v.forwardRef(PC(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=RC(n);return(0,R.jsx)(AC,{...i,...r,ref:t})},`DropdownMenuLabel`)),JC=v.forwardRef(PC(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=RC(n);return(0,R.jsx)(jC,{...i,...r,ref:t})},`DropdownMenuItem`)),YC=v.forwardRef(PC(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=RC(n);return(0,R.jsx)(MC,{...i,...r,ref:t})},`DropdownMenuSeparator`)),XC=VC,ZC=UC,QC=WC,$C=KC,ew=qC,tw=JC,nw=YC,rw=`z-50 overflow-hidden rounded-[8px] border border-rule bg-surface shadow-pop outline-none py-1 data-[state=open]:animate-[q-pop_120ms_ease-out] data-[state=closed]:animate-[q-pop-out_100ms_ease-in_forwards]`,iw=null;typeof document<`u`&&document.addEventListener(`pointerover`,e=>iw=e.target,{capture:!0,passive:!0});function aw(){let e=document.activeElement;return e instanceof HTMLIFrameElement&&iw!==e}function ow({trigger:e,children:t,width:n=220,align:r=`start`,side:i=`bottom`,sideOffset:a=6,open:o,onOpenChange:s}){let[c,l]=(0,v.useState)(!1);return(0,R.jsxs)(XC,{open:o??c,onOpenChange:e=>{(e||!aw())&&(l(e),s?.(e))},modal:!1,children:[(0,R.jsx)(ZC,{asChild:!0,children:e}),(0,R.jsx)(QC,{children:(0,R.jsx)($C,{align:r,side:i,sideOffset:a,collisionPadding:12,onFocusOutside:sw,className:rw,style:{width:n,maxWidth:`calc(100vw - 24px)`},children:t})})]})}function sw(e){aw()&&e.preventDefault()}var cw=(e,t)=>J(`flex min-h-9 w-full cursor-pointer items-center gap-2.5 border-0 px-3 py-1.5 text-left text-[13.5px] outline-none select-none`,`data-[highlighted]:bg-soft data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50`,t?`bg-soft`:`bg-transparent`,e?`text-danger-text`:`text-ink`);function lw({children:e,onSelect:t,danger:n,active:r,disabled:i,hint:a,className:o}){return(0,R.jsxs)(tw,{disabled:i,onSelect:t,className:J(cw(n,r),o),children:[e,a?(0,R.jsx)(`span`,{className:`ml-auto pl-3 text-[12px] text-muted`,children:a}):null]})}function uw(){return(0,R.jsx)(nw,{className:`my-1 h-px bg-rule`})}function dw({children:e}){return(0,R.jsx)(ew,{className:`px-3 pt-1.5 pb-1 text-[12px] text-muted`,children:e})}var fw=[{value:`system`,label:`System`,icon:`monitor`},{value:`light`,label:`Light`,icon:`sun`},{value:`dark`,label:`Dark`,icon:`moon`}];function pw(){let e=y_(),t=b_();return(0,R.jsxs)(ow,{align:`end`,width:180,trigger:(0,R.jsx)(N_,{icon:t===`dark`?`moon`:`sun`,label:`Appearance`}),children:[(0,R.jsx)(dw,{children:`Appearance`}),fw.map(t=>(0,R.jsxs)(lw,{active:e===t.value,onSelect:()=>v_(t.value),children:[(0,R.jsx)(X,{name:t.icon,size:15,className:`text-ink2`}),t.label,e===t.value?(0,R.jsx)(X,{name:`check`,size:15,className:`ml-auto text-ink2`}):null]},t.value))]})}function mw({size:e=24}){return(0,R.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 32 32`,"aria-hidden":`true`,className:`shrink-0`,children:[(0,R.jsx)(`rect`,{width:`32`,height:`32`,rx:`7`,className:`fill-primary`}),(0,R.jsx)(`rect`,{x:`7`,y:`7`,width:`8`,height:`11`,rx:`1.5`,className:`fill-primary-ink`}),(0,R.jsx)(`rect`,{x:`17`,y:`7`,width:`8`,height:`6`,rx:`1.5`,fill:`#f0a040`}),(0,R.jsx)(`rect`,{x:`17`,y:`15`,width:`8`,height:`10`,rx:`1.5`,className:`fill-primary-ink`}),(0,R.jsx)(`rect`,{x:`7`,y:`20`,width:`8`,height:`5`,rx:`1.5`,className:`fill-primary-ink`})]})}function hw({name:e,version:t}){return(0,R.jsxs)(ye,{href:`/`,title:t?`foss-design ${t}`:void 0,className:`flex min-w-0 items-center gap-2 text-[14px] font-semibold text-ink no-underline`,children:[(0,R.jsx)(mw,{}),(0,R.jsx)(`span`,{className:`truncate`,children:e??`Design`})]})}function gw({children:e,className:t}){return(0,R.jsx)(`header`,{className:J(`sticky top-0 z-30 flex h-[52px] shrink-0 items-center gap-3 border-b border-rule bg-surface px-4`,t),children:e})}var _w=(0,v.createContext)(!1).Provider;function vw(e,t,n){let[r,i]=(0,v.useState)(!1),a=(0,v.useRef)(0);return(0,v.useLayoutEffect)(()=>{let n=e.current,r=t.current;if(!n||!r)return;let o=()=>{let e=[...n.querySelectorAll(`[data-fit]`)].reduce((e,t)=>e+Math.max(0,t.scrollWidth-t.clientWidth),0),t=r.getBoundingClientRect().left-n.getBoundingClientRect().right;i(n=>n?t-e<a.current-r.offsetWidth+16:(a.current=r.offsetWidth,e>0))};o();let s=new ResizeObserver(o);return s.observe(n.parentElement??n),s.observe(r),()=>s.disconnect()},n),r}var yw=[{to:`/`,label:`Canvases`,match:e=>e===`/`||e.startsWith(`/c/`)},{to:`/system`,label:`Design system`,match:e=>e.startsWith(`/system`)}];function bw({location:e}){let t=(0,v.useRef)(null),n=yw.findIndex(t=>t.match(e)),[r,i]=(0,v.useState)(null);return(0,v.useLayoutEffect)(()=>{let e=t.current;if(!e)return;let r=()=>{let t=e.children[n];if(!t?.offsetWidth){i(null);return}let r=t.offsetLeft+10,a=t.offsetWidth-20;i(e=>e?.tab===n&&e.x===r&&e.width===a?e:{tab:n,x:r,width:a,slide:e!==null&&e.tab!==n})};r();let a=new ResizeObserver(r);return a.observe(e),()=>a.disconnect()},[n]),(0,R.jsxs)(`nav`,{ref:t,className:`relative flex h-[52px] items-stretch gap-0.5 max-md:hidden`,children:[yw.map((e,t)=>(0,R.jsx)(ye,{href:e.to,"aria-current":t===n?`page`:void 0,className:J(`flex items-center px-2.5 text-[14px] no-underline transition-colors`,t===n?`font-medium text-ink`:`text-ink2 hover:text-ink`),children:e.label},e.to)),r?(0,R.jsx)(Kf.span,{"aria-hidden":!0,className:`pointer-events-none absolute bottom-0 left-0 h-[2px] bg-action`,initial:!1,animate:{x:r.x,width:r.width},transition:r.slide?{type:`spring`,stiffness:520,damping:42}:{duration:0}}):null]})}function xw(){let e=r_().data,{slots:t}=e_(),[n]=I();return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(gw,{children:[t.barStart,(0,R.jsxs)(`div`,{className:`flex min-w-0 items-center gap-6`,children:[t.brand??(0,R.jsx)(hw,{name:e?.name,version:e?.version}),(0,R.jsx)(bw,{location:n})]}),(0,R.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,R.jsx)(Mx,{}),(0,R.jsx)(`span`,{className:J(`flex`,t.barEnd?`max-md:hidden`:void 0),children:(0,R.jsx)(pw,{})}),t.barEnd]})]}),(0,R.jsx)(Sw,{location:n}),t.belowBar?(0,R.jsx)(`div`,{className:`shrink-0`,children:t.belowBar}):null]})}function Sw({location:e}){return(0,R.jsx)(`nav`,{className:`sticky top-[52px] z-30 hidden h-10 shrink-0 items-stretch border-b border-rule bg-surface px-2 max-md:flex`,children:yw.map(t=>{let n=t.match(e);return(0,R.jsxs)(ye,{href:t.to,"aria-current":n?`page`:void 0,className:J(`relative flex grow items-center justify-center text-[13.5px] no-underline`,n?`font-medium text-ink`:`text-ink2`),children:[t.label,n?(0,R.jsx)(`span`,{"aria-hidden":!0,className:`absolute inset-x-6 bottom-0 h-[2px] rounded-full bg-action`}):null]},t.to)})})}var Cw=window.matchMedia(`(max-width: 767px)`),ww=e=>(Cw.addEventListener(`change`,e),()=>Cw.removeEventListener(`change`,e));function Tw(){return(0,v.useSyncExternalStore)(ww,()=>Cw.matches)}var Ew=Object.defineProperty,Dw=(e,t)=>Ew(e,`name`,{value:t,configurable:!0}),Ow=`Popover`,[kw,Aw]=sp(Ow,[wb]),jw=wb(),[Mw,Nw]=kw(Ow),Pw=Dw(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=jw(t),c=v.useRef(null),[l,u]=v.useState(!1),[d,f]=Cp({prop:r,defaultProp:i??!1,onChange:a,caller:Ow});return(0,R.jsx)(Lb,{...s,children:(0,R.jsx)(Mw,{scope:t,contentId:mp(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:v.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:v.useCallback(()=>u(!0),[]),onCustomAnchorRemove:v.useCallback(()=>u(!1),[]),modal:o,children:n})})},`Popover`),Fw=`PopoverTrigger`,Iw=v.forwardRef(Dw(function(e,t){let{__scopePopover:n,...r}=e,i=Nw(Fw,n),a=jw(n),o=rp(t,i.triggerRef),s=(0,R.jsx)(Kp.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":qw(i.open),...r,ref:o,onClick:q(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,R.jsx)(Rb,{asChild:!0,...a,children:s})},`PopoverTrigger`)),Lw=`PopoverPortal`,[Rw,zw]=kw(Lw,{forceMount:void 0}),Bw=Dw(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=Nw(Lw,t);return(0,R.jsx)(Rw,{scope:t,forceMount:n,children:(0,R.jsx)(Nm,{present:n||a.open,children:(0,R.jsx)(km,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),Vw=`PopoverContent`,Hw=v.forwardRef(Dw(function(e,t){let n=zw(Vw,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=Nw(Vw,e.__scopePopover);return(0,R.jsx)(Nm,{present:r||a.open,children:a.modal?(0,R.jsx)(Ww,{...i,ref:t}):(0,R.jsx)(Gw,{...i,ref:t})})},`PopoverContent`)),Uw=jp(`PopoverContent.RemoveScroll`),Ww=v.forwardRef(Dw(function(e,t){let n=Nw(Vw,e.__scopePopover),r=v.useRef(null),i=rp(t,r),a=v.useRef(!1);return v.useEffect(()=>{let e=r.current;if(e)return cg(e)},[]),(0,R.jsx)($h,{as:Uw,allowPinchZoom:!0,children:(0,R.jsx)(Kw,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:q(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:q(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:q(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),Gw=v.forwardRef(Dw(function(e,t){let n=Nw(Vw,e.__scopePopover),r=v.useRef(!1),i=v.useRef(!1);return(0,R.jsx)(Kw,{...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`)),Kw=v.forwardRef(Dw(function(e,t){let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=Nw(Vw,n),p=jw(n);return Wm(),(0,R.jsx)(gm,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,R.jsx)(im,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,R.jsx)(zb,{"data-state":qw(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.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 qw(e){return e?`open`:`closed`}Dw(qw,`getState`);var Jw=Pw,Yw=Iw,Xw=Bw,Zw=Hw,Qw=[`ink`,`red`,`blue`,`green`],$w=[`pen`,`arrow`,`rect`,`text`],eT=2e4,tT=12e3,nT=2e3,rT=1e5,iT=/^(board|markup):[a-z0-9][a-z0-9_-]{0,127}$/i,aT=/^[a-z0-9_-]{1,40}$/i,oT=e=>`board:${e}`,sT=e=>`markup:${e}`,cT=e=>typeof e==`string`&&iT.test(e),lT=()=>({strokes:[],erased:[]});function uT(){let e=crypto.getRandomValues(new Uint8Array(12));return Array.from(e,e=>(e%36).toString(36)).join(``)}var dT=e=>e&&typeof e==`object`&&!Array.isArray(e)?e:null;function fT(e){let t=dT(e);if(!t)return null;let{id:n,kind:r,ink:i,size:a,points:o,text:s}=t;if(typeof n!=`string`||!aT.test(n)||!$w.includes(r)||!Qw.includes(i)||typeof a!=`number`||!(a>=.5&&a<=400)||!Array.isArray(o)||o.length>tT||!o.every(e=>typeof e==`number`&&Number.isFinite(e)&&Math.abs(e)<=rT)||!(r===`pen`?o.length>=3&&o.length%3==0:o.length===(r===`text`?2:4))||r===`text`&&(typeof s!=`string`||!s.trim()||s.length>nT))return null;let c={id:n,kind:r,ink:i,size:a,points:o};return r===`text`&&(c.text=s),c}function pT(e,t){return!Array.isArray(e)||e.length>t?null:e.every(e=>typeof e==`string`&&aT.test(e))?e:null}function mT(e){let t=dT(e);if(!t)return null;let n={};if(t.add!==void 0){if(!Array.isArray(t.add)||t.add.length>4e3)return null;let e=t.add.map(fT);if(e.some(e=>!e))return null;n.add=e}if(t.erase!==void 0){let e=pT(t.erase,eT);if(!e)return null;n.erase=e}return n}function hT(e){let t=dT(e);if(!t)return null;let n=pT(t.erased??[],eT);if(!n||!Array.isArray(t.strokes)||t.strokes.length>4e3)return null;let r=t.strokes.map(fT);return r.some(e=>!e)?null:{strokes:r,erased:n}}function gT(e){let t={};for(let[n,r]of Object.entries(dT(e)??{})){let e=cT(n)?hT(r):null;e&&(t[n]=e)}return t}function _T(e,t){let n=new Set(e.erased),r=!1,i=[];for(let e of t.erase??[])n.has(e)||(n.add(e),i.push(e),r=!0);let a=i.length?e.strokes.filter(e=>!n.has(e.id)):[...e.strokes],o=new Set(a.map(e=>e.id));for(let e of t.add??[])n.has(e.id)||o.has(e.id)||a.length>=4e3||(a.push(e),o.add(e.id),r=!0);if(!r)return null;let s=[...e.erased,...i];return{strokes:a,erased:s.length>eT?s.slice(-2e4):s}}function vT(e,t){let n=new Set(t.erased),r=new Set(t.strokes.map(e=>e.id)),i=e.strokes.filter(e=>!r.has(e.id)&&!n.has(e.id)),a=e.erased.filter(e=>!n.has(e));return!i.length&&!a.length?null:{...i.length?{add:i}:{},...a.length?{erase:a}:{}}}function yT(e){return!e||e.strokes.length===0}var bT=1.25;function xT(e){let t=(e.text??``).split(`
58
+ `),n=Math.max(...t.map(e=>e.length),1);return{x:e.points[0],y:e.points[1],w:n*e.size*.56,h:t.length*e.size*bT}}function ST(e){if(e.kind===`text`)return xT(e);let t=e.kind===`pen`?3:2,n=e.kind===`arrow`?Math.max(10,e.size*4.5):e.size,r=1/0,i=1/0,a=-1/0,o=-1/0;for(let n=0;n+1<e.points.length;n+=t)r=Math.min(r,e.points[n]),i=Math.min(i,e.points[n+1]),a=Math.max(a,e.points[n]),o=Math.max(o,e.points[n+1]);return{x:r-n,y:i-n,w:a-r+n*2,h:o-i+n*2}}var CT=(e,t)=>{let n=Math.min(e.x,t.x),r=Math.min(e.y,t.y);return{x:n,y:r,w:Math.max(e.x+e.w,t.x+t.w)-n,h:Math.max(e.y+e.h,t.y+t.h)-r}};function wT(e){return e.length?e.map(ST).reduce(CT):null}function TT(e){let t=e.map(e=>({box:ST(e),strokes:[e]})),n=(e,t)=>e.x-240<t.x+t.w&&t.x-240<e.x+e.w&&e.y-240<t.y+t.h&&t.y-240<e.y+e.h;for(let e=!0;e;){e=!1;let r=[];for(let i of t){let t=r.find(e=>n(e.box,i.box));t?(t.box=CT(t.box,i.box),t.strokes.push(...i.strokes),e=!0):r.push({box:i.box,strokes:[...i.strokes]})}t=r}let r=new Map(e.map((e,t)=>[e.id,t]));for(let e of t)e.strokes.sort((e,t)=>r.get(e.id)-r.get(t.id));t.sort((e,t)=>e.box.y-t.box.y);let i=[];for(let e of t){let t=i.at(-1);t&&e.box.y<t[0].box.y+t[0].box.h/2?t.push(e):i.push([e])}return i.flatMap(e=>e.sort((e,t)=>e.box.x-t.box.x))}function ET(e){let t=dT(e);if(!t)return null;let{id:n,kind:r,ink:i,size:a,text:o,at:s,points:c}=t;if(typeof n!=`string`||!aT.test(n)||!$w.includes(r)||!Qw.includes(i)||typeof a!=`number`||!(a>=.5&&a<=400)||typeof s!=`number`||!Number.isInteger(s)||s<0||s>tT||!Array.isArray(c)||c.length>tT||!c.every(e=>typeof e==`number`&&Number.isFinite(e)&&Math.abs(e)<=rT)||o!==void 0&&(typeof o!=`string`||o.length>nT))return null;let l={id:n,kind:r,ink:i,size:a,at:s,points:c};return typeof o==`string`&&(l.text=o),l}function DT(e){if(e.length>262144)return null;try{return dT(JSON.parse(e))}catch{return null}}function OT(e){let t=DT(e);if(!t)return null;let n=typeof t.peer==`string`?t.peer:``;switch(t.type){case`hello`:return{type:`hello`,peer:n,canDraw:t.canDraw===!0,drawings:gT(t.drawings)};case`ops`:{let e=cT(t.key)?mT(t):null;return e?{type:`ops`,key:t.key,...e,peer:n}:null}case`ack`:return typeof t.id==`number`?{type:`ack`,id:t.id}:null;case`doc`:{let e=cT(t.key)?hT(t.drawing):null;return e?{type:`doc`,key:t.key,drawing:e}:null}case`live`:{let e=cT(t.key)?ET(t.stroke):null;if(!e)return null;let r=typeof t.name==`string`?t.name.slice(0,80):void 0;return{type:`live`,key:t.key,stroke:e,peer:n,...r?{name:r}:{}}}case`live-end`:return cT(t.key)&&typeof t.id==`string`?{type:`live-end`,key:t.key,id:t.id,peer:n}:null;case`gone`:return{type:`gone`,peer:n};case`error`:return{type:`error`,message:typeof t.message==`string`?t.message.slice(0,500):`error`}}return null}var kT=new d_([]),AT=1;function jT(e,t,n=`ok`){let r=AT++;kT.set(i=>[...i.slice(-2),{id:r,title:e,text:t,tone:n}]),setTimeout(()=>kT.set(e=>e.filter(e=>e.id!==r)),n===`error`?4200:2200)}var MT=new d_([]),NT=1;function PT(){let[e]=(0,v.useState)(()=>NT++);(0,v.useEffect)(()=>(MT.set(t=>[...t,e]),()=>MT.set(t=>t.filter(t=>t!==e))),[e]);let t=Y(MT,t=>t[0]===e),n=Y(kT);return t?(0,R.jsx)(`div`,{className:`pointer-events-none fixed bottom-5 left-1/2 z-[60] flex -translate-x-1/2 flex-col items-center gap-2`,children:(0,R.jsx)(td,{mode:`popLayout`,children:n.map(e=>(0,R.jsxs)(Kf.div,{layout:!0,initial:{opacity:0,y:8,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:4,transition:{duration:.12}},transition:{type:`spring`,stiffness:520,damping:40},className:`flex max-w-[min(420px,calc(100vw-32px))] min-w-0 items-center gap-2.5 rounded-[8px] border border-rule bg-surface px-3 py-2 text-[13px] text-ink shadow-pop`,children:[e.tone===`error`?(0,R.jsx)(X,{name:`alert`,size:15,className:`text-danger-text`}):e.tone===`info`?(0,R.jsx)(X,{name:`info`,size:15,className:`text-muted`}):(0,R.jsx)(X,{name:`check`,size:15,className:`text-ok-text`}),(0,R.jsx)(`span`,{className:`shrink-0 font-medium whitespace-nowrap`,children:e.title}),e.text?(0,R.jsx)(`span`,{className:`min-w-0 truncate font-mono text-[12px] text-muted`,children:e.text}):null]},e.id))})}):null}async function FT(e,t=`Copied`){try{await navigator.clipboard.writeText(e),jT(t,e.length>64?void 0:e)}catch{jT(`Could not copy`,`The browser blocked clipboard access`,`error`)}}function IT(e){return e.split(`/`).filter(Boolean)}function LT(e){return{pattern:e,segments:IT(e).map(e=>e===`*`?{kind:`splat`}:e.startsWith(`:`)?{kind:`param`,optional:e.endsWith(`?`)}:{kind:`static`,value:e})}}function RT(e){try{return decodeURIComponent(e)}catch{return e}}function zT(e,t){let n=IT(t.split(/[?#]/)[0]??``).map(RT),r=(t,i)=>{if(t===e.segments.length)return i===n.length?0:null;let a=e.segments[t];if(a.kind===`splat`)return 0;if(a.kind===`static`){if(n[i]!==a.value)return null;let e=r(t+1,i+1);return e===null?null:e+4}if(i<n.length){let e=r(t+1,i+1);if(e!==null)return e+2}return a.optional?r(t+1,i):null};return r(0,0)}function BT(e,t){let n=null;for(let r of e)for(let e of r.routes){let i=zT(e,t);i!==null&&(!n||i>n.score)&&(n={score:i,value:r.value})}return n?.value??null}function VT(e,t=`/`){let n=e.trim();if(!n||n.startsWith(`#`)||/^[a-z][a-z0-9+.-]*:/i.test(n)||n.startsWith(`//`))return null;let r=new URL(n,`http://app.invalid${t.replace(/\/:[^/]+\??|\/\*$/g,`/x`)}`);return r.pathname+r.search+r.hash}function HT(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var UT=HT();function WT(e){UT=e}var GT={exec:()=>null};function KT(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function Q(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(JT.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var qT=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),JT={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:KT(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:KT(e=>RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:KT(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:KT(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:KT(e=>RegExp(`^ {0,${e}}(?:</?(?:${lE})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,`i`)),blockquoteBeginRegex:KT(e=>RegExp(`^ {0,${e}}>`))},YT=/^(?:[ \t]*(?:\n|$))+/,XT=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ZT=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,QT=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,$T=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,eE=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,tE=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,nE=Q(tE).replace(/bull/g,eE).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),rE=Q(tE).replace(/bull/g,eE).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),iE=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,aE=/^[^\n]+/,oE=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,sE=Q(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,oE).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),cE=Q(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,eE).getRegex(),lE=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,uE=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,dE=Q(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,uE).replace(`tag`,lE).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),fE=e=>Q(iE).replace(`hr`,QT).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,e).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,lE).getRegex(),pE=fE(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),mE=fE(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),hE={blockquote:Q(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,mE).getRegex(),code:XT,def:sE,fences:ZT,heading:$T,hr:QT,html:dE,lheading:nE,list:cE,newline:YT,paragraph:pE,table:GT,text:aE},gE=Q(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,QT).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,lE).getRegex(),_E={...hE,lheading:rE,table:gE,paragraph:Q(iE).replace(`hr`,QT).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,gE).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,lE).getRegex()},vE={...hE,html:Q(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,uE).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:GT,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Q(iE).replace(`hr`,QT).replace(`heading`,` *#{1,6} *[^
59
+ ]`).replace(`lheading`,nE).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},yE=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,bE=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,xE=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,SE=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,CE=/[\p{P}\p{S}]/u,wE=/[\s\p{P}\p{S}]/u,TE=/[^\s\p{P}\p{S}]/u,EE=Q(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,wE).getRegex(),DE=/[\p{Pi}\p{Ps}"']/u,OE=/(?!~)[\p{P}\p{S}]/u,kE=/(?!~)[\s\p{P}\p{S}]/u,AE=/(?:[^\s\p{P}\p{S}]|~)/u,jE=Q(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,qT?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),ME=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,NE=Q(ME,`u`).replace(/punct/g,CE).getRegex(),PE=Q(ME,`u`).replace(/punct/g,OE).getRegex(),FE=Q(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,DE).replace(/punct/g,CE).getRegex(),IE=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,LE=Q(IE,`gu`).replace(/notPunctSpace/g,TE).replace(/punctSpace/g,wE).replace(/punct/g,CE).getRegex(),RE=Q(IE,`gu`).replace(/notPunctSpace/g,AE).replace(/punctSpace/g,kE).replace(/punct/g,OE).getRegex(),zE=Q(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,TE).replace(/punctSpace/g,wE).replace(/punct/g,CE).getRegex(),BE=Q(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,TE).replace(/punctSpace/g,wE).replace(/punct/g,CE).getRegex(),VE=Q(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,TE).replace(/punctSpace/g,wE).replace(/punct/g,CE).getRegex(),HE=Q(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,CE).getRegex(),UE=Q(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,TE).replace(/punctSpace/g,wE).replace(/punct/g,CE).getRegex(),WE=Q(/\\(punct)/,`gu`).replace(/punct/g,CE).getRegex(),GE=Q(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),KE=Q(uE).replace(`(?:-->|$)`,`-->`).getRegex(),qE=Q(`^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,KE).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),JE=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,YE=Q(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace(`brackets`,JE).getRegex(),XE=Q(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,YE).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ZE=Q(/^!?\[(label)\]\[(ref)\]/).replace(`label`,YE).replace(`ref`,oE).getRegex(),QE=Q(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,oE).getRegex(),$E=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,eD=Q(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace(`brackets`,JE).getRegex(),tD=Q(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,Q(/^!?\[(label)\]\[(ref)\]/).replace(`label`,eD).replace(`ref`,$E).getRegex()).replace(`nolink`,Q(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,$E).getRegex()).getRegex(),nD=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,rD=Q(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),iD={_backpedal:GT,anyPunctuation:WE,autolink:GE,blockSkip:jE,br:xE,code:bE,del:GT,delLDelim:GT,delRDelim:GT,emStrongLDelim:NE,emStrongRDelimAst:LE,emStrongRDelimUnd:BE,escape:yE,link:XE,nolink:QE,punctuation:EE,reflink:ZE,reflinkSearch:tD,tag:qE,text:SE,url:GT},aD={...iD,emStrongLDelim:FE,emStrongRDelimAst:zE,emStrongRDelimUnd:VE,link:Q(/^!?\[(label)\]\((.*?)\)/).replace(`label`,YE).getRegex(),reflink:Q(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,YE).getRegex()},oD={...iD,emStrongRDelimAst:RE,emStrongLDelim:PE,delLDelim:HE,delRDelim:UE,url:Q(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`emailProtocol`,rD).replace(`protocol`,nD).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Q(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace(`protocol`,nD).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},sD={...oD,br:Q(xE).replace(`{2,}`,`*`).getRegex(),text:Q(oD.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},cD={normal:hE,gfm:_E,pedantic:vE},lD={normal:iD,gfm:oD,breaks:sD,pedantic:aD},uD={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},dD=e=>uD[e];function fD(e,t){if(t){if(JT.escapeTest.test(e))return e.replace(JT.escapeReplace,dD)}else if(JT.escapeTestNoEncode.test(e))return e.replace(JT.escapeReplaceNoEncode,dD);return e}function pD(e){return e.replace(JT.numericCharacterReference,(e,t,n)=>{let r=t===void 0?Number.parseInt(n,16):Number.parseInt(t,10);return r===0||r>1114111||r>=55296&&r<=57343?`�`:String.fromCodePoint(r)})}function mD(e){try{e=encodeURI(e).replace(JT.percentDecode,`%`)}catch{return null}return e}function hD(e,t){let n=e.replace(JT.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(JT.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(JT.slashPipe,`|`);return n}function gD(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function _D(e){let t=e.split(`
60
+ `),n=t.length-1;for(;n>=0&&JT.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
61
+ `)}function vD(e){return e.trim().toLowerCase().toUpperCase().toLowerCase()}function yD(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function bD(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function xD(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`),c=e[0].charAt(0)===`!`;r.state.inLink=!0;let l=r.state.linkEmitted,u=r.state.inRawBlock;r.state.linkEmitted=!1;let d=r.inlineTokens(s),f=r.state.linkEmitted;if(r.state.linkEmitted=l,r.state.inLink=!1,!c){if(f){r.state.inRawBlock=u;return}r.state.linkEmitted=!0}return{type:c?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:d}}function SD(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
62
+ `).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return e.slice(Math.min(r.length,i.length))}).join(`
63
+ `)}function CD(e,t,n,r){if(!t.includes(`<`))return!1;for(let i=0;i<t.length;i++){if(t[i]===`\\`){i++;continue}if(t[i]==="`"){let e=r.inline.code.exec(t.slice(i));if(e){i+=e[0].length-1;continue}}if(t[i]!==`<`)continue;let a=e.slice(n+i),o=r.inline.tag.exec(a)||r.inline.autolink.exec(a);if(o){if(o[0].length>t.length-i)return!0;i+=o[0].length-1}}return!1}var wD=class{options;rules;lexer;constructor(e){this.options=e||UT}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:_D(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=SD(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=gD(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceTabChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:gD(t[0],`
64
+ `),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:gD(t[0],`
65
+ `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=gD(t[0],`
66
+ `).split(`
67
+ `),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
68
+ `),c=s.replace(this.rules.other.blockquoteSetextReplace,`
69
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
70
+ ${s}`:s,r=r?`${r}
71
+ ${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=e.join(`
72
+ `),o=t.raw+`
73
+ `+a.replace(this.rules.other.blockquoteSetextReplace2,``),s=this.blockquote(o);i[i.length-1]=s;let c=o.substring(s.raw.length).replace(/^\n/,``),l=c?c.split(`
74
+ `).length:0,d=l?e.slice(0,-l):e;d.length>0&&(n=`${n}
75
+ ${d.join(`
76
+ `)}`),r=r.substring(0,r.length-t.text.length)+s.text;break}if(u?.type===`list`){let t=u,a=t.raw+`
77
+ `+e.join(`
78
+ `),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
79
+ `);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=t[2].split(`
80
+ `,1)[0],l=t[1].length,u=this.options.pedantic?bD(c,l):c.replace(this.rules.other.leadingSpaceTab,e=>bD(e,l)),d=e.split(`
81
+ `,1)[0],f=!u.trim(),p=0;if(this.options.pedantic?(p=2,s=u.trimStart()):f?p=l+1:(p=u.search(this.rules.other.nonSpaceChar),p=p>4?1:p,s=u.slice(p),p+=l),f&&this.rules.other.blankLine.test(d)&&(r+=d+`
82
+ `,e=e.substring(d.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(p),n=this.rules.other.hrRegex(p),i=this.rules.other.fencesBeginRegex(p),a=this.rules.other.headingBeginRegex(p),o=this.rules.other.htmlBeginRegex(p),c=this.rules.other.blockquoteBeginRegex(p);for(;e;){let l=e.split(`
83
+ `,1)[0],m;if(d=l,this.options.pedantic?(d=d.replace(this.rules.other.listReplaceNesting,` `),m=d):m=d.replace(this.rules.other.leadingSpaceTab,e=>e.replace(this.rules.other.tabCharGlobal,` `)),i.test(d)||a.test(d)||o.test(d)||c.test(d)||t.test(d)||n.test(d))break;if(m.search(this.rules.other.nonSpaceChar)>=p||!d.trim())s+=`
84
+ `+m.slice(p);else{if(f||u.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(u)||a.test(u)||n.test(u))break;s+=`
85
+ `+d}f=!d.trim(),r+=l+`
86
+ `,e=e.substring(l.length+1),u=m.slice(p)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}for(let e of i.items){let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=_D(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=vD(t[1]).replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:gD(t[0],`
87
+ `),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=hD(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
88
+ `):[],a={type:`table`,raw:gD(t[0],`
89
+ `),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(hD(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:gD(t[0],`
90
+ `),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
91
+ `?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&CD(e,t[1],n,this.rules))return;let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let e=gD(r.slice(0,-1),`\\`);if((r.length-e.length)%2==0)return}else{let e=yD(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let i=t[2],a=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(i);e&&(i=e[1],a=e[3])}else a=t[3]?t[3].slice(1,-1):``;return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(i=this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?i.slice(1):i.slice(1,-1)),xD(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,`$1`),title:a&&a.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=n[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&CD(e,n[1],r,this.rules))return;let i=t[vD((n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `))];if(!i){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return xD(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,a,o,s=i,c=0,l=r[0][0],u=n===l,d=l===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){s+=o;continue}if(r[5]||r[6]){if(i%3&&!((i+o)%3)){c+=o;continue}if(u)break}if(s-=o,s>0)continue;o=Math.min(o,o+s+c);let t=[...r[0]][0].length,n=e.slice(0,i+r.index+t+o);if(Math.min(i,o)%2){let e=n.slice(1,-1);return{type:`em`,raw:n,text:e,tokens:this.lexer.inlineTokens(e)}}let l=n.slice(2,-2);return{type:`strong`,raw:n,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:e?t[0]:pD(t[0]),escaped:e}}}},TD=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||UT,this.options.tokenizer=this.options.tokenizer||new wD,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,top:!0};let t={other:JT,block:cD.normal,inline:lD.normal};this.options.pedantic?(t.block=cD.pedantic,t.inline=lD.pedantic):this.options.gfm&&(t.block=cD.gfm,t.inline=this.options.breaks?lD.breaks:lD.gfm),this.tokenizer.rules=t}static get rules(){return{block:cD,inline:lD}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(JT.carriageReturn,`
92
+ `),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(JT.tabCharGlobal,` `).replace(JT.spaceLine,``));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(n=>(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=`
93
+ `:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
94
+ `)?``:`
95
+ `)+i.raw,n.text+=`
96
+ `+i.text,this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
97
+ `)?``:`
98
+ `)+i.raw,n.text+=`
99
+ `+i.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},t.push(i));continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),t.push(i);continue}let a=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let r=t.at(-1);n&&r?.type===`paragraph`?(r.raw+=(r.raw.endsWith(`
100
+ `)?``:`
101
+ `)+i.raw,r.text+=`
102
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=a.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
103
+ `)?``:`
104
+ `)+i.raw,n.text+=`
105
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(e.charAt(0)!==`!`&&Object.hasOwn(this.tokens.links,vD(e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,t=n=>{let r=n.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,vD(n.slice(r+1,-1))))return n;if(r>1&&n.charAt(0)!==`!`){let i=n.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,t)+`][`+`a`.repeat(n.length-r-2)+`]`}return`[`+`a`.repeat(n.length-2)+`]`};n=n.replace(e,t)}n=n.replace(this.tokenizer.rules.inline.anyPunctuation,e=>`+`.repeat(e.length)),n=n.replace(this.tokenizer.rules.inline.blockSkip,(e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+`[`+`a`.repeat(e.length-r-2)+`]`}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,i=``,a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=``),r=!1;let o;if(this.options.extensions?.inline?.some(n=>(o=n.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let n=t.at(-1);o.type===`text`&&n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(o=this.tokenizer.emStrong(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.del(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),t.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},ED=class{options;parser;constructor(e){this.options=e||UT}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(JT.notSpaceStart)?.[0],i=e?e.replace(JT.endingNewline,``)+`
106
+ `:``;return r?`<pre><code class="language-`+fD(r)+`">`+(n?i:fD(i,!0))+`</code></pre>
107
+ `:`<pre><code>`+(n?i:fD(i,!0))+`</code></pre>
108
+ `}blockquote({tokens:e}){return`<blockquote>
109
+ ${this.parser.parse(e)}</blockquote>
110
+ `}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
111
+ `}hr(e){return`<hr>
112
+ `}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
113
+ `+r+`</`+i+`>
114
+ `}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
115
+ `}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
116
+ `}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
117
+ <thead>
118
+ `+t+`</thead>
119
+ `+r+`</table>
120
+ `}tablerow({text:e}){return`<tr>
121
+ ${e}</tr>
122
+ `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
123
+ `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${fD(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:i}){let a=i?fD(n,!0):this.parser.parseInline(r),o=mD(e);if(o===null)return a;e=fD(o,i);let s=`<a href="`+e+`"`;return t&&(s+=` title="`+fD(t)+`"`),s+=`>`+a+`</a>`,s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=mD(e);if(i===null)return fD(n);e=i;let a=`<img src="${fD(e)}" alt="${fD(n)}"`;return t&&(a+=` title="${fD(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:fD(e.text)}},DD=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},OD=class e{options;renderer;textRenderer;constructor(e){this.options=e||UT,this.options.renderer=this.options.renderer||new ED,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new DD}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`checkbox`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`checkbox`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},kD=class{options;block;constructor(e){this.options=e||UT}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?TD.lex:TD.lexInline}provideParser(e=this.block){return e?OD.parse:OD.parseInline}},AD=class{defaults=HT();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=OD;Renderer=ED;TextRenderer=DD;Lexer=TD;Tokenizer=wD;Hooks=kD;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new ED(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new wD(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new kD;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=kD.passThroughHooks.has(n)?e=>{if(this.defaults.async&&kD.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return TD.lex(e,t??this.defaults)}parser(e,t){return OD.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?TD.lex:TD.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?OD.parse:OD.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?TD.lex:TD.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?OD.parse:OD.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
124
+ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+fD(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},jD=new AD;function MD(e,t){return jD.parse(e,t)}MD.options=MD.setOptions=function(e){return jD.setOptions(e),MD.defaults=jD.defaults,WT(MD.defaults),MD},MD.getDefaults=HT,MD.defaults=UT;function ND(...e){return jD.use(...e),MD.defaults=jD.defaults,WT(MD.defaults),MD}MD.use=ND,MD.walkTokens=function(e,t){return jD.walkTokens(e,t)},MD.parseInline=jD.parseInline,MD.Parser=OD,MD.parser=OD.parse,MD.Renderer=ED,MD.TextRenderer=DD,MD.Lexer=TD,MD.lexer=TD.lex,MD.Tokenizer=wD,MD.Hooks=kD,MD.parse=MD,MD.options,MD.setOptions,MD.walkTokens,MD.parseInline,OD.parse,TD.lex;var PD=new Set([`http:`,`https:`,`mailto:`]);function FD(e){try{return PD.has(new URL(e,`http://relative.invalid/`).protocol)}catch{return!1}}function ID(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`)}var LD={amp:`&`,lt:`<`,gt:`>`,quot:`"`,apos:`'`,colon:`:`,sol:`/`,period:`.`,num:`#`,quest:`?`,equals:`=`,percnt:`%`,tab:` `,newline:`
125
+ `,nbsp:`\xA0`};function RD(e){return e.replace(/&(?:#(\d{1,7})|#x([0-9a-f]{1,6})|([a-z]{2,8}));/gi,(e,t,n,r)=>{if(r)return LD[r.toLowerCase()]??e;let i=t?Number(t):Number.parseInt(n,16);return i>0&&i<=1114111&&(i<55296||i>57343)?String.fromCodePoint(i):`�`})}var zD=new AD({gfm:!0,breaks:!1},{renderer:{html:({text:e})=>ID(e),link(e){let t=this.parser.parseInline(e.tokens),n=RD(e.href);if(!FD(n))return t;let r=e.title?` title="${ID(RD(e.title))}"`:``;return`<a target="_blank" rel="noreferrer" href="${ID(n)}"${r}>${t}</a>`},image(e){let t=ID(RD(e.text)),n=RD(e.href);if(!FD(n))return t;let r=e.title?` title="${ID(RD(e.title))}"`:``;return`<img src="${ID(n)}" alt="${t}"${r}>`}}});function BD(e){return zD.parse(e,{async:!1})}function VD({text:e,className:t}){let n=(0,v.useMemo)(()=>BD(e),[e]);return(0,R.jsx)(`div`,{className:J(`prose`,t),dangerouslySetInnerHTML:{__html:n}})}var HD=1e5,UD=2e3,WD=e=>typeof e==`object`&&!!e&&!Array.isArray(e),$=e=>typeof e==`string`,GD=e=>typeof e==`number`&&Number.isFinite(e),KD=e=>typeof e==`boolean`,qD=e=>t=>t===void 0||e(t),JD=e=>t=>Array.isArray(t)&&t.every(e),YD=e=>t=>WD(t)&&Object.entries(e).every(([e,n])=>n(t[e])),XD=e=>Array.isArray(e)&&e.length===2&&$(e[0])&&$(e[1]),ZD=e=>Array.isArray(e)&&e.length===4&&e.every(GD),QD=YD({ref:GD,label:$}),$D=YD({value:$,css:$,token:qD($)}),eO=YD({value:$,token:qD($)}),tO=YD({ref:GD,tag:$,label:$,text:qD($),classes:JD($),attributes:JD(XD),component:qD(YD({owners:JD($),file:qD($)})),rect:YD({x:GD,y:GD,w:GD,h:GD}),margin:ZD,border:ZD,padding:ZD,layout:JD(XD),typography:qD(YD({family:$,familyToken:qD($),size:$,sizeToken:qD($),weight:$,lineHeight:$,letterSpacing:$,color:$D,align:$,transform:qD($)})),appearance:YD({background:qD($D),backgroundImage:qD($),border:qD(YD({width:$,style:$,color:$D})),radius:qD(eO),shadow:qD(eO),opacity:qD($)}),path:JD(QD),children:JD(QD),css:$}),nO={ready:{},blur:{},updated:{},"inspect-escape":{},size:{width:GD,height:GD},error:{message:$},go:{target:$},link:{href:$,path:e=>e===null||$(e),form:KD,raw:qD($),pushed:qD(KD)},wheel:{deltaX:GD,deltaY:GD,x:GD,y:GD,zoom:KD},keydown:{code:$},pointer:{x:GD,y:GD,down:KD},key:{name:$,down:KD},inspect:{info:e=>e===null||tO(e)}},rO=e=>Math.min(HD,Math.max(0,e));function iO(e){if(!WD(e)||e.source!==`design-runtime`||!$(e.key)||!$(e.type))return null;let t=Object.hasOwn(nO,e.type)?nO[e.type]:null;if(!t||!YD(t)(e))return null;let n=e;return n.type===`size`?{...n,width:rO(n.width),height:rO(n.height)}:n.type===`error`?{...n,message:n.message.slice(0,UD)}:n}function aO(e,t){return e.includes(t)||e.length>=20?e:[...e,t]}var oO=new Map;window.addEventListener(`message`,e=>{let t=e.source?oO.get(e.source):void 0;if(!t)return;let n=iO(e.data);if(n)for(let e of t)e(n)});function sO(e,t){let n=null,r=()=>{if(!n)return;let e=oO.get(n);e?.delete(t),e?.size||oO.delete(n),n=null},i=()=>{if(r(),n=e.contentWindow,!n)return;let i=oO.get(n)??new Set;i.add(t),oO.set(n,i)};return i(),e.addEventListener(`load`,i),()=>{e.removeEventListener(`load`,i),r()}}function cO(e,t){e?.contentWindow?.postMessage({source:`design-viewer`,...t},`*`)}function lO(e){cO(e,{type:`canvas`})}function uO(e,t){for(let n=e.parentElement;n;n=n.parentElement){let e=getComputedStyle(n),r=e=>/(auto|scroll|overlay)/.test(e),i=r(e.overflowY)&&n.scrollHeight>n.clientHeight,a=r(e.overflowX)&&n.scrollWidth>n.clientWidth;if(i||a){n.scrollBy({left:a?t.deltaX:0,top:i?t.deltaY:0,behavior:`instant`});return}}window.scrollBy({left:t.deltaX,top:t.deltaY,behavior:`instant`})}function dO(e,t){cO(e,{type:`theme`,theme:t})}function fO(e){e&&(e.src=e.src)}var pO=(()=>{if(Fg)return``;let{protocol:e,hostname:t,port:n}=window.location,r=t===`localhost`?`127.0.0.1`:t===`127.0.0.1`?`localhost`:null;return r?`${e}//${r}${n?`:${n}`:``}`:``})();function mO(e,t,n){let[r=``,i=``]=e.split(`?`),a=new URLSearchParams(i);a.set(`theme`,t);for(let[e,t]of Object.entries(n??{}))a.set(e,t);return`${r.startsWith(`/`)?pO:``}${r}?${a.toString()}`}function hO(e){return new URL(e,document.baseURI).toString()}function gO(e,t,n,r,i){if(e.form){jT(`Forms are not sent from a screen`,void 0,`info`);return}if(e.path===null){if(!FD(e.href)||!/^(https?|mailto):/i.test(e.href.trim())){jT(`Link not opened`,e.href.slice(0,200),`info`);return}window.open(e.href,`_blank`,`noopener,noreferrer`)||jT(`Link to another site`,e.href,`info`);return}let a=Array.isArray(t)?t:t.pages.flatMap(e=>e.sections.flatMap(e=>e.items.filter(e=>e.kind===`screen`||e.kind===`url`))),o=a.find(e=>e.id===r),s=e.raw===void 0?e.path:VT(e.raw,o?.routes?.[0]);if(s===null)return;let c=BT(a.map(e=>({routes:(e.routes??[]).map(LT),value:e.id})),s);if(c){c!==r&&n(c);return}let l=s.split(/[?#]/)[0].replace(/\/+$/,``),u=l.slice(l.lastIndexOf(`/`)+1).replace(/\.html?$/,``);try{u=decodeURIComponent(u)}catch{}if(u&&u!==r&&a.some(e=>e.id===u))n(u);else if(e.pushed)return;else i?i(s):jT(`No screen for this link`,s,`info`)}function _O(e,t,n){let r=r_().data,i=a_(!!r?.system).data?.tokens,[a,o]=(0,v.useState)(null),s=(0,v.useRef)({enabled:t,tokens:i,picked:null});s.current={enabled:t,tokens:i,picked:a?.frame??null};let c=(0,v.useRef)(n.onEscape);c.current=n.onEscape;let l=(0,v.useRef)(e);l.current=e;let u=(0,v.useRef)(new Map),d=(e,t=!1)=>{let{enabled:n,tokens:r}=s.current,i=u.current.get(e);(t||i?.on!==n||i.tokens!==r)&&(u.current.set(e,{on:n,tokens:r}),cO(e,{type:`inspect`,on:n,tokens:n?r??[]:void 0}))};(0,v.useEffect)(()=>{for(let t of e)d(t);for(let t of u.current.keys())e.includes(t)||u.current.delete(t)},[e,t,i]),(0,v.useEffect)(()=>{let t=e.map(e=>sO(e,t=>{if(t.type===`ready`)s.current.enabled?d(e,!0):u.current.set(e,{on:!1});else if(t.type===`inspect`){if(t.info&&(s.current.enabled||s.current.picked===e)){for(let t of l.current)t!==e&&cO(t,{type:`inspect-select`,ref:null});o({info:t.info,frame:e})}else o(t=>t?.frame===e?null:t)}else t.type===`inspect-escape`&&c.current()}));return()=>{for(let e of t)e()}},[e]);let f=a&&e.includes(a.frame)?a.frame:null;return{info:f?a.info:null,frame:f,select(e){if(e===null){for(let e of l.current)cO(e,{type:`inspect-select`,ref:null});o(null)}else a&&cO(a.frame,{type:`inspect-select`,ref:e})}}}function vO(e){let[t,n]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{let t=e=>e===`Meta`||e===`Control`,r=!1,i=!1,a,o=()=>{r=!1,clearTimeout(a),n(!1)},s=e=>{if(t(e)){if(r)return;r=!0,i=!1,a=setTimeout(()=>{r&&!i&&n(!0)},150)}else r&&(i=!0,clearTimeout(a),n(!1))},c=e=>s(e.key),l=e=>{t(e.key)&&o()};window.addEventListener(`keydown`,c,!0),window.addEventListener(`keyup`,l,!0),window.addEventListener(`blur`,o);let u=e.map(e=>sO(e,e=>{e.type===`key`?e.down?s(e.name):t(e.name)&&o():e.type===`blur`&&o()}));return()=>{window.removeEventListener(`keydown`,c,!0),window.removeEventListener(`keyup`,l,!0),window.removeEventListener(`blur`,o);for(let e of u)e();clearTimeout(a)}},[e]),t}function yO({title:e,children:t,right:n}){return(0,R.jsxs)(`section`,{className:`border-t border-rule pb-2 first:border-t-0`,children:[(0,R.jsxs)(`div`,{className:`flex h-9 items-center justify-between px-4 text-[12px] font-medium text-muted`,children:[e,n]}),t]})}function bO({label:e,children:t}){return(0,R.jsxs)(`div`,{className:`grid min-h-7 grid-cols-[92px_minmax(0,1fr)] items-center gap-x-3 px-4 py-0.5 text-[12.5px]`,children:[(0,R.jsx)(`span`,{className:`text-muted`,children:e}),(0,R.jsx)(`div`,{className:`flex min-w-0 items-center gap-1.5 text-ink`,children:t})]})}function xO({name:e}){return e?(0,R.jsx)(`button`,{type:`button`,onClick:()=>void FT(`var(${e})`,`Token copied`),title:`Copy var()`,className:`shrink-0 cursor-pointer truncate rounded-[4px] border-0 bg-action-soft px-1.5 py-px font-mono text-[11px] text-action`,children:e}):null}function SO({children:e,title:t}){return(0,R.jsx)(`span`,{className:`min-w-0 truncate font-mono text-[12px]`,title:t,children:e})}function CO({label:e,color:t}){return(0,R.jsxs)(bO,{label:e,children:[(0,R.jsx)(`span`,{className:`size-3.5 shrink-0 rounded-[3px] shadow-[inset_0_0_0_1px_rgba(0,0,0,0.12)]`,style:{background:t.css}}),(0,R.jsx)(SO,{title:t.css,children:t.value}),(0,R.jsx)(xO,{name:t.token})]})}var wO=e=>e?String(e):`–`;function TO({label:e,values:t,className:n,children:r}){let[i,a,o,s]=t;return(0,R.jsxs)(`div`,{className:J(`relative grid grid-cols-[28px_minmax(0,1fr)_28px] grid-rows-[20px_auto_20px] rounded-[4px]`,n),children:[(0,R.jsx)(`span`,{className:`absolute top-1 left-1.5 text-[9.5px] tracking-wide text-muted uppercase`,children:e}),(0,R.jsx)(`span`,{className:`col-start-2 self-center text-center`,children:wO(i)}),(0,R.jsx)(`span`,{className:`row-start-2 self-center text-center`,children:wO(s)}),(0,R.jsx)(`div`,{className:`row-start-2 col-start-2`,children:r}),(0,R.jsx)(`span`,{className:`row-start-2 col-start-3 self-center text-center`,children:wO(a)}),(0,R.jsx)(`span`,{className:`row-start-3 col-start-2 self-center text-center`,children:wO(o)})]})}function EO({info:e}){let t={w:Math.max(0,e.rect.w-e.border[1]-e.border[3]-e.padding[1]-e.padding[3]),h:Math.max(0,e.rect.h-e.border[0]-e.border[2]-e.padding[0]-e.padding[2])};return(0,R.jsx)(`div`,{className:`px-4 pt-1 pb-2 font-mono text-[11px] text-ink2`,children:(0,R.jsx)(TO,{label:`margin`,values:e.margin,className:`border border-dashed border-rule-strong bg-[#f6b26b]/15`,children:(0,R.jsx)(TO,{label:`border`,values:e.border,className:`border border-rule-strong bg-[#f9e27d]/15`,children:(0,R.jsx)(TO,{label:`padding`,values:e.padding,className:`border border-rule-strong bg-[#93c47d]/20`,children:(0,R.jsxs)(`div`,{className:`flex h-8 items-center justify-center rounded-[3px] border border-rule-strong bg-[#6fa8dc]/25 text-ink`,children:[Math.round(t.w*100)/100,` × `,Math.round(t.h*100)/100]})})})})})}function DO({info:e,onSelect:t}){return(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 px-4 pb-2`,children:[e.path.slice(-4).map((e,n)=>(0,R.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,R.jsx)(`button`,{type:`button`,onClick:()=>t(e.ref),className:`cursor-pointer rounded-[4px] border-0 bg-soft2 px-1.5 py-0.5 font-mono text-[11px] text-ink2 hover:text-ink`,children:e.label}),(0,R.jsx)(X,{name:`chevron-right`,size:11,className:`text-muted`})]},n)),(0,R.jsx)(`span`,{className:`rounded-[4px] bg-action-soft px-1.5 py-0.5 font-mono text-[11px] text-action`,children:e.label})]})}function OO({info:e,onSelect:t,onClose:n,active:r}){return(0,R.jsxs)(`aside`,{"data-ui":!0,className:`flex w-[320px] shrink-0 flex-col overflow-hidden border-l border-rule bg-surface`,children:[(0,R.jsxs)(`div`,{className:`flex h-[46px] shrink-0 items-center justify-between border-b border-rule pr-2 pl-4`,children:[(0,R.jsxs)(`span`,{className:`flex items-center gap-2 text-[14px] font-semibold`,children:[(0,R.jsx)(X,{name:`pointer`,size:15,className:`text-action`}),` Inspect`]}),(0,R.jsx)(N_,{icon:`x`,label:`Close inspector (I)`,onClick:n})]}),e?(0,R.jsxs)(`div`,{className:`min-h-0 grow overflow-y-auto`,children:[(0,R.jsxs)(yO,{title:`Element`,children:[(0,R.jsxs)(`div`,{className:`flex flex-col gap-1 px-4 pb-2`,children:[(0,R.jsx)(`div`,{className:`flex min-w-0 items-baseline gap-1.5`,children:e.component?.owners[0]?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`span`,{className:`truncate font-mono text-[14px] font-medium text-ink`,children:[`<`,e.component.owners[0],`>`]}),(0,R.jsx)(`span`,{className:`truncate font-mono text-[12px] text-muted`,children:e.tag})]}):(0,R.jsx)(`span`,{className:`truncate font-mono text-[14px] font-medium text-ink`,children:e.label})}),e.component&&e.component.owners.length>1?(0,R.jsxs)(`span`,{className:`truncate text-[12px] text-muted`,children:[`in `,e.component.owners.slice(1).join(` ← `)]}):null,e.component?.file?(0,R.jsx)(`button`,{type:`button`,onClick:()=>void FT(e.component.file,`Path copied`),className:`w-fit max-w-full cursor-pointer truncate border-0 bg-transparent p-0 text-left font-mono text-[11.5px] text-muted hover:text-ink2`,title:`Copy path`,children:e.component.file}):null,e.text?(0,R.jsxs)(`span`,{className:`line-clamp-2 text-[12.5px] text-ink2`,children:[`“`,e.text,`”`]}):null]}),(0,R.jsx)(DO,{info:e,onSelect:t})]}),(0,R.jsxs)(yO,{title:`Box`,children:[(0,R.jsx)(EO,{info:e}),(0,R.jsx)(bO,{label:`Size`,children:(0,R.jsxs)(SO,{children:[e.rect.w,` × `,e.rect.h]})}),(0,R.jsx)(bO,{label:`Position`,children:(0,R.jsxs)(SO,{children:[`x `,e.rect.x,` · y `,e.rect.y]})})]}),e.layout.length?(0,R.jsx)(yO,{title:`Layout`,children:e.layout.map(([e,t])=>(0,R.jsx)(bO,{label:e,children:(0,R.jsx)(SO,{title:t,children:t})},e))}):null,e.typography?(0,R.jsxs)(yO,{title:`Typography`,children:[(0,R.jsxs)(bO,{label:`Font`,children:[(0,R.jsx)(SO,{title:e.typography.family,children:e.typography.family.split(`,`)[0]?.replace(/["']/g,``)}),(0,R.jsx)(xO,{name:e.typography.familyToken})]}),(0,R.jsxs)(bO,{label:`Size`,children:[(0,R.jsxs)(SO,{children:[e.typography.size,` / `,e.typography.lineHeight]}),(0,R.jsx)(xO,{name:e.typography.sizeToken})]}),(0,R.jsx)(bO,{label:`Weight`,children:(0,R.jsx)(SO,{children:e.typography.weight})}),e.typography.letterSpacing===`normal`?null:(0,R.jsx)(bO,{label:`Tracking`,children:(0,R.jsx)(SO,{children:e.typography.letterSpacing})}),(0,R.jsx)(CO,{label:`Color`,color:e.typography.color}),e.typography.align===`start`?null:(0,R.jsx)(bO,{label:`Align`,children:(0,R.jsx)(SO,{children:e.typography.align})}),e.typography.transform?(0,R.jsx)(bO,{label:`Transform`,children:(0,R.jsx)(SO,{children:e.typography.transform})}):null]}):null,Object.values(e.appearance).some(Boolean)?(0,R.jsxs)(yO,{title:`Appearance`,children:[e.appearance.background?(0,R.jsx)(CO,{label:`Background`,color:e.appearance.background}):null,e.appearance.backgroundImage?(0,R.jsx)(bO,{label:`Image`,children:(0,R.jsx)(SO,{title:e.appearance.backgroundImage,children:e.appearance.backgroundImage})}):null,e.appearance.border?(0,R.jsxs)(bO,{label:`Border`,children:[(0,R.jsx)(`span`,{className:`size-3.5 shrink-0 rounded-[3px] shadow-[inset_0_0_0_1px_rgba(0,0,0,0.12)]`,style:{background:e.appearance.border.color.css}}),(0,R.jsxs)(SO,{children:[e.appearance.border.width,` `,e.appearance.border.style,` `,e.appearance.border.color.value]}),(0,R.jsx)(xO,{name:e.appearance.border.color.token})]}):null,e.appearance.radius?(0,R.jsxs)(bO,{label:`Radius`,children:[(0,R.jsx)(SO,{children:e.appearance.radius.value}),(0,R.jsx)(xO,{name:e.appearance.radius.token})]}):null,e.appearance.shadow?(0,R.jsxs)(bO,{label:`Shadow`,children:[(0,R.jsx)(SO,{title:e.appearance.shadow.value,children:e.appearance.shadow.value}),(0,R.jsx)(xO,{name:e.appearance.shadow.token})]}):null,e.appearance.opacity?(0,R.jsx)(bO,{label:`Opacity`,children:(0,R.jsx)(SO,{children:e.appearance.opacity})}):null]}):null,e.classes.length?(0,R.jsx)(yO,{title:`Classes`,right:(0,R.jsx)(`button`,{type:`button`,onClick:()=>void FT(e.classes.join(` `),`Classes copied`),className:`cursor-pointer border-0 bg-transparent text-[12px] text-muted hover:text-ink2`,children:`Copy`}),children:(0,R.jsx)(`div`,{className:`flex flex-wrap gap-1 px-4 pb-1`,children:e.classes.map(e=>(0,R.jsx)(`span`,{className:`rounded-[4px] bg-soft2 px-1.5 py-0.5 font-mono text-[11px] text-ink2`,children:e},e))})}):null,e.attributes.length?(0,R.jsx)(yO,{title:`Attributes`,children:e.attributes.map(([e,t])=>(0,R.jsx)(bO,{label:e,children:(0,R.jsx)(SO,{title:t,children:t})},e))}):null,e.children.length?(0,R.jsx)(yO,{title:`Children · ${e.children.length}`,children:(0,R.jsx)(`div`,{className:`flex flex-col px-2 pb-1`,children:e.children.map((e,n)=>(0,R.jsxs)(`button`,{type:`button`,onClick:()=>t(e.ref),className:`flex h-7 cursor-pointer items-center gap-2 rounded-[6px] border-0 bg-transparent px-2 text-left font-mono text-[12px] text-ink2 hover:bg-soft2`,children:[(0,R.jsx)(X,{name:`chevron-right`,size:12,className:`text-muted`}),(0,R.jsx)(`span`,{className:`truncate`,children:e.label})]},n))})}):null]}):(0,R.jsxs)(`div`,{className:`flex flex-col items-center gap-2 px-6 py-10 text-center`,children:[(0,R.jsx)(X,{name:`pointer`,size:22,className:`text-muted`}),(0,R.jsx)(`span`,{className:`text-[13.5px] text-ink2`,children:r?`Click an element in any screen.`:`Hold ${av} to highlight, click to inspect.`}),(0,R.jsx)(`span`,{className:`text-[12.5px] leading-[1.5] text-muted`,children:`Hover shows margin, padding and content. Clicks go to the inspector, not the screen.`}),(0,R.jsxs)(`span`,{className:`mt-2 flex items-center gap-1.5 text-[12px] text-muted`,children:[(0,R.jsx)(S_,{children:`I`}),` toggle · hold `,(0,R.jsx)(S_,{children:av}),` · `,(0,R.jsx)(S_,{children:`esc`}),` clear`]})]}),e?(0,R.jsx)(`div`,{className:`flex shrink-0 items-center gap-2 border-t border-rule bg-soft px-4 py-2.5`,children:(0,R.jsx)(A_,{icon:`copy`,onClick:()=>void FT(e.css,`CSS copied`),className:`grow`,children:`Copy CSS`})}):null]})}function kO({issues:e,className:t}){return(0,R.jsx)(`div`,{className:J(`flex flex-col`,t),children:e.map((e,t)=>(0,R.jsxs)(`div`,{className:`flex items-start gap-2.5 border-t border-rule px-4 py-2.5 text-[13px] first:border-t-0`,children:[(0,R.jsx)(X,{name:e.severity===`error`?`alert`:`info`,size:15,className:J(`mt-0.5`,e.severity===`error`?`text-danger-text`:`text-action`)}),(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,R.jsx)(`span`,{className:`text-ink`,children:e.message}),(0,R.jsxs)(`span`,{className:`font-mono text-[12px] break-all text-muted`,children:[e.file,e.at?` · ${e.at}`:``]})]})]},t))})}function AO({issues:e,title:t=`Problems`}){if(!e.length)return null;let n=e.filter(e=>e.severity===`error`).length;return(0,R.jsxs)(z_,{className:n?`border-danger/40`:void 0,children:[(0,R.jsx)(B_,{title:t,count:e.length,sub:n?`${n} blocking`:`warnings`}),(0,R.jsx)(`div`,{className:`border-t border-rule`,children:(0,R.jsx)(kO,{issues:e})})]})}var jO=[.2,.7,.2,1];function MO({open:e,side:t,width:n,children:r}){return(0,R.jsx)(td,{initial:!1,children:e?(0,R.jsx)(Kf.div,{initial:{width:0,opacity:.6},animate:{width:n,opacity:1},exit:{width:0,opacity:.6},transition:{duration:.22,ease:jO},className:J(`flex min-h-0 shrink-0 overflow-hidden`,t===`right`?`justify-start`:`justify-end`),children:(0,R.jsx)(`div`,{className:`flex min-h-0 shrink-0`,style:{width:n},children:r})},`panel`):null})}var NO=8e3,PO=class{url;store=new d_({ready:!1,online:!1,canDraw:!1,drawings:{},ghosts:{}});socket=null;confirmed={};pending=new Map;nextId=1;delay=500;timer;sweep;closed=!1;constructor(e){this.url=e,this.connect(),this.sweep=setInterval(()=>this.dropStale(),2e3)}connect(){if(this.closed)return;let e;try{e=new WebSocket(this.url)}catch{this.retry();return}this.socket=e,e.onmessage=e=>{if(typeof e.data!=`string`)return;let t=OT(e.data);t&&this.receive(t)},e.onclose=()=>{this.socket===e&&(this.socket=null,this.store.set(e=>({...e,online:!1,ghosts:{}})),this.retry())}}retry(){this.closed||(clearTimeout(this.timer),this.timer=setTimeout(()=>this.connect(),this.delay),this.delay=Math.min(this.delay*2,1e4))}send(e){this.socket?.readyState===WebSocket.OPEN&&this.socket.send(JSON.stringify(e))}shown(e){let t=this.confirmed[e]??lT();for(let n of this.pending.values())n.key===e&&(t=_T(t,n.ops)??t);return t}show(e){this.store.set(t=>{let n={...t.drawings};for(let t of e)n[t]=this.shown(t);return{...t,drawings:n}})}receive(e){switch(e.type){case`hello`:{this.delay=500,this.confirmed=e.drawings;let t=new Set([...Object.keys(this.confirmed),...[...this.pending.values()].map(e=>e.key)]),n={};for(let e of t)n[e]=this.shown(e);if(this.store.set({ready:!0,online:!0,canDraw:e.canDraw,drawings:n,ghosts:{}}),e.canDraw)for(let[e,{key:t,ops:n}]of this.pending)this.send({type:`ops`,id:e,key:t,...n});else this.pending.clear();break}case`ops`:{let t=_T(this.confirmed[e.key]??lT(),e);t&&(this.confirmed={...this.confirmed,[e.key]:t});let n=new Set((e.add??[]).map(e=>e.id));this.store.set(r=>{let i=r.ghosts[e.key]?.filter(e=>!n.has(e.stroke.id));return{...r,drawings:t?{...r.drawings,[e.key]:this.shown(e.key)}:r.drawings,ghosts:i?{...r.ghosts,[e.key]:i}:r.ghosts}});break}case`ack`:{let t=this.pending.get(e.id);this.pending.delete(e.id),t&&this.show([t.key]);break}case`doc`:{let t=this.confirmed[e.key]??lT(),n=vT(e.drawing,t),r=n?_T(t,n):null;r&&(this.confirmed={...this.confirmed,[e.key]:r},this.show([e.key]));break}case`live`:this.store.set(t=>{let n=t.ghosts[e.key]??[],r=n.find(t=>t.stroke.id===e.stroke.id),{at:i,points:a,...o}=e.stroke,s={...o,points:i&&r?[...r.stroke.points.slice(0,i),...a]:a},c={peer:e.peer,name:e.name,stroke:s,seen:Date.now()},l=r?n.map(e=>e===r?c:e):[...n,c];return{...t,ghosts:{...t.ghosts,[e.key]:l}}});break;case`live-end`:this.dropGhosts((t,n)=>n===e.key&&t.stroke.id===e.id);break;case`gone`:this.dropGhosts(t=>t.peer===e.peer);break;case`error`:console.warn(`[design] drawings: ${e.message}`)}}dropGhosts(e){this.store.set(t=>{let n=!1,r={};for(let[i,a]of Object.entries(t.ghosts)){let t=a.filter(t=>!e(t,i));t.length!==a.length&&(n=!0),t.length&&(r[i]=t)}return n?{...t,ghosts:r}:t})}dropStale(){let e=Date.now();this.dropGhosts(t=>e-t.seen>NO)}apply(e,t){let n=this.store.get();if(!n.canDraw||!_T(n.drawings[e]??lT(),t))return;let r=this.nextId++;this.pending.set(r,{key:e,ops:t}),this.show([e]),this.send({type:`ops`,id:r,key:e,...t})}live(e,t,n){let{points:r,...i}=t;this.send({type:`live`,key:e,stroke:{...i,at:n,points:r.slice(n)}})}liveEnd(e,t){this.send({type:`live-end`,key:e,id:t})}close(){this.closed=!0,clearTimeout(this.timer),clearInterval(this.sweep);let e=this.socket;this.socket=null,e?.close()}};function FO(e,t=!0){let{source:n}=e_(),r=t?n.drawings?.(e)??null:null,[i,a]=(0,v.useState)(null);return(0,v.useEffect)(()=>{if(!r)return;let e=new PO(r);return a(e),()=>{e.close(),a(null)}},[r]),i}var IO=[];function LO(e,t){return{drawing:Y(e.store,e=>e.drawings[t]),ghosts:Y(e.store,e=>e.ghosts[t]??IO)}}var RO=new d_({ready:!1,online:!1,canDraw:!1,drawings:{},ghosts:{}});function zO({title:e=`Nothing here`,text:t}){let n=!!e_().scope;return(0,R.jsx)(tv,{title:e,text:t??`This address does not match a canvas or a page of the design system.`,action:n?void 0:(0,R.jsx)(P_,{to:`/`,children:`All canvases`})})}var BO=.1,VO=(e,t=BO)=>Math.min(8,Math.max(t,e)),HO=class{camera={x:0,y:0,z:1};minZoom=BO;listeners=new Set;animation=0;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}set(e){this.camera={x:e.x,y:e.y,z:VO(e.z,this.minZoom)};for(let e of this.listeners)e(this.camera)}interrupt(){cancelAnimationFrame(this.animation),this.animation=0}panBy(e,t){this.interrupt();let{x:n,y:r,z:i}=this.camera;this.set({x:n+e,y:r+t,z:i})}zoomAt(e,t,n){this.interrupt();let{x:r,y:i,z:a}=this.camera,o=VO(a*n,this.minZoom),s=(e-r)/a,c=(t-i)/a;this.set({x:e-s*o,y:t-c*o,z:o})}animateTo(e,t=320){this.interrupt();let n={...this.camera},r={...e,z:VO(e.z,this.minZoom)};if(t<=0||matchMedia(`(prefers-reduced-motion: reduce)`).matches){this.set(r);return}let i=performance.now(),a=e=>{let o=Math.min(1,(e-i)/t),s=1-(1-o)**3,c=n.z*(r.z/n.z)**s,l=n.z===r.z?s:(c-n.z)/(r.z-n.z);this.set({x:n.x+(r.x-n.x)*l,y:n.y+(r.y-n.y)*l,z:c}),this.animation=o<1?requestAnimationFrame(a):0};this.animation=requestAnimationFrame(a)}toWorld(e,t){let{x:n,y:r,z:i}=this.camera;return{x:(e-n)/i,y:(t-r)/i}}};function UO(e){try{let t=JSON.parse(sessionStorage.getItem(e)??`null`);if(t&&Number.isFinite(t.x)&&Number.isFinite(t.y)&&Number.isFinite(t.z))return t}catch{}return null}function WO(e,t,n,r=72,i=1,a=BO){let o=VO(Math.min((t-r*2)/Math.max(e.w,1),(n-r*2)/Math.max(e.h,1),i),a),s=(e,t,n)=>t*o<=n-r*2?n/2-(e+t/2)*o:r-e*o;return{z:o,x:s(e.x,e.w,t),y:s(e.y,e.h,n)}}var GO=14,KO=96;function qO(e){let t=0;return n=>{let r=24*n.z;for(;r<GO;)r*=4;for(;r>KO;)r/=4;r!==t&&(t=r,e.style.backgroundSize=`${r}px ${r}px`);let i=e=>((e+KO)%r+r)%r-r;e.style.transform=`translate3d(${i(n.x)}px, ${i(n.y)}px, 0)`}}function JO(e,t){return e.x<t.x+t.w&&e.x+e.w>t.x&&e.y<t.y+t.h&&e.y+e.h>t.y}function YO(){return new d_({selected:null,active:null,hovered:null,sizes:{},frames:{},live:[],panning:!1,zoomTiny:!1,frameEls:{},inspecting:!1,markup:null})}function XO(e,t,n){e.set(e=>{let r=e.sizes[t];return r&&Math.abs(r.h-n.h)<1&&r.w===n.w?e:{...e,sizes:{...e.sizes,[t]:n}}})}function ZO(e,t,n){e.set(e=>{let r=e.frames[t]??{ready:!1,errors:[]};return{...e,frames:{...e.frames,[t]:{...r,...n}}}})}function QO(e,t,n){e.set(e=>e.frameEls[t]===n?e:{...e,frameEls:{...e.frameEls,[t]:n}})}function $O(e,t,n=!0){let r=(0,v.useRef)(null);return(0,v.useLayoutEffect)(()=>{let i=r.current;if(!i||!n)return;let a=new ResizeObserver(()=>XO(e,t,{h:i.offsetHeight}));return a.observe(i),()=>a.disconnect()},[e,t,n]),r}function ek(e){return e<600?`smartphone`:e<1100?`tablet`:`monitor`}var tk=(0,v.memo)(function({placed:e,mode:t,thumb:n,theme:r,store:i,events:a,capture:o}){let{item:s,x:c,y:l,w:u,h:d}=e,f=(0,v.useRef)(null),{frameSandbox:p,frameAllow:m}=e_(),h=(0,v.useCallback)(e=>{f.current=e,QO(i,s.id,e)},[i,s.id]),g=Y(i,e=>e.frames[s.id]),_=Y(i,e=>e.active===s.id),y=Y(i,e=>e.inspecting&&s.kind===`screen`),b=s.frame.height===`auto`,x=s.kind===`screen`?s.theme??r:r,S=s.kind===`screen`?s.rev:s.url,[C]=(0,v.useState)(x),w=s.kind===`screen`?mO(s.url,C,o?{capture:`1`}:void 0):s.url,T=!!g?.ready,E=t===`off`,D=!E&&!(s.kind===`screen`&&s.missing)&&!!s.url;(0,v.useEffect)(()=>{E&&ZO(i,s.id,{ready:!1})},[E,i,s.id]),(0,v.useEffect)(()=>{let e=f.current;if(e&&!E&&s.kind===`screen`)return sO(e,t=>{switch(t.type){case`ready`:ZO(i,s.id,{ready:!0}),lO(e);break;case`size`:b&&XO(i,s.id,{h:Math.max(200,t.height)});break;case`error`:{let e=i.get().frames[s.id]?.errors??[],n=aO(e,t.message);n!==e&&ZO(i,s.id,{errors:n});break}case`updated`:ZO(i,s.id,{errors:[]});break;case`go`:a.onGo(s.id,t.target);break;case`link`:a.onLink(s.id,t);break;case`wheel`:a.onWheel(e,t);break;case`keydown`:t.code===`Escape`&&a.onEscape()}})},[E,s.id,s.kind,b,i,a,w,S]),(0,v.useEffect)(()=>{s.kind===`screen`&&dO(f.current,x)},[x,s.kind]);let O=x===`dark`?`light`:`dark`,k=e=>e?.[x]??e?.[O],A=s.kind===`screen`?k(s.snapshots):void 0,j=n&&s.kind===`screen`?k(s.thumbs)??A:A,M=t===`asleep`&&T&&!!j;return(0,R.jsxs)(`div`,{"data-item":s.id,className:`absolute overflow-clip bg-surface`,style:{left:c,top:l,width:u,height:d,boxShadow:`var(--shadow-frame), 0 0 0 1px var(--rule)`},children:[(!T||M)&&j?(0,R.jsx)(`img`,{src:j,alt:``,draggable:!1,loading:`lazy`,decoding:`async`,className:`absolute inset-0 h-full w-full object-cover object-top select-none`}):null,!T&&!j?(0,R.jsx)(nk,{item:s,loading:D}):null,D?(0,R.jsx)(`div`,{className:`absolute inset-0`,style:{contentVisibility:M?`hidden`:`visible`},children:(0,R.jsx)(`iframe`,{ref:h,src:w,title:s.title,allow:m,sandbox:p,className:J(`absolute top-0 left-0 block border-0 transition-opacity duration-200`,T?`opacity-100`:`opacity-0`),style:{width:u,height:d,colorScheme:x},onLoad:()=>{s.kind===`url`?ZO(i,s.id,{ready:!0}):(dO(f.current,x),lO(f.current))}},S)}):null,_||y?null:(0,R.jsx)(`div`,{"data-shield":s.id,className:`absolute inset-0`})]})});function nk({item:e,loading:t}){let n=e.kind===`screen`&&e.missing;return(0,R.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center gap-3 bg-soft text-muted`,children:[(0,R.jsx)(X,{name:n?`alert`:e.kind===`url`?`globe`:ek(e.frame.width),size:Math.max(24,Math.min(96,e.frame.width/12)),strokeWidth:1.25,className:n?`text-danger-text`:void 0}),(0,R.jsx)(`div`,{className:`max-w-[80%] truncate text-center`,style:{fontSize:Math.max(14,e.frame.width/40)},children:n?`Missing file: ${e.kind===`screen`?e.src:``}`:t?`Loading…`:e.title})]})}var rk=(0,v.memo)(function({placed:e,store:t}){let{item:n,x:r,y:i,w:a}=e,o=$O(t,n.id),s=n.tone===`plain`;return(0,R.jsxs)(`div`,{ref:o,"data-item":n.id,className:J(`absolute`,s?``:`rounded-[10px] border border-note-line bg-note px-6 py-5 shadow-frame`),style:{left:r,top:i,width:a},children:[n.title?(0,R.jsx)(`div`,{className:`mb-2 font-semibold text-ink`,style:{fontSize:s?26:19},children:n.title}):null,(0,R.jsx)(VD,{text:n.text,className:s?`prose-plain`:`prose-note`})]})}),ik=(0,v.memo)(function({placed:e,store:t}){let{item:n,x:r,y:i,w:a,h:o}=e;return(0,R.jsx)(`div`,{"data-item":n.id,className:`absolute overflow-clip rounded-[6px] bg-surface`,style:{left:r,top:i,width:a,height:o,boxShadow:`0 0 0 1px var(--rule)`},children:n.missing?(0,R.jsxs)(`div`,{className:`flex h-full items-center justify-center gap-2 text-danger-text`,children:[(0,R.jsx)(X,{name:`alert`,size:20}),` Missing image`]}):(0,R.jsx)(`img`,{src:n.url,alt:n.title,draggable:!1,className:`block h-full w-full object-contain select-none`,onLoad:e=>{let r=e.currentTarget;XO(t,n.id,{w:r.naturalWidth,h:r.naturalHeight})}})})}),ak=(0,v.memo)(function({section:e,x:t,y:n,w:r,store:i}){let a=$O(i,`section:${e.id}`);return!e.title&&!e.description?null:(0,R.jsxs)(`div`,{ref:a,className:`canvas-section absolute`,style:{left:t,top:n,width:Math.min(Math.max(r,720),1400)},children:[e.title?(0,R.jsx)(`div`,{className:`text-[40px] leading-[1.15] font-semibold tracking-[-0.015em] text-ink`,children:e.title}):null,e.description?(0,R.jsx)(`div`,{className:`mt-3 max-w-[1100px]`,children:(0,R.jsx)(VD,{text:e.description,className:`prose-plain`})}):null]})}),ok=280,sk=96,ck=150,lk=110,uk=720,dk=e=>e.kind===`screen`||e.kind===`url`;function fk(e,t){let n=t[e.id];if(e.kind===`screen`||e.kind===`url`){let t=e.frame.width;if(e.frame.height!==`auto`)return{w:t,h:e.frame.height};let r=e.kind===`screen`?e.measuredHeight:void 0;return{w:t,h:n?.h??r??900}}if(e.kind===`note`)return{w:e.width,h:n?.h??Math.max(80,Math.ceil(e.text.length/38)*26+40)};let r=e.width??n?.w??480;return{w:r,h:n?.w?n.h/n.w*r:n?.h??r*.62}}function pk(e,t){return!e.title&&!e.description?0:t[`section:${e.id}`]?.h??(e.title?56:0)+(e.description?60:0)}function mk(e,t){let n=[],r=[];if(e.layout===`free`){let r=0;for(let i of e.sections)for(let e of i.items){let{w:a,h:o}=fk(e,t),s=e.x??r,c=e.y??0;r=Math.max(r,s+a+sk),n.push({item:e,section:i,x:s,y:c,w:a,h:o})}}else{let i=0;for(let a of e.sections){let e=pk(a,t),o=i,s=i+(e?e+lk:0),c=0,l=0,u=0,d=0;for(let e of a.items){a.columns&&d===a.columns&&(s+=l+ck,c=0,l=0,d=0);let{w:r,h:i}=fk(e,t);n.push({item:e,section:a,x:c,y:s,w:r,h:i}),c+=r+sk,u=Math.max(u,c-sk),l=Math.max(l,i),d++}let f=s+l;r.push({section:a,x:0,y:o,w:Math.max(u,e?uk:0),h:f-o,header:e,body:e?e+lk:0}),i=f+ok}}let i=0,a=0,o=0,s=0,c=[...n,...r];return c.length&&(i=Math.min(...c.map(e=>e.x)),a=Math.min(...c.map(e=>e.y)),o=Math.max(...c.map(e=>e.x+e.w)),s=Math.max(...c.map(e=>e.y+e.h))),{items:n,sections:r,bounds:{x:i,y:a,w:o-i,h:s-a}}}function hk(e){return e.items.filter(e=>dk(e.item))}var gk={phone:{width:390,height:844,label:`Phone`},"phone-sm":{width:375,height:667,label:`Phone S`},"phone-lg":{width:430,height:932,label:`Phone L`},tablet:{width:834,height:1194,label:`Tablet`},"tablet-landscape":{width:1194,height:834,label:`Tablet landscape`},laptop:{width:1280,height:800,label:`Laptop`},desktop:{width:1440,height:900,label:`Desktop`},wide:{width:1920,height:1080,label:`Wide`}};Object.keys(gk);var _k=e=>({"--x":e.x,"--y":e.y,"--w":e.w,"--h":e.h});function vk(e){let t=e.item;if(t.kind!==`screen`&&t.kind!==`url`)return``;let n=t.frame.device?gk[t.frame.device]?.label:void 0,r=`${t.frame.width} × ${t.frame.height===`auto`?`auto`:t.frame.height}`;return n?`${n} · ${r}`:r}var yk=(0,v.memo)(function({placed:e,store:t}){let n=e.item.id,r=Y(t,e=>e.selected===n),i=Y(t,e=>e.frames[n]?.errors.length??0);return(0,R.jsxs)(`div`,{"data-at":``,"data-label":n,style:_k(e),className:J(`frame-label pointer-events-auto flex cursor-default items-center gap-1.5 overflow-hidden pb-1.5 text-[12.5px] leading-none whitespace-nowrap select-none`,r?`text-ink`:`text-muted hover:text-ink2`),children:[i?(0,R.jsx)(`span`,{className:`size-[7px] shrink-0 rounded-full bg-danger`,title:`${i} errors`}):null,(0,R.jsx)(`span`,{className:J(`min-w-[3ch] truncate`,r?`font-semibold`:`font-medium`),children:e.item.title}),(0,R.jsx)(`span`,{className:`frame-device min-w-0 shrink-[20] truncate text-[11.5px] text-muted opacity-80`,children:vk(e)})]})}),bk=(0,v.memo)(function({placed:e}){return(0,R.jsx)(`div`,{"data-at":``,style:{"--x":e.x,"--y":e.y,"--body":e.body},className:`section-title text-[15px] leading-none font-semibold whitespace-nowrap text-ink select-none`,children:e.section.title})});function xk({placed:e,kind:t}){return(0,R.jsx)(`div`,{"data-at":``,style:_k(e),className:J(`frame-outline rounded-[1px]`,t===`hover`?`outline outline-[1.5px] outline-action/60`:`outline-2 outline-action outline`)})}function Sk({layout:e,view:t,store:n,overlayRef:r}){let i=Y(n,e=>e.selected),a=Y(n,e=>e.active),o=Y(n,e=>e.hovered),s=Y(n,e=>e.zoomTiny),c=(0,v.useMemo)(()=>e.items.filter(e=>dk(e.item)),[e]),l=(0,v.useMemo)(()=>{if(!t||s)return[];let{x:e,y:n,z:r,w:i,h:a}=t,o={x:-e/r-i/r,y:-n/r-a/r,w:i/r*3,h:a/r*3};return c.filter(e=>JO(e,o))},[c,t,s]),u=(0,v.useMemo)(()=>e.sections.filter(e=>e.section.title),[e]),d=t=>t?e.items.find(e=>e.item.id===t):void 0,f=d(i),p=o&&o!==i?d(o):void 0;return(0,R.jsxs)(`div`,{ref:r,className:`canvas-overlay`,"data-tiny":s,children:[u.map(e=>(0,R.jsx)(bk,{placed:e},e.section.id)),l.map(e=>(0,R.jsx)(yk,{placed:e,store:n},e.item.id)),p?(0,R.jsx)(xk,{placed:p,kind:`hover`}):null,f?(0,R.jsx)(xk,{placed:f,kind:a===i?`active`:`selected`}):null]})}var Ck=12,wk=.4,Tk=20,Ek=110,Dk=.2,Ok=400,kk=.2,Ak=3,jk=8e3;function Mk({layout:e,theme:t,store:n,camera:r,events:i,capture:a,apiRef:o,onPlay:s,onSelect:c,over:l}){let u=(0,v.useRef)(null),d=(0,v.useRef)(null),f=(0,v.useRef)(null),p=(0,v.useRef)(null),[m,h]=(0,v.useState)(null),g=Y(n,e=>e.panning),_=Y(n,e=>e.selected),y=Y(n,e=>e.active),b=(0,v.useMemo)(()=>e.items.filter(e=>dk(e.item)),[e]);(0,v.useLayoutEffect)(()=>{let e=u.current,t=d.current,i=f.current,a,o,s=!1,c=qO(i),l=()=>h({...r.camera,w:e.clientWidth,h:e.clientHeight,moving:s}),m=e=>{t.style.transform=`translate3d(${e.x}px, ${e.y}px, 0) scale(${e.z})`,s||(s=!0,t.classList.add(`moving`)),clearTimeout(a),a=setTimeout(()=>{s=!1,t.classList.remove(`moving`),l()},160);let r=p.current;r&&(r.style.setProperty(`--tx`,String(e.x)),r.style.setProperty(`--ty`,String(e.y)),r.style.setProperty(`--z`,String(e.z))),c(e);let i=e.z<.09;n.get().zoomTiny!==i&&n.set(e=>({...e,zoomTiny:i})),t.classList.toggle(`far`,e.z<.15);let u=e.z<wk;t.classList.toggle(`small-titles`,u),r&&(r.dataset.titles=u?`on`:`off`),o??=setTimeout(()=>{o=void 0,l()},90)};m(r.camera),l();let g=r.subscribe(m),_=e.getBoundingClientRect().left,v=new ResizeObserver(()=>{let t=e.getBoundingClientRect().left;if(t!==_){let e=r.camera;r.set({...e,x:e.x-(t-_)}),_=t}l()});return v.observe(e),()=>{g(),v.disconnect(),clearTimeout(a),clearTimeout(o)}},[r,n]),(0,v.useEffect)(()=>{let t=u.current,n=()=>{let{w:n,h:i}={w:t.clientWidth,h:t.clientHeight},o=e.bounds,s=o.w&&n?Math.min((n-160)/o.w,(i-160)/Math.max(o.h,1)):1;r.minZoom=a?.01:Math.min(.25,Math.max(BO,s*.5))};n();let i=new ResizeObserver(n);return i.observe(t),()=>i.disconnect()},[r,e.bounds,a]),(0,v.useEffect)(()=>{let t=u.current,n=()=>({w:t.clientWidth,h:t.clientHeight});o.current={size:n,openView(){let{w:t,h:i}=n(),a=e.bounds;if(!a.w)return;if(Math.min((t-160)/a.w,(i-160)/Math.max(a.h,1))>=kk)return this.fitAll(!1);let o=e.sections[0]??a,s=Math.min(.5,Math.max(.25,(t-160)/Math.max(o.w,1)));r.set({z:s,x:80-a.x*s,y:80-a.y*s})},fitAll(t=!0){let{w:i,h:a}=n();if(!e.bounds.w)return;let o=WO(e.bounds,i,a,80,1,r.minZoom);t?r.animateTo(o):r.set(o)},fitItem(t,i=!0){let a=e.items.find(e=>e.item.id===t);if(!a)return;let{w:o,h:s}=n(),c=WO(a,o,s,64,1,r.minZoom);i?r.animateTo(c):r.set(c)},zoomBy(e){let{w:t,h:i}=n(),a=r.camera,o=a.z*e,s=(t/2-a.x)/a.z,c=(i/2-a.y)/a.z;r.animateTo({z:o,x:t/2-s*o,y:i/2-c*o},180)},zoomTo(e){let{w:t,h:i}=n(),a=r.camera,o=(t/2-a.x)/a.z,s=(i/2-a.y)/a.z;r.animateTo({z:e,x:t/2-o*e,y:i/2-s*e},220)}}},[o,r,e]);let x=(0,v.useRef)([]),S=(0,v.useRef)(new Map),[C,w]=(0,v.useState)(0),T=Y(n,e=>Nk(e.frames)),E=(0,v.useMemo)(()=>{let e=new Map;if(a){for(let t of b)e.set(t.item.id,`live`);return e}if(!m)return e;let{x:t,y:n,z:r,w:i,h:o}=m,s={x:-t/r,y:-n/r,w:i/r,h:o/r},c={x:s.x-s.w*.25,y:s.y-s.h*.25,w:s.w*1.5,h:s.h*1.5},l=s.x+s.w/2,u=s.y+s.h/2,d=e=>Math.max(0,Math.min(e.x+e.w,s.x+s.w)-Math.max(e.x,s.x))*Math.max(0,Math.min(e.y+e.h,s.y+s.h)-Math.max(e.y,s.y)),f=e=>Math.hypot(e.x+e.w/2-l,e.y+e.h/2-u),p=b.filter(e=>r>=Dk&&JO(e,c)&&e.w*r>=Ek).sort((e,t)=>d(t)-d(e)||f(e)-f(t)).slice(0,Ck).map(e=>e.item.id),h=[y,_].filter(e=>!!e),g=new Set(b.map(e=>e.item.id)),v=new Set(T.split(`
126
+ `)),C=new Set(x.current),w=performance.now(),E=e=>!v.has(e)&&w-(S.current.get(e)??0)<jk,D=Ak-[...C].filter(E).length,O=[];for(let e of new Set([...h,...p]))g.has(e)&&(C.has(e)?O.push(e):(h.includes(e)||!m.moving&&D>0)&&(O.push(e),S.current.set(e,w),D--));let k=[...new Set([...O,...x.current])].filter(e=>g.has(e)).slice(0,Tk);x.current=k;for(let e of S.current.keys())k.includes(e)||S.current.delete(e);for(let t of k)e.set(t,O.includes(t)?`live`:`asleep`);return e},[m,b,y,_,a,T,C]);(0,v.useEffect)(()=>{let e=performance.now(),t=new Set(T.split(`
127
+ `)),n=[...S.current].filter(([e])=>!t.has(e)).map(([,t])=>t+jk-e).filter(e=>e>0);if(!n.length)return;let r=setTimeout(()=>w(e=>e+1),Math.min(...n)+20);return()=>clearTimeout(r)},[E,T]);let D=(0,v.useRef)(null),O=(0,v.useRef)(new Map),k=(0,v.useRef)(null),A=(0,v.useRef)(!1),j=e=>{n.get().panning!==e&&n.set(t=>({...t,panning:e}))};(0,v.useEffect)(()=>{let e=e=>{e.code===`Space`&&!Pk(e.target)&&(A.current=!0,u.current?.classList.add(`cursor-grab`),e.preventDefault())},t=e=>{e.code===`Space`&&(A.current=!1,u.current?.classList.remove(`cursor-grab`))};return window.addEventListener(`keydown`,e),window.addEventListener(`keyup`,t),()=>{window.removeEventListener(`keydown`,e),window.removeEventListener(`keyup`,t)}},[]);let M=e=>{let t=e;return(t?.closest(`[data-shield]`))?.dataset.shield??(t?.closest(`[data-label]`))?.dataset.label??(t?.closest(`[data-item]`))?.dataset.item??null},ee=e=>{if(e.target.closest(`[data-ui]`)||e.button!==0&&e.button!==1)return;if(u.current.setPointerCapture(e.pointerId),O.current.set(e.pointerId,{x:e.clientX,y:e.clientY}),r.interrupt(),O.current.size===2){let[e,t]=[...O.current.values()];k.current={dist:Math.hypot(e.x-t.x,e.y-t.y),midX:(e.x+t.x)/2,midY:(e.y+t.y)/2},D.current=null,j(!0);return}let t=e.button===1||A.current;D.current={id:t?null:M(e.target),startX:e.clientX,startY:e.clientY,lastX:e.clientX,lastY:e.clientY,moved:t},t&&j(!0)},N=e=>{if(O.current.has(e.pointerId)&&O.current.set(e.pointerId,{x:e.clientX,y:e.clientY}),k.current&&O.current.size===2){let[e,t]=[...O.current.values()],n=Math.hypot(e.x-t.x,e.y-t.y),i=(e.x+t.x)/2,a=(e.y+t.y)/2,o=u.current.getBoundingClientRect();r.panBy(i-k.current.midX,a-k.current.midY),r.zoomAt(i-o.left,a-o.top,n/Math.max(k.current.dist,1)),k.current={dist:n,midX:i,midY:a};return}let t=D.current;if(!t){if(!n.get().panning){let t=M(e.target);n.get().hovered!==t&&n.set(e=>({...e,hovered:t}))}return}!t.moved&&Math.hypot(e.clientX-t.startX,e.clientY-t.startY)>3&&(t.moved=!0,j(!0)),t.moved&&r.panBy(e.clientX-t.lastX,e.clientY-t.lastY),t.lastX=e.clientX,t.lastY=e.clientY},P=e=>{O.current.delete(e.pointerId),O.current.size<2&&(k.current=null);let t=D.current;D.current=null,t&&!t.moved&&c(t.id,{x:e.clientX,y:e.clientY}),O.current.size||j(!1)};(0,v.useEffect)(()=>{let e=u.current,t=t=>{if(t.target.closest(`[data-ui]`))return;t.preventDefault();let n=e.getBoundingClientRect(),i=t.deltaMode===1?16:t.deltaMode===2?n.height:1;if(t.ctrlKey||t.metaKey){let e=t.deltaY*i,a=Math.abs(e)<40?.012:.0025;r.zoomAt(t.clientX-n.left,t.clientY-n.top,Math.exp(-e*a))}else r.panBy(-t.deltaX*i,-t.deltaY*i)};return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},[r]);let te=e.sections;return(0,R.jsxs)(`div`,{ref:u,className:J(`canvas-root relative h-full w-full touch-none overflow-clip select-none animate-[q-fade-in_160ms_ease-out]`,g&&`canvas-panning cursor-grabbing`),onPointerDown:ee,onPointerMove:N,onPointerUp:P,onPointerCancel:P,onPointerLeave:()=>n.get().hovered&&n.set(e=>({...e,hovered:null})),onDoubleClick:t=>{let n=M(t.target),r=n?e.items.find(e=>e.item.id===n):void 0;r&&dk(r.item)&&s(r.item.id)},children:[(0,R.jsx)(`div`,{ref:f,className:`canvas-grid`}),(0,R.jsxs)(`div`,{ref:d,className:`canvas-world`,children:[te.map(e=>(0,R.jsx)(ak,{section:e.section,x:e.x,y:e.y,w:e.w,store:n},`section:${e.section.id}`)),e.items.map(e=>{let{item:r}=e;return r.kind===`screen`||r.kind===`url`?(0,R.jsx)(tk,{placed:e,mode:E.get(r.id)??`off`,thumb:!a&&!!m&&e.w*m.z*devicePixelRatio<=Ok,theme:t,store:n,events:i,capture:a},r.id):r.kind===`note`?(0,R.jsx)(rk,{placed:e,store:n},r.id):(0,R.jsx)(ik,{placed:e,store:n},r.id)}),l]}),(0,R.jsx)(Sk,{layout:e,view:m,store:n,overlayRef:p})]})}function Nk(e){return Object.keys(e).filter(t=>e[t].ready).sort().join(`
128
+ `)}function Pk(e){let t=e;return!!t&&(t.isContentEditable||/^(input|textarea|select)$/i.test(t.tagName))}var{PI:Fk}=Math,Ik=Fk+1e-4,Lk=.5,Rk=[1,1];function zk(e,t,n,r=e=>e){return e*r(.5-t*(.5-n))}var{min:Bk}=Math;function Vk(e,t,n){let r=Bk(1,t/n);return Bk(1,e+(Bk(1,1-r)-e)*(r*.275))}function Hk(e){return[-e[0],-e[1]]}function Uk(e,t){return[e[0]+t[0],e[1]+t[1]]}function Wk(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}function Gk(e,t){return[e[0]-t[0],e[1]-t[1]]}function Kk(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}function qk(e,t){return[e[0]*t,e[1]*t]}function Jk(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}function Yk(e,t){return[e[0]/t,e[1]/t]}function Xk(e){return[e[1],-e[0]]}function Zk(e,t){let n=t[0];return e[0]=t[1],e[1]=-n,e}function Qk(e,t){return e[0]*t[0]+e[1]*t[1]}function $k(e,t){return e[0]===t[0]&&e[1]===t[1]}function eA(e){return Math.hypot(e[0],e[1])}function tA(e,t){let n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}function nA(e){return Yk(e,eA(e))}function rA(e,t){return Math.hypot(e[1]-t[1],e[0]-t[0])}function iA(e,t,n){let r=Math.sin(n),i=Math.cos(n),a=e[0]-t[0],o=e[1]-t[1],s=a*i-o*r,c=a*r+o*i;return[s+t[0],c+t[1]]}function aA(e,t,n,r){let i=Math.sin(r),a=Math.cos(r),o=t[0]-n[0],s=t[1]-n[1],c=o*a-s*i,l=o*i+s*a;return e[0]=c+n[0],e[1]=l+n[1],e}function oA(e,t,n){return Uk(e,qk(Gk(t,e),n))}function sA(e,t,n,r){let i=n[0]-t[0],a=n[1]-t[1];return e[0]=t[0]+i*r,e[1]=t[1]+a*r,e}function cA(e,t,n){return Uk(e,qk(t,n))}var lA=[0,0],uA=[0,0],dA=[0,0];function fA(e,t){let n=cA(e,nA(Xk(Gk(e,Uk(e,[1,1])))),-t),r=[],i=1/13;for(let t=i;t<=1;t+=i)r.push(iA(n,e,Ik*2*t));return r}function pA(e,t,n){let r=[],i=1/n;for(let n=i;n<=1;n+=i)r.push(iA(t,e,Ik*n));return r}function mA(e,t,n){let r=Gk(t,n),i=qk(r,.5),a=qk(r,.51);return[Gk(e,i),Gk(e,a),Uk(e,a),Uk(e,i)]}function hA(e,t,n,r){let i=[],a=cA(e,t,n),o=1/r;for(let t=o;t<1;t+=o)i.push(iA(a,e,Ik*3*t));return i}function gA(e,t,n){return[Uk(e,qk(t,n)),Uk(e,qk(t,n*.99)),Gk(e,qk(t,n*.99)),Gk(e,qk(t,n))]}function _A(e,t,n){return e===!1||e===void 0?0:e===!0?Math.max(t,n):e}function vA(e,t,n){return e.slice(0,10).reduce((e,r)=>{let i=r.pressure;return t&&(i=Vk(e,r.distance,n)),(e+i)/2},e[0].pressure)}function yA(e,t={}){let{size:n=16,smoothing:r=.5,thinning:i=.5,simulatePressure:a=!0,easing:o=e=>e,start:s={},end:c={},last:l=!1}=t,{cap:u=!0,easing:d=e=>e*(2-e)}=s,{cap:f=!0,easing:p=e=>--e*e*e+1}=c;if(e.length===0||n<=0)return[];let m=e[e.length-1].runningLength,h=_A(s.taper,n,m),g=_A(c.taper,n,m),_=(n*r)**2,v=[],y=[],b=vA(e,a,n),x=zk(n,i,e[e.length-1].pressure,o),S,C=e[0].vector,w=e[0].point,T=w,E=w,D=T,O=!1;for(let t=0;t<e.length;t++){let{pressure:r}=e[t],{point:s,vector:c,distance:l,runningLength:u}=e[t],f=t===e.length-1;if(!f&&m-u<3)continue;i?(a&&(r=Vk(b,l,n)),x=zk(n,i,r,o)):x=n/2,S===void 0&&(S=x);let k=u<h?d(u/h):1,A=m-u<g?p((m-u)/g):1;x=Math.max(.01,x*Math.min(k,A));let j=(f?e[t]:e[t+1]).vector,M=f?1:Qk(c,j),ee=Qk(c,C)<0&&!O,N=M!==null&&M<0;if(ee||N){Zk(lA,C),Jk(lA,lA,x);for(let e=0;e<=1;e+=.07692307692307693)Kk(uA,s,lA),aA(uA,uA,s,Ik*e),E=[uA[0],uA[1]],v.push(E),Wk(dA,s,lA),aA(dA,dA,s,Ik*-e),D=[dA[0],dA[1]],y.push(D);w=E,T=D,N&&(O=!0);continue}if(O=!1,f){Zk(lA,c),Jk(lA,lA,x),v.push(Gk(s,lA)),y.push(Uk(s,lA));continue}sA(lA,j,c,M),Zk(lA,lA),Jk(lA,lA,x),Kk(uA,s,lA),E=[uA[0],uA[1]],(t<=1||tA(w,E)>_)&&(v.push(E),w=E),Wk(dA,s,lA),D=[dA[0],dA[1]],(t<=1||tA(T,D)>_)&&(y.push(D),T=D),b=r,C=c}let k=[e[0].point[0],e[0].point[1]],A=e.length>1?[e[e.length-1].point[0],e[e.length-1].point[1]]:Uk(e[0].point,[1,1]),j=[],M=[];if(e.length===1){if(!(h||g)||l)return fA(k,S||x)}else{h||g&&e.length===1||(u?j.push(...pA(k,y[0],13)):j.push(...mA(k,v[0],y[0])));let t=Xk(Hk(e[e.length-1].vector));g||h&&e.length===1?M.push(A):f?M.push(...hA(A,t,x,29)):M.push(...gA(A,t,x))}return v.concat(M,y.reverse(),j)}var bA=[0,0];function xA(e){return e!=null&&e>=0}function SA(e,t={}){let{streamline:n=.5,size:r=16,last:i=!1}=t;if(e.length===0)return[];let a=.15+(1-n)*.85,o=Array.isArray(e[0])?e:e.map(({x:e,y:t,pressure:n=Lk})=>[e,t,n]);if(o.length===2){let e=o[1];o=o.slice(0,-1);for(let t=1;t<5;t++)o.push(oA(o[0],e,t/4))}o.length===1&&(o=[...o,[...Uk(o[0],Rk),...o[0].slice(2)]]);let s=[{point:[o[0][0],o[0][1]],pressure:xA(o[0][2])?o[0][2]:.25,vector:[...Rk],distance:0,runningLength:0}],c=!1,l=0,u=s[0],d=o.length-1;for(let e=1;e<o.length;e++){let t=i&&e===d?[o[e][0],o[e][1]]:oA(u.point,o[e],a);if($k(u.point,t))continue;let n=rA(t,u.point);if(l+=n,e<d&&!c){if(l<r)continue;c=!0}Kk(bA,u.point,t),u={point:t,pressure:xA(o[e][2])?o[e][2]:Lk,vector:nA(bA),distance:n,runningLength:l},s.push(u)}return s[0].vector=s[1]?.vector||[0,0],s}function CA(e,t={}){return yA(SA(e,t),t)}var wA={ink:`var(--draw-ink)`,red:`var(--draw-red)`,blue:`var(--draw-blue)`,green:`var(--draw-green)`},TA=e=>Math.round(e*100)/100;function EA(e,t){let n=[];for(let t=0;t+2<e.points.length;t+=3)n.push([e.points[t],e.points[t+1],e.points[t+2]]);let r=CA(n,{size:e.size,thinning:.55,smoothing:.5,streamline:.4,simulatePressure:n.every(e=>e[2]===.5),last:t});if(!r.length)return``;let i=[`M`,TA(r[0][0]),TA(r[0][1]),`Q`];return r.forEach(([e,t],n)=>{let[a,o]=r[(n+1)%r.length];i.push(TA(e),TA(t),TA((e+a)/2),TA((t+o)/2))}),i.push(`Z`),i.join(` `)}function DA([e,t,n,r],i){let a=Math.atan2(r-t,n-e),o=Math.max(10,i*4.5),s=e=>`${TA(n-o*Math.cos(a+e))} ${TA(r-o*Math.sin(a+e))}`;return`M ${TA(e)} ${TA(t)} L ${TA(n)} ${TA(r)} M ${s(.45)} L ${TA(n)} ${TA(r)} L ${s(-.45)}`}var OA=(0,v.memo)(function({stroke:e,done:t=!0}){let n=wA[e.ink],[r=0,i=0,a=0,o=0]=e.points;switch(e.kind){case`pen`:return(0,R.jsx)(`path`,{d:EA(e,t),fill:n});case`arrow`:return(0,R.jsx)(`path`,{d:DA(e.points,e.size),fill:`none`,stroke:n,strokeWidth:e.size,strokeLinecap:`round`,strokeLinejoin:`round`});case`rect`:return(0,R.jsx)(`rect`,{x:Math.min(r,a),y:Math.min(i,o),width:Math.abs(a-r),height:Math.abs(o-i),rx:Math.min(e.size*1.5,Math.abs(a-r)/2,Math.abs(o-i)/2),fill:`none`,stroke:n,strokeWidth:e.size,strokeLinejoin:`round`});case`text`:return(0,R.jsx)(`text`,{x:r,y:i,fill:n,fontSize:e.size,fontFamily:`var(--font-sans)`,fontWeight:500,dominantBaseline:`text-before-edge`,style:{whiteSpace:`pre`},children:(e.text??``).split(`
129
+ `).map((e,t)=>(0,R.jsx)(`tspan`,{x:r,dy:t?`${bT}em`:0,children:e||` `},t))})}});function kA({drawing:e,ghosts:t,draft:n}){return(0,R.jsxs)(R.Fragment,{children:[e?.strokes.map(e=>(0,R.jsx)(OA,{stroke:e},e.id)),t?.map(e=>(0,R.jsx)(`g`,{opacity:.8,children:(0,R.jsx)(OA,{stroke:e.stroke,done:!1})},`${e.peer}:${e.stroke.id}`)),n?(0,R.jsx)(OA,{stroke:n,done:!1}):null]})}function AA(e,t,n){let r=e.points,i=(e,r,i,a)=>{let o=i-e,s=a-r,c=o*o+s*s,l=c?Math.max(0,Math.min(1,((t-e)*o+(n-r)*s)/c)):0;return Math.hypot(t-(e+l*o),n-(r+l*s))};if(e.kind===`text`){let r=xT(e),i=Math.max(r.x-t,0,t-(r.x+r.w)),a=Math.max(r.y-n,0,n-(r.y+r.h));return Math.hypot(i,a)}if(e.kind===`pen`){let e=1/0;if(r.length===3)return Math.hypot(t-r[0],n-r[1]);for(let t=0;t+5<r.length;t+=3)e=Math.min(e,i(r[t],r[t+1],r[t+3],r[t+4]));return e}let[a=0,o=0,s=0,c=0]=r;return e.kind===`arrow`?i(a,o,s,c):Math.min(i(a,o,s,o),i(s,o,s,c),i(s,c,a,c),i(a,c,a,o))}var jA=[{tool:`pen`,icon:`edit`,label:`Pen`,key:`P`},{tool:`arrow`,icon:`arrow-up-right`,label:`Arrow`,key:`A`},{tool:`rect`,icon:`square`,label:`Rectangle`,key:`R`},{tool:`text`,icon:`type`,label:`Text`,key:`T`},{tool:`eraser`,icon:`eraser`,label:`Eraser`,key:`E`}],MA={ink:`Ink`,red:`Red`,blue:`Blue`,green:`Green`},NA=e=>e.map(e=>({...e,id:uT()})),PA=e=>Math.round(e*10)/10;function FA(e,t,n=`ink`){let[r,i]=(0,v.useState)(`pen`),[a,o]=(0,v.useState)(n),s=(0,v.useRef)({undo:[],redo:[]}),[,c]=(0,v.useReducer)(e=>e+1,0);if((0,v.useEffect)(()=>{s.current={undo:[],redo:[]},c()},[t]),!e||!t)return null;let l=e=>{e.strokes.length&&(s.current.undo.push(e),s.current.redo=[],c())},u=n=>e.apply(t,{erase:n.map(e=>e.id)}),d=n=>{let r=s.current,i=r[n].pop();if(!i)return;let a=n===`undo`?r.redo:r.undo;if(i.kind===`add`==(n===`undo`))u(i.strokes),a.push(i);else{let n=NA(i.strokes);e.apply(t,{add:n}),a.push({kind:i.kind,strokes:n})}c()};return{client:e,drawingKey:t,tool:r,setTool:i,ink:a,setInk:o,record:l,eraseNow:u,add(n){e.apply(t,{add:n}),l({kind:`add`,strokes:n})},clear(){let n=e.store.get().drawings[t]?.strokes??[];u(n),l({kind:`erase`,strokes:n})},undo:()=>d(`undo`),redo:()=>d(`redo`),canUndo:s.current.undo.length>0,canRedo:s.current.redo.length>0}}function IA(){let e=(0,v.useRef)(!1);return(0,v.useEffect)(()=>{let t=t=>{t.code===`Space`&&(e.current=!0)},n=t=>{t.code===`Space`&&(e.current=!1)};return window.addEventListener(`keydown`,t),window.addEventListener(`keyup`,n),()=>{window.removeEventListener(`keydown`,t),window.removeEventListener(`keyup`,n)}},[]),e}function LA(e,t){let n=(0,v.useRef)(e);n.current=e,(0,v.useEffect)(()=>{if(!t)return;let e=e=>{let t=n.current;if(!t||Pk(e.target))return;let r=e.metaKey||e.ctrlKey,i=e.key.toLowerCase();if(r&&i===`z`)e.preventDefault(),e.shiftKey?t.redo():t.undo();else if(r&&i===`y`)e.preventDefault(),t.redo();else if(!r&&!e.altKey){let n=jA.find(e=>e.key.toLowerCase()===i);n?t.setTool(n.tool):/^[1-4]$/.test(e.key)&&t.setInk(Qw[Number(e.key)-1])}};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[t])}function RA({editor:e,end:t,compact:n=!1}){return(0,R.jsxs)(`div`,{"data-ui":!0,className:`flex items-center gap-0.5`,children:[jA.map(t=>(0,R.jsx)(kx,{content:(0,R.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[t.label,` `,(0,R.jsx)(S_,{children:t.key})]}),children:(0,R.jsx)(`button`,{type:`button`,"aria-label":t.label,"aria-pressed":e.tool===t.tool,onClick:()=>e.setTool(t.tool),className:J(`inline-flex h-ctrl w-ctrl shrink-0 cursor-pointer items-center justify-center rounded-[6px] border p-0 transition-[color,background-color,scale] duration-100 active:scale-[0.94]`,e.tool===t.tool?`border-action-line bg-action-soft text-action`:`border-transparent bg-transparent text-muted hover:bg-soft2 hover:text-ink2`),children:(0,R.jsx)(X,{name:t.icon,size:16})})},t.tool)),(0,R.jsx)(`div`,{className:`mx-1 h-5 w-px bg-rule`}),n?(0,R.jsx)(ow,{side:`top`,align:`center`,width:170,trigger:(0,R.jsx)(`button`,{type:`button`,"aria-label":`Ink: ${MA[e.ink]}`,className:`inline-flex h-ctrl w-ctrl shrink-0 cursor-pointer items-center justify-center rounded-[6px] border-0 bg-transparent p-0 hover:bg-soft2`,children:(0,R.jsx)(`span`,{className:`size-[14px] rounded-full`,style:{background:wA[e.ink]}})}),children:Qw.map((t,n)=>(0,R.jsxs)(lw,{active:e.ink===t,onSelect:()=>e.setInk(t),hint:n+1,children:[(0,R.jsx)(`span`,{className:`size-[12px] rounded-full`,style:{background:wA[t]}}),MA[t]]},t))}):null,n?null:Qw.map((t,n)=>(0,R.jsx)(kx,{content:(0,R.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[MA[t],` `,(0,R.jsx)(S_,{children:n+1})]}),children:(0,R.jsx)(`button`,{type:`button`,"aria-label":MA[t],"aria-pressed":e.ink===t,onClick:()=>e.setInk(t),className:J(`inline-flex h-ctrl w-[26px] shrink-0 cursor-pointer items-center justify-center rounded-[6px] border-0 bg-transparent p-0 hover:bg-soft2`),children:(0,R.jsx)(`span`,{className:J(`size-[14px] rounded-full`,e.ink===t&&`ring-2 ring-action ring-offset-2 ring-offset-surface`),style:{background:wA[t]}})})},t)),(0,R.jsx)(`div`,{className:`mx-1 h-5 w-px bg-rule`}),(0,R.jsx)(kx,{content:(0,R.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[`Undo `,(0,R.jsx)(S_,{children:`⌘Z`})]}),children:(0,R.jsx)(N_,{icon:`undo`,label:`Undo`,disabled:!e.canUndo,onClick:e.undo})}),(0,R.jsx)(kx,{content:(0,R.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[`Redo `,(0,R.jsx)(S_,{children:`⇧⌘Z`})]}),children:(0,R.jsx)(N_,{icon:`redo`,label:`Redo`,disabled:!e.canRedo,onClick:e.redo})}),(0,R.jsx)(kx,{content:`Erase everything`,children:(0,R.jsx)(N_,{icon:`trash`,label:`Erase everything`,onClick:e.clear})}),t]})}function zA({client:e,drawingKey:t,width:n,height:r,editor:i,sizes:a,className:o,camera:s,onPointerDownCapture:c}){let{drawing:l,ghosts:u}=LO(e,t);(0,v.useLayoutEffect)(()=>{let e=d.current;if(!s||!e)return;let t=()=>{let{x:t,y:n,z:r}=s.camera;e.setAttribute(`viewBox`,`${-t/r} ${-n/r} ${(e.clientWidth||1)/r} ${(e.clientHeight||1)/r}`)};t();let n=s.subscribe(t),r=new ResizeObserver(t);return r.observe(e),()=>{n(),r.disconnect()}},[s]);let d=(0,v.useRef)(null),[f,p]=(0,v.useState)(null),[m,h]=(0,v.useState)(null),g=(0,v.useRef)(null),_=e=>{let t=d.current,n=t?.getScreenCTM();if(!t||!n)return null;let r=new DOMPoint(e.clientX,e.clientY).matrixTransform(n.inverse());return{x:r.x,y:r.y,scale:n.a||1}},y=(0,v.useRef)(null);y.current=m;let b=(0,v.useRef)(i);b.current=i;let x=(0,v.useCallback)(()=>{let e=y.current,t=b.current;y.current=null,h(null),e&&t&&e.value.trim()&&t.add([{id:uT(),kind:`text`,ink:t.ink,size:a.text,points:[PA(e.x),PA(e.y)],text:e.value.replace(/\s+$/,``)}])},[a.text]),S=i?.tool;(0,v.useEffect)(()=>{S!==`text`&&x()},[S,x]),(0,v.useEffect)(()=>x,[x]);let C=n=>{let r=g.current;if(!r?.stroke)return;let i=performance.now();if(!n&&i-r.lastSend<40)return;r.lastSend=i;let a=r.stroke.kind===`pen`?r.sent:0;e.live(t,r.stroke,a),r.sent=r.stroke.points.length},w=(n,r,a)=>{let o=g.current,s=e.store.get().drawings[t]?.strokes??[],c=8/a,l=s.filter(e=>AA(e,n,r)<=c+e.size/2);l.length&&i&&(i.eraseNow(l),o?.erased.push(...l))},T=e=>{if(!i||e.button!==0||c?.(e))return;e.stopPropagation(),e.preventDefault();let t=_(e);if(!t)return;if(m){x();return}d.current?.setPointerCapture(e.pointerId);let n={id:uT(),ink:i.ink},r=null;if(i.tool===`pen`){let i=e.pointerType===`pen`&&e.pressure||.5;r={...n,kind:`pen`,size:a.pen,points:[PA(t.x),PA(t.y),i]}}else(i.tool===`arrow`||i.tool===`rect`)&&(r={...n,kind:i.tool,size:a.line,points:[t.x,t.y,t.x,t.y]});g.current={stroke:r,sent:0,lastSend:0,frame:0,erased:[],startX:t.x,startY:t.y,pointer:e.pointerId},i.tool===`eraser`&&w(t.x,t.y,t.scale),p(r)},E=e=>{let t=g.current;if(!t||t.pointer!==e.pointerId||!i)return;let n=e.nativeEvent.getCoalescedEvents?.()??[e.nativeEvent];for(let r of n.length?n:[e.nativeEvent]){let e=_(r);if(e){if(i.tool===`eraser`)w(e.x,e.y,e.scale);else if(t.stroke?.kind===`pen`){let n=r.pointerType===`pen`&&r.pressure||.5;t.stroke.points.push(PA(e.x),PA(e.y),n)}else t.stroke&&(t.stroke.points=[t.stroke.points[0],t.stroke.points[1],e.x,e.y])}}t.stroke&&!t.frame&&(t.frame=requestAnimationFrame(()=>{t.frame=0,t.stroke&&p({...t.stroke,points:[...t.stroke.points]})})),C(!1)},D=n=>{let r=g.current;if(!r||r.pointer!==n.pointerId||!i)return;g.current=null,cancelAnimationFrame(r.frame),p(null);let o=_(n);if(i.tool===`eraser`){i.record({kind:`erase`,strokes:r.erased});return}if(i.tool===`text`){o&&Math.hypot(o.x-r.startX,o.y-r.startY)*o.scale<6&&h({x:r.startX,y:r.startY-a.text*.6,value:``});return}let s=r.stroke;if(s){if(r.sent&&e.liveEnd(t,s.id),s.kind!==`pen`){let[e=0,t=0,n=0,r=0]=s.points;if(Math.hypot(n-e,r-t)*(o?.scale??1)<4)return;s.points=s.points.map(PA)}i.add([s])}},O=n=>{let r=g.current;r&&r.pointer===n.pointerId&&(g.current=null,cancelAnimationFrame(r.frame),p(null),r.stroke&&r.sent&&e.liveEnd(t,r.stroke.id),r.erased.length&&i?.record({kind:`erase`,strokes:r.erased}))},k=i?i.tool===`text`?`text`:i.tool===`eraser`?`cell`:`crosshair`:void 0,A=(0,v.useMemo)(()=>m?xT({id:`draft`,kind:`text`,ink:`ink`,size:a.text,points:[m.x,m.y],text:m.value}):null,[m,a.text]);return(0,R.jsxs)(`svg`,{ref:d,viewBox:s?void 0:`0 0 ${n??0} ${r??0}`,preserveAspectRatio:s?`xMinYMin meet`:`xMidYMid meet`,role:`img`,"aria-label":i?`Drawing: draw here`:`Drawing`,className:J(`block touch-none select-none`,o),style:{cursor:k,pointerEvents:i?`auto`:`none`},onPointerDown:T,onPointerMove:E,onPointerUp:D,onPointerCancel:O,children:[(0,R.jsx)(kA,{drawing:l,ghosts:u,draft:f}),m&&A&&i?(0,R.jsx)(`foreignObject`,{x:m.x,y:m.y,width:Math.max(A.w+a.text*2,a.text*8),height:A.h+8,children:(0,R.jsx)(`textarea`,{autoFocus:!0,"aria-label":`Text`,value:m.value,onChange:e=>h({...m,value:e.target.value}),onBlur:x,onPointerDown:e=>e.stopPropagation(),onKeyDown:e=>{e.stopPropagation(),(e.key===`Enter`&&!e.shiftKey||e.key===`Escape`)&&(e.preventDefault(),x())},spellCheck:!1,className:`block h-full w-full resize-none overflow-hidden border-0 bg-transparent p-0 outline-none`,style:{font:`500 ${a.text}px/1.25 var(--font-sans)`,color:wA[i.ink],caretColor:wA[i.ink],whiteSpace:`pre`}})}):null]})}var BA={pen:5,line:3.5,text:28},VA=56,HA=(e,t)=>`foss-design.board.${e}.${t}`,UA=(e,t)=>`foss-design.board-camera.${e}.${t}`;function WA(e){try{return sessionStorage.getItem(e)===`1`}catch{return!1}}function GA({client:e,canvasId:t,page:n}){let r=oT(n.id),i=Y(e.store,e=>e.ready),a=Y(e.store,e=>e.canDraw),{drawing:o}=LO(e,r),s=HA(t,n.id),[c,l]=(0,v.useState)(()=>WA(s));if((0,v.useEffect)(()=>{try{c?sessionStorage.setItem(s,`1`):sessionStorage.removeItem(s)}catch{}},[c,s]),!i||!a&&yT(o))return null;let u=`board:${t}:${n.id}`;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(td,{initial:!1,children:c?(0,R.jsx)(qA,{layoutId:u,client:e,canvasId:t,page:n,canDraw:a,onClose:()=>l(!1)},`panel`):null}),c?null:(0,R.jsx)(KA,{layoutId:u,client:e,page:n,onOpen:()=>l(!0)})]})}function KA({layoutId:e,client:t,page:n,onOpen:r}){let{drawing:i,ghosts:a}=LO(t,oT(n.id)),o=(0,v.useMemo)(()=>wT([...i?.strokes??[],...a.map(e=>e.stroke)]),[i,a]);return(0,R.jsx)(kx,{content:`Idea board`,side:`left`,children:(0,R.jsx)(Kf.button,{type:`button`,"data-ui":!0,layoutId:e,"aria-label":`Open the idea board`,onClick:r,style:{borderRadius:10},transition:{type:`spring`,duration:.34,bounce:.12},className:`absolute right-4 bottom-[76px] z-20 flex size-[92px] cursor-pointer flex-col items-center justify-center gap-1 overflow-hidden border border-rule bg-surface p-0 text-muted shadow-pop hover:text-ink2`,children:o?(0,R.jsx)(`svg`,{viewBox:`${o.x-VA} ${o.y-VA} ${o.w+112} ${o.h+112}`,className:`h-full w-full p-1.5`,"aria-hidden":`true`,children:(0,R.jsx)(kA,{drawing:i,ghosts:a})}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(X,{name:`lightbulb`,size:20}),(0,R.jsx)(`span`,{className:`text-[11.5px] font-medium`,children:`Ideas`})]})})})}function qA({layoutId:e,client:t,canvasId:n,page:r,canDraw:i,onClose:a}){let o=oT(r.id),s=FA(i?t:null,o),c=Y(t.store,e=>e.online),l=(0,v.useMemo)(()=>new HO,[]),u=(0,v.useRef)(null),d=(0,v.useCallback)((e=!0)=>{let n=u.current;if(!n)return;let r=wT(t.store.get().drawings[o]?.strokes??[]),i=r?WO(r,n.clientWidth,n.clientHeight,VA,1,l.minZoom):{x:VA,y:VA,z:1};e?l.animateTo(i):l.set(i)},[l,t,o]),f=UA(n,r.id);return(0,v.useLayoutEffect)(()=>{let e=UO(f);e?l.set(e):d(!1);let t,n=l.subscribe(e=>{clearTimeout(t),t=setTimeout(()=>{try{sessionStorage.setItem(f,JSON.stringify(e))}catch{}},250)});return()=>{n(),clearTimeout(t)}},[l,f,d]),LA(s,!0),(0,v.useEffect)(()=>{let e=e=>{Pk(e.target)||(e.key===`Escape`?a():e.shiftKey&&e.code===`Digit1`&&d())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[a,d]),(0,R.jsx)(Kf.div,{"data-ui":!0,role:`dialog`,"aria-label":`Idea board`,layoutId:e,style:{borderRadius:12},transition:{type:`spring`,duration:.34,bounce:.12},className:`absolute inset-4 z-30 flex flex-col overflow-hidden border border-rule bg-surface shadow-pop`,children:(0,R.jsxs)(Kf.div,{initial:{opacity:0},animate:{opacity:1,transition:{delay:.12,duration:.16}},exit:{opacity:0,transition:{duration:.08}},className:`flex min-h-0 grow flex-col`,children:[(0,R.jsxs)(`div`,{className:`flex h-[52px] shrink-0 items-center gap-2 border-b border-rule pr-2 pl-4`,children:[(0,R.jsx)(X,{name:`lightbulb`,size:16,className:`text-muted`}),(0,R.jsx)(`span`,{className:`text-[14px] font-semibold`,children:`Ideas`}),(0,R.jsx)(`span`,{className:`min-w-0 truncate text-[13px] text-muted`,children:r.title}),c?null:(0,R.jsx)(`span`,{className:`text-[12.5px] text-muted`,children:`· Reconnecting…`}),(0,R.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[s?(0,R.jsx)(RA,{editor:s}):(0,R.jsx)(`span`,{className:`px-2 text-[12.5px] text-muted`,children:`View only`}),(0,R.jsx)(`div`,{className:`mx-1 h-5 w-px bg-rule`}),(0,R.jsx)(kx,{content:(0,R.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[`Show all `,(0,R.jsx)(S_,{children:`⇧1`})]}),children:(0,R.jsx)(N_,{icon:`fit`,label:`Show all of the board`,onClick:()=>d()})}),(0,R.jsx)(kx,{content:(0,R.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[`Close `,(0,R.jsx)(S_,{children:`Esc`})]}),children:(0,R.jsx)(N_,{icon:`minimize`,label:`Close the idea board`,onClick:a})})]})]}),(0,R.jsx)(JA,{sheetRef:u,client:t,drawingKey:o,editor:s,camera:l})]})})}function JA({sheetRef:e,client:t,drawingKey:n,editor:r,camera:i}){let a=(0,v.useRef)(null),o=IA(),s=(0,v.useRef)(null),[c,l]=(0,v.useState)(!1);(0,v.useLayoutEffect)(()=>{let e=qO(a.current);return e(i.camera),i.subscribe(e)},[i]),(0,v.useEffect)(()=>{let t=e.current,n=e=>{e.preventDefault();let n=t.getBoundingClientRect(),r=e.deltaMode===1?16:e.deltaMode===2?n.height:1;if(e.ctrlKey||e.metaKey){let t=e.deltaY*r,a=Math.abs(t)<40?.012:.0025;i.zoomAt(e.clientX-n.left,e.clientY-n.top,Math.exp(-t*a))}else i.panBy(-e.deltaX*r,-e.deltaY*r)};return t.addEventListener(`wheel`,n,{passive:!1}),()=>t.removeEventListener(`wheel`,n)},[i,e]);let u=e=>e.button===1||o.current===!0||!r&&e.button===0;return(0,R.jsxs)(`div`,{ref:e,className:J(`relative min-h-0 grow touch-none overflow-hidden bg-surface`,c&&`cursor-grabbing`),onPointerDown:e=>{u(e)&&(e.preventDefault(),i.interrupt(),e.currentTarget.setPointerCapture(e.pointerId),s.current={id:e.pointerId,x:e.clientX,y:e.clientY},l(!0))},onPointerMove:e=>{let t=s.current;t&&t.id===e.pointerId&&(i.panBy(e.clientX-t.x,e.clientY-t.y),t.x=e.clientX,t.y=e.clientY)},onPointerUp:e=>{s.current?.id===e.pointerId&&(s.current=null,l(!1))},onPointerCancel:()=>{s.current=null,l(!1)},children:[(0,R.jsx)(`div`,{ref:a,className:`canvas-grid`}),(0,R.jsx)(zA,{client:t,drawingKey:n,editor:r,sizes:BA,camera:i,className:`absolute inset-0 h-full w-full`,onPointerDownCapture:u})]})}function YA({items:e,value:t,onChange:n,label:r,stretch:i,size:a=`ctrl`}){let o=(0,v.useId)();return(0,R.jsx)(`div`,{role:`group`,"aria-label":r,className:J(`shrink-0 items-center gap-0.5 rounded-[6px] bg-track p-[3px]`,a===`ctrl`?`h-ctrl`:`h-7`,i?`flex`:`inline-flex`),children:e.map(e=>{let r=e.value===t;return(0,R.jsxs)(`button`,{type:`button`,"aria-pressed":r,title:e.title,onClick:()=>n(e.value),className:J(`relative flex h-full cursor-pointer items-center justify-center whitespace-nowrap rounded-[4px] border-0 bg-transparent font-medium transition-colors`,a===`ctrl`?`px-2.5 text-ctrl`:`px-2 text-[12.5px]`,i&&`flex-1`,r?`text-ink`:`text-muted hover:text-ink2`),children:[r?(0,R.jsx)(Kf.span,{layoutId:o,className:`absolute inset-0 z-0 rounded-[4px] bg-surface shadow-[0_1px_2px_rgba(0,0,0,0.10)]`,transition:{type:`spring`,stiffness:520,damping:42}}):null,(0,R.jsx)(`span`,{className:`relative z-[1] flex items-center gap-1.5`,children:e.label})]},e.value)})})}var XA=5500,ZA=350,QA=(e,t)=>e>=window.innerWidth/2&&t<=window.innerHeight/2;function $A({frame:e,note:t,badge:n,children:r}){let[i,a]=(0,v.useState)(!0),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(!1),[m,h]=(0,v.useState)(0),g=(0,v.useRef)(void 0),_=(0,v.useRef)(void 0),y=e=>{a(!0),clearTimeout(g.current),g.current=setTimeout(()=>a(!1),e)},b=(e,t)=>{let n=e>=0&&QA(e,t);clearTimeout(_.current),n?s(!0):_.current=setTimeout(()=>s(!1),ZA)};(0,v.useEffect)(()=>{if(!e)return;let t=()=>{cO(e,{type:`pointer`}),y(XA),h(e=>e+1)};e.addEventListener(`load`,t);let n=sO(e,t=>{if(t.type!==`pointer`)return;if(d(!0),t.x<0)return b(-1,-1);let n=e.getBoundingClientRect(),r=n.left+t.x,i=n.top+t.y;t.down&&QA(r,i)?y(XA):b(r,i)});return()=>{e.removeEventListener(`load`,t),n()}},[e]),(0,v.useEffect)(()=>{let e=e=>b(e.clientX,e.clientY),t=e=>{e.relatedTarget||b(-1,-1)};return window.addEventListener(`pointermove`,e,{passive:!0}),document.addEventListener(`pointerout`,t),()=>{window.removeEventListener(`pointermove`,e),document.removeEventListener(`pointerout`,t),clearTimeout(g.current),clearTimeout(_.current)}},[]),(0,v.useEffect)(()=>{if(u)return;let e=document.documentElement,t=()=>p(!0),n=()=>p(!1);return e.addEventListener(`pointerenter`,t),e.addEventListener(`pointerleave`,n),()=>{e.removeEventListener(`pointerenter`,t),e.removeEventListener(`pointerleave`,n)}},[u]);let x=i||o||c||!u&&f;return(0,R.jsxs)(R.Fragment,{children:[n?(0,R.jsx)(Kf.button,{type:`button`,"aria-label":`Show the page's notice`,initial:!1,animate:x?{opacity:0,scale:.8}:{opacity:1,scale:1},transition:{duration:.2,delay:x?0:.25},onClick:()=>y(XA),tabIndex:x?-1:0,className:J(`absolute top-3 right-3 inline-flex h-7 cursor-pointer items-center gap-1.5 rounded-full border border-rule bg-surface/90 px-2.5 text-[11.5px] text-muted shadow-[0_1px_3px_rgb(0_0_0/0.08)] backdrop-blur-sm hover:text-ink2`,x&&`pointer-events-none`),children:n}):null,(0,R.jsx)(Kf.div,{initial:{opacity:0,scale:.94,y:-4},animate:x?{opacity:1,scale:1,y:0}:{opacity:0,scale:.97,y:-2},transition:x?{type:`spring`,stiffness:420,damping:30}:{duration:.45,ease:`easeOut`},style:{transformOrigin:`top right`},className:J(`absolute top-3 right-3 flex max-w-[calc(100%-24px)] flex-col items-end`,!x&&`pointer-events-none`),"aria-hidden":!x||void 0,onFocus:()=>l(!0),onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||l(!1)},children:(0,R.jsxs)(`div`,{className:`relative flex max-w-full flex-col gap-1 rounded-[8px] border border-rule bg-surface p-1 shadow-pop`,children:[m>0?(0,R.jsx)(Kf.span,{"aria-hidden":!0,initial:{opacity:.55,scale:1},animate:{opacity:0,scale:1.18},transition:{duration:1.1,ease:`easeOut`,delay:.15},className:`pointer-events-none absolute -inset-px rounded-[8px] border-2 border-action`},m):null,r?(0,R.jsx)(`div`,{className:`flex items-center gap-1`,children:r}):null,t?(0,R.jsx)(`div`,{className:`px-2 pb-1 text-[11.5px] leading-snug text-muted`,children:t}):null]})})]})}var ej=(e,t,n)=>`/c/${encodeURIComponent(e)}/full/${encodeURIComponent(t)}?theme=${n}`;function tj(e,t,n){let{frameSandbox:r}=e_(),{base:i}=le();return t?t.kind===`url`?t.url:hO(r?`${i}${ej(e,t.id,t.theme??n)}`:mO(t.url,t.theme??n)):null}function nj({canvasId:e,itemId:t}){let{data:n,error:r,isLoading:i}=i_(e),[,a]=I(),{frameSandbox:o,frameAllow:s,slots:c}=e_(),l=b_(),u=(0,v.useRef)(null),[d,f]=(0,v.useState)(null),p=(0,v.useCallback)(e=>{u.current=e,f(e)},[]),m=new URLSearchParams(window.location.search).get(`theme`),h=n?n.pages.flatMap(e=>e.sections.flatMap(e=>e.items.filter(e=>e.kind===`screen`||e.kind===`url`))):[],g=h.find(e=>e.id===t),_=(g?.kind===`screen`?g.theme:void 0)??(m===`light`||m===`dark`?m:n?.theme??l),y=g?g.kind===`screen`?mO(g.url,_):g.url:``,b=`/c/${encodeURIComponent(e)}`;return(0,v.useEffect)(()=>{g&&(document.title=`${g.title} · ${n?.title??``}`)},[g,n?.title]),(0,v.useEffect)(()=>{let e=e=>{e.key===`Escape`&&a(b)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[a,b]),(0,v.useEffect)(()=>{let r=u.current;if(r&&g?.kind===`screen`)return sO(r,r=>{if(r.type===`keydown`&&r.code===`Escape`)a(b);else if(r.type===`go`){let t=r.target.includes(`/`)?r.target.split(`/`)[1]:r.target;h.some(e=>e.id===t)&&a(ej(e,t,_),{replace:!0})}else r.type===`link`&&n&&gO(r,n,t=>a(ej(e,t,_),{replace:!0}),t)})},[y,g?.kind]),r?(0,R.jsx)(zO,{title:`Canvas not found`,text:r.message}):i||!n?(0,R.jsx)(`div`,{className:`h-dvh bg-surface`}):g?(0,R.jsxs)(`div`,{className:`fixed inset-0 bg-surface`,children:[(0,R.jsx)(`iframe`,{ref:p,src:y,title:g.title,allow:s,sandbox:o,className:`block h-full w-full border-0`,style:{colorScheme:_},onLoad:()=>g.kind===`screen`&&dO(u.current,_)},`${g.id}:${g.kind===`screen`?g.rev:g.url}`),(0,R.jsxs)($A,{frame:d,note:c.fullPlate?.note,badge:c.fullPlate?.badge,children:[(0,R.jsxs)(ye,{href:b,className:`flex h-8 min-w-0 items-center gap-2 rounded-[6px] px-2 text-[12.5px] text-ink2 no-underline hover:bg-soft2 hover:text-ink`,children:[(0,R.jsx)(X,{name:`x`,size:14}),(0,R.jsxs)(`span`,{className:`truncate`,children:[`Back to `,n.title]}),(0,R.jsx)(S_,{children:`esc`})]}),c.fullPlate?.actions]})]}):(0,R.jsx)(zO,{title:`Screen not found`,text:`No screen "${t}" on this canvas.`})}function rj(e){return e.kind===`note`?`note`:e.kind===`image`?`image`:e.kind===`url`?`globe`:e.frame.width<600?`smartphone`:e.frame.width<1100?`tablet`:`monitor`}function ij(e,t){return`/c/${encodeURIComponent(e.id)}/p/${encodeURIComponent(t.id)}`}function aj({canvas:e,page:t,store:n,onPick:r}){let i=Y(n,e=>e.selected),a=Y(n,e=>e.frames);return(0,R.jsxs)(`aside`,{"data-ui":!0,className:`flex w-[264px] shrink-0 flex-col overflow-hidden border-r border-rule bg-surface`,children:[(0,R.jsxs)(`div`,{className:`flex flex-col gap-1 border-b border-rule px-4 py-3.5`,children:[(0,R.jsx)(`div`,{className:`truncate text-[14px] font-semibold`,children:e.title}),e.description?(0,R.jsx)(`div`,{className:`line-clamp-3 text-[12.5px] leading-[1.45] text-muted`,children:e.description}):null]}),(0,R.jsxs)(`div`,{className:`min-h-0 grow overflow-y-auto pb-4`,children:[e.pages.length>1?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{className:`px-4 pt-3 pb-1 text-[12px] text-muted`,children:`Pages`}),(0,R.jsx)(`nav`,{className:`flex flex-col gap-0.5 px-2`,children:e.pages.map(n=>{let r=n.sections.reduce((e,t)=>e+t.items.filter(e=>e.kind===`screen`||e.kind===`url`).length,0);return(0,R.jsxs)(ye,{href:ij(e,n),className:J(`flex h-8 items-center gap-2 rounded-[6px] px-2.5 text-[13.5px] no-underline transition-colors focus-visible:outline-offset-[-2px]`,n.id===t.id?`bg-soft2 font-medium text-ink`:`text-ink2 hover:bg-soft2`),children:[(0,R.jsx)(X,{name:`file`,size:15,className:`text-muted`}),(0,R.jsx)(`span`,{className:`min-w-0 grow truncate`,children:n.title}),(0,R.jsx)(`span`,{className:`text-[12px] text-muted tabular`,children:r})]},n.id)})})]}):null,(0,R.jsx)(`div`,{className:`px-4 pt-3 pb-1 text-[12px] text-muted`,children:e.pages.length>1?t.title:`Layers`}),(0,R.jsx)(`div`,{className:`flex flex-col px-2`,children:t.sections.map(e=>(0,R.jsxs)(`div`,{className:`flex flex-col`,children:[e.title?(0,R.jsxs)(`div`,{className:`flex h-7 items-center gap-2 px-2.5 pt-1 text-[12px] font-medium text-ink2`,children:[(0,R.jsx)(`span`,{className:`truncate`,children:e.title}),(0,R.jsx)(R_,{value:e.items.length})]}):null,e.items.map(t=>{let n=(a[t.id]?.errors.length??0)>0||t.kind===`screen`&&t.missing;return(0,R.jsxs)(`button`,{type:`button`,onClick:()=>r(t.id),className:J(`flex h-8 w-full cursor-pointer items-center gap-2 rounded-[6px] border-0 px-2.5 text-left text-[13px] transition-colors focus-visible:outline-offset-[-2px]`,e.title&&`pl-4`,i===t.id?`bg-action-soft text-ink`:`bg-transparent text-ink2 hover:bg-soft2`),children:[(0,R.jsx)(X,{name:rj(t),size:15,className:`text-muted`}),(0,R.jsx)(`span`,{className:`min-w-0 grow truncate`,children:t.title||(t.kind===`note`?`Note`:t.id)}),n?(0,R.jsx)(`span`,{className:`size-[7px] shrink-0 rounded-full bg-danger`}):null]},t.id)})]},e.id))})]})]})}function oj({canvas:e,page:t,theme:n,onTheme:r,sidebar:i,onSidebar:a,onPlay:o,canPlay:s,inspect:c,onInspect:l}){let[,u]=I(),{slots:d,scope:f}=e_(),p=(0,v.useRef)(null),m=(0,v.useRef)(null),h=vw(p,m,[e.title,t?.title,e.pages.length]);return(0,R.jsxs)(_w,{value:h,children:[(0,R.jsxs)(gw,{children:[d.barStart,d.brand?d.brand:f?(0,R.jsx)(mw,{}):(0,R.jsx)(kx,{content:`All canvases`,children:(0,R.jsx)(ye,{href:`/`,className:`flex items-center`,"aria-label":`All canvases`,children:(0,R.jsx)(mw,{})})}),(0,R.jsx)(N_,{icon:`panel-left`,label:i?`Hide sidebar (⌘\\)`:`Show sidebar (⌘\\)`,onClick:()=>a(!i)}),(0,R.jsxs)(`div`,{ref:p,className:`flex min-w-0 items-center gap-1.5 text-[14px]`,children:[(0,R.jsx)(`span`,{"data-fit":!0,className:`truncate font-semibold`,children:e.title}),t&&e.pages.length>1?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(X,{name:`chevron-right`,size:14,className:`shrink-0 text-muted`}),(0,R.jsxs)(ow,{width:240,trigger:(0,R.jsxs)(`button`,{type:`button`,className:`flex h-ctrl cursor-pointer items-center gap-1 rounded-[6px] border-0 bg-transparent px-2 text-[14px] text-ink2 hover:bg-soft2`,children:[(0,R.jsx)(`span`,{"data-fit":!0,className:`truncate`,children:t.title}),(0,R.jsx)(X,{name:`chevron-down`,size:14,className:`text-muted`})]}),children:[(0,R.jsx)(dw,{children:`Pages`}),e.pages.map(n=>(0,R.jsxs)(lw,{active:n.id===t.id,onSelect:()=>u(ij(e,n)),children:[(0,R.jsx)(X,{name:`file`,size:15,className:`text-muted`}),n.title]},n.id))]})]}):null]}),(0,R.jsxs)(`div`,{ref:m,className:`ml-auto flex shrink-0 items-center gap-2`,children:[(0,R.jsx)(YA,{label:`Screen theme`,value:n,onChange:r,items:[{value:`light`,label:(0,R.jsx)(X,{name:`sun`,size:15}),title:`Light screens`},{value:`dark`,label:(0,R.jsx)(X,{name:`moon`,size:15}),title:`Dark screens`}]}),(0,R.jsx)(uj,{on:c,onChange:l,compact:h}),(0,R.jsx)(kx,{content:(0,R.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[`Play `,(0,R.jsx)(S_,{children:`P`})]}),children:(0,R.jsx)(A_,{kind:`secondary`,icon:`play`,onClick:o,disabled:!s,"aria-label":`Play`,className:h?`w-ctrl px-0`:void 0,children:h?null:`Play`})}),(0,R.jsx)(Mx,{width:180,label:`Search`,compact:h}),(0,R.jsx)(pw,{}),d.barEnd]})]}),d.belowBar?(0,R.jsx)(`div`,{className:`shrink-0`,children:d.belowBar}):null]})}function sj({children:e}){return(0,R.jsx)(`div`,{"data-ui":!0,className:`pointer-events-none absolute inset-x-4 bottom-5 z-20 grid grid-cols-[minmax(var(--dock-left,0px),1fr)_minmax(0,auto)_minmax(var(--dock-right,0px),1fr)]`,children:(0,R.jsx)(`div`,{className:`col-start-2 flex min-w-0 justify-center`,children:e})})}function cj({canvas:e,store:t,layoutItems:n,theme:r,onPlay:i,inspect:a,onMarkup:o}){let s=Y(t,e=>e.selected),c=n.find(e=>e.id===s);return(0,R.jsx)(sj,{children:(0,R.jsx)(td,{children:c?(0,R.jsx)(lj,{canvas:e,store:t,item:c,theme:r,onPlay:i,inspect:a,onMarkup:o},`bar`):null})})}function lj({canvas:e,store:t,item:n,theme:r,onPlay:i,inspect:a,onMarkup:o}){let{slots:s}=e_(),c=Y(t,e=>e.frames[n.id]),l=tj(e.id,n.kind===`screen`||n.kind===`url`?n:void 0,r),u=n.kind===`screen`||n.kind===`url`,d=()=>fO(document.querySelector(`[data-item="${CSS.escape(n.id)}"] iframe`)),f=c?.errors??[];return(0,R.jsxs)(Kf.div,{initial:{opacity:0,y:10,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:10,scale:.98,transition:{duration:.14,ease:`easeIn`}},transition:{type:`spring`,duration:.26,bounce:.12},className:`relative flex w-fit max-w-full min-w-0 flex-col`,children:[(0,R.jsx)(`div`,{className:`pointer-events-none absolute inset-x-5 bottom-full flex justify-center`,children:(0,R.jsx)(td,{children:u&&a?(0,R.jsx)(Kf.div,{initial:{y:`100%`,opacity:0},animate:{y:0,opacity:.9},exit:{y:`100%`,opacity:0},transition:{type:`spring`,duration:.28,bounce:.15},className:`flex h-[22px] min-w-0 items-center rounded-t-[7px] border border-b-0 border-rule bg-surface/80 px-3 text-[11.5px] whitespace-nowrap text-muted backdrop-blur-md`,children:(0,R.jsx)(`span`,{className:`truncate`,children:`Click an element to inspect it`})},`inspect`):null})}),(0,R.jsxs)(`div`,{className:`pointer-events-auto relative flex max-w-full flex-col overflow-hidden rounded-[10px] border border-rule bg-surface shadow-pop`,children:[f.length?(0,R.jsxs)(`div`,{className:`flex max-h-40 items-start gap-2 overflow-y-auto border-b border-rule bg-danger-soft px-3.5 py-2 font-mono text-[12px] whitespace-pre-wrap text-danger-text`,children:[(0,R.jsx)(X,{name:`alert`,size:14,className:`mt-px`}),(0,R.jsx)(`span`,{className:`min-w-0`,children:f.join(`
130
+ `)})]}):null,(0,R.jsxs)(`div`,{className:`flex h-[44px] items-center gap-1 pr-1.5 pl-3.5 [&>:not(:first-child)]:shrink-0`,children:[(0,R.jsx)(`span`,{className:`min-w-0 truncate pr-2 text-[13.5px] font-medium`,children:n.title||n.id}),u?(0,R.jsx)(kx,{content:(0,R.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[`Play `,(0,R.jsx)(S_,{children:`↵`})]}),children:(0,R.jsx)(N_,{icon:`play`,label:`Play`,onClick:()=>i(n.id)})}):null,l?(0,R.jsx)(kx,{content:`Open in a new tab`,children:(0,R.jsx)(`a`,{href:l,target:`_blank`,rel:`noreferrer`,"aria-label":`Open in a new tab`,className:`inline-flex h-ctrl w-ctrl items-center justify-center rounded-[6px] text-muted hover:bg-soft2 hover:text-ink2`,children:(0,R.jsx)(X,{name:`external`,size:16})})}):null,u?(0,R.jsx)(kx,{content:`Reload`,children:(0,R.jsx)(N_,{icon:`refresh`,label:`Reload`,onClick:d})}):null,n.kind===`screen`&&o?(0,R.jsx)(kx,{content:`Mark up`,children:(0,R.jsx)(N_,{icon:`edit`,label:`Mark up`,onClick:()=>o(n.id)})}):null,n.kind===`screen`?(0,R.jsx)(kx,{content:`Copy source path`,children:(0,R.jsx)(N_,{icon:`copy`,label:`Copy source path`,onClick:()=>void FT(n.file,`Path copied`)})}):null,s.selectionActions?.(e.id,n),(0,R.jsx)(kx,{content:(0,R.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[`Zoom to `,(0,R.jsx)(S_,{children:`⇧2`})]}),children:(0,R.jsx)(N_,{icon:`fit`,label:`Zoom to`,onClick:()=>window.dispatchEvent(new CustomEvent(`design:focus`,{detail:{canvas:e.id,item:n.id}}))})})]})]})]})}function uj({on:e,onChange:t,compact:n=!1}){return(0,R.jsx)(kx,{content:(0,R.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[`Inspect elements `,(0,R.jsx)(S_,{children:`I`})]}),children:(0,R.jsxs)(`button`,{type:`button`,"aria-pressed":e,"aria-label":`Inspect elements`,onClick:()=>t(!e),className:J(`inline-flex h-ctrl shrink-0 cursor-pointer items-center justify-center gap-1.5 rounded-[6px] border text-ctrl font-medium`,n?`w-ctrl px-0`:`px-ctrl`,e?`border-action-line bg-action-soft text-action`:`border-rule-strong bg-surface text-ink hover:bg-soft`),children:[(0,R.jsx)(X,{name:`pointer`,size:15}),n?null:`Inspect`]})})}var dj={pen:4,line:3,text:20},fj=600;function pj({layout:e,client:t,store:n,editor:r}){let i=Y(n,e=>e.markup),a=Y(t.store,e=>[...new Set([...Object.keys(e.drawings).filter(t=>e.drawings[t].strokes.length),...Object.keys(e.ghosts)])].sort().join(`
131
+ `)),o=(0,v.useMemo)(()=>new Set(a.split(`
132
+ `)),[a]),s=IA();return(0,R.jsx)(R.Fragment,{children:e.items.filter(e=>e.item.kind===`screen`&&(e.item.id===i||o.has(sT(e.item.id)))).map(e=>(0,R.jsx)(mj,{placed:e,client:t,editor:e.item.id===i?r:null,space:s},e.item.id))})}var mj=(0,v.memo)(function({placed:e,client:t,editor:n,space:r}){let{item:i,x:a,y:o,w:s,h:c}=e;return(0,R.jsx)(`div`,{className:`absolute`,style:{left:a,top:o,width:s,height:c,pointerEvents:n?`auto`:`none`},children:(0,R.jsx)(zA,{client:t,drawingKey:sT(i.id),width:s,height:c,editor:n,sizes:dj,className:`h-full w-full overflow-visible`,onPointerDownCapture:e=>e.button===1||r.current===!0})})});function hj({item:e,editor:t,onDone:n,room:r}){return(0,R.jsx)(sj,{children:(0,R.jsxs)(Kf.div,{initial:{opacity:0,y:10,scale:.98},animate:{opacity:1,y:0,scale:1},transition:{type:`spring`,duration:.26,bounce:.12},className:`pointer-events-auto flex h-[46px] max-w-full min-w-0 items-center gap-1 rounded-[10px] border border-rule bg-surface pr-1.5 pl-3.5 shadow-pop`,children:[(0,R.jsxs)(`span`,{className:`min-w-0 truncate pr-2 text-[13.5px]`,children:[(0,R.jsx)(`span`,{className:`text-muted`,children:`Marking up`}),` `,(0,R.jsx)(`span`,{className:`font-medium`,children:e.title||e.id})]}),(0,R.jsx)(RA,{editor:t,compact:r<fj,end:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{className:`mx-1 h-5 w-px bg-rule`}),(0,R.jsx)(kx,{content:(0,R.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[`Done `,(0,R.jsx)(S_,{children:`Esc`})]}),children:(0,R.jsx)(A_,{kind:`secondary`,onClick:n,children:`Done`})})]})})]})})}var gj=new URLSearchParams(window.location.search),_j=gj.has(`capture`),vj=(e,t)=>`foss-design.camera.${e}.${t}`;function yj(e){let t=b_(),n=gj.get(`theme`),[r,i]=(0,v.useState)(n===`dark`||n===`light`?n:null);return[r??e?.theme??t,i]}function bj({canvasId:e,pageId:t}){let{data:n,error:r,isLoading:i}=i_(e);if(r)return(0,R.jsx)(zO,{title:`Canvas not found`,text:r.message});if(i||!n)return(0,R.jsx)(`div`,{className:`canvas-dots grow`});let a=t??gj.get(`page`)??void 0,o=n.pages.find(e=>e.id===a)??n.pages[0];return(0,R.jsx)(xj,{canvas:n,page:o},`${n.id}/${o?.id??``}`)}function xj({canvas:e,page:t}){let[,n]=I(),r=(0,v.useMemo)(()=>YO(),[]),i=(0,v.useMemo)(()=>new HO,[]),a=(0,v.useRef)(null),[o,s]=yj(e),[c,l]=(0,v.useState)(()=>!_j&&window.innerWidth>900),[u,d]=(0,v.useState)(!1),f=Y(r,e=>e.sizes),p=(0,v.useMemo)(()=>t?mk(t,f):{items:[],sections:[],bounds:{x:0,y:0,w:0,h:0}},[t,f]),m=Dj(Y(r,e=>e.frameEls),p),h=vO(m),g=u||h;(0,v.useEffect)(()=>{r.set(e=>e.inspecting===g?e:{...e,inspecting:g,active:null})},[g,r]);let _=_O(m,g,{onEscape:()=>d(!1)}),y=!!_.info;(0,v.useEffect)(()=>{y&&d(!0)},[y]);let b=_.info;(0,v.useEffect)(()=>{let e=_.frame;if(!e||!b)return;let t=Object.entries(r.get().frameEls).find(([,t])=>t===e)?.[0];t&&r.get().selected!==t&&r.set(e=>({...e,selected:t}))},[_.frame,b,r]);let x=(0,v.useMemo)(()=>hk(p),[p]),S=vj(e.id,t?.id??``),C=(0,v.useRef)(null),w=(0,v.useRef)(null),T=(0,v.useRef)(null),E=Ej(C,w,T,e.issues.length>0),D=FO(e.id,!_j),O=Y(D?.store??RO,e=>e.ready&&e.canDraw),k=Y(r,e=>e.markup),A=k?p.items.find(e=>e.item.id===k)?.item:void 0,j=FA(A&&O?D:null,k?sT(k):null,`red`);LA(j,!!j);let M=(0,v.useCallback)(()=>r.set(e=>e.markup?{...e,markup:null}:e),[r]);(0,v.useEffect)(()=>{k&&(!A||!O||g)&&M()},[k,A,O,g,M]);let ee=(0,v.useRef)(!1);(0,v.useEffect)(()=>{if(ee.current||!p.bounds.w)return;ee.current=!0;let t=u_(e.id),n=_j?null:UO(S);t?(r.set(e=>({...e,selected:t})),requestAnimationFrame(()=>a.current?.fitItem(t,!1))):n&&n.z>=i.minZoom?i.set(n):requestAnimationFrame(()=>_j?a.current?.fitAll(!1):a.current?.openView())},[p,i,S,e.id,r]),(0,v.useEffect)(()=>{if(_j)return;let e,t=i.subscribe(t=>{clearTimeout(e),e=setTimeout(()=>sessionStorage.setItem(S,JSON.stringify(t)),250)});return()=>{t(),clearTimeout(e)}},[i,S]);let N=(0,v.useCallback)(e=>{let t=e?p.items.find(t=>t.item.id===e)?.item:void 0;r.set(e=>({...e,selected:t?t.id:null,active:t&&dk(t)?t.id:null,hovered:null,markup:t&&t.id===e.markup?e.markup:null}))},[p,r]),P=(0,v.useCallback)(e=>{d(!1),r.set(t=>({...t,selected:e,active:null,markup:e,hovered:null})),a.current?.fitItem(e)},[r]),te=(0,v.useCallback)(e=>{N(e),a.current?.fitItem(e)},[N]),ne=(0,v.useCallback)(r=>n(`/c/${encodeURIComponent(e.id)}/play/${encodeURIComponent(r)}${t?`?page=${encodeURIComponent(t.id)}`:``}`),[e.id,t,n]),F=(0,v.useCallback)(()=>{let e=r.get().selected,t=e&&x.find(t=>t.item.id===e)||x[0];t&&ne(t.item.id)},[r,x,ne]);(0,v.useEffect)(()=>{let t=t=>{let n=t.detail;n.canvas===e.id&&p.items.some(e=>e.item.id===n.item)&&(u_(e.id),te(n.item))};return window.addEventListener(`design:focus`,t),()=>window.removeEventListener(`design:focus`,t)},[e.id,p,te]);let re=(0,v.useMemo)(()=>({onGo(r,i){let[a,o]=i.includes(`/`)?i.split(`/`):[null,i],s=a?e.pages.filter(e=>e.id===a):[t,...e.pages.filter(e=>e!==t)];for(let r of s)if(r&&r.sections.some(e=>e.items.some(e=>e.id===o))){r===t?te(o):(n(ij(e,r)),window.dispatchEvent(new CustomEvent(`design:focus`,{detail:{canvas:e.id,item:o}})));return}console.warn(`[design] go("${i}"): no such screen`)},onLink(t,n){gO(n,e,e=>this.onGo(t,e),t)},onWheel(e,t){let n=e.closest(`.canvas-root`);if(!n)return;let r=n.getBoundingClientRect(),a=e.getBoundingClientRect(),o=i.camera.z;if(t.zoom){let e=Math.abs(t.deltaY)<40?.012:.0025;i.zoomAt(a.left-r.left+t.x*o,a.top-r.top+t.y*o,Math.exp(-t.deltaY*e))}else i.panBy(-t.deltaX,-t.deltaY)},onEscape(){r.set(e=>({...e,active:null,selected:null}))}}),[e,t,i,r,te,n]);return(0,v.useEffect)(()=>{if(!_j)return;let e=Date.now(),t=setInterval(()=>{let n=r.get().frames;(x.every(e=>n[e.item.id]?.ready||e.item.kind===`screen`&&e.item.missing)||Date.now()-e>6e4)&&(clearInterval(t),a.current?.fitAll(!1),requestAnimationFrame(()=>requestAnimationFrame(()=>window.__DESIGN_CANVAS_READY__=!0)))},250);return()=>clearInterval(t)},[x,r]),(0,v.useEffect)(()=>{let i=i=>{if(Pk(i.target)||document.querySelector(`[role="dialog"]`))return;let o=a.current,s=r.get(),c=i.metaKey||i.ctrlKey;if(s.markup){i.key===`Escape`&&M();return}if(i.key===`Escape`)_.info?_.select(null):u?d(!1):(s.active||s.selected)&&r.set(e=>({...e,active:null,selected:null}));else if(i.key===`i`&&!c&&!i.altKey)d(e=>!e);else if(i.key===`p`&&!c&&!i.altKey)F();else if(i.shiftKey&&i.code===`Digit1`)o?.fitAll();else if(i.shiftKey&&i.code===`Digit2`&&s.selected)o?.fitItem(s.selected);else if(i.shiftKey&&i.code===`Digit0`)o?.zoomTo(1);else if((i.key===`=`||i.key===`+`)&&!i.altKey)i.preventDefault(),o?.zoomBy(1.4);else if(i.key===`-`&&!i.altKey)i.preventDefault(),o?.zoomBy(1/1.4);else if(c&&i.key===`0`)i.preventDefault(),o?.zoomTo(1);else if(c&&i.key===`\\`)i.preventDefault(),l(e=>!e);else if([`ArrowRight`,`ArrowDown`,`ArrowLeft`,`ArrowUp`].includes(i.key)&&x.length){i.preventDefault();let e=x.findIndex(e=>e.item.id===s.selected),t=i.key===`ArrowRight`||i.key===`ArrowDown`?1:-1,n=x[e===-1?0:(e+t+x.length)%x.length];r.set(e=>({...e,selected:n.item.id,active:null})),o?.fitItem(n.item.id)}else if(i.key===`Enter`&&s.selected){let e=p.items.find(e=>e.item.id===s.selected)?.item;e&&dk(e)&&ne(e.id)}else if(i.key===`]`||i.key===`[`){let r=t?e.pages.indexOf(t):-1,a=e.pages[r+(i.key===`]`?1:-1)];a&&n(ij(e,a))}};return window.addEventListener(`keydown`,i),()=>window.removeEventListener(`keydown`,i)},[r,x,p,ne,F,e,t,n,u,_,M]),_j?(0,R.jsx)(`div`,{className:`flex h-dvh`,children:(0,R.jsx)(Mk,{layout:p,theme:o,store:r,camera:i,events:re,capture:!0,apiRef:a,onPlay:()=>{},onSelect:()=>{}})}):(0,R.jsxs)(`div`,{className:`flex h-dvh flex-col`,children:[(0,R.jsx)(oj,{canvas:e,page:t,theme:o,onTheme:s,sidebar:c,onSidebar:l,inspect:u,onInspect:d,onPlay:F,canPlay:x.length>0}),(0,R.jsxs)(`div`,{className:`flex min-h-0 grow basis-0`,children:[(0,R.jsx)(MO,{open:c&&!!t,side:`left`,width:264,children:t?(0,R.jsx)(aj,{canvas:e,page:t,store:r,onPick:te}):null}),(0,R.jsxs)(`div`,{ref:C,className:`relative min-w-0 grow`,style:E.style,children:[t&&p.items.length?(0,R.jsx)(Mk,{layout:p,theme:o,store:r,camera:i,events:re,capture:!1,apiRef:a,onPlay:ne,over:D?(0,R.jsx)(pj,{layout:p,client:D,store:r,editor:j}):null,onSelect:e=>{e||(_.select(null),d(!1)),N(e)}}):(0,R.jsx)(`div`,{className:`canvas-dots flex h-full`,children:(0,R.jsx)(tv,{title:t?`This page is empty`:`This canvas has no pages`,text:(0,R.jsxs)(R.Fragment,{children:[`Add sections and screens to`,` `,(0,R.jsxs)(`code`,{className:`font-mono text-[13px]`,children:[`.design/canvas/`,e.id,`/canvas.json`]}),`.`]})})}),A&&j?(0,R.jsx)(hj,{item:A,editor:j,onDone:M,room:E.room}):(0,R.jsx)(cj,{canvas:e,store:r,layoutItems:p.items.map(e=>e.item),theme:o,onPlay:ne,inspect:g,onMarkup:O?P:void 0}),(0,R.jsx)(Cj,{ref:w,camera:i,apiRef:a}),D&&t?(0,R.jsx)(GA,{client:D,canvasId:e.id,page:t}):null,e.issues.length?(0,R.jsx)(wj,{ref:T,canvas:e}):null]}),(0,R.jsx)(MO,{open:u,side:`right`,width:320,children:(0,R.jsx)(OO,{info:_.info,active:!0,onSelect:e=>_.select(e),onClose:()=>{d(!1),_.select(null)}})})]})]})}function Sj({camera:e}){let[t,n]=(0,v.useState)(e.camera.z);return(0,v.useEffect)(()=>{let t=0;return e.subscribe(e=>{cancelAnimationFrame(t),t=requestAnimationFrame(()=>n(e.z))})},[e]),(0,R.jsxs)(R.Fragment,{children:[Math.round(t*100),`%`]})}function Cj({ref:e,camera:t,apiRef:n}){return(0,R.jsxs)(`div`,{ref:e,"data-ui":!0,className:`absolute right-4 bottom-5 z-20 flex h-[46px] items-center gap-0.5 rounded-[10px] border border-rule bg-surface px-1.5 shadow-pop`,children:[(0,R.jsx)(N_,{icon:`zoom-out`,label:`Zoom out (−)`,onClick:()=>n.current?.zoomBy(1/1.4)}),(0,R.jsxs)(ow,{side:`top`,align:`end`,width:210,trigger:(0,R.jsx)(`button`,{type:`button`,className:`h-ctrl min-w-[56px] cursor-pointer rounded-[6px] border-0 bg-transparent px-1.5 text-[12.5px] font-medium text-ink2 tabular hover:bg-soft2`,children:(0,R.jsx)(Sj,{camera:t})}),children:[(0,R.jsx)(lw,{onSelect:()=>n.current?.fitAll(),hint:`⇧1`,children:`Zoom to fit`}),(0,R.jsx)(lw,{onSelect:()=>n.current?.zoomTo(1),hint:`⇧0`,children:`100%`}),(0,R.jsx)(uw,{}),[.25,.5,2].map(e=>(0,R.jsxs)(lw,{onSelect:()=>n.current?.zoomTo(e),children:[e*100,`%`]},e))]}),(0,R.jsx)(N_,{icon:`zoom-in`,label:`Zoom in (+)`,onClick:()=>n.current?.zoomBy(1.4)}),(0,R.jsx)(`div`,{className:`mx-0.5 h-5 w-px bg-rule`}),(0,R.jsx)(N_,{icon:`fit`,label:`Zoom to fit (⇧1)`,onClick:()=>n.current?.fitAll()})]})}function wj({ref:e,canvas:t}){let n=t.issues.filter(e=>e.severity===`error`).length;return(0,R.jsxs)(Jw,{children:[(0,R.jsx)(Yw,{asChild:!0,children:(0,R.jsxs)(`button`,{ref:e,type:`button`,"data-ui":!0,className:`absolute bottom-5 left-4 z-20 flex h-[46px] cursor-pointer items-center gap-2 rounded-[10px] border border-rule bg-surface px-3.5 text-[13px] font-medium shadow-pop hover:bg-soft`,children:[(0,R.jsx)(X,{name:`alert`,size:15,className:n?`text-danger-text`:`text-action`}),t.issues.length,` `,t.issues.length===1?`problem`:`problems`,` in canvas.json`]})}),(0,R.jsx)(Xw,{children:(0,R.jsx)(Zw,{side:`top`,align:`start`,sideOffset:8,collisionPadding:12,onFocusOutside:sw,className:`z-50 max-h-[50vh] w-[460px] max-w-[calc(100vw-24px)] overflow-y-auto rounded-[10px] border border-rule bg-surface shadow-pop outline-none data-[state=open]:animate-[q-pop_120ms_ease-out]`,children:(0,R.jsx)(kO,{issues:t.issues})})})]})}var Tj=10;function Ej(e,t,n,r){let[i,a]=(0,v.useState)({area:0,left:0,right:0});return(0,v.useLayoutEffect)(()=>{let r=()=>a(r=>{let i={area:e.current?.clientWidth??0,left:n.current?n.current.offsetWidth+Tj:0,right:t.current?t.current.offsetWidth+Tj:0};return i.area===r.area&&i.left===r.left&&i.right===r.right?r:i});r();let i=new ResizeObserver(r);for(let r of[e.current,n.current,t.current])r&&i.observe(r);return()=>i.disconnect()},[e,n,t,r]),{style:{"--dock-left":`${i.left}px`,"--dock-right":`${i.right}px`},room:Math.max(0,i.area-32-i.left-i.right)}}function Dj(e,t){let n=(0,v.useRef)([]);return(0,v.useMemo)(()=>{let r=new Set(t.items.filter(e=>e.item.kind===`screen`).map(e=>e.item.id)),i=Object.entries(e).filter(e=>!!e[1]&&r.has(e[0])).map(([,e])=>e);return i.length===n.current.length&&i.every((e,t)=>e===n.current[t])||(n.current=i),n.current},[e,t])}var Oj=48,kj=Math.max(0,Math.floor(Number(new URLSearchParams(window.location.search).get(`max`))||0));function Aj(e){let t=e<1e3?Math.min(2,1e3/e):1,n=kj?Math.min(kj,3200):3200;return e*t>n?n/e:t}var jj=(e,t)=>kj&&e&&t?Math.min(1,kj/Math.max(e,t)):1;function Mj(e,t=0,n=0,r=1){(0,v.useEffect)(()=>{if(!e)return;window.__DESIGN_DRAWING_SIZE__=t&&n?{width:t,height:n}:void 0,window.__DESIGN_DRAWING_PARTS__=r;let i=requestAnimationFrame(()=>requestAnimationFrame(()=>{window.__DESIGN_DRAWING_READY__=!0}));return()=>cancelAnimationFrame(i)},[e,t,n,r])}function Nj({canvasId:e,pageId:t}){let n=FO(e),r=Y(n?.store??RO,e=>e.ready);return n?(0,R.jsx)(Pj,{client:n,pageId:t,ready:r}):null}function Pj({client:e,pageId:t,ready:n}){let{drawing:r}=LO(e,oT(t)),i=(0,v.useMemo)(()=>TT(r?.strokes??[]).map(({box:e,strokes:t})=>{let n={x:e.x-Oj,y:e.y-Oj,w:e.w+96,h:e.h+96},r=Aj(Math.max(n.w,n.h));return{crop:n,strokes:t,width:Math.ceil(n.w*r),height:Math.ceil(n.h*r)}}),[r]);return Mj(n,Math.max(0,...i.map(e=>e.width)),i.reduce((e,t)=>e+t.height,0),i.length),(0,R.jsx)(`div`,{className:`flex flex-col items-start`,children:i.map((e,t)=>(0,R.jsx)(`div`,{"data-part":t,className:`bg-surface`,style:{width:e.width,height:e.height},children:(0,R.jsx)(`svg`,{viewBox:`${e.crop.x} ${e.crop.y} ${e.crop.w} ${e.crop.h}`,width:e.width,height:e.height,"aria-hidden":`true`,children:(0,R.jsx)(kA,{drawing:{strokes:e.strokes,erased:[]}})})},e.strokes[0].id))})}var Fj={onGo(){},onLink(){},onWheel(){},onEscape(){}};function Ij({canvasId:e,itemId:t}){let{data:n,error:r}=i_(e),i=FO(e),a=(0,v.useMemo)(()=>YO(),[]),o=Y(a,e=>e.sizes),s=(0,v.useMemo)(()=>{for(let e of n?.pages??[])for(let n of e.sections)for(let e of n.items)if(e.id===t&&e.kind===`screen`)return{item:e,section:n};return null},[n,t]),c=Y(a,e=>s?!!e.frames[s.item.id]?.ready:!1),l=Y(i?.store??RO,e=>e.ready),u=s?fk(s.item,o):{w:0,h:0},d=jj(u.w,u.h);if(Mj(c&&l,Math.round(u.w*d),Math.ceil(u.h*d)),r)return(0,R.jsx)(zO,{title:`Canvas not found`,text:r.message});if(!n||!i)return null;if(!s)return(0,R.jsx)(zO,{title:`Screen not found`,text:`No screen "${t}" in "${e}".`});let f=new URLSearchParams(window.location.search).get(`theme`),p=f===`dark`||f===`light`?f:n.theme??`light`,m={item:s.item,section:s.section,x:0,y:0,w:u.w,h:u.h};return(0,R.jsx)(`div`,{className:`overflow-hidden`,style:{width:u.w*d,height:u.h*d},children:(0,R.jsxs)(`div`,{className:`relative origin-top-left`,style:{width:u.w,height:u.h,transform:d<1?`scale(${d})`:void 0},children:[(0,R.jsx)(tk,{placed:m,mode:`live`,thumb:!1,theme:p,store:a,events:Fj,capture:!0}),(0,R.jsx)(`div`,{className:`absolute inset-0`,children:(0,R.jsx)(zA,{client:i,drawingKey:sT(t),width:u.w,height:u.h,sizes:dj,className:`h-full w-full overflow-visible`})})]})})}function Lj({open:e,onOpenChange:t,title:n,children:r}){return(0,R.jsx)(gg,{open:e,onOpenChange:t,children:(0,R.jsx)(td,{children:e?(0,R.jsxs)(bg,{forceMount:!0,children:[(0,R.jsx)(Sg,{asChild:!0,forceMount:!0,children:(0,R.jsx)(Kf.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.16},className:`fixed inset-0 z-50 bg-overlay`})}),(0,R.jsx)(Eg,{asChild:!0,forceMount:!0,"aria-describedby":void 0,children:(0,R.jsxs)(Kf.div,{initial:{y:`100%`},animate:{y:0},exit:{y:`100%`,transition:{duration:.18,ease:`easeIn`}},transition:{type:`spring`,stiffness:420,damping:40},className:`fixed inset-x-0 bottom-0 z-50 flex max-h-[82dvh] flex-col rounded-t-[14px] border-t border-rule bg-surface pb-[env(safe-area-inset-bottom)] shadow-pop outline-none`,children:[(0,R.jsx)(`div`,{className:`flex justify-center pt-2`,children:(0,R.jsx)(`span`,{"aria-hidden":!0,className:`h-1 w-9 rounded-full bg-rule-strong`})}),(0,R.jsxs)(`div`,{className:`flex min-h-[48px] items-center justify-between gap-3 pr-2 pl-4`,children:[(0,R.jsx)(jg,{className:`m-0 truncate text-[15px] font-semibold`,children:n}),(0,R.jsx)(Ng,{asChild:!0,children:(0,R.jsx)(N_,{icon:`x`,label:`Close`})})]}),(0,R.jsx)(`div`,{className:`min-h-0 overflow-y-auto overscroll-contain border-t border-rule`,children:r})]})})]}):null})})}function Rj(e,t){return(t?e.pages.filter(e=>e.id===t):e.pages).flatMap(t=>t.sections.flatMap(n=>n.items.filter(e=>e.kind===`screen`||e.kind===`url`).map(r=>({item:r,pageId:t.id,where:[e.pages.length>1?t.title:null,n.title].filter(Boolean).join(` · `)}))))}var zj=(e,t,n)=>`/c/${encodeURIComponent(e)}/play/${encodeURIComponent(t)}?page=${encodeURIComponent(n)}`;function Bj({canvasId:e,itemId:t}){let{data:n,error:r,isLoading:i}=i_(e);return r?(0,R.jsx)(zO,{title:`Canvas not found`,text:r.message}):i||!n?null:(0,R.jsx)(Vj,{canvas:n,itemId:t})}function Vj({canvas:e,itemId:t}){let[,n]=I(),{frameSandbox:r,frameAllow:i,slots:a}=e_(),o=new URLSearchParams(window.location.search).get(`page`)??(window.location.hash.split(`?`)[1]?new URLSearchParams(window.location.hash.split(`?`)[1]).get(`page`):null),s=(0,v.useMemo)(()=>Rj(e,null),[e]),c=s.find(e=>e.item.id===t),l=o??c?.pageId??null,u=(0,v.useMemo)(()=>l?Rj(e,l):s,[e,l,s]),d=u.findIndex(e=>e.item.id===t),f=b_(),[p,m]=(0,v.useState)(e.theme??f),[h,g]=(0,v.useState)(`fit`),_=(0,v.useRef)(null),y=(0,v.useRef)(null),[b,x]=(0,v.useState)(null),S=(0,v.useCallback)(e=>{y.current=e,x(e)},[]),[C,w]=(0,v.useState)(!1),[T,E]=(0,v.useState)({w:0,h:0}),[D,O]=(0,v.useState)([]),k=l?`/c/${encodeURIComponent(e.id)}/p/${encodeURIComponent(l)}`:`/c/${encodeURIComponent(e.id)}`,A=t=>{if(!u.length)return;let r=u[(d+t+u.length)%u.length];n(zj(e.id,r.item.id,r.pageId),{replace:!0})};(0,v.useLayoutEffect)(()=>{let e=_.current;if(!e)return;let t=new ResizeObserver(()=>E({w:e.clientWidth,h:e.clientHeight}));return t.observe(e),()=>t.disconnect()},[]),(0,v.useEffect)(()=>{let e=e=>{Pk(e.target)||document.querySelector(`[role="dialog"]`)||(e.key===`ArrowRight`?A(1):e.key===`ArrowLeft`?A(-1):e.key===`i`&&!e.metaKey&&!e.ctrlKey&&!e.altKey?w(e=>!e):e.key===`Escape`&&(re.info?re.select(null):C?w(!1):n(k)))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)});let j=u[d],M=j?.item,ee=M?.kind===`screen`?M.theme??p:p,N=tj(e.id,M,ee),[P]=(0,v.useState)(ee),te=M?M.kind===`screen`?mO(M.url,P):M.url:``,ne=(0,v.useMemo)(()=>b&&M?.kind===`screen`?[b]:[],[b,M?.kind]),F=vO(ne),re=_O(ne,C||F,{onEscape:()=>w(!1)}),ie=!!re.info;if((0,v.useEffect)(()=>{ie&&w(!0)},[ie]),(0,v.useEffect)(()=>{let t=y.current;if(t&&M?.kind===`screen`)return O([]),sO(t,t=>{if(t.type===`error`)O(e=>aO(e,t.message));else if(t.type===`updated`)O([]);else if(t.type===`keydown`&&t.code===`Escape`)n(k);else if(t.type===`go`){let[r,i]=t.target.includes(`/`)?t.target.split(`/`):[null,t.target],a=s.find(e=>e.item.id===i&&(!r||e.pageId===r));a&&n(zj(e.id,a.item.id,a.pageId))}else t.type===`link`&&gO(t,e,t=>{let r=s.find(e=>e.item.id===t);r&&n(zj(e.id,r.item.id,r.pageId))},M?.id)})},[M,te,s,e.id,n,k]),(0,v.useEffect)(()=>{M?.kind===`screen`&&dO(y.current,ee)},[ee,M]),!M)return(0,R.jsx)(zO,{title:`Screen not found`,text:`No screen "${t}" on this canvas.`});let ae=M.frame.width,oe=M.frame.height===`auto`?Math.max(T.h-48,400):M.frame.height,se=h===`fit`?Math.min(1,(T.w-48)/ae,(T.h-48)/oe):1,ce=ae<=T.w-48&&oe<=T.h-48;return(0,R.jsxs)(`div`,{className:`flex h-dvh flex-col`,children:[(0,R.jsxs)(gw,{children:[a.barStart,(0,R.jsx)(kx,{content:(0,R.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[`Back to canvas `,(0,R.jsx)(S_,{children:`esc`})]}),children:(0,R.jsx)(ye,{href:k,className:`inline-flex h-ctrl w-ctrl items-center justify-center rounded-[6px] text-muted hover:bg-soft2 hover:text-ink2`,"aria-label":`Back to canvas`,children:(0,R.jsx)(X,{name:`arrow-left`,size:16})})}),(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-col leading-tight`,children:[(0,R.jsx)(`span`,{className:`truncate text-[14px] font-semibold`,children:M.title}),(0,R.jsx)(`span`,{className:`truncate text-[12px] text-muted`,children:[e.title,j.where].filter(Boolean).join(` · `)})]}),(0,R.jsxs)(`div`,{className:`mx-auto flex items-center gap-1`,children:[(0,R.jsx)(N_,{icon:`chevron-left`,label:`Previous screen (←)`,onClick:()=>A(-1),disabled:u.length<2}),(0,R.jsxs)(`span`,{className:`min-w-[52px] text-center text-[12.5px] text-muted tabular`,children:[d+1,` / `,u.length]}),(0,R.jsx)(N_,{icon:`chevron-right`,label:`Next screen (→)`,onClick:()=>A(1),disabled:u.length<2})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[ce?null:(0,R.jsx)(YA,{label:`Scale`,value:h,onChange:g,items:[{value:`fit`,label:`Fit`},{value:`actual`,label:`100%`}]}),M.kind===`screen`&&!M.theme?(0,R.jsx)(YA,{label:`Screen theme`,value:p,onChange:m,items:[{value:`light`,label:(0,R.jsx)(X,{name:`sun`,size:15}),title:`Light`},{value:`dark`,label:(0,R.jsx)(X,{name:`moon`,size:15}),title:`Dark`}]}):null,M.kind===`screen`?(0,R.jsx)(uj,{on:C,onChange:w}):null,(0,R.jsx)(N_,{icon:`refresh`,label:`Reload`,onClick:()=>fO(y.current)}),N?(0,R.jsx)(`a`,{href:N,target:`_blank`,rel:`noreferrer`,title:`Open in a new tab`,className:`inline-flex h-ctrl w-ctrl items-center justify-center rounded-[6px] text-muted hover:bg-soft2 hover:text-ink2`,children:(0,R.jsx)(X,{name:`external`,size:16})}):null,(0,R.jsx)(pw,{}),a.barEnd]})]}),a.belowBar?(0,R.jsx)(`div`,{className:`shrink-0`,children:a.belowBar}):null,(0,R.jsxs)(`div`,{className:`flex min-h-0 grow basis-0`,children:[(0,R.jsxs)(`div`,{ref:_,className:`canvas-dots relative min-w-0 grow overscroll-none ${h===`actual`?`overflow-auto`:`overflow-hidden`}`,children:[D.length?(0,R.jsxs)(`div`,{className:`absolute inset-x-0 top-0 z-10 flex items-start gap-2 border-b border-rule bg-danger-soft px-4 py-2 font-mono text-[12px] whitespace-pre-wrap text-danger-text`,children:[(0,R.jsx)(X,{name:`alert`,size:14,className:`mt-px`}),D.join(`
133
+ `)]}):null,(0,R.jsx)(`div`,{className:`flex min-h-full min-w-full items-center justify-center p-6`,style:{width:h===`actual`?ae+48:void 0},children:(0,R.jsx)(`div`,{className:`shrink-0 animate-[q-fade-in_160ms_ease-out] overflow-clip bg-surface`,style:{width:ae*se,height:oe*se,boxShadow:`var(--shadow-frame), 0 0 0 1px var(--rule)`},children:(0,R.jsx)(`iframe`,{ref:S,src:te,title:M.title,allow:i,sandbox:r,className:`block border-0`,style:{width:ae,height:oe,transform:`scale(${se})`,transformOrigin:`0 0`,colorScheme:ee},onLoad:()=>M.kind===`screen`&&dO(y.current,ee)},`${M.id}:${M.kind===`screen`?M.rev:M.url}`)},M.id)})]}),(0,R.jsx)(MO,{open:C,side:`right`,width:320,children:(0,R.jsx)(OO,{info:re.info,active:!0,onSelect:e=>re.select(e),onClose:()=>{w(!1),re.select(null)}})})]})]})}var Hj=12;function Uj({canvasId:e,pageId:t,itemId:n}){let{data:r,error:i,isLoading:a}=i_(e);return i?(0,R.jsx)(zO,{title:`Canvas not found`,text:i.message}):a||!r?(0,R.jsx)(`div`,{className:`canvas-dots h-dvh`}):(0,R.jsx)(Wj,{canvas:r,pageId:t,itemId:n})}function Wj({canvas:e,pageId:t,itemId:n}){let[,r]=I(),{frameSandbox:i,frameAllow:a,slots:o,scope:s}=e_(),c=b_(),l=(0,v.useMemo)(()=>Rj(e,null),[e]),u=Math.max(0,n?l.findIndex(e=>e.item.id===n):t?l.findIndex(e=>e.pageId===t):0),d=l[u],f=d?.item,[p,m]=(0,v.useState)(e.theme??c),[h,g]=(0,v.useState)(!1),[_,y]=(0,v.useState)([]),[b,x]=(0,v.useState)(0),[S,C]=(0,v.useState)(null),[w,T]=(0,v.useState)(0),[E,D]=(0,v.useState)(!1),O=(0,v.useRef)(null),k=(0,v.useRef)(null),[A,j]=(0,v.useState)(null),M=(0,v.useCallback)(e=>{e&&(k.current=e,j(e))},[]),ee=(0,v.useCallback)((t,n=0)=>{T(n),r(zj(e.id,t.item.id,t.pageId),{replace:!0})},[e.id,r]),N=e=>{l.length<2||ee(l[(u+e+l.length)%l.length],e)},P=e=>{let t=l.find(t=>t.item.id===e);t&&ee(t,l.indexOf(t)>u?1:-1)};(0,v.useLayoutEffect)(()=>{let e=O.current;if(!e)return;let t=new ResizeObserver(()=>x(e.clientWidth));return t.observe(e),()=>t.disconnect()},[]);let te=f?.kind===`screen`?f.theme??p:p,[ne]=(0,v.useState)(te),F=f?f.kind===`screen`?mO(f.url,ne):f.url:``,re=tj(e.id,f,te);(0,v.useEffect)(()=>{y([]),C(f?.kind===`screen`?f.measuredHeight??null:null),O.current?.scrollTo({top:0});let t=k.current;if(t&&f?.kind===`screen`)return sO(t,t=>{t.type===`size`?C(t.height):t.type===`error`?y(e=>aO(e,t.message)):t.type===`updated`?y([]):t.type===`go`?P(t.target.includes(`/`)?t.target.split(`/`)[1]:t.target):t.type===`link`&&gO(t,e,P,f.id)})},[A,F]),(0,v.useEffect)(()=>{f?.kind===`screen`&&dO(k.current,te)},[te,f]),(0,v.useEffect)(()=>{let e=e=>{document.querySelector(`[role="dialog"]`)||(e.key===`ArrowRight`?N(1):e.key===`ArrowLeft`&&N(-1))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)});let ie=(0,v.useRef)(null),ae=e=>{let t=e.touches[0];ie.current=t?{x:t.clientX,y:t.clientY}:null},oe=e=>{let t=ie.current,n=e.changedTouches[0];if(ie.current=null,!t||!n)return;let r=n.clientX-t.x,i=n.clientY-t.y;Math.abs(r)>56&&Math.abs(r)>Math.abs(i)*1.5&&N(r<0?1:-1)};if(!f||!d)return(0,R.jsxs)(`div`,{className:`flex h-dvh flex-col`,children:[(0,R.jsx)(Kj,{canvas:e,title:e.title,sub:null}),(0,R.jsx)(zO,{title:`No screens here`,text:`This canvas has no screens to show yet.`})]});let se=f.frame.width,ce=b?Math.min(1,(b-24)/se):0,le=ce>0&&ce<.8,ue=le&&E?1:ce,de=f.frame.height===`auto`?Math.max(S??0,480):f.frame.height,fe=f.kind===`screen`&&!f.theme;return(0,R.jsxs)(`div`,{className:`flex h-dvh flex-col`,children:[(0,R.jsx)(Kj,{canvas:e,title:f.title||f.id,sub:[e.title,d.where].filter(Boolean).join(` · `),back:s?void 0:`/`,end:(0,R.jsxs)(R.Fragment,{children:[le?(0,R.jsx)(N_,{icon:E?`zoom-out`:`zoom-in`,label:E?`Fit to width`:`Actual size`,onClick:()=>D(e=>!e)}):null,(0,R.jsxs)(ow,{align:`end`,width:220,trigger:(0,R.jsx)(N_,{icon:`more`,label:`Screen options`}),children:[fe?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(dw,{children:`Screen theme`}),(0,R.jsx)(Gj,{value:`light`,current:p,onPick:m}),(0,R.jsx)(Gj,{value:`dark`,current:p,onPick:m}),(0,R.jsx)(uw,{})]}):null,(0,R.jsxs)(lw,{onSelect:()=>fO(k.current),children:[(0,R.jsx)(X,{name:`refresh`,size:15,className:`text-ink2`}),`Reload screen`]}),re?(0,R.jsxs)(lw,{onSelect:()=>window.open(re,`_blank`,`noopener`),children:[(0,R.jsx)(X,{name:`external`,size:15,className:`text-ink2`}),`Open in a new tab`]}):null,(0,R.jsxs)(lw,{onSelect:()=>v_(c===`dark`?`light`:`dark`),children:[(0,R.jsx)(X,{name:c===`dark`?`sun`:`moon`,size:15,className:`text-ink2`}),c===`dark`?`Light appearance`:`Dark appearance`]})]}),o.barEnd]})}),o.belowBar?(0,R.jsx)(`div`,{className:`shrink-0`,children:o.belowBar}):null,(0,R.jsxs)(`div`,{ref:O,onTouchStart:ae,onTouchEnd:oe,className:J(`canvas-dots relative min-h-0 grow overflow-y-auto overscroll-contain`,le&&E?`overflow-x-auto`:`overflow-x-hidden`),children:[_.length?(0,R.jsxs)(`div`,{className:`sticky top-0 z-10 flex items-start gap-2 border-b border-rule bg-danger-soft px-4 py-2 font-mono text-[12px] whitespace-pre-wrap text-danger-text`,children:[(0,R.jsx)(X,{name:`alert`,size:14,className:`mt-px shrink-0`}),(0,R.jsx)(`span`,{className:`min-w-0 break-words`,children:_.join(`
134
+ `)})]}):null,(0,R.jsx)(td,{initial:!1,mode:`popLayout`,custom:w,children:(0,R.jsx)(Kf.div,{custom:w,initial:{opacity:0,x:w*40},animate:{opacity:1,x:0},exit:{opacity:0,x:w*-40,transition:{duration:.12}},transition:{type:`spring`,stiffness:420,damping:38},className:J(`flex`,le&&E?`w-max`:`justify-center`),style:{padding:Hj},children:ue?(0,R.jsx)(`div`,{className:`shrink-0 overflow-hidden rounded-[6px] bg-surface`,style:{width:se*ue,height:de*ue,boxShadow:`var(--shadow-frame), 0 0 0 1px var(--rule)`},children:(0,R.jsx)(`iframe`,{ref:M,src:F,title:f.title,allow:a,sandbox:i,className:`block border-0`,style:{width:se,height:de,transform:`scale(${ue})`,transformOrigin:`0 0`,colorScheme:te},onLoad:()=>f.kind===`screen`&&dO(k.current,te)},`${f.id}:${f.kind===`screen`?f.rev:f.url}`)}):null},f.id)})]}),(0,R.jsxs)(`nav`,{"aria-label":`Screens`,className:`flex shrink-0 items-center gap-1 border-t border-rule bg-surface px-2 pt-1.5 pb-[max(6px,env(safe-area-inset-bottom))]`,children:[(0,R.jsx)(N_,{icon:`chevron-left`,label:`Previous screen`,onClick:()=>N(-1),disabled:l.length<2}),(0,R.jsxs)(`button`,{type:`button`,onClick:()=>g(!0),className:`flex h-10 min-w-0 grow cursor-pointer items-center justify-center gap-2 rounded-[8px] border-0 bg-transparent px-3 text-[13.5px] text-ink active:bg-soft2`,children:[(0,R.jsx)(X,{name:`list`,size:15,className:`shrink-0 text-muted`}),(0,R.jsxs)(`span`,{className:`tabular shrink-0 text-muted`,children:[u+1,` / `,l.length]}),(0,R.jsx)(`span`,{className:`min-w-0 truncate font-medium`,children:f.title||f.id})]}),(0,R.jsx)(N_,{icon:`chevron-right`,label:`Next screen`,onClick:()=>N(1),disabled:l.length<2})]}),(0,R.jsx)(Lj,{open:h,onOpenChange:g,title:e.title,children:(0,R.jsx)(Jj,{canvas:e,current:f.id,onPick:e=>{g(!1),P(e)}})})]})}function Gj({value:e,current:t,onPick:n}){return(0,R.jsxs)(lw,{active:t===e,onSelect:()=>n(e),children:[(0,R.jsx)(X,{name:e===`dark`?`moon`:`sun`,size:15,className:`text-ink2`}),e===`dark`?`Dark`:`Light`,t===e?(0,R.jsx)(X,{name:`check`,size:15,className:`ml-auto text-ink2`}):null]})}function Kj({canvas:e,title:t,sub:n,back:r,end:i}){let{slots:a}=e_();return(0,R.jsxs)(`header`,{className:`flex h-[52px] shrink-0 items-center gap-2 border-b border-rule bg-surface pr-2 pl-2 pt-[env(safe-area-inset-top)]`,children:[a.barStart,r?(0,R.jsx)(ye,{href:r,"aria-label":`All canvases, leaving ${e.title}`,className:`inline-flex size-10 shrink-0 items-center justify-center rounded-[8px] text-ink2 active:bg-soft2`,children:(0,R.jsx)(X,{name:`arrow-left`,size:18})}):(0,R.jsx)(`span`,{className:`flex size-10 shrink-0 items-center justify-center`,children:(0,R.jsx)(mw,{})}),(0,R.jsxs)(`div`,{className:`flex min-w-0 grow flex-col leading-tight`,children:[(0,R.jsx)(`span`,{className:`truncate text-[14.5px] font-semibold`,children:t}),n?(0,R.jsx)(`span`,{className:`truncate text-[12px] text-muted`,children:n}):null]}),(0,R.jsx)(`div`,{className:`flex shrink-0 items-center gap-1`,children:i})]})}var qj=e=>e.item.kind===`url`?`globe`:e.item.frame.device===`phone`?`smartphone`:e.item.frame.device===`tablet`?`tablet`:`monitor`;function Jj({canvas:e,current:t,onPick:n}){let r=(0,v.useRef)(null);(0,v.useEffect)(()=>{r.current?.scrollIntoView({block:`center`})},[]);let i=e.pages.length>1;return(0,R.jsx)(`div`,{className:`flex flex-col pb-2`,children:e.pages.map(a=>{let o=Rj(e,a.id);return o.length?(0,R.jsxs)(`section`,{className:`flex flex-col`,children:[i?(0,R.jsx)(`h3`,{className:`sticky top-0 z-[1] m-0 border-b border-rule bg-soft px-4 py-2 text-[12px] font-semibold text-ink2`,children:a.title}):null,a.sections.map(e=>{let i=o.filter(t=>e.items.includes(t.item));return i.length?(0,R.jsxs)(`div`,{className:`flex flex-col`,children:[e.title?(0,R.jsx)(`div`,{className:`px-4 pt-3 pb-1 text-[12px] text-muted`,children:e.title}):null,i.map(e=>{let i=e.item.id===t;return(0,R.jsxs)(`button`,{ref:i?r:void 0,type:`button`,"aria-current":i?`true`:void 0,onClick:()=>n(e.item.id),className:J(`flex min-h-[48px] cursor-pointer items-center gap-3 border-0 bg-transparent px-4 text-left text-[14px] active:bg-soft2`,i?`font-medium text-ink`:`text-ink2`),children:[(0,R.jsx)(`span`,{className:J(`flex size-8 shrink-0 items-center justify-center rounded-[8px]`,i?`bg-action-soft text-action`:`bg-soft2 text-muted`),children:(0,R.jsx)(X,{name:qj(e),size:15})}),(0,R.jsx)(`span`,{className:`min-w-0 grow truncate`,children:e.item.title||e.item.id}),i?(0,R.jsx)(X,{name:`check`,size:16,className:`shrink-0 text-action`}):null]},e.item.id)})]},e.id):null})]},a.id):null})})}var Yj=[[`year`,31536e3],[`month`,2592e3],[`week`,604800],[`day`,86400],[`hour`,3600],[`minute`,60]],Xj=new Intl.RelativeTimeFormat(`en`,{numeric:`auto`});function Zj(e){if(!e)return``;let t=(e-Date.now())/1e3;for(let[e,n]of Yj)if(Math.abs(t)>=n)return Xj.format(Math.round(t/n),e);return`just now`}function Qj(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(+(e<10240))} KB`:`${(e/1024/1024).toFixed(1)} MB`}function $j(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}function eM({className:e,style:t}){return(0,R.jsx)(`span`,{"aria-hidden":`true`,className:J(`block animate-pulse rounded-[6px] bg-soft2`,e),style:t})}function tM({rows:e=3,lead:t=28,minH:n=56}){return(0,R.jsx)(`div`,{role:`status`,"aria-label":`Loading`,children:Array.from({length:e},(e,r)=>(0,R.jsxs)(`div`,{className:`flex items-center gap-3 border-t border-rule px-4`,style:{minHeight:n,opacity:1-r*.18},children:[t?(0,R.jsx)(eM,{style:{width:t,height:Math.min(t,n-20)}}):null,(0,R.jsxs)(`span`,{className:`flex min-w-0 grow flex-col gap-1.5`,children:[(0,R.jsx)(eM,{className:`h-3 w-[38%]`}),(0,R.jsx)(eM,{className:`h-2.5 w-[62%]`})]}),(0,R.jsx)(eM,{className:`h-3 w-14`})]},r))})}function nM({canvas:e}){return(0,R.jsx)(`div`,{className:`flex h-[54px] w-[86px] shrink-0 items-center justify-center overflow-hidden rounded-[6px] border border-rule bg-soft`,children:e.cover?(0,R.jsx)(`img`,{src:e.cover,alt:``,className:`h-full w-full object-cover object-top`}):(0,R.jsx)(X,{name:`canvas`,size:18,className:`text-muted`})})}function rM({src:e}){return(0,R.jsx)(`span`,{className:`flex size-8 shrink-0 items-center justify-center overflow-hidden rounded-[6px] border border-rule bg-soft`,children:(0,R.jsx)(`img`,{src:e,alt:``,className:`size-full object-contain`})})}function iM({project:e}){let{source:t,keys:n}=e_(),r=Me(),i=(0,v.useRef)(null);if(!t.setIcon||e.static)return null;let a=async e=>{try{await t.setIcon(e),await r.invalidateQueries({queryKey:n.project}),jT(e?`Icon set`:`Icon removed`,e?`Saved as .design/icon; a linked project takes it to the cloud on its next push or pull.`:void 0)}catch(e){jT(`Could not change the icon`,e.message,`error`)}};return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`input`,{ref:i,type:`file`,accept:`.svg,.png,.webp,image/svg+xml,image/png,image/webp`,className:`hidden`,onChange:e=>{let t=e.target.files?.[0];e.target.value=``,t&&a(t)}}),(0,R.jsxs)(ow,{trigger:(0,R.jsx)(A_,{children:`Icon`}),align:`end`,width:240,children:[(0,R.jsxs)(lw,{onSelect:()=>i.current?.click(),hint:`≤ 256 KB`,children:[(0,R.jsx)(X,{name:`upload`,size:15}),e.icon?`Replace icon`:`Upload icon`]}),e.icon?(0,R.jsxs)(lw,{danger:!0,onSelect:()=>void a(null),children:[(0,R.jsx)(X,{name:`trash`,size:15}),`Remove icon`]}):null]})]})}function aM({actions:e,children:t}){return e?(0,R.jsxs)(`div`,{className:`grid items-center border-t border-rule transition-colors hover:bg-soft`,style:{gridTemplateColumns:`minmax(0,1fr) auto`},children:[t,(0,R.jsx)(`div`,{className:`flex items-center gap-2 pr-4`,children:e})]}):t}function oM({children:e}){return e?(0,R.jsx)(`div`,{className:`flex items-center gap-2.5 border-t border-rule bg-soft px-4 py-3 text-[12.5px] text-muted`,children:e}):null}function sM({project:e}){let{canvasRowActions:t,canvasesFoot:n}=e_().slots,r=Tw();return e.canvases.length?(0,R.jsxs)(z_,{children:[(0,R.jsx)(B_,{title:`Canvases`,count:e.canvases.length}),e.canvases.map(e=>{let n=t?.(e.id);return(0,R.jsx)(aM,{actions:n,children:r?(0,R.jsxs)(q_,{to:`/c/${encodeURIComponent(e.id)}`,cols:`86px minmax(0,1fr)`,align:`ll`,pad:`10px 16px`,minH:74,first:!!n,children:[(0,R.jsx)(nM,{canvas:e}),(0,R.jsx)(C_,{top:e.title,bottom:(0,R.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[e.issues?(0,R.jsx)(L_,{tone:`danger`,children:$j(e.issues,`problem`)}):null,(0,R.jsxs)(`span`,{className:`truncate`,children:[$j(e.screens,`screen`),` · `,Zj(e.updatedAt)]})]})})]}):(0,R.jsxs)(q_,{to:`/c/${encodeURIComponent(e.id)}`,cols:`86px minmax(0,1fr) auto auto`,align:`llrr`,pad:`10px 16px`,minH:74,first:!!n,children:[(0,R.jsx)(nM,{canvas:e}),(0,R.jsx)(C_,{top:e.title,bottom:(0,R.jsx)(`span`,{className:`truncate`,children:e.description??e.id})}),(0,R.jsxs)(`span`,{className:`flex items-center gap-2 text-[12.5px] whitespace-nowrap text-muted`,children:[e.issues?(0,R.jsx)(L_,{tone:`danger`,children:$j(e.issues,`problem`)}):null,$j(e.screens,`screen`),` · `,$j(e.pages,`page`)]}),(0,R.jsx)(`span`,{className:`w-[92px] text-[12.5px] whitespace-nowrap text-muted`,children:Zj(e.updatedAt)})]})},e.id)}),(0,R.jsx)(oM,{children:n})]}):(0,R.jsxs)(z_,{children:[(0,R.jsx)(B_,{title:`Canvases`,count:0}),(0,R.jsx)(Y_,{children:(0,R.jsxs)(`div`,{className:`flex flex-col gap-2 py-6 text-center`,children:[(0,R.jsx)(`span`,{className:`text-[14px] text-ink2`,children:`No canvases yet.`}),(0,R.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[`Ask your agent to design something, or run `,(0,R.jsx)(Z,{children:`design new <name>`}),` in the project.`]})]})}),(0,R.jsx)(oM,{children:n})]})}function cM({project:e}){let t=e.system;return t?(0,R.jsxs)(z_,{children:[(0,R.jsx)(B_,{title:`Design system`,right:(0,R.jsx)(P_,{to:`/system`,children:`Open`})}),(0,R.jsxs)(Y_,{gap:6,children:[(0,R.jsx)(`span`,{className:`text-[15px] font-semibold`,children:t.name}),t.description?(0,R.jsx)(`span`,{className:`text-[13px] text-ink2`,children:t.description}):null]}),(0,R.jsx)(J_,{label:`Tokens`,labelWidth:120,end:!0,children:(0,R.jsx)(R_,{value:t.tokens})}),(0,R.jsx)(J_,{label:`Components`,labelWidth:120,end:!0,children:(0,R.jsx)(R_,{value:t.components})}),(0,R.jsx)(J_,{label:`Guidelines`,labelWidth:120,end:!0,children:(0,R.jsx)(R_,{value:t.guidelines})}),t.issues?(0,R.jsx)(J_,{label:`Problems`,labelWidth:120,end:!0,children:(0,R.jsx)(L_,{tone:`danger`,children:t.issues})}):null]}):(0,R.jsxs)(z_,{children:[(0,R.jsx)(B_,{title:`Design system`}),(0,R.jsx)(Y_,{children:(0,R.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[`No design system yet. Ask your agent to build one from the codebase, or run `,(0,R.jsx)(Z,{children:`design system init`}),`.`]})})]})}function lM(){return(0,R.jsxs)(X_,{children:[(0,R.jsxs)(`div`,{className:`flex flex-col gap-2.5 pt-1 pb-1`,children:[(0,R.jsx)(eM,{className:`h-6 w-[220px]`}),(0,R.jsx)(eM,{className:`h-3.5 w-[300px]`})]}),(0,R.jsxs)(`div`,{className:`grid items-start gap-5 max-lg:grid-cols-1!`,style:{gridTemplateColumns:`minmax(0,1fr) 340px`},children:[(0,R.jsxs)(z_,{children:[(0,R.jsx)(B_,{title:`Canvases`}),(0,R.jsx)(tM,{rows:3,lead:86,minH:74})]}),(0,R.jsxs)(z_,{children:[(0,R.jsx)(B_,{title:`Design system`}),(0,R.jsx)(tM,{rows:3,lead:0,minH:40})]})]})]})}function uM(){let{data:e,error:t,isLoading:n}=r_(),{slots:r}=e_(),i=Tw();return t?(0,R.jsx)(tv,{title:`Could not load the project`,text:t.message}):n||!e?(0,R.jsx)(lM,{}):(0,R.jsxs)(X_,{children:[(0,R.jsx)(Z_,{title:e.icon?(0,R.jsxs)(`span`,{className:`flex min-w-0 items-center gap-3`,children:[(0,R.jsx)(rM,{src:e.icon}),e.name]}):e.name,right:i?void 0:r.homeActions??(0,R.jsx)(iM,{project:e}),badge:i&&r.homeActions?(0,R.jsx)(`span`,{className:`ml-auto flex`,children:r.homeActions}):void 0,sub:r.homeSub?r.homeSub:e.static?`Snapshot built with foss-design ${e.version}`:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(Z,{size:12.5,wrap:!0,children:[e.root,`/.design`]}),` `,`· foss-design `,e.version]})}),(0,R.jsx)(AO,{issues:e.issues,title:`Problems in design.json`}),(0,R.jsxs)(`div`,{className:`grid items-start gap-5 max-lg:grid-cols-1!`,style:{gridTemplateColumns:`minmax(0,1fr) 340px`},children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-5`,children:[(0,R.jsx)(sM,{project:e}),r.canvasesAfter]}),(0,R.jsx)(cM,{project:e})]}),r.homeAfter]})}function dM(e){let t=e.utility;if(t===void 0)return[];let n=t?`-${t}`:``;switch(e.kind){case`color`:return[`bg${n}`,`text${n}`,`border${n}`];case`font`:return[`font${n}`];case`text`:return[`text${n}`];case`weight`:return[`font${n}`];case`leading`:return[`leading${n}`];case`tracking`:return[`tracking${n}`];case`spacing`:return t?[`p${n}`,`gap${n}`]:[`p-1`,`gap-4`,`m-2`];case`radius`:return[`rounded${n}`];case`shadow`:return e.name.startsWith(`--inset-shadow-`)?[`inset-shadow${n}`]:e.name.startsWith(`--drop-shadow-`)?[`drop-shadow${n}`]:e.name.startsWith(`--text-shadow-`)?[`text-shadow${n}`]:[`shadow${n}`];case`blur`:return[`blur${n}`,`backdrop-blur${n}`];case`ease`:return[`ease${n}`];case`animation`:return[`animate${n}`];case`breakpoint`:return e.name.startsWith(`--container-`)?[`@${t}:`,`max-w${n}`]:[`${t}:`];default:return[]}}function fM(e,...t){return e.filter(e=>t.includes(e.kind))}function pM(e){let t=new Map;for(let n of e){let e=t.get(n.group)??[];e.push(n),t.set(n.group,e)}return[...t].map(([e,t])=>({group:e,tokens:t}))}function mM(e){let t=/^(-?[\d.]+)(px|rem|em)?$/.exec(e.trim());if(!t)return null;let n=Number(t[1]);return Number.isFinite(n)?t[2]===`rem`||t[2]===`em`?n*16:n:null}function hM(e,t){return(t===`dark`?e.dark?.value:void 0)??e.light?.value}function gM(){let e=b_(),[t,n]=(0,v.useState)(null);return[t??e,n]}function _M({value:e,onChange:t}){return(0,R.jsx)(YA,{label:`Theme`,size:`sm`,value:e,onChange:t,items:[{value:`light`,label:(0,R.jsx)(X,{name:`sun`,size:14}),title:`Light`},{value:`dark`,label:(0,R.jsx)(X,{name:`moon`,size:14}),title:`Dark`}]})}function vM({items:e}){return e.length?(0,R.jsx)(`span`,{className:`flex min-w-0 flex-wrap gap-x-2 gap-y-0.5`,children:e.map(e=>(0,R.jsx)(Z,{size:12,className:`text-muted`,children:e},e))}):null}function yM({title:e,children:t}){return(0,R.jsxs)(z_,{children:[(0,R.jsx)(B_,{title:e}),(0,R.jsx)(Y_,{children:(0,R.jsx)(`div`,{className:`py-4 text-[13px] text-muted`,children:t})})]})}var bM=`.design/system/tokens.css`;function xM({children:e,className:t}){return(0,R.jsx)(`span`,{className:`font-mono text-[12px] text-muted [overflow-wrap:anywhere] ${t??``}`,children:e})}function SM({asset:e,index:t}){if(e.kind===`image`)return(0,R.jsx)(`span`,{className:`checker flex h-[132px] items-center justify-center overflow-hidden border-b border-rule`,children:(0,R.jsx)(`img`,{src:e.url,alt:``,className:`max-h-[96px] max-w-[80%] object-contain`})});if(e.kind===`font`){let n=`design-asset-font-${t}`;return(0,R.jsxs)(`span`,{className:`flex h-[132px] items-center justify-center border-b border-rule bg-soft`,children:[(0,R.jsx)(`style`,{children:`@font-face{font-family:"${n}";src:url("${e.url.replace(/"/g,`%22`)}")}`}),(0,R.jsx)(`span`,{className:`text-[52px] leading-none text-ink`,style:{fontFamily:`"${n}", var(--font-sans)`},children:`Aa`})]})}return(0,R.jsx)(`span`,{className:`flex h-[132px] items-center justify-center border-b border-rule bg-soft text-muted`,children:(0,R.jsx)(X,{name:`file`,size:28})})}function CM({system:e}){return e.assets.length?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Z_,{title:`Assets`,sub:`Click an asset to copy its import path.`}),(0,R.jsx)(`div`,{className:`grid gap-4`,style:{gridTemplateColumns:`repeat(auto-fill, minmax(210px, 1fr))`},children:e.assets.map((e,t)=>(0,R.jsx)(`button`,{type:`button`,title:`Copy the import path`,onClick:()=>FT(`@system/${e.path}`),className:`block cursor-pointer border-0 bg-transparent p-0 text-left`,children:(0,R.jsxs)(z_,{className:`transition-colors hover:border-rule-strong`,children:[(0,R.jsx)(SM,{asset:e,index:t}),(0,R.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5 px-3.5 py-2.5`,children:[(0,R.jsx)(`span`,{className:`truncate text-[13.5px] font-medium text-ink`,children:e.name}),(0,R.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-[12.5px] text-muted`,children:[(0,R.jsx)(`span`,{className:`shrink-0`,children:Qj(e.size)}),(0,R.jsx)(Z,{size:12,className:`truncate`,children:e.path})]})]})]})},e.path))})]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Z_,{title:`Assets`}),(0,R.jsxs)(yM,{title:`No assets`,children:[`Put logos, icons, images and font files in `,(0,R.jsx)(Z,{children:`.design/system/assets`}),`; screens import them as`,` `,(0,R.jsx)(Z,{children:`@system/assets/…`}),`.`]})]})}function wM({color:e,label:t,className:n}){return e?(0,R.jsx)(`span`,{title:`${t}: ${e}`,className:J(`checker relative h-[30px] w-[44px] shrink-0 overflow-hidden rounded-[6px]`,n),children:(0,R.jsx)(`span`,{className:`absolute inset-0 rounded-[6px] shadow-[inset_0_0_0_1px_rgba(0,0,0,0.1)] dark:shadow-[inset_0_0_0_1px_rgba(255,255,255,0.12)]`,style:{background:e}})}):(0,R.jsx)(`span`,{className:J(`h-[30px] w-[44px] shrink-0`,n)})}function TM({tokens:e}){let t=e.some(e=>e.dark),n=t=>(0,R.jsxs)(`div`,{className:`relative flex h-9 min-w-0 grow overflow-hidden rounded-[6px]`,children:[(0,R.jsx)(`span`,{className:`pointer-events-none absolute inset-0 z-10 rounded-[6px] shadow-[inset_0_0_0_1px_var(--rule-strong)] opacity-60`}),e.map(e=>{let n=t===`dark`?e.dark?.value??e.light?.value:e.light?.value;return(0,R.jsx)(`button`,{type:`button`,title:`${e.name}: ${n}`,onClick:()=>FT(`var(${e.name})`),className:`h-full min-w-0 flex-1 cursor-pointer border-0 p-0 transition-[flex-grow] duration-150 hover:grow-[1.6]`,style:{background:n}},e.name)})]});return(0,R.jsxs)(`div`,{className:`flex flex-col gap-1.5 border-t border-rule px-4 py-3`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-3`,children:[t?(0,R.jsx)(`span`,{className:`w-9 shrink-0 text-[12px] text-muted`,children:`Light`}):null,n(`light`)]}),t?(0,R.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,R.jsx)(`span`,{className:`w-9 shrink-0 text-[12px] text-muted`,children:`Dark`}),n(`dark`)]}):null]})}function EM({token:e}){return(0,R.jsxs)(K_,{cols:`100px minmax(170px, 0.9fr) minmax(0, 1.4fr)`,minH:56,title:`Copy the variable`,onClick:()=>FT(`var(${e.name})`),children:[(0,R.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,R.jsx)(wM,{color:e.light?.value,label:`Light`}),e.dark?(0,R.jsx)(wM,{color:e.dark.value,label:`Dark`}):null]}),(0,R.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,R.jsx)(Z,{size:12.5,className:`truncate text-ink`,children:e.name}),(0,R.jsx)(vM,{items:dM(e).slice(0,2)})]}),(0,R.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,R.jsxs)(`span`,{className:`flex min-w-0 flex-wrap gap-x-3`,children:[(0,R.jsx)(Z,{size:12,className:`text-muted`,children:e.light?.value}),e.dark?(0,R.jsxs)(Z,{size:12,className:`text-muted`,children:[`dark `,e.dark.value]}):null]}),e.description?(0,R.jsx)(`span`,{className:`text-[13px] text-ink2`,children:e.description}):null]})]})}function DM({system:e}){let t=fM(e.tokens,`color`),n=pM(t);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Z_,{title:`Colors`,sub:t.length?`${t.length} tokens · click a color to copy its variable`:void 0}),n.length?n.map(({group:e,tokens:t})=>(0,R.jsxs)(z_,{children:[(0,R.jsx)(B_,{title:e,count:t.length}),(0,R.jsx)(TM,{tokens:t}),t.map(e=>(0,R.jsx)(EM,{token:e},e.name))]},e)):(0,R.jsxs)(yM,{title:`No color tokens`,children:[`Add them to `,(0,R.jsx)(Z,{children:bM}),`: light values in `,(0,R.jsx)(Z,{children:`:root`}),`, dark ones in`,` `,(0,R.jsx)(Z,{children:`:root[data-theme="dark"]`}),`, and map them to Tailwind with `,(0,R.jsx)(Z,{children:`--color-*`}),` in`,` `,(0,R.jsx)(Z,{children:`@theme inline`}),`.`]})]})}function OM({src:e,theme:t,title:n,minHeight:r=120,width:i,className:a}){let o=(0,v.useRef)(null),{frameSandbox:s,frameAllow:c}=e_(),[l]=(0,v.useState)(()=>({src:e,theme:t})),u=mO(e,l.src===e?l.theme:t),[d,f]=(0,v.useState)(r),[p,m]=(0,v.useState)(!1),[h,g]=(0,v.useState)([]);return(0,v.useEffect)(()=>{let e=o.current;if(e)return m(!1),g([]),sO(e,t=>{t.type===`size`?f(Math.max(r,t.height)):t.type===`ready`?m(!0):t.type===`error`?g(e=>aO(e,t.message)):t.type===`updated`?g([]):t.type===`wheel`&&!t.zoom&&uO(e,t)})},[r,u]),(0,v.useEffect)(()=>{dO(o.current,t)},[t]),(0,R.jsxs)(`div`,{className:J(`relative`,a),style:{width:i},children:[h.length?(0,R.jsxs)(`div`,{className:`flex items-start gap-2 border-b border-rule bg-danger-soft px-4 py-2.5 text-[12.5px] text-danger-text`,children:[(0,R.jsx)(X,{name:`alert`,size:15,className:`mt-px`}),(0,R.jsx)(`div`,{className:`min-w-0 font-mono break-words`,children:h.join(`
135
+ `)})]}):null,(0,R.jsx)(`iframe`,{ref:o,src:u,title:n,allow:c,sandbox:s,className:J(`block w-full border-0 transition-opacity duration-150`,p?`opacity-100`:`opacity-0`),style:{height:d,colorScheme:t},onLoad:()=>dO(o.current,t)},u),p?null:(0,R.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center text-muted`,children:(0,R.jsx)(X,{name:`loader`,size:18})})]})}var kM=`identifier keyword string class property entity jsxliterals sign comment break space`.split(` `),[AM,jM,MM,NM,PM,FM,IM,LM,RM,zM,BM]=kM.map((e,t)=>t);new Map(kM.map((e,t)=>[e,t]));function VM(e,t){let n=[],r=0,i=[],a=!1;function o(e){n.push({index:r++,value:e.map(([,e])=>e).join(``),tokens:e.map(([e,t])=>({type:kM[e],value:t})),annotations:[]})}for(let e=0;e<t.length;e++){let n=t[e],[r,s]=n;if(r!==zM){if(s.includes(`
136
+ `)){let e=s.split(`
137
+ `);for(let t=0;t<e.length;t++)i.push([r,e[t]]),t<e.length-1&&(o(i),i.length=0)}else i.push(n);a=!1}else a?o([]):(o(i),i.length=0),e===t.length-1&&o([]),a=!0}return i.length&&o(i),{value:e,lines:n}}function HM(e,t){let n={index:e.index,value:e.value,tokens:e.tokens,annotations:e.annotations,className:`sh__line${e.annotations.map(e=>` sh__line--${e}`).join(``)}`,style:{},properties:{}};return t?.(n),n}function UM({type:e,value:t},n,r){let i=n?.[e],a={type:e,value:t,className:`sh__token--${e}${i?` ${i}`:``}`,style:{color:`var(--sh-${e})`},properties:{}};return r?.(a),a}function WM(e,t){let n=t?.cx,r=t?.mark,i=t?.markLine;return!n&&!r&&!i?e.lines.map(e=>{let t=`sh__line${e.annotations.map(e=>` sh__line--${e}`).join(``)}`,n=e.tokens.map(({type:e,value:t})=>`<span class="sh__token--${e}" style="color:var(--sh-${e})">${KM(t)}</span>`).join(``);return`<span class="${KM(t)}">${n}</span>`}).join(`
138
+ `):e.lines.map(e=>{let t=HM(e,i),a=e.tokens.map(e=>{let t=UM(e,n,r);return`<span ${qM({...t.properties,className:t.className,style:t.style})}>${KM(t.value)}</span>`}).join(``);return`<span ${qM({...t.properties,className:t.className,style:t.style})}>${a}</span>`}).join(`
139
+ `)}var GM={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#039;`},KM=e=>e.replace(/[&<>"']/g,e=>GM[e]);function qM(e){let t=Object.entries(e.style||{}).map(([e,t])=>`${e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}:${t}`).join(`;`),n=Object.entries(e).filter(([e,t])=>/^[\w:-]+$/.test(e)&&e!==`className`&&e!==`style`&&t!==!1&&t!=null).map(([e,t])=>t===!0?e:`${e}="${KM(String(t))}"`).join(` `);return`class="${KM(e.className||``)}"${t?` style="${KM(t)}"`:``}${n?` ${n}`:``}`}var JM=new Set(`+-*/%=!&|^~?:.,;()[]{}<>#@\\`.split(``)),YM=()=>0,XM=e=>e===`_`||e===`$`||/[\p{L}\p{N}]/u.test(e);function ZM(e,t){for(;t<e.length&&/\s/.test(e[t]);)t++;return e[t]===`:`}function QM(e,t){if(typeof t?.tokenize==`function`)return t.tokenize(e,t);let n=t?.keywords||new Set,r=t?.typeKeywords||new Set,i=t?.onCommentStart||YM,a=t?.onCommentEnd||YM,o=t?.caseInsensitive?e=>e.toLowerCase():e=>e,s=[],c=``;function l(e,t){t&&(s.push([e,t]),e!==BM&&e!==zM&&(c=t))}for(let s=0;s<e.length;){let u=e[s],d=e[s+1],f=i(u,d,s,e);if(f){let t=s++;for(;s<e.length;){if(a(e[s-1],e[s],s,e,t)==f){s++;break}s++}l(RM,e.slice(t,s));continue}let p=t?.onLiteral?.(u,s,e);if(p){l(MM,e.slice(s,s+p)),s+=p;continue}if(typeof t?.onQuote==`function`&&u===`'`){let n=t.onQuote(u,s,e);if(typeof n==`number`&&n>=1){l(AM,e.slice(s,s+n)),s+=n;continue}}if(u===`"`||u===`'`||t?.templateStrings&&u==="`"){let n=u,r=s++;for(;s<e.length;){if(e[s]===`\\`)s++;else if(e[s]===n){s++;break}s++}let i=e.slice(r,s);l(t?.quotedKeys&&ZM(e,s)?PM:MM,i);continue}if(u===`
140
+ `){l(zM,u),s++;continue}if(/[^\S\r\n]/.test(u)){let t=s++;for(;s<e.length&&/[^\S\r\n]/.test(e[s]);)s++;l(BM,e.slice(t,s));continue}if(XM(u)){let t=s++;for(;s<e.length&&XM(e[s]);)s++;if(/^\d/.test(u)&&e[s]===`.`&&/\d/.test(e[s+1]||``))for(s++;s<e.length&&XM(e[s]);)s++;let i=e.slice(t,s),a=o(i);l(r.has(a)?NM:n.has(a)?jM:c===`.`?PM:/^\d/.test(i)||i===`null`||/^\p{Lu}/u.test(i)?NM:AM,i);continue}if(JM.has(u)){l(LM,u),s++;continue}l(MM,u),s++}return s}function $M(e,t){let n=VM(e,QM(e,t));if(t?.annotateLine)for(let e of n.lines)t.annotateLine(e);return n}var eN=(e,t)=>{let n=e+t;return n===`//`?1:n===`/*`?2:0},tN=(e,t)=>t===`
141
+ `?1:e+t===`*/`?2:0,nN=s({keywords:()=>iN,onCommentEnd:()=>tN,onCommentStart:()=>eN,typeKeywords:()=>rN}),rN=new Set([`void`,`char`,`short`,`int`,`long`,`float`,`double`,`signed`,`unsigned`,`_Bool`,`_Complex`,`_Imaginary`]),iN=new Set(`auto.break.case.const.continue.default.do.else.enum.extern.for.goto.if.inline.register.restrict.return.sizeof.static.struct.switch.typedef.union.volatile.while._Alignas._Alignof._Atomic._Generic._Noreturn._Static_assert._Thread_local`.split(`.`)),aN=s({keywords:()=>oN,onCommentEnd:()=>tN,onCommentStart:()=>eN,typeKeywords:()=>sN}),oN=new Set(`alignas.alignof.and.and_eq.asm.auto.bitand.bitor.break.case.catch.class.compl.concept.const.consteval.constexpr.constinit.const_cast.continue.co_await.co_return.co_yield.decltype.default.delete.do.dynamic_cast.else.enum.explicit.export.extern.false.for.friend.goto.if.inline.mutable.namespace.new.noexcept.not.not_eq.nullptr.operator.or.or_eq.private.protected.public.register.reinterpret_cast.requires.return.sizeof.static.static_assert.static_cast.struct.switch.template.this.thread_local.throw.true.try.typedef.typeid.typename.union.using.virtual.volatile.while.xor.xor_eq`.split(`.`)),sN=new Set([`bool`,`char`,`char8_t`,`char16_t`,`char32_t`,`double`,`float`,`int`,`long`,`short`,`signed`,`unsigned`,`void`,`wchar_t`]),cN=s({keywords:()=>lN,onCommentEnd:()=>tN,onCommentStart:()=>eN,typeKeywords:()=>uN}),lN=new Set(`abstract.as.async.await.base.break.case.catch.checked.class.const.continue.default.delegate.do.else.enum.event.explicit.extern.false.finally.fixed.for.foreach.from.get.global.goto.if.implicit.in.init.interface.internal.into.is.join.let.lock.namespace.new.null.on.operator.orderby.out.override.params.partial.private.protected.public.readonly.record.ref.remove.required.return.sealed.select.set.sizeof.stackalloc.static.struct.switch.this.throw.true.try.typeof.unchecked.unsafe.using.value.virtual.volatile.when.where.while.with.yield`.split(`.`)),uN=new Set([`bool`,`byte`,`char`,`decimal`,`double`,`dynamic`,`float`,`int`,`long`,`nint`,`nuint`,`object`,`sbyte`,`short`,`string`,`uint`,`ulong`,`ushort`,`void`]),dN=s({keywords:()=>fN,onCommentEnd:()=>mN,onCommentStart:()=>pN,onLiteral:()=>hN,tokenize:()=>CN}),fN=new Set([`@media`,`@import`,`@keyframes`,`@font-face`,`@supports`,`@page`,`@counter-style`,`@font-feature-values`,`@viewport`,`@counter-style`,`@font-feature-values`,`@document`]),pN=(e,t)=>+(e+t===`/*`),mN=(e,t)=>+(e+t===`*/`),hN=(e,t,n)=>e===`#`&&n.slice(t).match(/^#(?:[\da-f]{8}|[\da-f]{6}|[\da-f]{4}|[\da-f]{3})(?![\w-])/i)?.[0].length||0,gN=e=>e===BM||e===zM||e===RM,_N=([e,t])=>e===AM||e===NM||e===LM&&t===`-`,vN=([e])=>e===AM||e===NM||e===PM,yN=e=>vN(e)&&!/^\d/.test(e[1]),bN=([e,t])=>e===LM&&t===`-`,xN=e=>{for(let t=0;t<e.length;t++){let n=t,r=t;if(bN(e[r])){for(;e[r]&&bN(e[r]);)r++;if(!e[r]||!yN(e[r]))continue;n=r++}else if(yN(e[r]))r++;else continue;let i=n>t;for(;e[r]&&bN(e[r]);){let t=r;for(;e[r]&&bN(e[r]);)r++;if(!e[r]||!vN(e[r])){r=t;break}i=!0,r++}if(!i)continue;let a=e.slice(t,r).map(([,e])=>e).join(``);e.splice(t,r-t,[e[n][0],a])}},SN=(e,t)=>{let n=0,r=0;for(let i=t;i<e.length;i++){let[t,a]=e[i];if(t===LM){if(a===`(`)n++;else if(a===`)`)n--;else if(a===`[`)r++;else if(a===`]`)r--;else if(!n&&!r&&a===`{`)return!0;else if(!n&&!r&&(a===`;`||a===`}`))return!1}}return!1},CN=(e,t)=>{let n=QM(e,{...t,tokenize:void 0});xN(n);let r=0,i=!1;for(let e=0;e<n.length;e++){let[t,a]=n[e];if(t===LM&&a===`{`){r++,i=!0;continue}if(t===LM&&a===`}`){r--,i=!1;continue}if(t===LM&&a===`;`){i=r>0;continue}if(!i||gN(t))continue;let o=e,s=e;for(;s<n.length&&_N(n[s]);)s++;let c=s;for(;c<n.length&&gN(n[c][0]);)c++;if(s>o&&n[c]?.[0]===LM&&n[c][1]===`:`&&!SN(n,c+1)){let e=n.slice(o,s).map(([,e])=>e).join(``);n.splice(o,s-o,[PM,e])}i=!1}return n},wN=s({annotateLine:()=>EN,keywords:()=>TN}),TN=new Set([]),EN=e=>{let t=``;if(e.value.startsWith(`+`)&&!e.value.startsWith(`+++`))t=`diff-add`;else if(e.value.startsWith(`-`)&&!e.value.startsWith(`---`))t=`diff-remove`;else if(e.value.startsWith(`@@`))t=`diff-hunk`;else if(/^(diff --git|index |--- |\+\+\+ )/.test(e.value)){t=`diff-meta`;for(let t of e.tokens)t.type===`property`&&(t.type=`identifier`)}t&&e.annotations.push(t)},DN=e=>+(e===`#`),ON=(e,t)=>+(t===`
142
+ `),kN=s({caseInsensitive:()=>!0,keywords:()=>AN,onCommentEnd:()=>ON,onCommentStart:()=>DN}),AN=new Set([`add`,`arg`,`cmd`,`copy`,`entrypoint`,`env`,`expose`,`from`,`healthcheck`,`label`,`maintainer`,`onbuild`,`run`,`shell`,`stopsignal`,`user`,`volume`,`workdir`]),jN=s({keywords:()=>NN,onCommentEnd:()=>tN,onCommentStart:()=>eN,typeKeywords:()=>MN}),MN=new Set([`bool`,`byte`,`complex64`,`complex128`,`error`,`float32`,`float64`,`int`,`int8`,`int16`,`int32`,`int64`,`rune`,`string`,`uint`,`uint8`,`uint16`,`uint32`,`uint64`,`uintptr`]),NN=new Set([`break`,`case`,`chan`,`const`,`continue`,`default`,`defer`,`else`,`fallthrough`,`for`,`func`,`go`,`goto`,`if`,`import`,`interface`,`map`,`package`,`range`,`return`,`select`,`struct`,`switch`,`type`,`var`]),PN=s({keywords:()=>FN,onCommentEnd:()=>ON,onCommentStart:()=>DN,typeKeywords:()=>IN}),FN=new Set([`directive`,`enum`,`extend`,`fragment`,`implements`,`input`,`interface`,`mutation`,`on`,`query`,`repeatable`,`scalar`,`schema`,`subscription`,`type`,`union`]),IN=new Set([`Boolean`,`Float`,`ID`,`Int`,`String`]),LN=s({keywords:()=>RN,onCommentEnd:()=>BN,onCommentStart:()=>zN}),RN=new Set([`false`,`for`,`if`,`in`,`null`,`true`]),zN=(e,t)=>e===`#`||e+t===`//`?1:e+t===`/*`?2:0,BN=(e,t)=>t===`
143
+ `?1:e+t===`*/`?2:0,VN=new Set([`<`,`>`,`{`,`}`,`[`,`]`]),HN=new Set(`for.do.while.if.else.return.function.var.let.const.true.false.undefined.this.new.delete.typeof.in.instanceof.void.break.continue.switch.case.default.throw.try.catch.finally.debugger.with.yield.async.await.class.extends.super.import.export.from.static`.split(`.`)),UN=new Set([...HN,`type`,`interface`,`enum`,`implements`,`readonly`,`abstract`,`declare`,`namespace`,`module`,`private`,`protected`,`public`,`override`,`keyof`,`infer`,`is`,`asserts`,`satisfies`,`as`,`unknown`,`never`,`any`,`number`,`string`,`boolean`,`bigint`,`symbol`,`object`]),WN=new Set([`+`,`-`,`*`,`/`,`%`,`=`,`!`,`&`,`|`,`^`,`~`,`!`,`?`,`:`,`.`,`,`,`;`,`'`,`"`,`.`,`(`,`)`,`[`,`]`,`#`,`@`,`\\`,...VN]),GN={keywords:HN,onCommentStart:iP,onCommentEnd:aP,jsx:!0,regex:!0,templateStrings:!0};function KN(e){return{...GN,...e}}function qN(e){let t=0;return/\binterface\s+[A-Za-z_$][\w$]*/.test(e)&&(t+=2),/\btype\s+[A-Za-z_$][\w$]*\s*=/.test(e)&&(t+=2),/\benum\s+[A-Za-z_$][\w$]*/.test(e)&&(t+=2),/\b(?:implements|readonly|declare|namespace|satisfies|infer|keyof|asserts)\b/.test(e)&&(t+=2),/:\s*[A-Za-z_$][\w$]*(?:<[^>\n]+>)?(?:\[\])?(?=\s*[,)=;{])/m.test(e)&&(t+=1),/\b(?:const|let|var)\s+[A-Za-z_$][\w$]*\s*:\s*/.test(e)&&(t+=1),/\)\s*:\s*[A-Za-z_$][\w$]*(?:<[^>\n]+>)?(?:\[\])?\s*(?:=>|\{)/.test(e)&&(t+=1),t>=2}function JN(e,t){if(e[t]!==`<`)return!1;let n=0,r=!1;for(let i=t;i<e.length;i++){let t=e[i];if(t===`<`){n++;continue}if(t===`>`){if(n--,n===0){let t=i+1;for(;t<e.length&&/\s/.test(e[t]);)t++;if(!(r&&e[t]===`(`))return!1;let n=e.slice(t,t+320);return/\)\s*(?::[\s\S]{0,120}?)?=>/.test(n)}continue}if(n!==0){if(/[$A-Za-z_]/.test(t)){r=!0;continue}if(!/[\s,\.\=\?\:\|\&\[\]]/.test(t))return!1}}return!1}function YN(e){return/^[^\S\r\n]+$/g.test(e)}function XN(e){return WN.has(e)}function ZN(e){return/^[\w$\u0080-\uffff]+$/.test(e||``)}function QN(e){return/^[0-9A-Z\p{Lu}]/u.test(e)||e===`null`}function $N(e){return/^[a-zA-Z]$/.test(e)}function eP(e){return/^[$_A-Za-z\u0080-\uffff]$/.test(e||``)}function tP(e){return eP(e[0])&&ZN(e)}function nP(e){return e==="`"}function rP(e){return e===`"`||e===`'`}function iP(e,t){let n=e+t;return n===`/*`?2:+(n===`//`)}function aP(e,t){return e+t===`*/`?2:+(t===`
144
+ `)}function oP(e){return e[0]===`/`&&!iP(e[0],e[1])}function sP(e,t){let n=t+1;for(;n<e.length&&/\s/.test(e[n]);)n++;return e[n]===`:`}function cP(e,t){let n=KN(t),r=n.keywords!==GN.keywords,i=typeof n.typescript==`boolean`?n.typescript:qN(e),a=r?n.keywords:i?UN:HN,{onCommentStart:o,onCommentEnd:s}=n,c=n.typeKeywords instanceof Set?n.typeKeywords:null,l=n.jsx!==!1,u=n.regex!==!1,d=n.templateStrings!==!1,f=n.caseInsensitive?e=>e.toLowerCase():e=>e,p=e=>d&&nP(e),m=``,h=-1,g=[-1,``],_=[-2,``],v=[],y=!1,b=0,x=0,S=0,C=0,w=()=>y&&!x&&!b,T=()=>b,E=()=>w()&&C,D=null,O=0,k=!1,A=0,j=0,M=()=>D!==null,ee=()=>k,N=()=>j>A,P=()=>j>0&&j===A,te=()=>M()||N();function ne(e){let t=e===`
145
+ `;if(T()){if(M())return MM;let[,t]=g;if(tP(e)){if(t===`<`||t===`</`)return FM;if(!S&&/^\s+$/.test(v[v.length-1]?.[1]||``))return PM}}if(E())return IM;if(M()||N())return MM;if(c&&c.has(f(e)))return g[1]===`.`?AM:NM;if(a.has(f(e)))return g[1]===`.`?AM:jM;if(t)return zM;if(YN(e))return BM;if(e.split(``).every(XN))return LM;if(QN(e))return T()&&!S?AM:NM;if(tP(e)){let e=g[1]===`.`&&tP(_[1]);if(!te()&&!e)return AM;if(e)return PM}return MM}let F=(e,t)=>{if(t&&(m=t),m){h=typeof e==`number`?e:ne(m);let t=[h,m];h!==BM&&h!==zM&&(_=g,g=t),T()&&h===LM&&(m===`{`&&S++,m===`}`&&S--),v.push(t)}m=``};for(let t=0;t<e.length;t++){let r=e[t],i=e[t-1],c=e[t+1],d=i+r,f=r+c;if(typeof n.onQuote==`function`&&r===`'`&&!M()&&!E()&&!N()){let i=n.onQuote(r,t,e);if(typeof i==`number`&&i>=1&&!Number.isNaN(i)){let n=Math.min(i,e.length-t),r=t+n;F(),m=e.slice(t,r),F(AM),t=r-1;continue}}if(rP(r)&&!E()&&!N()){F();let i=!1;if(D&&r===D?(D=null,i=!0):D||(D=r,O=v.length),F(MM,r),n.quotedKeys&&i&&sP(e,t))for(let e=O;e<v.length;e++)v[e][0]=PM;continue}if(p(r)){F(),j+=N()?-1:1,F(MM,r);continue}if(N()&&f==="${"){A++,F(MM),F(LM,f),t++;continue}if(P()&&r===`}`){F(),A--,F(LM,r);continue}if(w()&&r===`{`){F(),F(LM,r),x=1;continue}if(y){if(!b&&r===`<`){F(),c===`/`?(b=2,m=f,t++):(b=1,m=r),F(LM);continue}if(b){if(r===`>`&&!`/=`.includes(i)){F(),b===1?(b=0,C++):(b=0,y=!1),F(LM,r);continue}if(f===`/>`||f===`</`){m!==`<`&&m!==`/`&&F(),f===`/>`?b=0:C--,C||(y=!1),m=f,t++,F(LM);continue}if(r===`<`){F(),m=r,F(LM);continue}if(r===`-`&&m&&!te()&&!E()){let n=t+1;for(;n<e.length&&/[$\w-]/.test(e[n]);)n++;F(PM,m+e.slice(t,n)),t=n-1;continue}if(c===`=`&&!te()&&!YN(r)){YN(m)&&F();let e=m+r;if(tP(e)){F(PM,e);continue}}}}if(l&&!b&&(r===`<`&&eP(c)||f===`</`)){let n=t-1;for(;n>=0&&/\s/.test(e[n]);)n--;let i=n>=0?e[n]:``,[o,s]=g,l=!1,u=!1;if(m&&!YN(m)){let e=m;QN(e)||e===`true`||e===`false`?l=!0:a.has(e)&&tP(e)?u=!0:tP(e)&&(l=!0)}let d=r===`<`&&/[$\w\]\)]/.test(i)&&(l||!u&&(o===AM||o===NM||o===LM&&(s===`)`||s===`]`))),f=r===`<`&&JN(e,t);!d&&!f&&(b=c===`/`?2:1),r===`<`&&(c===`/`||$N(c))&&!d&&!f&&!te()&&!E()&&!ee()&&(y=!0)}let h=rP(r)||p(r),_=N(),S=u&&!y&&oP(f),T=E();if(h||_||rP(D))m+=r,r===`\\`&&(m+=e[++t]||``);else if(S){F();let[n,i]=g;if(S&&n!==-1&&!(n===LM&&i!==`)`||n===RM)){m=r,F();continue}k=!0;let a=t++,o=!1,s=!1;for(;t<e.length&&e[t]!==`
146
+ `;t++){let n=e[t];if(n===`\\`){if(e[t+1]===`
147
+ `)break;t++;continue}if(n===`[`&&(s=!0),n===`]`&&(s=!1),n===`/`&&!s){for(o=!0;/^[a-z]$/.test(e[t+1]);)t++;break}}k=!1,a!==t&&o?(m=e.slice(a,t+1),F(MM)):(m=r,F(),t=a)}else if(o(r,c,t,e)){F();let n=t,i=o(r,c,t,e);if(i)for(;t<e.length&&s(e[t-1],e[t],t,e)!=i;t++);m=e.slice(n,t+1),F(RM)}else if(r===` `||r===`
148
+ `){if(r===` `&&(YN(m)||!m||T)){let n=t+1;for(;e[n]===` `;)n++;m+=e.slice(t,n),t=n-1,e[n]===`<`&&F()}else F(),m=r,F()}else x&&r===`}`?(F(),m=r,F(),x--):T&&!VN.has(r)||N()||(ZN(r)===ZN(m[m.length-1])||w())&&!WN.has(r)?m+=r:(d===`</`&&(m=d),F(),d!==`</`&&(m=r),f===`</`||f===`/>`?(m=f,F(),t++):VN.has(r)&&F()),x&&r===`{`&&x++}return F(),v}var lP=s({tokenize:()=>uP}),uP=cP,dP={keywords:new Set,jsx:!0,regex:!1,templateStrings:!1,onCommentStart:(e,t,n,r)=>r.startsWith(`<!--`,n)?2:0,onCommentEnd:(e,t,n,r)=>r.slice(n-2,n+1)===`-->`?2:0},fP=e=>uP(e,dP),pP=/^<\s*(script|style)\b/i,mP=e=>RegExp(`</\\s*${e}\\s*>`,`ig`);function hP(e,t){let n=``;for(let r=t;r<e.length;r++){let t=e[r];if(n)t===n&&(n=``);else if(t===`"`||t===`'`)n=t;else if(t===`>`)return r+1}return-1}function gP(e){let t=[],n=0;for(;n<e.length;){if(e.startsWith(`<!--`,n)){let t=e.indexOf(`-->`,n+4);n=t===-1?e.length:t+3;continue}if(e[n]!==`<`){n++;continue}let r=hP(e,n);if(r===-1)break;let i=e.slice(n,r).match(pP);if(!i){n=r;continue}let a=i[1].toLowerCase(),o=mP(a);o.lastIndex=r;let s=o.exec(e);if(!s){n=r;continue}t.push({start:n,openEnd:r,closeStart:s.index,end:o.lastIndex,tag:a}),n=o.lastIndex}return t}function _P(e){let t=[],n=0;for(let r of gP(e)){let{start:i,openEnd:a,closeStart:o,end:s,tag:c}=r;t.push(...fP(e.slice(n,i))),t.push(...fP(e.slice(i,a))),t.push(...c===`style`?CN(e.slice(a,o)):uP(e.slice(a,o),{jsx:!1})),t.push(...fP(e.slice(o,s))),n=s}return t.push(...fP(e.slice(n))),t}var vP=s({jsx:()=>!0,keywords:()=>yP,onCommentEnd:()=>SP,onCommentStart:()=>xP,regex:()=>!1,templateStrings:()=>!1,tokenize:()=>bP}),yP=new Set([]),bP=_P,xP=(e,t,n,r)=>r.startsWith(`<!--`,n)?2:0,SP=(e,t,n,r)=>r.slice(n-2,n+1)===`-->`?2:0,CP=s({keywords:()=>TP,onCommentEnd:()=>tN,onCommentStart:()=>eN,typeKeywords:()=>wP}),wP=new Set([`boolean`,`byte`,`char`,`double`,`float`,`int`,`long`,`short`,`void`]),TP=new Set(`abstract.assert.break.case.catch.class.const.continue.default.do.else.enum.extends.final.finally.for.goto.if.implements.import.instanceof.interface.native.new.package.private.protected.public.return.static.strictfp.super.switch.synchronized.this.throw.throws.transient.try.volatile.while`.split(`.`)),EP=s({keywords:()=>DP,onCommentEnd:()=>tN,onCommentStart:()=>eN,quotedKeys:()=>!0}),DP=new Set([`true`,`false`,`null`]),OP=s({keywords:()=>kP,onCommentEnd:()=>tN,onCommentStart:()=>eN,typeKeywords:()=>AP}),kP=new Set(`as.break.by.catch.class.companion.const.constructor.continue.data.do.else.enum.false.finally.for.fun.get.if.import.in.infix.init.interface.internal.is.lateinit.noinline.null.object.open.operator.out.override.package.private.protected.public.reified.return.sealed.set.suspend.tailrec.this.throw.true.try.typealias.val.var.vararg.when.where.while`.split(`.`)),AP=new Set([`Any`,`Boolean`,`Byte`,`Char`,`Double`,`Float`,`Int`,`Long`,`Nothing`,`Short`,`String`,`Unit`]),jP=s({keywords:()=>MP,onCommentEnd:()=>PP,onCommentStart:()=>NP,onLiteral:()=>FP}),MP=new Set([`and`,`break`,`do`,`else`,`elseif`,`end`,`false`,`for`,`function`,`goto`,`if`,`in`,`local`,`nil`,`not`,`or`,`repeat`,`return`,`then`,`true`,`until`,`while`]);function NP(e,t,n,r){return e===`#`&&n===0&&t===`!`?1:e+t===`--`?/^--\[=*\[/.test(r.slice(n))?2:1:0}function PP(e,t,n,r,i){if(t===`
149
+ `)return 1;if(t!==`]`)return 0;let a=r.slice(i).match(/^--\[(=*)\[/);if(!a)return 0;let o=`]${a[1]}]`;return r.slice(n-o.length+1,n+1)===o?2:0}function FP(e,t,n){if(e!==`[`)return 0;let r=n.slice(t).match(/^\[(=*)\[/);if(!r)return 0;let i=`]${r[1]}]`,a=n.indexOf(i,t+r[0].length);return a===-1?n.length-t:a+i.length-t}var IP=()=>0,LP=()=>0,RP=s({annotateLine:()=>VP,keywords:()=>zP,onCommentEnd:()=>LP,onCommentStart:()=>IP,tokenize:()=>BP}),zP=new Set([]),BP=e=>{let t=[],n=``,r=!1,i=(e,n)=>{if(!n)return;let r=t[t.length-1];r?.[0]===e?r[1]+=n:t.push([e,n])};for(let t of e.match(/[^\n]*(?:\n|$)/g)||[]){if(!t)continue;let e=t.endsWith(`
150
+ `)?`
151
+ `:``,a=e?t.slice(0,-1):t,o=[],s=a.match(/^(?: {0,3}>[ \t]?)*/)?.[0]||``;if(!n||r)for(let e of s.matchAll(/>/g))o.push([e.index,e.index+1]);let c=s.length,l=0;for(;l<3&&a[c]===` `;)c++,l++;let u=a.slice(c).match(/^(`{3,}|~{3,})/)?.[1];if(n)u?.[0]===n[0]&&u.length>=n.length&&/^\s*$/.test(a.slice(c+u.length))&&(o.push([c,c+u.length]),n=``,r=!1);else if(u)o.push([c,c+u.length]),n=u,r=s.includes(`>`);else{let e=a.slice(c).match(/^(#{1,6}(?=\s)|(?:[-+*]|\d+[.)])(?=\s)|(?:(?:\*\s*){3,}|(?:-\s*){3,}|(?:_\s*){3,})$)/)?.[1];e&&o.push([c,c+e.length]);for(let e of a.matchAll(/(`+)(.*?)\1|(\*{1,3}|_{1,3}|~{2})(?=\S)(.*?\S)\3/g)){let t=e[1]||e[3];a[e.index-1]===`\\`||t[0]===`_`&&/\w/.test(a[e.index-1]||``)||o.push([e.index,e.index+t.length],[e.index+e[0].length-t.length,e.index+e[0].length])}}let d=0;for(let[e,t]of o.sort((e,t)=>e[0]-t[0]))e<d||(i(AM,a.slice(d,e)),i(LM,a.slice(e,t)),d=t);i(AM,a.slice(d)+e)}return t},VP=e=>{let t=``;/^#{1,6}\s/.test(e.value)?t=`markdown-heading`:/^\s*>/.test(e.value)?t=`markdown-quote`:/^\s*(?:[-*+] |\d+[.)] )/.test(e.value)?t=`markdown-list`:/^\s*```/.test(e.value)&&(t=`markdown-fence`),t&&e.annotations.push(t)},HP=s({keywords:()=>UP,onCommentEnd:()=>KP,onCommentStart:()=>GP,typeKeywords:()=>WP}),UP=new Set(`abstract.and.array.as.break.callable.case.catch.class.clone.const.continue.declare.default.do.echo.else.elseif.empty.enddeclare.endfor.endforeach.endif.endswitch.endwhile.enum.eval.exit.extends.false.final.finally.fn.for.foreach.from.function.global.goto.if.implements.include.include_once.instanceof.insteadof.interface.isset.list.match.namespace.new.null.or.print.private.protected.public.readonly.require.require_once.return.static.switch.throw.trait.true.try.unset.use.var.while.xor.yield`.split(`.`)),WP=new Set([`bool`,`float`,`int`,`iterable`,`mixed`,`never`,`object`,`string`,`void`]),GP=(e,t)=>e===`#`||e+t===`//`?1:e+t===`/*`?2:0,KP=(e,t)=>t===`
152
+ `?1:e+t===`*/`?2:0,qP=s({tokenize:()=>JP}),JP=e=>[[AM,e]],YP=s({caseInsensitive:()=>!0,keywords:()=>XP,onCommentEnd:()=>QP,onCommentStart:()=>ZP}),XP=new Set(`begin.break.catch.class.continue.data.define.do.dynamicparam.else.elseif.end.enum.exit.filter.finally.for.foreach.from.function.if.in.param.process.return.switch.throw.trap.try.until.using.while`.split(`.`)),ZP=(e,t)=>e===`#`?1:e+t===`<#`?2:0,QP=(e,t)=>t===`
153
+ `?1:e+t===`#>`?2:0,$P=s({keywords:()=>eF,onCommentEnd:()=>nF,onCommentStart:()=>tF}),eF=new Set(`and.as.assert.async.await.break.class.continue.def.del.elif.else.except.finally.for.from.global.if.import.in.is.lambda.nonlocal.not.or.pass.raise.return.try.while.with.yield`.split(`.`)),tF=(e,t)=>+(e===`#`),nF=(e,t)=>+(t===`
154
+ `),rF=s({keywords:()=>iF,onCommentEnd:()=>sF,onCommentStart:()=>oF}),iF=new Set(`BEGIN.END.__ENCODING__.__FILE__.__LINE__.alias.and.begin.break.case.class.def.defined.do.else.elsif.end.ensure.false.for.if.in.module.next.nil.not.or.redo.rescue.retry.return.self.super.then.true.undef.unless.until.when.while.yield`.split(`.`));function aF(e,t){return e>0&&t[e-1]!==`
155
+ `?!1:/^=begin(?:\s|$)/.test(t.slice(e))}function oF(e,t,n,r){return e===`#`?1:e===`=`&&aF(n,r)?2:0}function sF(e,t,n,r){if(t!==`
156
+ `)return 0;let i=r.lastIndexOf(`
157
+ `,n-1)+1,a=r.slice(i,n);return/^=end(?:\s|$)/.test(a)?2:1}var cF=s({keywords:()=>lF,onQuote:()=>uF}),lF=new Set(`as.break.const.continue.crate.else.enum.extern.false.fn.for.if.impl.in.let.loop.match.mod.move.mut.pub.ref.return.self.Self.static.struct.super.trait.true.type.unsafe.use.where.while.async.await.dyn.abstract.become.box.do.final.macro.override.priv.typeof.unsized.virtual.yield.try`.split(`.`));function uF(e,t,n){if(e!==`'`||t+1>=n.length)return 1;let r=n[t+1];if(r===`\\`){let e=t+2;for(;e<n.length;){if(n[e]===`\\`){e+=2;continue}if(n[e]===`'`)return e-t+1;e++}return n.length-t}if(r===`_`)return 2;if(/[a-zA-Z]/.test(r)){let e=t+2;for(;e<n.length&&/[a-zA-Z0-9_]/.test(n[e]);)e++;return e<n.length&&n[e]===`'`?e-t+1:e-t}return 1}var dF=s({keywords:()=>fF,onCommentEnd:()=>ON,onCommentStart:()=>DN}),fF=new Set([`case`,`coproc`,`do`,`done`,`elif`,`else`,`esac`,`export`,`fi`,`for`,`function`,`if`,`in`,`local`,`readonly`,`return`,`select`,`then`,`time`,`until`,`while`]),pF=s({caseInsensitive:()=>!0,keywords:()=>mF,onCommentEnd:()=>_F,onCommentStart:()=>gF,typeKeywords:()=>hF}),mF=new Set(`add.all.alter.and.as.asc.between.by.case.check.column.constraint.create.cross.database.default.delete.desc.distinct.drop.else.end.exists.foreign.from.full.group.having.in.index.inner.insert.into.is.join.key.left.like.limit.not.null.offset.on.or.order.outer.primary.references.right.select.set.table.then.union.unique.update.values.view.when.where.with`.split(`.`)),hF=new Set([`bigint`,`binary`,`bit`,`blob`,`boolean`,`char`,`date`,`datetime`,`decimal`,`double`,`float`,`int`,`integer`,`interval`,`json`,`numeric`,`real`,`smallint`,`text`,`time`,`timestamp`,`uuid`,`varchar`]),gF=(e,t)=>{let n=e+t;return n===`--`?1:n===`/*`?2:0},_F=(e,t)=>t===`
158
+ `?1:e+t===`*/`?2:0,vF=s({keywords:()=>yF,onCommentEnd:()=>tN,onCommentStart:()=>eN,typeKeywords:()=>bF}),yF=new Set(`as.associatedtype.break.case.catch.class.continue.convenience.default.defer.deinit.didSet.do.dynamic.else.enum.extension.fallthrough.false.fileprivate.final.for.func.get.guard.if.import.in.indirect.infix.init.inout.internal.is.lazy.let.mutating.nil.nonmutating.open.operator.override.precedencegroup.private.protocol.public.repeat.required.rethrows.return.self.set.some.static.struct.subscript.super.switch.throw.throws.true.try.typealias.unowned.var.weak.where.while.willSet`.split(`.`)),bF=new Set([`Any`,`Bool`,`Character`,`Double`,`Float`,`Int`,`Never`,`String`,`UInt`,`Void`]),xF=s({keywords:()=>SF,onCommentEnd:()=>ON,onCommentStart:()=>DN,quotedKeys:()=>!0}),SF=new Set([`false`,`true`]),CF=s({tokenize:()=>wF}),wF=(e,t)=>cP(e,{...t,typescript:!0}),TF=s({jsx:()=>!0,keywords:()=>yP,onCommentEnd:()=>SP,onCommentStart:()=>xP,regex:()=>!1,templateStrings:()=>!1,tokenize:()=>_P}),EF=s({jsx:()=>!0,keywords:()=>yP,onCommentEnd:()=>SP,onCommentStart:()=>xP,regex:()=>!1,templateStrings:()=>!1,tokenize:()=>_P}),DF=s({keywords:()=>OF,onCommentEnd:()=>ON,onCommentStart:()=>DN,quotedKeys:()=>!0}),OF=new Set([`false`,`False`,`FALSE`,`no`,`No`,`NO`,`null`,`Null`,`NULL`,`off`,`Off`,`OFF`,`on`,`On`,`ON`,`true`,`True`,`TRUE`,`yes`,`Yes`,`YES`]),kF=s({keywords:()=>AF,onCommentEnd:()=>NF,onCommentStart:()=>MF,onLiteral:()=>PF,typeKeywords:()=>jF}),AF=new Set(`addrspace.align.allowzero.and.anyframe.anytype.asm.async.await.break.callconv.catch.comptime.const.continue.defer.else.enum.errdefer.error.export.extern.false.fn.for.if.inline.linksection.noalias.noinline.nosuspend.null.opaque.or.orelse.packed.pub.resume.return.struct.suspend.switch.test.threadlocal.true.try.undefined.union.unreachable.usingnamespace.var.volatile.while`.split(`.`)),jF=new Set(`anyerror.anyopaque.bool.c_char.c_int.c_long.c_longdouble.c_longlong.c_short.c_uint.c_ulong.c_ulonglong.c_ushort.comptime_float.comptime_int.f16.f32.f64.f80.f128.i8.i16.i32.i64.i128.isize.noreturn.type.u8.u16.u32.u64.u128.usize.void`.split(`.`)),MF=(e,t)=>+(e+t===`//`),NF=(e,t)=>+(t===`
159
+ `);function PF(e,t,n){if(e!==`\\`||n[t+1]!==`\\`)return 0;let r=n.lastIndexOf(`
160
+ `,t-1)+1;if(n.slice(r,t).trim())return 0;let i=n.indexOf(`
161
+ `,t+2);return(i===-1?n.length:i)-t}function FF(e){return{...e,jsx:!1,regex:!1,templateStrings:!1}}function IF(){return{javascript:lP,typescript:CF,css:FF(dN),python:FF($P),c:FF(nN),go:FF(jN),java:FF(CP),rust:FF(cF),json:FF(EP),diff:FF(wN),shell:FF(dF),cpp:FF(aN),csharp:FF(cN),sql:FF(pF),html:vP,vue:EF,svelte:TF,yaml:FF(DF),markdown:FF(RP),plaintext:FF(qP),ruby:FF(rF),kotlin:FF(OP),swift:FF(vF),php:FF(HP),toml:FF(xF),powershell:FF(YP),dockerfile:FF(kN),graphql:FF(PN),hcl:FF(LN),zig:FF(kF),lua:FF(jP)}}var LF=IF();function RF(e){return LF[e||`javascript`]}function zF(e,t){let{lang:n,cx:r,mark:i,markLine:a}=t||{};return WM($M(e,RF(n)),{cx:r,mark:i,markLine:a})}function BF({code:e,path:t,className:n}){let r=e.replace(/\n$/,``),i=(0,v.useMemo)(()=>zF(r),[r]),a=r.split(`
162
+ `).length;return(0,R.jsxs)(`div`,{className:J(`flex min-w-0 flex-col`,n),children:[t?(0,R.jsxs)(`div`,{className:`flex h-10 items-center justify-between gap-3 border-b border-rule bg-soft pr-1.5 pl-4`,children:[(0,R.jsx)(Z,{size:12,className:`truncate text-muted`,title:t,children:t}),(0,R.jsx)(N_,{icon:`copy`,label:`Copy file`,size:15,onClick:()=>FT(e,`Copied the file`)})]}):null,(0,R.jsxs)(`div`,{className:`flex max-h-[640px] min-w-0 overflow-auto font-mono text-[12.5px] leading-[1.6]`,children:[(0,R.jsx)(`pre`,{"aria-hidden":`true`,className:`sticky left-0 m-0 shrink-0 select-none border-r border-rule bg-surface py-3 pr-3 pl-4 text-right text-muted`,children:Array.from({length:a},(e,t)=>t+1).join(`
163
+ `)}),(0,R.jsx)(`pre`,{className:`m-0 min-w-0 grow py-3 pr-6 pl-4 text-ink`,children:(0,R.jsx)(`code`,{dangerouslySetInnerHTML:{__html:i}})})]})]})}var VF={beta:`action`,experimental:`action`,draft:`action`,deprecated:`danger`,stable:`ok`},HF=`.design/system/components/`;function UF(e){return e.startsWith(HF)?`@system/components/${e.slice(26).replace(/\.(tsx|jsx|ts|js)$/,``).replace(/\/index$/,``)}`:null}function WF(e){let t=new Set;for(let n of e.matchAll(/export\s+(?:async\s+)?(?:function|const|class|let)\s+([A-Za-z_$][\w$]*)/g))t.add(n[1]);for(let n of e.matchAll(/export\s*\{([^}]+)\}/g))for(let e of n[1].split(`,`)){let n=e.trim().split(/\s+as\s+/).pop()?.trim();n&&n!=="default"&&t.add(n)}return[...t].filter(e=>/^[A-Z]/.test(e))}function GF({path:e}){let t=UF(e),n=o_(t?e:null).data;if(!t)return null;let r=n?WF(n):[],i=`import { ${r.length?r.join(`, `):`…`} } from '${t}'`;return(0,R.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-rule py-1.5 pr-1.5 pl-4`,children:[(0,R.jsx)(Z,{size:12.5,className:`min-w-0 truncate text-ink2`,title:i,children:i}),(0,R.jsx)(N_,{icon:`copy`,label:`Copy the import`,size:14,className:`ml-auto`,onClick:()=>FT(i)})]})}function KF({component:e,theme:t,width:n}){return n===`fill`?(0,R.jsx)(OM,{src:e.url,theme:t,title:e.title,minHeight:160}):(0,R.jsx)(`div`,{className:`flex justify-center overflow-x-auto bg-soft p-6`,children:(0,R.jsx)(`div`,{className:`shrink-0 overflow-hidden rounded-[8px] border border-rule bg-surface shadow-frame`,children:(0,R.jsx)(OM,{src:e.url,theme:t,title:e.title,minHeight:160,width:Number(n)})})})}function qF({component:e}){let t=[...e.sources,e.specimen],[n,r]=(0,v.useState)(t[0]),i=t.includes(n)?n:t[0],{data:a,error:o,isLoading:s}=o_(i);return(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[t.length>1?(0,R.jsx)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-rule px-4 py-2.5`,children:(0,R.jsx)(YA,{label:`File`,size:`sm`,value:i,onChange:r,items:t.map(t=>({value:t,label:t===e.specimen?`${JF(t)} · specimen`:JF(t),title:t}))})}):null,UF(i)?(0,R.jsx)(GF,{path:i}):null,o?(0,R.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-6 text-[13px] text-danger-text`,children:[(0,R.jsx)(X,{name:`alert`,size:15}),o.message]}):s||a===void 0?(0,R.jsx)(`div`,{className:`flex items-center justify-center py-10 text-muted`,children:(0,R.jsx)(X,{name:`loader`,size:18})}):(0,R.jsx)(BF,{code:a,path:i})]})}function JF(e){return e.split(`/`).pop()??e}function YF({system:e,id:t}){let n=e.components.find(e=>e.id===t),[r,i]=(0,v.useState)(`preview`),[a,o]=gM(),[s,c]=(0,v.useState)(`fill`),l=!e_().frameSandbox;if(!n)return(0,R.jsx)(zO,{title:`No such component`,text:`There is no specimen "${t}" in .design/system/specimens.`});let u=n.status?.toLowerCase();return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Z_,{title:n.title,badge:(0,R.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,R.jsx)(L_,{children:n.group}),u?(0,R.jsx)(L_,{tone:VF[u]??`neutral`,children:n.status}):null]}),sub:n.description}),(0,R.jsxs)(z_,{children:[(0,R.jsx)(V_,{value:r,onChange:i,items:[{value:`preview`,label:`Preview`},{value:`code`,label:`Code`,count:n.sources.length+1}],right:r===`preview`?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(YA,{label:`Width`,size:`sm`,value:s,onChange:c,items:[{value:`fill`,label:`Fill`},{value:`768`,label:`768`},{value:`390`,label:`390`}]}),(0,R.jsx)(_M,{value:a,onChange:o}),l?(0,R.jsx)(F_,{icon:`external`,href:hO(mO(n.url,a)),target:`_blank`,rel:`noreferrer`,children:`Open`}):null]}):null}),(0,R.jsx)(`div`,{className:`border-t border-rule`,children:r===`preview`?(0,R.jsx)(KF,{component:n,theme:a,width:s}):(0,R.jsx)(qF,{component:n})})]})]})}function XF(e,t){let n=/^\s*#\s+(.+)\r?\n/.exec(e);return n&&n[1].trim()===t?e.slice(n[0].length):e}function ZF({system:e,slug:t}){let n=e.guidelines.find(e=>e.slug===t);if(!n)return(0,R.jsx)(zO,{title:`No such guideline`,text:`There is no guideline "${t}" in .design/system/guidelines.`});let r=XF(n.markdown,n.title).trim();return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Z_,{title:n.title,sub:`Guideline`}),(0,R.jsx)(z_,{children:(0,R.jsx)(`div`,{className:`px-6 py-5`,children:r?(0,R.jsx)(VD,{text:r,className:`max-w-[760px]`}):(0,R.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[`This guideline is empty. Write it in `,(0,R.jsx)(Z,{children:`.design/system/guidelines`}),`.`]})})})]})}var QF={linear:[0,0,1,1],ease:[.25,.1,.25,1],"ease-in":[.42,0,1,1],"ease-out":[0,0,.58,1],"ease-in-out":[.42,0,.58,1]};function $F(e){let t=e.trim();if(QF[t])return QF[t];let n=/^cubic-bezier\(\s*([-\d.]+)\s*,\s*([-\d.]+)\s*,\s*([-\d.]+)\s*,\s*([-\d.]+)\s*\)$/.exec(t);if(!n)return null;let r=n.slice(1).map(Number);return r.every(Number.isFinite)?r:null}function eI(e){let t=/^(-?[\d.]+)(ms|s)$/.exec(e.trim());return t?Number(t[1])*(t[2]===`s`?1e3:1):null}var tI=132,nI=22;function rI({bezier:e}){let[t,n,r,i]=e,a=Math.min(0,n,i),o=Math.max(1,n,i),s=88/(o-a),c=e=>nI+e*88,l=e=>nI+(o-e)*s;return(0,R.jsxs)(`svg`,{width:tI,height:tI,viewBox:`0 0 ${tI} ${tI}`,"aria-hidden":`true`,className:`shrink-0`,children:[(0,R.jsx)(`rect`,{x:c(0),y:l(1),width:88,height:l(0)-l(1),className:`fill-none stroke-rule`}),(0,R.jsx)(`line`,{x1:c(0),y1:l(0),x2:c(t),y2:l(n),className:`stroke-rule-strong`,strokeDasharray:`3 3`}),(0,R.jsx)(`line`,{x1:c(1),y1:l(1),x2:c(r),y2:l(i),className:`stroke-rule-strong`,strokeDasharray:`3 3`}),(0,R.jsx)(`path`,{d:`M ${c(0)} ${l(0)} C ${c(t)} ${l(n)}, ${c(r)} ${l(i)}, ${c(1)} ${l(1)}`,className:`fill-none stroke-ink`,strokeWidth:2,strokeLinecap:`round`}),(0,R.jsx)(`circle`,{cx:c(t),cy:l(n),r:3,className:`fill-action`}),(0,R.jsx)(`circle`,{cx:c(r),cy:l(i),r:3,className:`fill-action`})]})}function iI({token:e,duration:t}){let[n,r]=(0,v.useState)(!1),i=e.light?.value??``,a=$F(i);return(0,R.jsxs)(`button`,{type:`button`,title:`Hover to play; click to copy the variable`,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),onFocus:()=>r(!0),onBlur:()=>r(!1),onClick:()=>FT(`var(${e.name})`),className:`flex min-w-0 cursor-pointer flex-col gap-3 rounded-[8px] border border-transparent bg-transparent p-3 text-left transition-colors hover:border-rule hover:bg-soft`,children:[(0,R.jsx)(`span`,{className:`flex h-[132px] items-center justify-center rounded-[6px] bg-soft`,children:a?(0,R.jsx)(rI,{bezier:a}):(0,R.jsx)(`span`,{className:`text-[12.5px] text-muted`,children:`No curve to draw`})}),(0,R.jsx)(`span`,{className:`relative mx-1 h-2 rounded-full bg-soft2`,children:(0,R.jsx)(`span`,{className:`absolute top-1/2 size-3.5 -translate-y-1/2 rounded-full bg-ink`,style:{left:n?`calc(100% - 14px)`:`0px`,transition:`left ${t}ms ${i||`ease`}`}})}),(0,R.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5 px-1`,children:[(0,R.jsx)(Z,{size:12.5,className:`truncate text-ink`,children:e.name}),(0,R.jsx)(vM,{items:dM(e)}),(0,R.jsx)(xM,{children:i}),e.description?(0,R.jsx)(`span`,{className:`text-[12.5px] text-ink2`,children:e.description}):null]})]})}function aI({system:e}){let t=fM(e.tokens,`ease`),n=fM(e.tokens,`duration`),r=fM(e.tokens,`animation`),i=`minmax(170px,1fr) 100px minmax(0,2fr)`,a=`minmax(170px,1fr) minmax(140px,0.7fr) minmax(0,2fr)`;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Z_,{title:`Motion`,sub:`Hover an easing to see it move.`}),!t.length&&!n.length&&!r.length?(0,R.jsxs)(yM,{title:`No motion tokens`,children:[`Add `,(0,R.jsx)(Z,{children:`--ease-*`}),` and `,(0,R.jsx)(Z,{children:`--animate-*`}),` to the `,(0,R.jsx)(Z,{children:`@theme`}),` block, and durations as`,` `,(0,R.jsx)(Z,{children:`--duration-*`}),`, in `,(0,R.jsx)(Z,{children:bM}),`.`]}):null,t.length?(0,R.jsxs)(z_,{children:[(0,R.jsx)(B_,{title:`Easing`,count:t.length}),(0,R.jsx)(`div`,{className:`grid gap-2 border-t border-rule p-3`,style:{gridTemplateColumns:`repeat(auto-fill, minmax(190px, 1fr))`},children:t.map(e=>(0,R.jsx)(iI,{token:e,duration:900},e.name))})]}):null,n.length?(0,R.jsxs)(z_,{children:[(0,R.jsx)(B_,{title:`Durations`,count:n.length}),(0,R.jsx)(W_,{cols:i,labels:[`Token`,`Value`,``]}),n.map(e=>{let t=e.light?eI(e.light.value):null;return(0,R.jsxs)(K_,{cols:i,minH:40,onClick:()=>FT(`var(${e.name})`),children:[(0,R.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,R.jsx)(Z,{size:12.5,className:`truncate text-ink`,children:e.name}),e.description?(0,R.jsx)(`span`,{className:`truncate text-[12.5px] text-muted`,children:e.description}):null]}),(0,R.jsx)(Z,{size:12,className:`text-muted`,children:e.light?.value}),t===null?(0,R.jsx)(`span`,{}):(0,R.jsx)(`span`,{className:`h-3 rounded-[3px] bg-action/70`,style:{width:Math.max(2,Math.min(t/2,480))}})]},e.name)})]}):null,r.length?(0,R.jsxs)(z_,{children:[(0,R.jsx)(B_,{title:`Animations`,count:r.length,sub:`keyframes live in the system stylesheet`}),(0,R.jsx)(W_,{cols:a,labels:[`Token`,`Class`,`Value`]}),r.map(e=>(0,R.jsxs)(K_,{cols:a,minH:40,onClick:()=>FT(`var(${e.name})`),children:[(0,R.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,R.jsx)(Z,{size:12.5,className:`truncate text-ink`,children:e.name}),e.description?(0,R.jsx)(`span`,{className:`truncate text-[12.5px] text-muted`,children:e.description}):null]}),(0,R.jsx)(vM,{items:dM(e)}),(0,R.jsx)(xM,{children:e.light?.value})]},e.name))]}):null]})}function oI({system:e}){let t=Tw(),n=new Set(e.tokens.map(e=>e.kind)),r=[{to:`/system/colors`,label:`Colors`,hint:sI(e,`color`)},{to:`/system/typography`,label:`Typography`},{to:`/system/shape`,label:`Spacing & shape`}];(n.has(`ease`)||n.has(`duration`)||n.has(`animation`))&&r.push({to:`/system/motion`,label:`Motion`}),n.has(`other`)&&r.push({to:`/system/tokens`,label:`Other tokens`,hint:sI(e,`other`)}),e.assets.length&&r.push({to:`/system/assets`,label:`Assets`,hint:e.assets.length});let i=new Map;for(let t of e.components){let e=i.get(t.group)??[];e.push({to:`/system/components/${encodeURIComponent(t.id)}`,label:t.title,hint:t.status}),i.set(t.group,e)}let a=e.guidelines.filter(e=>e.slug!==`overview`);if(t){let e=[{label:``,items:[{to:`/system`,label:`Overview`}]},{label:`Foundations`,items:r},{label:`Guidelines`,items:a.map(e=>({to:`/system/guidelines/${encodeURIComponent(e.slug)}`,label:e.title}))},...[...i].map(([e,t])=>({label:e,items:t}))];return(0,R.jsx)(cI,{sections:e.filter(e=>e.items.length)})}return(0,R.jsxs)(`div`,{className:`flex flex-col max-lg:gap-1 max-lg:[&_nav]:flex-row max-lg:[&_nav]:flex-wrap`,children:[(0,R.jsx)(Q_,{label:`Overview`,items:[{to:`/system`,label:`Overview`}]}),(0,R.jsx)($_,{children:`Foundations`}),(0,R.jsx)(Q_,{label:`Foundations`,items:r}),a.length?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)($_,{children:`Guidelines`}),(0,R.jsx)(Q_,{label:`Guidelines`,items:a.map(e=>({to:`/system/guidelines/${encodeURIComponent(e.slug)}`,label:e.title}))})]}):null,[...i].map(([e,t])=>(0,R.jsxs)(`div`,{className:`flex flex-col`,children:[(0,R.jsx)($_,{children:e}),(0,R.jsx)(Q_,{label:e,items:t})]},e))]})}function sI(e,t){return e.tokens.filter(e=>e.kind===t).length||void 0}function cI({sections:e}){let[t]=I(),[n,r]=(0,v.useState)(!1),i=e.flatMap(e=>e.items).find(e=>e.to===t);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`button`,{type:`button`,onClick:()=>r(!0),className:`flex h-11 w-full cursor-pointer items-center gap-2 rounded-[8px] border border-rule bg-surface px-3.5 text-left text-[14px] text-ink`,children:[(0,R.jsx)(`span`,{className:`text-[12.5px] text-muted`,children:`Section`}),(0,R.jsx)(`span`,{className:`min-w-0 grow truncate font-medium`,children:i?.label??`Overview`}),(0,R.jsx)(X,{name:`chevron-down`,size:16,className:`shrink-0 text-muted`})]}),(0,R.jsx)(Lj,{open:n,onOpenChange:r,title:`Design system`,children:(0,R.jsx)(`nav`,{"aria-label":`Design system`,className:`flex flex-col pb-2`,children:e.map(e=>(0,R.jsxs)(`div`,{className:`flex flex-col`,children:[e.label?(0,R.jsx)(`div`,{className:`px-4 pt-3 pb-1 text-[12px] text-muted`,children:e.label}):null,e.items.map(e=>{let n=e.to===t;return(0,R.jsxs)(ye,{href:e.to,onClick:()=>r(!1),"aria-current":n?`page`:void 0,className:J(`flex min-h-[46px] items-center gap-2 px-4 text-[14px] no-underline active:bg-soft2`,n?`font-medium text-ink`:`text-ink2`),children:[(0,R.jsx)(`span`,{className:`min-w-0 grow truncate`,children:e.label}),e.hint?(0,R.jsx)(`span`,{className:`text-[12.5px] text-muted`,children:e.hint}):null,n?(0,R.jsx)(X,{name:`check`,size:16,className:`shrink-0 text-action`}):null]},e.to)})]},e.label||`overview`))})})]})}function lI({system:e}){let t=fM(e.tokens,`other`),n=`minmax(170px,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1.3fr)`;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Z_,{title:`Other tokens`,sub:`Variables that are not colors, type, spacing, shape or motion.`}),t.length?pM(t).map(({group:e,tokens:t})=>(0,R.jsxs)(z_,{children:[(0,R.jsx)(B_,{title:e,count:t.length}),(0,R.jsx)(W_,{cols:n,labels:[`Token`,`Light`,`Dark`,`Description`]}),t.map(e=>(0,R.jsxs)(K_,{cols:n,minH:40,title:`Copy the variable`,onClick:()=>FT(`var(${e.name})`),children:[(0,R.jsx)(Z,{size:12.5,className:`truncate text-ink`,children:e.name}),(0,R.jsx)(xM,{children:e.light?.value}),(0,R.jsx)(xM,{children:e.dark?.value??`—`}),(0,R.jsx)(`span`,{className:`text-[13px] text-ink2`,children:e.description})]},e.name))]},e)):(0,R.jsxs)(yM,{title:`No other tokens`,children:[`Variables in `,(0,R.jsx)(Z,{children:`:root`}),` of `,(0,R.jsx)(Z,{children:bM}),` that are not colors or lengths show here.`]})]})}function uI(e,...t){return e.tokens.filter(e=>t.includes(e.kind)).length}function dI(e){let t=[{to:`/system/colors`,icon:`palette`,title:`Colors`,text:$j(uI(e,`color`),`token`)},{to:`/system/typography`,icon:`type`,title:`Typography`,text:`${$j(uI(e,`font`),`family`,`families`)} · ${$j(uI(e,`text`),`size`)}`},{to:`/system/shape`,icon:`shape`,title:`Spacing & shape`,text:$j(uI(e,`spacing`,`radius`,`shadow`,`blur`,`breakpoint`),`token`)}],n=uI(e,`ease`,`duration`,`animation`);n&&t.push({to:`/system/motion`,icon:`motion`,title:`Motion`,text:$j(n,`token`)}),e.assets.length&&t.push({to:`/system/assets`,icon:`image`,title:`Assets`,text:$j(e.assets.length,`file`)});let r=e.components[0];return r&&t.push({to:`/system/components/${encodeURIComponent(r.id)}`,icon:`component`,title:`Components`,text:$j(e.components.length,`component`)}),t}function fI({system:e}){return(0,R.jsx)(`div`,{className:`grid gap-4`,style:{gridTemplateColumns:`repeat(auto-fill, minmax(220px, 1fr))`},children:dI(e).map(e=>(0,R.jsxs)(ye,{href:e.to,className:`flex items-center gap-3 rounded-[10px] border border-rule bg-surface px-4 py-3.5 text-inherit no-underline transition-colors hover:border-rule-strong hover:bg-soft`,children:[(0,R.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-[8px] bg-soft2 text-ink2`,children:(0,R.jsx)(X,{name:e.icon,size:17})}),(0,R.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,R.jsx)(`span`,{className:`text-[14px] font-medium text-ink`,children:e.title}),(0,R.jsx)(`span`,{className:`truncate text-[12.5px] text-muted`,children:e.text})]})]},e.to))})}function pI({system:e}){let[,t]=I(),n=[{label:`Color tokens`,value:uI(e,`color`),to:`/system/colors`},{label:`Type tokens`,value:uI(e,`font`,`text`,`weight`,`leading`,`tracking`),to:`/system/typography`},{label:`Spacing & shape tokens`,value:uI(e,`spacing`,`radius`,`shadow`,`blur`,`breakpoint`),to:`/system/shape`},{label:`Motion tokens`,value:uI(e,`ease`,`duration`,`animation`),to:`/system/motion`},{label:`Other tokens`,value:uI(e,`other`),to:`/system/tokens`},{label:`Components`,value:e.components.length},{label:`Guidelines`,value:e.guidelines.length}];return(0,R.jsxs)(z_,{children:[(0,R.jsx)(B_,{title:`At a glance`}),n.filter(e=>e.value||!e.to||e.to===`/system/colors`).map(e=>(0,R.jsxs)(K_,{cols:`minmax(0,1fr) auto`,align:`lr`,minH:40,pad:`8px 16px`,onClick:e.to&&e.value?()=>t(e.to):void 0,children:[(0,R.jsx)(`span`,{className:`text-[13.5px] text-ink2`,children:e.label}),(0,R.jsx)(R_,{value:e.value})]},e.label)),e.fonts.length?(0,R.jsxs)(K_,{cols:`minmax(0,1fr) auto`,align:`lr`,minH:40,pad:`8px 16px`,children:[(0,R.jsx)(`span`,{className:`text-[13.5px] text-ink2`,children:`Web fonts`}),(0,R.jsx)(`span`,{className:`flex min-w-0 flex-col items-end gap-0.5`,children:e.fonts.map(e=>(0,R.jsx)(Z,{size:12,className:`max-w-[260px] truncate text-muted`,title:e,children:mI(e)},e))})]}):null]})}function mI(e){try{let t=new URL(e),n=t.searchParams.getAll(`family`).map(e=>e.split(`:`)[0].replace(/\+/g,` `));return n.length?n.join(`, `):t.host}catch{return e}}function hI({system:e}){let t=e.guidelines.find(e=>e.slug===`overview`);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Z_,{title:e.name,sub:e.description}),(0,R.jsx)(AO,{issues:e.issues,title:`Problems in the design system`}),(0,R.jsx)(fI,{system:e}),(0,R.jsxs)(`div`,{className:`grid items-start gap-5 max-xl:grid-cols-1!`,style:{gridTemplateColumns:`minmax(0,1fr) 320px`},children:[t?(0,R.jsx)(z_,{children:(0,R.jsx)(`div`,{className:`px-6 py-5`,children:(0,R.jsx)(VD,{text:t.markdown})})}):(0,R.jsxs)(z_,{children:[(0,R.jsx)(B_,{title:`Overview`}),(0,R.jsxs)(`div`,{className:`border-t border-rule px-4 py-5 text-[13px] text-muted`,children:[`Write the principles every screen follows in `,(0,R.jsx)(Z,{children:`.design/system/guidelines/01-overview.md`}),`; it shows here.`]})]}),(0,R.jsx)(pI,{system:e})]})]})}var gI=[1,2,3,4,6,8,12,16],_I=480;function vI({px:e}){return e===null?(0,R.jsx)(`span`,{className:`text-[12.5px] text-muted`,children:`not a plain length`}):(0,R.jsxs)(`span`,{className:`flex h-3 items-center`,children:[(0,R.jsx)(`span`,{className:`h-3 rounded-[3px] bg-action/70`,style:{width:Math.max(2,Math.min(e,_I))},title:`${e}px`}),e>_I?(0,R.jsx)(`span`,{className:`ml-1.5 text-[12px] text-muted`,children:`…`}):null]})}function yI({tokens:e}){let t=e.find(e=>e.name===`--spacing`),n=e.filter(e=>e!==t),r=t?.light?mM(t.light.value):null,i=`minmax(150px,0.8fr) 110px minmax(0,2fr)`;return(0,R.jsxs)(z_,{children:[(0,R.jsx)(B_,{title:`Spacing`,count:e.length,sub:t?`base ${t.light?.value}`:void 0}),(0,R.jsx)(W_,{cols:i,labels:[`Class or token`,`Value`,``]}),t&&r!==null?gI.map(e=>(0,R.jsxs)(K_,{cols:i,minH:36,pad:`6px 16px`,children:[(0,R.jsxs)(Z,{size:12.5,className:`text-ink`,children:[`p-`,e,` · gap-`,e]}),(0,R.jsxs)(Z,{size:12,className:`text-muted`,children:[r*e,`px`]}),(0,R.jsx)(vI,{px:r*e})]},e)):null,n.map(e=>(0,R.jsxs)(K_,{cols:i,minH:40,pad:`6px 16px`,title:`Copy the variable`,onClick:()=>FT(`var(${e.name})`),children:[(0,R.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,R.jsx)(Z,{size:12.5,className:`truncate text-ink`,children:e.name}),e.description?(0,R.jsx)(`span`,{className:`truncate text-[12.5px] text-muted`,children:e.description}):null]}),(0,R.jsx)(Z,{size:12,className:`text-muted`,children:e.light?.value}),(0,R.jsx)(vI,{px:e.light?mM(e.light.value):null})]},e.name))]})}function bI({token:e,children:t}){return(0,R.jsxs)(`button`,{type:`button`,title:`Copy the variable`,onClick:()=>FT(`var(${e.name})`),className:`flex min-w-0 cursor-pointer flex-col items-stretch gap-2.5 rounded-[8px] border border-transparent bg-transparent p-2 text-left transition-colors hover:border-rule hover:bg-soft`,children:[t,(0,R.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5 px-1`,children:[(0,R.jsx)(Z,{size:12.5,className:`truncate text-ink`,children:e.name}),(0,R.jsx)(vM,{items:dM(e)}),(0,R.jsx)(xM,{children:e.light?.value}),e.description?(0,R.jsx)(`span`,{className:`text-[12.5px] text-ink2`,children:e.description}):null]})]})}function xI({title:e,tokens:t,min:n=170,children:r}){return(0,R.jsxs)(z_,{children:[(0,R.jsx)(B_,{title:e,count:t.length}),(0,R.jsx)(`div`,{className:`grid gap-2 border-t border-rule p-3`,style:{gridTemplateColumns:`repeat(auto-fill, minmax(${n}px, 1fr))`},children:t.map(e=>(0,R.jsx)(bI,{token:e,children:r(e)},e.name))})]})}function SI({tokens:e}){let t=`minmax(170px,1fr) minmax(90px,0.6fr) 110px 90px`;return(0,R.jsxs)(z_,{children:[(0,R.jsx)(B_,{title:`Breakpoints`,count:e.length}),(0,R.jsx)(W_,{cols:t,labels:[`Token`,`Variant`,`Value`,`Pixels`],align:`lllr`}),e.map(e=>{let n=e.light?mM(e.light.value):null;return(0,R.jsxs)(K_,{cols:t,align:`lllr`,minH:40,onClick:()=>FT(`var(${e.name})`),children:[(0,R.jsx)(Z,{size:12.5,className:`truncate text-ink`,children:e.name}),(0,R.jsx)(vM,{items:dM(e)}),(0,R.jsx)(Z,{size:12,className:`text-muted`,children:e.light?.value}),(0,R.jsx)(Z,{size:12,className:`text-muted`,children:n===null?``:`${n}px`})]},e.name)})]})}function CI({system:e}){let t=b_(),n=fM(e.tokens,`spacing`),r=fM(e.tokens,`radius`),i=fM(e.tokens,`shadow`),a=fM(e.tokens,`blur`),o=fM(e.tokens,`breakpoint`),s=!n.length&&!r.length&&!i.length&&!a.length&&!o.length;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Z_,{title:`Spacing & shape`,sub:`Click a token to copy its variable.`}),s?(0,R.jsxs)(yM,{title:`No spacing or shape tokens`,children:[`Add `,(0,R.jsx)(Z,{children:`--spacing`}),` (the base step), `,(0,R.jsx)(Z,{children:`--spacing-*`}),`, `,(0,R.jsx)(Z,{children:`--radius-*`}),`,`,` `,(0,R.jsx)(Z,{children:`--shadow-*`}),` and `,(0,R.jsx)(Z,{children:`--breakpoint-*`}),` to the `,(0,R.jsx)(Z,{children:`@theme`}),` block in`,` `,(0,R.jsx)(Z,{children:bM}),`.`]}):null,n.length?(0,R.jsx)(yI,{tokens:n}):null,r.length?(0,R.jsx)(xI,{title:`Radii`,tokens:r,children:e=>(0,R.jsx)(`span`,{className:`flex h-[88px] items-center justify-center rounded-[6px] bg-soft`,children:(0,R.jsx)(`span`,{className:`size-14 border border-rule-strong bg-surface`,style:{borderRadius:e.light?.value}})})}):null,i.length?(0,R.jsx)(xI,{title:`Shadows`,tokens:i,min:200,children:e=>(0,R.jsx)(`span`,{className:`flex h-[112px] items-center justify-center rounded-[6px] bg-soft`,children:(0,R.jsx)(`span`,{className:`h-[60px] w-[108px] rounded-[8px] bg-surface`,style:{boxShadow:hM(e,t)}})})}):null,a.length?(0,R.jsx)(xI,{title:`Blur`,tokens:a,children:e=>(0,R.jsxs)(`span`,{className:`relative flex h-[88px] items-center justify-center overflow-hidden rounded-[6px] bg-soft`,children:[(0,R.jsx)(`span`,{className:`absolute left-5 top-4 size-10 rounded-full bg-action`}),(0,R.jsx)(`span`,{className:`absolute right-6 bottom-3 size-12 rounded-[6px] bg-ink2`}),(0,R.jsx)(`span`,{className:`absolute inset-x-6 inset-y-5 rounded-[6px] bg-surface/40`,style:{backdropFilter:`blur(${e.light?.value})`}})]})}):null,o.length?(0,R.jsx)(SI,{tokens:o}):null]})}var wI={font:`Family`,text:`Size`,weight:`Weight`,leading:`Line height`,tracking:`Letter spacing`};function TI(e){return e.kind===`text`?[e.light?.value,e.lineHeight].filter(Boolean).join(` / `):e.light?.value??``}function EI({system:e}){let[t,n]=gM(),r=fM(e.tokens,`font`,`text`,`weight`,`leading`,`tracking`);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Z_,{title:`Typography`,sub:`Set in the design system's own stylesheet, with its fonts.`}),e.typographyUrl?(0,R.jsxs)(z_,{children:[(0,R.jsx)(B_,{title:`Specimen`,right:(0,R.jsx)(_M,{value:t,onChange:n})}),(0,R.jsx)(`div`,{className:`border-t border-rule`,children:(0,R.jsx)(OM,{src:e.typographyUrl,theme:t,title:`Typography specimen`,minHeight:200})})]}):null,r.length?(0,R.jsxs)(z_,{children:[(0,R.jsx)(B_,{title:`Tokens`,count:r.length}),(0,R.jsx)(W_,{cols:`minmax(160px,1fr) 110px minmax(120px,0.8fr) minmax(0,1.4fr)`,labels:[`Token`,`Kind`,`Class`,`Value`]}),r.map(e=>(0,R.jsxs)(K_,{cols:`minmax(160px,1fr) 110px minmax(120px,0.8fr) minmax(0,1.4fr)`,minH:42,title:`Copy the variable`,onClick:()=>FT(`var(${e.name})`),children:[(0,R.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,R.jsx)(Z,{size:12.5,className:`truncate text-ink`,children:e.name}),e.description?(0,R.jsx)(`span`,{className:`truncate text-[12.5px] text-muted`,children:e.description}):null]}),(0,R.jsx)(`span`,{className:`text-[13px] text-ink2`,children:wI[e.kind]}),(0,R.jsx)(vM,{items:dM(e)}),(0,R.jsx)(xM,{children:TI(e)})]},e.name))]}):(0,R.jsxs)(yM,{title:`No type tokens`,children:[`Add font families (`,(0,R.jsx)(Z,{children:`--font-*`}),`), sizes (`,(0,R.jsx)(Z,{children:`--text-*`}),` with`,` `,(0,R.jsx)(Z,{children:`--text-*--line-height`}),`) and weights (`,(0,R.jsx)(Z,{children:`--font-weight-*`}),`) to the `,(0,R.jsx)(Z,{children:`@theme`}),` `,`block in `,(0,R.jsx)(Z,{children:bM}),`. Web fonts go in `,(0,R.jsx)(Z,{children:`system.json`}),` `,(0,R.jsx)(Z,{children:`fonts`}),`.`]})]})}function DI({system:e}){let[t]=I();return(0,R.jsx)(`main`,{className:`mx-auto flex w-full max-w-[1440px] grow animate-[q-fade-in_160ms_ease-out] px-8 max-md:px-4`,children:(0,R.jsxs)(`div`,{className:`grid w-full items-start gap-6 max-lg:grid-cols-1! max-lg:gap-0`,style:{gridTemplateColumns:`232px minmax(0, 1fr)`},children:[(0,R.jsx)(`aside`,{className:`sticky top-[52px] flex max-h-[calc(100dvh-52px)] flex-col overflow-y-auto pt-6 pb-4 max-lg:static max-lg:max-h-none max-lg:overflow-visible max-lg:pb-0 max-md:pt-4`,children:(0,R.jsx)(oI,{system:e})}),(0,R.jsx)(`div`,{className:`flex min-w-0 animate-[q-fade-in_160ms_ease-out] flex-col gap-5 pt-6 pb-7`,children:(0,R.jsxs)(xe,{children:[(0,R.jsx)(L,{path:`/system`,children:(0,R.jsx)(hI,{system:e})}),(0,R.jsx)(L,{path:`/system/colors`,children:(0,R.jsx)(DM,{system:e})}),(0,R.jsx)(L,{path:`/system/typography`,children:(0,R.jsx)(EI,{system:e})}),(0,R.jsx)(L,{path:`/system/shape`,children:(0,R.jsx)(CI,{system:e})}),(0,R.jsx)(L,{path:`/system/motion`,children:(0,R.jsx)(aI,{system:e})}),(0,R.jsx)(L,{path:`/system/tokens`,children:(0,R.jsx)(lI,{system:e})}),(0,R.jsx)(L,{path:`/system/assets`,children:(0,R.jsx)(CM,{system:e})}),(0,R.jsx)(L,{path:`/system/guidelines/:slug`,children:t=>(0,R.jsx)(ZF,{system:e,slug:decodeURIComponent(t.slug)})}),(0,R.jsx)(L,{path:`/system/components/:id`,children:t=>(0,R.jsx)(YF,{system:e,id:decodeURIComponent(t.id)})}),(0,R.jsx)(L,{children:(0,R.jsx)(zO,{title:`No such page`,text:`This page is not part of the design system.`})})]})},t)]})})}function OI(){return(0,R.jsx)(tv,{title:`No design system yet`,text:(0,R.jsxs)(R.Fragment,{children:[`Ask your agent to build one from the codebase, or run `,(0,R.jsx)(Z,{children:`design system init`}),` to start from a template in `,(0,R.jsx)(Z,{children:`.design/system`}),`.`]})})}function kI(){let e=r_().data,t=e?e.system!==null:void 0,{data:n,error:r,isLoading:i}=a_(t===!0);return t===!1||n===null||r instanceof Ig&&r.status===404?(0,R.jsx)(OI,{}):r?(0,R.jsx)(tv,{title:`Could not load the design system`,text:r.message}):i||!n?null:(0,R.jsx)(DI,{system:n})}function AI(){let{name:e,icon:t}=r_().data??{};return(0,v.useEffect)(()=>{e&&(document.title=`${e} · Design`)},[e]),(0,v.useEffect)(()=>{let e=document.querySelector(`link[rel="icon"]`);e&&(e.dataset.fallback??=e.getAttribute(`href`)??``,e.removeAttribute(`type`),e.href=t||e.dataset.fallback)},[t]),null}var jI=new URLSearchParams(window.location.search).has(`capture`);function MI(){let e=Tw()&&!jI;return{play:(t,n)=>e?(0,R.jsx)(Uj,{canvasId:t,itemId:n}):(0,R.jsx)(Bj,{canvasId:t,itemId:n}),canvas:(t,n)=>e?(0,R.jsx)(Uj,{canvasId:t,pageId:n}):(0,R.jsx)(bj,{canvasId:t,pageId:n})}}function NI(){let e=MI();return(0,R.jsxs)(xe,{children:[(0,R.jsx)(L,{path:`/c/:canvas/full/:item`,children:e=>(0,R.jsx)(nj,{canvasId:e.canvas,itemId:e.item})}),(0,R.jsx)(L,{path:`/c/:canvas/play/:item`,children:t=>e.play(t.canvas,t.item)}),(0,R.jsx)(L,{path:`/c/:canvas/board/:page`,children:e=>(0,R.jsx)(Nj,{canvasId:e.canvas,pageId:e.page})}),(0,R.jsx)(L,{path:`/c/:canvas/markup/:item`,children:e=>(0,R.jsx)(Ij,{canvasId:e.canvas,itemId:e.item})}),(0,R.jsx)(L,{path:`/c/:canvas/p/:page`,children:t=>e.canvas(t.canvas,t.page)}),(0,R.jsx)(L,{path:`/c/:canvas`,children:t=>e.canvas(t.canvas)}),(0,R.jsxs)(L,{path:`/system/*?`,children:[(0,R.jsx)(xw,{}),(0,R.jsx)(kI,{})]}),(0,R.jsxs)(L,{path:`/`,children:[(0,R.jsx)(xw,{}),(0,R.jsx)(uM,{})]}),(0,R.jsxs)(L,{children:[(0,R.jsx)(xw,{}),(0,R.jsx)(zO,{})]})]})}function PI({canvas:e}){let t=`/c/${encodeURIComponent(e)}`,n=(n,r)=>t_(n,e)?r:(0,R.jsx)(Se,{to:t,replace:!0}),r=MI();return(0,R.jsxs)(xe,{children:[(0,R.jsx)(L,{path:`/c/:canvas/full/:item`,children:t=>n(t.canvas,(0,R.jsx)(nj,{canvasId:e,itemId:t.item}))}),(0,R.jsx)(L,{path:`/c/:canvas/play/:item`,children:t=>n(t.canvas,r.play(e,t.item))}),(0,R.jsx)(L,{path:`/c/:canvas/p/:page`,children:t=>n(t.canvas,r.canvas(e,t.page))}),(0,R.jsx)(L,{path:`/c/:canvas`,children:t=>n(t.canvas,r.canvas(e))}),(0,R.jsx)(L,{children:(0,R.jsx)(Se,{to:t,replace:!0})})]})}function FI({source:e,base:t=``,frameSandbox:n,frameAllow:r=Yg,slots:i,scope:a,queryClient:o}){let[s]=(0,v.useState)(()=>o??n_(e.live)),c=o??s,l=(0,v.useMemo)(()=>Jg(Qg(e)),[e]),u=a?.canvas,d=(0,v.useMemo)(()=>({source:e,keys:l,frameSandbox:n,frameAllow:r,slots:i??{},scope:u===void 0?null:{canvas:u}}),[e,l,n,r,i,u]);return(0,v.useEffect)(()=>e.live?s_(c,l):void 0,[e,c,l]),(0,R.jsx)(Ne,{client:c,children:(0,R.jsx)($g.Provider,{value:d,children:(0,R.jsx)(ad,{reducedMotion:`user`,children:(0,R.jsxs)(Dx,{children:[(0,R.jsx)(AI,{}),(0,R.jsxs)(ge,{base:t,children:[(0,R.jsx)(iv,{children:d.scope?(0,R.jsx)(PI,{canvas:d.scope.canvas}):(0,R.jsx)(NI,{})}),(0,R.jsx)(D_,{})]}),(0,R.jsx)(PT,{})]})})})})}(0,y.createRoot)(document.getElementById(`root`)).render((0,R.jsx)(v.StrictMode,{children:Fg?(0,R.jsx)(ge,{hook:ke,hrefs:e=>`#${e}`,children:(0,R.jsx)(FI,{source:Ug})}):(0,R.jsx)(FI,{source:Vg})}));