frameboard 0.22.0 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,111 +0,0 @@
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,t.exports),e=null),t.exports),s=(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},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(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 l=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 N(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 P(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,P(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,`$&/`)+`/`),P(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+=P(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+=P(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return P(N(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 F(e,t,n){if(e==null)return e;var r=[],i=0;return P(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function I(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 L=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 R(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,L)}catch(e){L(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function z(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 R(z.bind(null,e))}var ee={map:F,forEach:function(e,t,n){F(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return F(e,function(){t++}),t},toArray:function(e){return F(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=ee,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=z,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:I}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=R,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.1`})),u=o(((e,t)=>{t.exports=l()})),d=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}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u();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 d(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=d(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=d(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=d(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=d(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.1`})),m=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=p()})),h=o((e=>{var t=f(),n=u(),r=m();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 d(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 p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}function h(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&h(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function g(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function _(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function v(e){var t=[null,null],n=g(e);return n===null||y(t,e,n.child,{foundSelf:!1}),t}function y(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&y(e,t,n.child,r))return!0;n=n.sibling}return!1}function b(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(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`),N=Symbol.for(`react.profiler`),P=Symbol.for(`react.consumer`),F=Symbol.for(`react.context`),I=Symbol.for(`react.forward_ref`),L=Symbol.for(`react.suspense`),R=Symbol.for(`react.suspense_list`),z=Symbol.for(`react.memo`),ee=Symbol.for(`react.lazy`),te=Symbol.for(`react.activity`),ne=Symbol.for(`react.legacy_hidden`),re=Symbol.for(`react.memo_cache_sentinel`),ie=Symbol.for(`react.view_transition`),ae=Symbol.for(`react.recoverable`),B=Symbol.iterator;function V(e){return typeof e!=`object`||!e?null:(e=B&&e[B]||e[`@@iterator`],typeof e==`function`?e:null)}var oe=Symbol.for(`react.client.reference`);function se(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===oe?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case j:return`Fragment`;case N:return`Profiler`;case M:return`StrictMode`;case L:return`Suspense`;case R:return`SuspenseList`;case te:return`Activity`;case ie:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case A:return`Portal`;case F:return e.displayName||`Context`;case P:return(e._context.displayName||`Context`)+`.Consumer`;case I:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case z:return t=e.displayName||null,t===null?se(e.type)||`Memo`:t;case ee:t=e._payload,e=e._init;try{return se(e(t))}catch{}}return null}var ce=Array.isArray,H=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,le=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue={pending:!1,data:null,method:null,action:null},de=[],fe=-1;function pe(e){return{current:e}}function me(e){0>fe||(e.current=de[fe],de[fe]=null,fe--)}function he(e,t){fe++,de[fe]=e.current,e.current=t}var ge=pe(null),_e=pe(null),ve=pe(null),ye=pe(null);function be(e,t){switch(he(ve,t),he(_e,e),he(ge,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?fp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=fp(t),e=pp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}me(ge),he(ge,e)}function xe(){me(ge),me(_e),me(ve)}function U(e){var t=e.memoizedState;t!==null&&(lh._currentValue=t.memoizedState,he(ye,e)),t=ge.current;var n=pp(t,e.type);t!==n&&(he(_e,e),he(ge,n))}function Se(e){_e.current===e&&(me(ge),me(_e)),ye.current===e&&(me(ye),lh._currentValue=ue)}var Ce,we;function Te(e){if(Ce===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Ce=t&&t[1]||``,we=-1<e.stack.indexOf(`
2
- at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
- `+Ce+e+we}var Ee=!1;function De(e,t){if(!e||Ee)return``;Ee=!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{Ee=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Te(n):``}function Oe(e,t){switch(e.tag){case 26:case 27:case 5:return Te(e.type);case 16:return Te(`Lazy`);case 13:return e.child!==t&&t!==null?Te(`Suspense Fallback`):Te(`Suspense`);case 19:return Te(`SuspenseList`);case 0:case 15:return De(e.type,!1);case 11:return De(e.type.render,!1);case 1:return De(e.type,!0);case 31:return Te(`Activity`);case 30:return Te(`ViewTransition`);default:return``}}function ke(e){try{var t=``,n=null;do t+=Oe(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
- Error generating stack: `+e.message+`
8
- `+e.stack}}var Ae=Object.prototype.hasOwnProperty,je=t.unstable_scheduleCallback,Me=t.unstable_cancelCallback,Ne=t.unstable_shouldYield,Pe=t.unstable_requestPaint,Fe=t.unstable_now,Ie=t.unstable_getCurrentPriorityLevel,Le=t.unstable_ImmediatePriority,Re=t.unstable_UserBlockingPriority,ze=t.unstable_NormalPriority,Be=t.unstable_LowPriority,Ve=t.unstable_IdlePriority,He=t.log,Ue=t.unstable_setDisableYieldValue,W=null,We=null;function Ge(e){if(typeof He==`function`&&Ue(e),We&&typeof We.setStrictMode==`function`)try{We.setStrictMode(W,e)}catch{}}var Ke=Math.clz32?Math.clz32:Ye,qe=Math.log,Je=Math.LN2;function Ye(e){return e>>>=0,e===0?32:31-(qe(e)/Je|0)|0}var Xe=256,Ze=262144,Qe=4194304;function $e(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 et(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=$e(n))):i=$e(o):i=$e(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=$e(n))):i=$e(o)):i=$e(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 tt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function nt(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-Ke(n),i=1<<r;t|=e[r],n&=~i}return t}function rt(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 it(){var e=Qe;return Qe<<=1,!(Qe&62914560)&&(Qe=4194304),e}function at(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ot(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function st(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-Ke(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&&ct(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function ct(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ke(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function lt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ke(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function ut(e,t){var n=t&-t;return n=n&42?1:dt(n),(n&(e.suspendedLanes|t))===0?n:0}function dt(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 ft(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function pt(){var e=le.p;return e===0?(e=window.event,e===void 0?32:Th(e.type)):e}function mt(e,t){var n=le.p;try{return le.p=e,t()}finally{le.p=n}}var ht=Math.random().toString(36).slice(2),gt=`__reactFiber$`+ht,_t=`__reactProps$`+ht,vt=`__reactContainer$`+ht,yt=`__reactEvents$`+ht,bt=`__reactListeners$`+ht,xt=`__reactHandles$`+ht,St=`__reactResources$`+ht,Ct=`__reactMarker$`+ht,wt=`__reactLoad$`+ht;function Tt(e){delete e[gt],delete e[_t],delete e[bt],delete e[xt]}function Et(e){var t;if(t=e[gt])return t;for(var n=e.parentNode;n;){if(t=n[vt]||n[gt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=mm(e);e!==null;){if(n=e[gt])return n;e=mm(e)}return t}e=n,n=e.parentNode}return null}function Dt(e){if(e=e[gt]||e[vt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ot(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function kt(e){var t=e[St];return t||=e[St]={hoistableStyles:new Map,hoistableScripts:new Map},t}function At(e){e[Ct]=!0}function jt(e){e[wt]=void 0}var Mt=new Set,Nt={};function Pt(e,t){Ft(e,t),Ft(e+`Capture`,t)}function Ft(e,t){for(Nt[e]=t,e=0;e<t.length;e++)Mt.add(t[e])}var It=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]*$`),Lt={},Rt={};function zt(e){return Ae.call(Rt,e)?!0:Ae.call(Lt,e)?!1:It.test(e)?Rt[e]=!0:(Lt[e]=!0,!1)}var Bt=!1;function Vt(){var e=Bt;return Bt=!1,e}function Ht(e,t,n){if(zt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function Ut(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function Wt(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 Gt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Kt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function qt(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 Jt(e){if(!e._valueTracker){var t=Kt(e)?`checked`:`value`;e._valueTracker=qt(e,t,``+e[t])}}function Yt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Kt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var Xt=/[\n"\\]/g;function Zt(e){return e.replace(Xt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Qt(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=``+Gt(t)):e.value!==``+Gt(t)&&(e.value=``+Gt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):en(e,Gt(n)):o===`number`&&e.value==t?en(e,Gt(e.value)):en(e,Gt(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=``+Gt(s):e.removeAttribute(`name`)}function $t(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)){Jt(e);return}n=n==null?``:``+Gt(n),t=t==null?n:``+Gt(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),Jt(e)}function en(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function tn(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=``+Gt(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 nn(e,t,n){t!=null&&(t=``+Gt(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+Gt(n)}function rn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ce(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Gt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Jt(e)}function an(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var on=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 sn(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||on.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function cn(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]=``,Bt=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(sn(e,a,r),Bt=!0)}else for(var o in t)t.hasOwnProperty(o)&&sn(e,o,t[o])}function ln(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 un=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`]]),dn=/^[\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 fn(e){return dn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function pn(){}var mn=null;function hn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var gn=null,_n=null;function vn(e){var t=Dt(e);if(t&&(e=t.stateNode)){var n=e[_t]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Qt(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="`+Zt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[_t]||null;if(!a)throw Error(i(90));Qt(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&&Yt(r)}break a;case`textarea`:nn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&tn(e,!!n.multiple,t,!1)}}}var yn=!1;function bn(e,t,n){if(yn)return e(t,n);yn=!0;try{return e(t)}finally{if(yn=!1,(gn!==null||_n!==null)&&(Rd(),gn&&(t=gn,e=_n,_n=gn=null,vn(t),e)))for(t=0;t<e.length;t++)vn(e[t])}}function xn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[_t]||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 Sn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Cn=!1;if(Sn)try{var wn={};Object.defineProperty(wn,"passive",{get:function(){Cn=!0}}),window.addEventListener(`test`,wn,wn),window.removeEventListener(`test`,wn,wn)}catch{Cn=!1}var Tn=null,En=null,Dn=null;function On(){if(Dn)return Dn;var e,t=En,n=t.length,r,i=`value`in Tn?Tn.value:Tn.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 Dn=i.slice(e,1<r?1-r:void 0)}function kn(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 An(){return!0}function jn(){return!1}function Mn(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)?An:jn,this.isPropagationStopped=jn,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=An)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=An)},persist:function(){},isPersistent:An}),t}var Nn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Pn=Mn(Nn),Fn=D({},Nn,{view:0,detail:0}),In=Mn(Fn),Ln,Rn,zn,Bn=D({},Fn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Zn,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!==zn&&(zn&&e.type===`mousemove`?(Ln=e.screenX-zn.screenX,Rn=e.screenY-zn.screenY):Rn=Ln=0,zn=e),Ln)},movementY:function(e){return`movementY`in e?e.movementY:Rn}}),Vn=Mn(Bn),Hn=Mn(D({},Bn,{dataTransfer:0})),Un=Mn(D({},Fn,{relatedTarget:0})),Wn=Mn(D({},Nn,{animationName:0,elapsedTime:0,pseudoElement:0})),Gn=Mn(D({},Nn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Kn=Mn(D({},Nn,{data:0})),qn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Jn={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`},Yn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Xn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Yn[e])?!!t[e]:!1}function Zn(){return Xn}var Qn=Mn(D({},Fn,{key:function(e){if(e.key){var t=qn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=kn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Jn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Zn,charCode:function(e){return e.type===`keypress`?kn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?kn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),$n=Mn(D({},Bn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),er=Mn(D({},Nn,{submitter:0})),tr=Mn(D({},Fn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Zn})),nr=Mn(D({},Nn,{propertyName:0,elapsedTime:0,pseudoElement:0})),rr=Mn(D({},Bn,{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})),ir=Mn(D({},Nn,{newState:0,oldState:0,source:0})),ar=[9,13,27,32],or=Sn&&`CompositionEvent`in window,sr=null;Sn&&`documentMode`in document&&(sr=document.documentMode);var cr=Sn&&`TextEvent`in window&&!sr,lr=Sn&&(!or||sr&&8<sr&&11>=sr),ur=` `,dr=!1;function fr(e,t){switch(e){case`keyup`:return ar.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function pr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var mr=!1;function hr(e,t){switch(e){case`compositionend`:return pr(t);case`keypress`:return t.which===32?(dr=!0,ur):null;case`textInput`:return e=t.data,e===ur&&dr?null:e;default:return null}}function gr(e,t){if(mr)return e===`compositionend`||!or&&fr(e,t)?(e=On(),Dn=En=Tn=null,mr=!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 lr&&t.locale!==`ko`?null:t.data;default:return null}}var _r={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 vr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!_r[e.type]:t===`textarea`}function yr(e,t,n,r){gn?_n?_n.push(r):_n=[r]:gn=r,t=Yf(t,`onChange`),0<t.length&&(n=new Pn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var br=null,xr=null;function Sr(e){Vf(e,0)}function Cr(e){if(Yt(Ot(e)))return e}function wr(e,t){if(e===`change`)return t}var Tr=!1;if(Sn){var Er;if(Sn){var Dr=`oninput`in document;if(!Dr){var Or=document.createElement(`div`);Or.setAttribute(`oninput`,`return;`),Dr=typeof Or.oninput==`function`}Er=Dr}else Er=!1;Tr=Er&&(!document.documentMode||9<document.documentMode)}function kr(){br&&(br.detachEvent(`onpropertychange`,Ar),xr=br=null)}function Ar(e){if(e.propertyName===`value`&&Cr(xr)){var t=[];yr(t,xr,e,hn(e)),bn(Sr,t)}}function jr(e,t,n){e===`focusin`?(kr(),br=t,xr=n,br.attachEvent(`onpropertychange`,Ar)):e===`focusout`&&kr()}function Mr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Cr(xr)}function Nr(e,t){if(e===`click`)return Cr(t)}function Pr(e,t){if(e===`input`||e===`change`)return Cr(t)}function Fr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Ir=typeof Object.is==`function`?Object.is:Fr;function Lr(e,t){if(Ir(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(!Ae.call(t,i)||!Ir(e[i],t[i]))return!1}return!0}function Rr(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 zr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Br(e,t){var n=zr(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=zr(n)}}function Vr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Vr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Hr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Rr(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=Rr(e.document)}return t}function Ur(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 Wr=Sn&&`documentMode`in document&&11>=document.documentMode,Gr=null,Kr=null,qr=null,Jr=!1;function Yr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Jr||Gr==null||Gr!==Rr(r)||(r=Gr,`selectionStart`in r&&Ur(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&&Lr(qr,r)||(qr=r,r=Yf(Kr,`onSelect`),0<r.length&&(t=new Pn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Gr)))}function Xr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Zr={animationend:Xr(`Animation`,`AnimationEnd`),animationiteration:Xr(`Animation`,`AnimationIteration`),animationstart:Xr(`Animation`,`AnimationStart`),transitionrun:Xr(`Transition`,`TransitionRun`),transitionstart:Xr(`Transition`,`TransitionStart`),transitioncancel:Xr(`Transition`,`TransitionCancel`),transitionend:Xr(`Transition`,`TransitionEnd`)},Qr={},$r={};Sn&&($r=document.createElement(`div`).style,`AnimationEvent`in window||(delete Zr.animationend.animation,delete Zr.animationiteration.animation,delete Zr.animationstart.animation),`TransitionEvent`in window||delete Zr.transitionend.transition);function ei(e){if(Qr[e])return Qr[e];if(!Zr[e])return e;var t=Zr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in $r)return Qr[e]=t[n];return e}var ti=ei(`animationend`),ni=ei(`animationiteration`),ri=ei(`animationstart`),ii=ei(`transitionrun`),ai=ei(`transitionstart`),oi=ei(`transitioncancel`),si=ei(`transitionend`),ci=new Map,li=`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(` `);li.push(`scrollEnd`);function ui(e,t){ci.set(e,t),Pt(t,[e])}var di=0;function fi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=yd.identifierPrefix;var n=di++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function pi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Dd;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 mi(e,t){return e=pi(e),t=pi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var hi=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)},gi=[],_i=0,vi=0;function yi(){for(var e=_i,t=vi=_i=0;t<e;){var n=gi[t];gi[t++]=null;var r=gi[t];gi[t++]=null;var i=gi[t];gi[t++]=null;var a=gi[t];if(gi[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&&Ci(n,i,a)}}function bi(e,t,n,r){gi[_i++]=e,gi[_i++]=t,gi[_i++]=n,gi[_i++]=r,vi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function xi(e,t,n,r){return bi(e,t,n,r),wi(e)}function Si(e,t){return bi(e,null,null,t),wi(e)}function Ci(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-Ke(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function wi(e){if(50<Od)throw Od=0,kd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ti={};function Ei(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 Di(e,t,n,r){return new Ei(e,t,n,r)}function Oi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ki(e,t){var n=e.alternate;return n===null?(n=Di(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 Ai(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 ji(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Oi(r)&&(s=1);else if(typeof r==`string`)s=Ym(e,n,ge.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case te:return e=Di(31,n,t,a),e.elementType=te,e.lanes=o,e;case j:return Mi(n.children,a,o,t);case M:s=8,a|=24;break;case N:return e=Di(12,n,t,a|2),e.elementType=N,e.lanes=o,e;case L:return e=Di(13,n,t,a),e.elementType=L,e.lanes=o,e;case R:return e=Di(19,n,t,a),e.elementType=R,e.lanes=o,e;case ne:case ie:return e=a|32,e=Di(30,n,t,e),e.elementType=ie,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case F:s=10;break a;case P:s=9;break a;case I:s=11;break a;case z:s=14;break a;case ee:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Di(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Mi(e,t,n,r){return e=Di(7,e,r,t),e.lanes=n,e}function Ni(e,t,n){return e=Di(6,e,null,t),e.lanes=n,e}function Pi(e){var t=Di(18,null,null,0);return t.stateNode=e,t}function Fi(e,t,n){return t=Di(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ii=new WeakMap;function Li(e,t){if(typeof e==`object`&&e){var n=Ii.get(e);return n===void 0?(t={value:e,source:t,stack:ke(t)},Ii.set(e,t),t):n}return{value:e,source:t,stack:ke(t)}}var Ri=[],zi=0,Bi=null,Vi=0,Hi=[],Ui=0,Wi=null,Gi=1,Ki=``;function qi(e,t){Ri[zi++]=Vi,Ri[zi++]=Bi,Bi=e,Vi=t}function Ji(e,t,n){Hi[Ui++]=Gi,Hi[Ui++]=Ki,Hi[Ui++]=Wi,Wi=e;var r=Gi;e=Ki;var i=32-Ke(r)-1;r&=~(1<<i),n+=1;var a=32-Ke(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Gi=1<<32-Ke(t)+i|n<<i|r,Ki=a+e}else Gi=1<<a|n<<i|r,Ki=e}function Yi(e){e.return!==null&&(qi(e,1),Ji(e,1,0))}function Xi(e){for(;e===Bi;)Bi=Ri[--zi],Ri[zi]=null,Vi=Ri[--zi],Ri[zi]=null;for(;e===Wi;)Wi=Hi[--Ui],Hi[Ui]=null,Ki=Hi[--Ui],Hi[Ui]=null,Gi=Hi[--Ui],Hi[Ui]=null}function Zi(e,t){Hi[Ui++]=Gi,Hi[Ui++]=Ki,Hi[Ui++]=Wi,Gi=t.id,Ki=t.overflow,Wi=e}var Qi=null,$i=null,ea=!1,ta=null,na=!1,ra=Error(i(519));function ia(e){throw ua(Li(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ra}function aa(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[gt]=e,t[_t]=r,n){case`dialog`:Hf(`cancel`,t),Hf(`close`,t);break;case`iframe`:case`object`:case`embed`:Hf(`load`,t);break;case`video`:case`audio`:for(n=0;n<zf.length;n++)Hf(zf[n],t);break;case`source`:Hf(`error`,t);break;case`img`:case`image`:case`link`:Hf(`error`,t),Hf(`load`,t);break;case`details`:Hf(`toggle`,t);break;case`input`:Hf(`invalid`,t),$t(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Hf(`invalid`,t);break;case`textarea`:Hf(`invalid`,t),rn(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||tp(t.textContent,n)?(r.popover!=null&&(Hf(`beforetoggle`,t),Hf(`toggle`,t)),r.onScroll!=null&&Hf(`scroll`,t),r.onScrollEnd!=null&&Hf(`scrollend`,t),r.onClick!=null&&(t.onclick=pn),t=!0):t=!1,t||ia(e,!0)}function oa(e){for(Qi=e.return;Qi;)switch(Qi.tag){case 5:case 31:case 13:na=!1;return;case 27:case 3:na=!0;return;default:Qi=Qi.return}}function sa(e){if(e!==Qi)return!1;if(!ea)return oa(e),ea=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||hp(e.type,e.memoizedProps)),n=!n),n&&$i&&ia(e),oa(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));$i=pm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));$i=pm(e)}else t===27?(t=$i,wp(e.type)?(e=fm,fm=null,$i=e):$i=t):$i=Qi?dm(e.stateNode.nextSibling):null;return!0}function ca(){$i=Qi=null,ea=!1}function la(){var e=ta;return e!==null&&(dd===null?dd=e:dd.push.apply(dd,e),ta=null),e}function ua(e){ta===null?ta=[e]:ta.push(e)}var da=pe(null),fa=null,pa=null;function ma(e,t,n){he(da,t._currentValue),t._currentValue=n}function ha(e){e._currentValue=da.current,me(da)}function ga(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function _a(e,t,n,r){var 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),ga(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),ga(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),ga(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 va(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;Ir(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===ye.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[lh]:e.push(lh))}a=a.return}return e!==null&&_a(t,e,n,r),t.flags|=262144,e!==null}function ya(e){for(e=e.firstContext;e!==null;){if(!Ir(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ba(e){fa=e,pa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function xa(e){return Ca(fa,e)}function Sa(e,t){return fa===null&&ba(e),Ca(e,t)}function Ca(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},pa===null){if(e===null)throw Error(i(308));pa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else pa=pa.next=t;return n}var wa=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Ta=t.unstable_scheduleCallback,Ea=t.unstable_NormalPriority,Da={$$typeof:F,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Oa(){return{controller:new wa,data:new Map,refCount:0}}function ka(e){e.refCount--,e.refCount===0&&Ta(Ea,function(){e.controller.abort()})}function Aa(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var ja=null;function Ma(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Na=null,Pa=0,Fa=0,G=null;function Ia(e,t){if(Na===null){var n=Na=[];Pa=0,Fa=Pf(),G={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Pa++,t.then(La,La),t}function La(){if(--Pa===0&&(ja=null,Na!==null)){G!==null&&(G.status=`fulfilled`);var e=Na;Na=null,Fa=0,G=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ra(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 za=H.S;H.S=function(e,t){if(md=Fe(),typeof t==`object`&&t&&typeof t.then==`function`&&Ia(e,t),ja!==null)for(var n=bf;n!==null;)Aa(n,ja),n=n.next;if(n=e.types,n!==null){for(var r=bf;r!==null;)Aa(r,n),r=r.next;if(Fa!==0){r=ja,r===null&&(r=ja=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}za!==null&&za(e,t)};var Ba=pe(null);function Va(){var e=Ba.current;return e===null?Xu.pooledCache:e}function Ha(e,t){t===null?he(Ba,Ba.current):he(Ba,t.pool)}function Ua(){var e=Va();return e===null?null:{parent:Da._currentValue,pool:e}}var Wa=Error(i(460)),Ga=Error(i(474)),Ka=Error(i(542)),qa={then:function(){}};function Ja(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ya(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(pn,pn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,$a(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(pn,pn);else{if(e=Xu,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,$a(e),e}throw Za=t,Wa}}function Xa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Za=e,Wa):e}}var Za=null;function Qa(){if(Za===null)throw Error(i(459));var e=Za;return Za=null,e}function $a(e){if(e===Wa||e===Ka)throw Error(i(483))}var eo=null,to=0;function no(e){var t=to;return to+=1,eo===null&&(eo=[]),Ya(eo,e,t)}function ro(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function io(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 ao(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=ki(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=Ni(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),ro(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===ee&&Xa(i)===t.type)?(t=a(t,n.props),ro(t,n),t.return=e,t):(t=ji(n.type,n.key,n.props,null,e.mode,r),ro(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=Fi(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=Mi(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=Ni(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case k:return n=ji(t.type,t.key,t.props,null,e.mode,n),ro(n,t),n.return=e,n;case A:return t=Fi(t,e.mode,n),t.return=e,t;case ee:return t=Xa(t),f(e,t,n)}if(ce(t)||V(t))return t=Mi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,no(t),n);if(t.$$typeof===F)return f(e,Sa(e,t),n);io(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 ee:return n=Xa(n),p(e,t,n,r)}if(ce(n)||V(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,no(n),r);if(n.$$typeof===F)return p(e,t,Sa(e,n),r);io(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 ee:return r=Xa(r),m(e,t,n,r,i)}if(ce(r)||V(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,no(r),i);if(r.$$typeof===F)return m(e,t,n,Sa(t,r),i);io(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),ea&&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 ea&&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)}),ea&&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),ea&&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 ea&&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)}),ea&&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),ro(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===ee&&Xa(l)===r.type){n(e,r.sibling),c=a(r,o.props),ro(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===j?(c=Mi(o.props.children,e.mode,c,o.key),ro(c,o),c.return=e,e=c):(c=ji(o.type,o.key,o.props,null,e.mode,c),ro(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=Fi(o,e.mode,c),c.return=e,e=c}return s(e);case ee:return o=Xa(o),_(e,r,o,c)}if(ce(o))return h(e,r,o,c);if(V(o)){if(l=V(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,no(o),c);if(o.$$typeof===F)return _(e,r,Sa(e,o),c);io(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=Ni(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{to=0;var i=_(e,t,n,r);return eo=null,i}catch(t){if(t===Wa||t===Ka)throw t;var a=Di(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var oo=ao(!0),K=ao(!1),so=!1;function co(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function lo(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 uo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function fo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Yu&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=wi(e),Ci(e,null,n),t}return bi(e,r,t,n),wi(e)}function po(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,lt(e,n)}}function mo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var ho=!1;function go(){if(ho){var e=G;if(e!==null)throw e}}function _o(e,t,n,r){ho=!1;var i=e.updateQueue;so=!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?(Zu&f)===f:(r&f)===f){f!==0&&f===Fa&&(ho=!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:so=!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),ad|=o,e.lanes=o,e.memoizedState=d}}function vo(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function yo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)vo(n[e],t)}var bo=pe(null),xo=pe(0);function So(e,t){e=rd,he(xo,e),he(bo,t),rd=e|t.baseLanes}function Co(){he(xo,rd),he(bo,bo.current)}function wo(){rd=xo.current,me(bo),me(xo)}var To=pe(null),Eo=null;function Do(e){var t=e.alternate;he(Mo,Mo.current&1),he(To,e),Eo===null&&(t===null||bo.current!==null||t.memoizedState!==null)&&(Eo=e)}function Oo(e){he(Mo,Mo.current),he(To,e),Eo===null&&(Eo=e)}function ko(e){e.tag===22?(he(Mo,Mo.current),he(To,e),Eo===null&&(Eo=e)):Ao()}function Ao(){he(Mo,Mo.current),he(To,To.current)}function jo(e){me(To),Eo===e&&(Eo=null),me(Mo)}var Mo=pe(0);function No(e,t){he(To,To.current),he(Mo,t)}function Po(e){me(Mo),me(To),Eo===e&&(Eo=null)}function Fo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||cm(n)||lm(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 Io=0,q=null,J=null,Lo=null,Ro=!1,zo=!1,Bo=!1,Vo=0,Ho=0,Uo=null,Wo=0;function Go(){throw Error(i(321))}function Ko(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ir(e[n],t[n]))return!1;return!0}function qo(e,t,n,r,i,a){return Io=a,q=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,H.H=e===null||e.memoizedState===null?lc:uc,Bo=!1,a=n(r,i),Bo=!1,zo&&(a=Yo(t,n,r,i)),Jo(e),a}function Jo(e){H.H=cc;var t=J!==null&&J.next!==null;if(Io=0,Lo=J=q=null,Ro=!1,Ho=0,Uo=null,t)throw Error(i(300));e===null||Dc||(e=e.dependencies,e!==null&&ya(e)&&(Dc=!0))}function Yo(e,t,n,r){q=e;var a=0;do{if(zo&&(Uo=null),Ho=0,zo=!1,25<=a)throw Error(i(301));if(a+=1,Lo=J=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}H.H=dc,o=t(n,r)}while(zo);return o}function Xo(){var e=H.H,t=e.useState()[0];return t=typeof t.then==`function`?rs(t):t,e=e.useState()[0],(J===null?null:J.memoizedState)!==e&&(q.flags|=1024),t}function Zo(){var e=Vo!==0;return Vo=0,e}function Qo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function $o(e){if(Ro){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ro=!1}Io=0,Lo=J=q=null,zo=!1,Ho=Vo=0,Uo=null}function es(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Lo===null?q.memoizedState=Lo=e:Lo=Lo.next=e,Lo}function ts(){if(J===null){var e=q.alternate;e=e===null?null:e.memoizedState}else e=J.next;var t=Lo===null?q.memoizedState:Lo.next;if(t!==null)Lo=t,J=e;else{if(e===null)throw q.alternate===null?Error(i(467)):Error(i(310));J=e,e={memoizedState:J.memoizedState,baseState:J.baseState,baseQueue:J.baseQueue,queue:J.queue,next:null},Lo===null?q.memoizedState=Lo=e:Lo=Lo.next=e}return Lo}function ns(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function rs(e){var t=Ho;return Ho+=1,Uo===null&&(Uo=[]),e=Ya(Uo,e,t),t=q,(Lo===null?t.memoizedState:Lo.next)===null&&(t=t.alternate,H.H=t===null||t.memoizedState===null?lc:uc),e}function is(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return rs(e);if(e.$$typeof===ae)return;if(e.$$typeof===F)return xa(e)}throw Error(i(438,String(e)))}function as(e){var t=null,n=q.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=q.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=ns(),q.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]=re;return t.index++,n}function os(e,t){return typeof t==`function`?t(e):t}function ss(e){return cs(ts(),J,e)}function cs(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?(Io&f)===f:(Zu&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Fa&&(d=!0);else if((Io&p)===p){u=u.next,p===Fa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,q.lanes|=p,ad|=p;f=u.action,Bo&&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,q.lanes|=f,ad|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Ir(o,e.memoizedState)&&(Dc=!0,d&&(n=G,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 ls(e){var t=ts(),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);Ir(o,t.memoizedState)||(Dc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function us(e,t,n){var r=q,a=ts(),o=ea;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Ir((J||a).memoizedState,n);if(s&&(a.memoizedState=n,Dc=!0),a=a.queue,Ps(fs.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Lo!==null&&!!(Lo.memoizedState.tag&1),ks(e?9:8,{destroy:void 0},Y.bind(null,r,a,n,t),null),e){if(r.flags|=2048,Xu===null)throw Error(i(349));o||Io&127||ds(r,t,n)}return n}function ds(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=q.updateQueue,t===null?(t=ns(),q.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Y(e,t,n,r){t.value=n,t.getSnapshot=r,ps(t)&&ms(e)}function fs(e,t,n){return n(function(){ps(t)&&ms(e)})}function ps(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ir(e,n)}catch{return!0}}function ms(e){var t=Si(e,2);t!==null&&Nd(t,e,2)}function hs(e){var t=es();if(typeof e==`function`){var n=e;if(e=n(),Bo){Ge(!0);try{n()}finally{Ge(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:os,lastRenderedState:e},t}function gs(e,t,n,r){return e.baseState=n,cs(e,J,typeof r==`function`?r:os)}function _s(e,t,n,r,a){if(ac(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)}};H.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,vs(t,o)):(o.next=n.next,t.pending=n.next=o)}}function vs(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=H.T,o={};o.types=a===null?null:a.types,H.T=o;try{var s=n(i,r),c=H.S;c!==null&&c(o,s),ys(e,t,s)}catch(n){xs(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),H.T=a}}else try{a=n(i,r),ys(e,t,a)}catch(n){xs(e,t,n)}}function ys(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){bs(e,t,n)},function(n){return xs(e,t,n)}):bs(e,t,n)}function bs(e,t,n){t.status=`fulfilled`,t.value=n,Ss(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,vs(e,n)))}function xs(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Ss(t),t=t.next;while(t!==r)}e.action=null}function Ss(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Cs(e,t){return t}function ws(e,t){if(ea){var n=Xu.formState;if(n!==null){a:{var r=q;if(ea){if($i){b:{for(var i=$i,a=na;i.nodeType!==8;)if(!a||(i=dm(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){$i=dm(i.nextSibling),r=i.data===`F!`;break a}}ia(r)}r=!1}r&&(t=n[0])}}return n=es(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Cs,lastRenderedState:t},n.queue=r,n=nc.bind(null,q,r),r.dispatch=n,r=hs(!1),a=ic.bind(null,q,!1,r.queue),r=es(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=_s.bind(null,q,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ts(e){return Es(ts(),J,e)}function Es(e,t,n){if(t=cs(e,t,Cs)[0],e=ss(os)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=rs(t)}catch(e){throw e===Wa?Ka:e}else r=t;t=ts();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(q.flags|=2048,ks(9,{destroy:void 0},Ds.bind(null,i,n),null)),[r,a,e]}function Ds(e,t){e.action=t}function Os(e){var t=ts(),n=J;if(n!==null)return Es(t,n,e);ts(),t=t.memoizedState,n=ts();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ks(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=q.updateQueue,t===null&&(t=ns(),q.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 As(){return ts().memoizedState}function js(e,t,n,r){var i=es();q.flags|=e,i.memoizedState=ks(1|t,{destroy:void 0},n,r===void 0?null:r)}function Ms(e,t,n,r){var i=ts();r=r===void 0?null:r;var a=i.memoizedState.inst;J!==null&&r!==null&&Ko(r,J.memoizedState.deps)?i.memoizedState=ks(t,a,n,r):(q.flags|=e,i.memoizedState=ks(1|t,a,n,r))}function Ns(e,t){js(8390656,8,e,t)}function Ps(e,t){Ms(2048,8,e,t)}function Fs(e){q.flags|=4;var t=q.updateQueue;if(t===null)t=ns(),q.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Is(e){var t=ts().memoizedState;return Fs({ref:t,nextImpl:e}),function(){if(Yu&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Ls(e,t){return Ms(4,2,e,t)}function Rs(e,t){return Ms(4,4,e,t)}function zs(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 Bs(e,t,n){n=n==null?null:n.concat([e]),Ms(4,4,zs.bind(null,t,e),n)}function Vs(){}function Hs(e,t){var n=ts();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Ko(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Us(e,t){var n=ts();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Ko(t,r[1]))return r[0];if(r=e(),Bo){Ge(!0);try{e()}finally{Ge(!1)}}return n.memoizedState=[r,t],r}function Ws(e,t,n){return n===void 0||Io&1073741824&&!(Zu&261930)?e.memoizedState=t:(e.memoizedState=n,e=jd(),q.lanes|=e,ad|=e,n)}function Gs(e,t,n,r){return Ir(n,t)?n:bo.current===null?!(Io&106)||Io&1073741824&&!(Zu&261930)?(Dc=!0,e.memoizedState=n):(e=jd(),q.lanes|=e,ad|=e,t):(e=Ws(e,n,r),Ir(e,t)||(Dc=!0),e)}function Ks(e,t,n,r,i){var a=le.p;le.p=a!==0&&8>a?a:8;var o=H.T,s={};s.types=o===null?null:o.types,H.T=s,ic(e,!1,t,n);try{var c=i(),l=H.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?rc(e,t,Ra(c,r),Ad(e)):rc(e,t,r,Ad(e))}catch(n){rc(e,t,{then:function(){},status:`rejected`,reason:n},Ad())}finally{le.p=a,o!==null&&s.types!==null&&(o.types=s.types),H.T=o}}function qs(){}function Js(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Ys(e).queue;Ks(e,a,t,ue,n===null?qs:function(){return Xs(e),n(r)})}function Ys(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ue,baseState:ue,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:os,lastRenderedState:ue},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:os,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Xs(e){var t=Ys(e);t.next===null&&(t=e.alternate.memoizedState),rc(e,t.next.queue,{},Ad())}function Zs(){return xa(lh)}function Qs(){return ts().memoizedState}function $s(){return ts().memoizedState}function ec(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Ad();e=uo(n);var r=fo(t,e,n);r!==null&&(Nd(r,t,n),po(r,t,n)),t={cache:Oa()},e.payload=t;return}t=t.return}}function tc(e,t,n){var r=Ad();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},ac(e)?oc(t,n):(n=xi(e,t,n,r),n!==null&&(Nd(n,e,r),sc(n,t,r)))}function nc(e,t,n){rc(e,t,n,Ad())}function rc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(ac(e))oc(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,Ir(s,o))return bi(e,t,i,0),Xu===null&&yi(),!1}catch{}if(n=xi(e,t,i,r),n!==null)return Nd(n,e,r),sc(n,t,r),!0}return!1}function ic(e,t,n,r){if(r={lane:2,revertLane:Pf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},ac(e)){if(t)throw Error(i(479))}else t=xi(e,n,r,2),t!==null&&Nd(t,e,2)}function ac(e){var t=e.alternate;return e===q||t!==null&&t===q}function oc(e,t){zo=Ro=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function sc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,lt(e,n)}}var cc={readContext:xa,use:is,useCallback:Go,useContext:Go,useEffect:Go,useImperativeHandle:Go,useLayoutEffect:Go,useInsertionEffect:Go,useMemo:Go,useReducer:Go,useRef:Go,useState:Go,useDebugValue:Go,useDeferredValue:Go,useTransition:Go,useSyncExternalStore:Go,useId:Go,useHostTransitionStatus:Go,useFormState:Go,useActionState:Go,useOptimistic:Go,useMemoCache:Go,useCacheRefresh:Go,useEffectEvent:Go},lc={readContext:xa,use:is,useCallback:function(e,t){return es().memoizedState=[e,t===void 0?null:t],e},useContext:xa,useEffect:Ns,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),js(4194308,4,zs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return js(4194308,4,e,t)},useInsertionEffect:function(e,t){js(4,2,e,t)},useMemo:function(e,t){var n=es();t=t===void 0?null:t;var r=e();if(Bo){Ge(!0);try{e()}finally{Ge(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=es();if(n!==void 0){var i=n(t);if(Bo){Ge(!0);try{n(t)}finally{Ge(!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=tc.bind(null,q,e),[r.memoizedState,e]},useRef:function(e){var t=es();return e={current:e},t.memoizedState=e},useState:function(e){e=hs(e);var t=e.queue,n=nc.bind(null,q,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Vs,useDeferredValue:function(e,t){return Ws(es(),e,t)},useTransition:function(){var e=hs(!1);return e=Ks.bind(null,q,e.queue,!0,!1),es().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=q,a=es();if(ea){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Xu===null)throw Error(i(349));Zu&127||ds(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Ns(fs.bind(null,r,o,e),[e]),r.flags|=2048,ks(9,{destroy:void 0},Y.bind(null,r,o,n,t),null),n},useId:function(){var e=es(),t=Xu.identifierPrefix;if(ea){var n=Ki,r=Gi;n=(r&~(1<<32-Ke(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Vo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Wo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Zs,useFormState:ws,useActionState:ws,useOptimistic:function(e){var t=es();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=ic.bind(null,q,!0,n),n.dispatch=t,[e,t]},useMemoCache:as,useCacheRefresh:function(){return es().memoizedState=ec.bind(null,q)},useEffectEvent:function(e){var t=es(),n={impl:e};return t.memoizedState=n,function(){if(Yu&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},uc={readContext:xa,use:is,useCallback:Hs,useContext:xa,useEffect:Ps,useImperativeHandle:Bs,useInsertionEffect:Ls,useLayoutEffect:Rs,useMemo:Us,useReducer:ss,useRef:As,useState:function(){return ss(os)},useDebugValue:Vs,useDeferredValue:function(e,t){return Gs(ts(),J.memoizedState,e,t)},useTransition:function(){var e=ss(os)[0],t=ts().memoizedState;return[typeof e==`boolean`?e:rs(e),t]},useSyncExternalStore:us,useId:Qs,useHostTransitionStatus:Zs,useFormState:Ts,useActionState:Ts,useOptimistic:function(e,t){return gs(ts(),J,e,t)},useMemoCache:as,useCacheRefresh:$s,useEffectEvent:Is},dc={readContext:xa,use:is,useCallback:Hs,useContext:xa,useEffect:Ps,useImperativeHandle:Bs,useInsertionEffect:Ls,useLayoutEffect:Rs,useMemo:Us,useReducer:ls,useRef:As,useState:function(){return ls(os)},useDebugValue:Vs,useDeferredValue:function(e,t){var n=ts();return J===null?Ws(n,e,t):Gs(n,J.memoizedState,e,t)},useTransition:function(){var e=ls(os)[0],t=ts().memoizedState;return[typeof e==`boolean`?e:rs(e),t]},useSyncExternalStore:us,useId:Qs,useHostTransitionStatus:Zs,useFormState:Os,useActionState:Os,useOptimistic:function(e,t){var n=ts();return J===null?(n.baseState=e,[e,n.queue.dispatch]):gs(n,J,e,t)},useMemoCache:as,useCacheRefresh:$s,useEffectEvent:Is};function fc(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 pc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ad(),i=uo(r);i.payload=t,n!=null&&(i.callback=n),t=fo(e,i,r),t!==null&&(Nd(t,e,r),po(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ad(),i=uo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=fo(e,i,r),t!==null&&(Nd(t,e,r),po(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ad(),r=uo(n);r.tag=2,t!=null&&(r.callback=t),t=fo(e,r,n),t!==null&&(Nd(t,e,n),po(t,e,n))}};function mc(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?!Lr(n,r)||!Lr(i,a):!0}function hc(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&&pc.enqueueReplaceState(t,t.state,null)}function gc(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 _c(e){hi(e)}function vc(e){console.error(e)}function yc(e){hi(e)}function bc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function xc(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 Sc(e,t,n){return n=uo(n),n.tag=3,n.payload={element:null},n.callback=function(){bc(e,t)},n}function Cc(e){return e=uo(e),e.tag=3,e}function wc(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(){xc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){xc(t,n,r),typeof i!=`function`&&(_d===null?_d=new Set([this]):_d.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Tc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&va(t,n,a,!0),n=To.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Eo===null?Gd():n.alternate===null&&id===0&&(id=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),mf(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)),mf(e,r,a)),!1}throw Error(i(435,n.tag))}return mf(e,r,a),Gd(),!1}if(ea)return t=To.current,t===null?(r!==ra&&(t=Error(i(423),{cause:r}),ua(Li(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Li(r,n),a=Sc(e.stateNode,r,a),mo(e,a),id!==4&&(id=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ra&&(e=Error(i(422),{cause:r}),ua(Li(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Li(o,n),ud===null?ud=[o]:ud.push(o),id!==4&&(id=2),t===null)return!0;r=Li(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Sc(n.stateNode,r,e),mo(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`&&(_d===null||!_d.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Cc(a),wc(a,e,n,r),mo(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Ec=Error(i(461)),Dc=!1;function Oc(e,t,n,r){t.child=e===null?K(t,null,n,r):oo(t,e.child,n,r)}function kc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return ba(t),r=qo(e,t,n,o,a,i),s=Zo(),e!==null&&!Dc?(Qo(e,t,i),rl(e,t,i)):(ea&&s&&Yi(t),t.flags|=1,Oc(e,t,r,i),t.child)}function Ac(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Oi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,jc(e,t,a,r,i)):(e=ji(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!il(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Lr:n,n(o,r)&&e.ref===t.ref)return rl(e,t,i)}return t.flags|=1,e=ki(a,r),e.ref=t.ref,e.return=t,t.child=e}function jc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Lr(a,r)&&e.ref===t.ref){if(Dc=!1,t.pendingProps=r=a,il(e,i))e.flags&131072&&(Dc=!0);else return t.lanes=e.lanes,rl(e,t,i)}}return zc(e,t,n,r,i)}function Mc(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 Pc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ha(t,a===null?null:a.cachePool),a===null?Co():So(t,a),ko(t);else return r=t.lanes=536870912,Pc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ha(t,null),Co(),Ao()):(Ha(t,a.cachePool),So(t,a),Ao(),t.memoizedState=null);return Oc(e,t,i,n),t.child}function Nc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Pc(e,t,n,r,i){var a=Va();return a=a===null?null:{parent:Da._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ha(t,null),Co(),ko(t),e!==null&&va(e,t,r,!0),t.childLanes=i,null}function Fc(e,t){return t=Jc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Ic(e,t,n){return oo(t,e.child,null,n),e=Fc(t,t.pendingProps),e.flags|=2,jo(t),t.memoizedState=null,e}function Lc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(ea){if(r.mode===`hidden`)return e=Fc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Nc(null,e);if(Oo(t),(e=$i)?(e=sm(e,na),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Wi===null?null:{id:Gi,overflow:Ki},retryLane:536870912,hydrationErrors:null},n=Pi(e),n.return=t,t.child=n,Qi=t,$i=null)):e=null,e===null)throw ia(t);return t.lanes=536870912,null}return Fc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Oo(t),a){if(t.flags&256)t.flags&=-257,t=Ic(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Dc||va(e,t,n,!1),a=(n&e.childLanes)!==0,Dc||a){if(bo.current===null){if(r=Xu,r!==null&&(s=ut(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Si(e,s),Nd(r,e,s),Ec;Gd()}t=Ic(e,t,n)}else e=o.treeContext,$i=dm(s.nextSibling),Qi=t,ea=!0,ta=null,na=!1,e!==null&&Zi(t,e),t=Fc(t,r),t.flags|=134221824;return t}return e=ki(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Rc(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 zc(e,t,n,r,i){return ba(t),n=qo(e,t,n,r,void 0,i),r=Zo(),e!==null&&!Dc?(Qo(e,t,i),rl(e,t,i)):(ea&&r&&Yi(t),t.flags|=1,Oc(e,t,n,i),t.child)}function Bc(e,t,n,r,i,a){return ba(t),t.updateQueue=null,n=Yo(t,r,n,i),Jo(e),r=Zo(),e!==null&&!Dc?(Qo(e,t,a),rl(e,t,a)):(ea&&r&&Yi(t),t.flags|=1,Oc(e,t,n,a),t.child)}function Vc(e,t,n,r,i){if(ba(t),t.stateNode===null){var a=Ti,o=n.contextType;typeof o==`object`&&o&&(a=xa(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=pc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},co(t),o=n.contextType,a.context=typeof o==`object`&&o?xa(o):Ti,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(fc(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&&pc.enqueueReplaceState(a,a.state,null),_o(t,r,a,i),go(),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=gc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Ti,typeof u==`object`&&u&&(o=xa(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&hc(t,a,r,o),so=!1;var f=t.memoizedState;a.state=f,_o(t,r,a,i),go(),l=t.memoizedState,s||f!==l||so?(typeof d==`function`&&(fc(t,n,d,r),l=t.memoizedState),(c=so||mc(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,lo(e,t),o=t.memoizedProps,u=gc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Ti,typeof l==`object`&&l&&(c=xa(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&hc(t,a,r,c),so=!1,f=t.memoizedState,a.state=f,_o(t,r,a,i),go();var p=t.memoizedState;o!==d||f!==p||so||e!==null&&e.dependencies!==null&&ya(e.dependencies)?(typeof s==`function`&&(fc(t,n,s,r),p=t.memoizedState),(u=so||mc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ya(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Rc(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=oo(t,e.child,null,i),t.child=oo(t,null,n,i)):Oc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=rl(e,t,i),e}function Hc(e,t,n,r){return ca(),t.flags|=256,Oc(e,t,n,r),t.child}var Uc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Wc(e){return{baseLanes:e,cachePool:Ua()}}function Gc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=cd),e}function Kc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Mo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(ea){if(i?Do(t):Ao(),(e=$i)?(e=sm(e,na),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Wi===null?null:{id:Gi,overflow:Ki},retryLane:536870912,hydrationErrors:null},n=Pi(e),n.return=t,t.child=n,Qi=t,$i=null)):e=null,e===null)throw ia(t);return t.lanes=lm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Ao(),i=t.mode,a=Jc({mode:`hidden`,children:a},i),r=Mi(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Wc(n),r.childLanes=Gc(e,o,n),t.memoizedState=Uc,Nc(null,r)):(Do(t),qc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return Xc(e,t,a,o,r,c,s,n)}return i?(Ao(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=ki(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Mi(i,a,n,null),i.flags|=2):i=ki(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Nc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Wc(n):(a=i.cachePool,a===null?a=Ua():(s=Da._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Gc(e,o,n),t.memoizedState=Uc,Nc(e.child,r)):(Do(t),n=e.child,e=n.sibling,n=ki(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 qc(e,t){return t=Jc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Jc(e,t){return e=Di(22,e,null,t),e.lanes=0,e}function Yc(e,t,n){return oo(t,e.child,null,n),e=qc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Xc(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Do(t),t.flags&=-257,Yc(e,t,c)):t.memoizedState===null?(Ao(),o=a.fallback,s=t.mode,a=Jc({mode:`visible`,children:a.children},s),o=Mi(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,oo(t,e.child,null,c),a=t.child,a.memoizedState=Wc(c),a.childLanes=Gc(e,r,c),t.memoizedState=Uc,Nc(null,a)):(Ao(),t.child=e.child,t.flags|=128,null);if(Do(t),lm(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,ua({value:a,source:null,stack:null})),Yc(e,t,c)}if(Dc||va(e,t,c,!1),r=(c&e.childLanes)!==0,Dc||r){if(bo.current!==null)return Yc(e,t,c);if(r=Xu,r!==null&&(a=ut(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Si(e,a),Nd(r,e,a),Ec;return cm(o)||Gd(),Yc(e,t,c)}return cm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,$i=dm(o.nextSibling),Qi=t,ea=!0,ta=null,na=!1,e!==null&&Zi(t,e),t=qc(t,a.children),t.flags|=134221824,t)}function Zc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ga(e.return,t,n)}function Qc(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Fo(n)===null&&(t=e),e=e.sibling}return t}function $c(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 el(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 tl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Mo.current;if(t.flags&128)return No(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,No(t,o),i===`backwards`&&e!==null?(el(e),Oc(e,t,r,n),el(e)):Oc(e,t,r,n),r=ea?Vi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Zc(e,n,t);else if(e.tag===19)Zc(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=Qc(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,el(t)),$c(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&&Fo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}$c(t,!0,n,null,a,r);break;case`together`:$c(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=Qc(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),$c(t,!1,i,n,a,r)}return t.child}function nl(e,t,n){var r=t.pendingProps;return ma(t,t.type,r.value),Oc(e,t,r.children,n),t.child}function rl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ad|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(va(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=ki(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ki(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function il(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&ya(e)))}function al(e,t,n){switch(t.tag){case 3:be(t,t.stateNode.containerInfo),ma(t,Da,e.memoizedState.cache),ca();break;case 27:case 5:U(t);break;case 4:be(t,t.stateNode.containerInfo);break;case 10:ma(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Oo(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Do(t),t.flags|=128,null;r=va(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Kc(e,t,n):(Do(t),e=rl(e,t,n),e===null?null:e.sibling)}Do(t);break;case 19:if(t.flags&128)return tl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(va(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return tl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),No(t,Mo.current),r)break;return null;case 22:return t.lanes=0,Mc(e,t,n,t.pendingProps);case 24:ma(t,Da,e.memoizedState.cache)}return rl(e,t,n)}function ol(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Dc=!0;else{if(!il(e,n)&&!(t.flags&128))return Dc=!1,al(e,t,n);Dc=!!(e.flags&131072)}}else Dc=!1,ea&&t.flags&1048576&&Ji(t,Vi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Xa(t.elementType),t.type=e,typeof e==`function`)Oi(e)?(r=gc(e,r),t.tag=1,t=Vc(null,t,e,r,n)):(t.tag=0,t=zc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===I){t.tag=11,t=kc(null,t,e,r,n);break a}if(a===z){t.tag=14,t=Ac(null,t,e,r,n);break a}if(a===F){t.tag=10,t.type=e,t=nl(null,t,n);break a}}throw t=se(e)||e,Error(i(306,t,``))}}return t;case 0:return zc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=gc(r,t.pendingProps),Vc(e,t,r,a,n);case 3:a:{if(be(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,lo(e,t),_o(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ma(t,Da,r),r!==o.cache&&_a(t,[Da],n,!0),go(),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=Hc(e,t,r,n);break a}if(r!==a){a=Li(Error(i(424)),t),ua(a),t=Hc(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($i=dm(e.firstChild),Qi=t,ea=!0,ta=null,na=!0,n=K(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(ca(),r===a){t=rl(e,t,n);break a}Oc(e,t,r,n)}t=t.child}return t;case 26:return Rc(e,t),e===null?(n=Fm(t.type,null,t.pendingProps,null))?t.memoizedState=n:ea||(t.stateNode=mp(t.type,t.pendingProps,ve.current,t)):t.memoizedState=Fm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return U(t),e===null&&ea&&(r=t.stateNode=_m(t.type,t.pendingProps,ve.current),Qi=t,na=!0,a=$i,wp(t.type)?(fm=a,$i=dm(r.firstChild)):$i=a),Oc(e,t,t.pendingProps.children,n),Rc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ea&&((a=r=$i)&&(r=am(r,t.type,t.pendingProps,na),r===null?a=!1:(t.stateNode=r,Qi=t,$i=dm(r.firstChild),na=!1,a=!0)),a||ia(t)),U(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,hp(a,o)?r=null:s!==null&&hp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=qo(e,t,Xo,null,null,n),lh._currentValue=a),Rc(e,t),Oc(e,t,r,n),t.child;case 6:return e===null&&ea&&((e=n=$i)&&(n=om(n,t.pendingProps,na),n===null?e=!1:(t.stateNode=n,Qi=t,$i=null,e=!0)),e||ia(t)),null;case 13:return Kc(e,t,n);case 4:return be(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=oo(t,null,r,n):Oc(e,t,r,n),t.child;case 11:return kc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Rc(e,t),Oc(e,t,r,n),t.child;case 8:return Oc(e,t,t.pendingProps.children,n),t.child;case 12:return Oc(e,t,t.pendingProps.children,n),t.child;case 10:return nl(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,ba(t),a=xa(a),r=r(a),t.flags|=1,Oc(e,t,r,n),t.child;case 14:return Ac(e,t,t.type,t.pendingProps,n);case 15:return jc(e,t,t.type,t.pendingProps,n);case 19:return tl(e,t,n);case 31:return Lc(e,t,n);case 22:return Mc(e,t,n,t.pendingProps);case 24:return ba(t),r=xa(Da),e===null?(a=Va(),a===null&&(a=Xu,o=Oa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},co(t),ma(t,Da,a)):((e.lanes&n)!==0&&(lo(e,t),_o(t,null,null,n),go()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,ma(t,Da,r),r!==a.cache&&_a(t,[Da],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ma(t,Da,r))),Oc(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:ea&&Yi(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Rc(e,t),Oc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function sl(e){e.flags|=4}function cl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Xm(t,r):Xm(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(Hd())e.flags|=8192;else throw Za=qa,Ga}}else e.flags&=-16777217}function ll(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Zm(t)){if(Hd())e.flags|=8192;else throw Za=qa,Ga}}function X(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:it(),e.lanes|=t,ld|=t)}function ul(e,t){if(!ea)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 dl(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 fl(e,t,n){var r=t.pendingProps;switch(Xi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return dl(t),null;case 1:return dl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ha(Da),xe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(sa(t)?sl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,la())),dl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(sl(t),o===null?(dl(t),cl(t,a,null,r,n)):(dl(t),ll(t,o))):o?o===e.memoizedState?(dl(t),t.flags&=-16777217):(sl(t),dl(t),ll(t,o)):(e=e.memoizedProps,e!==r&&sl(t),dl(t),cl(t,a,e,r,n)),null;case 27:if(Se(t),n=ve.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&sl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return dl(t),t.subtreeFlags&=-33554433,null}e=ge.current,sa(t)?aa(t,e):(e=_m(a,r,n),t.stateNode=e,sl(t))}return dl(t),t.subtreeFlags&=-33554433,null;case 5:if(Se(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&sl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return dl(t),t.subtreeFlags&=-33554433,null}if(o=ge.current,sa(t))aa(t,o);else{var s=dp(ve.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[gt]=t,o[_t]=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(ip(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&&sl(t)}}return dl(t),t.subtreeFlags&=-33554433,cl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&sl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ve.current,sa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Qi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[gt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||tp(e.nodeValue,n)),e||ia(t,!0)}else e=dp(e).createTextNode(r),e[gt]=t,t.stateNode=e}return dl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=sa(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[gt]=t}else ca(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;dl(t),e=!1}else n=la(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(jo(t),t):(jo(t),null);if(t.flags&128)throw Error(i(558))}return dl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=sa(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[gt]=t}else ca(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;dl(t),a=!1}else a=la(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(jo(t),t):(jo(t),null)}return jo(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),X(t,t.updateQueue),dl(t),null);case 4:return xe(),e===null&&Gf(t.stateNode.containerInfo),t.flags|=67108864,dl(t),null;case 10:return ha(t.type),dl(t),null;case 19:if(Po(t),r=t.memoizedState,r===null)return dl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)ul(r,!1);else{if(id!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Fo(e),o!==null){for(t.flags|=128,ul(r,!1),e=o.updateQueue,t.updateQueue=e,X(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ai(n,e),n=n.sibling;return No(t,Mo.current&1|2),ea&&qi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Fe()>hd&&(t.flags|=128,a=!0,ul(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Fo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,X(t,e),ul(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!ea)return dl(t),null}else 2*Fe()-r.renderingStartTime>hd&&n!==536870912&&(t.flags|=128,a=!0,ul(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=Fe(),e.sibling=null,o=Mo.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||ea?No(t,o):(n=o,he(To,t),he(Mo,n),Eo===null&&(Eo=t)),ea&&qi(t,r.treeForkCount),e}return dl(t),null;case 22:case 23:return jo(t),wo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(dl(t),t.subtreeFlags&6&&(t.flags|=8192)):dl(t),n=t.updateQueue,n!==null&&X(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&&me(Ba),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ha(Da),dl(t),null;case 25:return null;case 30:return t.flags|=33554432,dl(t),null}throw Error(i(156,t.tag))}function pl(e,t){switch(Xi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ha(Da),xe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Se(t),null;case 31:if(t.memoizedState!==null){if(jo(t),t.alternate===null)throw Error(i(340));ca()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(jo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));ca()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Po(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return xe(),null;case 10:return ha(t.type),null;case 22:case 23:return jo(t),wo(),e!==null&&me(Ba),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ha(Da),null;case 25:return null;default:return null}}function ml(e,t){switch(Xi(t),t.tag){case 3:ha(Da),xe();break;case 26:case 27:case 5:Se(t);break;case 4:xe();break;case 31:t.memoizedState!==null&&jo(t);break;case 13:jo(t);break;case 19:Po(t);break;case 10:ha(t.type);break;case 22:case 23:jo(t),wo(),e!==null&&me(Ba);break;case 24:ha(Da)}}function hl(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){pf(t,t.return,e)}}function gl(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){pf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){pf(t,t.return,e)}}function _l(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{yo(t,n)}catch(t){pf(e,e.return,t)}}}function vl(e,t,n){n.props=gc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){pf(e,t,n)}}function yl(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=fi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Ip(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Lp(e);h(e.child,!1,em,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){pf(e,t,n)}}function bl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){pf(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){pf(e,t,n)}else n.current=null}}function xl(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++)nm(e.stateNode,t[n])}function Sl(e){for(var t=e.return;t!==null&&(Tl(t)&&nm(e.stateNode,t.stateNode),!wl(t));)t=t.return}function Cl(e){for(var t=e.return;t!==null&&(Tl(t)&&rm(e.stateNode,t.stateNode),!wl(t));)t=t.return}function wl(e){return e.tag===5||e.tag===3||e.tag===27}function Tl(e){return e&&e.tag===7&&e.stateNode!==null}function El(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){pf(e,e.return,t)}}function Dl(e,t,n){try{var r=e.stateNode;op(r,e.type,n,t),r[_t]=t}catch(t){pf(e,e.return,t)}}function Ol(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&wp(e.type)||e.tag===4}function kl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Ol(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&&wp(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 Al(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=pn)),xl(e,r),Bt=!0;else if(i!==4&&(i===27&&(xl(e,r),r=null,wp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Al(e,t,n,r),e=e.sibling;e!==null;)Al(e,t,n,r),e=e.sibling}function jl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),xl(e,r),Bt=!0;else if(i!==4&&(i===27&&(xl(e,r),r=null,wp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(jl(e,t,n,r),e=e.sibling;e!==null;)jl(e,t,n,r),e=e.sibling}function Ml(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);ip(t,r,n),t[gt]=e,t[_t]=n}catch(t){pf(e,e.return,t)}}var Nl=!1,Pl=null;function Fl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Nl=!0)}var Il=null;function Ll(){var e=Il;return Il=null,e}var Rl=0;function zl(e,t,n,r,i){return Rl=0,Bl(e.child,t,n,r,i)}function Bl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Ap(o);r.push(s),s.view&&(a=!0)}else a||Ap(o).view&&(a=!0);Nl=!0,Dp(o,Rl===0?t:t+`_`+Rl,n),Rl++}else e.tag===22&&e.memoizedState!==null||e.tag===30&&i||Bl(e.child,t,n,r,i)&&(a=!0);e=e.sibling}return a}function Vl(e,t){for(;e!==null;)e.tag===5?Op(e.stateNode,e.memoizedProps):e.tag===22&&e.memoizedState!==null||e.tag===30&&t||Vl(e.child,t),e=e.sibling}function Hl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Hl(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=mi(t.default,t.share),t!==`none`&&(zl(e,n,t,null,!1)||Vl(e.child,!1))}e=e.sibling}}function Ul(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=fi(r,n),a=mi(r.default,n.paired?r.share:r.enter);a===`none`?Hl(e):zl(e,i,a,null,!1)?(Hl(e),n.paired||t||Md(e,r.onEnter)):Vl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Ul(e,t),e=e.sibling;else Hl(e)}function Wl(e){if(Pl!==null&&Pl.size!==0){var t=Pl;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=mi(n.default,n.share);if(a!==`none`&&(zl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Md(e,n.onShare)):Vl(e.child,!1)),t.delete(r),t.size===0)break}}}Wl(e)}e=e.sibling}}}function Gl(e){if(e.tag===30){var t=e.memoizedProps,n=fi(t,e.stateNode),r=Pl===null?void 0:Pl.get(n),i=mi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(zl(e,n,i,null,!1)?r===void 0?Md(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Pl.delete(n),Md(e,t.onShare)):Vl(e.child,!1)),Pl!==null&&Wl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Gl(e),e=e.sibling;else Pl!==null&&Wl(e)}function Kl(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=fi(t,e.stateNode);t=mi(t.default,t.update),e.flags&=-5,t!==`none`&&zl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Kl(e);e=e.sibling}}function ql(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,Vl(e.child,!1))}ql(e)}e=e.sibling}}function Jl(e){if(e.tag===30)e.stateNode.paired=null,Vl(e.child,!1),ql(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Jl(e),e=e.sibling;else ql(e)}function Yl(e){for(e=e.child;e!==null;)e.tag===30?Vl(e.child,!1):e.subtreeFlags&33554432&&Yl(e),e=e.sibling}function Xl(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Rl<a.length){var l=a[Rl],u=Ap(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&&Dp(c,Rl===0?n:n+`_`+Rl,i),s&&e.flags&4||(Il===null&&(Il=[]),Il.push(c,Rl===0?r:r+`_`+Rl,t.memoizedProps)),Rl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:Xl(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function Zl(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=fi(n,r),a=mi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(jp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Rl=0,i=Xl(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Md(e,n.onUpdate))}else e.subtreeFlags&33554432&&Zl(e,t);e=e.sibling}}var Ql=!1,$l=!1,eu=!1,tu=!1,nu=typeof WeakSet==`function`?WeakSet:Set,ru=null,iu=!1,au=!1,ou=!1,su=!1;function cu(e,t,n){if(e=e.containerInfo,lp=vh,e=Hr(e),Ur(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(up={focusedElem:e,selectionRange:r},vh=!1,n=(n&335544064)===n,ru=t,t=n?9270:1024;ru!==null;){if(e=ru,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Gl(r[a]);if(e.alternate===null&&e.flags&2)n&&Fl(e),lu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Gl(r),lu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Fl(e),lu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,ru=r):(n&&Kl(e),lu(n))}}Pl=null}function lu(e){for(;ru!==null;){var t=ru,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=gc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){pf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)im(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:im(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=fi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=mi(a.default,a.update),a!==`none`&&zl(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,ru=r;break}ru=t.return}}function uu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Au(e,n),r&4&&hl(5,n);break;case 1:if(Au(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){pf(n,n.return,e)}else{var i=gc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){pf(n,n.return,e)}}}r&64&&_l(n),r&512&&yl(n,n.return);break;case 3:if(Au(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{yo(e,t)}catch(e){pf(n,n.return,e)}}break;case 27:t===null&&r&4&&Ml(n);case 26:case 5:Au(e,n),t===null&&r&4&&El(n),r&512&&yl(n,n.return);break;case 12:Au(e,n);break;case 31:Au(e,n),r&4&&yu(e,n);break;case 13:Au(e,n),r&4&&bu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=_f.bind(null,n),um(e,n))));break;case 22:if(r=n.memoizedState!==null||Ql,!r){var a=t!==null&&t.memoizedState!==null||$l;t=Ql,i=$l,Ql=r,($l=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Mu(e,n,r)):Au(e,n),Ql=t,$l=i}break;case 30:Au(e,n),r&512&&yl(n,n.return);break;case 7:r&512&&yl(n,n.return);default:Au(e,n)}}function du(e,t){for(e=e.child;e!==null;)fu(e,t),e=e.sibling}function fu(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){pf(e,e.return,t)}pu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,Bt=!0}catch(t){pf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Ep(s,!0):Ep(e.stateNode,!1)}catch(t){pf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&du(e,t);break;default:du(e,t)}}function pu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:fu(n,r);break a;case 22:n.memoizedState===null&&pu(n,r);break a;default:pu(n,r)}}e=e.sibling}}function mu(e){var t=e.alternate;t!==null&&(e.alternate=null,mu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Tt(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 hu=null,gu=!1;function _u(e,t,n){for(n=n.child;n!==null;)vu(e,t,n),n=n.sibling}function vu(e,t,n){if(We&&typeof We.onCommitFiberUnmount==`function`)try{We.onCommitFiberUnmount(W,n)}catch{}switch(n.tag){case 26:$l||bl(n,t),_u(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!$l&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:$l||bl(n,t),Cl(n);var r=hu,i=gu;wp(n.type)&&(hu=n.stateNode,gu=!1),_u(e,t,n),vm(n.stateNode,n.type,n.memoizedProps),hu=r,gu=i;break;case 5:$l||bl(n,t),Cl(n);case 6:if(n.tag===6&&Cl(n),r=hu,i=gu,hu=null,_u(e,t,n),hu=r,gu=i,hu!==null){if(gu)try{(hu.nodeType===9?hu.body:hu.nodeName===`HTML`?hu.ownerDocument.body:hu).removeChild(n.stateNode),Bt=!0}catch(e){pf(n,t,e)}else try{hu.removeChild(n.stateNode),Bt=!0}catch(e){pf(n,t,e)}}break;case 18:hu!==null&&(gu?(e=hu,Tp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Wh(e)):Tp(hu,n.stateNode));break;case 4:r=hu,i=gu,hu=n.stateNode.containerInfo,gu=!0,_u(e,t,n),hu=r,gu=i;break;case 0:case 11:case 14:case 15:gl(2,n,t),$l||gl(4,n,t),_u(e,t,n);break;case 1:$l||(bl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&vl(n,t,r)),_u(e,t,n);break;case 21:_u(e,t,n);break;case 22:$l=(r=$l)||n.memoizedState!==null,_u(e,t,n),$l=r;break;case 30:bl(n,t),_u(e,t,n);break;case 7:$l||bl(n,t),_u(e,t,n);break;default:_u(e,t,n)}}function yu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Wh(e)}catch(e){pf(t,t.return,e)}}}function bu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Wh(e)}catch(e){pf(t,t.return,e)}}function xu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new nu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new nu),t;default:throw Error(i(435,e.tag))}}function Su(e,t){var n=xu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=vf.bind(null,e,t);t.then(r,r)}})}function Cu(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(wp(l.type)){hu=l.stateNode,gu=!1;break a}break;case 5:hu=l.stateNode,gu=!1;break a;case 3:case 4:hu=l.stateNode.containerInfo,gu=!0;break a}l=l.return}if(hu===null)throw Error(i(160));vu(s,c,o),hu=null,gu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Tu(t,e,n),t=t.sibling}var wu=null;function Tu(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}Cu(t,e,n),Eu(e),a&4&&(gl(3,e,e.return),hl(3,e),gl(5,e,e.return));break;case 1:Cu(t,e,n),Eu(e),a&512&&($l||r===null||bl(r,r.return)),a&64&&Ql&&(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=wu,Cu(t,e,n),Eu(e),a&512&&($l||r===null||bl(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(Ql)e.stateNode=mp(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[Ct]||r[gt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),ip(r,t,n),r[gt]=e,At(r),t=r;break a;case`link`:if(o=qm(`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),ip(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=qm(`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),ip(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[gt]=e,At(r),t=r}e.stateNode=t}}else Ql||Jm(o,e.type,e.stateNode)}else e.stateNode=Hm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Dl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||$l||t.parentNode.removeChild(t)):a.count--,n===null?Ql||Jm(o,e.type,e.stateNode):Hm(o,n,e.memoizedProps))}break;case 27:Cu(t,e,n),Eu(e),a&512&&($l||r===null||bl(r,r.return)),r!==null&&a&4&&Dl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=eu,eu=!1,Cu(t,e,n),eu=o,Eu(e),a&512&&($l||r===null||bl(r,r.return)),e.flags&32){t=e.stateNode;try{an(t,``),Bt=!0}catch(t){pf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Dl(e,t,r===null?t:r.memoizedProps)),a&1024&&(tu=!0);break;case 6:if(Cu(t,e,n),Eu(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Bt=!0}catch(t){pf(e,e.return,t)}}break;case 3:if(Bt=!1,Km=null,o=wu,wu=Sm(t.containerInfo),Cu(t,e,n),wu=o,Eu(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Wh(t.containerInfo)}catch(t){pf(e,e.return,t)}tu&&(tu=!1,Du(e)),Bt=!1;break;case 4:a=eu,eu=Ql,r=Vt(),o=wu,wu=Sm(e.stateNode.containerInfo),Cu(t,e,n),Eu(e),wu=o,Bt&&au&&(ou=!0),Bt=r,eu=a;break;case 12:Cu(t,e,n),Eu(e);break;case 31:Cu(t,e,n),Eu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Su(e,t)));break;case 13:Cu(t,e,n),Eu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(pd=Fe()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Su(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=Ql,l=$l,u=eu;Ql=c||o,eu=u||o,$l=l||s,Cu(t,e,n),$l=l,eu=u,Ql=c,Eu(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||Ql||$l||(t=s||$l,n=Ql,r=$l,Ql=o||Ql,$l=t,ju(e,2),Ql=n,$l=r),!o&&eu||du(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Su(e,n))));break;case 19:Cu(t,e,n),Eu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Su(e,t)));break;case 30:a&512&&($l||r===null||bl(r,r.return)),a=Vt(),o=au,s=(n&335544064)===n,c=e.memoizedProps,au=s&&mi(c.default,c.update)!==`none`,Cu(t,e,n),Eu(e),s&&r!==null&&Bt&&(e.flags|=4),au=o,Bt=a;break;case 21:break;case 7:a&512&&($l||r===null||bl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Cu(t,e,n),Eu(e)}}function Eu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Ol(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Tl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(wl(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;jl(e,kl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(an(l,``),n.flags&=-33),jl(e,kl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Al(e,kl(e),u,s);break;default:throw Error(i(161))}}catch(t){pf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Du(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Du(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,vh=!0,t.reset(),vh=!1),e=e.sibling}}function Ou(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)ku(t,e),t=t.sibling;else Zl(t,!1)}function ku(e,t){var n=e.alternate;if(n===null)Ul(e,!1);else switch(e.tag){case 3:if(su=iu=!1,Ll(),Ou(t,e),!iu&&!ou){if(e=Il,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Op(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`})),su=!0}Il=null;break;case 5:Ou(t,e);break;case 4:r=iu,iu=!1,Ou(t,e),iu&&(ou=!0),iu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Ou(t,e):Ul(e,!1));break;case 30:r=iu,i=Ll(),iu=!1,Ou(t,e),iu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=fi(a,o),o=fi(n.memoizedProps,o);var s=mi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Rl=0,t=Xl(e,n,t,o,s,a,!0),Rl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Md(e,e.memoizedProps.onUpdate),Il=i):i!==null&&(i.push.apply(i,Il),Il=i),iu=e.flags&32?!0:r;break;default:Ou(t,e)}}function Au(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)uu(e,t.alternate,t),t=t.sibling}function ju(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:gl(4,n,n.return),ju(n,r);break;case 1:bl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&vl(n,n.return,i),ju(n,r);break;case 27:r&2&&vm(n.stateNode,n.type,n.memoizedProps);case 5:bl(n,n.return),n.tag!==5&&n.tag!==27||Cl(n),ju(n,r);break;case 6:Cl(n);break;case 26:bl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||$l||i.parentNode.removeChild(i),ju(n,r);break;case 22:n.memoizedState===null&&ju(n,r);break;case 30:bl(n,n.return),ju(n,r);break;case 7:bl(n,n.return);default:ju(n,r)}e=e.sibling}}function Mu(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:Mu(i,a,n),hl(4,a);break;case 1:if(Mu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){pf(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++)vo(l[i],c)}catch(e){pf(r,r.return,e)}}s&&o&64&&_l(a),yl(a,a.return);break;case 27:n&2&&Ml(a);case 5:a.tag!==5&&a.tag!==27||Sl(a),Mu(i,a,n),s&&r===null&&o&4&&El(a),yl(a,a.return);break;case 6:Sl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||Ql||Jm(Sm(c.ownerDocument),a.type,c),Mu(i,a,n),s&&r===null&&o&4&&El(a),yl(a,a.return);break;case 12:Mu(i,a,n);break;case 31:Mu(i,a,n),s&&o&4&&yu(i,a);break;case 13:Mu(i,a,n),s&&o&4&&bu(i,a);break;case 22:a.memoizedState===null&&Mu(i,a,n),yl(a,a.return);break;case 30:Mu(i,a,n),yl(a,a.return);break;case 7:yl(a,a.return);default:Mu(i,a,n)}t=t.sibling}}function Nu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ka(n))}function Pu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ka(e))}function Fu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Iu(e,t,n,r),t=t.sibling;else i&&Yl(t)}function Iu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Jl(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Fu(e,t,n,r),a&2048&&hl(9,t);break;case 1:Fu(e,t,n,r);break;case 3:Fu(e,t,n,r),i&&su&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&ka(a)));break;case 12:if(a&2048){Fu(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){pf(t,t.return,e)}}else Fu(e,t,n,r);break;case 31:Fu(e,t,n,r);break;case 13:Fu(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&&Jl(t),o._visibility&2?Fu(e,t,n,r):(o._visibility|=2,Lu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&Jl(s),o._visibility&2?Fu(e,t,n,r):Ru(e,t)),a&2048&&Nu(s,t);break;case 24:Fu(e,t,n,r),a&2048&&Pu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Vl(a.child,!0),Vl(t.child,!0))),Fu(e,t,n,r);break;default:Fu(e,t,n,r)}}function Lu(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:Lu(a,o,s,c,i),hl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Lu(a,o,s,c,i)):u._visibility&2?Lu(a,o,s,c,i):Ru(a,o),i&&l&2048&&Nu(o.alternate,o);break;case 24:Lu(a,o,s,c,i),i&&l&2048&&Pu(o.alternate,o);break;default:Lu(a,o,s,c,i)}t=t.sibling}}function Ru(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:Ru(n,r),i&2048&&Nu(r.alternate,r);break;case 24:Ru(n,r),i&2048&&Pu(r.alternate,r);break;default:Ru(n,r)}t=t.sibling}}var zu=8192;function Bu(e,t,n){if(e.subtreeFlags&zu)for(e=e.child;e!==null;)Vu(e,t,n),e=e.sibling}function Vu(e,t,n){switch(e.tag){case 26:Bu(e,t,n),e.flags&zu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&$m(n,e)):eh(n,wu,e.memoizedState,e.memoizedProps));break;case 5:Bu(e,t,n),e.flags&zu&&(e=e.stateNode,(t&335544128)===t&&$m(n,e));break;case 3:case 4:var r=wu;wu=Sm(e.stateNode.containerInfo),Bu(e,t,n),wu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=zu,zu=16777216,Bu(e,t,n),zu=r):Bu(e,t,n));break;case 30:if((e.flags&zu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Pl===null&&(Pl=new Map),Pl.set(r,i)}Bu(e,t,n);break;default:Bu(e,t,n)}}function Hu(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 Uu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ru=r,Ku(r,e)}Hu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Wu(e),e=e.sibling}function Wu(e){switch(e.tag){case 0:case 11:case 15:Uu(e),e.flags&2048&&gl(9,e,e.return);break;case 3:Uu(e);break;case 12:Uu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Gu(e)):Uu(e);break;default:Uu(e)}}function Gu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ru=r,Ku(r,e)}Hu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:gl(8,t,t.return),Gu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Gu(t));break;default:Gu(t)}e=e.sibling}}function Ku(e,t){for(;ru!==null;){var n=ru;switch(n.tag){case 0:case 11:case 15:gl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:ka(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,ru=r;else a:for(n=e;ru!==null;){r=ru;var i=r.sibling,a=r.return;if(mu(r),r===n){ru=null;break a}if(i!==null){i.return=a,ru=i;break a}ru=a}}}var qu={getCacheForType:function(e){var t=xa(Da),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return xa(Da).controller.signal}},Ju=typeof WeakMap==`function`?WeakMap:Map,Yu=0,Xu=null,Z=null,Zu=0,Qu=0,$u=null,ed=!1,td=!1,nd=!1,rd=0,id=0,ad=0,od=0,sd=0,cd=0,ld=0,ud=null,dd=null,fd=!1,pd=0,md=0,hd=1/0,gd=null,_d=null,vd=0,yd=null,bd=null,xd=0,Sd=0,Cd=null,wd=null,Td=null,Ed=null,Dd=null,Od=0,kd=null;function Ad(){return Yu&2&&Zu!==0?Zu&-Zu:H.T===null?pt():Pf()}function jd(){if(cd===0){if(!(Zu&536870912)||ea){var e=Ze;Ze<<=1,!(Ze&3932160)&&(Ze=262144),cd=e}else cd=536870912}return e=To.current,e!==null&&(e.flags|=32),cd}function Md(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Ip(fi(e.memoizedProps,n))),Ed===null&&(Ed=[]),Ed.push(t.bind(null,r))}}function Nd(e,t,n){(e===Xu&&(Qu===2||Qu===9)||e.cancelPendingCommit!==null)&&(Bd(e,0),Ld(e,Zu,cd,!1)),ot(e,n),Yu&2&&e===Xu||(e===Xu&&(!(Yu&2)&&(od|=n),id===4&&Ld(e,Zu,cd,!1)),Ef(e))}function Pd(e,t,n){if(Yu&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||tt(e,t),a=r?Jd(e,t):Kd(e,t,!0),o=r;do{if(a===0){td&&!r&&Ld(e,t,0,!1);break}if(n=e.current.alternate,o&&!Id(n))a=Kd(e,t,!1),o=!1;else{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=ud;var l=c.current.memoizedState.isDehydrated;if(l&&(Bd(c,s).flags|=256),s=Kd(c,s,!1),s!==2&&s!==6){if(nd&&!l){c.errorRecoveryDisabledLanes|=o,od|=o,a=4;break a}o=dd,dd=a,o!==null&&(dd===null?dd=o:dd.push.apply(dd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Bd(e,0),Ld(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:Ld(r,t,cd,!ed);break a;case 2:dd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=pd+300-Fe(),10<a)){if(Ld(r,t,cd,!ed),et(r,0,!0)!==0)break a;xd=t,r.timeoutHandle=vp(Fd.bind(null,r,n,dd,gd,fd,t,cd,od,ld,ed,o,`Throttled`,-0,0),a);break a}Fd(r,n,dd,gd,fd,t,cd,od,ld,ed,o,null,-0,0)}break}}while(1);Ef(e)}function Fd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:pn},Pl=null,Vu(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=ih.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?pd-Fe():(a&4194048)===a?md-Fe():0,m=nh(d,m),m!==null)?(xd=a,e.cancelPendingCommit=m(tf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Ld(e,a,o,!l)):tf(e,t,a,n,r,i,o,s,c,l,u,d)}function Id(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(!Ir(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 Ld(e,t,n,r){t=nt(e,t),t&=~sd,t&=~od,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ke(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&ct(e,n,t)}function Rd(){return Yu&6?!0:(Df(0,!1),!1)}function zd(){if(Z!==null){if(Qu===0)var e=Z.return;else e=Z,pa=fa=null,$o(e),eo=null,to=0,e=Z;for(;e!==null;)ml(e.alternate,e),e=e.return;Z=null}}function Bd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,yp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),xd=0,zd(),Xu=e,Z=n=ki(e.current,null),Zu=t,Qu=0,$u=null,ed=!1,td=tt(e,t),nd=!1,ld=cd=sd=od=ad=id=0,dd=ud=null,fd=!1,rd=nt(e,t),yi(),n}function Vd(e,t){q=null,H.H=cc,t===Wa||t===Ka?(t=Qa(),Qu=3):t===Ga?(t=Qa(),Qu=4):Qu=t===Ec?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,$u=t,Z===null&&(id=1,bc(e,Li(t,e.current)))}function Hd(){var e=To.current;return e===null?!0:(Zu&4194048)===Zu?Eo===null:(Zu&62914560)===Zu||Zu&536870912?e===Eo:!1}function Ud(){var e=H.H;return H.H=cc,e===null?cc:e}function Wd(){var e=H.A;return H.A=qu,e}function Gd(){id=4,ed||(Zu&4194048)!==Zu&&To.current!==null||(td=!0),!(ad&134217727)&&!(od&134217727)||Xu===null||Ld(Xu,Zu,cd,!1)}function Kd(e,t,n){var r=Yu;Yu|=2;var i=Ud(),a=Wd();(Xu!==e||Zu!==t)&&(gd=null,Bd(e,t)),t=!1;var o=id;a:do try{if(Qu!==0&&Z!==null){var s=Z,c=$u;switch(Qu){case 8:zd(),o=6;break a;case 3:case 2:case 9:case 6:To.current===null&&(t=!0);var l=Qu;if(Qu=0,$u=null,Qd(e,s,c,l),n&&td){o=0;break a}break;default:l=Qu,Qu=0,$u=null,Qd(e,s,c,l)}}qd(),o=id;break}catch(t){Vd(e,t)}while(1);return t&&e.shellSuspendCounter++,pa=fa=null,Yu=r,H.H=i,H.A=a,Z===null&&(Xu=null,Zu=0,yi()),o}function qd(){for(;Z!==null;)Xd(Z)}function Jd(e,t){var n=Yu;Yu|=2;var r=Ud(),a=Wd();Xu!==e||Zu!==t?(gd=null,hd=Fe()+500,Bd(e,t)):td=tt(e,t);a:do try{if(Qu!==0&&Z!==null){t=Z;var o=$u;b:switch(Qu){case 1:Qu=0,$u=null,Qd(e,t,o,1);break;case 2:case 9:if(Ja(o)){Qu=0,$u=null,Zd(t);break}t=function(){Qu!==2&&Qu!==9||Xu!==e||(Qu=7),Ef(e)},o.then(t,t);break a;case 3:Qu=7;break a;case 4:Qu=5;break a;case 7:Ja(o)?(Qu=0,$u=null,Zd(t)):(Qu=0,$u=null,Qd(e,t,o,7));break;case 5:var s=null;switch(Z.tag){case 26:s=Z.memoizedState;case 5:case 27:var c=Z;if(s?Zm(s):c.stateNode.complete){Qu=0,$u=null;var l=c.sibling;if(l!==null)Z=l;else{var u=c.return;u===null?Z=null:(Z=u,$d(u))}break b}}Qu=0,$u=null,Qd(e,t,o,5);break;case 6:Qu=0,$u=null,Qd(e,t,o,6);break;case 8:zd(),id=6;break a;default:throw Error(i(462))}}Yd();break}catch(t){Vd(e,t)}while(1);return pa=fa=null,H.H=r,H.A=a,Yu=n,Z===null?(Xu=null,Zu=0,yi(),id):0}function Yd(){for(;Z!==null&&!Ne();)Xd(Z)}function Xd(e){var t=ol(e.alternate,e,rd);e.memoizedProps=e.pendingProps,t===null?$d(e):Z=t}function Zd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Bc(n,t,t.pendingProps,t.type,void 0,Zu);break;case 11:t=Bc(n,t,t.pendingProps,t.type.render,t.ref,Zu);break;case 5:$o(t);var r=t;r===Qi&&(ea?(oa(r),r.tag===5&&r.stateNode!=null&&($i=r.stateNode)):(oa(r),ea=!0));default:ml(n,t),t=Z=Ai(t,rd),t=ol(n,t,rd)}e.memoizedProps=e.pendingProps,t===null?$d(e):Z=t}function Qd(e,t,n,r){pa=fa=null,$o(t),eo=null,to=0;var i=t.return;try{if(Tc(e,i,t,n,Zu)){id=1,bc(e,Li(n,e.current)),Z=null;return}}catch(t){if(i!==null)throw Z=i,t;id=1,bc(e,Li(n,e.current)),Z=null;return}t.flags&32768?(ea||r===1?e=!0:td||Zu&536870912?e=!1:(ed=e=!0,(r===2||r===9||r===3||r===6)&&(r=To.current,r!==null&&r.tag===13&&(r.flags|=16384))),ef(t,e)):$d(t)}function $d(e){var t=e;do{if(t.flags&32768){ef(t,ed);return}e=t.return;var n=fl(t.alternate,t,rd);if(n!==null){Z=n;return}if(t=t.sibling,t!==null){Z=t;return}Z=t=e}while(t!==null);id===0&&(id=5)}function ef(e,t){do{var n=pl(e.alternate,e);if(n!==null){n.flags&=32767,Z=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Z=e;return}Z=e=n}while(e!==null);id=6,Z=null}function tf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do uf();while(vd!==0);if(Yu&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===Xu&&(Z=Xu=null,Zu=0),bd=t,yd=e,xd=n,Cd=a,wd=r,nf(e,t,n,s,c,l,f)}}function nf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Sd=s,s|=vi,st(e,n,s,r,i,a),Ed=null,(n&335544064)===n?(Dd=Ma(e),r=10262):(Dd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,yf(ze,function(){return df(),null})):(e.callbackNode=null,e.callbackPriority=0),Nl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=H.T,H.T=null,i=le.p,le.p=2,a=Yu,Yu|=4;try{cu(e,t,n)}finally{Yu=a,le.p=i,H.T=r}}vd=1,Nl?Td=Pp(o,e.containerInfo,Dd,of,sf,af,cf,df,rf,null,null):(of(),sf(),cf())}function rf(e){if(vd!==0){var t=yd.onRecoverableError;t(e,{componentStack:null})}}function af(){vd===3&&(vd=0,ku(bd,yd),vd=4)}function of(){if(vd===1){vd=0;var e=yd,t=bd,n=xd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=H.T,H.T=null;var i=le.p;le.p=2;var a=Yu;Yu|=4;try{au=ou=!1,Tu(t,e,n),n=up;var o=Hr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Vr(s.ownerDocument.documentElement,s)){if(c!==null&&Ur(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 _=Br(s,h),v=Br(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}}vh=!!lp,up=lp=null}finally{Yu=a,le.p=i,H.T=r}}e.current=t,vd=2}}function sf(){if(vd===2){vd=0;var e=yd,t=bd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=H.T,H.T=null;var r=le.p;le.p=2;var i=Yu;Yu|=4;try{uu(e,t.alternate,t)}finally{Yu=i,le.p=r,H.T=n}}vd=3}}function cf(){if(vd===4||vd===3){vd=0;var e=Td;Td=null,Pe();var t=yd,n=bd,r=xd,i=wd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?vd=5:(vd=0,bd=yd=null,lf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(_d=null),ft(r),n=n.stateNode,We&&typeof We.onCommitFiberRoot==`function`)try{We.onCommitFiberRoot(W,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=H.T,a=le.p,le.p=2,H.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{H.T=n,le.p=a}}if(i=Ed,o=Dd,Dd=null,i!==null&&(Ed=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);xd&3&&uf(),Ef(t),a=t.pendingLanes,r&261930&&a&42?t===kd?Od++:(Od=0,kd=t):(Od=0,kd=null),Df(0,!1)}}function lf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ka(t)))}function uf(){return Td!==null&&(Td.skipTransition(),Td=null),of(),sf(),cf(),df()}function df(){if(vd!==5)return!1;var e=yd,t=Sd;Sd=0;var n=ft(xd),r=H.T,a=le.p;try{le.p=32>n?32:n,H.T=null,n=Cd,Cd=null;var o=yd,s=xd;if(vd=0,bd=yd=null,xd=0,Yu&6)throw Error(i(331));var c=Yu;if(Yu|=4,Wu(o.current),Iu(o,o.current,s,n),Yu=c,Df(0,!1),We&&typeof We.onPostCommitFiberRoot==`function`)try{We.onPostCommitFiberRoot(W,o)}catch{}return!0}finally{le.p=a,H.T=r,lf(e,t)}}function ff(e,t,n){t=Li(n,t),t=Sc(e.stateNode,t,2),e=fo(e,t,2),e!==null&&(ot(e,2),Ef(e))}function pf(e,t,n){if(e.tag===3)ff(e,e,n);else for(;t!==null;){if(t.tag===3){ff(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(_d===null||!_d.has(r))){e=Li(n,e),n=Cc(2),r=fo(t,n,2),r!==null&&(wc(n,r,t,e),ot(r,2),Ef(r));break}}t=t.return}}function mf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ju;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)||(nd=!0,i.add(n),e=hf.bind(null,e,t,n),t.then(e,e))}function hf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Xu===e&&(Zu&n)===n&&(id===4||id===3&&(Zu&62914560)===Zu&&300>Fe()-pd?Yu&2?sd|=n:Bd(e,0):sd|=n,ld===Zu&&(ld=0)),Ef(e)}function gf(e,t){t===0&&(t=it()),e=Si(e,t),e!==null&&(ot(e,t),Ef(e))}function _f(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),gf(e,n)}function vf(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),gf(e,n)}function yf(e,t){return je(e,t)}var bf=null,xf=null,Sf=!1,Cf=!1,wf=!1,Tf=0;function Ef(e){e!==xf&&e.next===null&&(xf===null?bf=xf=e:xf=xf.next=e),Cf=!0,Sf||(Sf=!0,Nf())}function Df(e,t){if(!wf&&Cf){wf=!0;do for(var n=!1,r=bf;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-Ke(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Mf(r,a))}else a=Zu,a=et(r,r===Xu?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||tt(r,a)||(n=!0,Mf(r,a))}r=r.next}while(n);wf=!1}}function Of(){kf()}function kf(){Cf=Sf=!1;var e=0;Tf!==0&&_p()&&(e=Tf);for(var t=Fe(),n=null,r=bf;r!==null;){var i=r.next,a=Af(r,t);a===0?(r.next=null,n===null?bf=i:n.next=i,i===null&&(xf=n)):(n=r,(e!==0||a&3)&&(Cf=!0)),r=i}vd!==0&&vd!==5||Df(e,!1),Tf!==0&&(Tf=0)}function Af(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ke(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=rt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Xu,n=Zu,n=et(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Qu===2||Qu===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Me(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||tt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Me(r),ft(n)){case 2:case 8:n=Re;break;case 32:n=ze;break;case 268435456:n=Ve;break;default:n=ze}return r=jf.bind(null,e),n=je(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Me(r),e.callbackPriority=2,e.callbackNode=null,2}function jf(e,t){if(vd!==0&&vd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(uf()&&e.callbackNode!==n)return null;var r=Zu;return r=et(e,e===Xu?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Pd(e,r,t),Af(e,Fe()),e.callbackNode!=null&&e.callbackNode===n?jf.bind(null,e):null)}function Mf(e,t){if(uf())return null;Pd(e,t,!0)}function Nf(){Sp(function(){Yu&6?je(Le,Of):kf()})}function Pf(){if(Tf===0){var e=Fa;e===0&&(e=Xe,Xe<<=1,!(Xe&261888)&&(Xe=256)),Tf=e}return Tf}function Ff(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:fn(e)}function If(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Ff((i[_t]||null).action),o=r.submitter;o&&(t=(t=o[_t]||null)?Ff(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Pn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Tf!==0){var e=new FormData(i,o);Js(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),Js(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Lf=0;Lf<li.length;Lf++){var Rf=li[Lf];ui(Rf.toLowerCase(),`on`+(Rf[0].toUpperCase()+Rf.slice(1)))}ui(ti,`onAnimationEnd`),ui(ni,`onAnimationIteration`),ui(ri,`onAnimationStart`),ui(`dblclick`,`onDoubleClick`),ui(`focusin`,`onFocus`),ui(`focusout`,`onBlur`),ui(ii,`onTransitionRun`),ui(ai,`onTransitionStart`),ui(oi,`onTransitionCancel`),ui(si,`onTransitionEnd`),Ft(`onMouseEnter`,[`mouseout`,`mouseover`]),Ft(`onMouseLeave`,[`mouseout`,`mouseover`]),Ft(`onPointerEnter`,[`pointerout`,`pointerover`]),Ft(`onPointerLeave`,[`pointerout`,`pointerover`]),Pt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Pt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Pt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Pt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Pt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Pt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var zf=`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(` `),Bf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(zf));function Vf(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){hi(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){hi(e)}i.currentTarget=null,a=c}}}}function Hf(e,t){var n=t[yt];n===void 0&&(n=t[yt]=new Set);var r=e+`__bubble`;n.has(r)||(Kf(t,e,2,!1),n.add(r))}function Uf(e,t,n){var r=0;t&&(r|=4),Kf(n,e,r,t)}var Wf=`_reactListening`+Math.random().toString(36).slice(2);function Gf(e){if(!e[Wf]){e[Wf]=!0,Mt.forEach(function(t){t!==`selectionchange`&&(Bf.has(t)||Uf(t,!1,e),Uf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Wf]||(t[Wf]=!0,Uf(`selectionchange`,!1,t))}}function Kf(e,t,n,r){switch(Th(t)){case 2:var i=yh;break;case 8:i=bh;break;default:i=xh}n=i.bind(null,t,n,e),i=void 0,!Cn||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 qf(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=Et(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}bn(function(){var r=a,i=hn(n),s=[];a:{var c=ci.get(e);if(c!==void 0){var l=Pn,u=e;switch(e){case`keypress`:if(kn(n)===0)break a;case`keydown`:case`keyup`:l=Qn;break;case`focusin`:u=`focus`,l=Un;break;case`focusout`:u=`blur`,l=Un;break;case`beforeblur`:case`afterblur`:l=Un;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=Vn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Hn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=tr;break;case ti:case ni:case ri:l=Wn;break;case si:l=nr;break;case`scroll`:case`scrollend`:l=In;break;case`wheel`:l=rr;break;case`copy`:case`cut`:case`paste`:l=Gn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=$n;break;case`submit`:l=er;break;case`toggle`:case`beforetoggle`:l=ir}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=xn(m,p),g!=null&&d.push(Jf(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!==mn&&(u=n.relatedTarget||n.fromElement)&&(Et(u)||u[vt]))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?Et(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=Vn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=$n,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Ot(c),h=l==null?u:Ot(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Et(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,Xf):null,c!==null&&Zf(s,u,c,d,!1),l!==null&&f!==null&&Zf(s,f,l,d,!0)))}a:{if(c=r?Ot(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=wr;else if(vr(c)){if(Tr)_=Pr;else{_=Mr;var v=jr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&ln(r.elementType)&&(_=wr):_=Nr;if(_&&=_(e,r)){yr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Ot(r):window,e){case`focusin`:(vr(v)||v.contentEditable===`true`)&&(Gr=v,Kr=r,qr=null);break;case`focusout`:qr=Kr=Gr=null;break;case`mousedown`:Jr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Jr=!1,Yr(s,n,i);break;case`selectionchange`:if(Wr)break;case`keydown`:case`keyup`:Yr(s,n,i)}var y;if(or)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 mr?fr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(lr&&n.locale!==`ko`&&(mr||b!==`onCompositionStart`?b===`onCompositionEnd`&&mr&&(y=On()):(Tn=i,En=`value`in Tn?Tn.value:Tn.textContent,mr=!0)),v=Yf(r,b),0<v.length&&(b=new Kn(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=pr(n),y!==null&&(b.data=y)))),(y=cr?hr(e,n):gr(e,n))&&(b=Yf(r,`onBeforeInput`),0<b.length&&(v=new Kn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),If(s,e,r,n,i)}Vf(s,t)})}function Jf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Yf(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=xn(e,n),i!=null&&r.unshift(Jf(e,i,a)),i=xn(e,t),i!=null&&r.push(Jf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Xf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Zf(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=xn(n,a),l!=null&&o.unshift(Jf(n,l,c))):i||(l=xn(n,a),l!=null&&o.push(Jf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Qf=/\r\n?/g,$f=/\u0000|\uFFFD/g;function ep(e){return(typeof e==`string`?e:``+e).replace(Qf,`
9
- `).replace($f,``)}function tp(e,t){return t=ep(t),ep(e)===t}function np(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||an(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&an(e,``+r);else return;break;case`className`:Ut(e,`class`,r);break;case`tabIndex`:Ut(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Ut(e,n,r);break;case`style`:cn(e,r,o);return;case`data`:if(t!==`object`){Ut(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=fn(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`&&np(e,t,`name`,a.name,a,null),np(e,t,`formEncType`,a.formEncType,a,null),np(e,t,`formMethod`,a.formMethod,a,null),np(e,t,`formTarget`,a.formTarget,a,null)):(np(e,t,`encType`,a.encType,a,null),np(e,t,`method`,a.method,a,null),np(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=fn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=pn);return;case`onScroll`:r!=null&&Hf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Hf(`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=fn(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`:Hf(`beforetoggle`,e),Hf(`toggle`,e),Ht(e,`popover`,r);break;case`xlinkActuate`:Wt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Wt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Wt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Wt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Wt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Wt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Ht(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=un.get(n)||n,Ht(e,n,r);else return}Bt=!0}function rp(e,t,n,r,a,o){switch(n){case`style`:cn(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`)an(e,r);else if(typeof r==`number`||typeof r==`bigint`)an(e,``+r);else return;break;case`onScroll`:r!=null&&Hf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Hf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=pn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Nt.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[_t]||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}Bt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Ht(e,n,r)}return}Bt=!0}function ip(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Hf(`error`,e),Hf(`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:np(e,t,o,s,n,null)}}a&&np(e,t,`srcSet`,n.srcSet,n,null),r&&np(e,t,`src`,n.src,n,null);return;case`input`:Hf(`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:np(e,t,r,d,n,null)}}$t(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Hf(`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:np(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&tn(e,!!r,n,!0):tn(e,!!r,t,!1);return;case`textarea`:for(s in Hf(`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:np(e,t,s,c,n,null)}rn(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:np(e,t,l,r,n,null)}return;case`dialog`:Hf(`beforetoggle`,e),Hf(`toggle`,e),Hf(`cancel`,e),Hf(`close`,e);break;case`iframe`:case`object`:Hf(`load`,e);break;case`video`:case`audio`:for(r=0;r<zf.length;r++)Hf(zf[r],e);break;case`image`:Hf(`error`,e),Hf(`load`,e);break;case`details`:Hf(`toggle`,e);break;case`embed`:case`source`:case`link`:Hf(`error`,e),Hf(`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:np(e,t,u,r,n,null)}return;default:if(ln(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&rp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&np(e,t,c,r,n,null))}var ap={};function op(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)||np(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&&(Bt=!0),o=m;break;case`name`:m!==f&&(Bt=!0),a=m;break;case`checked`:m!==f&&(Bt=!0),u=m;break;case`defaultChecked`:m!==f&&(Bt=!0),d=m;break;case`value`:m!==f&&(Bt=!0),s=m;break;case`defaultValue`:m!==f&&(Bt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&np(e,t,p,m,r,f)}}Qt(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)||np(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&&(Bt=!0),p=o;break;case`defaultValue`:o!==l&&(Bt=!0),c=o;break;case`multiple`:o!==l&&(Bt=!0),s=o;default:o!==l&&np(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?tn(e,!!n,n?[]:``,!1):tn(e,!!n,t,!0)):tn(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:np(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&&(Bt=!0),p=a;break;case`defaultValue`:a!==o&&(Bt=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&np(e,t,s,a,r,o)}nn(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:np(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&&(Bt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:np(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)&&np(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:np(e,t,u,p,r,m)}return;default:if(ln(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&rp(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||rp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&np(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||np(e,t,f,p,r,m)}function sp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function cp(){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&&sp(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&&sp(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 lp=null,up=null;function dp(e){return e.nodeType===9?e:e.ownerDocument}function fp(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 pp(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 mp(e,t,n,r){return n=dp(n).createElement(e),n[gt]=r,n[_t]=t,ip(n,e,t),At(n),n}function hp(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 gp=null;function _p(){var e=window.event;return e&&e.type===`popstate`?e!==gp&&(gp=e,!0):(gp=null,!1)}var vp=typeof setTimeout==`function`?setTimeout:void 0,yp=typeof clearTimeout==`function`?clearTimeout:void 0,bp=typeof Promise==`function`?Promise:void 0,xp=typeof requestAnimationFrame==`function`?requestAnimationFrame:vp,Sp=typeof queueMicrotask==`function`?queueMicrotask:bp===void 0?vp:function(e){return bp.resolve(null).then(e).catch(Cp)};function Cp(e){setTimeout(function(){throw e})}function wp(e){return e===`head`}function Tp(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),Wh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)ym(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,ym(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Ct]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&ym(e.ownerDocument.body)}n=i}while(n);Wh(t)}function Ep(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 Dp(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 Op(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 kp(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 Ap(e){return kp(e.getBoundingClientRect(),getComputedStyle(e),e)}function jp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return kp(t,n,e)}function Mp(e){return e.documentElement.clientHeight}function Np(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Pp(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`&&(Mp(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+=Qm(f),u>th){s.length=o;break}f=new Promise(Np.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 Fp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Fp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Fp.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},Fp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Ip(e){return{name:e,group:new Fp(`group`,e),imagePair:new Fp(`image-pair`,e),old:new Fp(`old`,e),new:new Fp(`new`,e)}}function Lp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Lp.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(Hp(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=Bp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),h(this._fragmentFiber.child,!1,Rp,e,s,r)}this._eventListeners=a}};function Rp(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Lp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Hp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Bp(i.optionsOrUseCapture),h(this._fragmentFiber.child,!1,zp,e,n,i),r.splice(t,1),a!==null&&a()}};function zp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Bp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Vp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Hp(e,t,n,r){if(e.length===0)return-1;r=Vp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Vp(a.optionsOrUseCapture)===r)return i}return-1}Lp.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,Bp(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,Bp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Lp.prototype.focus=function(e){h(this._fragmentFiber.child,!0,Up,e,void 0,void 0)};function Up(e,t){return e.tag!==6&&(e=b(e),hm(e,t))}Lp.prototype.focusLast=function(e){var t=[];h(this._fragmentFiber.child,!0,Wp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Up(t[n],e);n--);};function Wp(e,t){return t.push(e),!1}Lp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=dp(e).activeElement,e!==null&&h(this._fragmentFiber.child,!1,Gp,e,void 0,void 0))};function Gp(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Lp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),h(this._fragmentFiber.child,!1,Kp,e,void 0,void 0)};function Kp(e,t){return e.tag===6||(e=b(e),t.observe(e)),!1}Lp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),h(this._fragmentFiber.child,!1,qp,e,void 0,void 0);for(var n=t=0;n<Jp.length;n++){var r=Jp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Jp[t++]=r}Jp.length=t}};function qp(e,t){return e.tag===6||(e=b(e),t.unobserve(e)),!1}var Jp=[],Yp=!1;function Xp(e,t,n){Jp.push({fragmentInstance:e,observer:t,instance:n}),Yp||(Yp=!0,gm(function(){Yp=!1;var e=Jp;Jp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Lp.prototype.getClientRects=function(){var e=[];return h(this._fragmentFiber.child,!1,Zp,e,void 0,void 0),e};function Zp(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}Lp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Lp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];h(this._fragmentFiber.child,!1,Wp,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||Qp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Qp(e,t,n,r,i){var a=Et(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=g(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=E(n,a,T),t===null?t=!1:(h(t,!0,C,a,n),a=x,x=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=E(r,a,T),t===null?t=!1:(h(t,!0,w,a,r),a=x,S=x=null,t=a!==null)),t):!1}function $p(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)}Lp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];h(this._fragmentFiber.child,!1,Wp,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),$p(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),$p(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function em(e,t){return e=b(e),tm(e,t),!1}function tm(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function nm(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,Bp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Jp.length;i++){var a=Jp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Jp[r++]=a)}Jp.length=r,n.observe(e)}),tm(e,t))}function rm(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,Bp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Xp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function im(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`:im(n),Tt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function am(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[Ct])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=dm(e.nextSibling),e===null)break}return null}function om(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=dm(e.nextSibling),e===null))return null;return e}function sm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=dm(e.nextSibling),e===null))return null;return e}function cm(e){return e.data===`$?`||e.data===`$~`}function lm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function um(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 dm(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 fm=null;function pm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return dm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function mm(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 hm(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 gm(e){xp(function(){xp(function(t){return e(t)})})}function _m(e,t,n){switch(t=dp(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 vm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&np(e,t,r,null,ap,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===pn&&(e.onclick=null),Tt(e)}function ym(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Tt(e)}var bm=new Map,xm=new Set;function Sm(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 Cm=le.d;le.d={f:wm,r:Tm,D:Om,C:km,L:Am,m:jm,X:Nm,S:Mm,M:Pm};function wm(){var e=Cm.f(),t=Rd();return e||t}function Tm(e){var t=Dt(e);t!==null&&t.tag===5&&t.type===`form`?Xs(t):Cm.r(e)}var Em=typeof document>`u`?null:document;function Dm(e,t,n){var r=Em;if(r&&typeof t==`string`&&t){var i=Zt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),xm.has(i)||(xm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),ip(t,`link`,e),At(t),r.head.appendChild(t)))}}function Om(e){Cm.D(e),Dm(`dns-prefetch`,e,null)}function km(e,t){Cm.C(e,t),Dm(`preconnect`,e,t)}function Am(e,t,n){Cm.L(e,t,n);var r=Em;if(r&&e&&t){var i=`link[rel="preload"][as="`+Zt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Zt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Zt(n.imageSizes)+`"]`)):i+=`[href="`+Zt(e)+`"]`;var a=i;switch(t){case`style`:a=Im(e);break;case`script`:a=Bm(e)}if(!(bm.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),bm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Lm(a))||t===`script`&&r.querySelector(Vm(a))))){var o=r.createElement(`link`);ip(o,`link`,e),t===`style`&&(o[wt]=!0,o.onload=o.onerror=function(){jt(o)}),At(o),r.head.appendChild(o)}}}function jm(e,t){Cm.m(e,t);var n=Em;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Zt(r)+`"][href="`+Zt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Bm(e)}if(!bm.has(a)&&(e=D({rel:`modulepreload`,href:e},t),bm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Vm(a)))return}r=n.createElement(`link`),ip(r,`link`,e),At(r),n.head.appendChild(r)}}}function Mm(e,t,n){Cm.S(e,t,n);var r=Em;if(r&&e){var i=kt(r).hoistableStyles,a=Im(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Lm(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=bm.get(a))&&Wm(e,n);var c=o=r.createElement(`link`);At(c),ip(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,Um(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Nm(e,t){Cm.X(e,t);var n=Em;if(n&&e){var r=kt(n).hoistableScripts,i=Bm(e),a=r.get(i);a||(a=n.querySelector(Vm(i)),a||(e=D({src:e,async:!0},t),(t=bm.get(i))&&Gm(e,t),a=n.createElement(`script`),At(a),ip(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Pm(e,t){Cm.M(e,t);var n=Em;if(n&&e){var r=kt(n).hoistableScripts,i=Bm(e),a=r.get(i);a||(a=n.querySelector(Vm(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=bm.get(i))&&Gm(e,t),a=n.createElement(`script`),At(a),ip(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Fm(e,t,n,r){var a=(a=ve.current)?Sm(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=Im(n.href),t=kt(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=Im(n.href);var o=kt(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(Lm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=bm.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},bm.set(e,o)),zm(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=Bm(n),t=kt(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 Im(e){return`href="`+Zt(e)+`"`}function Lm(e){return`link[rel="stylesheet"][`+e+`]`}function Rm(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function zm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[wt]){r.loading=1;return}}else t=e.createElement(`link`),t[wt]=!0,t.onload=t.onerror=jt.bind(null,t),ip(t,`link`,n),At(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 Bm(e){return`[src="`+Zt(e)+`"]`}function Vm(e){return`script[async]`+e}function Hm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Zt(n.href)+`"]`);if(r)return t.instance=r,At(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`),At(r),ip(r,`style`,a),Um(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Im(n.href);var o=e.querySelector(Lm(a));if(o)return t.state.loading|=4,t.instance=o,At(o),o;r=Rm(n),(a=bm.get(a))&&Wm(r,a),o=(e.ownerDocument||e).createElement(`link`),At(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),ip(o,`link`,r),t.state.loading|=4,Um(o,n.precedence,e),t.instance=o;case`script`:return o=Bm(n.src),(a=e.querySelector(Vm(o)))?(t.instance=a,At(a),a):(r=n,(a=bm.get(o))&&(r=D({},n),Gm(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),At(a),ip(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,Um(r,n.precedence,e));return t.instance}function Um(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 Wm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Gm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Km=null;function qm(e,t,n){if(Km===null){var r=new Map,i=Km=new Map;i.set(n,r)}else i=Km,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[Ct]||a[gt]||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 Jm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Ym(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 Xm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Zm(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Qm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function $m(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Qm(t),e.suspenseyImages.push(t)),e=ah.bind(e),t.decode().then(e,e))}function eh(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=Im(r.href),a=t.querySelector(Lm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=ih.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,At(a);return}a=t.ownerDocument||t,r=Rm(r),(i=bm.get(i))&&Wm(r,i),a=a.createElement(`link`),At(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),ip(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=ih.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var th=0;function nh(e,t){return e.stylesheets&&e.count===0&&sh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&sh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&th===0&&(th=62500*cp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&sh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>th?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function rh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)sh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function ih(){this.count--,rh(this)}function ah(){this.imgCount--,rh(this)}var oh=null;function sh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,oh=new Map,t.forEach(ch,e),oh=null,ih.call(e))}function ch(e,t){if(!(t.state.loading&4)){var n=oh.get(e);if(n)var r=n.get(null);else{n=new Map,oh.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=ih.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 lh={$$typeof:F,Provider:null,Consumer:null,_currentValue:ue,_currentValue2:ue,_threadCount:0};function uh(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=at(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=at(0),this.hiddenUpdates=at(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 dh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new uh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Di(3,null,null,t),e.current=a,a.stateNode=e,t=Oa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},co(a),e}function fh(e){return e?(e=Ti,e):Ti}function ph(e,t,n,r,i,a){i=fh(i),r.context===null?r.context=i:r.pendingContext=i,r=uo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=fo(e,r,t),n!==null&&(Nd(n,e,t),po(n,e,t))}function mh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function hh(e,t){mh(e,t),(e=e.alternate)&&mh(e,t)}function gh(e){if(e.tag===13||e.tag===31){var t=Si(e,67108864);t!==null&&Nd(t,e,67108864),hh(e,67108864)}}function _h(e){if(e.tag===13||e.tag===31){var t=Ad();t=dt(t);var n=Si(e,t);n!==null&&Nd(n,e,t),hh(e,t)}}var vh=!0;function yh(e,t,n,r){var i=H.T;H.T=null;var a=le.p;try{le.p=2,xh(e,t,n,r)}finally{le.p=a,H.T=i}}function bh(e,t,n,r){var i=H.T;H.T=null;var a=le.p;try{le.p=8,xh(e,t,n,r)}finally{le.p=a,H.T=i}}function xh(e,t,n,r){if(vh){var i=Sh(r);if(i===null)qf(e,t,r,Ch,n),Ph(e,r);else if(Ih(i,e,t,n,r))r.stopPropagation();else if(Ph(e,r),t&4&&-1<Nh.indexOf(e)){for(;i!==null;){var a=Dt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=$e(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ke(o);s.entanglements[1]|=c,o&=~c}Ef(a),!(Yu&6)&&(hd=Fe()+500,Df(0,!1))}}break;case 31:case 13:s=Si(a,2),s!==null&&Nd(s,a,2),Rd(),hh(a,2)}if(a=Sh(r),a===null&&qf(e,t,r,Ch,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else qf(e,t,r,null,n)}}function Sh(e){return e=hn(e),wh(e)}var Ch=null;function wh(e){if(Ch=null,e=Et(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 Ch=e,null}function Th(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(Ie()){case Le:return 2;case Re:return 8;case ze:case Be:return 32;case Ve:return 268435456;default:return 32}default:return 32}}var Eh=!1,Dh=null,Oh=null,kh=null,Ah=new Map,jh=new Map,Mh=[],Nh=`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 Ph(e,t){switch(e){case`focusin`:case`focusout`:Dh=null;break;case`dragenter`:case`dragleave`:Oh=null;break;case`mouseover`:case`mouseout`:kh=null;break;case`pointerover`:case`pointerout`:Ah.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:jh.delete(t.pointerId)}}function Fh(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=Dt(t),t!==null&&gh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ih(e,t,n,r,i){switch(t){case`focusin`:return Dh=Fh(Dh,e,t,n,r,i),!0;case`dragenter`:return Oh=Fh(Oh,e,t,n,r,i),!0;case`mouseover`:return kh=Fh(kh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Ah.set(a,Fh(Ah.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,jh.set(a,Fh(jh.get(a)||null,e,t,n,r,i)),!0}return!1}function Lh(e){var t=Et(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,mt(e.priority,function(){_h(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,mt(e.priority,function(){_h(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 Rh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Sh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);mn=r,n.target.dispatchEvent(r),mn=null}else return t=Dt(n),t!==null&&gh(t),e.blockedOn=n,!1;t.shift()}return!0}function zh(e,t,n){Rh(e)&&n.delete(t)}function Bh(){Eh=!1,Dh!==null&&Rh(Dh)&&(Dh=null),Oh!==null&&Rh(Oh)&&(Oh=null),kh!==null&&Rh(kh)&&(kh=null),Ah.forEach(zh),jh.forEach(zh)}function Vh(e,n){e.blockedOn===n&&(e.blockedOn=null,Eh||(Eh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Bh)))}var Hh=null;function Uh(e){Hh!==e&&(Hh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Hh===e&&(Hh=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(wh(r||n)===null)continue;break}var a=Dt(n);a!==null&&(e.splice(t,3),t-=3,Js(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Wh(e){function t(t){return Vh(t,e)}Dh!==null&&Vh(Dh,e),Oh!==null&&Vh(Oh,e),kh!==null&&Vh(kh,e),Ah.forEach(t),jh.forEach(t);for(var n=0;n<Mh.length;n++){var r=Mh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Mh.length&&(n=Mh[0],n.blockedOn===null);)Lh(n),n.blockedOn===null&&Mh.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[_t]||null;if(typeof a==`function`)o||Uh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[_t]||null)s=o.formAction;else if(wh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Uh(n)}}}function Gh(){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 Kh(e){this._internalRoot=e}Q.prototype.render=Kh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;ph(n,Ad(),e,t,null,null)},Q.prototype.unmount=Kh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ph(e.current,2,null,e,null,null),Rd(),t[vt]=null}};function Q(e){this._internalRoot=e}Q.prototype.unstable_scheduleHydration=function(e){if(e){var t=pt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Mh.length&&t!==0&&t<Mh[n].priority;n++);Mh.splice(n,0,e),n===0&&Lh(e)}};var qh=n.version;if(qh!==`19.3.1`)throw Error(i(527,qh,`19.3.1`));le.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=d(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var Jh={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:H,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Yh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Yh.isDisabled&&Yh.supportsFiber)try{W=Yh.inject(Jh),We=Yh}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=_c,s=vc,c=yc;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=dh(e,1,!1,null,null,n,r,null,o,s,c,Gh),e[vt]=t.current,Gf(e),new Kh(t)}})),g=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=h()})),_=c(u(),1),v=g(),y=[`Shift`,`Meta`,`Alt`,`Control`],b=1e3,x=`keydown`,S=typeof navigator==`object`?navigator.platform:``,C=/Mac|iPod|iPhone|iPad/.test(S)?`Meta`:`Control`,w=S===`Win32`?[`Control`,`Alt`]:[`Alt`];function T(e){return!!(e.key&&e.code&&e.getModifierState)}function E(e){let t=e.target;return e.repeat||e.isComposing||t!==e.currentTarget&&t.matches(`[contenteditable],input,select,textarea`)}function D(e,t){return typeof e.getModifierState==`function`?e.getModifierState(t)||w.includes(t)&&e.getModifierState(`AltGraph`):!1}function O(e){return e.trim().split(` `).map(e=>{let t=e.split(/(?<=\w|\])\+/),n=t.pop(),r=n.match(/^\((.+)\)$/),i=r?RegExp(`^(?:${r[1]})$`,`iv`):n,a=[],o=[];for(let e of t){let t=e.match(/^\[(.*)\]$/),n=t?.[1]??e;n=n===`$mod`?C:n,t?o.push(n):a.push(n)}return[a,o,i]})}function k(e,[t,n,r]){let i=t.includes(`AltGraph`);return!((r instanceof RegExp?!(r.test(e.key)||r.test(e.code)):r.toUpperCase()!==e.key.toUpperCase()&&r!==e.code)||t.find(t=>!D(e,t))||y.find(a=>!t.includes(a)&&!n.includes(a)&&r!==a&&D(e,a)&&!(i&&w.includes(a))))}function A(e,t={}){let n=t.timeout??b,r=t.ignore??E,i=Object.keys(e).map(t=>[t,O(t),e[t]]),a=new Map,o=null;return e=>{if(!T(e)||r(e))return;let t=[];for(let[n,r,o]of i){let[i,...s]=a.get(n)||r;if(!k(e,i))D(e,e.key)||a.delete(n);else if(s.length>0)a.set(n,s),t.push(n);else if(a.delete(n),t.length)console.warn(`tinykeys: Conflict found, "${n}" did not fire, waiting for:`,t);else{o(e);break}}o&&clearTimeout(o),o=setTimeout(()=>a.clear(),n)}}function j(e,t,n={}){let r=n.event??x,i=A(t,n);return e.addEventListener(r,i,n.capture),()=>{e.removeEventListener(r,i,n.capture)}}var M=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},N=(e=>e?M(e):M),P=e=>e;function F(e,t=P){let n=_.useSyncExternalStore(e.subscribe,_.useCallback(()=>t(e.getState()),[e,t]),()=>t(e.getInitialState()));return _.useDebugValue(n),n}var I=e=>Symbol.iterator in e,L=e=>`entries`in e,R=(e,t)=>{let n=e instanceof Map?e:new Map(e.entries()),r=t instanceof Map?t:new Map(t.entries());if(n.size!==r.size)return!1;for(let[e,t]of n)if(!r.has(e)||!Object.is(t,r.get(e)))return!1;return!0},z=(e,t)=>{let n=e[Symbol.iterator](),r=t[Symbol.iterator](),i=n.next(),a=r.next();for(;!i.done&&!a.done;){if(!Object.is(i.value,a.value))return!1;i=n.next(),a=r.next()}return!!i.done&&!!a.done};function ee(e,t){return Object.is(e,t)?!0:typeof e!=`object`||!e||typeof t!=`object`||!t||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?!1:I(e)&&I(t)?L(e)&&L(t)?R(e,t):z(e,t):R({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}function te(e){let t=_.useRef(void 0);return n=>{let r=e(n);return ee(t.current,r)?t.current:t.current=r}}var ne={$mod:`⌘`,Meta:`⌘`,Control:`⌃`,Alt:`⌥`,Shift:`⇧`},re=[`Control`,`Alt`,`Shift`,`$mod`,`Meta`],ie={$mod:`Ctrl`,Meta:`Win`,Control:`Ctrl`,Alt:`Alt`,Shift:`Shift`},ae={Backslash:`\\`,BracketLeft:`[`,BracketRight:`]`,Equal:`=`,Minus:`-`,Escape:`Esc`,Enter:`↵`,Backspace:`⌫`,Tab:`Tab`,ArrowUp:`↑`,ArrowDown:`↓`,ArrowLeft:`←`,ArrowRight:`→`},B=/Mac|iPod|iPhone|iPad/.test(navigator.platform);function V(e,t=B){return oe(e,t).join(t?``:`+`)}function oe(e,t=B){let n=e.split(`+`),r=n.pop()??``,i=t?ne:ie,a=t?[...n].sort((e,t)=>re.indexOf(e)-re.indexOf(t)):n;return[...(se(r)?a.filter(e=>e!==`Shift`):a).map(e=>i[e]??e),ce(r)]}function se(e){return e.length===1&&!/[a-z0-9]/i.test(e)}function ce(e){return ae[e]||(/^(?:Key|Digit)(.)$/.exec(e)?.[1]??e).toUpperCase()}var H=new Set([`Backquote`,`Backslash`,`BracketLeft`,`BracketRight`,`Comma`,`Equal`,`Minus`,`Period`,`Quote`,`Semicolon`,`Slash`]);function le(e){let t=e.split(`+`),n=t.pop()??``;return t.some(e=>e!==`Shift`)?!1:n.length===1||/^(?:Key|Digit).$/.test(n)||H.has(n)}var ue=`frameboard.characterKeys`;function de(e){let t=N()(()=>({on:ge(e)}));return t.subscribe((t,n)=>{t.on!==n.on&&_e(e,t.on)}),t}function fe(e,t=ye){t.setState({on:e})}function pe(e=ye){return e.getState().on}function me(e=ye){return F(e,e=>e.on)}function he(e,t=pe()){return e?.find(e=>t||!le(e))}function ge(e){try{return e?.getItem(ue)!==`off`}catch{return!0}}function _e(e,t){try{e?.setItem(ue,t?`on`:`off`)}catch{}}function ve(){try{return window.localStorage}catch{return null}}var ye=de(ve()),be=N()(()=>({actions:[],version:0}));function xe(e){return be.setState(t=>({actions:[...t.actions,...e]})),()=>be.setState(t=>({actions:t.actions.filter(t=>!e.includes(t))}))}function U(){be.setState(e=>({version:e.version+1}))}function Se(e){return e.enabled?.()??!0}function Ce(e){return F(be,te(t=>[t.version,...e.map(e=>t.actions.find(t=>t.id===e))])).slice(1)}function we(e){return be.getState().actions.find(t=>t.id===e)}function Te(){return F(be,te(e=>{let t=new Set,n=e.actions.filter(e=>!e.command||t.has(e.id)?!1:(t.add(e.id),Se(e)));return[e.version,...n]})).slice(1)}function Ee(e){return F(be,te(t=>[t.version,...t.actions.filter(t=>t.group===e)])).slice(1)}function De(e,t){let n=n=>{let r=new Set(n.flatMap(e=>e.keys??[]).filter(e=>!t||t.includes(e)));return j(e,Object.fromEntries([...r].map(e=>[e,t=>Oe(e,t)])),{ignore:ke})},r=n(be.getState().actions),i=be.subscribe((e,t)=>{e.actions!==t.actions&&(r(),r=n(e.actions))});return()=>{i(),r()}}function Oe(e,t){if(le(e)&&!pe())return;let n=be.getState().actions.find(t=>t.keys?.includes(e)&&Se(t));n&&(t.preventDefault(),n.run())}function ke(e){let t=e.target;return typeof t?.matches==`function`?E(e)||t.isContentEditable?!0:t.closest?.(`[data-slot="toast"]`)==null?t.closest?.(`[role="dialog"]`)!=null:e.key===`Enter`:!1}var Ae=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function je(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:Ae(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var Me=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},Ne=e=>{let t=Me(e);return t.charAt(0).toUpperCase()+t.slice(1)},Pe=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Fe={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function Ie(e){return e!=null}function Le(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??Fe.width,a=e.size??e.height??Fe.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?Pe(...c):Pe(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??Fe[`stroke-width`])*Number(e.size??e.width??Fe.width)/Number(t.size??t.width??Fe.width):t.strokeWidth??Fe[`stroke-width`];return[`svg`,{...Object.entries(Fe).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&Ie(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&Ie(t.width)&&{[r(`width`)]:t.width},...`height`in t&&Ie(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function Re(e,t={}){return Le(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var ze=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Be=(0,_.createContext)({});function Ve({children:e,size:t,color:n,strokeWidth:r,absoluteStrokeWidth:i,nonScalingStroke:a,className:o}){let s=(0,_.useMemo)(()=>({size:t,color:n,strokeWidth:r,absoluteStrokeWidth:i,nonScalingStroke:a,className:o}),[t,n,r,i,a,o]);return(0,_.createElement)(Be.Provider,{value:s},e)}var He=()=>(0,_.useContext)(Be),Ue=(0,_.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:g=!1,color:v=`currentColor`,className:y=``}=He()??{},b=!!c||ze(d),[x,S,C=[]]=Re(u,{color:e??v,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:Pe(y,s),hasA11yProp:b,attributes:d});return(0,_.createElement)(x,{ref:f,...S},[...C.map(([e,t])=>(0,_.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function W(e,t=[],n=[]){let r=typeof e==`string`?je(e,t,n):e,i=(0,_.forwardRef)(({className:e,...t},n)=>(0,_.createElement)(Ue,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=Ne(r.name)),i}var We={name:`align-center-horizontal`,size:24,node:[[`path`,{d:`M2 12h20`,key:`9i4pu4`}],[`path`,{d:`M10 16v4a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-4`,key:`11f1s0`}],[`path`,{d:`M10 8V4a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v4`,key:`t14dx9`}],[`path`,{d:`M20 16v1a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-1`,key:`1w07xs`}],[`path`,{d:`M14 8V7c0-1.1.9-2 2-2h2a2 2 0 0 1 2 2v1`,key:`1apec2`}]]};We.node;var Ge=W(We),Ke={name:`align-center-vertical`,size:24,node:[[`path`,{d:`M12 2v20`,key:`t6zp3m`}],[`path`,{d:`M8 10H4a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h4`,key:`14d6g8`}],[`path`,{d:`M16 10h4a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2h-4`,key:`1e2lrw`}],[`path`,{d:`M8 20H7a2 2 0 0 1-2-2v-2c0-1.1.9-2 2-2h1`,key:`1fkdwx`}],[`path`,{d:`M16 14h1a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2h-1`,key:`1euafb`}]]};Ke.node;var qe=W(Ke),Je={name:`align-end-horizontal`,size:24,node:[[`rect`,{width:`6`,height:`16`,x:`4`,y:`2`,rx:`2`,key:`z5wdxg`}],[`rect`,{width:`6`,height:`9`,x:`14`,y:`9`,rx:`2`,key:`um7a8w`}],[`path`,{d:`M22 22H2`,key:`19qnx5`}]]};Je.node;var Ye=W(Je),Xe={name:`align-end-vertical`,size:24,node:[[`rect`,{width:`16`,height:`6`,x:`2`,y:`4`,rx:`2`,key:`10wcwx`}],[`rect`,{width:`9`,height:`6`,x:`9`,y:`14`,rx:`2`,key:`4p5bwg`}],[`path`,{d:`M22 22V2`,key:`12ipfv`}]]};Xe.node;var Ze=W(Xe),Qe={name:`align-horizontal-distribute-center`,size:24,node:[[`rect`,{width:`6`,height:`14`,x:`4`,y:`5`,rx:`2`,key:`1wwnby`}],[`rect`,{width:`6`,height:`10`,x:`14`,y:`7`,rx:`2`,key:`1fe6j6`}],[`path`,{d:`M17 22v-5`,key:`4b6g73`}],[`path`,{d:`M17 7V2`,key:`hnrr36`}],[`path`,{d:`M7 22v-3`,key:`1r4jpn`}],[`path`,{d:`M7 5V2`,key:`liy1u9`}]]};Qe.node;var $e=W(Qe),et={name:`align-horizontal-space-between`,size:24,node:[[`rect`,{width:`6`,height:`14`,x:`3`,y:`5`,rx:`2`,key:`j77dae`}],[`rect`,{width:`6`,height:`10`,x:`15`,y:`7`,rx:`2`,key:`bq30hj`}],[`path`,{d:`M3 2v20`,key:`1d2pfg`}],[`path`,{d:`M21 2v20`,key:`p059bm`}]]};et.node;var tt=W(et),nt={name:`align-start-vertical`,size:24,node:[[`rect`,{width:`9`,height:`6`,x:`6`,y:`14`,rx:`2`,key:`lpm2y7`}],[`rect`,{width:`16`,height:`6`,x:`6`,y:`4`,rx:`2`,key:`rdj6ps`}],[`path`,{d:`M2 2v20`,key:`1ivd8o`}]]};nt.node;var rt=W(nt),it={name:`align-start-horizontal`,size:24,node:[[`rect`,{width:`6`,height:`16`,x:`4`,y:`6`,rx:`2`,key:`1n4dg1`}],[`rect`,{width:`6`,height:`9`,x:`14`,y:`6`,rx:`2`,key:`17khns`}],[`path`,{d:`M22 2H2`,key:`fhrpnj`}]]};it.node;var at=W(it),ot={name:`align-vertical-distribute-center`,size:24,node:[[`path`,{d:`M22 17h-3`,key:`1lwga1`}],[`path`,{d:`M22 7h-5`,key:`o2endc`}],[`path`,{d:`M5 17H2`,key:`1gx9xc`}],[`path`,{d:`M7 7H2`,key:`6bq26l`}],[`rect`,{x:`5`,y:`14`,width:`14`,height:`6`,rx:`2`,key:`1qrzuf`}],[`rect`,{x:`7`,y:`4`,width:`10`,height:`6`,rx:`2`,key:`we8e9z`}]]};ot.node;var st=W(ot),ct={name:`arrow-down-up`,size:24,node:[[`path`,{d:`m3 16 4 4 4-4`,key:`1co6wj`}],[`path`,{d:`M7 20V4`,key:`1yoxec`}],[`path`,{d:`m21 8-4-4-4 4`,key:`1c9v7m`}],[`path`,{d:`M17 4v16`,key:`7dpous`}]]};ct.node;var lt=W(ct),ut={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};ut.node;var dt=W(ut),ft={name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]};ft.node;var pt=W(ft),mt={name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]};mt.node;var ht=W(mt),gt={name:`arrow-up-down`,size:24,node:[[`path`,{d:`m21 16-4 4-4-4`,key:`f6ql7i`}],[`path`,{d:`M17 20V4`,key:`1ejh1v`}],[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}]]};gt.node;var _t=W(gt),vt={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};vt.node;var yt=W(vt),bt={name:`calendar-plus`,size:24,node:[[`path`,{d:`M16 18h6`,key:`987eiv`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`path`,{d:`M19 15v6`,key:`10aioa`}],[`path`,{d:`M21 11.5V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h8.3`,key:`jgwkxf`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M8 2v3`,key:`1ioesn`}]]};bt.node;var xt=W(bt),St={name:`case-lower`,size:24,node:[[`path`,{d:`M10 9v7`,key:`ylp826`}],[`path`,{d:`M14 6v10`,key:`1jy4vg`}],[`circle`,{cx:`17.5`,cy:`12.5`,r:`3.5`,key:`1a9481`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`3.5`,key:`2jlv1r`}]]};St.node;var Ct=W(St),wt={name:`case-sensitive`,size:24,node:[[`path`,{d:`m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16`,key:`d5nyq2`}],[`path`,{d:`M22 9v7`,key:`pvm9v3`}],[`path`,{d:`M3.304 13h6.392`,key:`1q3zxz`}],[`circle`,{cx:`18.5`,cy:`12.5`,r:`3.5`,key:`z97x68`}]]};wt.node;var Tt=W(wt),Et={name:`case-upper`,size:24,node:[[`path`,{d:`M15 11h4.5a1 1 0 0 1 0 5h-4a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5h3a1 1 0 0 1 0 5`,key:`nxs35`}],[`path`,{d:`m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16`,key:`d5nyq2`}],[`path`,{d:`M3.304 13h6.392`,key:`1q3zxz`}]]};Et.node;var Dt=W(Et),Ot={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};Ot.node;var kt=W(Ot),At={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};At.node;var jt=W(At),Mt={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};Mt.node;var Nt=W(Mt),Pt={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]};Pt.node;var Ft=W(Pt),It={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};It.node;var Lt=W(It),Rt={name:`circle-question-mark`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`help-circle`,`circle-help`]};Rt.node;var zt=W(Rt),Bt={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};Bt.node;var Vt=W(Bt),Ht={name:`clipboard-paste`,size:24,node:[[`path`,{d:`M11 14h10`,key:`1w8e9d`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v1.344`,key:`1e62lh`}],[`path`,{d:`m17 18 4-4-4-4`,key:`z2g111`}],[`path`,{d:`M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 1.793-1.113`,key:`bjbb7m`}],[`rect`,{x:`8`,y:`2`,width:`8`,height:`4`,rx:`1`,key:`ublpy`}]]};Ht.node;var Ut=W(Ht),Wt={name:`clock`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]};Wt.node;var Gt=W(Wt),Kt={name:`columns-2`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]],aliases:[`columns`]};Kt.node;var qt=W(Kt),Jt={name:`command`,size:24,node:[[`path`,{d:`M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3`,key:`11bfej`}]]};Jt.node;var Yt=W(Jt),Xt={name:`copy-plus`,size:24,node:[[`line`,{x1:`15`,x2:`15`,y1:`12`,y2:`18`,key:`1p7wdc`}],[`line`,{x1:`12`,x2:`18`,y1:`15`,y2:`15`,key:`1nscbv`}],[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};Xt.node;var Zt=W(Xt),Qt={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};Qt.node;var $t=W(Qt),en={name:`eighth-notes`,size:24,node:[[`path`,{d:`M21 16V3a1 1 0 0 0-1.28-.96l-10 2.917a1 1 0 0 0-.72.96V19`,key:`uy6ho8`}],[`circle`,{cx:`18`,cy:`16`,r:`3`,key:`1hluhg`}],[`circle`,{cx:`6`,cy:`19`,r:`3`,key:`1kj8tv`}]],aliases:[`music`]};en.node;var tn=W(en),nn={name:`ellipsis`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]],aliases:[`more-horizontal`]};nn.node;var rn=W(nn),an={name:`eye-off`,size:24,node:[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};an.node;var on=W(an),sn={name:`eye`,size:24,node:[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};sn.node;var cn=W(sn),ln={name:`file-plus`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}]]};ln.node;var un=W(ln),dn={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]};dn.node;var fn=W(dn),pn={name:`fold-vertical`,size:24,node:[[`path`,{d:`M12 22v-6`,key:`6o8u61`}],[`path`,{d:`M12 8V2`,key:`1wkif3`}],[`path`,{d:`M4 12H2`,key:`rhcxmi`}],[`path`,{d:`M10 12H8`,key:`s88cx1`}],[`path`,{d:`M16 12h-2`,key:`10asgb`}],[`path`,{d:`M22 12h-2`,key:`14jgyd`}],[`path`,{d:`m15 19-3-3-3 3`,key:`e37ymu`}],[`path`,{d:`m15 5-3 3-3-3`,key:`19d6lf`}]]};pn.node;var mn=W(pn),hn={name:`folder-plus`,size:24,node:[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`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`,key:`1kt360`}]]};hn.node;var gn=W(hn),_n={name:`folder`,size:24,node:[[`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`,key:`1kt360`}]]};_n.node;var vn=W(_n),yn={name:`frame`,size:24,node:[[`line`,{x1:`22`,x2:`2`,y1:`6`,y2:`6`,key:`15w7dq`}],[`line`,{x1:`22`,x2:`2`,y1:`18`,y2:`18`,key:`1ip48p`}],[`line`,{x1:`6`,x2:`6`,y1:`2`,y2:`22`,key:`a2lnyx`}],[`line`,{x1:`18`,x2:`18`,y1:`2`,y2:`22`,key:`8vb6jd`}]]};yn.node;var bn=W(yn),xn={name:`git-compare-arrows`,size:24,node:[[`circle`,{cx:`5`,cy:`6`,r:`3`,key:`1qnov2`}],[`path`,{d:`M12 6h5a2 2 0 0 1 2 2v7`,key:`1yj91y`}],[`path`,{d:`m15 9-3-3 3-3`,key:`1lwv8l`}],[`circle`,{cx:`19`,cy:`18`,r:`3`,key:`1qljk2`}],[`path`,{d:`M12 18H7a2 2 0 0 1-2-2V9`,key:`16sdep`}],[`path`,{d:`m9 15 3 3-3 3`,key:`1m3kbl`}]]};xn.node;var Sn=W(xn),Cn={name:`hand`,size:24,node:[[`path`,{d:`M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2`,key:`1fvzgz`}],[`path`,{d:`M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2`,key:`1kc0my`}],[`path`,{d:`M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8`,key:`10h0bg`}],[`path`,{d:`M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15`,key:`1s1gnw`}]]};Cn.node;var wn=W(Cn),Tn={name:`house`,size:24,node:[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]],aliases:[`home`]};Tn.node;var En=W(Tn),Dn={name:`image`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]};Dn.node;var On=W(Dn),kn={name:`info`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]};kn.node;var An=W(kn),jn={name:`keyboard`,size:24,node:[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]};jn.node;var Mn=W(jn),Nn={name:`layout-grid`,size:24,node:[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]};Nn.node;var Pn=W(Nn),Fn={name:`letter-spacing`,size:24,node:[[`path`,{d:`M15 14H9`,key:`u4f7rb`}],[`path`,{d:`M21 3v18`,key:`fnf4zc`}],[`path`,{d:`M3 3v18`,key:`k760nc`}],[`path`,{d:`m8 16 3.453-7.648a.6.6 0 011.094.001L16 16`,key:`16ilm2`}]]};Fn.node;var In=W(Fn),Ln={name:`line-height`,size:24,node:[[`path`,{d:`M15 14H9`,key:`u4f7rb`}],[`path`,{d:`M21 21H3`,key:`oafrgs`}],[`path`,{d:`M21 3H3`,key:`e9iw4c`}],[`path`,{d:`m8 16 3.453-7.648a.6.6 0 011.094.001L16 16`,key:`16ilm2`}]]};Ln.node;var Rn=W(Ln),zn={name:`link-2`,size:24,node:[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]};zn.node;var Bn=W(zn),Vn={name:`list-chevrons-up-down`,size:24,node:[[`path`,{d:`M3 5h8`,key:`18g2rq`}],[`path`,{d:`M3 12h8`,key:`1xfjp6`}],[`path`,{d:`M3 19h8`,key:`fpbke4`}],[`path`,{d:`m15 8 3-3 3 3`,key:`bc4io6`}],[`path`,{d:`m15 16 3 3 3-3`,key:`9wmg1l`}]]};Vn.node;var Hn=W(Vn),Un={name:`list`,size:24,node:[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]};Un.node;var Wn=W(Un),Gn={name:`locate-off`,size:24,node:[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M12 2v3`,key:`qbqxhf`}],[`path`,{d:`M18.89 13.24a7 7 0 0 0-8.13-8.13`,key:`1v9jrh`}],[`path`,{d:`M19 12h3`,key:`osuazr`}],[`path`,{d:`M2 12h3`,key:`1wrr53`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M7.05 7.05a7 7 0 0 0 9.9 9.9`,key:`rc5l2e`}]]};Gn.node;var Kn=W(Gn),qn={name:`locate-fixed`,size:24,node:[[`line`,{x1:`2`,x2:`5`,y1:`12`,y2:`12`,key:`bvdh0s`}],[`line`,{x1:`19`,x2:`22`,y1:`12`,y2:`12`,key:`1tbv5k`}],[`line`,{x1:`12`,x2:`12`,y1:`2`,y2:`5`,key:`11lu5j`}],[`line`,{x1:`12`,x2:`12`,y1:`19`,y2:`22`,key:`x3vr5v`}],[`circle`,{cx:`12`,cy:`12`,r:`7`,key:`fim9np`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};qn.node;var Jn=W(qn),Yn={name:`lock-open`,size:24,node:[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 9.9-1`,key:`1mm8w8`}]],aliases:[`unlock`]};Yn.node;var Xn=W(Yn),Zn={name:`lock`,size:24,node:[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]};Zn.node;var Qn=W(Zn),$n={name:`maximize`,size:24,node:[[`path`,{d:`M8 3H5a2 2 0 0 0-2 2v3`,key:`1dcmit`}],[`path`,{d:`M21 8V5a2 2 0 0 0-2-2h-3`,key:`1e4gt3`}],[`path`,{d:`M3 16v3a2 2 0 0 0 2 2h3`,key:`wsl5sc`}],[`path`,{d:`M16 21h3a2 2 0 0 0 2-2v-3`,key:`18trek`}]]};$n.node;var er=W($n),tr={name:`message-square`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]};tr.node;var nr=W(tr),rr={name:`minus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]};rr.node;var ir=W(rr),ar={name:`monitor`,size:24,node:[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]};ar.node;var or=W(ar),sr={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};sr.node;var cr=W(sr),lr={name:`mouse-pointer-2`,size:24,node:[[`path`,{d:`M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z`,key:`edeuup`}]]};lr.node;var ur=W(lr),dr={name:`move-horizontal`,size:24,node:[[`path`,{d:`m18 8 4 4-4 4`,key:`1ak13k`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}]]};dr.node;var fr=W(dr),pr={name:`octagon-x`,size:24,node:[[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z`,key:`2d38gg`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-octagon`]};pr.node;var mr=W(pr),hr={name:`panel-left`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]],aliases:[`sidebar`]};hr.node;var gr=W(hr),_r={name:`panel-top`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]};_r.node;var vr=W(_r),yr={name:`pencil-line`,size:24,node:[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}],[`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`,key:`1a8usu`}]]};yr.node;var br=W(yr),xr={name:`pencil`,size:24,node:[[`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`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]};xr.node;var Sr=W(xr),Cr={name:`pin`,size:24,node:[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]};Cr.node;var wr=W(Cr),Tr={name:`pipette`,size:24,node:[[`path`,{d:`m12 9-8.414 8.414A2 2 0 0 0 3 18.828v1.344a2 2 0 0 1-.586 1.414A2 2 0 0 1 3.828 21h1.344a2 2 0 0 0 1.414-.586L15 12`,key:`1y3wsu`}],[`path`,{d:`m18 9 .4.4a1 1 0 1 1-3 3l-3.8-3.8a1 1 0 1 1 3-3l.4.4 3.4-3.4a1 1 0 1 1 3 3z`,key:`110lr1`}],[`path`,{d:`m2 22 .414-.414`,key:`jhxm08`}]]};Tr.node;var Er=W(Tr),Dr={name:`play`,size:24,node:[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]};Dr.node;var Or=W(Dr),kr={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};kr.node;var Ar=W(kr),jr={name:`presentation`,size:24,node:[[`path`,{d:`M2 3h20`,key:`91anmk`}],[`path`,{d:`M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3`,key:`2k9sn8`}],[`path`,{d:`m7 21 5-5 5 5`,key:`bip4we`}]]};jr.node;var Mr=W(jr),Nr={name:`redo-2`,size:24,node:[[`path`,{d:`m15 14 5-5-5-5`,key:`12vg1m`}],[`path`,{d:`M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13`,key:`6uklza`}]]};Nr.node;var Pr=W(Nr),Fr={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};Fr.node;var Ir=W(Fr),Lr={name:`rotate-cw`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]};Lr.node;var Rr=W(Lr),zr={name:`scan-eye`,size:24,node:[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`path`,{d:`M18.944 12.33a1 1 0 0 0 0-.66 7.5 7.5 0 0 0-13.888 0 1 1 0 0 0 0 .66 7.5 7.5 0 0 0 13.888 0`,key:`11ak4c`}]]};zr.node;var Br=W(zr),Vr={name:`scan-search`,size:24,node:[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`path`,{d:`m16 16-1.9-1.9`,key:`1dq9hf`}]]};Vr.node;var Hr=W(Vr),Ur={name:`scan`,size:24,node:[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}]]};Ur.node;var Wr=W(Ur),Gr={name:`scissors`,size:24,node:[[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M8.12 8.12 12 12`,key:`1alkpv`}],[`path`,{d:`M20 4 8.12 15.88`,key:`xgtan2`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M14.8 14.8 20 20`,key:`ptml3r`}]]};Gr.node;var Kr=W(Gr),qr={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};qr.node;var Jr=W(qr),Yr={name:`settings-2`,size:24,node:[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]};Yr.node;var Xr=W(Yr),Zr={name:`smartphone`,size:24,node:[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]};Zr.node;var Qr=W(Zr),$r={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]};$r.node;var ei=W($r),ti={name:`strikethrough`,size:24,node:[[`path`,{d:`M16 4H9a3 3 0 0 0-2.83 4`,key:`43sutm`}],[`path`,{d:`M14 12a4 4 0 0 1 0 8H6`,key:`nlfj13`}],[`line`,{x1:`4`,x2:`20`,y1:`12`,y2:`12`,key:`1e0a9i`}]]};ti.node;var ni=W(ti),ri={name:`sun-moon`,size:24,node:[[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M14.837 16.385a6 6 0 1 1-7.223-7.222c.624-.147.97.66.715 1.248a4 4 0 0 0 5.26 5.259c.589-.255 1.396.09 1.248.715`,key:`xlf6rm`}],[`path`,{d:`M16 12a4 4 0 0 0-4-4`,key:`6vsxu`}],[`path`,{d:`m19 5-1.256 1.256`,key:`1yg6a6`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}]]};ri.node;var ii=W(ri),ai={name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]};ai.node;var oi=W(ai),si={name:`tablet`,size:24,node:[[`rect`,{width:`16`,height:`20`,x:`4`,y:`2`,rx:`2`,ry:`2`,key:`76otgf`}],[`line`,{x1:`12`,x2:`12.01`,y1:`18`,y2:`18`,key:`1dp563`}]]};si.node;var ci=W(si),li={name:`text-align-center`,size:24,node:[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M17 12H7`,key:`16if0g`}],[`path`,{d:`M19 19H5`,key:`vjpgq2`}]],aliases:[`align-center`]};li.node;var ui=W(li),di={name:`text-align-end`,size:24,node:[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M21 19H7`,key:`4cu937`}]],aliases:[`align-right`]};di.node;var fi=W(di),pi={name:`text-align-justify`,size:24,node:[[`path`,{d:`M3 5h18`,key:`1u36vt`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`path`,{d:`M3 19h18`,key:`awlh7x`}]],aliases:[`align-justify`]};pi.node;var mi=W(pi),hi={name:`text-align-start`,size:24,node:[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M17 19H3`,key:`z6ezky`}]],aliases:[`text`,`align-left`]};hi.node;var gi=W(hi),_i={name:`text-wrap`,size:24,node:[[`path`,{d:`m16 16-3 3 3 3`,key:`117b85`}],[`path`,{d:`M3 12h14.5a1 1 0 0 1 0 7H13`,key:`18xa6z`}],[`path`,{d:`M3 19h6`,key:`1ygdsz`}],[`path`,{d:`M3 5h18`,key:`1u36vt`}]],aliases:[`wrap-text`]};_i.node;var vi=W(_i),yi={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};yi.node;var bi=W(yi),xi={name:`triangle-alert`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`]};xi.node;var Si=W(xi),Ci={name:`triangles-centerline-dashed-horizontal`,size:24,node:[[`path`,{d:`M10 12H8`,key:`s88cx1`}],[`path`,{d:`M16 12h-2`,key:`10asgb`}],[`path`,{d:`M22 12h-2`,key:`14jgyd`}],[`path`,{d:`M4 12H2`,key:`rhcxmi`}],[`path`,{d:`M7.298 20.288A1 1 0 008 22h8a1 1 0 00.703-1.712l-3.991-3.99a1 1 0 00-1.424-.001z`,key:`15ue1v`}],[`path`,{d:`M7.298 3.712A1 1 0 018 2h8a1 1 0 01.703 1.712l-3.991 3.99a1 1 0 01-1.424.001z`,key:`lzh03e`}]],aliases:[`flip-horizontal-2`]};Ci.node;var wi=W(Ci),Ti={name:`triangles-centerline-dashed-vertical`,size:24,node:[[`path`,{d:`M12 14v2`,key:`8jcxud`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 8v2`,key:`1woqiv`}],[`path`,{d:`M20.288 16.703A1 1 0 0022 16V8a1 1 0 00-1.712-.703l-3.99 3.991a1 1 0 00-.001 1.424z`,key:`1ewq2t`}],[`path`,{d:`M3.712 16.703A1 1 0 012 16V8a1 1 0 011.712-.703l3.99 3.991a1 1 0 01.001 1.424z`,key:`1c1klx`}]],aliases:[`flip-vertical-2`]};Ti.node;var Ei=W(Ti),Di={name:`type`,size:24,node:[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]};Di.node;var Oi=W(Di),ki={name:`underline`,size:24,node:[[`path`,{d:`M6 4v6a6 6 0 0 0 12 0V4`,key:`9kb039`}],[`line`,{x1:`4`,x2:`20`,y1:`20`,y2:`20`,key:`nun2al`}]]};ki.node;var Ai=W(ki),ji={name:`undo-2`,size:24,node:[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]};ji.node;var Mi=W(ji),Ni={name:`user-round`,size:24,node:[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]],aliases:[`user-2`]};Ni.node;var Pi=W(Ni),Fi={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};Fi.node;var Ii=W(Fi),Li={name:`zoom-in`,size:24,node:[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`11`,x2:`11`,y1:`8`,y2:`14`,key:`1vmskp`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]};Li.node;var Ri=W(Li),zi={name:`zoom-out`,size:24,node:[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]};zi.node;var Bi=W(zi);function Vi(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 Hi=o((e=>{var t=u();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 d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),Ui=o(((e,t)=>{t.exports=Hi()})),Wi=Ui(),Gi=_.useInsertionEffect,Ki=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?_.useLayoutEffect:_.useEffect,qi=Gi||Ki,Ji=e=>{let t=_.useRef([e,(...e)=>t[0](...e)]).current;return qi(()=>{t[0]=e}),t[1]},Yi=[`popstate`,`pushState`,`replaceState`,`hashchange`],Xi=[],Zi=()=>Xi.forEach(e=>e()),Qi=e=>(Xi.push(e)===1&&Yi.forEach(e=>addEventListener(e,Zi)),()=>{Xi=Xi.filter(t=>t!==e),Xi.length||Yi.forEach(e=>removeEventListener(e,Zi))}),$i=(e,t)=>(0,Wi.useSyncExternalStore)(Qi,e,t),ea=()=>location.search,ta=({ssrSearch:e}={})=>$i(ea,e==null?ea:()=>e),na=()=>location.pathname,ra=({ssrPath:e}={})=>$i(na,e==null?na:()=>e),ia=(e,{replace:t=!1,state:n=null}={})=>history[t?`replaceState`:`pushState`](n,``,e),aa=e=>[ra(e),ia],oa=Symbol.for(`wouter_v3`);if(typeof history<`u`&&window[oa]===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,oa,{value:!0})}var sa=(e=``)=>e===`/`?``:e,ca=(e,t)=>e[0]===`~`?e.slice(1):sa(t)+e,la=(e,t)=>(e=ua(sa(e)),t=ua(t),!e||(t.toLowerCase()+`/`).startsWith(e.toLowerCase()+`/`)?t.slice(e.length)||`/`:`~`+t),ua=e=>{try{return e.includes(`%`)?decodeURI(e):e}catch{return e}},da={hook:aa,searchHook:ta,parser:Vi,base:``,ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:e=>e,aroundNav:(e,t,n)=>e(t,n)},fa=(0,_.createContext)(da),pa=()=>(0,_.useContext)(fa),ma={},ha=(0,_.createContext)(ma),ga=()=>(0,_.useContext)(ha),_a=(e,t=e.base)=>la(t,e.hook(e)[0]),va=e=>{let[t,n]=e.hook(e);return[la(e.base,t),Ji((t,r)=>e.aroundNav(n,ca(t,e.base),r))]},ya=()=>va(pa()),ba=(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]},xa=e=>{let t=pa(),n=/^~\//.test(e);return ba(t.parser,n?e.slice(1):e,_a(t,n?``:t.base))},Sa=({children:e,...t})=>{let n=pa(),r=t.hook?da: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,_.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,_.createElement)(fa.Provider,{value:i},e)},Ca=({children:e,component:t},n)=>t?(0,_.createElement)(t,{params:n}):typeof e==`function`?e(n):e,wa=e=>{let t=(0,_.useRef)(ma),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},Ta=({path:e,nest:t,match:n,...r})=>{let i=pa(),a=_a(i),[o,s,c]=n??ba(i.parser,e,a,t),l=wa({...ga(),...s});if(!o)return null;let u=Ca(r,l);return(0,_.createElement)(ha.Provider,{value:l},c?(0,_.createElement)(Sa,{base:c},u):u)},Ea=(0,_.forwardRef)((e,t)=>{let n=pa(),[r,i]=va(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=Ji(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,_.isValidElement)(l)?(0,_.cloneElement)(l,m):(0,_.createElement)(`a`,m,l)}),Da=(e,t=[])=>{if(Array.isArray(e))for(let n of e)Da(n&&n.type===_.Fragment?n.props.children:n,t);else t.push(e);return t},Oa=({children:e,location:t})=>{let n=pa(),r=_a(n);for(let i of Da(e)){let e=0;if((0,_.isValidElement)(i)&&(e=ba(n.parser,i.props.path,t||r,i.props.nest))[0])return(0,_.cloneElement)(i,{match:e})}return null},ka=e=>{let{to:t,href:n=t}=e,r=pa(),[,i]=va(r),a=Ji(()=>i(t||n,e)),{ssrContext:o}=r;return Ki(()=>{a()},[]),o&&(o.redirectTo=t),null};function Aa(){}var ja=Object.freeze([]),Ma=Object.freeze({});function Na(e){_.useEffect(e,ja)}var Pa={};function Fa(e,t){let n=_.useRef(Pa);return n.current===Pa&&(n.current=e(t)),n}var G=typeof document<`u`?_.useLayoutEffect:()=>{};function Ia(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var La=Ia(`https://base-ui.com/production-error`,`Base UI`),Ra=_.createContext(void 0);function za(){let e=_.useContext(Ra);if(!e)throw Error(La(73));return e}var Ba=o((e=>{var t=u(),n=Ui();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),Va=o(((e,t)=>{t.exports=Ba()})),Ha=19;function Ua(e){return Ha>=e}var Wa=[],Ga=void 0;function Ka(){return Ga}function qa(e){Wa.push(e)}function Ja(e){let t=(t,n)=>{let r=Fa(Xa).current,i;try{Ga=r;for(let e of Wa)e.before(r);i=e(t,n);for(let e of Wa)e.after(r);r.didInitialize=!0}finally{Ga=void 0}return i};return t.displayName=e.displayName||e.name,t}function Ya(e){return _.forwardRef(Ja(e))}function Xa(){return{didInitialize:!1}}var Za=Va(),Qa=Ua(19)?to:no;function $a(e,t,n,r,i){return Qa(e,t,n,r,i)}function eo(e,t,n,r,i){let a=_.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,Wi.useSyncExternalStore)(e.subscribe,a,a)}qa({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,Wi.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function to(e,t,n,r,i){let a=Ka();if(!a)return eo(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],s.store===e&&s.selector===t&&Object.is(s.a1,n)&&Object.is(s.a2,r)&&Object.is(s.a3,i)||(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function no(e,t,n,r,i){return(0,Za.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var ro=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return $a(this,e,t,n,r)}},io={..._},ao=io.useInsertionEffect,oo=ao&&ao!==io.useLayoutEffect?ao:e=>e();function K(e){let t=Fa(so).current;return t.next=e,oo(t.effect),t.trampoline}function so(){let e={next:void 0,callback:co,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function co(){}var lo=class extends ro{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){_.useDebugValue(e);let n=this;G(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;G(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;G(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){_.useDebugValue(e);let n=this,r=t!==void 0;G(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return _.useDebugValue(e),$a(this,this.selectors[e],t,n,r)}useContextCallback(e,t){_.useDebugValue(e);let n=K(t??Aa);this.context[e]=n}useStateSetter(e){let t=_.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}};function uo(){return typeof window<`u`}function fo(e){return ho(e)?(e.nodeName||``).toLowerCase():`#document`}function po(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function mo(e){return((ho(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function ho(e){return uo()?e instanceof Node||e instanceof po(e).Node:!1}function go(e){return uo()?e instanceof Element||e instanceof po(e).Element:!1}function _o(e){return uo()?e instanceof HTMLElement||e instanceof po(e).HTMLElement:!1}function vo(e){return!uo()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof po(e).ShadowRoot}function yo(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Ao(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function bo(e){return/^(table|td|th)$/.test(fo(e))}function xo(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var So=/transform|translate|scale|rotate|perspective|filter/,Co=/paint|layout|strict|content/,wo=e=>!!e&&e!==`none`,To;function Eo(e){let t=go(e)?Ao(e):e;return wo(t.transform)||wo(t.translate)||wo(t.scale)||wo(t.rotate)||wo(t.perspective)||!Oo()&&(wo(t.backdropFilter)||wo(t.filter))||So.test(t.willChange||``)||Co.test(t.contain||``)}function Do(e){let t=Mo(e);for(;_o(t)&&!ko(t);){if(Eo(t))return t;if(xo(t))return null;t=Mo(t)}return null}function Oo(){return To??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),To}function ko(e){return/^(html|body|#document)$/.test(fo(e))}function Ao(e){return po(e).getComputedStyle(e)}function jo(e){return go(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Mo(e){if(fo(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||vo(e)&&e.host||mo(e);return vo(t)?t.host:t}function No(e){let t=Mo(e);return ko(t)?(e.ownerDocument||e).body:_o(t)&&yo(t)?t:No(t)}function Po(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=No(e),i=r===e.ownerDocument?.body,a=po(r);if(i){let e=Fo(a);return t.concat(a,a.visualViewport||[],yo(r)?r:[],e&&n?Po(e):[])}return t.concat(r,Po(r,[],n))}function Fo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Io(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function q(e){return e?.ownerDocument||document}function J(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Lo(){let[,e]=_.useState({});return _.useCallback(()=>{e({})},[])}var Ro=null;globalThis.requestAnimationFrame;var zo=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}},Bo=class e{static create(){return new e}static request(e){return zo.request(e)}static cancel(e){return zo.cancel(e)}currentId=Ro;request(e){this.cancel(),this.currentId=zo.request(()=>{this.currentId=Ro,e()})}cancel=()=>{this.currentId!==Ro&&(zo.cancel(this.currentId),this.currentId=Ro)};disposeEffect=()=>this.cancel};function Vo(){let e=Fa(Bo.create).current;return Na(e.disposeEffect),e}var Ho=0,Uo=class e{static create(){return new e}currentId=Ho;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Ho,t()},e)}isStarted(){return this.currentId!==Ho}clear=()=>{this.currentId!==Ho&&(clearTimeout(this.currentId),this.currentId=Ho)};disposeEffect=()=>this.clear};function Wo(){let e=Fa(Uo.create).current;return Na(e.disposeEffect),e}var Go=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})),Ko=o(((e,t)=>{t.exports=Go()})),qo=0;function Jo(e){return qo+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${qo}`}function Yo(e,t){if(typeof e==`string`)return{description:e};if(typeof e==`function`){let n=e(t);return typeof n==`string`?{description:n}:n}return e}function Xo(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:Zo,platform:Qo,maxTouchPoints:$o}=Xo(),es=Zo.toLowerCase(),ts=Qo.toLowerCase(),ns=/^i(os$|p)/.test(ts)||ts===`macintel`&&$o>1,rs=`android`,is=ts===rs||es.includes(rs),as=!ns&&ts.startsWith(`mac`);ts.startsWith(`win`),!is&&/^(linux|chrome os)/.test(ts);var os=as||ns,ss=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`),cs=!ss&&es.includes(`firefox`);!ss&&es.includes(`chrom`);var ls=os,us=/jsdom|happydom/.test(es);function ds(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Y(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&vo(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function fs(e,t){let n=e;for(;n;){if(go(n)&&n.matches(t))return n;n=n.assignedSlot??n.parentNode??(vo(n)?n.host:null)}return null}function ps(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var ms=`data-base-ui-focusable`,hs=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,gs=`ArrowLeft`,_s=`ArrowRight`,vs=`ArrowUp`,ys=`ArrowDown`,bs=`data-starting-style`,xs=`data-ending-style`,Ss={[bs]:``},Cs={[xs]:``},ws={transitionStatus(e){return e===`starting`?Ss:e===`ending`?Cs:null}},Ts=`data-open`,Es=`data-closed`,Ds=`data-anchor-hidden`,Os=`data-popup-open`,ks=`data-pressed`,As={[Os]:``},js={[Os]:``,[ks]:``},Ms={[Ts]:``},Ns={[Es]:``},Ps={[Ds]:``},Fs={open(e){return e?As:null}},Is={open(e){return e?js:null}},Ls={open(e){return e?Ms:Ns},anchorHidden(e){return e?Ps:null}},Rs={...Ls,...ws},zs=`data-trigger-disabled`;function Bs(e,t){if(!go(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(zs);for(let[,e]of t.entries())if(Y(e,n))return!e.hasAttribute(zs);return!1}function Vs(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function Hs(e){return e.matches(`html,body`)}function Us(e){return _o(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function Ws(e){return fs(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${hs}`)!=null}function Gs(e){return e?e.getAttribute(`role`)===`combobox`&&Us(e):!1}function Ks(e){if(!e||us)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function qs(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function Js(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...Js(e,t.id,n)])}function Ys(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function Xs(e){e.preventDefault(),e.stopPropagation()}function Zs(e){return`nativeEvent`in e}function Qs(e){return e.pointerType===``&&e.isTrusted?!0:is&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function $s(e){return us?!1:!is&&e.width===0&&e.height===0||e.type===`pointerdown`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`&&(is||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function ec(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function tc(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var nc=Math.min,rc=Math.max,ic=Math.round,ac=Math.floor,oc=e=>({x:e,y:e}),sc={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function cc(e,t,n){return rc(e,nc(t,n))}function lc(e,t){return typeof e==`function`?e(t):e}function uc(e){return e.split(`-`)[0]}function dc(e){return e.split(`-`)[1]}function fc(e){return e===`x`?`y`:`x`}function pc(e){return e===`y`?`height`:`width`}function mc(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function hc(e){return fc(mc(e))}function gc(e,t,n){n===void 0&&(n=!1);let r=dc(e),i=hc(e),a=pc(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Tc(o)),[o,Tc(o)]}function _c(e){let t=Tc(e);return[vc(e),t,vc(t)]}function vc(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var yc=[`left`,`right`],bc=[`right`,`left`],xc=[`top`,`bottom`],Sc=[`bottom`,`top`];function Cc(e,t,n){switch(e){case`top`:case`bottom`:return n?t?bc:yc:t?yc:bc;case`left`:case`right`:return t?xc:Sc;default:return[]}}function wc(e,t,n,r){let i=dc(e),a=Cc(uc(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(vc)))),a}function Tc(e){let t=uc(e);return sc[t]+e.slice(t.length)}function Ec(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Dc(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Ec(e)}function Oc(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 kc(e,t){return t<0||t>=e.length}function Ac(e,t){return Nc(e.current,{disabledIndices:t})}function jc(e,t){return Nc(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Mc(e,t,n){let{decrement:r,loopFocus:i,allowEscape:a,disabledIndices:o,minIndex:s,maxIndex:c}=n,l=()=>Nc(e,{startingIndex:t,decrement:r,disabledIndices:o}),u,d=!1;if(!i)u=r?Math.max(s,l()):Math.min(c,l());else if(r?t<=s:t>=c){let n=r?-1:e.length;a&&t!==n?u=-1:(u=r?c:s,d=!0)}else u=l();return{index:kc(e,u)?-1:u,wrapped:d}}function Nc(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&Pc(e,a,r));return a}function Pc(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!Ic(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function Fc(e){return e.visibility===`hidden`||e.visibility===`collapse`}function Ic(e,t=e?Ao(e):null){return!e||!e.isConnected||!t||Fc(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var Lc=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function Rc(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return vo(n)?n.host:null}function zc(e){for(let t of Array.from(e.children))if(fo(t)===`summary`)return t;return null}function Bc(e,t){let n=zc(t);return!!n&&(e===n||Y(n,e))}function Vc(e){let t=e?fo(e):``;return e!=null&&e.matches(Lc)&&(t!==`summary`||e.parentElement!=null&&fo(e.parentElement)===`details`&&zc(e.parentElement)===e)&&(t!==`details`||zc(e)==null)&&(t!==`input`||e.type!==`hidden`)}function Hc(e){if(!Vc(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=Rc(t)){let n=t!==e,r=fo(t)===`slot`;if(t.hasAttribute(`inert`)||n&&fo(t)===`details`&&!t.open&&!Bc(e,t)||t.hasAttribute(`hidden`)||!r&&!Uc(t,n))return!1}return!0}function Uc(e,t){let n=Ao(e);return t?n.display!==`none`:Ic(e,n)}function Wc(e){let t=e.tabIndex;if(t<0){let t=fo(e);if(t===`details`||t===`audio`||t===`video`||_o(e)&&e.isContentEditable)return 0}return t}function Gc(e){if(fo(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function Kc(e,t){let n=Gc(e);if(!n)return!0;let r=t.find(e=>{let t=Gc(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=Gc(e);return t?.name===n.name&&t.form===n.form})===n}function qc(e){if(_o(e)&&fo(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return _o(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function Jc(e,t){qc(e).forEach(e=>{Vc(e)&&t.push(e),Jc(e,t)})}function Yc(e,t,n){qc(e).forEach(e=>{_o(e)&&e.matches(t)&&n.push(e),Yc(e,t,n)})}function Xc(e){return Hc(e)&&Wc(e)>=0}function Zc(e){let t=[];return Jc(e,t),t.filter(Hc)}function Qc(e){let t=Zc(e);return t.filter(e=>Wc(e)>=0&&Kc(e,t))}function $c(e,t){let n=Qc(e),r=n.length;if(r===0)return;let i=ds(q(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function el(e){return $c(q(e).body,1)||e}function tl(e){return $c(q(e).body,-1)||e}function nl(e,t,n){if(!e)return null;let r=[];Jc(q(e).body,r);let i=r.indexOf(e);if(i===-1)return null;let a=r.filter(Hc);for(let e=1;e<r.length;e+=1){let o=r[(i+t*e+r.length)%r.length];if(!Y(n,o)&&Xc(o)&&Kc(o,a))return o}return r[i]}function rl(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!Y(n,r)}function il(e){Qc(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function al(e){let t=[];Yc(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function ol(e){let t=new Map,n=0,r=0;return e.forEach((e,i)=>{let a=e.transitionStatus===`ending`;t.set(e.id,{value:e,domIndex:i,visibleIndex:a?-1:n,offsetY:r}),r+=e.height||0,a||(n+=1)}),t}function sl(e,t){let n=0;return e.map(e=>{if(e.transitionStatus===`ending`)return e;let r=n>=t;return n+=1,e.limited===r?e:{...e,limited:r}})}var cl={toasts:e=>e.toasts,isEmpty:e=>e.toasts.length===0,toast:(e,t)=>e.toastMetadata.get(t)?.value,toastIndex:(e,t)=>e.toastMetadata.get(t)?.domIndex??-1,toastOffsetY:(e,t)=>e.toastMetadata.get(t)?.offsetY??0,toastVisibleIndex:(e,t)=>e.toastMetadata.get(t)?.visibleIndex??-1,focused:e=>e.focused,expanded:e=>e.hovering||e.focused,expandedOrOutOfFocus:e=>e.hovering||e.focused||!e.isWindowFocused,prevFocusElement:e=>e.prevFocusElement},ll=class extends lo{timers=new Map;areTimersPaused=!1;constructor(e){super({...e,toastMetadata:ol(e.toasts)},{},cl)}setViewport=e=>{this.set(`viewport`,e)};syncProviderProps(e,t){let n=this.state.limit!==t;if(this.state.timeout===e&&!n)return;let r={timeout:e,limit:t};if(n){let e=sl(this.state.toasts,t);r.toasts=e,r.toastMetadata=ol(e)}this.update(r)}disposeEffect=()=>()=>{this.timers.forEach(e=>{e.timeout?.clear()}),this.timers.clear()};removeToast(e,t=!1){let n=cl.toastIndex(this.state,e);if(n===-1)return;let r=this.state.toasts[n];t||r?.onRemove?.();let i=[...this.state.toasts];i.splice(n,1),this.setToasts(i)}addToast=e=>{let{timeout:t,limit:n}=this.state,r=e.id||Jo(`toast`);if(e.id){let t=cl.toast(this.state,e.id);if(t){if(t.transitionStatus===`ending`)this.removeToast(e.id,!0);else{let{id:t,transitionStatus:n,...r}=e;return this.updateToastInternal(e.id,r,!0,!0),e.id}}}let i={...e,id:r,updateKey:0,transitionStatus:`starting`},a=[i,...this.state.toasts];this.setToasts(sl(a,n));let o=i.timeout??t;return i.type!==`loading`&&o>0&&this.scheduleTimer(r,o,()=>this.closeToast(r)),cl.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),r};updateToast=(e,t)=>{let n=cl.toast(this.state,e);n&&n.transitionStatus!==`ending`&&this.updateToastInternal(e,typeof t==`function`?t(n):t,!1,!0)};updateToastInternal=(e,t,n=!1,r=!1)=>{let{timeout:i,toasts:a}=this.state,o=cl.toast(this.state,e);if(!o||o.transitionStatus===`ending`)return;let s={...o,...t,...r&&{updateKey:o.updateKey+1}};this.setToasts(a.map(t=>t.id===e?s:t));let c=s.timeout??i,l=o.timeout??i,u=Object.hasOwn(t,`timeout`),d=s.transitionStatus!==`ending`&&s.type!==`loading`&&c>0,f=this.timers.has(e),p=l!==c,m=o.type===`loading`;!d&&f?this.clearTimer(e):d&&(!f||p||u||m||n)&&(this.clearTimer(e),this.scheduleTimer(e,c,()=>this.closeToast(e)),cl.expandedOrOutOfFocus(this.state)&&this.pauseTimers())};closeToast=e=>{let t=e===void 0,{limit:n,toasts:r}=this.state,i;if(t)i=r,this.clearTimers();else{let t=cl.toast(this.state,e);if(!t)return;i=[t],this.clearTimer(e)}let a=sl(r.map(n=>t||n.id===e?{...n,transitionStatus:`ending`,height:0}:n),n);this.setToasts(a,!a.some(e=>e.transitionStatus!==`ending`)),i.forEach(e=>{e.transitionStatus!==`ending`&&e.onClose?.()}),this.handleFocusManagement(e)};promiseToast=(e,t)=>{let n=Yo(t.loading),r=this.addToast({...n,type:`loading`}),i=e.then(e=>{let n=Yo(t.success,e);return this.updateToast(r,{...n,type:`success`,timeout:n.timeout}),e}).catch(e=>{let n=Yo(t.error,e);return this.updateToast(r,{...n,type:`error`,timeout:n.timeout}),Promise.reject(e)});return{}.hasOwnProperty.call(t,`setPromise`)&&t.setPromise(i),i};pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(e=>{e.timeout&&(e.timeout.clear(),e.remaining=Math.max(e.remaining-(Date.now()-e.start),0))}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((e,t)=>{e.remaining=e.remaining>0?e.remaining:e.delay,e.timeout??=Uo.create(),e.timeout.start(e.remaining,()=>{this.handleTimerFired(t),e.callback()}),e.start=Date.now()}))}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=e=>{if(e.pointerType!==`touch`)return;let t=ps(e);Y(this.state.viewport,t)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))};scheduleTimer(e,t,n){let r=Date.now(),i=cl.expandedOrOutOfFocus(this.state)?void 0:Uo.create();i?.start(t,()=>{this.handleTimerFired(e),n()}),this.timers.set(e,{timeout:i,start:r,delay:t,remaining:t,callback:n})}clearTimers(){this.timers.forEach(e=>{e.timeout?.clear()}),this.timers.clear(),this.areTimersPaused=!1}clearTimer(e){this.timers.get(e)?.timeout?.clear(),this.timers.delete(e),this.resetPausedStateIfNoTimersRemain()}handleTimerFired(e){this.timers.delete(e),this.resetPausedStateIfNoTimersRemain()}resetPausedStateIfNoTimersRemain(){this.timers.size===0&&(this.areTimersPaused=!1)}setToasts(e,t=e.length===0){let n={toasts:e,toastMetadata:ol(e)};t&&(n.hovering=!1,n.focused=!1),this.update(n)}handleFocusManagement(e){let t=ds(q(this.state.viewport));if(!this.state.viewport||!Y(this.state.viewport,t)||!Ks(t))return;if(e===void 0){this.restoreFocusToPrevElement();return}let n=cl.toasts(this.state),r=cl.toastIndex(this.state,e),i=(e,t)=>{for(let r=e;r>=0&&r<n.length;r+=t)if(n[r].transitionStatus!==`ending`)return n[r];return null},a=i(r+1,1)??i(r-1,-1);a?a.ref?.current?.focus():this.restoreFocusToPrevElement()}},X=Ko(),ul=function(e){let{children:t,timeout:n=5e3,limit:r=3,toastManager:i}=e,a=Fa(()=>new ll({timeout:n,limit:r,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return Na(a.disposeEffect),_.useEffect(function(){if(i)return i[` subscribe`](({action:e,options:t})=>{let n=t.id;e===`promise`&&t.promise?a.promiseToast(t.promise,t):e===`update`&&n?a.updateToast(n,t.updates):e===`close`?a.closeToast(n):a.addToast(t)})},[a,i]),(0,X.jsxs)(Ra.Provider,{value:a,children:[(0,X.jsx)(dl,{store:a,timeout:n,limit:r}),t]})};function dl(e){let{store:t,timeout:n,limit:r}=e;return G(()=>{t.syncProviderProps(n,r)},[t,n,r]),null}var fl={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},pl={...fl,position:`fixed`,margin:0,top:0,left:0},ml={...fl,position:`absolute`},hl=_.forwardRef(function(e,t){let[n,r]=_.useState();G(()=>{ls&&ss&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,X.jsx)(`span`,{...e,ref:t,style:pl,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})});function gl(e,t,n,r){let i=Fa(vl).current;return yl(i,e,t,n,r)&&xl(i,[e,t,n,r]),i.callback}function _l(e){let t=Fa(vl).current;return bl(t,e)&&xl(t,e),t.callback}function vl(){return{callback:null,cleanup:null,refs:[]}}function yl(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function bl(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function xl(e,t){e.refs=t,e.callback=t.every(e=>e==null)?null:n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}function Sl(e){if(!_.isValidElement(e))return null;let t=e,n=t.props;return(Ua(19)?n?.ref:t.ref)??null}function Cl(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function wl(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e)}else i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function Tl(e,t){return typeof e==`function`?e(t):e}function El(e,t){return typeof e==`function`?e(t):e}var Dl={};function Ol(e,t,n,r,i){if(!n&&!r&&!i&&!e)return Al(t);let a=Al(e);return t&&(a=jl(a,t)),n&&(a=jl(a,n)),r&&(a=jl(a,r)),i&&(a=jl(a,i)),a}function kl(e){if(e.length===0)return Dl;if(e.length===1)return Al(e[0]);let t=Al(e[0]);for(let n=1;n<e.length;n+=1)t=jl(t,e[n]);return t}function Al(e){return Fl(e)?{...e(Dl)}:Ml(e)}function jl(e,t){return Fl(t)?t(e):Nl(e,t)}function Ml(e){let t={...e};for(let e in t){let n=t[e];Pl(e,n)&&(t[e]=Ll(n))}return t}function Nl(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=Cl(e.style,r);break;case`className`:e[n]=zl(e.className,r);break;default:e[n]=Pl(n,r)?Il(e[n],r):r}}return e}function Pl(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function Fl(e){return typeof e==`function`}function Il(e,t){return t?e?(...n)=>{let r=n[0];if(Bl(r)){let i=r;Rl(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:Ll(t):e}function Ll(e){return e&&((...t)=>{let n=t[0];return Bl(n)&&Rl(n),e(...t)})}function Rl(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function zl(e,t){return t?e?t+` `+e:t:e}function Bl(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function Vl(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=Gl(r));let i=Hl(t,n,r);if(n.enabled===!1)return null;let a=n.state??Ma;return Kl(e,r,i,a)}function Hl(e,t,n){let{className:r,style:i}=e,{state:a=Ma,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?Tl(r,a):void 0,d=l?El(i,a):void 0,f=l?wl(a,c):Ma,p=l&&s?Ul(s):void 0,m=l?Cl(f,p)??{}:Ma;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?_l([m.ref,Sl(n),...o]):gl(m.ref,Sl(n),o):gl(null,null)),l?(u!==void 0&&(m.className=zl(m.className,u)),d!==void 0&&(m.style=Cl(m.style,d)),m):Ma}function Ul(e){return Array.isArray(e)?kl(e):Ol(void 0,e)}var Wl=Symbol.for(`react.lazy`);function Gl(e){if(e?.$$typeof!==Wl)return e;let t=_.Children.toArray(e)[0];return _.isValidElement(t)?t:e}function Kl(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=Ol(n,t.props);return e.ref=n.ref,_.cloneElement(t,e)}return ql(e,n)}function ql(e,t){return e===`button`?(0,_.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,_.createElement)(`img`,{alt:``,...t,key:t.key}):_.createElement(e,t)}var Jl=`--toast-frontmost-height`,Yl=_.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,s=za(),c=Wo(),l=_.useRef(!1),u=_.useRef(!1),d=_.useRef(!1),f=s.useState(`isEmpty`),p=s.useState(`toasts`),m=s.useState(`focused`),h=s.useState(`expanded`),g=s.useState(`prevFocusElement`),v=p[0]?.height,y=p.some(e=>e.transitionStatus===`ending`),b=p.filter(e=>e.priority===`high`);_.useEffect(()=>{let e=s.state.viewport;if(!e||f)return;let t=po(e),n=q(e);function r(t){t.key===`F6`&&ps(t)!==e&&(t.preventDefault(),s.set(`prevFocusElement`,ds(n)),e?.focus({preventScroll:!0}),s.pauseTimers(),s.set(`focused`,!0))}function i(e){ps(e)===t&&(s.set(`isWindowFocused`,!1),s.pauseTimers())}function a(n){if(n.relatedTarget)return;let r=ps(n),i=ds(q(e));r!==t&&Y(e,r)&&Ks(i)||s.resumeTimers(),c.start(0,()=>s.set(`isWindowFocused`,!0))}return Io(J(t,`keydown`,r),J(t,`blur`,i,!0),J(t,`focus`,a,!0),J(n,`pointerdown`,s.handleDocumentPointerDown,!0))},[s,c,f]);function x(e){l.current=!0;let t=e.relatedTarget===s.state.viewport?p.find(e=>e.transitionStatus!==`ending`&&!e.limited):void 0;t?t.ref?.current?.focus():s.restoreFocusToPrevElement()}function S(e){e.key===`Tab`&&e.shiftKey&&ps(e.nativeEvent)===s.state.viewport&&(e.preventDefault(),s.restoreFocusToPrevElement())}function C(){s.state.toasts.some(e=>e.transitionStatus===`ending`)||d.current||!u.current||(s.set(`hovering`,!1),s.select(`expandedOrOutOfFocus`)||s.resumeTimers(),u.current=!1)}_.useEffect(C,[y,s]);function w(){s.pauseTimers(),s.set(`hovering`,!0),u.current=!1}function T(){u.current=!0,C()}function E(e){e.pointerType===`touch`&&(d.current=!0)}function D(e){e.pointerType===`touch`&&(d.current=!1,C())}function O(){l.current?l.current=!1:m||Ks(ds(q(s.state.viewport)))&&(s.set(`focused`,!0),s.pauseTimers())}function k(e){m&&!Y(s.state.viewport,e.relatedTarget)&&(s.set(`focused`,!1),s.select(`expandedOrOutOfFocus`)||s.resumeTimers())}let A={tabIndex:-1,role:`region`,"aria-live":`polite`,"aria-atomic":!1,"aria-relevant":`additions text`,"aria-label":`Notifications`,onMouseEnter:w,onMouseMove:w,onMouseLeave:T,onFocus:O,onBlur:k,onKeyDown:S,onClick:O,onPointerDown:E,onPointerUp:D,onPointerCancel:D,style:{[Jl]:v?`${v}px`:void 0}},j={expanded:h},M=!f&&g&&(0,X.jsx)(hl,{onFocus:x}),N=Vl(`div`,e,{ref:[t,s.setViewport],state:j,props:[A,o,{children:(0,X.jsxs)(_.Fragment,{children:[M,a,M]})}]});return(0,X.jsxs)(_.Fragment,{children:[M,N,!m&&b.length>0&&(0,X.jsx)(`div`,{style:pl,children:b.map(e=>(0,X.jsxs)(`div`,{role:`alert`,"aria-atomic":!0,children:[(0,X.jsx)(`div`,{children:e.title}),(0,X.jsx)(`div`,{children:e.description})]},e.id))})]})});function Xl(e){return Ua(19)?e:e?`true`:void 0}var Zl=_.createContext(void 0);function Ql(){let e=_.useContext(Zl);if(!e)throw Error(La(66));return e}function $l(e){return e==null?e:`current`in e?e.current:e}function eu(e,t){return e.getAnimations(t).filter(e=>{let t=e.effect?.getTiming();return t?.duration!==1/0&&t?.iterations!==1/0})}var tu=c(m(),1),nu=null;function ru(e){if(!nu){let e=[];nu=e,queueMicrotask(()=>{nu=null,tu.flushSync(()=>{for(let t of e)t()})})}nu.push(e)}function iu(e,t=!1,n=!1){let r=Vo();return K((i,a=null)=>{r.cancel();let o=$l(e);if(o==null)return;let s=o,c=()=>{n?ru(()=>{a?.aborted||i()}):tu.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(eu(s).map(e=>e.finished.then(Aa))).then(()=>{a?.aborted||c()},()=>{a?.aborted||(eu(s).some(e=>e.pending||e.playState!==`finished`)?l():c())})}if(t){let e=bs;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0})}else r.request(l)})}function au(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=K(a),s=iu(r,n,i);_.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}var ou={style:{transition:`none`}},su=`data-base-ui-click-trigger`,cu=`data-base-ui-swipe-ignore`,lu=`data-swipe-ignore`,uu=`[${cu}]`,du=`[${lu}]`,fu={fallbackAxisSide:`none`},pu={fallbackAxisSide:`end`},mu={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0};function hu(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function gu(e,t){let n=(t??po(e).getComputedStyle(e)).transform,r=0,i=0,a=1;if(n&&n!==`none`){let e=n.match(/matrix(?:3d)?\(([^)]+)\)/);if(e){let t=e[1].split(`, `).map(parseFloat);t.length===6?(r=t[4],i=t[5],a=Math.sqrt(t[0]*t[0]+t[1]*t[1])):t.length===16&&(r=t[12],i=t[13],a=t[0])}}return{x:r,y:i,scale:a}}function _u(e,t,n){switch(e){case`up`:return-n;case`down`:return n;case`left`:return-t;case`right`:return t;default:return 0}}var vu=`--toast-index`,yu=`--toast-offset-y`,bu=`--toast-height`,xu=`--toast-swipe-movement-x`,Su=`--toast-swipe-movement-y`,Cu=`data-swipe-direction`,wu={...ws,swipeDirection(e){return e?{[Cu]:e}:null}},Tu=40,Eu=10,Du=.5,Ou=1,ku=`${uu},${du}`,Au=_.forwardRef(function(e,t){let{toast:n,render:r,className:i,swipeDirection:a=[`down`,`right`],style:o,...s}=e,c=n.positionerProps?.anchor!==void 0,l=[];c||(l=Array.isArray(a)?a:[a]);let u=l.length>0,d=za(),[f,p]=_.useState(void 0),[m,h]=_.useState(!1),[g,v]=_.useState(!1),[y,b]=_.useState({x:0,y:0}),[x,S]=_.useState({x:0,y:0,scale:1}),[C,w]=_.useState(),[T,E]=_.useState(),[D,O]=_.useState(null),k=_.useRef(null),A=_.useRef(void 0),j=_.useRef({x:0,y:0}),M=_.useRef({x:0,y:0,scale:1}),N=_.useRef(void 0),P=_.useRef(0),F=_.useRef(!1),I=_.useRef({x:0,y:0}),L=_.useRef(!1),R=_.useRef({x:0,y:0}),z=_.useRef(null),ee=_.useRef(null),te=d.useState(`toastIndex`,n.id),ne=d.useState(`toastVisibleIndex`,n.id),re=d.useState(`toastOffsetY`,n.id),ie=d.useState(`focused`),ae=d.useState(`expanded`);au({open:n.transitionStatus!==`ending`,ref:k,onComplete(){n.transitionStatus===`ending`&&d.removeToast(n.id)}});let B=K((e=!1)=>{let t=k.current;if(!t)return;let r=t.style.height;t.style.height=`auto`;let i=t.offsetHeight;t.style.height=r;function a(){d.updateToastInternal(n.id,{ref:k,height:i,transitionStatus:void 0})}e?tu.flushSync(a):a()});G(()=>{let e=A.current;(n.transitionStatus===`starting`||e!==n.id)&&(e!==void 0&&(p(void 0),S({x:0,y:0,scale:1}),V({x:0,y:0})),A.current=n.id,B())},[B,n.id,n.transitionStatus]);function V(e){R.current=e,b(e)}G(()=>()=>{ee.current?.abort()},[]);function oe(e,t){let n=e=>e>0?e**Du:-(Math.abs(e)**Du),r=e>0&&!l.includes(`right`)||e<0&&!l.includes(`left`),i=t>0&&!l.includes(`down`)||t<0&&!l.includes(`up`);return{x:r?n(e):e,y:i?n(t):t}}let se=K(e=>{if(e.pointerId!==z.current)return;z.current=null,ee.current?.abort(),ee.current=null,h(!1),v(!1),O(null);let t=M.current;if(e.type===`pointercancel`||F.current){V({x:t.x,y:t.y}),p(void 0);return}let r=R.current,i=r.x-t.x,a=r.y-t.y,o;for(let e of l)if(_u(e,i,a)>Tu){o=e;break}o?(p(o),d.closeToast(n.id)):(V({x:t.x,y:t.y}),p(void 0))});function ce(e){if(e.button!==0||(e.pointerType===`touch`&&d.pauseTimers(),fs(ps(e.nativeEvent),`button,a,input,textarea,[role="button"],${ku}`)))return;F.current=!1,N.current=void 0,P.current=0,z.current=e.pointerId,j.current={x:e.clientX,y:e.clientY},I.current=j.current;let t=e.currentTarget,n=gu(t);M.current=n,S(n),V({x:n.x,y:n.y}),d.set(`hovering`,!0),h(!0),v(!1),O(null),L.current=!0,ee.current?.abort();let r=new AbortController;ee.current=r;let i=q(t);i.addEventListener(`pointerup`,se,{signal:r.signal}),i.addEventListener(`pointercancel`,se,{signal:r.signal}),t.setPointerCapture?.(e.pointerId)}function H(e){if(e.pointerId!==z.current)return;e.preventDefault(),L.current&&=(j.current={x:e.clientX,y:e.clientY},!1);let{clientY:t,clientX:n,movementX:r,movementY:i}=e;(i<0&&t>I.current.y||i>0&&t<I.current.y)&&(I.current={x:I.current.x,y:t}),(r<0&&n>I.current.x||r>0&&n<I.current.x)&&(I.current={x:n,y:I.current.y});let a=n-j.current.x,o=t-j.current.y,s=t-I.current.y,c=n-I.current.x,u=D;if(!g&&Math.sqrt(a*a+o*o)>=Ou){v(!0);let e=l.includes(`left`)||l.includes(`right`),t=l.includes(`up`)||l.includes(`down`);e&&t&&(u=Math.abs(a)>Math.abs(o)?`horizontal`:`vertical`,O(u))}let d;if(!N.current)u===`vertical`?o>0?d=`down`:o<0&&(d=`up`):u===`horizontal`?a>0?d=`right`:a<0&&(d=`left`):d=Math.abs(a)>=Math.abs(o)?a>0?`right`:`left`:o>0?`down`:`up`,d&&l.includes(d)&&(N.current=d,P.current=_u(d,a,o),p(d));else{let e=N.current,t=_u(e,c,s);t>Tu?(F.current=!1,p(e)):!(l.includes(`left`)&&l.includes(`right`))&&!(l.includes(`up`)&&l.includes(`down`))&&P.current-t>=Eu&&(F.current=!0)}let f=oe(a,o),m=M.current.x,h=M.current.y,_=l.includes(`left`)||l.includes(`right`),y=l.includes(`up`)||l.includes(`down`);u!==`vertical`&&_&&(m+=f.x),u!==`horizontal`&&y&&(h+=f.y),V({x:m,y:h})}function le(e){if(e.key===`Escape`){if(!k.current||!Y(k.current,ds(q(k.current))))return;d.closeToast(n.id)}}_.useEffect(()=>{let e=k.current;if(!u||!e)return;function t(t){z.current!==null&&Y(e,ps(t))&&t.preventDefault()}return J(e,`touchmove`,t,{passive:!1})},[u]);function ue(){let e=y.x-x.x,t=y.y-x.y;return{transition:m?`none`:void 0,transform:m?`translateX(${y.x}px) translateY(${y.y}px) scale(${x.scale})`:void 0,[xu]:`${e}px`,[Su]:`${t}px`}}let de=n.priority===`high`,fe={role:de?`alertdialog`:`dialog`,tabIndex:0,"aria-modal":!1,"aria-labelledby":C,"aria-describedby":T,"aria-hidden":de&&!ie?!0:void 0,onPointerDown:u?ce:void 0,onPointerMove:u?H:void 0,onPointerUp:u?se:void 0,onPointerCancel:u?se:void 0,onKeyDown:le,inert:Xl(n.limited),style:{...ue(),[vu]:n.transitionStatus===`ending`?te:ne,[yu]:`${re}px`,[bu]:n.height?`${n.height}px`:void 0}},pe=_.useMemo(()=>({toast:n,setTitleId:w,setDescriptionId:E,recalculateHeight:B,visibleIndex:ne,expanded:ae}),[n,w,E,B,ne,ae]),me={transitionStatus:n.transitionStatus,expanded:ae,limited:n.limited||!1,type:n.type,swiping:m,swipeDirection:f},he=Vl(`div`,e,{ref:[t,k],state:me,stateAttributesMapping:wu,props:[fe,s]});return(0,X.jsx)(Zl.Provider,{value:pe,children:he})}),ju=_.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{visibleIndex:o,expanded:s,recalculateHeight:c}=Ql(),l=_.useRef(null);return G(()=>{c();let e=l.current;if(!e||typeof ResizeObserver!=`function`||typeof MutationObserver!=`function`)return;let t=new ResizeObserver(()=>c(!0)),n=new MutationObserver(()=>c(!0));return t.observe(e),n.observe(e,{childList:!0,subtree:!0,characterData:!0}),()=>{t.disconnect(),n.disconnect()}},[c]),Vl(`div`,e,{ref:[t,l],state:{expanded:s,behind:o>0},props:a})}),Mu=0;function Nu(e,t=`mui`){let n=_.useRef(void 0),r=Lo(),i=e??n.current;return _.useEffect(()=>{n.current??(Mu+=1,n.current=`${t}-${Mu}`,e??r())},[e,t,r]),i}var Pu=io.useId;function Fu(e,t){if(Pu!==void 0){let n=Pu();return e??(t?`${t}-${n}`:n)}return Nu(e,t)}function Iu(e){return e==null||typeof e==`boolean`||e===``?!1:!Array.isArray(e)||e.some(Iu)}function Lu(e){return _.isValidElement(e)&&Iu(e.props.children)}function Ru(e,t,n){let{toast:r,setTitleId:i,setDescriptionId:a}=Ql(),o=n===`title`?i:a,s=t??(n===`title`?r.title:r.description);return{id:Fu(e),children:s,type:r.type,setId:o}}function zu(e,t,n){let r=Lu(e);return G(()=>{if(r)return n(t),()=>{n(e=>e===t?void 0:e)}},[r,t,n]),r?e:null}var Bu=_.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,children:o,...s}=e,{id:c,children:l,type:u,setId:d}=Ru(a,o,`description`);return zu(Vl(`p`,e,{ref:t,state:{type:u},props:{...s,id:c,children:l}}),c,d)}),Vu=_.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,children:o,...s}=e,{id:c,children:l,type:u,setId:d}=Ru(a,o,`title`);return zu(Vl(`h2`,e,{ref:t,state:{type:u},props:{...s,id:c,children:l}}),c,d)}),Hu=_.createContext(void 0);function Uu(e=!1){let t=_.useContext(Hu);if(t===void 0&&!e)throw Error(La(16));return t}function Wu(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:_.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function Gu(e,t,{detail:n=0,pointerType:r=``}={}){e.dispatchEvent(new(po(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,pointerType:r,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function Ku(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=_.useRef(null),s=Uu(!0),c=a??s!==void 0,{props:l}=Wu({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=_.useCallback(()=>{let e=o.current;qu(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return G(u,[u]),{getButtonProps:_.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return Ol({onClick(e){t?e.preventDefault():n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(Rl(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=qu(r),s=!i&&Ju(r),l=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&c&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),Gu(r,e))}else!l||i||!d&&!u?n&&s&&d&&e.preventDefault():e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),Gu(r,e)))},onKeyUp(e){t||(Rl(e),a?.(e),e.target===e.currentTarget&&i&&c&&qu(e.currentTarget)&&e.key===` `?e.preventDefault():e.baseUIHandlerPrevented||e.target!==e.currentTarget||i||c||e.defaultPrevented||e.key!==` `||(e.preventBaseUIHandler(),Gu(e.currentTarget,e)))},onPointerDown(e){t?e.preventDefault():s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:K(e=>{o.current=e,u()})}}function qu(e){return _o(e)&&e.tagName===`BUTTON`}function Ju(e){return _o(e)&&e.tagName===`A`&&!!e.href}var Yu=_.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a,nativeButton:o=!0,...s}=e,c=za(),{toast:l,expanded:u}=Ql(),[d,f]=_.useState(!1),{getButtonProps:p,buttonRef:m}=Ku({disabled:a,native:o}),h={type:l.type};return Vl(`button`,e,{ref:[t,m],state:h,props:[{"aria-hidden":!u&&!d,onClick(){c.closeToast(l.id)},onFocus(){f(!0)},onBlur(){f(!1)}},s,p]})}),Xu=_.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a,nativeButton:o=!0,...s}=e,{toast:c}=Ql(),l=c.actionProps?.children??s.children,{getButtonProps:u,buttonRef:d}=Ku({disabled:a,native:o}),f={type:c.type},p=Vl(`button`,e,{ref:[t,d],state:f,props:[s,c.actionProps,u,{children:l}]});return Lu(p)?p:null});function Z(e,t,n,r){let i=!1,a=!1,o=r??Ma;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function Zu(e,t,n){let r=n??Ma;return{reason:e,event:t??new Event(`base-ui`),...r}}var Qu=`none`,$u=`trigger-press`,ed=`trigger-hover`,td=`trigger-focus`,nd=`outside-press`,rd=`item-press`,id=`close-press`,ad=`track-press`,od=`input-change`,sd=`input-clear`,cd=`input-blur`,ld=`input-paste`,ud=`focus-out`,dd=`escape-key`,fd=`list-navigation`,pd=`keyboard`,md=`pointer`,hd=`drag`,gd=`wheel`,_d=`scrub`,vd=`cancel-open`,yd=`sibling-open`,bd=`disabled`,xd=`missing`,Sd=`initial`,Cd=`imperative-action`;function wd(e){return`data-base-ui-${e}`}var Td=_.createContext(null),Ed=()=>_.useContext(Td),Dd=wd(`portal`);function Od(e={}){let{ref:t,container:n,componentProps:r=Ma,elementProps:i}=e,a=Fu(),o=Ed()?.portalNode,[s,c]=_.useState(null),[l,u]=_.useState(null),d=K(e=>{e!==null&&u(e)}),f=_.useRef(null);G(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(ho(n)?n:n.current))??o??document.body;e==null?f.current&&(f.current=null,u(null),c(null)):f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=Vl(`div`,r,{ref:[t,d],props:[{id:a,[Dd]:``},i]}),m=s&&p?tu.createPortal(p,s):null;return{node:l,nodeId:_.isValidElement(p)?p.props.id:void 0,subtree:m}}var kd=_.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,portalOwnerRole:s,...c}=e,{node:l,nodeId:u,subtree:d}=Od({container:o,ref:t,componentProps:e,elementProps:c}),f=_.useRef(null),p=_.useRef(null),m=_.useRef(null),h=_.useRef(null),[g,v]=_.useState(null),y=_.useRef(!1),b=g?.modal,x=g?.open,S=!!g&&!g.modal&&g.open&&!!l;_.useEffect(()=>{if(!l||b)return;function e(e){l&&e.relatedTarget&&rl(e)&&(e.type===`focusin`?y.current&&=(al(l),!1):(il(l),y.current=!0))}return Io(J(l,`focusin`,e,!0),J(l,`focusout`,e,!0))},[l,b]),G(()=>{l&&x===!0&&y.current&&(al(l),y.current=!1)},[x,l]);let C=_.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:l,setFocusManagerState:v}),[l]);return(0,X.jsxs)(_.Fragment,{children:[d,(0,X.jsxs)(Td.Provider,{value:C,children:[S&&l&&(0,X.jsx)(hl,{"data-type":`outside`,ref:f,onFocus:e=>{rl(e,l)?m.current?.focus():tl(g?g.domReference:null)?.focus()}}),S&&l&&(0,X.jsx)(`span`,{role:s,"aria-owns":u,style:mu}),l&&tu.createPortal(a,l),S&&l&&(0,X.jsx)(hl,{"data-type":`outside`,ref:p,onFocus:e=>{rl(e,l)?h.current?.focus():(el(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,Z(`focus-out`,e.nativeEvent)))}})]})]})}),Ad=_.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{node:c,subtree:l}=Od({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,X.jsxs)(_.Fragment,{children:[l,c&&tu.createPortal(n,c)]})}),jd=_.forwardRef(function(e,t){return(0,X.jsx)(Ad,{ref:t,...e})});function Md(e){let t=Fa(Nd,e).current;return t.next=e,G(t.effect),t}function Nd(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function Pd(e,t){return t!=null&&!ec(t)?0:typeof e==`function`?e():e}function Fd(e,t,n){let r=Pd(e,n);return typeof r==`number`?r:r?.[t]}function Id(e){return typeof e==`function`?e():e}function Ld(e,t){return t||e===`click`||e===`mousedown`}function Rd(e){return e?.includes(`mouse`)&&e!==`mousedown`}var zd=_.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Uo,currentIdRef:{current:null},currentContextRef:{current:null}});function Bd(e,t){e.current=t.current}function Vd(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=_.useRef(n),a=_.useRef(n),o=_.useRef(null),s=_.useRef(null),c=Wo();return G(()=>{a.current=n,o.current?i.current={open:Fd(i.current,`open`),close:Fd(n,`close`)}:i.current=n},[n,o,i,a]),(0,X.jsx)(zd.Provider,{value:_.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function Hd(e,t={open:!1}){let{open:n}=t,r=e.useState(`floatingId`),{currentIdRef:i,delayRef:a,timeoutMs:o,initialDelayRef:s,currentContextRef:c,hasProvider:l,timeout:u}=_.useContext(zd),[d,f]=_.useState(!1),p=_.useRef(n);return G(()=>{p.current=n},[n]),G(()=>{function t(){c.current?.setIsInstantPhase(!1),i.current=null,c.current=null,a.current=s.current,u.clear()}if(i.current&&!n&&i.current===r){if(f(!1),o){let n=r;return u.start(o,()=>{e.select(`open`)||i.current&&i.current!==n||t()}),()=>{(p.current||i.current!==n)&&u.clear()}}t()}},[n,r,i,a,o,s,c,u,e]),G(()=>{if(!n)return;let t=c.current,o=i.current;u.clear(),c.current={onOpenChange:e.setOpen,setIsInstantPhase:f},i.current=r,a.current={open:0,close:Fd(s.current,`close`)},o!==null&&o!==r?(f(!0),t?.setIsInstantPhase(!0),t?.onOpenChange(!1,Z(Qu))):(f(!1),t?.setIsInstantPhase(!1))},[n,r,e,i,a,s,c,u]),G(()=>()=>{if(i.current===r){if(c.current=null,!p.current)return;i.current=null,Bd(a,s),u.clear()}},[c,i,a,r,s,u]),_.useMemo(()=>({activeIdRef:i,hasProvider:l,delayRef:a,isInstantPhase:d}),[i,l,a,d])}var Ud=0;function Wd(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(Ud);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),Aa;let o=requestAnimationFrame(a);return Ud=o,()=>{Ud===o&&(cancelAnimationFrame(o),Ud=0)}}var Gd=`data-base-ui-inert`,Kd=new WeakMap,qd=new WeakSet,Jd=new WeakMap,Yd=0;function Xd(e){return e?vo(e)?e.host:Xd(e.parentNode):null}var Zd=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Xd(t);return e.contains(n)?n:null}).filter(e=>e!=null),Qd=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},$d=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{fo(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function ef(e,t,n,{mark:r=!0}){let i=Zd(t,e),a=r?$d(t,Qd(i),new Set(i)):[],o=[],s=[];if(n){let e=Zd(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);$d(t,Qd(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(Kd.get(e)||0)+1;Kd.set(e,r),o.push(e),r===1&&n&&qd.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(Jd.get(e)||0)+1;Jd.set(e,t),s.push(e),t===1&&e.setAttribute(Gd,``)}),Yd+=1,()=>{o.forEach(e=>{let t=(Kd.get(e)||0)-1;Kd.set(e,t),t||(qd.has(e)||e.removeAttribute(`aria-hidden`),qd.delete(e))}),r&&s.forEach(e=>{let t=(Jd.get(e)||0)-1;Jd.set(e,t),t||e.removeAttribute(Gd)}),--Yd,Yd||(Kd=new WeakMap,qd=new WeakSet,Jd=new WeakMap)}}function tf(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t,i=q(e[0]).body;return ef(e,i,n,{mark:r})}function nf(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var rf=class{nodesRef={current:[]};events=nf();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},af=_.createContext(null),of=_.createContext(null),sf=()=>_.useContext(af)?.id||null,cf=e=>{let t=_.useContext(of);return e??t};function lf(e){let t=Fu(),n=cf(e),r=sf();return G(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function uf(e){let{children:t,id:n}=e,r=sf();return(0,X.jsx)(af.Provider,{value:_.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function df(e){let{children:t,externalTree:n}=e,r=Fa(()=>n??new rf).current;return(0,X.jsx)(of.Provider,{value:r,children:t})}function ff(e,t){let n=po(ps(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(Qs(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var pf=20,mf=[];function hf(){mf=mf.filter(e=>e.deref()?.isConnected)}function gf(e){hf(),e&&fo(e)!==`body`&&(mf.push(new WeakRef(e)),mf.length>pf&&(mf=mf.slice(-20)))}function _f(){return hf(),mf[mf.length-1]?.deref()}function vf(e){return e?Xc(e)?e:Qc(e)[0]||e:null}function yf(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=Zc(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return Xc(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function bf(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,explicitReturnFocus:o,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u=``,nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:p,externalTree:m,getInsideElements:h}=e,g=t.useState(`open`),v=t.useState(`domReferenceElement`),y=t.useState(`floatingElement`),{events:b,dataRef:x}=t.context,S=K(()=>x.current.floatingContext?.nodeId),C=i===!1,w=Gs(v)&&C,T=Md(i),E=Md(a),D=Md(o),O=Md(u),k=Md(g),A=cf(m),j=Ed(),M=_.useRef(!1),N=_.useRef(!1),P=_.useRef(!1),F=_.useRef(null),I=_.useRef(``),L=_.useRef(``),R=_.useRef(null),z=_.useRef(null),ee=gl(R,p,j?.beforeInsideRef),te=gl(z,j?.afterInsideRef),ne=Wo(),re=Wo(),ie=Vo(),ae=j!=null,B=qs(y),V=K((e=B)=>e?Qc(e):[]),oe=K(()=>h?.().filter(e=>e!=null)??[]);_.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&Y(B,ds(q(B)))&&V().length===0&&!w&&Xs(e)}return J(q(B),`keydown`,e)},[r,B,c,w,V]),_.useEffect(()=>{if(r||!g)return;let e=q(B);function t(){P.current=!1}function n(e){let t=ps(e),n=oe(),r=Y(y,t)||Y(v,t)||Y(j?.portalNode,t)||n.some(e=>e===t||Y(e,t));P.current=!r,L.current=e.pointerType||`keyboard`,fs(t,`[data-base-ui-click-trigger]`)&&(N.current=!0,re.start(0,()=>{N.current=!1}))}function i(){L.current=`keyboard`}return Io(J(e,`pointerdown`,n,!0),J(e,`pointerup`,t,!0),J(e,`pointercancel`,t,!0),J(e,`keydown`,i,!0),t)},[r,y,v,B,g,j,re,oe]),_.useEffect(()=>{if(r||!l)return;let e=q(B);function n(){N.current=!0,re.start(0,()=>{N.current=!1})}function i(e){let t=ps(e);Xc(t)&&(F.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=ps(n);c&&r==null&&a!=null&&Y(y,a)&&gf(a),queueMicrotask(()=>{let o=S(),l=t.context.triggerElements,u=oe(),p=r?.hasAttribute(wd(`focus-guard`))&&[R.current,z.current,j?.beforeInsideRef.current,j?.afterInsideRef.current,j?.beforeOutsideRef.current,j?.afterOutsideRef.current,$l(f),$l(d)].includes(r),m=!(Y(v,r)||Y(y,r)||Y(r,y)||Y(j?.portalNode,r)||u.some(e=>e===r||Y(e,r))||l.hasMatchingElement(e=>Y(e,r))||p||A&&(Js(A.nodesRef.current,o).find(e=>Y(e.context?.elements.floating,r)||Y(e.context?.elements.domReference,r))||Ys(A.nodesRef.current,o).find(e=>[e.context?.elements.floating,qs(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===v&&B&&yf(B),s&&i!==v&&!Ic(a)&&ds(e)===e.body){if(_o(B)&&(B.focus(),s===`popup`)){ie.request(()=>{B.focus()});return}let e=V(),t=F.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||B;_o(n)&&n.focus()}x.current.insideReactTree?x.current.insideReactTree=!1:(w||!c)&&r&&m&&!N.current&&(w||r!==_f())&&(M.current=!0,t.setOpen(!1,Z(ud,n)))})}function o(){P.current||(x.current.insideReactTree=!0,ne.start(0,()=>{x.current.insideReactTree=!1}))}let u=_o(v)?v:null;if(y||u)return Io(u&&J(u,`focusout`,a),u&&J(u,`pointerdown`,n),y&&J(y,`focusin`,i),y&&J(y,`focusout`,a),y&&j&&J(y,`focusout`,o,!0))},[r,v,y,B,c,A,j,t,l,s,V,w,S,x,ne,re,ie,d,f,oe]),_.useEffect(()=>{if(r||!y||!g)return;let e=Array.from(j?.portalNode?.querySelectorAll(`[${wd(`portal`)}]`)||[]),t=(A?Ys(A.nodesRef.current,S()):[]).find(e=>Gs(e.context?.elements.domReference||null))?.context?.elements.domReference,n=tf([y,...e,R.current,z.current,j?.beforeOutsideRef.current,j?.afterOutsideRef.current,...oe(),t,$l(f),$l(d),w?v:null].filter(e=>e!=null),{ariaHidden:c||w,mark:!1}),i=tf([y,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,v,y,c,j,w,A,S,d,f,oe]),G(()=>{if(!g||r||!_o(B))return;I.current=``,L.current=``;let e=q(B),t=ds(e);queueMicrotask(()=>{let n=T.current,r=typeof n==`function`?n(O.current||``):n;if(r===void 0||r===!1||Y(B,t))return;let i=null,a=()=>(i??=V(B),i[0]||B),o;o=r===!0||r===null?a():$l(r),o||=a();let s=Y(B,ds(e)),c=x.current.openEvent,l=c?.type===`mousedown`&&Qs(c);Wd(o,{sync:l,preventScroll:o===B,shouldFocus(){if(!k.current)return!1;if(s)return!0;let t=ds(e);return!(t!==o&&Y(B,t))}})})},[r,g,B,V,T,O,k,x]);let se=_.useRef(null);G(()=>{if(r||!B){se.current=null;return}se.current&&=(se.current.cancelled=!0,null);let e=q(B),t=ds(e),n=O.current==null;gf(t);function i(e){if(e.open||(I.current=ff(e.nativeEvent,L.current)),(e.reason===`focus-out`&&e.triggerElement?.hasAttribute(wd(`focus-guard`))||e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`)&&(M.current=!0),e.reason===`outside-press`){if(e.nested)M.current=!1;else if(Qs(e.nativeEvent)||$s(e.nativeEvent))M.current=!1;else{let e=!1;q(B).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?M.current=!1:M.current=!0}}}b.on(`openchange`,i);function a(e){let r=E.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=v?.isConnected?v:null,o=t?.isConnected&&fo(t)!==`body`?t:null,s=n?o||a:a||o;return s||=_f()||null,typeof i==`boolean`?s:$l(i)||s||null}return()=>{b.off(`openchange`,i);let t=ds(e),n=oe(),r=Y(y,t)||n.some(e=>e===t||Y(e,t))||A&&Js(A.nodesRef.current,S(),!1).some(e=>Y(e.context?.elements.floating,t)),o=E.current,s=I.current,c=a(s),l={cancelled:!1};se.current=l,queueMicrotask(()=>{se.current===l&&(se.current=null);let n=vf(c),i=D.current??typeof o!=`boolean`;if(!l.cancelled&&o&&!M.current&&_o(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}M.current=!1})}},[r,y,B,E,D,O,b,A,v,S,oe]),G(()=>{if(!ss||g||!y)return;let e=ds(q(y));_o(e)&&Us(e)&&Y(y,e)&&e.blur()},[g,y]),G(()=>{if(!r&&j)return j.setFocusManagerState({modal:c,closeOnFocusOut:l,open:g,onOpenChange:t.setOpen,domReference:v}),()=>{j.setFocusManagerState(null)}},[r,j,c,g,t,l,v]),G(()=>{if(!r&&B)return yf(B),()=>{queueMicrotask(hf)}},[r,B]);let ce=!r&&(!c||!w)&&(ae||c);return(0,X.jsxs)(_.Fragment,{children:[ce&&(0,X.jsx)(hl,{"data-type":`inside`,ref:ee,onFocus:e=>{if(c){let e=V();Wd(e[e.length-1])}else j?.portalNode&&(M.current=!1,rl(e,j.portalNode)?el(v)?.focus():$l(f??j.beforeOutsideRef)?.focus())}}),n,ce&&(0,X.jsx)(hl,{"data-type":`inside`,ref:te,onFocus:e=>{c?Wd(V()[0]):j?.portalNode&&(l&&(M.current=!0),rl(e,j.portalNode)?tl(v)?.focus():$l(d??j.afterOutsideRef)?.focus())}})]})}function xf(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=$u}=t,l=e.context.dataRef,u=_.useRef(void 0),d=Vo(),f=Wo(),p=_.useMemo(()=>{function t(t,n,r,i){let a=Z(c,n,r);t&&i===`touch`&&s>0?f.start(s,()=>{e.setOpen(!0,a)}):e.setOpen(t,a)}function n(t,n,r){let a=l.current.openEvent,s=e.select(`domReferenceElement`)!==n;return t&&s||!t||!i?!0:a&&(typeof o==`function`?o():o)?!r(a.type):!1}return{onPointerDown(e){u.current=ec(e.pointerType,!0)&&$s(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(i){let o=u.current,s=i.nativeEvent,c=e.select(`open`);if(i.button!==0||r===`click`||ec(o,!0)&&a)return;let l=n(c,i.currentTarget,e=>e===`click`||e===`mousedown`),f=ps(s),p=Us(f);if(p||o===`virtual`){t(l,s,p?f:i.currentTarget,o);return}let m=i.currentTarget;d.request(()=>{t(l,s,m,o)})},onClick(i){if(r===`mousedown-only`)return;let o=u.current;r===`mousedown`&&o?u.current=void 0:ec(o,!0)&&a||t(n(e.select(`open`),i.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),i.nativeEvent,i.currentTarget,o)},onKeyDown(){u.current=void 0}}},[l,r,a,c,e,o,i,d,f,s]);return _.useMemo(()=>n?{reference:p}:Ma,[n,p])}function Sf(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,(!i||c)&&(d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function Cf(e){return e!=null&&e.clientX!=null}function wf(e,t={}){let{enabled:n=!0,axis:r=`both`}=t,i=e.useState(`open`),a=e.useState(`floatingElement`),o=e.useState(`domReferenceElement`),s=e.context.dataRef,c=_.useRef(!1),l=_.useRef(null),[u,d]=_.useState(),[f,p]=_.useState([]),m=K(t=>{e.set(`positionReference`,t)}),h=K((t,n,i)=>{c.current||(!s.current.openEvent||Cf(s.current.openEvent))&&e.set(`positionReference`,Sf(i??o,{x:t,y:n,axis:r,dataRef:s,pointerType:u}))}),g=K(e=>{i?l.current||(h(e.clientX,e.clientY,e.currentTarget),p([])):h(e.clientX,e.clientY,e.currentTarget)}),v=ec(u)?a:i;_.useEffect(()=>{if(!n){m(o);return}if(!v)return;function e(){l.current?.(),l.current=null}let t=po(a);function r(t){let n=ps(t);Y(a,n)?e():h(t.clientX,t.clientY)}return!s.current.openEvent||Cf(s.current.openEvent)?l.current=J(t,`mousemove`,r):m(o),e},[v,n,a,s,o,e,h,m,f]),_.useEffect(()=>()=>{e.set(`positionReference`,null)},[e]),_.useEffect(()=>{n&&!a&&(c.current=!1)},[n,a]),_.useEffect(()=>{!n&&i&&(c.current=!0)},[n,i]);let y=_.useMemo(()=>{function e(e){d(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:g,onMouseEnter:g}},[g]);return _.useMemo(()=>n?{reference:y,trigger:y}:{},[n,y])}function Tf(){return!1}function Ef(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function Df(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=Tf,bubbles:s,externalTree:c}=t,l=e.useState(`open`),u=e.useState(`floatingElement`),{dataRef:d,events:f}=e.context,p=cf(c),m=K(typeof i==`function`?i:()=>!1),h=typeof i==`function`?m:i,g=h!==!1,v=K(()=>a),{escapeKey:y,outsidePress:b}=Ef(s),x=_.useRef(!1),S=_.useRef(!1),C=_.useRef(!1),w=_.useRef(!1),T=_.useRef(!1),E=_.useRef(``),D=_.useRef(null),O=Wo(),k=Wo(),A=Wo(),j=K(()=>{k.clear(),d.current.insideReactTree=!1}),M=K(e=>{let t=d.current.floatingContext?.nodeId;return(p?Js(p.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),N=K(t=>Vs(t,e.select(`floatingElement`))||Vs(t,e.select(`domReferenceElement`))),P=K(t=>{o()&&e.setOpen(!1,Z($u,t.nativeEvent))}),F=K(t=>{if(!l||!n||!r||t.key!==`Escape`)return;let i=Zs(t)?t.nativeEvent:t;if(T.current||i.isComposing||!y&&M(`__escapeKeyBubbles`))return;let a=Z(dd,i);e.setOpen(!1,a),a.isCanceled||t.preventDefault(),!y&&!a.isPropagationAllowed&&t.stopPropagation()}),I=K(()=>{d.current.insideReactTree=!0,k.start(0,j)}),L=K(t=>{if(!l||!n||t.button!==0)return;let r=ps(t.nativeEvent);Y(e.select(`floatingElement`),r)&&(x.current||(x.current=!0,S.current=!1))}),R=K(e=>{l&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&x.current&&(S.current=!0)});_.useEffect(()=>{function e(e){e.open||(w.current=!1)}return f.on(`openchange`,e),()=>{f.off(`openchange`,e)}},[f]),_.useEffect(()=>j,[j]),_.useEffect(()=>{if(!l||!n)return l||(w.current=!1,T.current=!1,E.current=``,D.current=null),j;d.current.__escapeKeyBubbles=y,d.current.__outsidePressBubbles=b;let t=new Uo,i=q(u);function a(){A.clear(),T.current=!0}function o(){T.current=!0,A.start(ss?5:0,()=>{T.current=!1})}function s(){C.current=!0,t.start(0,()=>{C.current=!1})}function c(){x.current=!1,S.current=!1}function f(){let e=E.current,t=e===`pen`||!e?`mouse`:e,n=v(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function m(e){let t=f();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function _(e){let t=d.current.floatingContext?.nodeId,n=p&&Js(p.nodesRef.current,t).some(t=>Vs(e,t.context?.elements.floating));return N(e)||n}function k(n){if(m(n)){n.type!==`click`&&!N(n)&&(t.clear(),C.current=!1),j();return}if(d.current.insideReactTree){j();return}let r=ps(n),i=`[${wd(`inert`)}]`,a=go(r)?r.getRootNode():null,o=Array.from((vo(a)?a:q(e.select(`floatingElement`))).querySelectorAll(i)),s=e.context.triggerElements;if(r&&(s.hasElement(r)||s.hasMatchingElement(e=>Y(e,r))))return;let c=go(r)?r:null;for(;c&&!ko(c);){let e=Mo(c);if(ko(e)||!go(e))break;c=e}if(!(o.length&&go(r)&&!Hs(r)&&!Y(r,e.select(`floatingElement`))&&o.every(e=>!Y(c,e)))){if(_o(r)&&!(`touches`in n)){let e=ko(r),t=Ao(r),i=/auto|scroll/,a=e||i.test(t.overflowX),o=e||i.test(t.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=t.direction===`rtl`,u=c&&(l?n.offsetX<=r.offsetWidth-r.clientWidth:n.offsetX>r.clientWidth),d=s&&n.offsetY>r.clientHeight;if(u||d)return}if(!_(n)){if(f()===`intentional`){if(n.detail!==0&&!Qs(n)&&!w.current)return;if(C.current){t.clear(),C.current=!1;return}}typeof h==`function`&&!h(n)||M(`__outsidePressBubbles`)||(e.setOpen(!1,Z(nd,n)),j())}}}function P(t){f()===`sloppy`&&t.pointerType!==`touch`&&e.select(`open`)&&n&&!N(t)&&k(t)}function I(t){if(f()!==`sloppy`||!e.select(`open`)||!n||N(t))return;let r=t.touches[0];r&&(D.current={startTime:Date.now(),startX:r.clientX,startY:r.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},O.start(1e3,()=>{D.current&&(D.current.dismissOnTouchEnd=!1,D.current.dismissOnMouseDown=!1)}))}function L(e,t){let n=ps(e);if(!n)return;let r=J(n,e.type,()=>{t(e),r()})}function R(e){E.current=`touch`,L(e,I)}function z(e){O.clear(),e.type===`pointerdown`&&(e.button===0&&(w.current=!0),E.current=e.pointerType),(e.type!==`mousedown`||!D.current||D.current.dismissOnMouseDown)&&L(e,e=>{e.type===`pointerdown`?P(e):k(e)})}function ee(e){if(e.type===`pointercancel`&&(w.current=!1),!x.current)return;let n=S.current;c(),f()===`intentional`&&(e.type===`pointercancel`?n&&s():_(e)||(n?s():(typeof h!=`function`||h(e))&&(t.clear(),C.current=!0,j())))}function te(e){if(f()!==`sloppy`||!D.current||N(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-D.current.startX),r=Math.abs(t.clientY-D.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(D.current.dismissOnTouchEnd=!0),i>10&&(k(e),O.clear(),D.current=null)}function ne(e){L(e,te)}function re(e){f()===`sloppy`&&D.current&&!N(e)&&(D.current.dismissOnTouchEnd&&k(e),O.clear(),D.current=null)}function ie(e){L(e,re)}let ae=Io(r&&Io(J(i,`keydown`,F),J(i,`compositionstart`,a),J(i,`compositionend`,o)),g&&Io(J(i,`click`,z,!0),J(i,`pointerdown`,z,!0),J(i,`pointerup`,ee,!0),J(i,`pointercancel`,ee,!0),J(i,`mousedown`,z,!0),J(i,`mouseup`,ee,!0),J(i,`touchstart`,R,{capture:!0,passive:!0}),J(i,`touchmove`,ne,{capture:!0,passive:!0}),J(i,`touchend`,ie,{capture:!0,passive:!0})));return()=>{ae(),t.clear(),c(),C.current=!1}},[d,u,r,g,h,l,n,y,b,F,j,v,M,N,p,e,O,A]);let z=_.useMemo(()=>({onKeyDown:F,onPointerDown:P,onClick:P}),[F,P]),ee=_.useMemo(()=>({onKeyDown:F,onPointerDown:R,onMouseDown:R,onClickCapture:I,onMouseDownCapture(e){I(),L(e)},onPointerDownCapture(e){I(),L(e)},onMouseUpCapture:I,onTouchEndCapture:I,onTouchMoveCapture:I}),[F,I,L,R]);return _.useMemo(()=>n?{reference:z,floating:ee,trigger:z}:{},[n,z,ee])}function Of(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=o;return t.useSyncedValue(`floatingId`,i),G(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};go(c)&&(e.domReferenceElement=c),r.state.positionReference===r.state.referenceElement&&(e.positionReference=c),r.update(e)},[s,i,c,l,r]),r.context.onOpenChange=u,r.context.nested=a,r}function kf(e,t=!1,n=!1,r=!1){let[i,a]=_.useState(e&&t?`idle`:void 0),[o,s]=_.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),G(()=>{if(!e&&o&&i!==`ending`&&n){let e=Bo.request(()=>{a(`ending`)});return()=>{Bo.cancel(e)}}},[e,o,i,n]),G(()=>{if(!e||t||i===void 0)return;let n=Bo.request(()=>{a(void 0)});return()=>{Bo.cancel(n)}},[t,e,i]),G(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=Bo.request(()=>{a(`idle`)});return()=>{Bo.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}function Af(e){let{open:t,ref:n,preventUnmountOnClose:r,setPreventUnmountOnClose:i,onUnmount:a,animateInitialOpen:o}=e,s=K(i),{mounted:c,setMounted:l,transitionStatus:u}=kf(t,!1,!1,o),d=!t&&r;G(()=>{t&&s(!1)},[t,s]);let f=_.useRef(c),p=_.useRef(!1),m=Lo(),h=()=>{f.current=!1,l(!1),a()};G(()=>{f.current=c,p.current&&(p.current=!1,!t&&c&&h())});let g=K(()=>{f.current&&(t?(p.current=!0,m()):h())});return au({enabled:c&&!t&&!d,open:t,ref:n,onComplete(){t||g()}}),{mounted:c,transitionStatus:u,preventUnmountingOnClose:d,forceUnmount:g}}var jf={tabIndex:-1,[ms]:``};function Mf(e){return t=>t!==`touch`||e.current}function Nf(e,t=!1){let n=Fu(),r=sf()!=null,i=Fa(()=>e(n,r)).current;return Of({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function Pf({handle:e,store:t}){return G(()=>e.attachStore(t),[e,t]),null}function Ff(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function If(e,t){let n=_.useRef(null);return K(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),Ff(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),Ff(t))})}function Lf(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s,openedWithoutTrigger:t?n==null:e.openedWithoutTrigger}}function Rf(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function zf(e,t,n,r={}){let i=n.reason,a=i===ed,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=Rf(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i=Lf(e.state,t,n.trigger,c()),l={...r.extraState,...i};o?l.instantType=`focus`:s?l.instantType=`dismiss`:a&&(l.instantType=void 0),e.update(l)};a?tu.flushSync(l):l()}function Bf(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=If(e,n),o=K(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e)}else if(a==null&&i&&!n.state.openedWithoutTrigger){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=K(e=>{a(e),e&&o(e)});return G(()=>(s(t.current),()=>s(null)),[s,t,n,e]),G(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function Vf(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=_.useRef(null),i=e.useState(`open`);G(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0),e.state.openedWithoutTrigger&&e.set(`openedWithoutTrigger`,!1);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&!e.state.openedWithoutTrigger&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=Z(Qu);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function Hf(e,t,n,r){let{mounted:i,transitionStatus:a,forceUnmount:o}=Af({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState(`preventUnmountingOnClose`),setPreventUnmountOnClose:e=>t.set(`preventUnmountingOnClose`,e),animateInitialOpen:r,onUnmount(){t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}});return Fa(()=>(t.set(`mounted`,i),null)),t.useSyncedValues({mounted:i,transitionStatus:a}),{forceUnmount:o,transitionStatus:a}}function Uf(e,t){e.useSyncedValues(t),G(()=>()=>{e.update({activeTriggerProps:Ma,inactiveTriggerProps:Ma,popupProps:Ma})},[e])}function Wf(e,t){G(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),G(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var Gf=class{idMap=new Map;add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}},Kf={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},qf=class extends lo{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:nf(),nested:n,triggerElements:i},Kf),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&tc(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{this.syncOnly||this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function Jf(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new qf({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Ma,inactiveTriggerProps:Ma,popupProps:Ma}}var Yf=e=>e.triggerIdProp??e.activeTriggerId,Xf=e=>e.openProp??e.open,Zf=e=>(e.popupElement?.id??e.floatingId)||void 0;function Qf(e,t){return t!==void 0&&Xf(e)&&Yf(e)===t}function $f(e,t){return Qf(e,t)?!0:t!==void 0&&Xf(e)&&Yf(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var ep={open:Xf,mounted:e=>e.mounted,transitionStatus:e=>Xf(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:Yf,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:Zf,isTriggerActive:(e,t)=>t!==void 0&&Yf(e)===t,isOpenedByTrigger:(e,t)=>Qf(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Yf(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>$f(e,t)?Zf(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function tp(e){let t=_.useCallback(t=>e===void 0?Aa:e.subscribeStore(t),[e]),n=_.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,Wi.useSyncExternalStore)(t,n,()=>e?.serverStore)}var np=as&&ss;function rp(e,t={}){let{enabled:n=!0,delay:r}=t,{events:i,dataRef:a}=e.context,o=_.useRef(!1),s=_.useRef(null),c=_.useRef(!0),l=Wo();_.useEffect(()=>{let t=e.select(`domReferenceElement`);if(!n)return;let r=po(t);function i(){let t=e.select(`domReferenceElement`);!e.select(`open`)&&_o(t)&&t===ds(q(t))&&(o.current=!0,s.current=t)}function a(){c.current=!0}function l(){c.current=!1}return Io(J(r,`blur`,i),np&&J(r,`keydown`,a,!0),np&&J(r,`pointerdown`,l,!0))},[e,n]),_.useEffect(()=>{if(!n)return;function t(t){if(t.reason===`trigger-press`||t.reason===`escape-key`){let t=e.select(`domReferenceElement`);go(t)&&(s.current=t,o.current=!0)}}return i.on(`openchange`,t),()=>{i.off(`openchange`,t)}},[i,n,e]);let u=_.useMemo(()=>{function t(){o.current=!1,s.current=null}return{onMouseLeave(){t()},onFocus(n){let i=n.currentTarget;if(o.current){if(s.current===i)return;t()}let a=ps(n.nativeEvent);if(go(a)){if(np&&!n.relatedTarget){if(!c.current&&!Us(a))return}else if(!Ks(a))return}let u=Bs(n.relatedTarget,e.context.triggerElements),{nativeEvent:d,currentTarget:f}=n;e.select(`open`)&&u||!r?e.setOpen(!0,Z(td,d,f)):l.start(r,()=>{o.current||e.setOpen(!0,Z(td,d,f))})},onBlur(n){t();let r=n.relatedTarget,i=n.nativeEvent,o=go(r)&&r.hasAttribute(wd(`focus-guard`))&&r.getAttribute(`data-type`)===`outside`;l.start(0,()=>{let t=e.select(`domReferenceElement`),n=ds(q(t));!r&&n===t||Y(a.current.floatingContext?.refs.floating.current,n)||Y(t,n)||o||Bs(r??n,e.context.triggerElements)||e.setOpen(!1,Z(td,i))})}}},[a,r,e,l]);return _.useMemo(()=>n?{reference:u,trigger:u}:{},[n,u])}var ip=class e{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new Uo;restTimeout=new Uo;handleCloseOptions=void 0;static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},ap=new WeakMap;function op(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&ap.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),ap.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function sp(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=ap.get(n);a&&a!==e&&op(a),op(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,ap.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function cp(e){let t=e.context.dataRef.current,n=Fa(()=>t.hoverInteractionState??ip.create()).current;return t.hoverInteractionState||=n,Na(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function lp(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=e.useState(`open`),o=e.useState(`floatingElement`),s=e.useState(`domReferenceElement`),{dataRef:c}=e.context,l=cf(),u=sf(),d=cp(e),f=Wo(),p=K(()=>Ld(c.current.openEvent?.type,d.interactedInside)),m=K(()=>Rd(c.current.openEvent?.type)),h=K(()=>{op(d)});G(()=>{a||(d.pointerType=void 0,d.restTimeoutPending=!1,d.interactedInside=!1,h())},[a,d,h]),_.useEffect(()=>h,[h]),G(()=>{if(n&&a&&d.handleCloseOptions?.blockPointerEvents&&m()&&go(s)&&o){let e=s,t=o,n=q(o),r=l?.nodesRef.current.find(e=>e.id===u)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=d.pointerEventsScopeElement===t?null:d.pointerEventsScopeElement,a=r===t?null:r,c=d.handleCloseOptions?.getScope?.()??i??a??fs(e,`[data-rootownerid]`)??n.body;return sp(d,{scopeElement:c,referenceElement:e,floatingElement:t}),()=>{h()}}},[n,a,s,o,d,m,l,u,h]),_.useEffect(()=>{if(!n)return;function t(){return!!(l&&u&&Js(l.nodesRef.current,u).length>0)}function a(t){let n=Fd(r,`close`,d.pointerType),i=()=>{e.setOpen(!1,Z(ed,t)),l?.events.emit(`floating.closed`,t)};n?d.openChangeTimeout.start(n,i):(d.openChangeTimeout.clear(),i())}function s(e){let t=ps(e);Ws(t)?d.interactedInside=fs(t,`[aria-haspopup]`)!=null:d.interactedInside=!1}function g(){d.openChangeTimeout.clear(),f.clear(),l?.events.off(`floating.closed`,v),h()}function _(n){if(t()&&l){l.events.on(`floating.closed`,v);return}if(Bs(n.relatedTarget,e.context.triggerElements))return;let r=c.current.floatingContext?.nodeId??i,o=n.relatedTarget;l&&r&&go(o)&&Js(l.nodesRef.current,r,!1).some(e=>Y(e.context?.elements.floating,o))||(d.handler?d.handler(n):(h(),m()&&!p()&&a(n)))}function v(n){l&&u&&!t()&&f.start(0,()=>{l.events.off(`floating.closed`,v),e.setOpen(!1,Z(ed,n)),l.events.emit(`floating.closed`,n)})}let y=o;return Io(y&&J(y,`mouseenter`,g),y&&J(y,`mouseleave`,_),y&&J(y,`pointerdown`,s,!0),()=>{l?.events.off(`floating.closed`,v)})},[n,o,e,c,r,i,m,p,h,d,l,u,f])}var up={current:null};function dp(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=up,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,{dataRef:h,events:g}=e.context,v=cf(l),y=cp(e),b=_.useRef(!1),x=Md(i),S=Md(r),C=Md(o),w=Md(n),T=Md(p),E=Md(f),D=K(()=>Ld(h.current.openEvent?.type,y.interactedInside)),O=K(()=>T.current?.()!==!1),k=K((t,n,r)=>{let i=e.context.triggerElements;if(i.hasElement(n))return!t||!Y(t,n);if(!go(r))return!1;let a=r;return i.hasMatchingElement(e=>Y(e,a))&&(!t||!Y(t,a))}),A=K(()=>{y.handler&&=(q(e.select(`domReferenceElement`)).removeEventListener(`mousemove`,y.handler),void 0)}),j=K(()=>{op(y)});return u&&(y.handleCloseOptions=i?.__options),_.useEffect(()=>A,[A]),_.useEffect(()=>{if(!n)return;function e(e){e.open?b.current=!1:(b.current=e.reason===ed,A(),y.openChangeTimeout.clear(),y.restTimeout.clear(),y.blockMouseMove=!0,y.restTimeoutPending=!1)}return g.on(`openchange`,e),()=>{g.off(`openchange`,e)}},[n,g,y,A]),_.useEffect(()=>{if(!n)return;function t(t,n=!0){let r=Fd(S.current,`close`,y.pointerType);r?y.openChangeTimeout.start(r,()=>{e.setOpen(!1,Z(ed,t)),v?.events.emit(`floating.closed`,t)}):n&&(y.openChangeTimeout.clear(),e.setOpen(!1,Z(ed,t)),v?.events.emit(`floating.closed`,t))}let r=c.current??(u?e.select(`domReferenceElement`):null);if(!go(r))return;function i(t){if(y.openChangeTimeout.clear(),y.blockMouseMove=!1,a&&!ec(y.pointerType))return;let n=Id(C.current),r=Fd(S.current,`open`,y.pointerType),i=ps(t),o=t.currentTarget??null,s=e.select(`domReferenceElement`),c=o;if(go(i)&&!e.context.triggerElements.hasElement(i)){for(let t of e.context.triggerElements.elements())if(Y(t,i)){c=t;break}}go(o)&&go(s)&&!e.context.triggerElements.hasElement(o)&&Y(o,s)&&(c=s);let l=c!=null&&k(s,c,i),u=e.select(`open`),d=E.current?.()??e.select(`transitionStatus`)===`ending`,f=!u&&d&&b.current,p=!l&&go(c)&&go(s)&&Y(s,c)&&f,m=n>0&&!r,h=l&&(u||f)||p,g=!u||l;h?O()&&e.setOpen(!0,Z(ed,t,c)):m||(r?y.openChangeTimeout.start(r,()=>{g&&O()&&e.setOpen(!0,Z(ed,t,c))}):g&&O()&&e.setOpen(!0,Z(ed,t,c)))}function o(n){if(D()){j();return}A();let r=q(e.select(`domReferenceElement`));y.restTimeout.clear(),y.restTimeoutPending=!1;let i=h.current.floatingContext??d?.();if(!Bs(n.relatedTarget,e.context.triggerElements)){if(x.current&&i){e.select(`open`)||y.openChangeTimeout.clear();let a=c.current;y.handler=x.current({...i,tree:v,x:n.clientX,y:n.clientY,onClose(){j(),A(),w.current&&!D()&&a===e.select(`domReferenceElement`)&&t(n,!0)}}),r.addEventListener(`mousemove`,y.handler),y.handler(n)}else y.pointerType===`touch`&&Y(e.select(`floatingElement`),n.relatedTarget)||t(n)}}function l(e){Y(r,e.relatedTarget)||(y.openChangeTimeout.clear(),y.restTimeout.clear(),y.restTimeoutPending=!1)}let f=m?J(r,`mouseout`,l):void 0;return s?Io(J(r,`mousemove`,i,{once:!0}),J(r,`mouseenter`,i),J(r,`mouseleave`,o),f):Io(J(r,`mouseenter`,i),J(r,`mouseleave`,o),f)},[A,j,h,S,e,n,x,y,u,k,D,a,s,C,c,v,w,d,E,O,m]),_.useMemo(()=>{if(!n)return;function t(e){y.pointerType=e.pointerType}return{onPointerDown:t,onPointerEnter:t,onMouseMove(t){let{nativeEvent:n}=t,r=t.currentTarget,i=e.select(`domReferenceElement`),o=e.select(`open`),s=k(i,r,t.target);if(a&&!ec(y.pointerType))return;if(o&&s&&y.handleCloseOptions?.blockPointerEvents){let t=e.select(`floatingElement`);if(t){let e=y.handleCloseOptions?.getScope?.()??r.ownerDocument.body;sp(y,{scopeElement:e,referenceElement:r,floatingElement:t})}}let c=Id(C.current);if(o&&!s||c===0||!s&&y.restTimeoutPending&&t.movementX**2+t.movementY**2<2)return;y.restTimeout.clear();function l(){if(y.restTimeoutPending=!1,D())return;let t=e.select(`open`);!y.blockMouseMove&&(!t||s)&&O()&&e.setOpen(!0,Z(ed,n,r))}y.pointerType===`touch`?tu.flushSync(()=>{l()}):s&&o?l():(y.restTimeoutPending=!0,y.restTimeout.start(c,l))}}},[n,y,D,k,a,e,C,O])}function fp(e){return ss&&e.movementX===0&&e.movementY===0}function pp(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function mp(e,t){return pp(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function hp(e,t,n){return pp(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function gp(e,t,n){return pp(t,n?e===gs:e===_s,e===ys)}function _p(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===`Escape`:pp(t,n?e===_s:e===gs,e===vs)}function vp(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:d=!1,focusItemOnOpen:f=`auto`,focusItemOnHover:p=!0,openOnArrowKeyDown:m=!0,disabledIndices:h=void 0,orientation:g=`vertical`,triggerOrientation:v=g,parentOrientation:y,id:b,resetOnPointerLeave:x=!0,externalTree:S,nestedReturnFocusRef:C,grid:w}=t,T=w!=null,E=e.useState(`open`),D=e.useState(`floatingElement`),O=e.useState(`domReferenceElement`),k=e.context.dataRef,A=qs(D),j=Gs(O),M=Md(A),N=sf(),P=cf(S),F=_.useRef(f),I=_.useRef(o??-1),L=_.useRef(null),R=_.useRef(!0),z=K(e=>{i(I.current===-1?null:I.current,e)}),ee=_.useRef(!!D),te=_.useRef(E),ne=_.useRef(!1),re=_.useRef(!1),ie=_.useRef(null),ae=Md(h),B=Md(E),V=Md(o),oe=Md(x),se=Vo(),ce=Vo(),H=K(()=>{se.cancel();function e(e){d||(ie.current=Wd(e,{sync:ne.current,preventScroll:!0}))}let t=n.current[I.current],r=re.current;t&&e(t),(ne.current?e=>e():e=>se.request(e))(()=>{let i=n.current[I.current]||t;i&&(t||e(i),me&&(r||!R.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});G(()=>{k.current.orientation=g},[k,g]),G(()=>{E||(L.current=null),E&&f===`auto`||(F.current=f)},[E,f]),G(()=>{a&&(E&&D?(I.current=o??-1,F.current&&o!=null&&(re.current=!0,z())):ee.current&&(I.current=-1,z()))},[a,E,D,o,z]),G(()=>{if(a){if(!E)ne.current=!1;else if(D){if(r==null){if(ne.current=!1,V.current!=null)return;if(ee.current&&(I.current=-1,H()),(!te.current||!ee.current)&&F.current&&(L.current!=null||F.current===!0&&L.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>ce.request(e):queueMicrotask)(t),e+=1):(I.current=L.current==null||hp(L.current,v,u)||l?Ac(n):jc(n),L.current=null,z())};t()}}else kc(n.current,r)||(I.current=r,H(),re.current=!1)}}},[a,E,D,r,V,l,n,v,u,z,H,ce]),G(()=>{if(!a||D||!P||d||!ee.current)return;let e=P.nodesRef.current,t=e.find(e=>e.id===N)?.context?.elements.floating,n=ds(q(O??t??null)),r=e.some(e=>e.context&&Y(e.context.elements.floating,n));t&&!r&&R.current&&t.focus({preventScroll:!0})},[a,D,O,P,N,d]),G(()=>{te.current=E,ee.current=!!D});let le=r!=null,ue=K(e=>{if(!B.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(I.current!==t||r!==t)&&(I.current=t,z(e))}),de=K(()=>y??P?.nodesRef.current.find(e=>e.id===N)?.context?.dataRef?.current.orientation),fe=K(()=>Ac(n,ae.current)),pe=K(t=>{if(R.current=!1,ne.current=!0,t.which===229||!B.current&&t.currentTarget===M.current)return;if(l&&_p(t.key,g,u,T)){mp(t.key,de())||Xs(t),e.setOpen(!1,Z(fd,t.nativeEvent));let n=C?.current??O;_o(n)&&n.focus();return}r!=null&&r!==I.current&&!kc(n.current,r)&&(I.current=r);let i=I.current,a=Ac(n,h),o=jc(n,h);if(j||(t.key===`Home`&&(Xs(t),I.current=a,z(t)),t.key===`End`&&(Xs(t),I.current=o,z(t))),w!=null){let e=w(t,I.current,n,g,c,u,h,a,o);if(e!=null&&e!==I.current&&(I.current=e,z(t)),g===`both`)return}if(mp(t.key,g)){Xs(t);let e=ds(t.currentTarget.ownerDocument);if(E&&!d&&Y(t.currentTarget,e)&&!n.current.some(t=>t!=null&&Y(t,e))){I.current=hp(t.key,g,u)?a:o,z(t),r===I.current&&H();return}let{index:l,wrapped:f}=Mc(n.current,i,{decrement:!hp(t.key,g,u),loopFocus:c,allowEscape:s,disabledIndices:h,minIndex:a,maxIndex:o});f&&(ne.current=!1),I.current=l,z(t)}}),me=_.useMemo(()=>({onFocus(e){ne.current=!0,ue(e)},onClick({currentTarget:e}){d||e.focus({preventScroll:!0})},onMouseMove(e){fp(e)||(ne.current=!0,re.current=!1,p&&ue(e))},onPointerLeave(e){if(!B.current||!R.current||e.pointerType===`touch`)return;ne.current=!0;let t=e.relatedTarget;if(p&&!n.current.includes(t)&&oe.current&&(ie.current?.(),ie.current=null,I.current=-1,z(e),!d)){let e=M.current,t=ds(q(e));e&&Y(e,t)&&e.focus({preventScroll:!0})}}}),[ue,B,M,p,n,z,oe,d]),he=_.useMemo(()=>d&&E&&le&&{"aria-activedescendant":`${b}-${r}`},[d,E,le,b,r]),ge=_.useMemo(()=>({...j?{}:he,onKeyDown(t){if(t.key===`Tab`&&t.shiftKey&&E&&!d){let n=ps(t.nativeEvent);if(n&&!Y(M.current,n))return;Xs(t);let r=Z(ud,t.nativeEvent);e.setOpen(!1,r);let i=C?.current??O;!r.isCanceled&&_o(i)&&i.focus()}else pe(t)},onPointerMove(e){fp(e)||(R.current=!0)}}),[he,pe,M,j,e,E,d,O,C]),_e=_.useMemo(()=>{function t(t){e.setOpen(!0,Z(fd,t.nativeEvent,t.currentTarget))}function n(e){f===`auto`&&Qs(e.nativeEvent)&&(F.current=!d)}function r(e){F.current=f,f===`auto`&&$s(e.nativeEvent)&&(F.current=!0)}return{onKeyDown(n){let r=e.select(`open`);R.current=!1;let i=n.key.startsWith(`Arrow`),a=gp(n.key,de(),u),o=mp(n.key,r?g:v),s=(l?a:o)||n.key===`Enter`||n.key.trim()===``;if(d&&r&&(!l||Us(n.currentTarget)))return pe(n);if(r||m||!i){if(s){let e=mp(n.key,de());L.current=l&&e?null:n.key}l?a&&(Xs(n),r?(I.current=fe(),z(n),d&&M.current?.focus()):t(n)):o&&(V.current!=null&&(I.current=V.current),Xs(n),!r&&m?t(n):pe(n),r&&z(n))}},onFocus(t){t.target===t.currentTarget&&e.select(`open`)&&!d&&(I.current=-1,z(t))},onPointerDown:r,onPointerEnter:r,onMouseDown:n,onClick:n}},[pe,f,fe,l,z,e,m,g,v,de,u,V,d,M]),ve=_.useMemo(()=>({...he,..._e}),[he,_e]);return _.useMemo(()=>a?{reference:ve,floating:ge,item:me,trigger:_e}:{},[a,ve,ge,_e,me])}function yp(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,d=K(s),f=e.useState(`open`),p=Wo(),m=_.useRef(``),h=_.useRef(u??i??-1),g=_.useRef(null),v=K(e=>{function t(e){return r?.current[e]}function s(e){let n=t(e);return n&&!Ic(n)||n?.matches(`:disabled`)?!1:o==null||!Pc(ja,e,o)}function c(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(i)&&s(n))return n}return-1}let _=n.current;if(m.current.length>0&&e.key===` `&&(Xs(e),d?.(!0)),m.current.length>0&&m.current[0]!==` `&&c(_,m.current)===-1&&e.key!==` `&&d?.(!1),_==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;f&&e.key!==` `&&(Xs(e),d?.(!0));let v=m.current===``;v&&(h.current=u??i??-1),_.every((e,t)=>e&&s(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&m.current===e.key&&(m.current=``,h.current=g.current),m.current+=e.key,p.start(l,()=>{m.current=``,h.current=g.current,d?.(!1)});let y=((v?u??i??-1:h.current)??0)+1,b=c(_,m.current,y);b===-1?e.key!==` `&&(m.current=``,d?.(!1)):(a?.(b,e),g.current=b)}),y=K(t=>{let n=t.relatedTarget,r=e.select(`domReferenceElement`),i=e.select(`floatingElement`);Y(r,n)||Y(i,n)||(p.clear(),m.current=``,h.current=g.current,d?.(!1))});G(()=>{(f||u===null)&&(p.clear(),g.current=null,m.current!==``&&(m.current=``,d?.(!1)))},[f,u,p,d]);let b=_.useMemo(()=>({onKeyDown:v,onBlur:y}),[v,y]);return _.useMemo(()=>c?{reference:b,floating:b}:{},[c,b])}var bp=.1,xp=bp*bp,Sp=.5;function Cp(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function wp(e,t,n,r,i,a,o,s,c,l){let u=!1;return Cp(e,t,n,r,i,a)&&(u=!u),Cp(e,t,i,a,o,s)&&(u=!u),Cp(e,t,o,s,c,l)&&(u=!u),Cp(e,t,c,l,n,r)&&(u=!u),u}function Tp(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function Ep(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function Dp(e={}){let{blockPointerEvents:t=!1}=e,n=new Uo,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*xp;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=ps(r),g=r.type===`mouseleave`,_=Y(u,h),v=Y(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&go(r.relatedTarget)&&Y(u,r.relatedTarget))return;function y(){return!!(s&&Js(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=Ep(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=Ep(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=Ep(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=Ep(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!Tp(d,f,x)||!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?Sp/2:Sp*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+Sp+1,o=C||T?S.bottom-Sp:S.top,s=C?T?S.bottom-Sp:S.top:S.bottom-Sp;M=wp(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?Sp/2:Sp*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-Sp,o=C||T?S.top+Sp:S.bottom,s=C?T?S.top+Sp:S.bottom:S.top+Sp;M=wp(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?Sp/2:Sp*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+Sp+1,o=w||E?S.right-Sp:S.left,s=w?E?S.right-Sp:S.left:S.right-Sp;M=wp(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?Sp/2:Sp*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-Sp,o=w||E?S.left+Sp:S.right,s=w?E?S.left+Sp:S.right:S.left+Sp;M=wp(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}function Op(e,t,n){let{reference:r,floating:i}=e,a=mc(t),o=hc(t),s=pc(o),c=uc(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=dc(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function kp(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}=lc(t,e),p=Dc(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Oc(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=Oc(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 Ap=50,jp=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:kp},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Op(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<Ap&&(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}=Op(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Mp=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}=lc(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=uc(r),_=mc(o),v=uc(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Tc(o)]:_c(o)),x=p!==`none`;!d&&x&&b.push(...wc(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=gc(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`||_===mc(t)||T.every(e=>mc(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=mc(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{}}}},Np=new Set([`left`,`top`]);async function Pp(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=uc(n),s=dc(n),c=mc(n)===`y`,l=Np.has(o)?-1:1,u=a&&c?-1:1,d=lc(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 Fp=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 Pp(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}}}}},Ip=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}=lc(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=mc(i),p=fc(f),m=u[p],h=u[f],g=(e,t)=>cc(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}}}}}},Lp=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}=lc(e,t),u={x:n,y:r},d=mc(i),f=fc(d),p=u[f],m=u[d],h=lc(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=Np.has(uc(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}}}},Rp=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}=lc(e,t),c=await i.detectOverflow(t,s),l=uc(n),u=dc(n),d=mc(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=nc(p-c[m],g),y=nc(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*rc(c.left,c.right):S=p-2*rc(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 zp(e){let t=Ao(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=_o(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=ic(n)!==a||ic(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Bp(e){return go(e)?e:e.contextElement}function Vp(e){let t=Bp(e);if(!_o(t))return oc(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=zp(t),o=(a?ic(n.width):n.width)/r,s=(a?ic(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}var Hp=oc(0);function Up(e){let t=po(e);return!Oo()||!t.visualViewport?Hp:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Wp(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===po(e)}function Gp(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Bp(e),o=oc(1);t&&(r?go(r)&&(o=Vp(r)):o=Vp(e));let s=Wp(a,n,r)?Up(a):oc(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=po(a),t=go(r)?po(r):r,n=e,i=Fo(n);for(;i&&t!==n;){let e=Vp(i),t=i.getBoundingClientRect(),r=Ao(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=po(i),i=Fo(n)}}return Oc({width:u,height:d,x:c,y:l})}function Kp(e,t){let n=jo(e).scrollLeft;return t?t.left+n:Gp(mo(e)).left+n}function qp(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Kp(e,n),y:n.top+t.scrollTop}}function Jp(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=mo(r),s=t?xo(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=oc(1),u=oc(0),d=_o(r);if((d||!a)&&((fo(r)!==`body`||yo(o))&&(c=jo(r)),d)){let e=Gp(r);l=Vp(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?qp(o,c):oc(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 Yp(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Xp(e){let t=jo(e),n=e.ownerDocument.body,r=rc(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=rc(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Kp(e),o=-t.scrollTop;return Ao(n).direction===`rtl`&&(a+=rc(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Zp=25;function Qp(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=po(e),a=mo(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Oo()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Kp(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<=Zp&&(s-=o)}return{width:s,height:c,x:l,y:u}}function $p(e,t){let n=Gp(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Vp(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function em(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Qp(e,n,t);else if(t===`document`)r=Xp(mo(e));else if(go(t))r=$p(t,n);else{let n=Up(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Oc(r)}function tm(e,t){let n=t.get(e);if(n)return n;let r=Po(e,[],!1).filter(e=>go(e)&&fo(e)!==`body`),i=null,a=Ao(e).position===`fixed`,o=a?Mo(e):e;for(;go(o)&&!ko(o);){let e=Ao(o),t=Eo(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Mo(o)}return t.set(e,r),r}function nm(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?xo(t)?[]:tm(t,this._c):[].concat(n),r],o=em(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=em(t,a[e],i);s=rc(n.top,s),c=nc(n.right,c),l=nc(n.bottom,l),u=rc(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function rm(e){let{width:t,height:n}=zp(e);return{width:t,height:n}}function im(e,t,n){let r=_o(t),i=mo(t),a=n===`fixed`,o=Gp(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=oc(0);if((r||!a)&&((fo(t)!==`body`||yo(i))&&(s=jo(t)),r)){let e=Gp(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Kp(i));let l=i&&!r&&!a?qp(i,s):oc(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 am(e){return Ao(e).position===`static`}function om(e,t){if(!_o(e)||Ao(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return mo(e)===n&&(n=n.ownerDocument.body),n}function sm(e,t){let n=po(e);if(xo(e))return n;if(!_o(e)){let t=Mo(e);for(;t&&!ko(t);){if(go(t)&&!am(t))return t;t=Mo(t)}return n}let r=om(e,t);for(;r&&bo(r)&&am(r);)r=om(r,t);return r&&ko(r)&&am(r)&&!Eo(r)?n:r||Do(e)||n}var cm=async function(e){let t=this.getOffsetParent||sm,n=this.getDimensions,r=await n(e.floating);return{reference:im(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function lm(e){return Ao(e).direction===`rtl`}var um={convertOffsetParentRelativeRectToViewportRelativeRect:Jp,getDocumentElement:mo,getClippingRect:nm,getOffsetParent:sm,getElementRects:cm,getClientRects:Yp,getDimensions:rm,getScale:Vp,isElement:go,isRTL:lm};function dm(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function fm(e,t,n){let r=null,i,a=mo(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=ac(d),h=ac(a.clientWidth-(u+f)),g=ac(a.clientHeight-(d+p)),_=ac(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:rc(0,nc(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!dm(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=po(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function pm(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=Bp(e),u=i||a?[...l?Po(l):[],...t?Po(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?fm(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?Gp(e):null;c&&g();function g(){let t=Gp(e);h&&!dm(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 mm=Fp,hm=Ip,gm=Mp,_m=Rp,vm=Lp,ym=(e,t,n)=>{let r=new Map,i=n??{},a={...um,...i.platform,_c:r};return jp(e,t,{...i,platform:a})},bm=typeof document<`u`?_.useLayoutEffect:function(){};function xm(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(!xm(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)&&!xm(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Sm(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Cm(e,t){let n=Sm(e);return Math.round(t*n)/n}function wm(e){let t=_.useRef(e);return bm(()=>{t.current=e}),t}function Tm(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]=_.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=_.useState(r);xm(f,r)||p(r);let[m,h]=_.useState(null),[g,v]=_.useState(null),y=_.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=_.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||m,S=o||g,C=_.useRef(null),w=_.useRef(null),T=_.useRef(u),E=c!=null,D=wm(c),O=wm(i),k=wm(l),A=_.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),ym(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!xm(T.current,t)&&(T.current=t,tu.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);bm(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=_.useRef(!1);bm(()=>(j.current=!0,()=>{j.current=!1}),[]),bm(()=>{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=_.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=_.useMemo(()=>({reference:x,floating:S}),[x,S]),P=_.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=Cm(N.floating,u.x),r=Cm(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Sm(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return _.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var Em=(e,t)=>{let n=mm(e);return{name:n.name,fn:n.fn,options:[e,t]}},Dm=(e,t)=>{let n=hm(e);return{name:n.name,fn:n.fn,options:[e,t]}},Om=(e,t)=>({fn:vm(e).fn,options:[e,t]}),km=(e,t)=>{let n=gm(e);return{name:n.name,fn:n.fn,options:[e,t]}},Am=(e,t)=>{let n=_m(e);return{name:n.name,fn:n.fn,options:[e,t]}};function jm(e){let{nodeId:t,externalTree:n,rootContext:r}=e,i=r.useState(`referenceElement`),a=r.useState(`floatingElement`),o=r.useState(`domReferenceElement`),s=r.useState(`open`),c=r.useState(`floatingId`),[l,u]=_.useState(null),d=_.useRef(null),f=cf(n),p=_.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),m=Tm({...e,elements:{...p,...l&&{reference:l}}}),h=_.useCallback(e=>{let t=go(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),m.refs.setReference(t)},[m.refs]),g=_.useMemo(()=>({...m.refs,setPositionReference:h,domReference:d}),[m.refs,h]),v=_.useMemo(()=>({...m.elements,domReference:o}),[m.elements,o]),y=_.useMemo(()=>({...m,dataRef:r.context.dataRef,open:s,onOpenChange:r.setOpen,events:r.context.events,floatingId:c,refs:g,elements:v,nodeId:t,rootStore:r}),[m,g,v,t,r,s,c]);return G(()=>{o&&(d.current=o)},[o]),G(()=>{r.context.dataRef.current.floatingContext=y;let e=f?.nodesRef.current.find(e=>e.id===t);e&&(e.context=y)}),_.useMemo(()=>({...m,context:y,refs:g,elements:v,rootStore:r}),[m,g,v,y,r])}var Mm=_.createContext(void 0);function Nm(){return _.useContext(Mm)?.direction??`ltr`}var Pm=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}=lc(e,t)||{};if(l==null)return{};let d=Dc(u),f={x:n,y:r},p=hc(i),m=pc(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=s.floating[y]||a.floating[m],C=b/2-x/2,w=S/2-h[m]/2-1,T=Math.min(d[_],w),E=Math.min(d[v],w),D=T,O=S-h[m]-E,k=S/2-h[m]/2+C,A=cc(D,k,O),j=!c.arrow&&dc(i)!=null&&k!==A&&a.reference[m]/2-(k<D?T:E)-h[m]/2<0,M=j?k<D?k-D:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),Fm=(e,t)=>{let{name:n,fn:r}=Pm(e);return{name:n,fn:r,options:[e,t]}},Im={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},Lm={sideX:`left`,sideY:`top`},Rm=`--available-width`,zm=`--available-height`,Bm=`--anchor-width`,Vm=`--anchor-height`,Hm=`--transform-origin`,Um=Rm,Wm=zm;function Gm(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function Km(e,t,n){let{rects:r,placement:i}=e;return{side:Gm(t,uc(i),n),align:dc(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function qm(e){return Jm(e,jm)}function Jm(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:g,collisionAvoidance:v,shift:y,nodeId:b,adaptiveOrigin:x,lazyFlip:S=!1,externalTree:C}=e,w=v.side||`flip`,T=v.align||`flip`,E=v.fallbackAxisSide||`end`,D=y?.crossAxis??!1,O=y?.rootBoundary,k=typeof n==`function`?n:void 0,A=K(k),j=k?A:n,M=Md(n),N=Md(g),P=Nm()===`rtl`,[F,I]=_.useState(null);!g&&F!==null&&I(null);let L=S===`placement`,R=F?uc(F):null,z=F&&L?dc(F)||`center`:null,ee=R||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":P?`left`:`right`,"inline-start":P?`right`:`left`}[i],te=z||o,ne=te===`center`?ee:`${ee}-${te}`,re=l;typeof re==`number`?re={top:re,right:re,bottom:re,left:re}:re&&={top:re.top||0,right:re.right||0,bottom:re.bottom||0,left:re.left||0};let ie=+(i===`bottom`),ae=+(i===`top`),B=+(i===`right`),V=+(i===`left`),oe={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:re},se=_.useRef(null),ce=Md(a),H=Md(s),le=typeof a==`function`?0:a,ue=typeof s==`function`?0:s,de=[];p&&de.push(p),de.push(Em(e=>{let t=Km(e,i,P),n=typeof ce.current==`function`?ce.current(t):ce.current,r=typeof H.current==`function`?H.current(t):H.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[le,ue,P,i]));let fe=T===`none`&&w!==`shift`,pe=!fe&&(u||D||w===`shift`),me=w===`none`?null:km({...oe,padding:{top:re.top+1+ie,right:re.right+1+V,bottom:re.bottom+1+ae,left:re.left+1+B},mainAxis:!D&&w===`flip`,crossAxis:T===`flip`&&`alignment`,fallbackAxisSideDirection:E}),he=fe?null:Dm({...oe,rootBoundary:O,mainAxis:T!==`none`,crossAxis:pe,limiter:u||D?void 0:Om(e=>{if(!se.current)return{};let{width:t,height:n}=se.current.getBoundingClientRect(),r=mc(uc(e.placement)),i=r===`y`?t:n,a=r===`y`?re.left+re.right:re.top+re.bottom;return{offset:i/2+a/2}})},[oe,u,D,O,re,T]);w===`shift`||T===`shift`||te===`center`?de.push(he,me):de.push(me,he),de.push(Am({...oe,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!N.current)return;let i=e.style;i.setProperty(Um,`${t}px`),i.setProperty(Wm,`${n}px`);let a=po(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(Bm,`${u}px`),i.setProperty(Vm,`${d}px`)}}),Fm(e=>({element:se.current||q(e.elements.floating).createElement(`div`),padding:se.current?d:0}),[d]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=uc(r),u=dc(r),d=mc(l)===`y`,f=se.current,p=typeof a==`function`?a(Km(e,i,P)):a,m;m=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&o.isRTL?.(t)===!0)?`100%`:`0%`:`${(d?n.arrow?.x||0:n.arrow?.y||0)+(d?f?.clientWidth||0:f?.clientHeight||0)/2}px`;let h=l===`top`||l===`left`?`calc(100% + ${p}px)`:`${-p}px`;return pe&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(Hm,d?`${m} ${h}`:`${h} ${m}`),{}}},Im,x),G(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let ge=_.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:_e,elements:ve,x:ye,y:be,middlewareData:xe,update:U,placement:Se,context:Ce,isPositioned:we,floatingStyles:Te}=t({rootContext:h,open:m?g:void 0,placement:ne,middleware:de,strategy:r,whileElementsMounted:m?void 0:(...e)=>pm(...e,ge),nodeId:b,externalTree:C}),{sideX:Ee,sideY:De}=xe.adaptiveOrigin||Lm,Oe=we?r:`fixed`,ke=_.useMemo(()=>{let e;return e=we?x?{position:Oe,[Ee]:ye,[De]:be}:{...Te,position:Oe}:{position:Oe,top:0,left:0},e[Um]=`100vw`,e[Wm]=`100vh`,we||(e.opacity=0),e},[x,Oe,Ee,ye,De,be,Te,we]),Ae=_.useRef(null);G(()=>{if(!g)return;let e=M.current,t=typeof e==`function`?e():e,n=(Ym(t)?t.current:t)||null;n!==Ae.current&&(_e.setPositionReference(n),Ae.current=n)},[g,_e,j,M]),_.useEffect(()=>{if(!g)return;let e=M.current;typeof e!=`function`&&Ym(e)&&e.current!==Ae.current&&(_e.setPositionReference(e.current),Ae.current=e.current)},[g,_e,j,M]),_.useEffect(()=>{if(m&&g&&ve.reference&&ve.floating)return pm(ve.reference,ve.floating,U,ge)},[m,g,ve,U,ge]);let je=uc(Se),Me=Gm(i,je,P),Ne=dc(Se)||`center`,Pe=!!xe.hide?.referenceHidden;G(()=>{S&&g&&we&&(je!==ee||L&&Ne!==te)&&I(Se)},[S,L,g,we,Se,je,Ne,ee,te]);let Fe=_.useMemo(()=>({position:`absolute`,top:xe.arrow?.y,left:xe.arrow?.x}),[xe.arrow]),Ie=xe.arrow?.centerOffset!==0;return _.useMemo(()=>({positionerStyles:ke,arrowStyles:Fe,arrowRef:se,arrowUncentered:Ie,side:Me,align:Ne,physicalSide:je,anchorHidden:Pe,refs:_e,context:Ce,isPositioned:we,update:U}),[ke,Fe,se,Ie,Me,Ne,je,Pe,_e,Ce,we,U])}function Ym(e){return e!=null&&`current`in e}function Xm(e){return e===`starting`?ou:Ma}function Zm(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),Vl(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},Xm(r),i],stateAttributesMapping:Ls})}function Qm(){let e=za(),t=e.useState(`toasts`);return _.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function $m(){let e=new Set;function t(t){e.forEach(e=>e(t))}return{" subscribe":function(t){return e.add(t),()=>{e.delete(t)}},add(e){let n=e.id||Jo(`toast`);return t({action:`add`,options:{...e,id:n,transitionStatus:`starting`}}),n},close(e){t({action:`close`,options:{id:e}})},update(e,n){t({action:`update`,options:{id:e,updates:n}})},promise(e,n){let r=e;return t({action:`promise`,options:{...n,promise:e,setPromise(e){r=e}}}),r}}}var eh=48,th=(e,t=0)=>{let n=new Int32Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r)-eh-t;return n},nh=e=>{let t=new Int32Array(e.length+1);for(let n=0;n<e.length;n++)t[n+1]=t[n]+e[n];return t},rh=e=>{let t=new Int32Array(e.length),n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r)-eh;n+=i>>>1^-(i&1),t[r]=n}return t},ih=384,ah=[],oh=nh(th(`E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010`)),sh=nh(th(`:11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3`)),ch=`@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom`,lh=(()=>{let e=oh.length-1,t=new Int32Array(e);for(let n=e-1;n>=0;n--){let e=1,r=n+1;for(let i=oh[n];i<oh[n+1];i++)e+=t[r],r+=t[r];t[n]=e}let n=new Int32Array(oh[e]),r=0;for(let i=0;i<e;i++){let e=i+1;for(let a=oh[i];a<oh[i+1];a++)n[r++]=e,e+=t[e]}return n})(),uh=th(`02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000…ŏ000ˆ0000ŏ0000000000—0000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000`,1),dh=nh(th(`123333359346463635126536711576`)),fh=th(`93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032`),ph=th(`012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199`),mh=rh(`020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200`),hh=(()=>{let e=new Int32Array(319).fill(-1),t=rh(`02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222`),n=rh(`02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222`);for(let r=0;r<t.length;r++)e[t[r]]=n[r];return e})(),gh=`container |break-after- all auto avoid avoid-page column left page right|break-before- all auto avoid avoid-page column left page right|break-inside-a uto void void-column void-page|box-decoration- clone slice|box- border content| contents flow-root hidden table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group| not-sr-only sr-only|float- end left none right start|clear- both end left none right start|isolat e ion-auto|overflow- auto clip hidden scroll visible|overflow-x- auto clip hidden scroll visible|overflow-y- auto clip hidden scroll visible|overscroll- auto contain none|overscroll-x- auto contain none|overscroll-y- auto contain none| absolute fixed relative static sticky| collapse invisible visible|justify- around baseline between center center-safe end end-safe evenly normal start stretch|justify-items- center center-safe end end-safe normal start stretch|justify-self- auto center center-safe end end-safe start stretch|items- baseline baseline-last center center-safe end end-safe start stretch|self- auto baseline baseline-last center center-safe end end-safe start stretch|place-content- around baseline between center center-safe end end-safe evenly start stretch|place-items- baseline center center-safe end end-safe start stretch|place-self- auto center center-safe end end-safe start stretch| antialiased subpixel-antialiased| italic not-italic|normal-nums |ordinal |slashed-zero | lining-nums oldstyle-nums| proportional-nums tabular-nums| diagonal-fractions stacked-fractions| no-underline overline| capitalize lowercase normal-case uppercase|truncate |whitespace- break-spaces normal nowrap pre pre-line pre-wrap|break- all keep normal words|wrap- anywhere break-word normal|hyphens- auto manual none|mix-blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay plus-darker plus-lighter saturation screen soft-light|table- auto fixed|caption- bottom top|backface- hidden visible|appearance- auto none|scheme- dark light light-dark normal only-dark only-light|field-sizing- content fixed|pointer-events- auto none|resize -none -x -y|snap- align-none center end start|snap- always normal|snap- both none x y|snap- mandatory proximity|touch- auto manipulation none|touch-pan- left right x|touch-pan- down up y|touch-pinch-zoom |select- all auto none text|forced-color-adjust- auto none| normal size| baseline bottom middle sub super text-bottom text-top top| bounce none ping pulse spin| auto square video| auto fr max min px|none | auto full px| fixed local scroll|clip- border content padding text|origin- border content padding| bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| no-repeat repeat repeat-round repeat-space repeat-x repeat-y| auto contain cover| gradient-to-b gradient-to-bl gradient-to-br gradient-to-l gradient-to-r gradient-to-t gradient-to-tl gradient-to-tr none|blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay saturation screen soft-light|to- b bl br l r t tl tr| auto dvh fit full lh lvh max min px screen svh| dashed dotted double hidden none solid| collapse separate|px |auto |full | content none strict| inline-size size|layout |paint |style | around baseline between center center-safe end end-safe evenly normal start stretch| alias all-scroll auto cell col-resize context-menu copy crosshair default e-resize ew-resize grab grabbing help move n-resize ne-resize nesw-resize no-drop none not-allowed ns-resize nw-resize nwse-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait zoom-in zoom-out| dashed dotted double solid wavy| auto from-font|reverse |initial | in in-out initial linear out| col col-reverse row row-reverse| nowrap wrap wrap-reverse| auto initial none| black bold extrabold extralight light medium normal semibold thin| condensed expanded extra-condensed extra-expanded normal semi-condensed semi-expanded ultra-condensed ultra-expanded|flow- col col-dense dense row row-dense| none subgrid| auto dvh dvw fit full lh lvh lvw max min px screen svh svw| block flex grid table| auto dvw fit full lvw max min px screen svw| loose none normal px relaxed snug tight|through |item | inside outside| decimal disc none| auto px| clip-border clip-content clip-fill clip-padding clip-stroke clip-view no-clip| add exclude intersect subtract| alpha luminance match|origin- border content fill padding stroke view|type- alpha luminance| circle ellipse| closest-corner closest-side farthest-corner farthest-side|at- bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| dvh fit full lh lvh max min none px screen svh| auto dvh dvw fit full lh lvh lvw max min none px screen svh svw| dvw fit full lvw max min none px screen svw| auto dvh dvw fit full lvh lvw max min none prose px svh svw| auto dvh dvw fit full lvh lvw max min none px screen svh svw| contain cover fill none scale-down| first last none| distant dramatic midrange near none normal|inset | full none|3d | auto smooth|gutter- auto both stable| auto none thin| inner none| auto dvh dvw fit full lvh lvw max min px svh svw|base | center end justify left right start| clip ellipsis| balance nowrap pretty wrap| normal tight tighter wide wider widest| cpu gpu none| 3d flat| all colors none opacity shadow transform| discrete normal| full px| auto dvh dvw fit full lvh lvw max min px screen svh svw| auto contents scroll transform`.split(`|`).map(e=>{let t=e.split(` `),n=t.shift();for(let e=0;e<t.length;e++)t[e]=n+t[e];return t}),_h=rh(`0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422`),vh=rh(`ɠ222222222222222222222222222222222222222222222222222222222222˕4222226>ʶ22ʷʺʷ2ʸʷ42ʴ2ʓ22>621422ɶ222ɹɼɷɺɷɺ22ɱ42222ɨ2ɧ26622ɘɓ244ƸƵ222]d24242ǖǓƚÄȫ2263ȨȥȨ2222222ǣ222222222222222222ǂƽ2ƾƵ2222222422222ƜƑ22222222222222222222144Ŧţ22Ţş222222222222222222222ĸ2ı68ĦģĦɡŰ4Ġ«®ĝ822ĔđĔ2ē2222622`),yh=rh(`02222222222222222222222222222222222222222222222222222222222222222202022222222222EH2200IL021042222Y\\222IL0cf2e10j2222U00X202[^2y0000120|{~‚22…ˆ‡:22|22222222222G000q†OVI00000}š2›>40000ŒB00000I¨©000¬00000000000000021M®­00°“000000000000000000000–222›HGHa1º222¿2À2222ÉÌ000­°2±`),bh=new Int32Array(995),xh=new Int32Array(995),Sh=new Int32Array(995),Ch=``,wh=new Int32Array(1038);{let e=new Map,t=0,n=0;for(let r=0;r<_h.length;r++)for(let i of gh[yh[r]]){let a=e.get(i);a===void 0&&(a=t++,e.set(i,a),wh[a*2]=Ch.length,wh[a*2+1]=i.length,Ch+=i),bh[n]=_h[r],xh[n]=vh[r],Sh[n]=a,n++}}var Th=rh(`0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p`),Eh=nh(th(`1::24444432:442:44:44>222222:44:4421322511111311111114`)),Dh=rh(`2Š4A;33N=C@H4A;33N=C@<27;83:;8393NQ:3NQʰ222ˉºŴŽ2R2=18cƴÅҜ=cĞÛC1ƈǝȈ:ħ25=11D3A@4=<1;1DEr25;11B3?<6;:371BCn9@7=<8192>2E121@9@EHE@9>2T25511<398454131<=V25511<398454131<=„ƧNž2Đå242L222290000f22500ɛ000ǘ222`),Oh=th(`ij`),kh=th(`—`),Ah=th(`1`),jh={GROUP_COUNT:ih,customValidatorNames:ah,edgeStart:oh,labelStart:sh,labelText:ch,edgeTarget:lh,nodeGroup:uh,nodeVlist:hh,vlistPat:dh,vlistOps:fh,vlistRef:ph,vlistGroup:mh,litAnchor:bh,litGroup:xh,litPool:Sh,poolOffsets:wh,poolText:Ch,adjGid:Th,adjStart:Eh,adjTgt:Dh,patGid:Oh,patTgt:kh,postfixLookupGroups:Ah,orderSensitiveModifiers:`* ** after backdrop before details-content file first-letter first-line marker placeholder selection`},Mh=`line`in Error(),Nh=-1,Ph=-1,Fh=(e,t,n)=>{let r=2166136261;for(let i=t;i<n;i++)r=Math.imul(r^e.charCodeAt(i),16777619);return r},Ih=(e,t,n)=>{let r=n-t,i=Math.imul(r,2654435761)^e.charCodeAt(t);if(r>3){let a=r>>2,o=r>>1;i=Math.imul(i^e.charCodeAt(t+1)<<8^e.charCodeAt(t+2)<<16^e.charCodeAt(t+a),2246822507),i=Math.imul(i^e.charCodeAt(t+o)<<8^e.charCodeAt(t+o+a)<<16^e.charCodeAt(n-3),3266489909),i^=e.charCodeAt(n-2)<<8^e.charCodeAt(n-1)<<16;for(let r=t+3,a=n-4;r<t+8&&r<a;r++,a--)i=Math.imul(i^e.charCodeAt(r)^e.charCodeAt(a)<<8,16777619)}return i^i>>>15},Lh=(e,t,n={})=>{let{GROUP_COUNT:r,edgeStart:i,labelStart:a,labelText:o,edgeTarget:s,nodeGroup:c,nodeVlist:l,vlistPat:u,vlistOps:d,vlistRef:f,vlistGroup:p,litAnchor:m,litGroup:h,litPool:g,poolOffsets:_,poolText:v,adjGid:y,adjStart:b,adjTgt:x,patGid:S,patTgt:C,postfixLookupGroups:w,customValidatorNames:T,orderSensitiveModifiers:E}=e,D=new Int32Array(r).fill(-1);for(let e=0;e<y.length;e++)D[y[e]]=e;let O=0;for(let e=0;e+1<b.length;e++){let t=b[e+1]-b[e];t>O&&(O=t)}let k=32;for(;k<2*(1+O+S.length);)k<<=1;let A=new Int32Array(f.length+1);for(let e=0;e<f.length;e++)A[e+1]=A[e]+u[f[e]+1]-u[f[e]];let j=new Uint8Array(r);for(let e=0;e<w.length;e++)j[w[e]]=1;let M=i.length-1,N=new Uint8Array(M),P=0,F=!0;for(let e=0;e<m.length;e++){N[m[e]]=1;let t=_[g[e]*2+1];t>P&&(P=t);let n=v.charCodeAt(_[g[e]*2]);(n===91||n===40)&&(F=!1)}let I=1;for(;I<m.length*2;)I<<=1;let L=new Int32Array(I).fill(-1);for(let e=0;e<m.length;e++){let t=_[g[e]*2],n=(Fh(v,t,t+_[g[e]*2+1])^Math.imul(m[e],2654435761)|0)&I-1;for(;L[n]!==-1;)n=n+1&I-1;L[n]=e}let R=(e,t,n,r)=>{let i=(Fh(t,n,r)^Math.imul(e,2654435761)|0)&I-1,a=r-n;for(;;){let r=L[i];if(r===-1)return-1;if(m[r]===e&&_[g[r]*2+1]===a){let e=_[g[r]*2],i=!0;for(let r=0;r<a;r++)if(v.charCodeAt(e+r)!==t.charCodeAt(n+r)){i=!1;break}if(i)return h[r]}i=i+1&I-1}},z=n.cacheSize??8192,ee=n.prefix??e.prefix??``,te=ee===``?``:ee+`:`,ne=te.length,re=(T??[]).map(e=>{let n=t&&t[e];if(!n)throw Error(`cn: missing validator `+e);return n}),ie=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ae=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,B=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,V=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,oe=0,se=-1,ce=-1,H=-1,le=-1,ue=e=>e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95,de=e=>/\s/.test(String.fromCharCode(e)),fe=(e,t,n)=>{if(oe=0,se=-1,n-t<3)return;let r=e.charCodeAt(t),i=e.charCodeAt(n-1);if(r===91&&i===93)oe=1;else if(r===40&&i===41)oe=2;else return;H=t+1,le=n-1;let a=t+1;if(ue(e.charCodeAt(a))){for(a++;a<n-1;){let t=e.charCodeAt(a);if(!ue(t)&&t!==45)break;a++}a<n-2&&e.charCodeAt(a)===58&&(se=t+1,ce=a,H=a+1)}},pe=(e,t,n,r)=>{if(n-t!==r.length)return!1;for(let n=0;n<r.length;n++)if(e.charCodeAt(t+n)!==r.charCodeAt(n))return!1;return!0},me=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,he=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ge=e=>!!e&&!Number.isNaN(Number(e)),_e=(e,t,n)=>{if(n-t<11||!pe(e,t,t+10,`@container`))return!1;if(e.charCodeAt(t+10)===47)return n-t>=12;let r=e.charCodeAt(t+11);return r===115&&n-t>=17&&pe(e,t+10,t+16,`-size/`)||r===110&&n-t>=19&&pe(e,t+10,t+18,`-normal/`)},ve=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],ye=`length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight`.split(`|`).map(e=>e.split(` `)),be=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],xe=(e,t,n,r)=>{if(e>=10){if(e>=25)return re[e-25](t.slice(n,r));let i=e-10;if(oe!==ve[i])return!1;if(se>=0){for(let e of ye[i])if(pe(t,se,ce,e))return!0;return!1}switch(be[i]){case 0:return!1;case 1:return!0;case 2:{let e=t.slice(H,le);return ie.test(e)&&!ae.test(e)}case 3:return ge(t.slice(H,le));case 4:return V.test(t.slice(H,le));default:return B.test(t.slice(H,le))}}switch(e){case 0:return!0;case 1:return oe===0;case 2:return oe===1;case 3:return oe===2;case 4:return me.test(t.slice(n,r));case 5:return ge(t.slice(n,r));case 6:{let e=t.slice(n,r);return!!e&&Number.isInteger(Number(e))}case 7:return r>n&&t.charCodeAt(r-1)===37&&ge(t.slice(n,r-1));case 8:return he.test(t.slice(n,r));default:return _e(t,n,r)}},U=new Set(typeof E==`string`?E.split(` `):E),Se=(e,t,n,r,i,a)=>{let o=Fh(t,n,r)^(i?2654435769:0),s=e.get(o);if(s!==void 0)outer:for(let e=0;e<s.length;e++){let a=s[e];if(a.imp===i&&a.k.length===r-n){for(let e=0;e<a.k.length;e++)if(a.k.charCodeAt(e)!==t.charCodeAt(n+e))continue outer;return a.id}}else e.set(o,s=[]);let c=t.slice(n,r),l=a(c);return s.push({k:c,imp:i,id:l}),l},Ce=new Map,we=new Map,Te=2,Ee=4096,De=(e,t)=>{let n=[],r=0,i=0,a=0;for(let t=0;t<e.length;t++){let o=e.charCodeAt(t);r===0&&i===0&&o===58?(n.push(e.slice(a,t)),a=t+1):o===91?r++:o===93?r--:o===40?i++:o===41&&i--}n.push(e.slice(a));let o=n[0];if(n.length>1){let e=[],t=[];for(let r of n)r.charCodeAt(0)===91||U.has(r)?(t.length&&(e.push(...t.sort()),t=[]),e.push(r)):t.push(r);t.length&&e.push(...t.sort()),o=e.join(`:`)}let s=t?o+` !`:o,c=we.get(s);return c===void 0&&we.set(s,c=Te++),c},Oe=new Map,ke=r,Ae=r+4096,je=()=>ke++,Me=2097152,Ne=8192,Pe=new Int32Array(Ne),Fe=Array(Ne).fill(null),Ie=new Int32Array(Ne),Le=new Int32Array(Ne),Re=new Uint8Array(Ne),ze=0,Be=(e,t,n,r,i,a,o,s)=>{let c=e;if(Fe[e]!==null){if(Fe[e|1]===null)c=e|1;else if(!(ze++&3))c=e|ze>>2&1;else return}Fe[c]=t.slice(n,r),Pe[c]=i,Ie[c]=a,Le[c]=o,Re[c]=s},Ve=()=>Fe.fill(null),He=256,Ue=[new Int32Array(He),new Int32Array(He),new Int32Array(He),new Int32Array(He)],[W,We,Ge,Ke]=Ue,qe=new Uint8Array(He),Je=new Uint8Array(He),Ye=()=>{He*=2,Ue=Ue.map(e=>{let t=new Int32Array(He);return t.set(e),t}),[W,We,Ge,Ke]=Ue;let e=new Uint8Array(He);e.set(qe),qe=e,Je=new Uint8Array(He)},Xe=64,Ze=new Int32Array(Xe),Qe=new Int32Array(Xe),$e=new Int32Array(r),et=2048,tt=21,nt=new Float64Array(et),rt=new Int32Array(et),it=0,at=(e,t)=>{if(e===0&&t<r)return $e[t]===it?1:($e[t]=it,0);let n=e*2097152+t+1,i=Math.imul(n,2654435761)>>>tt;for(;rt[i]===it;){if(nt[i]===n)return 1;i=i+1&et-1}return nt[i]=n,rt[i]=it,0},ot=(e,t,n,r,i)=>{if(n-t>=2&&e.charCodeAt(t)===91&&e.charCodeAt(n-1)===93){let r=-1;for(let i=t+1;i<n-1;i++)if(e.charCodeAt(i)===58){r=i;break}return r===-1||r===t+1?Nh:Se(Oe,e,t+1,r,0,je)}if(r>=0&&c[r]>=0)return c[r];for(let t=i-1;t>=0;t--){let r=Qe[t];if(r>n)continue;let i=Ze[t],a=n-r;if(N[i]===1&&a>0&&a<=P){let t=e.charCodeAt(r);if(F===!1||t!==91&&t!==40){let t=R(i,e,r,n);if(t>=0)return t}}let o=l[i];if(o<0)continue;let s=f[o],c=u[s],m=u[s+1];if(c===m)continue;fe(e,r,n);let h=A[o]-c;for(let t=c;t<m;t++)if(xe(d[t],e,r,n))return p[h+t]}return Nh},st=e=>{let t=e.length,n=0,c=0,u=!1;(Te>Ee||Ce.size>Ee)&&(Ce=new Map,we=new Map,Te=2,Ve()),ke>Ae&&(Oe=new Map,ke=r,Ve());let d=0;for(;d<t;){let f=e.charCodeAt(d);if(f===32||f>=9&&f<=13||f>=160&&de(f)){f!==32&&(u=!0),d++;continue}let p=d,m=0;for(;d<t;){if(f=e.charCodeAt(d),f<=32){if(f===32)break;if(f>=9&&f<=13){u=!0;break}}else if(f>=160&&de(f)){u=!0;break}m=Math.imul(m^f,16777619),d++}let h=d,g=h-p;n===He&&Ye();let _=n++;W[_]=p,We[_]=h,c+=g,m^=Math.imul(g,2654435761);let v=m^m>>>15,y=v&8190;{let t=-1;if(Pe[y]===v&&Fe[y]!==null&&Fe[y].length===g?t=y:Pe[y|1]===v&&Fe[y|1]!==null&&Fe[y|1].length===g&&(t=y|1),t>=0){let n=Fe[t],r=!0;for(let t=0;t<g;t++)if(n.charCodeAt(t)!==e.charCodeAt(p+t)){r=!1;break}if(r){Ge[_]=Ie[t],Ke[_]=Le[t],qe[_]=Re[t];continue}}}let b=p;if(ne!==0){if(h-p<=ne||!e.startsWith(te,p)){Ge[_]=Nh,Be(y,e,p,h,v,Nh,0,0);continue}b=p+ne}let x=0,S=0,C=-1,w=-1;for(let t=b;t<h;t++){let n=e.charCodeAt(t);if(x===0&&S===0){if(n===58){C=t;continue}if(n===47){w=t;continue}}n===91?x++:n===93?x--:n===40?S++:n===41&&S--}let T=C>=b?C+1:b,E=T,D=h,O=!1,k=0;D>E&&e.charCodeAt(D-1)===33?(O=!0,D--):D>E&&e.charCodeAt(E)===33&&(O=!0,E++,k=1);let A=-1;w>T&&(A=w+k,A>=D&&(A=-1));let M=E;D-E>1&&e.charCodeAt(E)===45&&(M=E+1);let P=0,F=0,I=0,L=-1,R=0;(l[0]>=0||N[0]===1)&&(Ze[0]=0,Qe[0]=M,R=1);let z=Ph,ee=0;for(let t=M;t<D;t++)if(t===A&&(z=F<I?Ph:P,ee=R),P!==Ph){let n=e.charCodeAt(t),r=-1;if(F<I)o.charCodeAt(F)===n?(F++,F===I&&(r=P=L)):P=Ph;else{let e=i[P],t=i[P+1],c=Ph;for(let i=e;i<t;i++){let e=a[i];if(o.charCodeAt(e)===n){a[i+1]-e===1?r=c=s[i]:(F=e+1,I=a[i+1],L=s[i],c=P);break}}P=c}if(r>=0&&(l[r]>=0||N[r]===1)&&t+1<D&&e.charCodeAt(t+1)===45){if(R===Xe){Xe*=2;let e=new Int32Array(Xe);e.set(Ze),Ze=e;let t=new Int32Array(Xe);t.set(Qe),Qe=t}Ze[R]=r,Qe[R]=t+2,R++}}A===D&&(z=F<I?Ph:P,ee=R);let re=F<I?Ph:P,ie,ae=!1;if(A>=0){if(ae=!0,ie=ot(e,E,A,z,ee),ie!==Nh&&ie<r&&j[ie]){let t=ot(e,E,D,re,R);t!==Nh&&t!==ie&&(ie=t,ae=!1)}else ie===Nh&&(ie=ot(e,E,D,re,R),ae=!1)}else ie=ot(e,E,D,re,R);let B=0,V=0;ie===Nh?Ge[_]=Nh:(V=+!!ae,B=b>=C?+!!O:Se(Ce,e,b,C,+!!O,e=>De(e,O)),Ge[_]=ie,qe[_]=V,Ke[_]=B),Be(y,e,p,h,v,ie,B,V)}if(n===0)return``;if(n===1)return W[0]===0&&We[0]===t?e:e.slice(W[0],We[0]);if(n*k>et){for(;n*k>et;)et<<=1,tt--;nt=new Float64Array(et),rt=new Int32Array(et)}if(Te>=Me||ke>=Me)throw Error(`cn: too many distinct classes in one merge`);it=it+1|0,it===0&&($e.fill(0),rt.fill(0),it=1);let f=!1;for(let e=n-1;e>=0;e--){let t=Ge[e];if(t===Nh){Je[e]=1;continue}let n=Ke[e];if(at(n,t)===1)Je[e]=0,f=!0;else if(Je[e]=1,t<r){let r=D[t];if(r>=0)for(let e=b[r];e<b[r+1];e++)at(n,x[e]);if(qe[e]&1)for(let e=0;e<S.length;e++)S[e]===t&&at(n,C[e])}}if(!f&&!u&&t===c+n-1)return e;let p=``,m=0;for(;m<n;){if(!Je[m]){m++;continue}let t=W[m],r=We[m],i=m+1;for(;i<n&&Je[i]&&W[i]===r+1&&e.charCodeAt(r)===32;)r=We[i],i++;p.length>0&&(p+=` `),p+=e.slice(t,r),m=i}return p},ct=16384,lt=new Int32Array(ct*2),ut=0,dt=1,ft=Object.create(null),pt=Object.create(null),mt=new Map,ht=new Map,gt=0,_t=0,vt=()=>{ut^=ct,dt=dt+1|0,_t=0},yt=e=>{let t=ft[e];if(t!==void 0)return t;let n=Ih(e,0,e.length),r=(n&16383)+ut,i=lt[r]===(n^dt)||lt[r^ct]===(n^dt-1);return i&&(t=pt[e],t!==void 0)?(ft[e]=t,t):(t=st(e),i?(ft[e]=t,++gt>z&&(gt=0,pt=ft,ft=Object.create(null),vt())):(lt[r]=n^dt,++_t>ct&&vt()),t)},bt=e=>{let t=mt.get(e);if(t!==void 0)return t;let n=Ih(e,0,e.length),r=(n&16383)+ut,i=lt[r]===(n^dt)||lt[r^ct]===(n^dt-1);return i&&(t=ht.get(e),t!==void 0)?(mt.set(e,t),t):(t=st(e),i?(mt.set(e,t),++gt>z&&(gt=0,ht=mt,mt=new Map,vt())):(lt[r]=n^dt,++_t>ct&&vt()),t)},xt=e=>{let t=Ih(e,0,e.length),n=(t&16383)+ut;return lt[n]===(t^dt)||lt[n^ct]===(t^dt-1)||(lt[n]=t^dt,++_t>ct&&vt(),!1)},St=z===0?st:Mh?e=>{let t=mt.get(e);return t===void 0?bt(e):t}:yt;return{merge:function(){return arguments.length===1&&typeof arguments[0]==`string`?St(arguments[0]):St(Bh.apply(null,arguments))},mergeString:St,seenBefore:z===0?()=>!1:xt,mergeUncached:st}},Rh=(e,t)=>{if(!e)return``;if(typeof e==`string`)return e;let n=``;if(typeof e.length==`number`&&(!t||Array.isArray(e))){let r=e;for(let e=0;e<r.length;e++){let i=r[e];if(!i)continue;let a=typeof i==`string`?i:Rh(i,t);a&&(n&&(n+=` `),n+=a)}return n}if(t){if(typeof e==`number`)return``+e;if(typeof e==`object`)for(let t in e)e[t]&&(n&&(n+=` `),n+=t)}return n},zh=(e,t)=>{let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(!i)continue;let a=typeof i==`string`?i:Rh(i,t);a&&(n&&(n+=` `),n+=a)}return n},Bh=function(){return zh(arguments,!1)},Vh=256,Hh=16,Uh=1024,Wh=4096,Gh=(e,t)=>{let n=t===void 0?()=>!0:t.seenBefore,r=t===void 0?e:t.mergeUncached,i=new Map,a=new Map,o=0,s=null,c=null,l=[],u=[],d=0,f=(t,n,r)=>{c===null&&(c=Array(Wh).fill(``),l=Array(Wh).fill(``),u=Array(Wh).fill(``));let i=Ih(t,0,t.length)&4094;if(c[i]===t&&l[i]===n)return u[i];if(c[i|1]===t&&l[i|1]===n)return u[i|1];let a=e(r?n+` `+t:t),o=c[i]===``?i:i|(c[i|1]===``?1:d++&1);return c[o]=t,l[o]=n,u[o]=a,a},p=(e,t,n,r)=>{let i=0;if(t){if(t!==e.a0)return!1;i=1}if(n){if(n!==(i===0?e.a0:e.a1))return!1;i++}if(r){if(r!==(i===0?e.a0:i===1?e.a1:e.a2))return!1;i++}return i===e.t},m=(e,t)=>{let n=e.a,r=0;for(let e=0;e<t.length;e++){let i=t[e];if(i){if(i!==n[r])return!1;r++}}return r===e.t},h=(t,c)=>{let l=t.length,u=s===null?null:s.n;if(!c){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let d=``,p=-1,h=0,g=!1;for(let e=0;e<l;e++){let n=t[e];if(n){if(typeof n!=`string`){if(n=t[e]=Rh(n,!0),!n)continue;g=!0}p<0&&(d=n,p=e),h++}}if(h===0)return``;if(h===1)return e(d);if(g){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let _=i.get(d);_===void 0&&(_=a.get(d),_!==void 0&&i.set(d,_));let v=null;if(_!==void 0){if(_.skip>0){_.skip--,s=null;let e=d;for(let n=p+1;n<l;n++){let r=t[n];r&&(e+=` `+r)}return f(e,``,!1)}let e=_.e;outer:for(let n=0;n<e.length;n++){let r=e[n];if(r.t!==h)continue;let i=r.a,a=1;for(let e=p+1;e<l;e++){let n=t[e];if(n&&n!==i[a++])continue outer}v=r;break}v!==null&&(_.miss=0)}if(v===null){let s=d,c=[d];for(let e=p+1;e<l;e++){let n=t[e];n&&(s+=` `+n,c.push(n))}if(!n(s))return r(s);v={r:e(s),t:c.length,a0:c[0],a1:c[1],a2:c[2]??``,a:c,n:null},_===void 0?i.set(d,_={e:[],miss:0,skip:0,at:0}):++_.miss>Hh&&(_.miss=Hh,_.skip=Uh,_.e.length=0,_.at=0);let u=_.e;u.length<Vh?u.push(v):(u[_.at]=v,_.at=_.at+1&255),++o>1e3&&(o=0,a=i,i=new Map)}return s!==null&&s!==v&&(s.n=v),s=v,v.r},g=t=>Array.isArray(t)?h(t.slice(),!1):e(Rh(t,!0));return function(t,n,r){let a=arguments.length;if((a|1)==3){let e=s;if(e!==null){let i=e.n;if(i!==null&&p(i,t,n,r))return s=i,i.r;if(e!==i&&p(e,t,n,r))return e.r}if(a===2&&typeof n==`string`&&n!==``){let e=i.get(t);if(e!==void 0&&e.skip>0)return e.skip--,s=null,f(n,t,!0)}return h([t,n,r],!0)}if(a===1)return typeof t==`string`?e(t):g(t);let o=s;if(o!==null){let e=o.n;if(e!==null){let t=e.a,n=0,r=!0;for(let e=0;e<a;e++){let i=arguments[e];if(i){if(i!==t[n]){r=!1;break}n++}}if(r&&n===e.t)return s=e,e.r}if(o!==e){let e=o.a,t=0,n=!0;for(let r=0;r<a;r++){let i=arguments[r];if(i){if(i!==e[t]){n=!1;break}t++}}if(n&&t===o.t)return o.r}}let c=[];for(let e=0;e<a;e++)c.push(arguments[e]);return h(c,!0)}},Kh=Lh(jh),Q=Gh(Kh.mergeString,Kh);Kh.merge;var qh=_.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{getButtonProps:l,buttonRef:u}=Ku({disabled:i,focusableWhenDisabled:a,native:o});return Vl(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})});function Jh(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Jh(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function Yh(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Jh(e))&&(r&&(r+=` `),r+=t);return r}var Xh=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Zh=Yh,Qh=(e,t)=>n=>{if(t?.variants==null)return Zh(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Xh(t)||Xh(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Zh(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},$h=Qh(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function eg({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,X.jsx)(qh,{"data-slot":`button`,className:Q($h({variant:t,size:n,className:e})),...r})}var tg=$m();function ng({...e}){return(0,X.jsx)(ul,{...e})}function rg({...e}){return(0,X.jsx)(jd,{"data-slot":`toast-portal`,...e})}function ig({className:e,...t}){return(0,X.jsx)(Yl,{"data-slot":`toast-viewport`,className:Q(`pointer-events-none fixed right-4 bottom-4 z-50 w-[340px] max-w-[calc(100vw-2rem)] outline-none`,e),...t})}function ag({className:e,...t}){return(0,X.jsx)(Au,{"data-slot":`toast`,className:Q(`group/toast pointer-events-auto absolute right-0 bottom-0 z-[calc(1000-var(--toast-index))] w-full origin-bottom rounded-[10px] border border-border bg-card text-card-foreground shadow-[0_12px_40px_rgba(0,0,0,.3)] will-change-transform outline-none select-none focus-visible:ring-[3px] focus-visible:ring-ring/50`,`[--gap:0.25rem] [--offset-y:calc(var(--toast-offset-y)*-1+calc(var(--toast-index)*var(--gap)*-1)+var(--toast-swipe-movement-y))]`,`h-(--toast-height) [transform:translateX(var(--toast-swipe-movement-x))_translateY(var(--offset-y))] [transition:transform_500ms_cubic-bezier(0.22,1,0.36,1),opacity_500ms,height_150ms] motion-reduce:transition-none`,`after:absolute after:top-full after:left-0 after:h-[calc(var(--gap)+1px)] after:w-full after:content-['']`,`data-limited:opacity-0 data-starting-style:[transform:translateY(150%)]`,`[&[data-ending-style]:not([data-limited]):not([data-swipe-direction])]:[transform:translateY(150%)]`,`data-ending-style:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]`,`data-ending-style:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]`,`data-ending-style:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]`,`data-ending-style:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]`,`data-expanded:data-ending-style:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]`,`data-expanded:data-ending-style:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]`,`data-expanded:data-ending-style:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]`,`data-expanded:data-ending-style:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]`,e),...t})}function og({className:e,...t}){return(0,X.jsx)(ju,{"data-slot":`toast-content`,className:Q(`flex h-full items-start gap-2.5 overflow-hidden px-3.5 py-3 text-xs`,e),...t})}function sg({className:e,...t}){return(0,X.jsx)(Vu,{"data-slot":`toast-title`,className:Q(`mb-0.5 text-xs font-semibold`,e),...t})}function cg({className:e,...t}){return(0,X.jsx)(Bu,{"data-slot":`toast-description`,className:Q(`text-xs leading-[1.45] text-muted-foreground`,e),...t})}function lg({className:e,render:t=(0,X.jsx)(eg,{variant:`outline`,size:`sm`}),...n}){return(0,X.jsx)(Xu,{"data-slot":`toast-action`,render:t,className:Q(`shrink-0`,e),...n})}function ug({className:e,children:t,render:n=(0,X.jsx)(eg,{variant:`ghost`,size:`icon-xs`}),...r}){return(0,X.jsx)(Yu,{"data-slot":`toast-close`,"aria-label":`Close`,render:n,className:Q(`absolute top-1.5 right-1.5 text-muted-foreground opacity-0 group-hover/toast:opacity-100 hover:text-foreground focus-visible:opacity-100`,e),...r,children:t??(0,X.jsx)(Ii,{"aria-hidden":`true`})})}function dg({type:e}){let t=null;return e===`success`&&(t=(0,X.jsx)(Lt,{className:`text-success`,"aria-hidden":`true`})),e===`info`&&(t=(0,X.jsx)(An,{"aria-hidden":`true`})),e===`warning`&&(t=(0,X.jsx)(Ft,{className:`text-note`,"aria-hidden":`true`})),e===`error`&&(t=(0,X.jsx)(mr,{className:`text-destructive`,"aria-hidden":`true`})),t?(0,X.jsx)(`span`,{"data-slot":`toast-icon`,className:`mt-px shrink-0 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4`,children:t}):null}function fg({bodies:e}){let{toasts:t}=Qm();return t.map(t=>{let n=t.type?e?.[t.type]:void 0;return n?(0,X.jsx)(n,{toast:t},t.id):(0,X.jsx)(pg,{toastItem:t},t.id)})}function pg({toastItem:e}){return(0,X.jsx)(ag,{toast:e,children:(0,X.jsxs)(og,{children:[(0,X.jsx)(dg,{type:e.type}),(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col pr-4`,children:[(0,X.jsx)(sg,{}),(0,X.jsx)(cg,{}),(0,X.jsx)(lg,{className:`mt-2 self-start`})]}),(0,X.jsx)(ug,{})]})})}function mg({children:e,toastManager:t=tg,bodies:n,...r}){return(0,X.jsxs)(ng,{toastManager:t,...r,children:[e,(0,X.jsx)(rg,{children:(0,X.jsx)(ig,{children:(0,X.jsx)(fg,{bodies:n})})})]})}function hg(){return N()(()=>({board:null,reloads:{},connected:!1,canWrite:!1,dispatch:!1,accessKnown:!1,focus:null,findings:{},notes:{},listeners:[],history:{undo:0,redo:0},claims:{},thumbnails:{light:{},dark:{}},aliases:{}}))}function gg(e,t){let n=t.split(`/`);for(let t=n.length;t>0;t--){let r=e[n.slice(0,t).join(`/`)];if(r!==void 0)return[r,...n.slice(t)].join(`/`)}return t}function _g(e,t,n){let r=e.getState(),{board:i}=r;if(!i||!vg(e,t,n))return;let a=e=>bg(e,t,n),o=t.split(`/`).length===3?r.aliases:{...a(r.aliases),[n]:gg(r.aliases,t)},s=Tg(i,t,n);e.setState({board:s,reloads:a(r.reloads),findings:a(r.findings),notes:a(r.notes),claims:a(r.claims),thumbnails:{light:a(r.thumbnails.light),dark:a(r.thumbnails.dark)},aliases:Sg(o,s)})}function vg(e,t,n){let{board:r}=e.getState();return!!r&&wg(r,t)&&!wg(r,n)}function yg(e,t,n){return xg(e,t)?`${n}${e.slice(t.length)}`:e}function bg(e,t,n){return Object.fromEntries(Object.entries(e).filter(([e])=>!xg(e,n)).map(([e,r])=>[yg(e,t,n),r]))}function xg(e,t){return e===t||e.startsWith(`${t}/`)}function Sg(e,t){let n=Object.entries(e).filter(([e,n])=>e!==n&&!wg(t,n));return n.length===Object.keys(e).length?e:Object.fromEntries(n)}function Cg(e,t,n){if(t.aliases===e.aliases||!e.board||!t.board||!wg(e.board,n)||wg(t.board,n))return null;let r=gg(e.aliases,n);return t.board.projects.flatMap(e=>e.pages).find(e=>gg(t.aliases,e.ref)===r)?.ref??null}function wg(e,t){return e.projects.some(e=>e.name===t||e.pages.some(e=>e.ref===t||e.frames.some(e=>e.ref===t)))}function Tg(e,t,n){let[r=``,i,a]=t.split(`/`),o=n.split(`/`).at(-1)??n,s=(e,t)=>n=>n===e||n.startsWith(`${e}/`)?`${t}${n.slice(e.length)}`:n;return{...e,projects:e.projects.map(e=>{if(e.name!==r)return e;if(a!==void 0)return{...e,pages:e.pages.map(e=>e.name===i?{...e,frames:e.frames.map(e=>e.ref===t?{...e,ref:n,name:o,path:Eg(e.path,`${o}.html`)}:e)}:e)};if(i===void 0){let t=s(e.path,Eg(e.path,o));return{...e,name:o,path:t(e.path),pages:e.pages.map(e=>({...e,ref:`${o}/${e.name}`,project:o,path:t(e.path),frames:e.frames.map(n=>({...n,ref:`${o}/${e.name}/${n.name}`,project:o,path:t(n.path)}))}))}}return{...e,pages:e.pages.map(e=>{if(e.name!==i)return e;let t=s(e.path,Eg(e.path,o));return{...e,ref:n,name:o,path:t(e.path),frames:e.frames.map(e=>({...e,ref:`${n}/${e.name}`,page:o,path:t(e.path)}))}})}})}}function Eg(e,t){return`${e.slice(0,e.lastIndexOf(`/`)+1)}${t}`}function Dg(e,t){let n=t.projects.flatMap(e=>e.pages),r=new Set(n.flatMap(e=>e.frames.map(e=>e.ref))),i=new Set(n.map(e=>e.ref)),a=(e,t)=>Object.fromEntries(Object.entries(e).filter(([e])=>t.has(e))),{reloads:o,findings:s,notes:c,claims:l,aliases:u}=e.getState();e.setState({board:t,reloads:a(o,r),findings:a(s,r),notes:a(c,i),claims:a(l,r),aliases:Sg(u,t)})}function Og(e,t,n){e.setState({notes:{...e.getState().notes,[t]:n}})}function kg(e,t){e.setState({listeners:t})}function Ag(e,t){e.setState({history:t})}function jg(e,t){e.setState({claims:Object.fromEntries(t.map(e=>[e.frame,e]))})}function Mg(e,t,n){let{thumbnails:r}=e.getState(),i={...r[t]};for(let[e,t]of Object.entries(n))t===null?delete i[e]:i[e]=t;e.setState({thumbnails:{...r,[t]:i}})}function Ng(e){e.setState({connected:!1,canWrite:!1,dispatch:!1,accessKnown:!1,notes:{},listeners:[],history:{undo:0,redo:0},claims:{},thumbnails:{light:{},dark:{}}})}function Pg(e,t){e.setState({findings:{...e.getState().findings,...t}})}function Fg(e,t,n=!1){e.setState({canWrite:t,dispatch:n,accessKnown:!0})}function Ig(e,t){let n={...e.getState().reloads};for(let e of t)n[e]=(n[e]??0)+1;e.setState({reloads:n})}var Lg=hg();function Rg(e){return F(Lg,e)}var zg=`link`,Bg=`expired`;function Vg(e=Lg,t=Hg){if(new URLSearchParams(location.search).get(zg)!==Bg)return()=>{};let n=()=>{let{accessKnown:n,canWrite:r}=e.getState();if(!n)return!1;let i=new URL(location.href);return i.searchParams.delete(zg),history.replaceState(history.state,``,i),r||t(),!0};if(n())return()=>{};let r=e.subscribe(()=>{n()&&r()});return r}function Hg(){tg.add({title:`This edit link has expired`,description:`A link works once, for two minutes. Run frameboard open for a new one.`,type:`warning`,timeout:0})}var Ug=1024;function Wg(e){return N()(()=>({mode:`edit`,tool:`move`,hideUi:e<Ug,spacePan:!1}))}function Gg(e,t=qg){let n=e=>{e.code!==`Space`||Kg(e.target)||(e.preventDefault(),t.getState().spacePan||t.setState({spacePan:!0}))},r=()=>{t.getState().spacePan&&t.setState({spacePan:!1})},i=e=>{e.code===`Space`&&r()};return e.addEventListener(`keydown`,n),e.addEventListener(`keyup`,i),e.addEventListener(`blur`,r),()=>{e.removeEventListener(`keydown`,n),e.removeEventListener(`keyup`,i),e.removeEventListener(`blur`,r),r()}}function Kg(e){return e instanceof Element&&e.closest(`input, textarea, select, button, a[href], [contenteditable=""], [contenteditable="true"], [role="menu"], [role="menuitem"], [role="dialog"], [role="option"], [role="switch"], [role="tab"], [role="checkbox"], [role="radio"], [role="button"]`)!=null}var qg=Wg(window.innerWidth);function Jg(e){return F(qg,e)}function Yg(){return Rg(e=>e.connected&&e.accessKnown&&!e.canWrite)}function Xg(){let e=Yg(),[t]=xa(`/p/*`),n=Jg(e=>e.mode===`play`);return!e||t&&n?null:(0,X.jsx)(`p`,{role:`status`,"data-view-only-notice":!0,className:`absolute top-3 left-1/2 -translate-x-1/2 rounded-xl border border-border bg-card px-3 py-1 text-body text-muted-foreground`,children:`View only. Run frameboard open to edit`})}function Zg(e){let[t=``,n=``,r=``]=e.split(`/`);return`/frames/${encodeURIComponent(t)}/${encodeURIComponent(n)}/${encodeURIComponent(r)}.html`}function Qg(e,t){return`/p/${encodeURIComponent(e)}/${encodeURIComponent(t)}`}var $g=null,e_=null,t_=1,n_=new Set,r_=new Set,i_=new Set,a_={zoom:()=>t_,attached:()=>$g!==null,page:()=>e_,onZoom:e=>u_(n_,e),onAttach:e=>u_(r_,e),onHandMove:e=>u_(i_,e),zoomBy:e=>$g?.zoomBy(e),zoomTo:e=>$g?.zoomTo(e),fit:()=>$g?.fit(),fitTo:e=>$g?.fitTo(e),panBy:(e,t)=>$g?.panBy(e,t),centerOn:(e,t)=>$g?.centerOn(e,t),reveal:e=>{$g&&!o_($g.visible(),e)&&(c_(),$g.centerOn(e))}};function o_(e,t){return t.x>=e.x&&t.y>=e.y&&t.x+t.width<=e.x+e.width&&t.y+t.height<=e.y+e.height}function s_(e,t){return $g=e,e_=t,d_(r_),()=>{$g===e&&($g=null,e_=null,d_(r_))}}function c_(){d_(i_)}function l_(e){e!==t_&&(t_=e,d_(n_))}function u_(e,t){return e.add(t),()=>{e.delete(t)}}function d_(e){for(let t of e)t()}var f_=[`dropdown-menu-content`,`context-menu-content`,`popover-content`,`dialog-content`].map(e=>`[data-slot="${e}"][data-open]`).join(`,`),p_=`input:not([type=button],[type=checkbox],[type=radio],[type=submit]),textarea,select,[contenteditable=""],[contenteditable="true"]`;function m_(e=document){let t=e.defaultView??window,n=new Set,r=!1,i,a=()=>r||(e.activeElement?.matches(p_)??!1)||e.querySelector(f_)!==null,o=()=>{clearTimeout(i),i=setTimeout(()=>{if(!a())for(let e of[...n])n.delete(e),e()})},s=()=>{r=!0},c=()=>{r=!1,o()},l=[[e,`pointerdown`,s],[e,`pointerup`,c],[e,`pointercancel`,c],[t,`blur`,c],[e,`focusout`,o]];for(let[e,t,n]of l)e.addEventListener(t,n,!0);let u=new MutationObserver(o);return u.observe(e.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`data-open`]}),{busy:a,whenIdle:e=>(n.add(e),o(),()=>n.delete(e)),dispose:()=>{clearTimeout(i),u.disconnect();for(let[e,t,n]of l)e.removeEventListener(t,n,!0);n.clear()}}}var h_=`frameboard.seen`;function g_(e){let t=N()(()=>({unseen:{},seen:O_(e),cursor:null,base:{}}));return Object.assign(t,{storage:e})}function __(e,t){let{unseen:n,seen:r,base:i}=e.getState(),a={...n},o={...i};for(let e of t)a[e.frame]||(e.before?o[e.frame]=e.before:delete o[e.frame]),r[e.frame]===e.hash?delete a[e.frame]:a[e.frame]=e;e.setState({unseen:a,base:o})}function v_(e,t){let{unseen:n,seen:r}=e.getState(),i=n[t];if(!i)return;let{[t]:a,...o}=n,s={...r,[t]:i.hash};e.setState({unseen:o,seen:s}),k_(e.storage,s)}function y_(e,t){let n=new Set(t.projects.flatMap(e=>e.pages.flatMap(e=>e.frames.map(e=>e.ref)))),{unseen:r,base:i}=e.getState(),a=S_(r,n),o=S_(i,n);(a!==r||o!==i)&&e.setState({unseen:a,base:o})}function b_(e,t,n){let{unseen:r,seen:i,base:a,cursor:o}=e.getState(),s=Object.fromEntries(Object.entries(bg(r,t,n)).map(([e,t])=>[e,{...t,frame:e}])),c=bg(i,t,n);e.setState({unseen:s,seen:c,base:bg(a,t,n),cursor:o===null?null:yg(o,t,n)}),k_(e.storage,c)}function x_(e,t){let{base:n}=e.getState();if(!(t in n))return;let{[t]:r,...i}=n;e.setState({base:i})}function S_(e,t){let n=Object.fromEntries(Object.entries(e).filter(([e])=>t.has(e)));return Object.keys(n).length===Object.keys(e).length?e:n}function C_(e,t){e.setState({cursor:t})}function w_(e,t){let n=`${t}/`;return Object.keys(e).filter(e=>e.startsWith(n)).length}function T_(e){return Object.values(e).sort((e,t)=>e.at.localeCompare(t.at)||e.id.localeCompare(t.id))}function E_(e,t){let n=T_(e);return n[(n.findIndex(e=>e.frame===t)+1)%n.length]??null}function D_(e,t){let n=T_(e),r=n.findIndex(e=>e.frame===t);return n[(r<0?n.length-1:r-1+n.length)%n.length]??null}function O_(e){try{let t=JSON.parse(e?.getItem(`frameboard.seen`)??`{}`);return typeof t!=`object`||!t?{}:Object.fromEntries(Object.entries(t).filter(e=>typeof e[1]==`string`))}catch{return{}}}function k_(e,t){try{e?.setItem(h_,JSON.stringify(t))}catch{}}function A_(){try{return window.localStorage}catch{return null}}var j_=g_(A_());function M_(e){return F(j_,e)}var N_=N()(()=>({session:null})),P_=null;function F_(e,{live:t=Lg,unseen:n=j_,go:r=ia}={}){I_();let i=a_.page(),a=null,o,s=()=>{if(a===null)return;let[e=``,n=``]=a.split(`/`),s=R_(a);if(a_.page()!==s){i!==s&&(i=s,o=a_.zoom(),r(Qg(e,n)));return}let c=z_(t.getState().board,a);c&&(a=null,a_.centerOn(c,o),o=void 0)},c=e=>{e!==null&&(a=e,s())},l=n.subscribe((t,n)=>{let r=T_(t.unseen).filter(t=>t.author?.session===e&&n.unseen[t.frame]?.id!==t.id);c(r.at(-1)?.frame??null)}),u=t.subscribe((t,n)=>{if(!t.listeners.some(t=>t.session===e)){I_();return}let r=Object.values(t.claims).filter(t=>t.session===e&&n.claims[t.frame]?.session!==e);r.length>0?c(r.at(-1)?.frame??null):t.board!==n.board&&s()}),d=a_.onHandMove(I_),f=a_.onAttach(()=>{let e=a_.page();if(e===null)return;let n=t.getState().focus;n!==null&&e===R_(n)&&(i=e),e===i?s():I_()}),p=xe([{id:`follow.stop`,label:`Stop following`,group:`changes`,run:I_,command:{label:`Stop following the agent`,icon:Kn}}]);P_=()=>{p(),f(),d(),u(),l()},N_.setState({session:e})}function I_(){if(!P_)return;let e=P_;P_=null,e(),N_.setState({session:null})}function L_(e=Lg){(0,_.useEffect)(()=>{let t=()=>{let{listeners:t}=e.getState();return t.length===1?t[0]:void 0},n=xe([{id:`follow.start`,label:`Follow the agent`,group:`changes`,run:()=>{let n=t();n&&F_(n.session,{live:e})},enabled:()=>t()!==void 0&&N_.getState().session===null,command:{label:`Follow the agent`,icon:Jn,hint:()=>t()?.tag??``}}]),r=e.subscribe((e,t)=>{e.listeners!==t.listeners&&U()}),i=N_.subscribe(U);return()=>{i(),r(),n()}},[e])}function R_(e){let[t=``,n=``]=e.split(`/`);return`${t}/${n}`}function z_(e,t){for(let n of e?.projects??[])for(let e of n.pages){let n=e.frames.find(e=>e.ref===t);if(n)return n.box}return null}var B_=`show-offer`,V_={live:Lg,busy:Z_,toasts:tg,go:ia,following:()=>N_.getState().session!==null,project:()=>/^\/p\/([^/]+)/.exec(location.pathname)?.[1]??null},H_=null,U_=null;function W_(e,t=V_){$_(),J_(e,t)}function G_(e,{go:t,live:n}=V_){let[r=``,i=``]=e.split(`/`);t(Qg(r,i)),n.setState({focus:e})}function K_(e,t=V_){G_(e,t),U_?.()}function q_(e){let[t=``,n=``,r=``]=e.split(`/`);return{ref:e,title:`An agent showed ${r}`,detail:`${n} in ${t}`}}function J_(e,t){let[n=``]=e.split(`/`),r=t.following();if(n!==t.project()&&!r)return Y_(e,t);if(!t.busy().busy())return G_(e,t);if(!r)return Y_(e,t);H_=t.busy().whenIdle(()=>{H_=null,J_(e,t)})}function Y_(e,t){let[n=``,r=``]=e.split(`/`),i=t.toasts.add({type:B_,timeout:0,data:q_(e),onClose:()=>{o(),U_===a&&(U_=null)}}),a=()=>t.toasts.close(i),o=a_.onAttach(()=>{a_.page()===`${n}/${r}`&&a()});U_=a}var X_=null;function Z_(){return X_??=m_()}function Q_(){H_?.(),H_=null}function $_(){Q_(),U_?.()}var ev=N()(()=>({glowing:{},replays:{}})),tv=new Set;function nv(e){ev.setState(t=>({replays:{...t.replays,[e]:!0}}))}function rv(e=j_){let{unseen:t,cursor:n}=e.getState();return(n===null?void 0:t[n])??T_(t)[0]??null}function iv(e,t=ia){let[n=``,r=``]=e.split(`/`),i=Qg(n,r);decodeURIComponent(location.pathname)!==decodeURIComponent(i)&&t(i),Lg.setState({focus:e}),nv(e)}function av(e=j_,t=ia){(0,_.useEffect)(()=>{let n=()=>Object.keys(e.getState().unseen).length>0,r=n=>()=>{let r=n(e.getState().unseen,rv(e)?.frame??null);r&&(C_(e,r.frame),iv(r.frame,t))},i=xe([{id:`changes.show`,label:`Show change`,group:`changes`,run:()=>{let n=rv(e);n&&(C_(e,n.frame),iv(n.frame,t))},enabled:n,command:{label:`Show the agent change`,icon:Br}},{id:`changes.next`,label:`Next change`,group:`changes`,keys:[`BracketRight`],run:r(E_),enabled:n,command:{label:`Next agent change`,icon:ht}},{id:`changes.previous`,label:`Previous change`,group:`changes`,keys:[`BracketLeft`],run:r(D_),enabled:n,command:{label:`Previous agent change`,icon:pt}}]),a=e.subscribe(U);return()=>{a(),i()}},[e,t])}function ov(e,t,n){let r=T_(e),i=r.length;if(i<=1){let e=t.author?.agent??null,r=t.frame.split(`/`).at(-1)??t.frame,i=t.whole?1:Math.max(t.elements.length,1),a=`${i} ${i===1?`change`:`changes`}`;return{initial:cv(e),title:e?`${sv(e)} updated ${r}`:`${r} changed`,detail:n?`${a}, glowing on the frame`:a,show:!n,next:!1,width:n?300:340}}let a=new Set(r.map(e=>e.author?.agent??null)),[o]=a,s=a.size===1&&o?o:null,c=new Set(r.map(e=>e.frame.split(`/`).slice(0,2).join(`/`))).size,l=r.findIndex(e=>e.id===t.id)+1;return{initial:cv(s),title:s?`${sv(s)} changed ${i} frames`:`${i} frames changed`,detail:`on ${c} ${c===1?`page`:`pages`} · ${l} of ${i}`,show:!0,next:!0,width:460}}function sv(e){return`${e.charAt(0).toUpperCase()}${e.slice(1)}`}function cv(e){return e?e.charAt(0).toUpperCase():null}var lv=5e3,uv=`change`;function dv({store:e=j_,toasts:t=tg}){return(0,X.jsx)(fv,{store:e,toasts:t})}function fv({store:e,toasts:t}){return(0,_.useEffect)(()=>{let n=null,r,i=()=>{let i=rv(e);if(i){clearTimeout(r),r=void 0;let a=ov(e.getState().unseen,i,i.frame in ev.getState().glowing);n===null?n=t.add({type:uv,timeout:0,data:a,onClose:()=>{n=null}}):t.update(n,{data:a})}else n!==null&&r===void 0&&(r=setTimeout(()=>{r=void 0,n!==null&&t.close(n)},lv))};i();let a=e.subscribe(i),o=ev.subscribe(i);return()=>{a(),o(),clearTimeout(r),n!==null&&t.close(n)}},[e,t]),null}function pv({toast:e}){let[t,n,r]=Ce([`changes.show`,`changes.previous`,`changes.next`]),i=e.data;return i?(0,X.jsx)(ag,{toast:e,"data-change-toast":!0,style:{width:i.width},onKeyDown:e=>{e.key===`Enter`&&e.target===e.currentTarget&&i.show&&(e.preventDefault(),t?.run())},children:(0,X.jsxs)(og,{className:`items-center`,children:[i.initial?(0,X.jsx)(`span`,{"aria-hidden":!0,className:`font-bold text-claim`,children:i.initial}):null,(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,X.jsx)(sg,{children:i.title}),(0,X.jsx)(cg,{children:i.detail})]}),i.show?(0,X.jsx)(`button`,{type:`button`,onClick:()=>t?.run(),className:Q(_v,`bg-[color-mix(in_srgb,var(--claim)_22%,transparent)] text-claim`),children:`Show`}):null,i.next?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(mv,{action:n,label:`Previous`,keys:hv}),(0,X.jsx)(mv,{action:r,label:`Next`,keys:gv})]}):null]})}):null}function mv({action:e,label:t,keys:n}){let r=he(e?.keys??n,me());return(0,X.jsx)(`button`,{type:`button`,"aria-keyshortcuts":r?V(r):void 0,onClick:()=>e?.run(),className:Q(_v,`bg-secondary text-foreground`),children:r?`${t} ${V(r)}`:t})}var hv=[`BracketLeft`],gv=[`BracketRight`],_v=`ml-2 shrink-0 rounded-md px-2 py-[3px] font-medium whitespace-nowrap outline-none hover:brightness-95 focus-visible:ring-2 focus-visible:ring-ring/50`;function vv({toast:e}){let t=e.data;return t?(0,X.jsxs)(ag,{toast:e,"data-show-offer":!0,style:{width:340},onKeyDown:e=>{e.key===`Enter`&&e.target===e.currentTarget&&(e.preventDefault(),K_(t.ref))},children:[(0,X.jsxs)(og,{className:`items-center`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,X.jsx)(sg,{children:t.title}),(0,X.jsx)(cg,{children:t.detail})]}),(0,X.jsx)(`button`,{type:`button`,onClick:()=>K_(t.ref),className:Q(_v,`bg-[color-mix(in_srgb,var(--claim)_22%,transparent)] text-claim`),children:`Go`})]}),(0,X.jsx)(ug,{})]}):null}function yv(e){return(typeof e==`number`||typeof e==`string`)&&e!==``}function bv(e){let t=(0,_.useId)();return yv(e)?`${e}`:t}var xv=typeof window<`u`?_.useLayoutEffect:_.useEffect;function Sv(e){let t=(0,_.useRef)(e);return xv(()=>{t.current=e},[e]),(0,_.useCallback)((...e)=>t.current?.(...e),[t])}function Cv(...e){return Sv(t=>{e.forEach(e=>{if(e)switch(typeof e){case`function`:e(t);break;case`object`:e.current=t}})})}function wv(e,t){let n=e?.[`data-testid`];return yv(n)?`${n}`:yv(t)?`${t}`:void 0}function Tv(e,t=`Assertion error`){if(!e)throw Error(t)}(0,_.createContext)(null);var Ev;function Dv(){return Ev===void 0&&(Ev=typeof matchMedia==`function`&&!!matchMedia(`(pointer:coarse)`).matches),Ev}function Ov({expandHitTargets:e,axis:t,rect:n}){let r=e?Dv()?t.resizeTargetMinimumSize.coarse:t.resizeTargetMinimumSize.fine:0;if(n.width<r){let e=r-n.width;n=new DOMRect(n.x-e/2,n.y,n.width+e,n.height)}if(n.height<r){let e=r-n.height;n=new DOMRect(n.x,n.y-e/2,n.width,n.height+e)}return n}function kv(e){switch(typeof e){case`number`:return[e,`px`];case`string`:{let t=parseFloat(e);return e.endsWith(`%`)?[t,`%`]:e.endsWith(`px`)?[t,`px`]:e.endsWith(`rem`)?[t,`rem`]:e.endsWith(`em`)?[t,`em`]:e.endsWith(`vh`)?[t,`vh`]:e.endsWith(`vw`)?[t,`vw`]:[t,`%`]}}}var Av=class{#e={};addListener(e,t){let n=this.#e[e];return n===void 0?this.#e[e]=[t]:n.includes(t)||n.push(t),()=>{this.removeListener(e,t)}}emit(e,t){let n=this.#e[e];if(n!==void 0){if(n.length===1){n[0].call(null,t);return}let e,r=Array.from(n);for(let n=0;n<r.length;n++){let i=r[n];try{i.call(null,t)}catch(t){e??={error:t}}}if(e)throw e.error}}removeAllListeners(){this.#e={}}removeListener(e,t){let n=this.#e[e];if(n!==void 0){let e=n.indexOf(t);e>=0&&n.splice(e,1)}}},jv={cursorFlags:0,state:`inactive`},Mv=new Av;function Nv(){return jv}function Pv(e){return Mv.addListener(`change`,e)}function Fv(e,t=[],n,r=!1){let i=jv,a={...jv};a.cursorFlags=e,a.state===`active`&&(a.didPointerMove||=r,a.previews=t,n&&(a.previewLayoutMap=n)),jv=a,Mv.emit(`change`,{prev:i,next:a})}function Iv(e){let t=jv;jv=e,t.state===`active`&&e.state!==`active`&&t.didPointerMove&&t.hitRegions.forEach(({separator:e})=>{e&&e.element.ownerDocument.activeElement===e.element&&e.element.blur()}),Mv.emit(`change`,{prev:t,next:e})}function Lv(e){jv.state!==`active`||!jv.previews.some(t=>t.separator===e)||Iv({...jv,previews:jv.previews.map(t=>t.separator===e?{...t}:t)})}function Rv(e){if(jv.state===`inactive`)return;let t=jv.hitRegions.filter(t=>t.axis!==e),n=jv.state===`active`&&jv.previews.some(t=>t.axis===e);if(t.length!==jv.hitRegions.length||n){if(t.length===0)Iv({cursorFlags:0,state:`inactive`});else if(jv.state===`active`){let n=new Map(jv.initialLayoutMap),r=new Map(jv.previewLayoutMap);n.delete(e),r.delete(e),Iv({...jv,cursorFlags:0,hitRegions:t,initialLayoutMap:n,previewLayoutMap:r,previews:jv.previews.filter(t=>t.axis!==e)})}else Iv({...jv,hitRegions:t})}}var zv=e=>e,Bv=()=>{},Vv=1,Hv=2,Uv=4,Wv=8,Gv=3,Kv=12,qv;function Jv(){return qv===void 0&&(qv=!1,typeof window<`u`&&(window.navigator.userAgent.includes(`Chrome`)||window.navigator.userAgent.includes(`Firefox`))&&(qv=!0)),qv}function Yv({cursorFlags:e,axes:t,state:n}){let r=0,i=0;switch(n){case`active`:case`hover`:t.forEach(e=>{if(!e.mutableState.disableCursor)switch(e.orientation){case`horizontal`:r++;break;case`vertical`:i++}})}if(r!==0||i!==0){if(n===`active`&&e&&Jv()){let t=(e&Vv)!==0,n=(e&Hv)!==0,r=(e&Uv)!==0,i=(e&Wv)!==0;if(t)return r?`se-resize`:i?`ne-resize`:`e-resize`;if(n)return r?`sw-resize`:i?`nw-resize`:`w-resize`;if(r)return`s-resize`;if(i)return`n-resize`}return Jv()?r>0&&i>0?`move`:r>0?`ew-resize`:`ns-resize`:r>0&&i>0?`grab`:r>0?`col-resize`:`row-resize`}}var Xv=new WeakMap;function Zv(e){if(!e.defaultView||!e.adoptedStyleSheets)return;let{prevStyle:t,styleSheet:n}=Xv.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&(Object.isExtensible(e.adoptedStyleSheets)?e.adoptedStyleSheets.push(n):e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]));let r=Nv();switch(r.state!==`inactive`&&r.ownerDocument!==e&&(r={cursorFlags:0,state:`inactive`}),r.state){case`active`:case`hover`:{let e=Yv({cursorFlags:r.cursorFlags,axes:r.hitRegions.map(e=>e.axis),state:r.state}),i=`*, *:hover {cursor: ${e} !important; }`;if(t===i)return;t=i,e?n.cssRules.length===0?n.insertRule(i):n.replaceSync(i):n.cssRules.length===1&&n.deleteRule(0);break}case`inactive`:t=void 0,n.cssRules.length===1&&n.deleteRule(0)}Xv.set(e,{prevStyle:t,styleSheet:n})}function Qv(e){return e.state===`inactive`?void 0:e.ownerDocument}function $v({next:e,prev:t}){let n=Qv(t),r=Qv(e);n&&n!==r&&Zv(n),r&&Zv(r)}function ey({axis:e}){let{layoutStrategy:t,orientation:n,items:r}=e;return t?t.calculateAvailableSize():r.reduce((e,t)=>(e+=n===`horizontal`?t.element.offsetWidth:t.element.offsetHeight,e),0)}function ty(e,t){let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_DISCONNECTED?0:n&Node.DOCUMENT_POSITION_FOLLOWING?-1:n&Node.DOCUMENT_POSITION_PRECEDING?1:0}function ny(e,t){return Array.from(t).sort((t,n)=>{let r=e===`horizontal`?ry(t,n):iy(t,n);return r===0?ty(t.element,n.element):r})}function ry(e,t){let n=e.element.offsetLeft-t.element.offsetLeft;return n===0?e.element.offsetWidth-t.element.offsetWidth:n}function iy(e,t){let n=e.element.offsetTop-t.element.offsetTop;return n===0?e.element.offsetHeight-t.element.offsetHeight:n}function ay(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.ELEMENT_NODE}function oy(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function sy({orientation:e,rects:t,targetRect:n}){let r={x:n.x+n.width/2,y:n.y+n.height/2},i,a=Number.MAX_VALUE;for(let n of t){let{x:t,y:o}=oy(r,n),s=e===`horizontal`?t:o;s<a&&(a=s,i=n)}return Tv(i,`No rect found`),i}function cy({expandHitTargets:e=!0,axis:t,includeDisabled:n=!1}){if(t.layoutStrategy)return t.layoutStrategy.calculateHitRegions({expandHitTargets:e,axis:t,includeDisabled:n});let{element:r,orientation:i,items:a,separators:o}=t,s=ny(i,Array.from(r.children).filter(ay).filter(e=>!e.hasAttribute(`data-resize-preview`)).map(e=>({element:e}))).map(({element:e})=>e),c=[],l=!1,u=!1,d=-1,f,p=-1,m=0,h,g=[];{let e=-1;for(let t of s)t.hasAttribute(`data-panel`)&&(e++,t.hasAttribute(`data-disabled`)||(m++,d===-1&&(d=e),p=e))}if(n||m>1){let r=-1;for(let m of s)if(m.hasAttribute(`data-panel`)){r++;let o=a.find(e=>e.element===m);if(o){if(h){let a=h.element.getBoundingClientRect(),s=m.getBoundingClientRect(),_;if(u){let e=i===`horizontal`?new DOMRect(a.right,a.top,0,a.height):new DOMRect(a.left,a.bottom,a.width,0),t=i===`horizontal`?new DOMRect(s.left,s.top,0,s.height):new DOMRect(s.left,s.top,s.width,0);switch(g.length){case 0:_=[e,t];break;case 1:{let n=g[0];_=[n,sy({orientation:i,rects:[a,s],targetRect:n.element.getBoundingClientRect()})===a?t:e];break}default:_=g}}else _=g.length?g:[i===`horizontal`?new DOMRect(a.right,s.top,s.left-a.right,s.height):new DOMRect(s.left,a.bottom,s.width,s.top-a.bottom)];for(let i of _){let a=Ov({expandHitTargets:e,axis:t,rect:`width`in i?i:i.element.getBoundingClientRect()});(n||!l&&!(r<=d||r>p))&&(f??=ey({axis:t}),c.push({axis:t,axisSize:f,items:[h,o],separator:`width`in i?void 0:i,rect:a})),l=!1}}u=!1,h=o,g=[]}}else if(m.hasAttribute(`data-separator`)){m.ariaDisabled!==null&&(l=!0);let e=o.find(e=>e.element===m);e?g.push(e):(h=void 0,g=[])}else u=!0}return c}function ly(e,t){let n=getComputedStyle(e);return t*parseFloat(n.fontSize)}function uy(e,t){let n=getComputedStyle(e.ownerDocument.documentElement);return t*parseFloat(n.fontSize)}function dy(e){return e/100*window.innerHeight}function fy(e){return e/100*window.innerWidth}function py({axisSize:e,itemElement:t,styleProp:n}){let r,[i,a]=kv(n);switch(a){case`%`:r=i/100*e;break;case`px`:r=i;break;case`rem`:r=uy(t,i);break;case`em`:r=ly(t,i);break;case`vh`:r=dy(i);break;case`vw`:r=fy(i)}return r}function my(e){return parseFloat(e.toFixed(3))}function hy(e,t=ey({axis:e})){let{items:n}=e;return t===0?n.map(e=>({groupResizeBehavior:e.constraintProps.groupResizeBehavior,collapsedSize:0,collapsible:e.constraintProps.collapsible===!0,defaultSize:void 0,disabled:e.constraintProps.disabled,minSize:0,maxSize:100,itemId:e.id})):n.map(e=>{let{element:n,constraintProps:r}=e,i=0;r.collapsedSize!==void 0&&(i=my(py({axisSize:t,itemElement:n,styleProp:r.collapsedSize})/t*100));let a;r.collapsedThreshold!==void 0&&(a=my(py({axisSize:t,itemElement:n,styleProp:r.collapsedThreshold})/t*100));let o;r.defaultSize!==void 0&&(o=my(py({axisSize:t,itemElement:n,styleProp:r.defaultSize})/t*100));let s=0;r.minSize!==void 0&&(s=my(py({axisSize:t,itemElement:n,styleProp:r.minSize})/t*100));let c=100;return r.maxSize!==void 0&&(c=my(py({axisSize:t,itemElement:n,styleProp:r.maxSize})/t*100)),{groupResizeBehavior:r.groupResizeBehavior,collapsedSize:i,collapsedThreshold:a,collapsible:r.collapsible===!0,defaultSize:o,disabled:r.disabled,minSize:s,maxSize:c,itemId:e.id}})}var gy=new Map,_y=new Av,vy=0,yy=[],by;function xy(){vy++}function Sy(){for(let e=0;e<yy.length;e++)try{_y.emit(`axisChange`,yy[e])}catch(e){by??={error:e}}yy.length=0}function Cy(){if(vy===1&&Sy(),vy--,vy===0&&by){let{error:e}=by;throw by=void 0,e}}function wy(e){gy=new Map(gy),gy.delete(e)}function Ty(e,t){for(let[t]of gy)if(t.id===e)return t}function Ey(e,t){for(let[t,n]of gy)if(t.id===e)return n;if(t)throw Error(`Could not find data for Group with id ${e}`)}function Dy(){return gy}function Oy(e,t){return _y.addListener(`axisChange`,n=>{n.axis.id===e&&t(n)})}function ky(e,t,n){let r=gy.get(e);gy=new Map(gy),gy.set(e,t);let i={axis:e,isUserInteraction:n?.isUserInteraction===!0,prev:r,next:t};vy>0?yy.push(i):_y.emit(`axisChange`,i)}function Ay(e,{pointerId:t,pointerType:n}){return t===e.pointerId||n===`pen`&&e.pointerType===`pen`}function jy(e,t,n={}){return e.ownerDocument===t&&(n.pointerId===void 0||Ay(e,n))}function My(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function Ny(e,t,n=0){return Math.abs(my(e)-my(t))<=n}function Py(e,t){return Ny(e,t)?0:e>t?1:-1}function Fy({overrideDisabledItems:e,itemConstraints:t,prevSize:n,size:r}){let{collapsedSize:i=0,collapsedThreshold:a,collapsible:o,disabled:s,maxSize:c=100,minSize:l=0}=t;if(s&&!e)return n;if(Py(r,l)<0){if(o){let e=a??(l-i)/2,t=Py(n,i)<=0,o=t?i+e:l-e,s=Py(r,o);r=Py(r,i)<=0||s<0||a!==void 0&&t&&s===0?i:l}else r=l}return r=Math.min(c,r),r=my(r),r}function Iy({delta:e,initialLayout:t,itemConstraints:n,pivotIndices:r,prevLayout:i,trigger:a}){if(Ny(e,0))return t;let o=a===`imperative-api`,s=n.map(({itemId:e})=>t[e]),c=n.map(({itemId:e})=>i[e]),l=[...s],[u,d]=r;Tv(u!=null,`Invalid first pivot index`),Tv(d!=null,`Invalid second pivot index`);let f=0;switch(a){case`keyboard`:{let t=e<0?d:u,r=n[t];Tv(r,`Panel constraints not found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(Tv(n!=null,`Previous layout not found for panel index ${t}`),Ny(n,i)){let t=o-n;Py(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let t=e<0?u:d,r=n[t];Tv(r,`No panel constraints found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(Tv(n!=null,`Previous layout not found for panel index ${t}`),Ny(n,o)){let t=n-i;Py(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}break;default:{let t=e<0?d:u,r=n[t];Tv(r,`Panel constraints not found for index ${t}`);let i=s[t],{collapsedSize:a,collapsedThreshold:o,collapsible:c,minSize:l}=r;if(c&&Py(i,l)<0){let t=l-a,n=o??t/2;if(Py(i+Math.abs(e),l)<0){let r=Py(Math.abs(e),n);e=r>0||r===0&&o===void 0&&e<0?e<0?-t:t:0}}break}}{let t=e<0?1:-1,r=e<0?d:u,i=0;for(;;){let e=s[r];Tv(e!=null,`Previous layout not found for panel index ${r}`);let a=Fy({overrideDisabledItems:o,itemConstraints:n[r],prevSize:e,size:100})-e;if(i+=a,r+=t,r<0||r>=n.length)break}let a=Math.min(Math.abs(e),Math.abs(i));e=e<0?0-a:a}{let t=e<0?u:d;for(;t>=0&&t<n.length;){let r=Math.abs(e)-Math.abs(f),i=s[t];Tv(i!=null,`Previous layout not found for panel index ${t}`);let a=i-r,c=Fy({overrideDisabledItems:o,itemConstraints:n[t],prevSize:i,size:a});if(!Ny(i,c)&&(f+=i-c,l[t]=c,f.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?t--:t++}}if(My(c,l))return i;{let t=e<0?d:u,r=s[t];Tv(r!=null,`Previous layout not found for panel index ${t}`);let i=r+f,a=Fy({overrideDisabledItems:o,itemConstraints:n[t],prevSize:r,size:i});if(l[t]=a,!Ny(a,i)){let t=i-a,r=e<0?d:u;for(;r>=0&&r<n.length;){let i=l[r];Tv(i!=null,`Previous layout not found for panel index ${r}`);let a=i+t,s=Fy({overrideDisabledItems:o,itemConstraints:n[r],prevSize:i,size:a});if(Ny(i,s)||(t-=s-i,l[r]=s),Ny(t,0))break;e>0?r--:r++}}}return Ny(Object.values(l).reduce((e,t)=>t+e,0),100,.1)?l.reduce((e,t,r)=>(e[n[r].itemId]=t,e),{}):i}function Ly(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(t[n]===void 0||Py(e[n],t[n])!==0)return!1;return!0}function Ry(e){xy();try{zy(e)}finally{Cy()}}function zy({commit:e,event:t,hitRegions:n,initialLayoutMap:r,mountedAxes:i,pointerDownAtPoint:a,prevCursorFlags:o}){let s=0,c=Nv(),l=c.state===`active`?c.previews:[],u=new Map(c.state===`active`?c.previewLayoutMap:void 0);n.forEach(n=>{let{axis:o,axisSize:c}=n,{orientation:d,items:f}=o;if(e&&o.resizePreviewMode!==`separator`)return;let{disableCursor:p}=o.mutableState,m=0;m=a?d===`horizontal`?(t.clientX-a.x)/c*100:(t.clientY-a.y)/c*100:d===`horizontal`?t.clientX<0?-100:100:t.clientY<0?-100:100;let h=r.get(o),g=i.get(o);if(!h||!g)return;let{defaultLayoutDeferred:_,derivedItemConstraints:v,axisSize:y,layout:b,separatorToItems:x}=g;if(v&&b&&x){let t=o.resizePreviewMode===`separator`?u.get(o)??b:b,r=Iy({delta:m,initialLayout:h,itemConstraints:v,pivotIndices:n.items.map(e=>f.indexOf(e)),prevLayout:t,trigger:`mouse-or-touch`});if(o.resizePreviewMode===`separator`&&!e&&!Ly(r,t)){u.set(o,r);let e=0,t=f.map(t=>(e+=r[t.id]-h[t.id],c/100*e));l=l.map(e=>{if(e.axis!==o)return e;let n=t[e.itemIndex];return n===e.offset?e:{...e,offset:n}})}if(Ly(r,t)&&m!==0&&!p)switch(d){case`horizontal`:s|=m<0?Vv:Hv;break;case`vertical`:s|=m<0?Uv:Wv}(o.resizePreviewMode!==`separator`||e)&&!Ly(r,b)&&ky(n.axis,{defaultLayoutDeferred:_,derivedItemConstraints:v,axisSize:y,layout:r,requestedAxisSize:y,requestedLayout:r,separatorToItems:x})}});let d=0;t.movementX===0?d|=o&Gv:d|=s&Gv,t.movementY===0?d|=o&Kv:d|=s&Kv;let f=c.state===`active`&&(t.clientX!==c.pointerDownAtPoint.x||t.clientY!==c.pointerDownAtPoint.y);Fv(d,l,u,f)}function By(e,t){let n=Nv();if(n.state!==`active`||!jy(n,e,t))return;let r=Dy();xy();try{Ry({commit:!0,event:t,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedAxes:r,pointerDownAtPoint:n.pointerDownAtPoint,prevCursorFlags:n.cursorFlags}),Sy(),Iv({cursorFlags:0,state:`inactive`}),n.hitRegions.length>0&&(t.preventDefault?.(),n.hitRegions.forEach(e=>{if(!r.has(e.axis))return;let t=Ey(e.axis.id,!0);ky(e.axis,t,{isUserInteraction:!0})}))}finally{Cy()}}function Vy(e){if(e.defaultPrevented)return;let{clientX:t,clientY:n,movementX:r,movementY:i}=e;By(e.currentTarget,{clientX:t,clientY:n,movementX:r,movementY:i})}function Hy(e,t,n){let r,i={x:1/0,y:1/0};for(let a of t){let t=oy(n,a.rect);switch(e){case`horizontal`:(t.x<i.x||t.x===i.x&&t.y<=i.y)&&(r=a,i=t);break;case`vertical`:(t.y<i.y||t.y===i.y&&t.x<=i.x)&&(r=a,i=t)}}return r?{distance:i,hitRegion:r}:void 0}function Uy(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function Wy(e,t){if(e===t)throw Error(`Cannot compare node with itself`);let n={a:Xy(e),b:Xy(t)},r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();Tv(r,`Stacking order can only be calculated for elements with a common ancestor`);let i={a:Yy(Jy(n.a)),b:Yy(Jy(n.b))};if(i.a===i.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},i=e.length;for(;i--;){let n=e[i];if(n===t.a)return 1;if(n===t.b)return-1}}return Math.sign(i.a-i.b)}var Gy=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Ky(e){let t=getComputedStyle(Zy(e)??e).display;return t===`flex`||t===`inline-flex`}function qy(e){let t=getComputedStyle(e);return!!(t.position===`fixed`||t.zIndex!==`auto`&&(t.position!==`static`||Ky(e))||+t.opacity<1||`transform`in t&&t.transform!==`none`||`webkitTransform`in t&&t.webkitTransform!==`none`||`mixBlendMode`in t&&t.mixBlendMode!==`normal`||`filter`in t&&t.filter!==`none`||`webkitFilter`in t&&t.webkitFilter!==`none`||`isolation`in t&&t.isolation===`isolate`||Gy.test(t.willChange)||t.webkitOverflowScrolling===`touch`)}function Jy(e){let t=e.length;for(;t--;){let n=e[t];if(Tv(n,`Missing node`),qy(n))return n}return null}function Yy(e){return e&&Number(getComputedStyle(e).zIndex)||0}function Xy(e){let t=[];for(;e;)t.push(e),e=Zy(e);return t}function Zy(e){let{parentNode:t}=e;return Uy(t)?t.host:t}function Qy(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function $y(e){try{return e.matches(`:modal`)}catch{return!1}}function eb({axisElement:e,hitRegion:t,pointerEventTarget:n}){if(ay(n)){let t=n.closest(`dialog`);if(t&&!t.contains(e)&&$y(t))return!1}if(!ay(n)||n.contains(e)||e.contains(n)||!n.isConnected||!e.isConnected)return!0;if(Wy(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(Qy(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function tb(e,t,n){let r=[];return t.forEach((t,i)=>{if(i.disabled||i.element.ownerDocument!==n)return;let a=cy({axis:i}),o=Hy(i.orientation,a,{x:e.clientX,y:e.clientY});o&&o.distance.x<=0&&o.distance.y<=0&&eb({axisElement:i.element,hitRegion:o.hitRegion.rect,pointerEventTarget:e.target})&&r.push(o.hitRegion)}),r}function nb(e){let t=0,n=0,r={};for(let i of e)if(i.defaultSize!==void 0){t++;let e=my(i.defaultSize);n+=e,r[i.itemId]=e}else r[i.itemId]=void 0;let i=e.length-t;if(i!==0){let t=my((100-n)/i);for(let n of e)n.defaultSize===void 0&&(r[n.itemId]=t)}return r}function rb(e,t){let n=e.map(e=>e.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(let e of n)if(!r.includes(e))return!1;return!0}function ib({axis:e,itemConstraints:t}){let n=e.items.map(({id:e})=>e).join(`,`),r=e.mutableState.defaultLayout;return e.mutableState.layouts[n]??(r&&rb(e.items,r)?r:nb(t))}function ab(e,t){if(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 ob(e,t){return e.length===t.length&&e.every((e,n)=>ab(e,t[n]))}function sb({layout:e,itemConstraints:t}){let n=t.map(({itemId:t})=>e[t]),r=[...n],i=r.reduce((e,t)=>e+t,0);if(Object.keys(e).length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${Object.values(e).map(e=>`${e}%`).join(`, `)}`);if(!Ny(i,100)&&r.length>0)for(let e=0;e<t.length;e++){let t=r[e];Tv(t!=null,`No layout data found for index ${e}`);let n=100/i*t;r[e]=n}let a=0;for(let e=0;e<t.length;e++){let i=n[e];Tv(i!=null,`No layout data found for index ${e}`);let o=r[e];Tv(o!=null,`No layout data found for index ${e}`);let s=Fy({overrideDisabledItems:!0,itemConstraints:t[e],prevSize:i,size:o});o!=s&&(a+=o-s,r[e]=s)}if(!Ny(a,0))for(let e=0;e<t.length;e++){let n=r[e];Tv(n!=null,`No layout data found for index ${e}`);let i=n+a,o=Fy({overrideDisabledItems:!0,itemConstraints:t[e],prevSize:n,size:i});if(n!==o&&(a-=o-n,r[e]=o,Ny(a,0)))break}return r.reduce((e,n,r)=>(e[t[r].itemId]=n,e),{})}function cb({itemIds:e,layout:t}){return sb({layout:t,itemConstraints:e.map(e=>({collapsedSize:0,collapsible:!1,defaultSize:void 0,disabled:void 0,itemId:e,maxSize:100,minSize:0}))})}function lb({axis:e,nextAxisSize:t,prevAxisSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let i=0,a=0,o=!1,s=new Map,c=[];for(let l of e.items){let e=r[l.id]??0;switch(l.constraintProps.groupResizeBehavior){case`preserve-pixel-size`:{o=!0;let r=my(e/100*n/t*100);s.set(l.id,r),i+=r;break}default:c.push(l.id),a+=e}}if(!o||c.length===0)return r;let l=100-i,u={...r};if(s.forEach((e,t)=>{u[t]=e}),a>0)for(let e of c)u[e]=my((r[e]??0)/a*l);else{let e=my(l/c.length);for(let t of c)u[t]=e}return u}function ub({axis:e,axisState:t}){let n=ey({axis:e});if(n===0)return;let r=hy(e,n),i=t.requestedAxisSize,a=t.requestedLayout;t.defaultLayoutDeferred&&(i=n,a=cb({itemIds:e.items.map(({id:e})=>e),layout:ib({axis:e,itemConstraints:r})}));let o=sb({layout:lb({axis:e,nextAxisSize:n,prevAxisSize:i,prevLayout:a}),itemConstraints:r});return{changed:t.defaultLayoutDeferred||!Ly(t.layout,o)||!ob(t.derivedItemConstraints,r)||t.axisSize!==n,state:{defaultLayoutDeferred:!1,derivedItemConstraints:r,axisSize:n,layout:o,requestedAxisSize:i,requestedLayout:a,separatorToItems:t.separatorToItems}}}function db({axisId:e,itemId:t}){let n=()=>{let t=Dy();for(let[n,r]of t)if(n.id===e)return{axis:n,...r};throw Error(`Group ${e} not found`)},r=()=>{let e=n().derivedItemConstraints.find(e=>e.itemId===t);if(e!==void 0)return e;throw Error(`Panel constraints not found for Panel ${t}`)},i=()=>{let{axis:e,...r}=n(),i=ub({axis:e,axisState:r}),a=i?.state??r,o=a.derivedItemConstraints.find(e=>e.itemId===t);if(o===void 0)throw Error(`Panel constraints not found for Panel ${t}`);let s=a.layout[t];if(s===void 0)throw Error(`Layout not found for Panel ${t}`);return{axis:e,changed:i?.changed===!0,itemConstraints:o,itemSize:s,state:a}},a=()=>{let e=n().axis.items.find(e=>e.id===t);if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},o=()=>{let e=n().layout[t];if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},s=({nextSize:e,items:n,prevLayout:r,derivedItemConstraints:i})=>{let a=r[t],o=n.findIndex(e=>e.id===t),s=o===0,c=o===n.length-1;if(c&&e<a&&(s||n.slice(0,o).every((e,t)=>{let n=i[t];return n?.collapsible&&Ny(n.collapsedSize,r[n.itemId])}))){let e=n.slice(0,o).reduce((e,t)=>e+r[t.id],0);return{...r,[t]:my(100-e)}}return Iy({delta:c?a-e:e-a,initialLayout:r,itemConstraints:i,pivotIndices:c?[o-1,o]:[o,o+1],prevLayout:r,trigger:`imperative-api`})},c=(e,{axis:t,changed:n,itemSize:r,state:i})=>{if(e===r)return;let{derivedItemConstraints:a,axisSize:o,layout:c}=i,l=sb({layout:s({nextSize:e,items:t.items,prevLayout:c,derivedItemConstraints:a}),itemConstraints:a});(n||!Ly(c,l))&&ky(t,{...i,layout:l,requestedAxisSize:o,requestedLayout:l})};return{collapse:()=>{let e=i(),{collapsible:t,collapsedSize:n}=e.itemConstraints,{mutableValues:r}=a(),o=e.itemSize;t&&o!==n&&(r.expandToSize=o,c(n,e))},expand:()=>{let e=i(),{collapsible:t,collapsedSize:n,minSize:r}=e.itemConstraints,{mutableValues:o}=a(),s=e.itemSize;if(t&&s===n){let t=o.expandToSize??r;t===0&&(t=1),c(t,e)}},getSize:()=>{let{axis:e}=n(),r=o(),{element:i}=a();return{asPercentage:r,inPixels:e.layoutStrategy?e.layoutStrategy.getItemSizeInPixels(t):e.orientation===`horizontal`?i.offsetWidth:i.offsetHeight}},isCollapsed:()=>{let{collapsible:e,collapsedSize:t}=r(),n=o();return e&&Ny(t,n)},resize:e=>{let t=i(),{axisSize:n}=t.state,{element:r}=a(),o=my(py({axisSize:n,itemElement:r,styleProp:e})/n*100);c(o,t)}}}function fb(e){e.defaultPrevented||tb(e,Dy(),e.currentTarget).forEach(t=>{if(t.separator&&!t.separator.disableDoubleClick){let n=t.items.find(e=>e.constraintProps.defaultSize!==void 0);if(n){let r=n.constraintProps.defaultSize,i=db({axisId:t.axis.id,itemId:n.id});i&&r!==void 0&&(i.resize(r),e.preventDefault())}}})}function pb(e){let t=Dy();for(let[n]of t)if(n.separators.some(t=>t.element===e))return n;throw Error(`Could not find parent Group for separator element`)}function mb({axisId:e}){let t=()=>{let t=Dy();for(let[n,r]of t)if(n.id===e)return{axis:n,...r};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){let{defaultLayoutDeferred:e,layout:n}=t();return e?{}:n},setLayout(e){let{axis:n,...r}=t(),i=ub({axis:n,axisState:r}),a=i?.state??r,{defaultLayoutDeferred:o,derivedItemConstraints:s,axisSize:c,layout:l}=a,u=sb({layout:e,itemConstraints:s});return o?l:((i?.changed||!Ly(l,u))&&ky(n,{...a,layout:u,requestedAxisSize:c,requestedLayout:u}),u)}}}function hb(e,t){let n=pb(e),r=Ey(n.id,!0),i=n.separators.find(t=>t.element===e);Tv(i,`Matching separator not found`);let a=r.separatorToItems.get(i);Tv(a,`Matching panels not found`);let o=a.map(e=>n.items.indexOf(e)),s=mb({axisId:n.id}).getLayout(),c=sb({layout:Iy({delta:t,initialLayout:s,itemConstraints:r.derivedItemConstraints,pivotIndices:o,prevLayout:s,trigger:`keyboard`}),itemConstraints:r.derivedItemConstraints});Ly(s,c)||ky(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedItemConstraints:r.derivedItemConstraints,axisSize:r.axisSize,layout:c,requestedAxisSize:r.axisSize,requestedLayout:c,separatorToItems:r.separatorToItems},{isUserInteraction:!0})}function gb(e){return e.separators.filter(e=>!e.disabled)}function _b(e){if(e.defaultPrevented)return;let t=e.currentTarget,n=pb(t);if(!(n.disabled||n.separators.find(e=>e.element===t)?.disabled))switch(e.key){case`ArrowDown`:e.preventDefault(),n.orientation===`vertical`&&hb(t,5);break;case`ArrowLeft`:e.preventDefault(),n.orientation===`horizontal`&&hb(t,-5);break;case`ArrowRight`:e.preventDefault(),n.orientation===`horizontal`&&hb(t,5);break;case`ArrowUp`:e.preventDefault(),n.orientation===`vertical`&&hb(t,-5);break;case`End`:e.preventDefault(),hb(t,100);break;case`Enter`:{e.preventDefault();let{derivedItemConstraints:r,layout:i,separatorToItems:a}=Ey(n.id,!0),o=n.separators.find(e=>e.element===t);Tv(o,`Matching separator not found`);let s=a.get(o);Tv(s,`Matching panels not found`);let c=s[0],l=r.find(e=>e.itemId===c.id);if(Tv(l,`Panel metadata not found`),l.collapsible){let e=i[c.id];hb(t,(l.collapsedSize===e?n.mutableState.expandedItemSizes[c.id]??l.minSize:l.collapsedSize)-e)}break}case`F6`:{e.preventDefault();let t=gb(n).map(e=>e.element),r=t.findIndex(t=>t===e.currentTarget);Tv(r!==-1,`Index not found`),t[e.shiftKey?r>0?r-1:t.length-1:r+1<t.length?r+1:0].focus({preventScroll:!0});break}case`Home`:e.preventDefault(),hb(t,-100)}}function vb(e,t){let n=Nv();if(n.state!==`active`||!jy(n,e,t))return!1;let r=Dy();xy();try{n.previewLayoutMap.forEach((e,t)=>{let n=r.get(t);t.resizePreviewMode===`separator`&&n&&!Ly(e,n.layout)&&ky(t,{...n,layout:e,requestedAxisSize:n.axisSize,requestedLayout:e})}),Sy(),Iv({cursorFlags:0,state:`inactive`}),n.hitRegions.forEach(e=>{if(!r.has(e.axis))return;let t=Ey(e.axis.id,!0);ky(e.axis,t,{isUserInteraction:!0})})}finally{Cy()}return!0}function yb(e){let t=Nv();if(t.state!==`active`)return;let n=t.hitRegions.flatMap(({separator:e})=>e?[e.element]:[]);!n.some(t=>t===e.target)||n.some(t=>t.hasPointerCapture?.(e.pointerId))||vb(e.currentTarget,e)}function bb(e){vb(e.currentTarget,e)}function xb(e,t){let{element:n,orientation:r,items:i}=e,a=n.getBoundingClientRect(),o=r===`horizontal`;return cy({expandHitTargets:!1,axis:e,includeDisabled:!0}).map(({items:r,rect:s,separator:c},l)=>{let u=i.indexOf(r[0]),d=o?s.left+s.width/2:s.top+s.height/2;return{active:t.some(t=>{if(t.axis!==e||t.items[0]!==r[0])return!1;if(c||t.separator)return t.separator===c;let n=o?t.rect.left+t.rect.width/2:t.rect.top+t.rect.height/2;return Ny(d,n)}),axis:e,key:c?`separator-${c.id}`:`panel-${r[0].id}-${l}`,offset:0,itemIndex:u,rect:new DOMRect((o&&!c?d:s.left)-a.left-n.clientLeft+n.scrollLeft,(!o&&!c?d:s.top)-a.top-n.clientTop+n.scrollTop,o&&!c?0:s.width,!o&&!c?0:s.height),separator:c}})}function Sb(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=Nv();if(t.state===`active`){Ay(t,e)&&vb(t.ownerDocument,t);return}let n=Dy(),r=tb(e,n,e.currentTarget);if(r.length===0)return;let i=new Map,a=!1;r.forEach(e=>{e.separator&&(a||(a=!0,e.separator.element.focus({focusVisible:!1,preventScroll:!0})));let t=n.get(e.axis);t&&i.set(e.axis,t.layout)});let o=Array.from(i.keys()).flatMap(e=>e.resizePreviewMode===`separator`?xb(e,r):[]);Iv({cursorFlags:0,didPointerMove:!1,hitRegions:r,initialLayoutMap:i,ownerDocument:e.currentTarget,pointerDownAtPoint:{x:e.clientX,y:e.clientY},pointerId:e.pointerId,pointerType:e.pointerType,previewLayoutMap:new Map(i),previews:o,state:`active`}),e.preventDefault()}function Cb(e){let t=e.currentTarget,n=Dy(),r=Nv();if(r.state===`active`){if(!jy(r,t,e))return;Ry({commit:!1,event:e,hitRegions:r.hitRegions,initialLayoutMap:r.initialLayoutMap,mountedAxes:n,prevCursorFlags:r.cursorFlags})}}function wb(e){if(e.defaultPrevented)return;let t=e.currentTarget,n=Nv(),r=Dy();switch(n.state){case`active`:if(!jy(n,t,e))return;if(e.buttons===0){vb(t,e);return}for(let t of n.hitRegions)if(t.separator){let{element:n}=t.separator;n.isConnected&&!n.hasPointerCapture?.(e.pointerId)&&n.setPointerCapture?.(e.pointerId)}Ry({commit:!1,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedAxes:r,pointerDownAtPoint:n.pointerDownAtPoint,prevCursorFlags:n.cursorFlags});break;default:{let i=tb(e,r,t);i.length===0?n.state!==`inactive`&&Iv({cursorFlags:0,state:`inactive`}):Iv({cursorFlags:0,hitRegions:i,ownerDocument:t,state:`hover`});break}}}function Tb(e){if(e.relatedTarget instanceof HTMLIFrameElement){let t=Nv();t.state===`hover`&&t.ownerDocument===e.currentTarget&&Iv({cursorFlags:0,state:`inactive`})}}function Eb(e){e.defaultPrevented||e.pointerType===`mouse`&&e.button>0||By(e.currentTarget,e)}function Db(e){e.target===e.currentTarget&&vb(e.currentTarget.document)}function Ob(e){vb(e.currentTarget.document)}function kb(e,t,n){if(!n[0])return;let r=e.items.find(e=>e.element===t);if(!r||!r.onResize)return;let i=ey({axis:e}),a=e.orientation===`horizontal`?r.element.offsetWidth:r.element.offsetHeight,o=r.mutableValues.prevSize,s={asPercentage:my(a/i*100),inPixels:a};r.mutableValues.prevSize=s,r.onResize(s,r.id,o)}var Ab=new Map,jb=!1;function Mb(e){let t=!0;Tv(e.element.ownerDocument.defaultView,`Cannot register an unmounted Group`);let n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,i=new Set,a=new n(n=>{let r;xy();try{for(let i of n){let{borderBoxSize:n,target:a}=i;if(a===e.element){if(t){let t=Ey(e.id);if(!t)break;let n=ub({axis:e,axisState:t});if(!n)break;if(!n.changed)continue;ky(e,n.state)}}else try{kb(e,a,n)}catch(e){r??={error:e}}}}finally{Cy()}if(r)throw r.error});a.observe(e.element),e.items.forEach(e=>{Tv(!r.has(e.id),`Panel ids must be unique; id "${e.id}" was used more than once`),r.add(e.id),e.onResize&&a.observe(e.element)});let o=ey({axis:e}),s=hy(e,o),c=ib({axis:e,itemConstraints:s}),l=sb({layout:c,itemConstraints:s}),u=e.element.ownerDocument,d=u.defaultView;Ab.set(u,(Ab.get(u)??0)+1);let f=new Map;return cy({axis:e,includeDisabled:!0}).forEach(e=>{e.separator&&f.set(e.separator,e.items)}),ky(e,{defaultLayoutDeferred:o===0,derivedItemConstraints:s,axisSize:o,layout:l,requestedAxisSize:o,requestedLayout:cb({itemIds:e.items.map(({id:e})=>e),layout:c}),separatorToItems:f}),e.separators.forEach(e=>{Tv(!i.has(e.id),`Separator ids must be unique; id "${e.id}" was used more than once`),i.add(e.id),e.element.addEventListener(`keydown`,_b)}),jb||(jb=!0,Pv($v)),Ab.get(u)===1&&(u.addEventListener(`contextmenu`,Vy,!0),u.addEventListener(`dblclick`,fb,!0),u.addEventListener(`lostpointercapture`,yb,!0),u.addEventListener(`pointercancel`,bb,!0),u.addEventListener(`pointerdown`,Sb,!0),u.addEventListener(`pointerleave`,Cb),u.addEventListener(`pointermove`,wb),u.addEventListener(`pointerout`,Tb),u.addEventListener(`pointerup`,Eb,!0),d?.addEventListener(`blur`,Db),d?.addEventListener(`pagehide`,Ob)),function(){t=!1,Ab.set(u,Math.max(0,(Ab.get(u)??0)-1)),wy(e),Rv(e),e.separators.forEach(e=>{e.element.removeEventListener(`keydown`,_b)}),Ab.get(u)||(u.removeEventListener(`contextmenu`,Vy,!0),u.removeEventListener(`dblclick`,fb,!0),u.removeEventListener(`lostpointercapture`,yb,!0),u.removeEventListener(`pointercancel`,bb,!0),u.removeEventListener(`pointerdown`,Sb,!0),u.removeEventListener(`pointerleave`,Cb),u.removeEventListener(`pointermove`,wb),u.removeEventListener(`pointerout`,Tb),u.removeEventListener(`pointerup`,Eb,!0),d?.removeEventListener(`blur`,Db),d?.removeEventListener(`pagehide`,Ob)),a.disconnect()}}function Nb({derivedItemConstraints:e,axis:t,layout:n,prevLayout:r,requestedLayout:i}){let a=t.items.map(({id:e})=>e).join(`,`);t.mutableState.layouts[a]=i,r&&e.forEach(e=>{if(e.collapsible){let i=Ny(e.collapsedSize,n[e.itemId]),a=Ny(e.collapsedSize,r[e.itemId]);i&&!a&&(t.mutableState.expandedItemSizes[e.itemId]=r[e.itemId])}})}function Pb(){let[e,t]=(0,_.useState)({});return[e,(0,_.useCallback)(()=>t({}),[])]}function Fb(e){let t=(0,_.useRef)({...e});return xv(()=>{for(let n in e)t.current[n]=e[n]},[e]),t.current}var Ib=(0,_.createContext)(null);function Lb({layout:e,itemConstraints:t,itemId:n,itemIndex:r}){let i,a,o=e[n],s=t.find(e=>e.itemId===n);if(s){let c=s.maxSize,l=s.collapsible?s.collapsedSize:s.minSize,u=[r,r+1];a=sb({layout:Iy({delta:l-o,initialLayout:e,itemConstraints:t,pivotIndices:u,prevLayout:e}),itemConstraints:t})[n],i=sb({layout:Iy({delta:c-o,initialLayout:e,itemConstraints:t,pivotIndices:u,prevLayout:e}),itemConstraints:t})[n]}return{valueControls:n,valueMax:i,valueMin:a,valueNow:o}}function Rb({attributes:e,axisId:t,axisOrientation:n,children:r,className:i,"data-testid":a,disableCursor:o,disabled:s,disableDoubleClick:c,elementRef:l,id:u,isSharedHitRegion:d,preview:f,registerSeparator:p,requiredStyle:m,style:h,styleDefaults:g,tabIndex:v=0,updateSeparatorProps:y}){let b=Fb({disabled:s,disableDoubleClick:c,children:r,className:i,preview:f,style:h}),[x,S]=(0,_.useState)({}),[C,w]=(0,_.useState)(`inactive`),[T,E]=(0,_.useState)(!1),D=(0,_.useRef)(null),O=(0,_.useRef)(null),k=Cv(D,l),A=n===`horizontal`?`vertical`:`horizontal`;xv(()=>{let e=D.current;if(e!==null){let n={disabled:b.disabled,disableDoubleClick:b.disableDoubleClick,element:e,id:u,get children(){return b.children},get className(){return b.className},get preview(){return b.preview},get style(){return b.style}};O.current=n;let r=p(n),i=Pv(e=>{w(e.next.state!==`inactive`&&e.next.hitRegions.some(e=>e.separator===n||(d?.(e)??!1))?e.next.state:`inactive`)}),a=Oy(t,e=>{let{derivedItemConstraints:t,layout:r,separatorToItems:i}=e.next,a=i.get(n);if(a){let n=a[0],i=t.findIndex(e=>e.itemId===n.id),{layoutStrategy:o}=e.axis;S({...Lb({layout:r,itemConstraints:t,itemId:n.id,itemIndex:i}),...o?.getItemAriaControls&&{valueControls:o.getItemAriaControls(n.id)}})}});return()=>{O.current=null,i(),a(),r()}}},[t,u,d,p,b]),xv(()=>{let e=O.current;e&&Lv(e)},[f]),(0,_.useEffect)(()=>{y(u,{disabled:s,disableDoubleClick:c})},[s,c,u,y]);let j;s&&!o&&(j=`not-allowed`);let M;if(s)M=`disabled`;else switch(C){case`active`:M=`active`;break;default:M=T?`focus`:C}return(0,X.jsx)(`div`,{...e,"aria-controls":x.valueControls,"aria-disabled":s||void 0,"aria-orientation":A,"aria-valuemax":x.valueMax,"aria-valuemin":x.valueMin,"aria-valuenow":x.valueNow,children:r,className:i,"data-separator":M,"data-testid":a,id:u,onBlur:()=>E(!1),onFocus:()=>E(!0),ref:k,role:`separator`,style:{...g,cursor:j,...h,...m,touchAction:`none`},tabIndex:s?void 0:v})}function zb(e){for(let t=1;t<e.length;t++)if(ty(e[t-1],e[t])>0)return!1;return!0}function Bb({separator:e}){let{element:t}=e,n=(0,_.useRef)(null);return xv(()=>{let e=t.cloneNode(!0),r=[t,...t.querySelectorAll(`*`)],i=[e,...e.querySelectorAll(`*`)],a=t.ownerDocument.defaultView;return r.forEach((e,t)=>{let n=i[t];if(n instanceof a.HTMLElement||n instanceof a.SVGElement){let t=a.getComputedStyle(e);for(let e=0;e<t.length;e++){let r=t.item(e);n.style.setProperty(r,t.getPropertyValue(r))}}n.removeAttribute(`data-testid`),n.removeAttribute(`id`)}),Object.assign(e.style,{boxSizing:`border-box`,height:`100%`,margin:`0`,position:`static`,transform:`none`,width:`100%`}),n.current.appendChild(e),()=>e.remove()},[t]),(0,X.jsx)(`div`,{ref:n,style:{height:`100%`,opacity:.65,pointerEvents:`none`,width:`100%`}})}function Vb(){let e=(0,_.useContext)(Ib);return Tv(e,`Group Context not found; did you render a Panel or Separator outside of a Group?`),e}function Hb(e){let{registerOverlay:t}=Vb(),n=(0,_.useRef)(e);ab(n.current,e)||(n.current=e);let r=n.current;return xv(()=>t(r),[t,r]),null}Hb.displayName=`SeparatorOverlay`;function Ub({active:e,orientation:t,style:n,...r}){let i;switch(t){case`horizontal`:i={height:`100%`,minWidth:`1px`};break;case`vertical`:i={minHeight:`1px`,width:`100%`}}return(0,X.jsx)(`div`,{...r,"data-separator-overlay":e?`active`:`inactive`,style:{...i,...n,flexShrink:0,pointerEvents:`none`}})}function Wb({overlay:e,preview:t}){let{axis:n,offset:r,rect:i,separator:a}=t,o=n.orientation===`horizontal`,s=a?.preview,c=e;return(0,_.isValidElement)(s)&&s.type===Hb&&(c=s.props,s=void 0),s??(c?s=(0,X.jsx)(Ub,{...c,active:t.active,orientation:n.orientation}):a&&(s=(0,X.jsx)(Bb,{separator:a}))),(0,X.jsx)(`div`,{"aria-hidden":`true`,"data-resize-preview":!0,inert:!0,style:{height:i.height,left:i.left,pointerEvents:`none`,position:`absolute`,top:i.top,transform:o?`translateX(${r}px)`:`translateY(${r}px)`,width:i.width},children:s})}function eee(e){return Array.from(e).sort(ty)}function Gb(e,t){let n=(0,_.useRef)({getLayout:()=>({}),setLayout:zv});(0,_.useImperativeHandle)(t,()=>n.current,[]),xv(()=>{Object.assign(n.current,mb({axisId:e}))})}function Kb({groupId:e,resizePreviewMode:t}){let[n,r]=(0,_.useState)([]),i=(0,_.useRef)(n);return xv(()=>{let n=n=>{let a=Ty(e),o=t===`separator`&&n.state===`active`?n.previews.filter(e=>e.axis===a&&(e.active||!Ny(e.offset,0))):[],s=i.current;s.length===o.length&&o.every((e,t)=>e===s[t])||(i.current=o,r(o))};if(t!==`separator`){n(Nv());return}let a=Pv(({next:e})=>n(e));return n(Nv()),a},[e,t]),n}function qb({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:i,elementRef:a,groupRef:o,id:s,onLayoutChange:c,onLayoutChanged:l,orientation:u=`horizontal`,resizePreviewMode:d=`panel`,resizeTargetMinimumSize:f={coarse:20,fine:10},style:p,...m}){let h=(0,_.useRef)({onLayoutChange:{},onLayoutChanged:{}}),g=Sv(e=>{Ly(h.current.onLayoutChange,e)||(h.current.onLayoutChange=e,c?.(e))}),v=Sv((e,t,n)=>{Ly(h.current.onLayoutChanged,e)||(h.current.onLayoutChanged=e,l?.(e,{isUserInteraction:t,requestedLayout:n}))}),y=bv(s),[b,x]=(0,_.useState)(),S=Kb({groupId:y,resizePreviewMode:d}),C=(0,_.useRef)(null),[w,T]=Pb(),E=(0,_.useRef)([]),D=(0,_.useRef)({lastExpandedPanelSizes:{},layouts:{},panels:[],separators:[]}),O=Cv(C,a);Gb(y,o);let k=Sv((e,t)=>{let r=Ey(e);if(r)return{flexGrow:r.layout[t]??1};if(n?.[t])return{flexGrow:n?.[t]}}),A=Fb({defaultLayout:n,disableCursor:r,resizeTargetMinimumSize:f}),j=(0,_.useMemo)(()=>({get disableCursor(){return!!A.disableCursor},getPanelStyles:k,id:y,orientation:u,registerPanel:e=>{let t=D.current;return t.panels=ny(u,[...t.panels,e]),T(),()=>{t.panels=t.panels.filter(t=>t!==e),T()}},registerOverlay:e=>(x(e),()=>{x(void 0)}),registerSeparator:e=>{let t=D.current;return t.separators=ny(u,[...t.separators,e]),T(),()=>{t.separators=t.separators.filter(t=>t!==e),T()}},updatePanelProps:(e,{disabled:t})=>{let n=D.current.panels.find(t=>t.id===e);if(!n||n.constraintProps.disabled===t)return;n.constraintProps.disabled=t;let r=Ty(y),i=Ey(y);r&&i&&ky(r,{...i,derivedItemConstraints:hy(r)})},updateSeparatorProps:(e,{disabled:t,disableDoubleClick:n})=>{let r=D.current.separators.find(t=>t.id===e);r&&(r.disabled=t,r.disableDoubleClick=n)}}),[k,y,T,u,A]),M=(0,_.useRef)(null);return xv(()=>{let e=C.current;if(e===null)return;let t=D.current;t.panels=ny(u,t.panels),t.separators=ny(u,t.separators),E.current=eee([...t.panels.map(({element:e})=>e),...t.separators.map(({element:e})=>e)]);let n;if(A.defaultLayout!==void 0&&Object.keys(A.defaultLayout).length===t.panels.length){n={};for(let e of t.panels){let t=A.defaultLayout[e.id];t!==void 0&&(n[e.id]=t)}}let r={disabled:!!i,element:e,id:y,mutableState:{defaultLayout:n,disableCursor:!!A.disableCursor,expandedItemSizes:D.current.lastExpandedPanelSizes,layouts:D.current.layouts},orientation:u,items:t.panels,resizePreviewMode:d,get resizeTargetMinimumSize(){return A.resizeTargetMinimumSize},separators:t.separators};M.current=r;let a=Mb(r),{defaultLayoutDeferred:o,derivedItemConstraints:s,layout:c,requestedLayout:l}=Ey(r.id,!0);if(!o&&s.length>0)try{try{g(c)}finally{v(c,!1,l)}}catch(e){throw M.current=null,a(),e}let f=Oy(y,e=>{let{defaultLayoutDeferred:t,derivedItemConstraints:n,layout:i,requestedLayout:a}=e.next;if(t||n.length===0)return;Nb({derivedItemConstraints:n,axis:r,layout:i,prevLayout:e.prev?.layout,requestedLayout:a});let o=Nv(),s=o.state!==`active`||!o.hitRegions.some(e=>e.axis===r);try{g(i)}finally{s&&v(i,e.isUserInteraction,a)}});return()=>{M.current=null,a(),f()}},[i,y,v,g,u,w,d,A]),xv(()=>{zb(E.current)||T()}),(0,_.useEffect)(()=>{let e=M.current;e&&(e.mutableState.defaultLayout=n,e.mutableState.disableCursor=!!r)}),(0,X.jsx)(Ib.Provider,{value:j,children:(0,X.jsxs)(`div`,{...m,className:t,"data-group":!0,"data-testid":wv(m,s),id:y,ref:O,style:{height:`100%`,width:`100%`,overflow:`hidden`,position:d===`separator`?`relative`:void 0,...p,display:`flex`,flexDirection:u===`horizontal`?`row`:`column`,flexWrap:`nowrap`,touchAction:u===`horizontal`?`pan-y`:`pan-x`},children:[e,S.map(e=>(0,X.jsx)(Wb,{overlay:b,preview:e},e.key))]})})}qb.displayName=`Group`;function Jb(e,t){return`react-resizable-panels:${[e,...t].join(`:`)}`}function Yb({id:e,panelIds:t,storage:n}){let r=Jb(e,[]),i=n.getItem(r);if(i)try{let e=JSON.parse(i);if(t){let n=e[t.join(`,`)];if(n&&Array.isArray(n.layout)&&t.length===n.layout.length){let e={};for(let r=0;r<t.length;r++)e[t[r]]=n.layout[r];return e}}else{let t=Object.keys(e);if(t.length===1){let n=e[t[0]];if(n&&Array.isArray(n.layout)){let e=t[0].split(`,`);if(e.length===n.layout.length){let t={};for(let r=0;r<e.length;r++)t[e[r]]=n.layout[r];return t}}}}}catch{}}function Xb({debounceSaveMs:e=100,onlySaveAfterUserInteractions:t,panelIds:n,storage:r=localStorage,...i}){let a=n!==void 0,o=`id`in i?i.id:i.groupId,s=Jb(o,n??[]),c=(0,_.useSyncExternalStore)(Zb,()=>r.getItem(s),()=>r.getItem(s)),l=(0,_.useMemo)(()=>{if(c){let e=JSON.parse(c),t=Object.values(e);if(Array.from(t).every(e=>typeof e==`number`))return e}},[c]),u=(0,_.useMemo)(()=>{if(!l)return Yb({id:o,panelIds:n,storage:r})},[l,o,n,r]),d=l??u,f=(0,_.useRef)(null),p=(0,_.useCallback)(()=>{let e=f.current;e&&(f.current=null,clearTimeout(e))},[]);(0,_.useLayoutEffect)(()=>()=>{p()},[p]);let m=(0,_.useCallback)((e,n)=>{if(t&&!n.isUserInteraction)return;p();let i=n.requestedLayout??e,s;s=a?Jb(o,Object.keys(i)):Jb(o,[]);try{r.setItem(s,JSON.stringify(i))}catch(e){console.error(e)}},[p,a,o,t,r]);return{defaultLayout:d,onLayoutChange:(0,_.useCallback)(t=>{p(),e===0?m(t,{isUserInteraction:!1}):f.current=setTimeout(()=>{m(t,{isUserInteraction:!1})},e)},[p,e,m]),onLayoutChanged:m}}function Zb(){return function(){}}function Qb(e,t){let{id:n}=Vb(),r=(0,_.useRef)({collapse:Bv,expand:Bv,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:Bv});(0,_.useImperativeHandle)(t,()=>r.current,[]),xv(()=>{Object.assign(r.current,db({axisId:n,itemId:e}))})}function $b({children:e,className:t,collapsedSize:n=`0%`,collapsedThreshold:r,collapsible:i=!1,defaultSize:a,disabled:o,elementRef:s,groupResizeBehavior:c=`preserve-relative-size`,id:l,maxSize:u=`100%`,minSize:d=`0%`,onResize:f,panelRef:p,style:m,...h}){let g=yv(l),v=bv(l),y=Fb({disabled:o}),b=(0,_.useRef)(null),x=Cv(b,s),{getPanelStyles:S,id:C,orientation:w,registerPanel:T,updatePanelProps:E}=Vb(),D=f!==null,O=Sv((e,t,n)=>{f?.(e,l,n)});xv(()=>{let e=b.current;if(e!==null){let t={element:e,id:v,idIsStable:g,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:D?O:void 0,constraintProps:{groupResizeBehavior:c,collapsedSize:n,collapsedThreshold:r,collapsible:i,defaultSize:a,disabled:y.disabled,maxSize:u,minSize:d}};return T(t)}},[c,n,r,i,a,D,v,g,u,d,O,T,y]),(0,_.useEffect)(()=>{E(v,{disabled:o})},[o,v,E]),Qb(v,p);let k=()=>{let e=S(C,v);if(e)return JSON.stringify(e)},A=(0,_.useSyncExternalStore)(e=>Oy(C,e),k,k),j;return j=A?JSON.parse(A):a===void 0?{flexGrow:1}:{flexGrow:void 0,flexShrink:void 0,flexBasis:a},(0,X.jsx)(`div`,{...h,"data-disabled":o||void 0,"data-panel":!0,"data-testid":wv(h,l),id:v,ref:x,style:{...ex,display:`flex`,flexBasis:0,flexShrink:1,overflow:`visible`,...j},children:(0,X.jsx)(`div`,{className:t,style:{maxHeight:`100%`,maxWidth:`100%`,flexGrow:1,overflow:`auto`,...m,touchAction:w===`horizontal`?`pan-y`:`pan-x`},children:e})})}$b.displayName=`Panel`;var ex={minHeight:0,maxHeight:`100%`,height:`auto`,minWidth:0,maxWidth:`100%`,width:`auto`,border:`none`,borderWidth:0,padding:0,margin:0};function tx(){return(0,_.useRef)(null)}var nx={flexBasis:`auto`},rx={flexGrow:0,flexShrink:0};function ix({children:e,className:t,disabled:n,disableDoubleClick:r,elementRef:i,id:a,preview:o,style:s,...c}){let l=bv(a),{disableCursor:u,id:d,orientation:f,registerSeparator:p,updateSeparatorProps:m}=Vb();return(0,X.jsx)(Rb,{attributes:c,axisId:d,axisOrientation:f,className:t,"data-testid":wv(c,a),disableCursor:u,disabled:n,disableDoubleClick:r,elementRef:i,id:l,preview:o,registerSeparator:p,requiredStyle:rx,style:s,styleDefaults:nx,updateSeparatorProps:m,children:e})}ix.displayName=`Separator`;function ax({className:e,...t}){return(0,X.jsx)(qb,{"data-slot":`resizable-panel-group`,className:Q(`flex h-full w-full aria-[orientation=vertical]:flex-col`,e),...t})}function ox({...e}){return(0,X.jsx)($b,{"data-slot":`resizable-panel`,...e})}function sx({withHandle:e,className:t,children:n,...r}){return(0,X.jsxs)(ix,{"data-slot":`resizable-handle`,className:Q(`relative flex w-px items-center justify-center bg-border ring-offset-background after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90`,t),...r,children:[e&&(0,X.jsx)(`div`,{className:`z-10 flex h-6 w-1 shrink-0 rounded-lg bg-border`}),n]})}var cx=class extends Error{code;details;constructor(e,t,n={}){super(t),this.name=`BoardWriteError`,this.code=e,this.details=n}};async function lx(e,t,n=`POST`,r=fetch){let i=await r(e,t instanceof FormData?{method:n,body:t}:{method:n,headers:{"content-type":`application/json`},body:JSON.stringify(t)});i.status===401&&Lg.setState({canWrite:!1});let a=await i.json().catch(()=>null);if(a===null)throw new cx(`internal`,`The board answered ${i.status}.`);if(!a.ok)throw new cx(a.error.code,a.error.message,a.error.details);return a.data}function ux(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function dx(e,t=`|`){return e.map(e=>Ix(e)).join(t)}function fx(e,t){return typeof t==`bigint`?t.toString():t}var px=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function mx(e){return new px(e)}function hx(e){return e==null}function gx(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function _x(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function vx(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function yx(e){return vx(e._zod.def)??e._zod.def.shape}function bx(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return _x(this,t,e),e},enumerable:!0,configurable:!0})}function xx(e,t,n){t in e?_x(e,t,n):e[t]=n}function Sx(e,t,n,r){let i=yx(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?bx(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):xx(e,a,r?r(n.value,a):n.value))}}function Cx(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?bx(e,n,()=>t[n]):xx(e,n,r.value))}}function wx(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Tx(e){return JSON.stringify(e)}function Ex(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var Dx=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function Ox(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var kx=mx(()=>{if(ES.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function Ax(e){if(Ox(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return Ox(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function jx(e){return Ax(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var Mx=new Set([`string`,`number`,`symbol`]);function Nx(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Px(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function Fx(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Ix(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function Lx(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var Rx={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},zx={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function Bx(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return Sx(i,e,Vx(e,t)),Px(e,wx(n,{shape:i,checks:[]}))}function Vx(e,t){let n=yx(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function Hx(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set(Vx(e,t)),a={};return Sx(a,e,Reflect.ownKeys(yx(e)).filter(e=>!i.has(e))),Px(e,wx(n,{shape:a,checks:[]}))}function Ux(e,t){if(!Ax(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=yx(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Px(e,wx(e._zod.def,{shape:Wx(e,t)}))}function Wx(e,t){let n={};return Sx(n,e,Reflect.ownKeys(yx(e))),Cx(n,t),n}function Gx(e,t){if(!Ax(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Px(e,wx(e._zod.def,{shape:Wx(e,t)}))}function Kx(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return Sx(n,e,Reflect.ownKeys(yx(e))),Sx(n,t,Reflect.ownKeys(yx(t))),Px(e,wx(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function qx(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(Vx(t,n)):void 0,o={};return Sx(o,t,Reflect.ownKeys(yx(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),Px(t,wx(t._zod.def,{shape:o,checks:[]}))}function Jx(e,t,n){let r=n?new Set(Vx(t,n)):void 0,i={};return Sx(i,t,Reflect.ownKeys(yx(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),Px(t,wx(t._zod.def,{shape:i}))}function Yx(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Xx(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Zx(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Qx(e){return typeof e==`string`?e:e?.message}function $x(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function eS(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function tS(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:Qx(e.inst?._zod.def?.error?.(e))??Qx(a?.(e))??Qx(t?.error?.(e))??Qx(n.customError?.(e))??Qx(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}var nS=/[\uD800-\uDBFF]/;function rS(e){let t=e.length;if(!nS.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function iS(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function aS(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function oS(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function sS(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):dS(e,n,r.value)}}function cS(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function lS(e,t,n){return cS(e,t,n,!1)}function uS(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return cS(this,n,r(this))},set(e){cS(this,n,e)}})}return t}function dS(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:cS(this,t,n.bind(this))},set(e){cS(this,t,e)}})}function fS(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var pS,mS=!1,hS={configurable:!0,get(){mS=!0}};function gS(e,t,n){let r=Object.getPrototypeOf(e._zod);t in r&&pS!==e._zod?pS=void 0:(pS=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,hS);let e=mS;mS=!1;try{let r=n(this);return mS?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),mS||=e,r}catch(n){throw delete this[t],mS||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}}))}function _S(e,t,n,r){let i=fS(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}var vS=`~constantCatch`;function yS(e){let t=()=>e;return t[vS]=!0,t}var bS,xS={value:void 0,enumerable:!1},SS=`captureStackTrace`in Error?Error:null;function CS(e){let t=SS;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return SS=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function $(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){xS.value=new a(r);try{Object.defineProperty(n,"_zod",xS)}finally{xS.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),sS(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?CS(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var wS=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},TS=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(bS=globalThis).__zod_globalConfig??(bS.__zod_globalConfig={});var ES=globalThis.__zod_globalConfig;function DS(e){return e&&Object.assign(ES,e),ES}function OS(){let e=this._zod;return e.message??=JSON.stringify(e.def,fx,2),e.message}function kS(e){this._zod.message=e}var AS={get:OS,set:kS,enumerable:!0,configurable:!0},jS={value:void 0,enumerable:!1},MS=new WeakSet([Object.prototype,Error.prototype]),NS=$(`$ZodError`,(e,t)=>{e.name=`$ZodError`,jS.value=t,Object.defineProperty(e,"issues",jS),jS.value=void 0,Object.defineProperty(e,"message",AS);let n=Object.getPrototypeOf(e);MS.has(n)||(MS.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))});function PS(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function FS(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?PS(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function IS(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function LS(e,t){return{callee:t?.callee??e,Err:t?.Err}}var RS=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new wS;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>tS(e,o,DS())));throw Dx(n,a?.callee??t),n}return s.value};return t},zS=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>tS(e,o,DS())));throw Dx(n,a?.callee??t),n}return s.value};return t},BS=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new wS;return a.issues.length?VS(e,a.issues,i):{success:!0,data:a.value}};function VS(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>tS(e,n,DS()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var HS=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?VS(e,a.issues,i):{success:!0,data:a.value}},US=Symbol.for(`zod.compile.invalid`),WS=Symbol.for(`zod.compile.fallback`),GS=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==US)return!0;if(r.definite===!0&&n===void 0)return!1}return KS(e,t,n)});function KS(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[WS]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new wS;return a.issues.length===0}var qS=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},JS=e=>{let t=RS(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,LS(n,a))};return n},YS=e=>{let t=RS(e),n=(e,r,i,a)=>t(e,r,i,LS(n,a));return n},XS=e=>{let t=zS(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,LS(n,a))};return n},ZS=e=>{let t=zS(e),n=async(e,r,i,a)=>await t(e,r,i,LS(n,a));return n},QS=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return BS(e)(t,n,i)},$S=e=>(t,n,r)=>BS(e)(t,n,r),eC=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return HS(e)(t,n,i)},tC=e=>async(t,n,r)=>HS(e)(t,n,r),nC=/^[cC][0-9a-z]{6,}$/,rC=/^[0-9a-z]+$/,iC=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,aC=/^[0-9a-vA-V]{20}$/,oC=/^[A-Za-z0-9]{27}$/,sC=/^[a-zA-Z0-9_-]{21}$/;function cC(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var lC=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,uC=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,dC=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,fC=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,pC=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function mC(){return new RegExp(pC,`u`)}var hC=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,gC=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,_C=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,vC=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,yC=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,bC=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,xC=/^https?$/,SC=/^\+[1-9]\d{6,14}$/,CC=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;function wC(e){return RegExp(`^${e}$`)}var TC=wC(CC);function EC(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function DC(e){return RegExp(`^${EC(e)}$`)}function OC(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${EC({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${EC({precision:e.precision})}`:n;return RegExp(`^${CC}T(?:${r})$`)}var kC=/^[\s\S]{0,}$/,AC=/^(?:true|false)$/i,jC=/^[^A-Z]*$/,MC=/^[^a-z]*$/,NC=$(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),PC=e=>{let t=e.value;return!hx(t)&&t.length!==void 0},FC=$(`$ZodCheckMaxLength`,(e,t)=>{var n;NC.init(e,t),(n=e._zod.def).when??(n.when=PC),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?rS(r):i)<=t.maximum)return;let a=iS(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),IC=$(`$ZodCheckMinLength`,(e,t)=>{var n;NC.init(e,t),(n=e._zod.def).when??(n.when=PC),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?rS(r):i)>=t.minimum)return;let a=iS(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),LC=$(`$ZodCheckLengthEquals`,(e,t)=>{var n;NC.init(e,t),(n=e._zod.def).when??(n.when=PC),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?rS(r):i;if(a===t.length)return;let o=iS(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),RC=$(`$ZodCheckStringFormat`,(e,t)=>{var n,r;NC.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),zC=$(`$ZodCheckRegex`,(e,t)=>{RC.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),BC=$(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=jC,RC.init(e,t)}),VC=$(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=MC,RC.init(e,t)}),HC=$(`$ZodCheckIncludes`,(e,t)=>{NC.init(e,t);let n=Nx(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),UC=$(`$ZodCheckStartsWith`,(e,t)=>{NC.init(e,t);let n=RegExp(`^${Nx(t.prefix)}.*`);t.pattern??=n,e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),WC=$(`$ZodCheckEndsWith`,(e,t)=>{NC.init(e,t);let n=RegExp(`.*${Nx(t.suffix)}$`);t.pattern??=n,e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),GC=$(`$ZodCheckOverwrite`,(e,t)=>{NC.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),KC=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
10
- `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(`
11
- `)}\n};`)(...Object.values(this.closed))}},qC={major:4,minor:6,patch:7},JC=$(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=qC;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=Yx(t),a;for(let o of n){if(o._zod.def.when){if(Xx(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new wS;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(eS(t.issues,n,e),i||=Yx(t,n))});else{if(t.issues.length===n)continue;eS(t.issues,n,e),i||=Yx(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(Yx(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new wS;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new wS;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return lS(this,`~standard`,ZC(this))},set"~standard"(e){cS(this,`~standard`,e)}}),YC=(e,t)=>e.issues.length?{issues:e.issues.map(e=>tS(e,t,DS()))}:{value:e.value};async function XC(e,t){let n={async:!0};return YC(await e._zod.run({value:t,issues:[]},n),n)}function ZC(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return YC(r,n)}catch{}return XC(e,t)},vendor:`zod`,version:1}}var QC=$(`$ZodString`,(e,t)=>{JC.init(e,t),e._zod.pattern=t.pattern??kC,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),$C=$(`$ZodStringFormat`,(e,t)=>{RC.init(e,t),QC.init(e,t)}),ew=$(`$ZodGUID`,(e,t)=>{t.pattern??=uC,$C.init(e,t)}),tw=$(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=dC(e)}else t.pattern??=dC();$C.init(e,t)}),nw=$(`$ZodEmail`,(e,t)=>{t.pattern??=fC,$C.init(e,t)});function rw(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function iw(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?rw(e)||2:aw(e,t)}function aw(e,t){if(!t.normalize&&t.protocol?.source===xC.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}var ow=/[\t\n\r]/g;function sw(e){return e.replace(ow,``)}function cw(e,t){return t.lastIndex=0,t.test(e.hostname)}function lw(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var uw=$(`$ZodURL`,(e,t)=>{$C.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=iw(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=sw(r);return}t.hostname&&!cw(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!lw(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:sw(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),dw=$(`$ZodEmoji`,(e,t)=>{t.pattern??=mC(),$C.init(e,t)}),fw=$(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?sC:cC(t.length),$C.init(e,t)}),pw=$(`$ZodCUID`,(e,t)=>{t.pattern??=nC,$C.init(e,t)}),mw=$(`$ZodCUID2`,(e,t)=>{t.pattern??=rC,$C.init(e,t)}),hw=$(`$ZodULID`,(e,t)=>{t.pattern??=iC,$C.init(e,t)}),gw=$(`$ZodXID`,(e,t)=>{t.pattern??=aC,$C.init(e,t)}),_w=$(`$ZodKSUID`,(e,t)=>{t.pattern??=oC,$C.init(e,t)}),vw=$(`$ZodISODateTime`,(e,t)=>{t.pattern??=OC(t),$C.init(e,t)}),yw=$(`$ZodISODate`,(e,t)=>{t.pattern??=TC,$C.init(e,t)}),bw=$(`$ZodISOTime`,(e,t)=>{t.pattern??=DC(t),$C.init(e,t)}),xw=$(`$ZodISODuration`,(e,t)=>{t.pattern??=lC,$C.init(e,t)}),tee=$(`$ZodIPv4`,(e,t)=>{t.pattern??=hC,$C.init(e,t)}),Sw=/^[0-9a-fA-F:.]+$/;function Cw(e){return Sw.test(e)?rw(`http://[${e}]`):!1}var ww=$(`$ZodIPv6`,(e,t)=>{t.pattern??=gC,$C.init(e,t),e._zod.check=n=>{Cw(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),Tw=$(`$ZodCIDRv4`,(e,t)=>{t.pattern??=_C,$C.init(e,t)});function Ew(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:Cw(n)}var Dw=$(`$ZodCIDRv6`,(e,t)=>{t.pattern??=vC,$C.init(e,t),e._zod.check=n=>{Ew(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function Ow(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var kw=/^[0-9a-zA-Z+/]*={0,2}$/,Aw=$(`$ZodBase64`,(e,t)=>{t.pattern??=kw,$C.init(e,t),e._zod.check=n=>{Ow(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),jw=/^[A-Za-z0-9_-]*$/;function Mw(e){if(!jw.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Ow(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var Nw=$(`$ZodBase64URL`,(e,t)=>{t.pattern??=jw,$C.init(e,t),e._zod.check=n=>{Mw(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Pw=$(`$ZodE164`,(e,t)=>{t.pattern??=SC,$C.init(e,t)});function Fw(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var Iw=$(`$ZodJWT`,(e,t)=>{$C.init(e,t),e._zod.check=n=>{Fw(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Lw=$(`$ZodBoolean`,(e,t)=>{JC.init(e,t),e._zod.pattern=AC,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),Rw=$(`$ZodUnknown`,(e,t)=>{JC.init(e,t),e._zod.parse=e=>e}),zw=$(`$ZodNever`,(e,t)=>{JC.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Bw(e,t){let n=$x(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(n,a)=>{let o=t(n.value);if(o>r&&!a?.skipChecks&&a?.direction!==`backward`){for(let[t,r]of $x(e._zod.def.checks))if(o>t&&r._zod.def.when(n)){let t=n.issues.length;return r._zod.check(n),n.issues[t].continue=!1,eS(n.issues,t,e),n}}return i(n,a)}}var Vw=e=>Array.isArray(e)?e.length:-1;function Hw(e,t,n){e.issues.length&&t.issues.push(...Zx(n,e.issues)),t.value[n]=e.value}var Uw=$(`$ZodArray`,(e,t)=>{JC.init(e,t);let n=ES.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>Hw(t,r,e)));else if(Hw(c,r,e),s&&c.issues.length!==0&&Yx(c))break}return o.length?Promise.all(o).then(()=>r):r},Bw(e,Vw)});function Ww(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...Zx(n,e.issues))}!o&&i===void 0?e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]}):e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}var Gw=[];function Kw(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:Gw,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=Lx(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function qw(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(Yx(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Ww(e,n,i,t,d,f))):Ww(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var Jw=$(`$ZodObject`,(e,t)=>{JC.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=mx(()=>Kw(t));gS(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||_x(n,e,new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=Ox,o=t.catchall,s,c=ES.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(Yx(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>Ww(n,t,e,r,a,o))):Ww(s,t,e,r,a,o)}return o?qw(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),Yw=$(`$ZodObjectJIT`,(e,t)=>{Jw.init(e,t);let n=e._zod.parse,r=mx(()=>Kw(t)),i=ES.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new KC([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
12
- let ${e}_ab = false;
13
- for (let i = 0; i < ${e}.issues.length; i++) {
14
- const iss = ${e}.issues[i];
15
- iss.path = iss.path ? [${t}, ...iss.path] : [${t}];
16
- payload.issues.push(iss);
17
- if (iss.continue !== true) ${e}_ab = true;
18
- }
19
- if (${e}_ab && ctx && ctx.abortEarly) {
20
- payload.value = newResult;
21
- return payload;
22
- }`;o.write(`const input = payload.value;`);let l=Object.create(null),u=0;for(let e of n.allKeys)l[e]=`key_${u++}`;o.write(i?`const newResult = memo.alloc(inst, payload, {}, ctx);`:`const newResult = {};`);for(let e of n.allKeys){if(e===`__proto__`)continue;let n=l[e],r=typeof e==`symbol`?`syms[${a.indexOf(e)}]`:Tx(e),i=`${r} in input`,u=t[e],d=u?._zod?.optin,f=d!==void 0,p=u?._zod?.optout===`optional`;if(o.write(`const ${n} = ${s(r)};`),f&&p){let e=d===`optional`?`${n}_present`:`${n}.value !== undefined || ${n}_present`;o.write(`
23
- const ${n}_present = ${i};
24
- if (!${n}.issues.length || ${n}_present) {
25
- if (${n}.issues.length) {${c(n,r)}
26
- }
27
-
28
- if (${e}) {
29
- newResult[${r}] = ${n}.value;
30
- }
31
- }
32
-
33
- `)}else f?(o.write(`
34
- if (${n}.issues.length) {${c(n,r)}
35
- }
36
- `),d===`defaulted`?o.write(`newResult[${r}] = ${n}.value;`):o.write(`
37
- if (${n}.value !== undefined || ${i}) {
38
- newResult[${r}] = ${n}.value;
39
- }
40
- `)):o.write(`
41
- const ${n}_present = ${i};
42
- if (${n}.issues.length) {${c(n,r)}
43
- }
44
- if (!${n}_present && !${n}.issues.length) {
45
- payload.issues.push({
46
- code: "invalid_type",
47
- expected: "nonoptional",
48
- input: undefined,
49
- path: [${r}]
50
- });
51
- if (ctx && ctx.abortEarly) {
52
- payload.value = newResult;
53
- return payload;
54
- }
55
- }
56
-
57
- if (${n}_present) {
58
- newResult[${r}] = ${n}.value;
59
- }
60
-
61
- `)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=Ox,c=!ES.jitless,l=c&&kx.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?qw([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function Xw(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!Yx(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>tS(e,r,DS())))}),t)}var Zw=$(`$ZodUnion`,(e,t)=>{JC.init(e,t),gS(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),gS(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),gS(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),gS(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>gx(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>Xw(t,r,e,i)):Xw(o,r,e,i)}}),Qw=$(`$ZodIntersection`,(e,t)=>{JC.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>eT(e,t,n)):eT(e,i,a)}});function $w(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Ax(e)&&Ax(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=$w(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=$w(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function eT(e,t,n){let r=new Map,i,a=new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=$w(t.value,n.value);if(!c.valid){if(Yx(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var tT=$(`$ZodEnum`,(e,t)=>{JC.init(e,t);let n=ux(t.entries),r=new Set(n);e._zod.values=r,gS(e,`pattern`,e=>{let t=ux(e.def.entries).filter(e=>Mx.has(typeof e));return RegExp(t.length?`^(${t.map(e=>Nx(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),nT=$(`$ZodLiteral`,(e,t)=>{JC.init(e,t);let n=new Set(t.values);e._zod.values=n,gS(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?Nx(e):e?Nx(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),rT=$(`$ZodTransform`,(e,t)=>{JC.init(e,t),e._zod.optin=`optional`,ES.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new TS(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new wS;return n.value=i,n}});function iT(e,t){return e.value=t.issues.length?void 0:t.value,e}var aT=$(`$ZodOptional`,(e,t)=>{JC.init(e,t),gS(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,gS(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),gS(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${gx(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>iT(e,t)):iT(e,r)}return t.innerType._zod.run(e,n)}}),oT=$(`$ZodExactOptional`,(e,t)=>{aT.init(e,t),gS(e,`values`,e=>e.def.innerType._zod.values),gS(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),sT=$(`$ZodNullable`,(e,t)=>{JC.init(e,t),gS(e,`optin`,e=>e.def.innerType._zod.optin),gS(e,`optout`,e=>e.def.innerType._zod.optout),gS(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${gx(t.source)}|null)$`):void 0}),gS(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),cT=$(`$ZodDefault`,(e,t)=>{JC.init(e,t),e._zod.optin=`defaulted`,gS(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>lT(e,t)):lT(r,t)}});function lT(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var uT=$(`$ZodPrefault`,(e,t)=>{JC.init(e,t),e._zod.optin=`defaulted`,gS(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),dT=$(`$ZodNonOptional`,(e,t)=>{JC.init(e,t),gS(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>fT(t,e)):fT(i,e)}});function fT(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function pT(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>tS(e,r,DS()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var mT=$(`$ZodCatch`,(e,t)=>{JC.init(e,t),gS(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),gS(e,`optout`,e=>e.def.innerType._zod.optout),gS(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>pT(e,r,t,n)):pT(e,r,t,n)}}),hT=$(`$ZodPipe`,(e,t)=>{JC.init(e,t),gS(e,`values`,e=>e.def.in._zod.values),gS(e,`optin`,e=>e.def.in._zod.optin),gS(e,`optout`,e=>e.def.out._zod.optout),gS(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>gT(e,t.in,n)):gT(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>gT(e,t.out,n)):gT(r,t.out,n)}});function gT(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var _T=$(`$ZodReadonly`,(e,t)=>{JC.init(e,t),gS(e,`propValues`,e=>e.def.innerType._zod.propValues),gS(e,`values`,e=>e.def.innerType._zod.values),gS(e,`optin`,e=>e.def.innerType?._zod?.optin),gS(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(vT):vT(r)}});function vT(e){return e.memo||(e.value=Object.freeze(e.value)),e}var yT=$(`$ZodCustom`,(e,t)=>{NC.init(e,t),JC.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>bT(t,n,r,e));bT(i,n,r,e)}});function bT(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(oS(e))}}var xT=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},ST=`~memo`,CT=[];function wT(e){return typeof e==`object`&&!!e}function TT(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var ET=new WeakMap,DT=0,OT=1,kT=2;function AT(e,t,n){let r=ET.get(e);if(r!==void 0)return r?kT:DT;if(t.has(e))return kT;t.add(e);let i=DT,a=e=>{if(i!==kT&&e?._zod){let r=AT(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=DT;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?OT:o.value?._zod?AT(o.value,t,n):DT;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=vx(c);s(e?o(e,!0):OT),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?AT(r,t,!1):OT);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),jT(e,i)}function jT(e,t){return t!==OT&&ET.set(e,t===kT),t}function MT(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var NT,PT=[],FT={alloc(e,t,n){let r=NT;if(!r)return n;NT=void 0;let i={value:n,issues:null};return r.set(t.value,i),PT.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&LT(n,e.value))throw new xT;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=AT(e,new Set,!1);if(i===DT)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===kT||r?n=!0:r=!0}let l=s.value;if(!wT(l))return t(s,c);let u=c[ST];u||(u={buckets:new WeakMap,backEdges:void 0},c[ST]=u);let d;i===c?d=a:(d=MT(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...TT(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=new WeakSet),u.backEdges.add(f.value)),s;NT=d;let p=PT.length,m=t(s,c);NT=void 0;let h=PT.length>p?PT.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?TT(e.issues):CT),e)):(h&&(h.issues=m.issues.length?TT(m.issues):CT),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function IT(){return FT}function LT(e,t){let n=e[ST]?.backEdges;return n!==void 0&&wT(t)&&n.has(t)}var RT=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(aS(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${Ix(e.values[0])}`:`Invalid option: expected one of ${dx(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${dx(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function zT(){return{localeError:RT()}}var BT,VT=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function HT(){return new VT}(BT=globalThis).__zod_globalRegistry??(BT.__zod_globalRegistry=HT());var UT=globalThis.__zod_globalRegistry;function WT(e){return e.checks&&=[...e.checks],e}function GT(e,t){return new e(WT({type:`string`,...Fx(t)}))}function KT(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...Fx(t)})}function qT(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...Fx(t)})}function JT(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...Fx(t)})}function YT(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...Fx(t)})}function XT(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...Fx(t)})}function ZT(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...Fx(t)})}function QT(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...Fx(t)})}function $T(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...Fx(t)})}function eE(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...Fx(t)})}function tE(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...Fx(t)})}function nE(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...Fx(t)})}function rE(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...Fx(t)})}function iE(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...Fx(t)})}function aE(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...Fx(t)})}function oE(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...Fx(t)})}function sE(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...Fx(t)})}function cE(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...Fx(t)})}function lE(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...Fx(t)})}function uE(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...Fx(t)})}function dE(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...Fx(t)})}function fE(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...Fx(t)})}function pE(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...Fx(t)})}function mE(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...Fx(t)})}function hE(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...Fx(t)})}function nee(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...Fx(t)})}function ree(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...Fx(t)})}function iee(e,t){return new e({type:`boolean`,...Fx(t)})}function aee(e){return new e({type:`unknown`})}function oee(e,t){return new e({type:`never`,...Fx(t)})}function gE(e,t){return new FC({check:`max_length`,...Fx(t),maximum:e})}function _E(e,t){return new IC({check:`min_length`,...Fx(t),minimum:e})}function vE(e,t){return new LC({check:`length_equals`,...Fx(t),length:e})}function see(e,t){return new zC({check:`string_format`,format:`regex`,...Fx(t),pattern:e})}function cee(e){return new BC({check:`string_format`,format:`lowercase`,...Fx(e)})}function lee(e){return new VC({check:`string_format`,format:`uppercase`,...Fx(e)})}function uee(e,t){return new HC({check:`string_format`,format:`includes`,...Fx(t),includes:e})}function dee(e,t){return new UC({check:`string_format`,format:`starts_with`,...Fx(t),prefix:e})}function fee(e,t){return new WC({check:`string_format`,format:`ends_with`,...Fx(t),suffix:e})}function yE(e){return new GC({check:`overwrite`,tx:e})}function pee(e){return yE(t=>t.normalize(e))}function mee(){return yE(e=>e.trim())}function hee(){return yE(e=>e.toLowerCase())}function gee(){return yE(e=>e.toUpperCase())}function _ee(){return yE(e=>Ex(e))}function vee(e,t,n){return new e({type:`array`,element:t,...Fx(n)})}function yee(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...Fx(n)})}function bE(e,t){let n=xE(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(oS(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(oS(r))}},e(t.value,t)),t);return n}function xE(e,t){let n=new NC({check:`custom`,...Fx(t)});return n._zod.check=e,n}function SE(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&_x(e,t,n[t]);return e}function CE(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??UT,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function wE(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function TE(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,TE(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&SE(o.schema,c),t.io===`input`&&FE(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function EE(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function DE(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${EE(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+EE(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
62
-
63
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0])a(n);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function OE(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;OE(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var kE=new Set([`type`,`properties`,`required`,`additionalProperties`]),AE=[`oneOf`,`anyOf`];function jE(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function ME(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!kE.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??jE(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}_x(n,r,e.length===1?e[0]:ME(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=jE(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function NE(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of kE)if(t in e)return;let n=t.filter(e=>AE.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=ME(t);else{let e=n[0],i=AE.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>ME([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,SE(e,r))}function PE(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):SE(i,s),SE(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())OE(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])NE(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}SE(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,_x(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:LE(t,`input`,e.processors),output:LE(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function FE(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return FE(r.element,n);if(r.type===`set`)return FE(r.valueType,n);if(r.type===`lazy`)return FE(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return FE(r.innerType,n);if(r.type===`intersection`)return FE(r.left,n)||FE(r.right,n);if(r.type===`record`||r.type===`map`)return FE(r.keyType,n)||FE(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:FE(r.in,n)||FE(r.out,n);if(r.type===`object`){for(let e in r.shape)if(FE(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(FE(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(FE(e,n))return!0;return!!(r.rest&&FE(r.rest,n))}return!1}var IE=(e,t={})=>n=>{let r=CE({...n,processors:t});return TE(e,r),DE(r,e),PE(r,e)},LE=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=CE({...i??{},target:a,io:t,processors:n});return TE(e,o),DE(o,e),PE(o,e)},RE=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},zE=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},BE=(e,t)=>{RE(e,`minimum`,t),zE(e,`maximum`,t)},VE=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},HE=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},UE=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},WE=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},GE=(e,t)=>RE(e,`minimum`,t.minimum),KE=(e,t)=>zE(e,`maximum`,t.maximum),qE=e=>(t,n)=>{WE(t,n.format);let[r,i]=e[n.format];RE(t,`minimum`,r),zE(t,`maximum`,i)},JE={greater_than:(e,t)=>RE(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>zE(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>VE(e,t.value),number_format:qE(Rx),bigint_format:qE(zx),min_length:GE,max_length:KE,length_equals:(e,t)=>BE(e,t.length),min_size:GE,max_size:KE,size_equals:(e,t)=>BE(e,t.size),string_format:(e,t)=>{WE(e,t.format),t.pattern&&HE(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>UE(e,t.mime)};function YE(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)JE[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&RE(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&RE(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&zE(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&zE(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&VE(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&UE(t,i.mime);for(let e of i.patterns??[])HE(t,e);return t}var XE={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},ZE=new Map([[kw,yC],[jw,bC]]),QE=e=>ZE.get(e)??e,$E=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=YE(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=XE[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(QE);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},eD=(e,t,n,r)=>{n.type=`boolean`},tD=(e,t,n,r)=>{n.not={}},nD=(e,t,n,r)=>{let i=e._zod.def,a=ux(i.entries);a.length===0?n.not={}:(a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a)},rD=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(wE(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(wE(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},iD=(e,t,n,r)=>{wE(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},aD=(e,t,n,r)=>{wE(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},oD=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=YE(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=TE(a.element,t,{...r,path:[...r.path,`items`]})};function sD(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?sD(t.out):t.type===`catch`?sD(t.innerType):e._zod.optin}var cD=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&wE(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)_x(i.properties,e,TE(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?sD(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=TE(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},lD=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>TE(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},uD=(e,t,n,r)=>{let i=e._zod.def,a=TE(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=TE(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},dD=(e,t,n,r)=>{let i=e._zod.def,a=TE(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},fD=(e,t,n,r)=>{let i=e._zod.def;TE(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},pD=Symbol();function mD(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(wE(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),pD):JSON.parse(o)}var hD=(e,t,n,r)=>{let i=e._zod.def;TE(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=mD(i.defaultValue,e,t,n,r);o!==pD&&(n.default=o)},gD=(e,t,n,r)=>{let i=e._zod.def;TE(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=mD(i.defaultValue,e,t,n,r);o!==pD&&(n._prefault=o)},_D=(e,t,n,r)=>{let i=e._zod.def;TE(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{wE(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},vD=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;TE(o,t,r);let s=t.seen.get(e);s.ref=o},yD=(e,t,n,r)=>{let i=e._zod.def;TE(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},bD=(e,t,n,r)=>{let i=e._zod.def;TE(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},xD=new WeakSet([Object.prototype,Error.prototype]);function SD(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var CD=$(`ZodError`,(e,t)=>{NS.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);xD.has(n)||(xD.add(n),SD(n,`format`,e=>t=>IS(e,t)),SD(n,`flatten`,e=>t=>FS(e,t)),SD(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,fx,2)}),SD(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,fx,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),wD=RS(CD),TD=zS(CD),ED=BS(CD),DD=HS(CD),OD=JS(CD),kD=YS(CD),AD=XS(CD),jD=ZS(CD),MD=QS(CD),ND=$S(CD),PD=eC(CD),FD=tC(CD);function ID(){ES.localeError||DS(zT())}function LD(){ES.memoizer||DS({memoizer:IT()})}var RD=$(`ZodType`,(e,t)=>(ID(),JC.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(wx(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Px(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(QO(e,t))},superRefine(e,t){return this.check($O(e,t))},overwrite(e){return this.check(yE(e))},optional(){return PO(this)},exactOptional(){return IO(this)},nullable(){return RO(this)},nullish(){return PO(RO(this))},nonoptional(e){return WO(this,e)},array(){return yO(this)},or(e){return wO([this,e])},and(e){return EO(this,e)},transform(e){return JO(this,MO(e))},default(e){return BO(this,e)},prefault(e){return HO(this,e)},catch(e){return KO(this,e)},pipe(e){return JO(this,e)},readonly(){return XO(this)},describe(e){let t=this.clone();return UT.add(t,{description:e}),t},meta(...e){if(e.length===0)return UT.get(this);let t=this.clone();return UT.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return lS(this,`~standard`,{...ZC(this),jsonSchema:{input:LE(this,`input`),output:LE(this,`output`)}})},set"~standard"(e){cS(this,`~standard`,e)},parse:function e(t,n){return wD(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await TD(this,t,n,{callee:e})},safeParse(e,t){return ED(this,e,t)},async safeParseAsync(e,t){return DD(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){cS(this,`spa`,e)},validate(e,t){return GS(this,e,t)},validateAsync(e,t){return qS(this,e,t)},encode:function e(t,n){return OD(this,t,n,{callee:e})},decode:function e(t,n){return kD(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await AD(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await jD(this,t,n,{callee:e})},safeEncode(e,t){return MD(this,e,t)},safeDecode(e,t){return ND(this,e,t)},async safeEncodeAsync(e,t){return PD(this,e,t)},async safeDecodeAsync(e,t){return FD(this,e,t)},toJSONSchema(e){return IE(this,{})(e)},get description(){return UT.get(this)?.description},get _def(){return this._zod.def}}),zD=$(`_ZodString`,(e,t)=>{QC.init(e,t),RD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$E(e,t,n,r)},uS({format:e=>YE(e).format??null,minLength:e=>YE(e).minimum??null,maxLength:e=>YE(e).maximum??null},{regex(...e){return this.check(see(...e))},includes(...e){return this.check(uee(...e))},startsWith(...e){return this.check(dee(...e))},endsWith(...e){return this.check(fee(...e))},min(...e){return this.check(_E(...e))},max(...e){return this.check(gE(...e))},length(...e){return this.check(vE(...e))},nonempty(...e){return this.check(_E(1,...e))},lowercase(e){return this.check(cee(e))},uppercase(e){return this.check(lee(e))},trim(){return this.check(mee())},normalize(...e){return this.check(pee(...e))},toLowerCase(){return this.check(hee())},toUpperCase(){return this.check(gee())},slugify(){return this.check(_ee())}})),BD=$(`ZodString`,(e,t)=>{QC.init(e,t),zD.init(e,t)},{email(e){return this.check(KT(qD,e))},url(e){return this.check(QT(XD,e))},jwt(e){return this.check(pE(dO,e))},emoji(e){return this.check($T(ZD,e))},guid(e){return this.check(qT(JD,e))},uuid(e){return this.check(JT(YD,e))},uuidv4(e){return this.check(YT(YD,e))},uuidv6(e){return this.check(XT(YD,e))},uuidv7(e){return this.check(ZT(YD,e))},nanoid(e){return this.check(eE(QD,e))},cuid(e){return this.check(tE($D,e))},cuid2(e){return this.check(nE(eO,e))},ulid(e){return this.check(rE(tO,e))},base64(e){return this.check(uE(cO,e))},base64url(e){return this.check(dE(lO,e))},xid(e){return this.check(iE(nO,e))},ksuid(e){return this.check(aE(rO,e))},ipv4(e){return this.check(oE(iO,e))},ipv6(e){return this.check(sE(aO,e))},cidrv4(e){return this.check(cE(oO,e))},cidrv6(e){return this.check(lE(sO,e))},e164(e){return this.check(fE(uO,e))},datetime(e){return this.check(mE(UD,e))},date(e){return this.check(hE(WD,e))},time(e){return this.check(nee(GD,e))},duration(e){return this.check(ree(KD,e))}});function VD(e){return GT(BD,e)}var HD=$(`ZodStringFormat`,(e,t)=>{$C.init(e,t),zD.init(e,t)}),UD=$(`ZodISODateTime`,(e,t)=>{vw.init(e,t),HD.init(e,t)}),WD=$(`ZodISODate`,(e,t)=>{yw.init(e,t),HD.init(e,t)}),GD=$(`ZodISOTime`,(e,t)=>{bw.init(e,t),HD.init(e,t)}),KD=$(`ZodISODuration`,(e,t)=>{xw.init(e,t),HD.init(e,t)}),qD=$(`ZodEmail`,(e,t)=>{nw.init(e,t),HD.init(e,t)}),JD=$(`ZodGUID`,(e,t)=>{ew.init(e,t),HD.init(e,t)}),YD=$(`ZodUUID`,(e,t)=>{tw.init(e,t),HD.init(e,t)}),XD=$(`ZodURL`,(e,t)=>{uw.init(e,t),HD.init(e,t)}),ZD=$(`ZodEmoji`,(e,t)=>{dw.init(e,t),HD.init(e,t)}),QD=$(`ZodNanoID`,(e,t)=>{fw.init(e,t),HD.init(e,t)}),$D=$(`ZodCUID`,(e,t)=>{pw.init(e,t),HD.init(e,t)}),eO=$(`ZodCUID2`,(e,t)=>{mw.init(e,t),HD.init(e,t)}),tO=$(`ZodULID`,(e,t)=>{hw.init(e,t),HD.init(e,t)}),nO=$(`ZodXID`,(e,t)=>{gw.init(e,t),HD.init(e,t)}),rO=$(`ZodKSUID`,(e,t)=>{_w.init(e,t),HD.init(e,t)}),iO=$(`ZodIPv4`,(e,t)=>{tee.init(e,t),HD.init(e,t)}),aO=$(`ZodIPv6`,(e,t)=>{ww.init(e,t),HD.init(e,t)}),oO=$(`ZodCIDRv4`,(e,t)=>{Tw.init(e,t),HD.init(e,t)}),sO=$(`ZodCIDRv6`,(e,t)=>{Dw.init(e,t),HD.init(e,t)}),cO=$(`ZodBase64`,(e,t)=>{Aw.init(e,t),HD.init(e,t)}),lO=$(`ZodBase64URL`,(e,t)=>{Nw.init(e,t),HD.init(e,t)}),uO=$(`ZodE164`,(e,t)=>{Pw.init(e,t),HD.init(e,t)}),dO=$(`ZodJWT`,(e,t)=>{Iw.init(e,t),HD.init(e,t)}),fO=$(`ZodBoolean`,(e,t)=>{Lw.init(e,t),RD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>eD(e,t,n,r)});function pO(e){return iee(fO,e)}var mO=$(`ZodUnknown`,(e,t)=>{Rw.init(e,t),RD.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function hO(){return aee(mO)}var gO=$(`ZodNever`,(e,t)=>{zw.init(e,t),RD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>tD(e,t,n,r)});function _O(e){return oee(gO,e)}var vO=$(`ZodArray`,(e,t)=>{LD(),Uw.init(e,t),RD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oD(e,t,n,r),e.element=t.element},{min(e,t){return this.check(_E(e,t))},nonempty(e){return this.check(_E(1,e))},max(e,t){return this.check(gE(e,t))},length(e,t){return this.check(vE(e,t))},unwrap(){return this.element}});function yO(e,t){return vee(vO,e,t)}var bO=$(`ZodObject`,(e,t)=>{LD(),Yw.init(e,t),RD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cD(e,t,n,r),_S(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return OO(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(wx(this._zod.def,{catchall:e}))},passthrough(){return this.clone(wx(this._zod.def,{catchall:hO()}))},loose(){return this.clone(wx(this._zod.def,{catchall:hO()}))},strict(){return this.clone(wx(this._zod.def,{catchall:_O()}))},strip(){return this.clone(wx(this._zod.def,{catchall:void 0}))},extend(e){return Ux(this,e)},safeExtend(e){return Gx(this,e)},merge(e){return Kx(this,e)},pick(e){return Bx(this,e)},omit(e){return Hx(this,e)},partial(...e){return qx(NO,this,e[0])},exactPartial(...e){return qx(FO,this,e[0],`exactPartial`)},required(...e){return Jx(UO,this,e[0])}});function xO(e,t){return new bO({type:`object`,shape:e??{},...Fx(t)})}function SO(e,t){return new bO({type:`object`,shape:e,catchall:hO(),...Fx(t)})}var CO=$(`ZodUnion`,(e,t)=>{Zw.init(e,t),RD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lD(e,t,n,r),e.options=t.options});function wO(e,t){return new CO({type:`union`,options:e,...Fx(t)})}var TO=$(`ZodIntersection`,(e,t)=>{Qw.init(e,t),RD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>uD(e,t,n,r)});function EO(e,t){return new TO({type:`intersection`,left:e,right:t})}var DO=$(`ZodEnum`,(e,t)=>{tT.init(e,t),RD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>nD(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new DO({...t,checks:[],...Fx(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new DO({...t,checks:[],...Fx(r),entries:i})}});function OO(e,t){return new DO({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...Fx(t)})}var kO=$(`ZodLiteral`,(e,t)=>{nT.init(e,t),RD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>rD(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function AO(e,t){return new kO({type:`literal`,values:Array.isArray(e)?e:[e],...Fx(t)})}var jO=$(`ZodTransform`,(e,t)=>{LD(),rT.init(e,t),RD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>aD(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new TS(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(oS(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(oS(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function MO(e){return new jO({type:`transform`,transform:e})}var NO=$(`ZodOptional`,(e,t)=>{aT.init(e,t),RD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bD(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function PO(e){return new NO({type:`optional`,innerType:e})}var FO=$(`ZodExactOptional`,(e,t)=>{oT.init(e,t),RD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bD(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function IO(e){return new FO({type:`optional`,innerType:e})}var LO=$(`ZodNullable`,(e,t)=>{sT.init(e,t),RD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>dD(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function RO(e){return new LO({type:`nullable`,innerType:e})}var zO=$(`ZodDefault`,(e,t)=>{cT.init(e,t),RD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hD(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function BO(e,t){return new zO({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():jx(t)}})}var VO=$(`ZodPrefault`,(e,t)=>{uT.init(e,t),RD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gD(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function HO(e,t){return new VO({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():jx(t)}})}var UO=$(`ZodNonOptional`,(e,t)=>{dT.init(e,t),RD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fD(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function WO(e,t){return new UO({type:`nonoptional`,innerType:e,...Fx(t)})}var GO=$(`ZodCatch`,(e,t)=>{mT.init(e,t),RD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_D(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function KO(e,t){return new GO({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:yS(t)})}var qO=$(`ZodPipe`,(e,t)=>{hT.init(e,t),RD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vD(e,t,n,r),e.in=t.in,e.out=t.out});function JO(e,t){return new qO({type:`pipe`,in:e,out:t})}var YO=$(`ZodReadonly`,(e,t)=>{_T.init(e,t),RD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yD(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function XO(e){return new YO({type:`readonly`,innerType:e})}var ZO=$(`ZodCustom`,(e,t)=>{yT.init(e,t),RD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>iD(e,t,n,r)});function QO(e,t={}){return yee(ZO,e,t)}function $O(e,t){return bE(e,t)}var ek=SO({frame:VD(),session:VD(),agent:VD(),tag:VD(),claimedAt:VD(),expiresAt:VD()});function tk(e,t){return t===e||t.startsWith(`${e}/`)}SO({version:AO(1),claims:yO(ek)});var nk=class extends Error{reason;constructor(e){super(`The waiting edit was ${e}.`),this.reason=e,this.name=`WaitDropped`}},rk=1e3,ik=N()(()=>({edits:[]})),ak=new Set,ok=1;function sk(){return F(ik,e=>e.edits)}function ck(e,t,{live:n=Lg,replace:r,dropWhen:i}){r&&pk(e,r);let a=()=>Object.values(n.getState().claims).filter(t=>e.some(e=>tk(e,t.frame))),o=a();return o.length===0?null:fk({label:t,refs:e,replace:r,dropWhen:i,live:n,holders:o.map(({frame:e,tag:t,claimedAt:n})=>({frame:e,tag:t,claimedAt:n})),ready:()=>n.getState().connected&&a().length===0})}function lk(e,t,{live:n=Lg,replace:r,dropWhen:i}={}){let{frame:a,tag:o,claimedAt:s,expiresAt:c}=e.details;if(typeof a!=`string`)return Promise.reject(e);let l={frame:a,tag:typeof o==`string`?o:a,claimedAt:typeof s==`string`?s:new Date().toISOString()},u=typeof c==`string`?Date.parse(c):NaN,d=Date.now(),f=!1;return r&&pk([a],r),fk({label:t,refs:[a],replace:r,dropWhen:i,live:n,holders:[l],ready:()=>{let{claims:e,connected:t}=n.getState();if(a in e&&(f=!0),!t||a in e)return!1;let r=Date.now();return f||r>=u||r-d>=2e3}})}async function uk(e,t,n,r={}){let i=ck(e,t,r);for(i&&await i;;)try{return await n()}catch(e){if(!(e instanceof cx)||e.code!==`frame-claimed`)throw e;await lk(e,t,r)}}function dk(){for(let e of[...ak])mk(e,new nk(`cancelled`))}function fk({label:e,refs:t,replace:n,dropWhen:r,live:i,holders:a,ready:o}){return new Promise((s,c)=>{let l={id:ok++,label:e,holders:a},u=()=>{r?.(i.getState())?mk(p,new nk(`cancelled`)):o()&&(mk(p),s())},d=i.subscribe(u),f=setInterval(u,rk),p={edit:l,refs:t,replace:n,reject:c,stop:()=>{d(),clearInterval(f)}};ak.add(p),ik.setState(e=>({edits:[...e.edits,l]})),u()})}function pk(e,t){for(let n of[...ak])n.replace===t&&n.refs.every(t=>e.includes(t))&&mk(n,new nk(`replaced`))}function mk(e,t){ak.delete(e)&&(e.stop(),ik.setState(t=>({edits:t.edits.filter(t=>t!==e.edit)})),t&&e.reject(t))}function hk(e=fetch){let t=(t,n)=>lx(t,n,`POST`,e),n=(e,n,r,i)=>uk(e,n,()=>t(r,i));return{addProject:e=>t(`/api/project/add`,{name:e}),renameProject:(e,n)=>t(`/api/project/rename`,{ref:e,name:n}),duplicateProject:e=>t(`/api/project/duplicate`,{ref:e}),deleteProject:e=>t(`/api/project/delete`,{ref:e}),projectTokens:(e,n)=>t(`/api/project/tokens`,{ref:e,...n}),addPage:(e,n)=>t(`/api/page/add`,{ref:e,index:n}),duplicatePage:e=>t(`/api/page/duplicate`,{ref:e}),renamePage:(e,t)=>n([e],`rename`,`/api/page/rename`,{ref:e,name:t}),movePage:(e,n)=>t(`/api/page/move`,{ref:e,index:n}),deletePage:e=>n([e],`delete`,`/api/page/delete`,{ref:e}),addFrame:(e,n,r,i)=>t(`/api/frame/add`,{ref:e,...n,x:r,y:i}),duplicateFrames:(e,n)=>t(`/api/frame/duplicate`,{refs:e,offset:n}),renameFrame:(e,t)=>n([e],`rename`,`/api/frame/rename`,{ref:e,name:t}),fitFrame:e=>n([e],`resize`,`/api/frame/fit`,{ref:e}),orderFrame:(e,n)=>t(`/api/frame/order`,{ref:e,index:n}),flagFrames:(e,n,r)=>t(`/api/frame/flag`,{refs:e,flag:n,on:r}),deleteFrames:e=>n(e,`delete`,`/api/frame/delete`,{refs:e}),copyFrames:e=>t(`/api/clipboard/copy`,{refs:e}),cutFrames:e=>n(e,`cut`,`/api/clipboard/cut`,{refs:e}),pasteFrames:(e,n)=>t(`/api/clipboard/paste`,{ref:e,at:n}),addSection:(e,n,r)=>t(`/api/section/add`,{page:e,name:r,box:n}),renameSection:(e,n,r)=>t(`/api/section/rename`,{page:e,section:n,name:r}),deleteSection:(e,n)=>t(`/api/section/delete`,{page:e,section:n}),undo:()=>t(`/api/undo`,{}),redo:()=>t(`/api/redo`,{})}}var gk=hk();function _k(e,t){return e.toLowerCase()===t.toLowerCase()}function vk(e,t){let n=new Set([...t].map(e=>e.toLowerCase()));if(!n.has(e.toLowerCase()))return e;for(let t=2;;t++){let r=`${e}-${t}`;if(!n.has(r.toLowerCase()))return r}}var yk=N()(()=>({ref:null}));function bk(){return F(yk,e=>e.ref)}function xk(e){yk.setState({ref:e})}function Sk(){yk.setState({ref:null})}function Ck(e){return t=>{t instanceof nk||tg.add({title:e,description:t instanceof Error?t.message:String(t),type:`error`})}}function wk(e){for(let t=e.length+1;;t++){let n=`page-${t}`;if(!e.some(e=>_k(e,n)))return n}}async function Tk(e,t,{current:n,navigate:r,calls:i=gk}){try{let a=await i.renamePage(e.ref,t);e.name===n&&r(Qg(e.project,a.name))}catch(t){Ck(`Couldn't rename ${e.name}`)(t)}}async function Ek(e,t,{current:n,navigate:r,calls:i=gk}){let a=t.filter(t=>t.ref!==e.ref),o=a[e.index]??a[e.index-1];try{await i.deletePage(e.ref)}catch(t){Ck(`Couldn't delete ${e.name}`)(t);return}e.name===n&&r(o?Qg(e.project,o.name):`/p/${encodeURIComponent(e.project)}`)}function Dk(e,t,n=gk){let[,r]=ya();(0,_.useEffect)(()=>{let i=()=>Lg.getState().board?.projects.find(t=>t.name===e)?.pages??[],a=()=>i().find(e=>e.name===t),o=()=>Lg.getState().canWrite,s=()=>o()&&a()!==void 0,c=e=>r(Qg(e.project,e.name)),l=xe([{id:`page.new`,label:`Add page`,group:`page`,command:{label:`Add page`,icon:un},enabled:o,run:()=>{let t=i().map(e=>e.name),r=a();n.addPage(`${e}/${wk(t)}`,r?r.index+1:void 0).then(e=>{c(e),xk(e.ref)},Ck(`Couldn't add a page`))}},{id:`page.duplicate`,label:`Duplicate page`,group:`page`,command:{label:`Duplicate page`,icon:$t},enabled:s,run:()=>{let e=a();e&&n.duplicatePage(e.ref).then(c,Ck(`Couldn't duplicate ${e.name}`))}},{id:`page.rename`,label:`Rename page`,group:`page`,command:{label:`Rename page`,icon:br},enabled:s,run:()=>{let e=a();e&&xk(e.ref)}},...[{id:`page.moveUp`,label:`Move up`,named:`Move page up`,by:-1,icon:yt},{id:`page.moveDown`,label:`Move down`,named:`Move page down`,by:1,icon:dt}].map(({id:e,label:t,named:r,by:o,icon:c})=>({id:e,label:t,group:`page`,command:{label:r,icon:c},enabled:()=>{let e=a(),t=e?e.index+o:-1;return s()&&t>=0&&t<i().length},run:()=>{let e=a();e&&n.movePage(e.ref,e.index+o).catch(Ck(`Couldn't move ${e.name}`))}})),{id:`page.delete`,label:`Delete page`,group:`page`,command:{label:`Delete page`,icon:bi},enabled:s,run:()=>{let e=a();e&&Ek(e,i(),{current:e.name,navigate:r,calls:n})}}]),u=Lg.subscribe((e,t)=>{(e.canWrite!==t.canWrite||e.board!==t.board)&&U()});return()=>{u(),l()}},[e,t,r,n])}var Ok=`frameboard.home.pins`;function kk(){return(0,_.useSyncExternalStore)(Lk,Ak,Ak)}function Ak(){let e=Rk();return e!==Pk.raw&&(Pk={raw:e,pins:Bk(e)}),Pk.pins}function jk(e){let t=new Set(Ak());t.delete(e)||t.add(e),zk(t)}function Mk(e,t){let n=new Set(Ak());n.delete(e)&&zk(n.add(t))}function Nk(e){let t=new Set(Ak());t.delete(e)&&zk(t)}var Pk={raw:null,pins:new Set},Fk=null,Ik=new Set;function Lk(e){return Ik.add(e),()=>Ik.delete(e)}function Rk(){if(Fk!==null)return Fk;try{return localStorage.getItem(Ok)}catch{return null}}function zk(e){let t=JSON.stringify([...e]);try{localStorage.setItem(Ok,t),Fk=null}catch{Fk=t}for(let e of Ik)e();U()}function Bk(e){try{let t=JSON.parse(e??`[]`);return new Set(Array.isArray(t)?t.filter(e=>typeof e==`string`):[])}catch{return new Set}}var Vk=N()(()=>({focused:null,renaming:null}));function Hk(e){return F(Vk,t=>t.renaming?.project===e?t.renaming:null)}function Uk(e){Vk.getState().focused!==e&&(Vk.setState({focused:e}),U())}function Wk(e){Vk.setState({renaming:{project:e,draft:e,refusal:null,attempt:0}})}function Gk(){Vk.setState({renaming:null})}function Kk({name:e,pages:t}){let n=t[0];return n?Qg(e,n.name):`/p/${encodeURIComponent(e)}`}async function qk(e,t,n=gk){Vk.setState(({renaming:e})=>({renaming:e&&{...e,draft:t}}));try{await n.renameProject(e,t)}catch(t){return t instanceof cx&&t.code===`invalid-name`?(Vk.setState(({renaming:e})=>({renaming:e&&{...e,refusal:t.message,attempt:e.attempt+1}})),null):(Gk(),Ck(`Couldn't rename ${e}`)(t),null)}return Mk(e,t),Gk(),Uk(t),t}function Jk(){return Vk.getState().focused}function Yk(e){(0,_.useEffect)(()=>xe([{id:`nav.home`,label:`All projects`,group:`project`,command:{label:`Go to all projects`,icon:En},keys:[`Alt+ArrowUp`],run:e}]),[e])}function Xk(e=gk,t){(0,_.useEffect)(()=>{let n=xe([{id:`project.new`,label:`New project`,group:`project`,command:{label:`New project`,icon:gn},enabled:()=>Lg.getState().canWrite,run:()=>{t?.(),e.addProject().then(e=>{Uk(e.name),Wk(e.name)},Ck(`Couldn't add a project`))}}]),r=Lg.subscribe((e,t)=>{e.canWrite!==t.canWrite&&U()});return()=>{r(),n()}},[e,t])}function Zk(e,{calls:t=gk,onDeleted:n}={}){let[,r]=ya();(0,_.useEffect)(()=>{let i=()=>Lg.getState().canWrite,a=()=>{let t=e();return Lg.getState().board?.projects.find(e=>e.name===t)},o=()=>i()&&a()!==void 0,s=()=>a()?.name??``,c=xe([{id:`project.open`,label:`Open`,group:`project`,enabled:()=>a()!==void 0,run:()=>{let e=a();e&&r(Kk(e))}},{id:`project.rename`,label:`Rename`,group:`project`,command:{label:`Rename project`,icon:br,hint:s},enabled:o,run:()=>{let e=a();e&&Wk(e.name)}},{id:`project.duplicate`,label:`Duplicate`,group:`project`,command:{label:`Duplicate project`,icon:$t,hint:s},enabled:o,run:()=>{let e=a();e&&t.duplicateProject(e.name).then(e=>Uk(e.name),Ck(`Couldn't duplicate ${e.name}`))}},{id:`project.pin`,label:`Pin`,group:`project`,command:{label:`Pin project`,icon:wr,hint:s},enabled:()=>a()!==void 0,checked:()=>Ak().has(e()??``),run:()=>{let e=a();e&&jk(e.name)}},{id:`project.delete`,label:`Delete`,group:`project`,command:{label:`Delete project`,icon:bi,hint:s},enabled:o,run:()=>{let e=a();e&&t.deleteProject(e.name).then(()=>{Nk(e.name),n?.()},Ck(`Couldn't delete ${e.name}`))}}]),l=Lg.subscribe((e,t)=>{(e.canWrite!==t.canWrite||e.board!==t.board)&&U()});return()=>{l(),c(),Vk.setState({focused:null,renaming:null})}},[t,r,e,n])}var Qk=[`all`,`images`,`video`,`fonts`,`other`],$k={all:`All`,images:`Images`,video:`Video`,fonts:`Fonts`,other:`Other`};function eA(e){switch(e){case`image`:case`gif`:case`svg`:return`images`;case`video`:return`video`;case`font`:return`fonts`;default:return`other`}}function tA(e){return Qk.map(t=>({chip:t,count:t===`all`?e.length:e.filter(e=>eA(e.kind)===t).length})).filter(({chip:e,count:t})=>e===`all`||t>0)}function nA(e,{chip:t,search:n}){let r=n.trim().toLowerCase(),i=new Map;for(let n of e){if(t!==`all`&&eA(n.kind)!==t||r!==``&&!n.path.toLowerCase().includes(r))continue;let e=rA(n.path),a=i.get(e);a?a.push(n):i.set(e,[n])}return[...i].map(([e,t])=>({folder:e,files:t})).sort((e,t)=>aA(e.folder,t.folder))}function rA(e){let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function iA(e){return e.slice(e.lastIndexOf(`/`)+1)}function aA(e,t){return e===``||t===``?e===``?t===``?0:-1:1:e.toLowerCase().localeCompare(t.toLowerCase())}async function oA(e){let t=await(await fetch(`/api/projects/${encodeURIComponent(e)}/assets`)).json();return t.ok?t.data:null}function sA(e){if(Array.isArray(e))return e}function cA(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function lA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function uA(e,t){if(e){if(typeof e==`string`)return lA(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?lA(e,t):void 0}}function dA(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
64
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fA(e,t){return sA(e)||cA(e,t)||uA(e,t)||dA()}var pA=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.bind=void 0;function t(e,t){var n=t.type,r=t.listener,i=t.options;return e.addEventListener(n,r,i),function(){e.removeEventListener(n,r,i)}}e.bind=t})),mA=o(((e,t,n)=>{var r=n&&n.__assign||function(){return r=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},r.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.bindAll=void 0;var i=pA();function a(e){if(e!==void 0)return typeof e==`boolean`?{capture:e}:e}function o(e,t){return t==null?e:r(r({},e),{options:r(r({},a(t)),a(e.options))})}function s(e,t,n){var r=t.map(function(t){var r=o(t,n);return(0,i.bind)(e,r)});return function(){r.forEach(function(e){return e()})}}e.bindAll=s})),hA=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.bindAll=e.bind=void 0;var t=pA();Object.defineProperty(e,"bind",{enumerable:!0,get:function(){return t.bind}});var n=mA();Object.defineProperty(e,"bindAll",{enumerable:!0,get:function(){return n.bindAll}})}))(),gA=`data-pdnd-honey-pot`;function _A(e){return e instanceof Element&&e.hasAttribute(`data-pdnd-honey-pot`)}function vA(e){var t=fA(document.elementsFromPoint(e.x,e.y),2),n=t[0],r=t[1];return n?_A(n)?r??null:n:null}function yA(e){"@babel/helpers - typeof";return yA=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},yA(e)}function bA(e,t){if(yA(e)!=`object`||!e)return e;var n;if(typeof Symbol<`u`&&(n=e[Symbol.toPrimitive])!==void 0){var r=n.call(e,t||`default`);if(yA(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function xA(e){var t=bA(e,`string`);return yA(t)==`symbol`?t:t+``}function SA(e,t,n){return(t=xA(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var bee=2147483647,CA={inset:`unset`,border:`none`,padding:0,margin:0,overflow:`visible`,color:`inherit`,background:`transparent`,width:`auto`,height:`auto`};function wA(e){var t=null;return function(){if(!t){var n=[...arguments];t={result:e.apply(this,n)}}return t.result}}var TA=wA(function(){return typeof HTMLElement<`u`&&typeof HTMLElement.prototype.showPopover==`function`});function EA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function DA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?EA(Object(n),!0).forEach(function(t){SA(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EA(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var OA=2,kA=OA/2;function AA(e){return{x:Math.floor(e.x),y:Math.floor(e.y)}}function jA(e){return{x:e.x-kA,y:e.y-kA}}function MA(e){return{x:Math.max(e.x,0),y:Math.max(e.y,0)}}function NA(e){return{x:Math.min(e.x,window.innerWidth-OA),y:Math.min(e.y,window.innerHeight-OA)}}function PA(e){var t=e.client,n=NA(MA(jA(AA(t))));return DOMRect.fromRect({x:n.x,y:n.y,width:OA,height:OA})}function FA(e){var t=e.clientRect;return{left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`}}function IA(e){var t=e.client,n=e.clientRect;return t.x>=n.x&&t.x<=n.x+n.width&&t.y>=n.y&&t.y<=n.y+n.height}function LA(e){var t=e.initial,n=document.createElement(`div`);n.setAttribute(gA,`true`),TA()&&n.setAttribute(`popover`,`manual`);var r=PA({client:t});Object.assign(n.style,DA(DA({position:`fixed`},TA()?CA:{zIndex:bee}),{},{backgroundColor:`transparent`,padding:0,margin:0,boxSizing:`border-box`,pointerEvents:`auto`},FA({clientRect:r}))),document.body.appendChild(n),TA()&&n.showPopover();var i=(0,hA.bind)(window,{type:`pointermove`,listener:function(e){r=PA({client:{x:e.clientX,y:e.clientY}}),Object.assign(n.style,FA({clientRect:r}))},options:{capture:!0}});return function(e){var t=e.current;if(i(),IA({client:t,clientRect:r})){n.remove();return}function a(){o(),n.remove()}var o=(0,hA.bindAll)(window,[{type:`pointerdown`,listener:a},{type:`pointermove`,listener:a},{type:`focusin`,listener:a},{type:`focusout`,listener:a},{type:`dragstart`,listener:a},{type:`dragenter`,listener:a},{type:`dragover`,listener:a}],{capture:!0})}}function RA(){var e=null;function t(){return e=null,(0,hA.bind)(window,{type:`pointermove`,listener:function(t){e={x:t.clientX,y:t.clientY}},options:{capture:!0}})}function n(){var t=null;return function(n){var r=n.eventName,i=n.payload;if(r===`onDragStart`){var a=i.location.initial.input;t=LA({initial:e??{x:a.clientX,y:a.clientY}})}if(r===`onDrop`){var o,s=i.location.current.input;(o=t)==null||o({current:{x:s.clientX,y:s.clientY}}),t=null,e=null}}}return{bindEvents:t,getOnPostDispatch:n}}function zA(e){if(Array.isArray(e))return lA(e)}function BA(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function VA(){throw TypeError(`Invalid attempt to spread non-iterable instance.
65
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function HA(e){return zA(e)||BA(e)||uA(e)||VA()}var UA=wA(function(){return navigator.userAgent.includes(`Firefox`)}),WA=wA(function(){var e=navigator.userAgent;return e.includes(`AppleWebKit`)&&!e.includes(`Chrome`)});function GA(e){return`nodeName`in e}function KA(e){return GA(e)&&e.ownerDocument!==document}var qA={isLeavingWindow:Symbol(`leaving`),isEnteringWindow:Symbol(`entering`)};(function(){if(typeof window>`u`||!WA())return;function e(){return{enterCount:0,isOverWindow:!1}}var t=e();function n(){t=e()}(0,hA.bindAll)(window,[{type:`dragstart`,listener:function(){t.enterCount=0,t.isOverWindow=!0}},{type:`drop`,listener:n},{type:`dragend`,listener:n},{type:`dragenter`,listener:function(e){!t.isOverWindow&&t.enterCount===0&&(e[qA.isEnteringWindow]=!0),t.isOverWindow=!0,t.enterCount++}},{type:`dragleave`,listener:function(e){t.enterCount--,t.isOverWindow&&t.enterCount===0&&(e[qA.isLeavingWindow]=!0,t.isOverWindow=!1)}}],{capture:!0})})();function JA(e){var t=e.dragLeave;return WA()?t.hasOwnProperty(qA.isLeavingWindow):!1}function YA(e){var t=e.dragLeave,n=t.type,r=t.relatedTarget;return n===`dragleave`?WA()?JA({dragLeave:t}):r==null?!0:UA()?KA(r):r instanceof HTMLIFrameElement:!1}function XA(e){var t=e.onDragEnd;return[{type:`pointermove`,listener:function(){var e=0;return function(){e<20?e++:t()}}()},{type:`pointerdown`,listener:t}]}function ZA(e){return{altKey:e.altKey,button:e.button,buttons:e.buttons,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY}}var QA=function(e){var t=[],n=null,r=function(){t=[...arguments],!n&&(n=requestAnimationFrame(function(){n=null,e.apply(void 0,t)}))};return r.cancel=function(){n&&=(cancelAnimationFrame(n),null)},r}(function(e){return e()}),$A=function(){var e=null;function t(t){e={frameId:requestAnimationFrame(function(){e=null,t()}),fn:t}}function n(){e&&=(cancelAnimationFrame(e.frameId),e.fn(),null)}return{schedule:t,flush:n}}();function ej(e){var t=e.source,n=e.initial,r=e.dispatchEvent,i={dropTargets:[]};function a(e){r(e),i={dropTargets:e.payload.location.current.dropTargets}}return{start:function(e){var r=e.nativeSetDragImage,o={current:n,previous:i,initial:n};a({eventName:`onGenerateDragPreview`,payload:{source:t,location:o,nativeSetDragImage:r}}),$A.schedule(function(){a({eventName:`onDragStart`,payload:{source:t,location:o}})})},dragUpdate:function(e){var r=e.current;$A.flush(),QA.cancel(),a({eventName:`onDropTargetChange`,payload:{source:t,location:{initial:n,previous:i,current:r}}})},drag:function(e){var r=e.current;QA(function(){$A.flush(),a({eventName:`onDrag`,payload:{source:t,location:{initial:n,previous:i,current:r}}})})},drop:function(e){var r=e.current,o=e.updatedSourcePayload;$A.flush(),QA.cancel(),a({eventName:`onDrop`,payload:{source:o??t,location:{current:r,previous:i,initial:n}}})}}}var tj={isActive:!1};function nj(){return!tj.isActive}function rj(e){return e.dataTransfer?e.dataTransfer.setDragImage.bind(e.dataTransfer):null}function ij(e){var t=e.current,n=e.next;if(t.length!==n.length)return!0;for(var r=0;r<t.length;r++)if(t[r].element!==n[r].element)return!0;return!1}function aj(e){var t=e.event,n=e.dragType,r=e.getDropTargetsOver,i=e.dispatchEvent;if(!nj())return;var a=sj({event:t,dragType:n,getDropTargetsOver:r});tj.isActive=!0;var o={current:a};oj({event:t,current:a.dropTargets});var s=ej({source:n.payload,dispatchEvent:i,initial:a});function c(e){var t=ij({current:o.current.dropTargets,next:e.dropTargets});o.current=e,t&&s.dragUpdate({current:o.current})}function l(e){var t=ZA(e),i=r({target:_A(e.target)?vA({x:t.clientX,y:t.clientY}):e.target,input:t,source:n.payload,current:o.current.dropTargets});i.length&&(e.preventDefault(),oj({event:e,current:i})),c({dropTargets:i,input:t})}function u(){o.current.dropTargets.length&&c({dropTargets:[],input:o.current.input}),s.drop({current:o.current,updatedSourcePayload:null}),d()}function d(){tj.isActive=!1,f()}var f=(0,hA.bindAll)(window,[{type:`dragover`,listener:function(e){l(e),s.drag({current:o.current})}},{type:`dragenter`,listener:l},{type:`dragleave`,listener:function(e){YA({dragLeave:e})&&(c({input:o.current.input,dropTargets:[]}),n.startedFrom===`external`&&u())}},{type:`drop`,listener:function(e){o.current={dropTargets:o.current.dropTargets,input:ZA(e)},o.current.dropTargets.length?(e.preventDefault(),oj({event:e,current:o.current.dropTargets}),s.drop({current:o.current,updatedSourcePayload:n.type===`external`?n.getDropPayload(e):null}),d()):u()}},{type:`dragend`,listener:function(e){o.current={dropTargets:o.current.dropTargets,input:ZA(e)},u()}}].concat(HA(XA({onDragEnd:u}))),{capture:!0});s.start({nativeSetDragImage:rj(t)})}function oj(e){var t=e.event,n=e.current[0]?.dropEffect;n!=null&&t.dataTransfer&&(t.dataTransfer.dropEffect=n)}function sj(e){var t=e.event,n=e.dragType,r=e.getDropTargetsOver,i=ZA(t);return n.startedFrom===`external`?{input:i,dropTargets:[]}:{input:i,dropTargets:r({input:i,source:n.payload,target:t.target,current:[]})}}var cj={canStart:nj,start:aj},lj=new Map;function uj(e){var t=e.typeKey,n=e.mount,r=lj.get(t);if(r)return r.usageCount++,r;var i={typeKey:t,unmount:n(),usageCount:1};return lj.set(t,i),i}function dj(e){var t=uj(e);return function(){t.usageCount--,!(t.usageCount>0)&&(t.unmount(),lj.delete(e.typeKey))}}function fj(){var e=[...arguments];return function(){e.forEach(function(e){return e()})}}function pj(e,t){var n=t.attribute,r=t.value;return e.setAttribute(n,r),function(){return e.removeAttribute(n)}}function mj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function hj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?mj(Object(n),!0).forEach(function(t){SA(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function gj(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=_j(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
66
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function _j(e,t){if(e){if(typeof e==`string`)return vj(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vj(e,t):void 0}}function vj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function yj(e){return e.slice(0).reverse()}function bj(e){var t=e.typeKey,n=e.defaultDropEffect,r=new WeakMap,i=`data-drop-target-for-${t}`,a=`[${i}]`;function o(e){return r.set(e.element,e),function(){return r.delete(e.element)}}function s(e){return wA(fj(pj(e.element,{attribute:i,value:`true`}),o(e)))}function c(e){var t=e.source,i=e.target,o=e.input,s=e.result,l=s===void 0?[]:s;if(i==null)return l;if(!(i instanceof Element))return i instanceof Node?c({source:t,target:i.parentElement,input:o,result:l}):l;var u=i.closest(a);if(u==null)return l;var d=r.get(u);if(d==null)return l;var f={input:o,source:t,element:d.element};if(d.canDrop&&!d.canDrop(f))return c({source:t,target:d.element.parentElement,input:o,result:l});var p=d.getData?.call(d,f)??{},m=d.getDropEffect?.call(d,f)??n,h={data:p,element:d.element,dropEffect:m,isActiveDueToStickiness:!1};return c({source:t,target:d.element.parentElement,input:o,result:[].concat(HA(l),[h])})}function l(e){var t=e.eventName,n=e.payload,i=gj(n.location.current.dropTargets),a;try{for(i.s();!(a=i.n()).done;){var o,s=a.value,c=r.get(s.element),l=hj(hj({},n),{},{self:s});c==null||(o=c[t])==null||o.call(c,l)}}catch(e){i.e(e)}finally{i.f()}}var u={onGenerateDragPreview:l,onDrag:l,onDragStart:l,onDrop:l,onDropTargetChange:function(e){var t=e.payload,n=new Set(t.location.current.dropTargets.map(function(e){return e.element})),i=new Set,a=gj(t.location.previous.dropTargets),o;try{for(a.s();!(o=a.n()).done;){var s,c=o.value;i.add(c.element);var l=r.get(c.element),u=n.has(c.element),d=hj(hj({},t),{},{self:c});if(l==null||(s=l.onDropTargetChange)==null||s.call(l,d),!u){var f;l==null||(f=l.onDragLeave)==null||f.call(l,d)}}}catch(e){a.e(e)}finally{a.f()}var p=gj(t.location.current.dropTargets),m;try{for(p.s();!(m=p.n()).done;){var h,g,_=m.value;if(!i.has(_.element)){var v=hj(hj({},t),{},{self:_}),y=r.get(_.element);y==null||(h=y.onDropTargetChange)==null||h.call(y,v),y==null||(g=y.onDragEnter)==null||g.call(y,v)}}}catch(e){p.e(e)}finally{p.f()}}};function d(e){u[e.eventName](e)}function f(e){var t=e.source,n=e.target,i=e.input,a=e.current,o=c({source:t,target:n,input:i});if(o.length>=a.length)return o;for(var s=yj(a),l=yj(o),u=[],d=0;d<s.length;d++){var f,p=s[d],m=l[d];if(m!=null)u.push(m);else{var h=u[d-1],g=s[d-1];if(h?.element!==g?.element)break;var _=r.get(p.element);if(!_)break;var v={input:i,source:t,element:_.element};if(_.canDrop&&!_.canDrop(v)||!((f=_.getIsSticky)!=null&&f.call(_,v)))break;u.push(hj(hj({},p),{},{isActiveDueToStickiness:!0}))}}return yj(u)}return{dropTargetForConsumers:s,getIsOver:f,dispatchEvent:d}}function xj(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=Sj(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
67
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function Sj(e,t){if(e){if(typeof e==`string`)return Cj(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Cj(e,t):void 0}}function Cj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function wj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Tj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?wj(Object(n),!0).forEach(function(t){SA(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ej(){var e=new Set,t=null;function n(e){t&&(!e.canMonitor||e.canMonitor(t.canMonitorArgs))&&t.active.add(e)}function r(r){var i=Tj({},r);e.add(i),n(i);function a(){e.delete(i),t&&t.active.delete(i)}return wA(a)}function i(r){var i=r.eventName,a=r.payload;if(i===`onGenerateDragPreview`){t={canMonitorArgs:{initial:a.location.initial,source:a.source},active:new Set};var o=xj(e),s;try{for(o.s();!(s=o.n()).done;){var c=s.value;n(c)}}catch(e){o.e(e)}finally{o.f()}}if(t){for(var l=Array.from(t.active),u=0,d=l;u<d.length;u++){var f=d[u];if(t.active.has(f)){var p;(p=f[i])==null||p.call(f,a)}}i===`onDrop`&&(t.active.clear(),t=null)}}return{dispatchEvent:i,monitorForConsumers:r}}function Dj(e){var t=e.typeKey,n=e.mount,r=e.dispatchEventToSource,i=e.onPostDispatch,a=e.defaultDropEffect,o=Ej(),s=bj({typeKey:t,defaultDropEffect:a});function c(e){r?.(e),s.dispatchEvent(e),o.dispatchEvent(e),i?.(e)}function l(e){var t=e.event,n=e.dragType;cj.start({event:t,dragType:n,getDropTargetsOver:s.getIsOver,dispatchEvent:c})}function u(){function e(){return n({canStart:cj.canStart,start:l})}return dj({typeKey:t,mount:e})}return{registerUsage:u,dropTarget:s.dropTargetForConsumers,monitor:o.monitorForConsumers}}var Oj=wA(function(){return navigator.userAgent.toLocaleLowerCase().includes(`android`)}),kj=`pdnd:android-fallback`,Aj=`text/plain`,jj=`application/vnd.pdnd`,Mj=new WeakMap;function Nj(e){return Mj.set(e.element,e),function(){Mj.delete(e.element)}}var Pj=RA(),Fj=Dj({typeKey:`element`,defaultDropEffect:`move`,mount:function(e){return fj(Pj.bindEvents(),(0,hA.bind)(document,{type:`dragstart`,listener:function(t){if(e.canStart(t)&&!t.defaultPrevented&&t.dataTransfer){var n=t.target;if(n instanceof HTMLElement){var r=Mj.get(n);if(r){var i=ZA(t),a={element:r.element,dragHandle:r.dragHandle??null,input:i};if(r.canDrag&&!r.canDrag(a))t.preventDefault();else{if(r.dragHandle){var o=vA({x:i.clientX,y:i.clientY});if(!r.dragHandle.contains(o)){t.preventDefault();return}}var s=r.getInitialDataForExternal?.call(r,a)??null;if(s)for(var c=0,l=Object.entries(s);c<l.length;c++){var u=fA(l[c],2),d=u[0],f=u[1];t.dataTransfer.setData(d,f??``)}Oj()&&!t.dataTransfer.types.includes(`text/plain`)&&!t.dataTransfer.types.includes(`text/uri-list`)&&t.dataTransfer.setData(Aj,kj),t.dataTransfer.setData(jj,``);var p={type:`element`,payload:{element:r.element,dragHandle:r.dragHandle??null,data:r.getInitialData?.call(r,a)??{}},startedFrom:`internal`};e.start({event:t,dragType:p})}}}}}}))},dispatchEventToSource:function(e){var t,n,r=e.eventName,i=e.payload;(t=Mj.get(i.source.element))==null||(n=t[r])==null||n.call(t,i)},onPostDispatch:Pj.getOnPostDispatch()}),Ij=Fj.dropTarget,Lj=Fj.monitor;function Rj(e){return wA(fj(Fj.registerUsage(),Nj(e),pj(e.element,{attribute:`draggable`,value:`true`})))}var zj=[`image`,`gif`,`svg`,`video`];function Bj(e){return zj.includes(e)}var Vj={image:`image`,gif:`GIF`,svg:`SVG`,video:`video`,audio:`audio`,font:`font`,stylesheet:`stylesheet`,script:`script`,other:`file`};function Hj(e){if(e<1e3)return`${e} B`;let t=Math.round(e/1e3);if(t<1e3)return`${t} KB`;let n=e/1e6;return n<1e3?`${Uj(n)} MB`:`${Uj(n/1e3)} GB`}function Uj(e){return e.toFixed(1).replace(/\.0$/,``)}function Wj({kind:e,size:t}){return`${Vj[e]} · ${Hj(t)}`}function Gj(e){return Vj[e]}function Kj({frames:e}){return e===void 0?null:e===0?`Unused`:`${e} ${e===1?`frame`:`frames`}`}function qj(e){return`../assets/${e.split(`/`).map(encodeURIComponent).join(`/`)}`}function Jj(e,t){let n=t.split(`/`).map(encodeURIComponent).join(`/`);return`/frames/${encodeURIComponent(e)}/assets/${n}`}function Yj(e){return Bj(e.kind)}var Xj=Symbol(`asset-tile`);function Zj(e){return{[Xj]:!0,...e}}function Qj(e){let{project:t,path:n,kind:r}=e;return e[Xj]===!0&&typeof t==`string`&&typeof n==`string`&&Bj(r)?{project:t,path:n,kind:r}:null}var $j=1500;function eM({project:e,file:t}){let[n,r]=(0,_.useState)(`idle`),i=(0,_.useRef)(void 0);(0,_.useEffect)(()=>()=>clearTimeout(i.current),[]);let a=(0,_.useRef)(null),o=Rg(e=>e.canWrite),{path:s,kind:c}=t,l=Kj(t);(0,_.useEffect)(()=>{let t=a.current;if(t&&o&&Bj(c))return Rj({element:t,getInitialData:()=>Zj({project:e,path:s,kind:c})})},[e,s,c,o]);async function u(){let e=`copied`;try{await navigator.clipboard.writeText(qj(t.path))}catch{e=`failed`}r(e),clearTimeout(i.current),i.current=setTimeout(()=>r(`idle`),$j)}return(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{ref:a,type:`button`,onClick:()=>void u(),"aria-label":`Copy path of ${[t.path,Gj(c),Hj(t.size),l].filter(Boolean).join(`, `)}`,className:`group relative block w-full overflow-hidden rounded-lg bg-muted text-left outline-none hover:ring-[1.5px] hover:ring-primary focus-visible:ring-[1.5px] focus-visible:ring-primary`,children:[(0,X.jsx)(iM,{project:e,file:t}),(0,X.jsx)(`span`,{"aria-live":`polite`,className:`absolute top-[5px] right-[5px] rounded-[5px] bg-card px-1.5 py-0.5 text-[10px] text-foreground shadow-[0_1px_3px_rgba(0,0,0,.3)] group-hover:visible group-focus-visible:visible ${n===`idle`?`invisible`:``}`,children:nM[n]}),(0,X.jsxs)(`span`,{className:`block truncate px-[7px] py-[5px] text-label font-normal`,children:[(0,X.jsx)(`span`,{title:t.path,children:iA(t.path)}),(0,X.jsx)(`span`,{className:`block text-[10px] text-muted-foreground`,children:l===null?Wj(t):(0,X.jsxs)(X.Fragment,{children:[Gj(c),` ·`,` `,(0,X.jsx)(`span`,{className:t.frames===0?tM:void 0,children:l})]})})]})]})})}var tM=`text-[color-mix(in_oklab,var(--note)_70%,var(--foreground))]`,nM={idle:`Copy path`,copied:`Copied`,failed:`Copy failed`},rM=`grid h-[72px] place-items-center text-muted-foreground`;function iM({project:e,file:t}){switch(t.kind){case`image`:case`gif`:case`svg`:return(0,X.jsx)(`span`,{className:rM,children:(0,X.jsx)(`img`,{src:Jj(e,t.path),alt:``,loading:`lazy`,decoding:`async`,className:`h-[72px] w-full object-cover`})});case`video`:return(0,X.jsx)(`span`,{className:`${rM} bg-[#111] text-white`,children:(0,X.jsx)(Or,{"aria-hidden":!0,className:`size-4`})});case`audio`:return(0,X.jsx)(`span`,{className:rM,children:(0,X.jsx)(tn,{"aria-hidden":!0,className:`size-4`})});case`font`:return(0,X.jsx)(`span`,{className:`${rM} text-[26px] text-foreground`,children:`Aa`});default:return(0,X.jsx)(`span`,{className:`${rM} font-mono`,children:`{ }`})}}function aM(e,t){let n=new FormData;for(let e of t)n.append(`files`,e);return lx(`/api/projects/${encodeURIComponent(e)}/assets`,n)}var oM=`font-mono text-label font-normal text-foreground`;function sM({project:e,load:t=oA,upload:n=aM}){let r=Rg(e=>e.canWrite),[i,a]=(0,_.useState)(0),o=pM(e,t,i),[s,c]=(0,_.useState)(!1),[l,u]=(0,_.useState)(!1),[d,f]=(0,_.useState)([]),p=(0,_.useRef)(null),[m,h]=(0,_.useState)(``),[g,v]=(0,_.useState)(`all`),[y,b]=(0,_.useState)(new Set);async function x(t){if(r&&t.length!==0){u(!0);try{let r=await n(e,t);f(r.refused.map(e=>({id:crypto.randomUUID(),text:`${e.name}: ${e.message}`})))}catch(e){f([{id:crypto.randomUUID(),text:e instanceof Error?e.message:String(e)}])}finally{u(!1),a(e=>e+1)}}}function S(e){dM(e)&&(e.preventDefault(),c(!1),x(fM(e)))}if(o===void 0)return null;if(o===null)return(0,X.jsx)(`p`,{className:`m-3 text-muted-foreground`,children:`The assets did not load. Reload the board to try again.`});let C=o.files.length,w=tA(o.files),T=w.some(e=>e.chip===g)?g:`all`,E=nA(o.files,{chip:T,search:m}),D=()=>{h(``),v(`all`)},O=e=>b(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n});return(0,X.jsxs)(`div`,{"aria-busy":l,onDragEnter:e=>dM(e)&&c(!0),onDragOver:e=>{dM(e)&&(e.preventDefault(),c(!0))},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||c(!1)},onDrop:S,className:`flex h-full flex-col overflow-y-auto pb-2 ${s&&r?`bg-primary/5 ring-[1.5px] ring-primary ring-inset`:``}`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between pt-2.5 pr-1.5 pb-1 pl-3 text-label text-muted-foreground`,children:[(0,X.jsxs)(`h3`,{children:[`assets/ · `,C,` `,C===1?`file`:`files`]}),(0,X.jsx)(`button`,{type:`button`,"aria-label":`Add files`,disabled:!r,onClick:()=>p.current?.click(),className:`grid size-5 place-items-center rounded-md outline-none hover:bg-accent hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50 disabled:hover:bg-transparent`,children:(0,X.jsx)(Ar,{"aria-hidden":!0,className:`size-3.5`})}),(0,X.jsx)(`input`,{ref:p,type:`file`,multiple:!0,hidden:!0,"aria-label":`Choose files to add`,onChange:e=>{let t=[...e.target.files??[]];e.target.value=``,x(t)}})]}),C===0?(0,X.jsxs)(`p`,{className:`mx-3 my-1 text-muted-foreground`,children:[`No files in `,(0,X.jsx)(`code`,{className:oM,children:`assets/`}),` yet.`]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`mx-2 mt-1 mb-1.5 flex h-[26px] shrink-0 items-center gap-1.5 rounded-md bg-muted px-2 focus-within:ring-[1.5px] focus-within:ring-primary`,children:[(0,X.jsx)(Jr,{"aria-hidden":!0,className:`size-[13px] shrink-0 text-muted-foreground`}),(0,X.jsx)(`input`,{type:`search`,"aria-label":`Search assets`,placeholder:`Search assets`,value:m,spellCheck:!1,onChange:e=>h(e.target.value),onKeyDown:e=>{e.key===`Escape`&&m!==``&&(e.preventDefault(),e.stopPropagation(),h(``))},className:`min-w-0 flex-1 bg-transparent text-label outline-none placeholder:text-muted-foreground [&::-webkit-search-cancel-button]:hidden`})]}),(0,X.jsx)(`div`,{role:`group`,"aria-label":`Filter by kind`,className:`flex flex-wrap gap-1 px-2 pb-1.5`,children:w.map(e=>(0,X.jsxs)(`button`,{type:`button`,"aria-pressed":e.chip===T,onClick:()=>v(e.chip),className:`inline-flex h-6 min-w-6 items-center justify-center rounded-full px-2 text-[10px] outline-none focus-visible:ring-3 focus-visible:ring-ring/50 ${e.chip===T?`bg-foreground text-background`:`bg-muted text-muted-foreground hover:text-foreground`}`,children:[$k[e.chip],e.chip===`all`?null:` ${e.count}`]},e.chip))}),E.length===0?(0,X.jsxs)(`div`,{className:`mx-3 my-1 text-muted-foreground`,children:[(0,X.jsx)(`p`,{children:lM(m,T)}),(0,X.jsx)(`button`,{type:`button`,onClick:D,className:`mt-1 rounded-sm text-foreground underline underline-offset-2 outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,children:`Clear filter`})]}):E.map(t=>(0,X.jsx)(cM,{group:t,project:e,open:!y.has(t.folder),onToggle:()=>O(t.folder)},t.folder))]}),(0,X.jsx)(`div`,{className:`m-2 rounded-[10px] border-[1.5px] border-dashed border-border p-3 text-center leading-normal text-muted-foreground`,children:r?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{children:l?`Adding files…`:`Drop files here to add them.`}),(0,X.jsx)(`br`,{}),`A frame links one as`,` `,(0,X.jsx)(`code`,{className:oM,children:`../assets/hero.png`})]}):(0,X.jsxs)(X.Fragment,{children:[`This tab is read-only, so files cannot be added. Run`,` `,(0,X.jsx)(`code`,{className:oM,children:`frameboard open`}),` for a tab that can.`]})}),d.length>0?(0,X.jsx)(`ul`,{role:`alert`,className:`mx-3 text-destructive`,children:d.map(e=>(0,X.jsx)(`li`,{className:`leading-[1.45]`,children:e.text},e.id))}):null]})}function cM({group:e,project:t,open:n,onToggle:r}){let i=n?jt:Nt,a=e.files.length;return(0,X.jsxs)(`section`,{"aria-label":e.folder===``?`assets/`:e.folder,children:[(0,X.jsx)(`h4`,{children:(0,X.jsxs)(`button`,{type:`button`,"aria-expanded":n,onClick:r,className:`mx-1 flex items-center gap-1 rounded-md px-1.5 py-1 text-label font-semibold outline-none hover:bg-accent focus-visible:ring-3 focus-visible:ring-ring/50`,children:[(0,X.jsx)(i,{"aria-hidden":!0,className:`size-3 text-muted-foreground`}),e.folder===``?`assets/`:e.folder,(0,X.jsxs)(`span`,{className:`font-normal text-muted-foreground`,children:[`· `,a]})]})}),n?(0,X.jsx)(`ul`,{className:`grid grid-cols-2 gap-2 px-2 pt-0.5 pb-2`,children:e.files.map(e=>(0,X.jsx)(eM,{project:t,file:e},e.path))}):null]})}function lM(e,t){let n=t===`all`?`files`:`${uM[t]} files`,r=e.trim();return r===``?`No ${n} here.`:`No ${n} match "${r}".`}var uM={images:`image`,video:`video`,fonts:`font`,other:`other`};function dM(e){return e.dataTransfer.types.includes(`Files`)}function fM(e){let{items:t,files:n}=e.dataTransfer,r=[];for(let[e,i]of[...n].entries())t[e]?.webkitGetAsEntry?.()?.isDirectory||r.push(i);return r}function pM(e,t,n){let r=Rg(e=>e.board),[i,a]=(0,_.useState)();return(0,_.useEffect)(()=>{let n=!0;return t(e).catch(()=>null).then(e=>{n&&a(e)}),()=>{n=!1}},[e,r,t,n]),i}var mM=[`light`,`dark`],hM=`theme`,gM=`data-frameboard`;function _M(e){return e===`light`||e===`dark`}function vM(e,t){e.setAttribute(`data-theme`,t),e.style.colorScheme=t,e.classList.toggle(`dark`,t===`dark`),e.classList.toggle(`light`,t===`light`)}function yM(e){return e===`dark`?`light`:`dark`}function bM(e,t,n,r){let i=new URLSearchParams({[hM]:t});return n!==void 0&&i.set(`v`,String(n)),r!==void 0&&i.set(`at`,r),`${Zg(e)}?${i}`}var xM=`frameboard.theme`;function SM(){return N()(()=>({choice:`system`,system:`light`,flipped:new Set}))}function CM({choice:e,system:t}){return e===`system`?t:e}function wM(e,t){let n=e=>{t.root.classList.toggle(`dark`,CM(e)===`dark`)},r=()=>{e.setState({system:t.media.matches?`dark`:`light`})};e.setState({choice:PM(t.storage)}),r(),n(e.getState()),t.media.addEventListener(`change`,r);let i=e.subscribe((e,r)=>{n(e),e.choice!==r.choice&&FM(t.storage,e.choice)});return()=>{i(),t.media.removeEventListener(`change`,r)}}function TM(e){let t;try{t=e.localStorage}catch{t=null}return{storage:t,media:e.matchMedia(`(prefers-color-scheme: dark)`),root:e.document.documentElement}}function EM(e,t=IM){t.setState({choice:e})}function DM(e=IM){e.setState({choice:yM(CM(e.getState()))})}function OM(e,t=IM){let n=new Set(t.getState().flipped);n.delete(e)||n.add(e),t.setState({flipped:n})}function kM(e,t,n=IM){let r=Object.fromEntries([...n.getState().flipped].map(e=>[e,!0]));n.setState({flipped:new Set(Object.keys(bg(r,e,t)))})}function AM(e,t=IM){return NM(t.getState(),e)}function jM(e=IM){return F(e,CM)}function MM(e,t=IM){return F(t,t=>NM(t,e))}function NM(e,t){let n=CM(e);return e.flipped.has(t)?yM(n):n}function PM(e){try{let t=e?.getItem(xM);return _M(t)?t:`system`}catch{return`system`}}function FM(e,t){try{e?.setItem(xM,t)}catch{}}var IM=SM();function LM(e,t,n=navigator.clipboard){let r=new URLSearchParams({ref:e,theme:t}),i=fetch(`/api/frames/png?${r}`).then(async e=>{if(!e.ok)throw Error(`The board answered ${e.status}.`);return e.blob()});return n.write([new ClipboardItem({"image/png":i})])}var RM=N()(()=>({byRef:{}}));function zM(e){return F(RM,t=>t.byRef[e])}function BM(){return F(RM,e=>e.byRef)}function VM(e){return RM.getState().byRef[e]}function HM(){return RM.getState().byRef}function UM(e){return RM.subscribe(e)}function WM(e,t){let n=Math.max(1,Math.round(t));QM(e,e=>e?.width===n?e:{width:n})}function GM(e){QM(e,()=>void 0)}function KM(e,t,n){QM([e],e=>!e||e.width!==t?e:n===null?e.height===void 0?e:{width:t}:e.height===n?e:{width:t,height:n})}function qM(e,t,n){if(!n)return t;let r=e.hugHeight&&n.height!==void 0?n.height:t.height;return{...t,width:n.width,height:r}}function JM(e,t){return e.map(e=>{let n=t[e.ref];return n?{...e,box:qM(e,e.box,n)}:e})}function YM(e){return JM(e,BM())}function XM(e){return e.subscribe((e,t)=>{e.board&&e.board!==t.board&&ZM(e.board)})}function ZM(e){let t=new Set(e.projects.flatMap(e=>e.pages.flatMap(e=>e.frames.flatMap(e=>e.hidden?[]:[e.ref])))),{byRef:n}=RM.getState();GM(Object.keys(n).filter(e=>!t.has(e)))}function QM(e,t){let{byRef:n}=RM.getState(),r={...n},i=!1;for(let a of e){let e=t(n[a]);e!==n[a]&&(i=!0,e?r[a]=e:delete r[a])}i&&RM.setState({byRef:r})}function $M(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function eN(e){if(e.length===0)return null;let t=Math.min(...e.map(e=>e.x)),n=Math.min(...e.map(e=>e.y)),r=Math.max(...e.map(e=>e.x+e.width)),i=Math.max(...e.map(e=>e.y+e.height));return{x:t,y:n,width:r-t,height:i-n}}var tN=2e3,nN=N()(()=>({byRef:{}}));function rN(e){return F(nN,t=>t.byRef[e]?.box)}function iN(e){return lN(e,F(nN,e=>e.byRef))}function aN(e){return lN(e,nN.getState().byRef)}function oN(e){return qM(e,rN(e.ref)??e.box,zM(e.ref))}function sN(e){return YM(iN(e))}function cN(e){return JM(aN(e),HM())}function lN(e,t){return e.map(e=>{let n=t[e.ref];return n?{...e,box:n.box}:e})}function uN(e){GM(Object.keys(e)),_N(Object.keys(e),t=>{let n=e[t];return n&&{box:n}})}var dN=new Map;async function fN(e,t,n,r=fetch,i){if(Object.keys(t).length===0&&!i)return!0;GM(Object.keys(t));let a={...t},o={...n},s={...i?.boxes},c={...i?.expected};for(let e of Object.keys(t)){let t=dN.get(e);if(t){for(let[e,n]of Object.entries(t.owner.sections?.boxes??{})){if(e in s)continue;s[e]=n;let r=t.owner.sections?.expected[e];r&&(c[e]=r)}for(let[e,n]of Object.entries(t.owner.boxes)){if(e in a)continue;a[e]=n;let t=dN.get(e)?.box;t&&(o[e]=t)}}}for(let e of Object.keys(a)){let t=dN.get(e)?.box;t&&(o[e]=t)}let l=Object.keys(a),u=new Map(Object.entries(a).map(([e,t])=>[e,{box:t}]));_N(l,e=>u.get(e));let d=()=>{let{byRef:e}=nN.getState();_N(l.filter(t=>e[t]===u.get(t)),()=>void 0)},f=Object.keys(s).length>0?{boxes:s,expected:c}:void 0,p={boxes:a,sections:f},m=()=>{for(let e of l){let t=o[e];t&&dN.set(e,{box:t,owner:p})}},h=()=>{for(let e of l)dN.get(e)?.owner===p&&dN.delete(e)};m();try{await uk(l,pN(a,o),async()=>{h();try{return await lx(`/api/frames/boxes`,{page:e,boxes:vN(a),expected:vN(o),sections:f?.boxes,expectedSections:f?.expected},`POST`,r)}catch(e){throw m(),e}},{replace:`boxes`})}catch{return h(),d(),!1}return setTimeout(d,tN),!0}function pN(e,t){return Object.entries(e).some(([e,n])=>{let r=t[e];return r&&(r.width!==n.width||r.height!==n.height)})?`resize`:`move`}function mN(e){_N(e,()=>void 0)}function hN(e){return e.subscribe((e,t)=>{e.board&&e.board!==t.board&&gN(e.board)})}function gN(e){let t=new Map(e.projects.flatMap(e=>e.pages.flatMap(e=>e.frames.map(e=>[e.ref,e.box])))),{byRef:n}=nN.getState(),r=Object.entries(n).filter(([e,n])=>{let r=t.get(e);return r!==void 0&&!$M(r,n.box)});r.length!==Object.keys(n).length&&nN.setState({byRef:Object.fromEntries(r)})}function _N(e,t){if(e.length===0)return;let n={...nN.getState().byRef};for(let r of e){let e=t(r);e?n[r]=e:delete n[r]}nN.setState({byRef:n})}function vN(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e.slice(e.lastIndexOf(`/`)+1),t]))}function yN(e){return`new:${e}`}var bN=N()(()=>({open:null,drafts:{}}));function xN(e){return F(bN,e)}function SN(e,t){bN.setState(({drafts:n})=>{let{[e]:r,...i}=n;return{drafts:t===``?i:{...i,[e]:t}}})}function CN(){bN.setState({open:null})}var wN=()=>Lg.getState().canWrite;function TN(){(0,_.useEffect)(()=>{let e=xe([{id:`tool.note`,label:`Note`,group:`tool`,command:{label:`Add a note`,icon:nr},keys:[`n`],enabled:wN,run:()=>qg.setState({tool:`note`,mode:`edit`}),checked:()=>qg.getState().mode===`edit`&&qg.getState().tool===`note`}]),t=Lg.subscribe((e,t)=>{e.canWrite!==t.canWrite&&(U(),!e.canWrite&&qg.getState().tool===`note`&&qg.setState({tool:`move`}),!e.canWrite&&bN.getState().open?.kind===`new`&&CN())}),n=qg.subscribe(e=>{let t=bN.getState().open;(e.mode===`play`||t?.kind===`new`&&e.tool!==`note`)&&CN()});return()=>{n(),t(),e(),qg.getState().tool===`note`&&qg.setState({tool:`move`}),bN.getState().open?.kind===`new`&&CN()}},[])}function EN(){return N()(()=>({page:null,frames:[]}))}function DN(e,t,n){e.setState({page:t,frames:[...new Set(n)],element:null,section:void 0})}function ON(e,t,n){e.setState({page:t,frames:[],element:null,section:n})}function kN(e,t,n){e.setState({page:t,frames:[n.frame],element:n,section:void 0})}function AN(e,t,n){let{page:r,frames:i}=e.getState();if(r!==t){DN(e,t,[n]);return}let a=i.includes(n)?i.filter(e=>e!==n):[...i,n];e.setState({page:a.length===0?null:t,frames:a,element:null,section:void 0})}function jN(e){let{page:t,frames:n,element:r,section:i}=e.getState();(t!==null||n.length!==0||r||i)&&e.setState({page:null,frames:[],element:null,section:void 0})}function MN(e,t,n){let{page:r,frames:i,element:a}=e.getState();if(r===null)return;let o=e=>yg(e,t,n);e.setState({page:o(r),frames:i.map(o),element:a&&{...a,frame:o(a.frame)}})}function NN(e,t){let{page:n,frames:r,section:i}=e.getState();if(n===null)return;let a=t.projects.flatMap(e=>e.pages).find(e=>e.ref===n);if(i!==void 0){a?.sections.some(e=>e.name===i)||jN(e);return}let o=new Set(a?.frames.filter(e=>!e.hidden).map(e=>e.ref)),s=r.filter(e=>o.has(e));s.length!==r.length&&(s.length===0?jN(e):e.setState({frames:s,element:null}))}function PN(e,t,n,r){e.getState().page!==t&&jN(e);let i=n.getState().board;i&&NN(e,i);let a=n.subscribe((t,n)=>{t.board&&t.board!==n.board&&NN(e,t.board)}),o=r.subscribe(t=>{t.mode===`play`&&jN(e)});return()=>{o(),a()}}var FN=new Map;function IN(e){FN.set(e,(FN.get(e)??0)+1);let t=!1;return()=>{t||(t=!0,FN.set(e,(FN.get(e)??1)-1))}}var LN=new Map;function RN(e,t){let n=(LN.get(e)??[]).filter(e=>e!==t);LN.set(e,[...n,t].slice(-100))}function zN(e,t){return(FN.get(e)??0)>0||(FN.get(null)??0)>0||t!=null&&(LN.get(e)?.includes(t)??!1)}function BN(e,t){let{page:n,element:r}=e.getState();if(!n||!r||zN(r.frame))return;let i=t(r.frame);i!==null&&i!==r.hash&&DN(e,n,[r.frame])}function VN(e,t){let{page:n,element:r}=e.getState();if(!n||!r||zN(r.frame))return;let i=t(r.frame);i!==null&&i!==r.hash&&!zN(r.frame,i)&&DN(e,n,[r.frame])}var HN=EN();function UN(e){return F(HN,e)}var WN=2,GN=40,KN=200,qN=[{name:`left`,key:`ArrowLeft`,dx:-1,dy:0},{name:`right`,key:`ArrowRight`,dx:1,dy:0},{name:`up`,key:`ArrowUp`,dx:0,dy:-1},{name:`down`,key:`ArrowDown`,dx:0,dy:1}];function JN(){(0,_.useEffect)(()=>{let e=xe(XN()),t=qg.subscribe(U),n=HN.subscribe(U),r=a_.onAttach(U);return()=>{r(),n(),t(),e()}},[])}function YN(){let{page:e,frames:t}=HN.getState(),n=Lg.getState().board?.projects.flatMap(e=>e.pages).find(t=>t.ref===e)?.frames.filter(e=>t.includes(e.ref));return aN(n??[])}function XN(){let e=()=>qg.getState(),t=e=>qg.setState(e),n=e=>({...e,group:`view`,enabled:a_.attached}),r=t=>()=>a_.attached()&&e().mode===`edit`&&t(HN.getState().frames.length);return[{id:`tool.move`,label:`Move`,group:`tool`,keys:[`v`],run:()=>t({tool:`move`,mode:`edit`}),checked:()=>e().mode===`edit`&&e().tool===`move`},{id:`tool.hand`,label:`Hand`,group:`tool`,keys:[`h`],run:()=>t({tool:`hand`,mode:`edit`}),checked:()=>e().mode===`edit`&&e().tool===`hand`},{id:`mode.edit`,label:`Edit`,group:`mode`,command:{label:`Switch to Edit`,icon:Sr},run:()=>t({mode:`edit`}),checked:()=>e().mode===`edit`},{id:`mode.play`,label:`Play`,group:`mode`,command:{label:`Switch to Play`,icon:Or},run:()=>t({mode:`play`}),checked:()=>e().mode===`play`},{id:`mode.exitPlay`,label:`Exit Play`,group:`mode`,keys:[`Escape`],enabled:()=>e().mode===`play`,run:()=>{document.activeElement instanceof HTMLIFrameElement&&document.activeElement.blur(),t({mode:`edit`})}},{id:`tool.disarm`,label:`Back to Move`,group:`tool`,keys:[`Escape`],enabled:()=>e().mode===`edit`&&e().tool!==`move`&&bN.getState().open===null,run:()=>{let e=document.activeElement;e instanceof HTMLElement&&e.closest(`[role="toolbar"]`)&&e.blur(),t({tool:`move`})}},{id:`view.hideUi`,label:`Hide UI`,group:`view`,command:{label:`Hide UI`,icon:gr},keys:[`$mod+Backslash`],run:()=>t({hideUi:!e().hideUi}),checked:()=>e().hideUi},n({id:`view.zoomIn`,label:`Zoom in`,command:{label:`Zoom in`,icon:Ri},keys:[`$mod+Equal`],run:()=>a_.zoomBy(WN)}),n({id:`view.zoomOut`,label:`Zoom out`,command:{label:`Zoom out`,icon:Bi},keys:[`$mod+Minus`],run:()=>a_.zoomBy(1/WN)}),n({id:`view.zoomToFit`,label:`Zoom to fit`,command:{label:`Zoom to fit`,icon:er},keys:[`Shift+Digit1`],run:a_.fit}),{id:`view.zoomToSelection`,label:`Zoom to selection`,group:`view`,command:{label:`Zoom to selection`,icon:Hr},keys:[`Shift+Digit2`],enabled:r(e=>e>0),run:()=>a_.fitTo(YN().map(e=>e.box))},...qN.flatMap(({name:e,key:t,dx:n,dy:i})=>[{id:`view.pan.${e}`,label:`Pan ${e}`,group:`view`,keys:[t],enabled:r(e=>e===0),run:()=>a_.panBy(n*GN,i*GN)},{id:`view.pan.${e}Far`,label:`Pan ${e} further`,group:`view`,keys:[`Shift+${t}`],enabled:r(e=>e===0),run:()=>a_.panBy(n*KN,i*KN)}]),{id:`frame.copyPng`,label:`Copy as PNG`,group:`frame`,command:{label:`Copy as PNG`,icon:$t},keys:[`$mod+Shift+KeyC`],enabled:r(e=>e===1),run:()=>{let[e]=YN();if(!e)return;let t=AM(e.ref);LM(e.ref,t).then(()=>tg.add({title:`Copied ${e.name}`,description:`PNG on the clipboard, in the ${t} theme.`,type:`success`}),Ck(`Couldn't copy ${e.name}`))}},n({id:`view.zoom50`,label:`Zoom to 50%`,run:()=>a_.zoomTo(.5)}),n({id:`view.zoom100`,label:`Zoom to 100%`,keys:[`Shift+Digit0`],run:()=>a_.zoomTo(1)}),n({id:`view.zoom200`,label:`Zoom to 200%`,run:()=>a_.zoomTo(2)})]}var ZN={svg:`http://www.w3.org/2000/svg`,xhtml:`http://www.w3.org/1999/xhtml`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function QN(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),ZN.hasOwnProperty(t)?{space:ZN[t],local:e}:e}function $N(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===`http://www.w3.org/1999/xhtml`&&t.documentElement.namespaceURI===`http://www.w3.org/1999/xhtml`?t.createElement(e):t.createElementNS(n,e)}}function eP(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function tP(e){var t=QN(e);return(t.local?eP:$N)(t)}function nP(){}function rP(e){return e==null?nP:function(){return this.querySelector(e)}}function iP(e){typeof e!=`function`&&(e=rP(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new KF(r,this._parents)}function aP(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function oP(){return[]}function sP(e){return e==null?oP:function(){return this.querySelectorAll(e)}}function cP(e){return function(){return aP(e.apply(this,arguments))}}function lP(e){e=typeof e==`function`?cP(e):sP(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new KF(r,i)}function uP(e){return function(){return this.matches(e)}}function dP(e){return function(t){return t.matches(e)}}var fP=Array.prototype.find;function pP(e){return function(){return fP.call(this.children,e)}}function mP(){return this.firstElementChild}function hP(e){return this.select(e==null?mP:pP(typeof e==`function`?e:dP(e)))}var gP=Array.prototype.filter;function _P(){return Array.from(this.children)}function vP(e){return function(){return gP.call(this.children,e)}}function yP(e){return this.selectAll(e==null?_P:vP(typeof e==`function`?e:dP(e)))}function bP(e){typeof e!=`function`&&(e=uP(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new KF(r,this._parents)}function xP(e){return Array(e.length)}function SP(){return new KF(this._enter||this._groups.map(xP),this._parents)}function CP(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}CP.prototype={constructor:CP,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function wP(e){return function(){return e}}function TP(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new CP(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function EP(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new CP(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function DP(e){return e.__data__}function OP(e,t){if(!arguments.length)return Array.from(this,DP);var n=t?EP:TP,r=this._parents,i=this._groups;typeof e!=`function`&&(e=wP(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=kP(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new KF(o,r),o._enter=s,o._exit=c,o}function kP(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function AP(){return new KF(this._exit||this._groups.map(xP),this._parents)}function jP(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function MP(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new KF(s,this._parents)}function NP(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function PP(e){e||=FP;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new KF(i,this._parents).order()}function FP(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function IP(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function LP(){return Array.from(this)}function RP(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function zP(){let e=0;for(let t of this)++e;return e}function BP(){return!this.node()}function VP(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function HP(e){return function(){this.removeAttribute(e)}}function UP(e){return function(){this.removeAttributeNS(e.space,e.local)}}function WP(e,t){return function(){this.setAttribute(e,t)}}function GP(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function KP(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function qP(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function JP(e,t){var n=QN(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?UP:HP:typeof t==`function`?n.local?qP:KP:n.local?GP:WP)(n,t))}function YP(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function XP(e){return function(){this.style.removeProperty(e)}}function ZP(e,t,n){return function(){this.style.setProperty(e,t,n)}}function QP(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function $P(e,t,n){return arguments.length>1?this.each((t==null?XP:typeof t==`function`?QP:ZP)(e,t,n??``)):eF(this.node(),e)}function eF(e,t){return e.style.getPropertyValue(t)||YP(e).getComputedStyle(e,null).getPropertyValue(t)}function tF(e){return function(){delete this[e]}}function nF(e,t){return function(){this[e]=t}}function rF(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function iF(e,t){return arguments.length>1?this.each((t==null?tF:typeof t==`function`?rF:nF)(e,t)):this.node()[e]}function aF(e){return e.trim().split(/^|\s+/)}function oF(e){return e.classList||new sF(e)}function sF(e){this._node=e,this._names=aF(e.getAttribute(`class`)||``)}sF.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function cF(e,t){for(var n=oF(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function lF(e,t){for(var n=oF(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function uF(e){return function(){cF(this,e)}}function dF(e){return function(){lF(this,e)}}function fF(e,t){return function(){(t.apply(this,arguments)?cF:lF)(this,e)}}function pF(e,t){var n=aF(e+``);if(arguments.length<2){for(var r=oF(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?fF:t?uF:dF)(n,t))}function mF(){this.textContent=``}function hF(e){return function(){this.textContent=e}}function gF(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function _F(e){return arguments.length?this.each(e==null?mF:(typeof e==`function`?gF:hF)(e)):this.node().textContent}function vF(){this.innerHTML=``}function yF(e){return function(){this.innerHTML=e}}function bF(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function xF(e){return arguments.length?this.each(e==null?vF:(typeof e==`function`?bF:yF)(e)):this.node().innerHTML}function SF(){this.nextSibling&&this.parentNode.appendChild(this)}function CF(){return this.each(SF)}function wF(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function TF(){return this.each(wF)}function EF(e){var t=typeof e==`function`?e:tP(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function DF(){return null}function OF(e,t){var n=typeof e==`function`?e:tP(e),r=t==null?DF:typeof t==`function`?t:rP(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function kF(){var e=this.parentNode;e&&e.removeChild(this)}function AF(){return this.each(kF)}function jF(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function MF(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function NF(e){return this.select(e?MF:jF)}function PF(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function FF(e){return function(t){e.call(this,t,this.__data__)}}function IF(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function LF(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function RF(e,t,n){return function(){var r=this.__on,i,a=FF(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function zF(e,t,n){var r=IF(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}}else{for(s=t?RF:LF,i=0;i<a;++i)this.each(s(r[i],t,n));return this}}function BF(e,t,n){var r=YP(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function VF(e,t){return function(){return BF(this,e,t)}}function HF(e,t){return function(){return BF(this,e,t.apply(this,arguments))}}function UF(e,t){return this.each((typeof t==`function`?HF:VF)(e,t))}function*WF(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var GF=[null];function KF(e,t){this._groups=e,this._parents=t}function qF(){return new KF([[document.documentElement]],GF)}function JF(){return this}KF.prototype=qF.prototype={constructor:KF,select:iP,selectAll:lP,selectChild:hP,selectChildren:yP,filter:bP,data:OP,enter:SP,exit:AP,join:jP,merge:MP,selection:JF,order:NP,sort:PP,call:IP,nodes:LP,node:RP,size:zP,empty:BP,each:VP,attr:JP,style:$P,property:iF,classed:pF,text:_F,html:xF,raise:CF,lower:TF,append:EF,insert:OF,remove:AF,clone:NF,datum:PF,on:zF,dispatch:UF,[Symbol.iterator]:WF};function YF(e){return typeof e==`string`?new KF([[document.querySelector(e)]],[document.documentElement]):new KF([[e]],GF)}function XF(e){let t;for(;t=e.sourceEvent;)e=t;return e}function ZF(e,t){if(e=XF(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var QF={value:()=>{}};function $F(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new eI(n)}function eI(e){this._=e}function tI(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}eI.prototype=$F.prototype={constructor:eI,on:function(e,t){var n=this._,r=tI(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=nI(n[i],e.name)))return i}else{if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=rI(n[i],e.name,t);else if(t==null)for(i in n)n[i]=rI(n[i],e.name,null);return this}},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new eI(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function nI(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function rI(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=QF,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var iI={passive:!1},aI={capture:!0,passive:!1};function oI(e){e.stopImmediatePropagation()}function sI(e){e.preventDefault(),e.stopImmediatePropagation()}function cI(e){var t=e.document.documentElement,n=YF(e).on(`dragstart.drag`,sI,aI);`onselectstart`in t?n.on(`selectstart.drag`,sI,aI):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function lI(e,t){var n=e.document.documentElement,r=YF(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,sI,aI),setTimeout(function(){r.on(`click.drag`,null)},0)),`onselectstart`in n?r.on(`selectstart.drag`,null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var uI=e=>()=>e;function dI(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:s,dx:c,dy:l,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}dI.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function fI(e){return!e.ctrlKey&&!e.button}function pI(){return this.parentNode}function mI(e,t){return t??{x:e.x,y:e.y}}function hI(){return navigator.maxTouchPoints||`ontouchstart`in this}function gI(){var e=fI,t=pI,n=mI,r=hI,i={},a=$F(`start`,`drag`,`end`),o=0,s,c,l,u,d=0;function f(e){e.on(`mousedown.drag`,p).filter(r).on(`touchstart.drag`,g).on(`touchmove.drag`,_,iI).on(`touchend.drag touchcancel.drag`,v).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function p(n,r){if(!u&&e.call(this,n,r)){var i=y(this,t.call(this,n,r),n,r,`mouse`);i&&(YF(n.view).on(`mousemove.drag`,m,aI).on(`mouseup.drag`,h,aI),cI(n.view),oI(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if(sI(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){YF(e.view).on(`mousemove.drag mouseup.drag`,null),lI(e.view,l),sI(e),i.mouse(`end`,e)}function g(n,r){if(e.call(this,n,r))for(var i=n.changedTouches,a=t.call(this,n,r),o=i.length,s=0,c;s<o;++s)(c=y(this,a,n,r,i[s].identifier,i[s]))&&(oI(n),c(`start`,n,i[s]))}function _(e){for(var t=e.changedTouches,n=t.length,r=0,a;r<n;++r)(a=i[t[r].identifier])&&(sI(e),a(`drag`,e,t[r]))}function v(e){var t=e.changedTouches,n=t.length,r,a;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),r=0;r<n;++r)(a=i[t[r].identifier])&&(oI(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=ZF(l||r,t),p,m,h;if((h=n.call(e,new dI(`beforestart`,{sourceEvent:r,target:f,identifier:c,active:o,x:d[0],y:d[1],dx:0,dy:0,dispatch:u}),s))!=null)return p=h.x-d[0]||0,m=h.y-d[1]||0,function n(r,a,l){var g=d,_;switch(r){case`start`:i[c]=n,_=o++;break;case`end`:delete i[c],--o;case`drag`:d=ZF(l||a,t),_=o}u.call(r,e,new dI(r,{sourceEvent:a,subject:h,target:f,identifier:c,active:_,x:d[0]+p,y:d[1]+m,dx:d[0]-g[0],dy:d[1]-g[1],dispatch:u}),s)}}return f.filter=function(t){return arguments.length?(e=typeof t==`function`?t:uI(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:uI(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:uI(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:uI(!!e),f):r},f.on=function(){var e=a.on.apply(a,arguments);return e===a?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}function _I(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function vI(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function yI(){}var bI=.7,xI=1/bI,SI=`\\s*([+-]?\\d+)\\s*`,CI=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,wI=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,TI=/^#([0-9a-f]{3,8})$/,EI=RegExp(`^rgb\\(${SI},${SI},${SI}\\)$`),DI=RegExp(`^rgb\\(${wI},${wI},${wI}\\)$`),OI=RegExp(`^rgba\\(${SI},${SI},${SI},${CI}\\)$`),kI=RegExp(`^rgba\\(${wI},${wI},${wI},${CI}\\)$`),AI=RegExp(`^hsl\\(${CI},${wI},${wI}\\)$`),jI=RegExp(`^hsla\\(${CI},${wI},${wI},${CI}\\)$`),MI={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};_I(yI,LI,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:NI,formatHex:NI,formatHex8:PI,formatHsl:FI,formatRgb:II,toString:II});function NI(){return this.rgb().formatHex()}function PI(){return this.rgb().formatHex8()}function FI(){return XI(this).formatHsl()}function II(){return this.rgb().formatRgb()}function LI(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=TI.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?RI(t):n===3?new HI(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?zI(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?zI(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=EI.exec(e))?new HI(t[1],t[2],t[3],1):(t=DI.exec(e))?new HI(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=OI.exec(e))?zI(t[1],t[2],t[3],t[4]):(t=kI.exec(e))?zI(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=AI.exec(e))?YI(t[1],t[2]/100,t[3]/100,1):(t=jI.exec(e))?YI(t[1],t[2]/100,t[3]/100,t[4]):MI.hasOwnProperty(e)?RI(MI[e]):e===`transparent`?new HI(NaN,NaN,NaN,0):null}function RI(e){return new HI(e>>16&255,e>>8&255,e&255,1)}function zI(e,t,n,r){return r<=0&&(e=t=n=NaN),new HI(e,t,n,r)}function BI(e){return e instanceof yI||(e=LI(e)),e?(e=e.rgb(),new HI(e.r,e.g,e.b,e.opacity)):new HI}function VI(e,t,n,r){return arguments.length===1?BI(e):new HI(e,t,n,r??1)}function HI(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}_I(HI,VI,vI(yI,{brighter(e){return e=e==null?xI:xI**+e,new HI(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?bI:bI**+e,new HI(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new HI(qI(this.r),qI(this.g),qI(this.b),KI(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:UI,formatHex:UI,formatHex8:WI,formatRgb:GI,toString:GI}));function UI(){return`#${JI(this.r)}${JI(this.g)}${JI(this.b)}`}function WI(){return`#${JI(this.r)}${JI(this.g)}${JI(this.b)}${JI((isNaN(this.opacity)?1:this.opacity)*255)}`}function GI(){let e=KI(this.opacity);return`${e===1?`rgb(`:`rgba(`}${qI(this.r)}, ${qI(this.g)}, ${qI(this.b)}${e===1?`)`:`, ${e})`}`}function KI(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function qI(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function JI(e){return e=qI(e),(e<16?`0`:``)+e.toString(16)}function YI(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new QI(e,t,n,r)}function XI(e){if(e instanceof QI)return new QI(e.h,e.s,e.l,e.opacity);if(e instanceof yI||(e=LI(e)),!e)return new QI;if(e instanceof QI)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new QI(o,s,c,e.opacity)}function ZI(e,t,n,r){return arguments.length===1?XI(e):new QI(e,t,n,r??1)}function QI(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}_I(QI,ZI,vI(yI,{brighter(e){return e=e==null?xI:xI**+e,new QI(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?bI:bI**+e,new QI(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new HI(tL(e>=240?e-240:e+120,i,r),tL(e,i,r),tL(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new QI($I(this.h),eL(this.s),eL(this.l),KI(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=KI(this.opacity);return`${e===1?`hsl(`:`hsla(`}${$I(this.h)}, ${eL(this.s)*100}%, ${eL(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function $I(e){return e=(e||0)%360,e<0?e+360:e}function eL(e){return Math.max(0,Math.min(1,e||0))}function tL(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var nL=e=>()=>e;function rL(e,t){return function(n){return e+n*t}}function iL(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function aL(e){return(e=+e)==1?oL:function(t,n){return n-t?iL(t,n,e):nL(isNaN(t)?n:t)}}function oL(e,t){var n=t-e;return n?rL(e,n):nL(isNaN(e)?t:e)}var sL=(function e(t){var n=aL(t);function r(e,t){var r=n((e=VI(e)).r,(t=VI(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=oL(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function cL(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var lL=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,uL=new RegExp(lL.source,`g`);function dL(e){return function(){return e}}function fL(e){return function(t){return e(t)+``}}function pL(e,t){var n=lL.lastIndex=uL.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=lL.exec(e))&&(i=uL.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:cL(r,i)})),n=uL.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?fL(c[0].x):dL(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}var mL=180/Math.PI,hL={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function gL(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*mL,skewX:Math.atan(c)*mL,scaleX:o,scaleY:s}}var _L;function vL(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?hL:gL(t.a,t.b,t.c,t.d,t.e,t.f)}function yL(e){return e==null||(_L||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),_L.setAttribute(`transform`,e),!(e=_L.transform.baseVal.consolidate()))?hL:(e=e.matrix,gL(e.a,e.b,e.c,e.d,e.e,e.f))}function bL(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:cL(e,i)},{i:c-2,x:cL(r,a)})}else(i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:cL(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:cL(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:cL(e,n)},{i:s-2,x:cL(t,r)})}else(n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var xL=bL(vL,`px, `,`px)`,`deg)`),SL=bL(yL,`, `,`)`,`)`),CL=1e-12;function wL(e){return((e=Math.exp(e))+1/e)/2}function TL(e){return((e=Math.exp(e))-1/e)/2}function EL(e){return((e=Math.exp(2*e))-1)/(e+1)}var DL=(function e(t,n,r){function i(e,i){var a=e[0],o=e[1],s=e[2],c=i[0],l=i[1],u=i[2],d=c-a,f=l-o,p=d*d+f*f,m,h;if(p<CL)h=Math.log(u/s)/t,m=function(e){return[a+e*d,o+e*f,s*Math.exp(t*e*h)]};else{var g=Math.sqrt(p),_=(u*u-s*s+r*p)/(2*s*n*g),v=(u*u-s*s-r*p)/(2*u*n*g),y=Math.log(Math.sqrt(_*_+1)-_);h=(Math.log(Math.sqrt(v*v+1)-v)-y)/t,m=function(e){var r=e*h,i=wL(y),c=s/(n*g)*(i*EL(t*r+y)-TL(y));return[a+c*d,o+c*f,s*i/wL(t*r+y)]}}return m.duration=h*1e3*t/Math.SQRT2,m}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i})(Math.SQRT2,2,4),OL=0,kL=0,AL=0,jL=1e3,ML,NL,PL=0,FL=0,IL=0,LL=typeof performance==`object`&&performance.now?performance:Date,RL=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function zL(){return FL||=(RL(BL),LL.now()+IL)}function BL(){FL=0}function VL(){this._call=this._time=this._next=null}VL.prototype=HL.prototype={constructor:VL,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?zL():+n)+(t==null?0:+t),!this._next&&NL!==this&&(NL?NL._next=this:ML=this,NL=this),this._call=e,this._time=n,qL()},stop:function(){this._call&&(this._call=null,this._time=1/0,qL())}};function HL(e,t,n){var r=new VL;return r.restart(e,t,n),r}function UL(){zL(),++OL;for(var e=ML,t;e;)(t=FL-e._time)>=0&&e._call.call(void 0,t),e=e._next;--OL}function WL(){FL=(PL=LL.now())+IL,OL=kL=0;try{UL()}finally{OL=0,KL(),FL=0}}function GL(){var e=LL.now(),t=e-PL;t>jL&&(IL-=t,PL=e)}function KL(){for(var e,t=ML,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:ML=n);NL=e,qL(r)}function qL(e){OL||(kL&&=clearTimeout(kL),e-FL>24?(e<1/0&&(kL=setTimeout(WL,e-LL.now()-IL)),AL&&=clearInterval(AL)):(AL||=(PL=LL.now(),setInterval(GL,jL)),OL=1,RL(WL)))}function JL(e,t,n){var r=new VL;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var YL=$F(`start`,`end`,`cancel`,`interrupt`),XL=[];function ZL(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;tR(e,n,{name:t,index:r,group:i,on:YL,tween:XL,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function QL(e,t){var n=eR(e,t);if(n.state>0)throw Error(`too late; already scheduled`);return n}function $L(e,t){var n=eR(e,t);if(n.state>3)throw Error(`too late; already running`);return n}function eR(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function tR(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=HL(a,0,n.time);function a(e){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==1)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===3)return JL(o);f.state===4?(f.state=6,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=6,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(JL(function(){n.state===3&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=2,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===2){for(n.state=3,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=5,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===5&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function nR(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n)(r=n[o]).name===t?(i=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]):a=!1;a&&delete e.__transition}}function rR(e){return this.each(function(){nR(this,e)})}function iR(e,t){var n,r;return function(){var i=$L(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function aR(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=$L(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function xee(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=eR(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?iR:aR)(n,e,t))}function oR(e,t,n){var r=e._id;return e.each(function(){var e=$L(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return eR(e,r).value[t]}}function sR(e,t){var n;return(typeof t==`number`?cL:t instanceof LI?sL:(n=LI(t))?(t=n,sL):pL)(e,t)}function See(e){return function(){this.removeAttribute(e)}}function Cee(e){return function(){this.removeAttributeNS(e.space,e.local)}}function wee(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function Tee(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function Eee(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function Dee(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function Oee(e,t){var n=QN(e),r=n===`transform`?SL:sR;return this.attrTween(e,typeof t==`function`?(n.local?Dee:Eee)(n,r,oR(this,`attr.`+e,t)):t==null?(n.local?Cee:See)(n):(n.local?Tee:wee)(n,r,t))}function kee(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Aee(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function jee(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Aee(e,i)),n}return i._value=t,i}function Mee(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&kee(e,i)),n}return i._value=t,i}function Nee(e,t){var n=`attr.`+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=`function`)throw Error();var r=QN(e);return this.tween(n,(r.local?jee:Mee)(r,t))}function Pee(e,t){return function(){QL(this,e).delay=+t.apply(this,arguments)}}function Fee(e,t){return t=+t,function(){QL(this,e).delay=t}}function Iee(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?Pee:Fee)(t,e)):eR(this.node(),t).delay}function Lee(e,t){return function(){$L(this,e).duration=+t.apply(this,arguments)}}function Ree(e,t){return t=+t,function(){$L(this,e).duration=t}}function zee(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?Lee:Ree)(t,e)):eR(this.node(),t).duration}function Bee(e,t){if(typeof t!=`function`)throw Error();return function(){$L(this,e).ease=t}}function Vee(e){var t=this._id;return arguments.length?this.each(Bee(t,e)):eR(this.node(),t).ease}function Hee(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();$L(this,e).ease=n}}function Uee(e){if(typeof e!=`function`)throw Error();return this.each(Hee(this._id,e))}function Wee(e){typeof e!=`function`&&(e=uP(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new kR(r,this._parents,this._name,this._id)}function Gee(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new kR(o,this._parents,this._name,this._id)}function Kee(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function qee(e,t,n){var r,i,a=Kee(t)?QL:$L;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function Jee(e,t){var n=this._id;return arguments.length<2?eR(this.node(),n).on.on(e):this.each(qee(n,e,t))}function Yee(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Xee(){return this.on(`end.remove`,Yee(this._id))}function Zee(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=rP(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,ZL(l[f],t,n,f,l,eR(u,n)));return new kR(a,this._parents,t,n)}function cR(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=sP(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=eR(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&ZL(p,t,n,h,f,m);a.push(f),o.push(u)}return new kR(a,o,t,n)}var lR=qF.prototype.constructor;function uR(){return new lR(this._groups,this._parents)}function dR(e,t){var n,r,i;return function(){var a=eF(this,e),o=(this.style.removeProperty(e),eF(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function fR(e){return function(){this.style.removeProperty(e)}}function pR(e,t,n){var r,i=n+``,a;return function(){var o=eF(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function mR(e,t,n){var r,i,a;return function(){var o=eF(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),eF(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function hR(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=$L(this,e),l=c.on,u=c.value[a]==null?s||=fR(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function gR(e,t,n){var r=(e+=``)==`transform`?xL:sR;return t==null?this.styleTween(e,dR(e,r)).on(`end.style.`+e,fR(e)):typeof t==`function`?this.styleTween(e,mR(e,r,oR(this,`style.`+e,t))).each(hR(this._id,e)):this.styleTween(e,pR(e,r,t),n).on(`end.style.`+e,null)}function _R(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function vR(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&_R(e,a,n)),r}return a._value=t,a}function yR(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,vR(e,t,n??``))}function bR(e){return function(){this.textContent=e}}function xR(e){return function(){var t=e(this);this.textContent=t??``}}function SR(e){return this.tween(`text`,typeof e==`function`?xR(oR(this,`text`,e)):bR(e==null?``:e+``))}function CR(e){return function(t){this.textContent=e.call(this,t)}}function wR(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&CR(r)),t}return r._value=e,r}function TR(e){var t=`text`;if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!=`function`)throw Error();return this.tween(t,wR(e))}function ER(){for(var e=this._name,t=this._id,n=AR(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=eR(c,t);ZL(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new kR(r,this._parents,e,n)}function DR(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=$L(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var OR=0;function kR(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function AR(){return++OR}var jR=qF.prototype;kR.prototype={constructor:kR,select:Zee,selectAll:cR,selectChild:jR.selectChild,selectChildren:jR.selectChildren,filter:Wee,merge:Gee,selection:uR,transition:ER,call:jR.call,nodes:jR.nodes,node:jR.node,size:jR.size,empty:jR.empty,each:jR.each,on:Jee,attr:Oee,attrTween:Nee,style:gR,styleTween:yR,text:SR,textTween:TR,remove:Xee,tween:xee,delay:Iee,duration:zee,ease:Vee,easeVarying:Uee,end:DR,[Symbol.iterator]:jR[Symbol.iterator]};function MR(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var NR={time:null,delay:0,duration:250,ease:MR};function PR(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function FR(e){var t,n;e instanceof kR?(t=e._id,e=e._name):(t=AR(),(n=NR).time=zL(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&ZL(c,e,t,l,o,n||PR(c,t));return new kR(r,this._parents,e,t)}qF.prototype.interrupt=rR,qF.prototype.transition=FR;var IR=e=>()=>e;function LR(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function RR(e,t,n){this.k=e,this.x=t,this.y=n}RR.prototype={constructor:RR,scale:function(e){return e===1?this:new RR(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new RR(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return`translate(`+this.x+`,`+this.y+`) scale(`+this.k+`)`}};var zR=new RR(1,0,0);BR.prototype=RR.prototype;function BR(e){for(;!e.__zoom;)if(!(e=e.parentNode))return zR;return e.__zoom}function VR(e){e.stopImmediatePropagation()}function HR(e){e.preventDefault(),e.stopImmediatePropagation()}function UR(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function WR(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute(`viewBox`)?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function GR(){return this.__zoom||zR}function KR(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function qR(){return navigator.maxTouchPoints||`ontouchstart`in this}function JR(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function YR(){var e=UR,t=WR,n=JR,r=KR,i=qR,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=DL,l=$F(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,GR).on(`wheel.zoom`,w,{passive:!1}).on(`mousedown.zoom`,T).on(`dblclick.zoom`,E).filter(i).on(`touchstart.zoom`,D).on(`touchmove.zoom`,O).on(`touchend.zoom touchcancel.zoom`,k).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}_.transform=function(e,t,n,r){var i=e.selection?e.selection():e;i.property(`__zoom`,GR),e===i?i.interrupt().each(function(){S(this,arguments).event(r).start().zoom(null,typeof t==`function`?t.apply(this,arguments):t).end()}):x(e,t,n,r)},_.scaleBy=function(e,t,n,r){_.scaleTo(e,function(){return this.__zoom.k*(typeof t==`function`?t.apply(this,arguments):t)},n,r)},_.scaleTo=function(e,r,i,a){_.transform(e,function(){var e=t.apply(this,arguments),a=this.__zoom,s=i==null?b(e):typeof i==`function`?i.apply(this,arguments):i,c=a.invert(s),l=typeof r==`function`?r.apply(this,arguments):r;return n(y(v(a,l),s,c),e,o)},i,a)},_.translateBy=function(e,r,i,a){_.transform(e,function(){return n(this.__zoom.translate(typeof r==`function`?r.apply(this,arguments):r,typeof i==`function`?i.apply(this,arguments):i),t.apply(this,arguments),o)},null,a)},_.translateTo=function(e,r,i,a,s){_.transform(e,function(){var e=t.apply(this,arguments),s=this.__zoom,c=a==null?b(e):typeof a==`function`?a.apply(this,arguments):a;return n(zR.translate(c[0],c[1]).scale(s.k).translate(typeof r==`function`?-r.apply(this,arguments):-r,typeof i==`function`?-i.apply(this,arguments):-i),e,o)},a,s)};function v(e,t){return t=Math.max(a[0],Math.min(a[1],t)),t===e.k?e:new RR(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new RR(e.k,r,i)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,n,r,i){e.on(`start.zoom`,function(){S(this,arguments).event(i).start()}).on(`interrupt.zoom end.zoom`,function(){S(this,arguments).event(i).end()}).tween(`zoom`,function(){var e=this,a=arguments,o=S(e,a).event(i),s=t.apply(e,a),l=r==null?b(s):typeof r==`function`?r.apply(e,a):r,u=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),d=e.__zoom,f=typeof n==`function`?n.apply(e,a):n,p=c(d.invert(l).concat(u/d.k),f.invert(l).concat(u/f.k));return function(e){if(e===1)e=f;else{var t=p(e),n=u/t[2];e=new RR(n,l[0]-t[0]*n,l[1]-t[1]*n)}o.zoom(null,e)}})}function S(e,t,n){return!n&&e.__zooming||new C(e,t)}function C(e,n){this.that=e,this.args=n,this.active=0,this.sourceEvent=null,this.extent=t.apply(e,n),this.taps=0}C.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit(`start`)),this},zoom:function(e,t){return this.mouse&&e!==`mouse`&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&e!==`touch`&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&e!==`touch`&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit(`zoom`),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit(`end`)),this},emit:function(e){var t=YF(this.that).datum();l.call(e,this.that,new LR(e,{sourceEvent:this.sourceEvent,target:_,type:e,transform:this.that.__zoom,dispatch:l}),t)}};function w(t,...i){if(!e.apply(this,arguments))return;var s=S(this,i).event(t),c=this.__zoom,l=Math.max(a[0],Math.min(a[1],c.k*2**r.apply(this,arguments))),u=ZF(t);if(s.wheel)(s.mouse[0][0]!==u[0]||s.mouse[0][1]!==u[1])&&(s.mouse[1]=c.invert(s.mouse[0]=u)),clearTimeout(s.wheel);else if(c.k===l)return;else s.mouse=[u,c.invert(u)],nR(this),s.start();HR(t),s.wheel=setTimeout(d,m),s.zoom(`mouse`,n(y(v(c,l),s.mouse[0],s.mouse[1]),s.extent,o));function d(){s.wheel=null,s.end()}}function T(t,...r){if(f||!e.apply(this,arguments))return;var i=t.currentTarget,a=S(this,r,!0).event(t),s=YF(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=ZF(t,i),l=t.clientX,u=t.clientY;cI(t.view),VR(t),a.mouse=[c,this.__zoom.invert(c)],nR(this),a.start();function d(e){if(HR(e),!a.moved){var t=e.clientX-l,r=e.clientY-u;a.moved=t*t+r*r>h}a.event(e).zoom(`mouse`,n(y(a.that.__zoom,a.mouse[0]=ZF(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),lI(e.view,a.moved),HR(e),a.event(e).end()}}function E(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=ZF(r.changedTouches?r.changedTouches[0]:r,this),l=a.invert(c),u=a.k*(r.shiftKey?.5:2),d=n(y(v(a,u),c,l),t.apply(this,i),o);HR(r),s>0?YF(this).transition().duration(s).call(x,d,c,r):YF(this).call(_.transform,d,c,r)}}function D(t,...n){if(e.apply(this,arguments)){var r=t.touches,i=r.length,a=S(this,n,t.changedTouches.length===i).event(t),o,s,c,l;for(VR(t),s=0;s<i;++s)c=r[s],l=ZF(c,this),l=[l,this.__zoom.invert(l),c.identifier],a.touch0?!a.touch1&&a.touch0[2]!==l[2]&&(a.touch1=l,a.taps=0):(a.touch0=l,o=!0,a.taps=1+!!u);u&&=clearTimeout(u),o&&(a.taps<2&&(d=l[0],u=setTimeout(function(){u=null},p)),nR(this),a.start())}}function O(e,...t){if(this.__zooming){var r=S(this,t).event(e),i=e.changedTouches,a=i.length,s,c,l,u;for(HR(e),s=0;s<a;++s)c=i[s],l=ZF(c,this),r.touch0&&r.touch0[2]===c.identifier?r.touch0[0]=l:r.touch1&&r.touch1[2]===c.identifier&&(r.touch1[0]=l);if(c=r.that.__zoom,r.touch1){var d=r.touch0[0],f=r.touch0[1],p=r.touch1[0],m=r.touch1[1],h=(h=p[0]-d[0])*h+(h=p[1]-d[1])*h,g=(g=m[0]-f[0])*g+(g=m[1]-f[1])*g;c=v(c,Math.sqrt(h/g)),l=[(d[0]+p[0])/2,(d[1]+p[1])/2],u=[(f[0]+m[0])/2,(f[1]+m[1])/2]}else if(r.touch0)l=r.touch0[0],u=r.touch0[1];else return;r.zoom(`touch`,n(y(c,l,u),r.extent,o))}}function k(e,...t){if(this.__zooming){var n=S(this,t).event(e),r=e.changedTouches,i=r.length,a,o;for(VR(e),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),a=0;a<i;++a)o=r[a],n.touch0&&n.touch0[2]===o.identifier?delete n.touch0:n.touch1&&n.touch1[2]===o.identifier&&delete n.touch1;if(n.touch1&&!n.touch0&&(n.touch0=n.touch1,delete n.touch1),n.touch0)n.touch0[1]=this.__zoom.invert(n.touch0[0]);else if(n.end(),n.taps===2&&(o=ZF(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=YF(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:IR(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:IR(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:IR(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:IR([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),_):t},_.scaleExtent=function(e){return arguments.length?(a[0]=+e[0],a[1]=+e[1],_):[a[0],a[1]]},_.translateExtent=function(e){return arguments.length?(o[0][0]=+e[0][0],o[1][0]=+e[1][0],o[0][1]=+e[0][1],o[1][1]=+e[1][1],_):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},_.constrain=function(e){return arguments.length?(n=e,_):n},_.duration=function(e){return arguments.length?(s=+e,_):s},_.interpolate=function(e){return arguments.length?(c=e,_):c},_.on=function(){var e=l.on.apply(l,arguments);return e===l?_:e},_.clickDistance=function(e){return arguments.length?(h=(e=+e)*e,_):Math.sqrt(h)},_.tapDistance=function(e){return arguments.length?(g=+e,_):g},_}var XR=`/api/live`,ZR=crypto.randomUUID(),QR=500;function $R(e,{onShow:t,onDisconnect:n,unseen:r=j_,selection:i=HN,theme:a=IM}={}){let o,s,c=!1,l=()=>{let u=location.protocol===`https:`?`wss`:`ws`;o=new WebSocket(`${u}://${location.host}${XR}`),o.addEventListener(`open`,()=>{let t={type:`hello`,role:`board`,tab:ZR};o?.send(JSON.stringify(t)),e.setState({connected:!0})}),o.addEventListener(`message`,n=>{let o=JSON.parse(String(n.data));if(o.type===`board`)Dg(e,o.data),y_(r,o.data);else if(o.type===`changes`){__(r,o.changes);let{board:t}=e.getState();t&&y_(r,t)}else if(o.type===`access`)Fg(e,o.write,o.dispatch);else if(o.type===`reload`)Ig(e,o.refs);else if(o.type===`renamed`){let{before:t,after:n}=o;vg(e,t,n)&&(MN(i,t,n),kM(t,n,a),b_(r,t,n),_g(e,t,n))}else o.type===`findings`?Pg(e,o.findings):o.type===`notes`?Og(e,o.page,o.notes):o.type===`listeners`?kg(e,o.listeners):o.type===`history`?Ag(e,{undo:o.undo,redo:o.redo}):o.type===`claims`?jg(e,o.claims):o.type===`thumbnails`?Mg(e,o.theme,o.stamps):o.type===`show`&&t?.(o.ref)}),o.addEventListener(`close`,()=>{Ng(e),n?.(),c||(s=setTimeout(l,QR))})};return l(),()=>{c=!0,clearTimeout(s),o?.close()}}var ez=1500;function tz(e,{store:t=j_,doc:n=document}={}){let r=(0,_.useRef)(e),i=(0,_.useRef)(()=>{});(0,_.useEffect)(()=>{let e=new Map,a=t=>{clearTimeout(e.get(t)),e.delete(t)},o=()=>{let i=r.current,{unseen:o}=t.getState(),s=i&&n.visibilityState===`visible`?new Set(i.frames.filter(e=>e.ref in o).filter(e=>nz(e.box,i.view,i.size)).map(e=>e.ref)):new Set;for(let t of[...e.keys()])s.has(t)||a(t);for(let n of s)e.has(n)||e.set(n,setTimeout(()=>{e.delete(n),v_(t,n)},ez))},s=()=>{for(let e of HN.getState().frames)v_(t,e)};i.current=o,o(),s();let c=t.subscribe((e,t)=>{e.unseen!==t.unseen&&(s(),o())}),l=HN.subscribe(s);return n.addEventListener(`visibilitychange`,o),()=>{c(),l(),n.removeEventListener(`visibilitychange`,o);for(let t of[...e.keys()])a(t);i.current=()=>{}}},[t,n]),(0,_.useEffect)(()=>{r.current=e,i.current()},[e])}function nz(e,t,n){let r=Math.max(e.x*t.k+t.x,0),i=Math.max(e.y*t.k+t.y,0),a=Math.min((e.x+e.width)*t.k+t.x,n.width),o=Math.min((e.y+e.height)*t.k+t.y,n.height),s=Math.max(0,a-r)*Math.max(0,o-i),c=e.width*t.k*e.height*t.k;return c>0&&s*2>=c}function rz(e){return[...e.querySelectorAll(`*`)].filter(e=>!e.hasAttribute(gM))}function iz(e,t){let n=rz(e).indexOf(t);return n===-1?null:n}function az(e,t){return rz(e)[t]??null}function oz(e){return e.querySelector(`style[data-frameboard]`)?.getAttribute(`data-hash`)??null}var sz=e=>`calc(${e}px / var(--zoom, 1))`,cz=`${sz(1.5)} solid var(--primary)`;function lz(e){return`${e.width} × ${e.height}`}function uz(e,t){return{left:e.x-(t?.x??0),top:e.y-(t?.y??0),width:e.width,height:e.height}}function dz(e,t,n,r){let i=yz(e,`[data-selection]`);if(!i)return;i.style.transform=`translate(${t}px, ${n}px)`,bz(i,`[data-handles]`,!0),bz(i,`[data-chip]`,!0);let a=yz(i,`[data-move-chip]`);a&&(a.hidden=!1,a.textContent=`${r.x}, ${r.y}`)}function fz(e,t){let n=yz(e,`[data-selection]`),r=eN(Object.values(t));if(!n||!r)return;Object.assign(n.style,vz(uz(r)));for(let[e,i]of Object.entries(t)){let t=yz(n,`[data-outline="${CSS.escape(e)}"]`);t&&Object.assign(t.style,vz(uz(i,r)))}let i=yz(n,`[data-chip]`);i&&Object.keys(t).length===1&&(i.textContent=lz(r))}function pz(e,t,n){let r=yz(e,`[data-marquee]`);r&&(r.hidden=t===null,t&&Object.assign(r.style,vz(uz(t)))),yz(e,`[data-marquee-hits]`)?.replaceChildren(...n.map(e=>{let t=document.createElement(`div`);return t.className=`absolute`,Object.assign(t.style,vz(uz(e)),{outline:cz}),t}))}function mz(e,t,n){yz(e,`[data-guides]`)?.replaceChildren(...t.map(e=>gz(e.axis===`x`?`vertical`:`horizontal`,e)),...n.flatMap(e=>[gz(e.axis===`x`?`horizontal`:`vertical`,e),_z(e)]))}function hz(e){let t=yz(e,`[data-selection]`);if(t){let e=t.hasAttribute(`data-inside`);t.style.transform=``,bz(t,`[data-handles]`,e),bz(t,`[data-chip]`,e),bz(t,`[data-move-chip]`,!0)}pz(e,null,[]),mz(e,[],[])}function gz(e,{at:t,from:n,to:r}){let i=document.createElement(`div`);return i.className=`absolute bg-guide`,i.dataset.guide=e,Object.assign(i.style,e===`vertical`?{left:`${t}px`,top:`${n}px`,height:`${r-n}px`,width:sz(1)}:{top:`${t}px`,left:`${n}px`,width:`${r-n}px`,height:sz(1)}),i}function _z(e){let t=document.createElement(`span`),n=Math.round(e.to-e.from);t.dataset.gap=String(n),t.textContent=String(n),t.className=`absolute origin-top-left rounded-[4px] bg-guide px-[5px] py-px text-[10px] leading-[14px] text-white tabular-nums`;let r=(e.from+e.to)/2;return Object.assign(t.style,{left:`${e.axis===`x`?r:e.at}px`,top:`${e.axis===`x`?e.at:r}px`,transform:`scale(calc(1 / var(--zoom, 1))) translate(-50%, -120%)`}),t}function vz(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,`${t}px`]))}function yz(e,t){return e.querySelector(t)}function bz(e,t,n){let r=yz(e,t);r&&(r.hidden=n)}var xz=[`nw`,`ne`,`sw`,`se`],Sz=`${sz(1)} dashed var(--primary)`,Cz=1e6,wz=`absolute top-full left-1/2 origin-top-left rounded-[4px] bg-primary px-1.5 py-0.5 text-[10px] leading-[14px] whitespace-nowrap text-primary-foreground tabular-nums [transform:scale(calc(1/var(--zoom,1)))_translate(-50%,6px)]`;function Tz({frames:e}){let t=UN(e=>e.frames),n=UN(e=>!!e.element),r=e.filter(e=>t.includes(e.ref)),i=sN(r),a=eN(i.map(e=>e.box)),o=eN(iN(r).map(e=>e.box)),s=BM(),c=r.some(e=>e.ref in s);return(0,X.jsxs)(`div`,{"data-overlay":!0,className:`pointer-events-none absolute top-0 left-0`,style:{zIndex:Cz},children:[a?(0,X.jsx)(Ez,{frames:i,bounds:a,size:o??a,previewed:c,inside:n}):null,(0,X.jsx)(`div`,{"data-marquee-hits":!0}),(0,X.jsx)(`div`,{"data-marquee":!0,hidden:!0,className:`absolute bg-primary/10`,style:{border:`${sz(1)} solid var(--primary)`}}),(0,X.jsx)(`div`,{"data-guides":!0})]})}function Ez({frames:e,bounds:t,size:n,previewed:r,inside:i}){let a=e.length>1;return(0,X.jsxs)(`div`,{"data-selection":!0,"data-inside":i||void 0,className:`absolute`,style:{...uz(t),...i?{outline:Sz,outlineOffset:sz(1)}:{outline:cz}},children:[a?e.map(e=>(0,X.jsx)(`div`,{"data-outline":e.ref,className:`absolute`,style:{...uz(e.box,t),outline:cz}},e.ref)):null,(0,X.jsx)(`div`,{"data-handles":!0,hidden:i,children:xz.map(e=>(0,X.jsx)(`span`,{"data-handle":e,className:`absolute -translate-1/2 border-primary bg-white`,style:{left:e.endsWith(`w`)?0:`100%`,top:e.startsWith(`n`)?0:`100%`,width:sz(7),height:sz(7),borderWidth:sz(1.5)}},e))}),(0,X.jsx)(`span`,{"data-chip":!0,hidden:i,className:wz,children:a?`${e.length} frames`:`${r?`Stored `:``}${lz(n)}`}),(0,X.jsx)(`span`,{"data-move-chip":!0,hidden:!0,className:wz})]})}var Dz=2e3,Oz=1;function kz({frames:e,container:t}){let n=Jg(e=>e.mode===`play`),[r,i]=(0,_.useState)({}),a=(0,_.useRef)(e);if((0,_.useLayoutEffect)(()=>{a.current=e},[e]),(0,_.useEffect)(()=>{if(!t||n)return;let e=new Set,r=(t,n,r)=>{let a=Oz++,{width:o,height:s}=qM(t,t.box,VM(t.ref)),c=n.whole?[{x:0,y:0,width:o,height:s}]:n.elements.flatMap(e=>{let t=az(r,e);if(!t)return[];let n=t.getBoundingClientRect();return[{x:n.left,y:n.top,width:n.width,height:n.height}]});if(tv.add(n.id),c.length===0)return;i(e=>({...e,[t.ref]:{key:a,boxes:c}})),ev.setState(e=>({glowing:{...e.glowing,[t.ref]:a}}));let l=setTimeout(()=>{e.delete(l),i(e=>{if(e[t.ref]?.key!==a)return e;let{[t.ref]:n,...r}=e;return r}),ev.setState(e=>{if(e.glowing[t.ref]!==a)return e;let{[t.ref]:n,...r}=e.glowing;return{glowing:r}})},Dz);e.add(l)},o=()=>{let{unseen:e}=j_.getState(),{replays:n}=ev.getState(),i=[];for(let o of a.current){let a=e[o.ref];if(!a)continue;let s=o.ref in n;if(tv.has(a.id)&&!s)continue;let c=t.querySelector(`[data-frame="${CSS.escape(o.ref)}"] iframe`)?.contentDocument;c&&oz(c)===a.hash&&(s&&i.push(o.ref),r(o,a,c))}i.length>0&&ev.setState(e=>({replays:Object.fromEntries(Object.entries(e.replays).filter(([e])=>!i.includes(e)))}))};o(),t.addEventListener(`load`,o,!0);let s=j_.subscribe((e,t)=>{e.unseen!==t.unseen&&o()}),c=ev.subscribe((e,t)=>{e.replays!==t.replays&&o()});return()=>{t.removeEventListener(`load`,o,!0),s(),c();for(let t of e)clearTimeout(t);i({}),ev.setState({glowing:{}})}},[t,n]),n)return null;let o=new Map(e.map(e=>[e.ref,e]));return Object.entries(r).flatMap(([e,{key:t,boxes:n}])=>{let r=o.get(e);return r?n.map((n,i)=>(0,X.jsx)(`span`,{"data-change-glow":e,"aria-hidden":!0,className:`pointer-events-none absolute rounded-[calc(8px/var(--zoom,1))] bg-[color-mix(in_srgb,var(--claim)_12%,transparent)] motion-safe:animate-change-glow`,style:{left:`calc(${r.box.x+n.x}px - ${sz(4)})`,top:`calc(${r.box.y+n.y}px - ${sz(4)})`,width:`calc(${n.width}px + ${sz(8)})`,height:`calc(${n.height}px + ${sz(8)})`,boxShadow:`0 0 0 ${sz(2)} var(--claim), 0 0 ${sz(18)} color-mix(in srgb, var(--claim) 55%, transparent)`,zIndex:Cz-1}},`${t}-${i}`)):[]})}function Az(e){return e.slice(0,1).toUpperCase()}var jz=`claude`;function Mz(e){let[t,n]=e.split(` · `);return n===void 0||!t?jz:t}function Nz(e,t){let n=Math.max(0,Math.floor((t-Date.parse(e))/1e3));return n<60?`${n}s`:`${Math.floor(n/60)}m`}function Pz(){let[e,t]=(0,_.useState)(()=>Date.now());return(0,_.useEffect)(()=>{let e=setInterval(()=>t(Date.now()),1e3);return()=>clearInterval(e)},[]),e}var Fz=`pointer-events-none w-[280px] rounded-[10px] border border-[color-mix(in_srgb,var(--claim)_50%,var(--border))] bg-card px-3 py-2.5 text-xs leading-[1.45] text-card-foreground shadow-[0_10px_30px_rgba(0,0,0,0.3)]`;function Iz({page:e,frames:t}){let n=sk(),r=Jg(e=>e.mode===`play`);(0,_.useEffect)(()=>{r&&dk()},[r]),(0,_.useEffect)(()=>()=>dk(),[e]);let i=n.length>0;(0,_.useEffect)(()=>{if(!i)return;let e=e=>{e.key===`Escape`&&dk()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[i]);let a=iN(t);if(r)return null;let o=Rz(n);return a.flatMap(e=>{let t=o.get(e.ref);return t?(0,X.jsx)(`div`,{className:`absolute origin-top-left [transform:scale(calc(1/var(--zoom,1)))]`,style:{left:`calc(${e.box.x}px + ${sz(72)})`,top:`calc(${e.box.y+e.box.height}px - ${sz(38)})`,zIndex:Cz+1},children:(0,X.jsx)(zz,{frame:e.name,...t})},e.ref):[]})}function Lz({frames:e}){let t=sk();if(Jg(e=>e.mode===`play`))return null;let n=new Set(e.map(e=>e.ref)),r=[...Rz(t)].filter(([e])=>!n.has(e));return r.length===0?null:(0,X.jsx)(`div`,{"data-waiting-dock":!0,className:`absolute bottom-[4.25rem] left-4 flex flex-col gap-2`,style:{zIndex:Cz+1},children:r.map(([e,t])=>(0,X.jsx)(zz,{frame:e.slice(e.lastIndexOf(`/`)+1),...t},e))})}function Rz(e){let t=new Map;for(let n of e)for(let e of n.holders)t.set(e.frame,{label:n.label,holder:e});return t}function zz({frame:e,label:t,holder:n}){let r=Pz(),i=`${Az(n.tag)}${n.tag.slice(1)}`;return(0,X.jsxs)(`div`,{"data-waiting-card":n.frame,role:`status`,className:Fz,children:[(0,X.jsxs)(`b`,{className:`block font-semibold`,children:[i,` is editing `,e]}),(0,X.jsxs)(`span`,{className:`text-muted-foreground`,children:[`Your `,t,` will wait until it finishes, about`,` `,(0,X.jsx)(`span`,{"data-waiting-elapsed":!0,children:Nz(n.claimedAt,r)}),` so far.`]})]})}function Bz(e,t,n){let r=n.width/t.k,i=n.height/t.k,a=-t.x/t.k-r,o=-t.y/t.k-i,s=a+3*r,c=o+3*i,l=new Set;for(let{ref:t,box:n}of e)n.x<s&&n.x+n.width>a&&n.y<c&&n.y+n.height>o&&l.add(t);return l}function Vz(e){let t=N()(()=>({byRef:{}})),n=(e,n,r)=>{let i=t.getState().byRef[e];i&&i.version>r||t.setState(t=>({byRef:{...t.byRef,[e]:{...n,version:r}}}))},r=(e,n)=>{let r=t.getState().byRef[e];r&&r.version>=n||i(e,n)},i=(t,r)=>{n(t,{status:`loading`},r),e(t).then(e=>n(t,{status:`ready`,tree:e},r),e=>n(t,{status:`refused`,message:e instanceof Error?e.message:String(e)},r))},a=(e,n)=>(r(e,n),new Promise(n=>{let r=()=>{let r=t.getState().byRef[e];return!r||r.status===`loading`?!1:(n(r.status===`ready`?r.tree:null),!0)};if(r())return;let i=t.subscribe(()=>{r()&&i()})}));return{store:t,request:r,read:a,catchUp:async(e,n,r)=>{let o=await a(e,r),s=t.getState().byRef[e];!o||o.hash===n||!s||s.version>r||(i(e,r),await a(e,r))}}}async function Hz(e,t=fetch){let n=await t(`/api/frames/elements?ref=${encodeURIComponent(e)}`),r=await n.json().catch(()=>null);if(!r)throw Error(`The board answered ${n.status}.`);if(!r.ok)throw Error(r.error.message);return r.data}var Uz=Vz(e=>Hz(e));function Wz(e){let t=Uz.store.getState().byRef[e];return t?.status===`ready`?t.tree:null}function Gz(e){let t=Rg(t=>e?t.reloads[e]??0:0);return(0,_.useEffect)(()=>{e&&Uz.request(e,t)},[e,t]),F(Uz.store,t=>e?t.byRef[e]??null:null)}function Kz(e){Uz.request(e,Lg.getState().reloads[e]??0)}function qz(e,t){return Uz.catchUp(e,t,Lg.getState().reloads[e]??0)}function Jz(e){return Uz.read(e,Lg.getState().reloads[e]??0)}function Yz(e,t){return e.find(e=>e.parent===t)?.index}function Xz(e,t){return e.find(e=>e.index===t)?.parent}function Zz(e,t,n){let r=Xz(e,t);if(r===void 0)return;let i=e.filter(e=>e.parent===r),a=i.findIndex(e=>e.index===t),o=i.length;return i[(a+n+o)%o]?.index}function Qz(e,t){let n=Xz(e,t);if(n===void 0)return;let r=e.filter(e=>e.parent===n),i=r.findIndex(e=>e.index===t);return i<0?void 0:{place:i,count:r.length}}function $z(e,t,n){let r=Xz(e,t),i=e[0];if(r===void 0||!i)return;let a=e.filter(e=>e.parent===r),o=a.findIndex(e=>e.index===t),s=n(o,a.length);if(s===o||s<0||s>=a.length)return;let c=a.filter(e=>e.index!==t);return{parent:r??i.index-1,before:c[s]?.index??null}}var eB=new Map,tB=new Map;function nB({frame:e,index:t}){return`${e}\n${t}`}function rB(e){return tB.get(nB(e))??null}function iB(e){tB.delete(nB(e))}function aB(e,t,n,r={}){return oB(t.frame,i=>sB(i,e,t,n,r)).then(e=>e!==null)}function oB(e,t){let n=t(eB.get(e));return eB.set(e,n),n.finally(()=>{eB.get(e)===n&&eB.delete(e)})}async function sB(e,t,n,r,{selection:i=HN,send:a=fetch,notify:o=({copy:e,...t})=>tg.add({...t,type:`warning`,...e===void 0?{}:{actionProps:{children:`Copy text`,onClick:()=>void navigator.clipboard.writeText(e)}}})}){let s=e?await e:void 0;if(s===null)return BN(i,cB),null;let c=s!==void 0&&s.from.includes(n.hash),l=c?s.at.get(n.index):void 0,u=c&&(!s.shifted||l!==void 0),d=u?s.to:n.hash,f=u?l??n.index:n.index,p=()=>{};try{let e=await uk([n.frame],`edit`,async()=>{p=IN(n.frame),RN(n.frame,d);try{return await lx(`/api/frames/edit`,{ref:n.frame,index:f,hash:d,change:r},`POST`,a)}catch(e){throw p(),e}}),o=e.from!==void 0&&e.from!==d;o&&e.from&&RN(n.frame,e.from),RN(n.frame,e.hash);let{page:l,frames:u,element:m}=i.getState(),h=!m&&l===t&&u.length===1&&u[0]===n.frame;(m?.frame===n.frame&&(m.index===n.index||m.index===f)||o&&h)&&kN(i,t,{frame:n.frame,index:e.index,hash:e.hash}),p(),VN(i,cB);let g=new Map(c?s.at:[]);return g.set(n.index,e.index),{from:c?[...s.from,d]:[n.hash],to:e.hash,at:g,shifted:c&&s.shifted||o}}catch(e){if(!(e instanceof nk)){let t=r.kind===`text`?r.value:void 0,i=e instanceof cx&&e.code===`stale-address`,a=i&&t!==void 0&&e.details.moved===!1;a&&tB.set(nB(n),t),o({title:`Edit not saved`,description:e instanceof cx?lB(e.message)+(a?` Press Enter to apply your text anyway.`:``):`The board could not be reached, so nothing was written.`,...i&&t!==void 0?{copy:t}:{}})}return p(),BN(i,cB),null}}function cB(e){let t=document.querySelector(`[data-frame="${CSS.escape(e)}"] iframe`)?.contentDocument;return t?oz(t):null}function lB(e){let t=/^\S+\.html\b/.test(e)?e:e.charAt(0).toUpperCase()+e.slice(1);return/[.!?]$/.test(t)?t:`${t}.`}function uB(e,t,n,r,i){return{onPreview:r=>i?.(e,r?n(r(t)):null),onCommit:i=>r({kind:`style`,property:e,value:n(i(t))})}}var dB={width:240,height:135},fB=3e3,pB=1e4;function mB(e,t){let n=e&&e.width>0&&e.height>0?e:dB,r=Math.min(1,t>0?t/n.width:1,pB/n.width,pB/n.height);return{width:Math.max(1,Math.round(n.width*r)),height:Math.max(1,Math.round(n.height*r))}}function hB(e,t,n=fB){return t===`svg`?_B(e):new Promise(r=>{let i=t===`video`?document.createElement(`video`):new Image,a=e=>{clearTimeout(o),i.removeAttribute(`src`),r(e&&e.width>0&&e.height>0?e:null)},o=setTimeout(()=>a(null),n);i.addEventListener(`error`,()=>a(null),{once:!0}),i instanceof HTMLVideoElement?(i.preload=`metadata`,i.muted=!0,i.addEventListener(`loadedmetadata`,()=>a({width:i.videoWidth,height:i.videoHeight}),{once:!0})):i.addEventListener(`load`,()=>a({width:i.naturalWidth,height:i.naturalHeight}),{once:!0}),i.src=e})}var gB=/^\s*(\d+(?:\.\d+)?)(?:px)?\s*$/;async function _B(e){let t;try{let n=await fetch(e);if(!n.ok)return null;t=await n.text()}catch{return null}let n=new DOMParser().parseFromString(t,`image/svg+xml`).documentElement;if(n.localName!==`svg`)return null;let r=gB.exec(n.getAttribute(`width`)??``)?.[1],i=gB.exec(n.getAttribute(`height`)??``)?.[1];if(r&&i)return vB(Number(r),Number(i));let a=(n.getAttribute(`viewBox`)??``).trim().split(/[\s,]+/).map(Number);return a.length===4?vB(a[2]??0,a[3]??0):null}function vB(e,t){return e>0&&t>0?{width:Math.round(e),height:Math.round(t)}:null}var yB=new Set([`HTML`,`BODY`]);function bB(e,t,n){let r=[...t].filter(e=>!e.hidden&&xB(e.box,n)).sort((e,t)=>t.order-e.order)[0];if(!r)return null;let i=e.querySelector(`[data-frame="${CSS.escape(r.ref)}"] iframe`),a=i?.contentDocument,o=a?.elementFromPoint(n.x-r.box.x,n.y-r.box.y),s=i?.dataset.renderedAt??null,c=a&&o&&s&&!yB.has(o.tagName)?iz(a,o):null;return{frame:{ref:r.ref,name:r.name},element:c,renderedAt:c===null?null:s,at:n}}function xB(e,{x:t,y:n}){return t>=e.x&&t<e.x+e.width&&n>=e.y&&n<e.y+e.height}var SB=new Set(`area.br.col.embed.hr.iframe.img.input.link.meta.noscript.object.picture.script.select.source.style.template.textarea.title.track.video.audio.canvas.wbr.p.h1.h2.h3.h4.h5.h6.pre.button.label.a`.split(`.`)),CB=`http://www.w3.org/1999/xhtml`;function wB(e,t){if(e.localName===`body`)return!0;if(e.namespaceURI!==CB||SB.has(e.localName)||e.childElementCount===0||e.closest(`svg, math`))return!1;let n=t.getComputedStyle(e).display;return n.startsWith(`inline`)||n===`contents`?!1:![...e.childNodes].some(e=>e.nodeType===Node.TEXT_NODE&&(e.textContent??``).trim()!==``)}function TB(e){let t=e.display;if(t.endsWith(`grid`))return{row:!0,reverse:!1};if(!t.endsWith(`flex`))return{row:!1,reverse:!1};let n=e.flexDirection;return{row:n.startsWith(`row`),reverse:n.endsWith(`reverse`)}}function EB(e,t,n,r){if(!n){let n=t.top+t.height/2;return r?e.y>n:e.y<n}if(e.y<t.top)return!0;if(e.y>t.bottom)return!1;let i=t.left+t.width/2;return r?e.x>i:e.x<i}function DB(e,t){let n=e.defaultView,r=e.body;if(!n||!r)return null;let i=e.elementFromPoint(t.x,t.y);for(i&&r.contains(i)||(i=r);i&&!wB(i,n);)i=i.parentElement;let a=i&&iz(e,i);if(!i||a==null)return null;let o=n.getComputedStyle(i),{row:s,reverse:c}=TB(o),l=[...i.children].flatMap(t=>{let n=iz(e,t),r=t.getBoundingClientRect();return n!==null&&(r.width>0||r.height>0)?[{index:n,box:r}]:[]}),u=l.findIndex(({box:e})=>EB(t,e,s,c)),d=u===-1?l.at(-1):l[u-1],f=u===-1?void 0:l[u],p=e=>Number.parseFloat(o.getPropertyValue(`padding-${e}`))||0;return{parent:a,before:f?.index??null,row:s,room:Math.max(0,i.clientWidth-p(`left`)-p(`right`)),line:OB(i.getBoundingClientRect(),o,s,c,{after:d?.box,ahead:f?.box})}}function OB(e,t,n,r,{after:i,ahead:a}){let o=e=>Number.parseFloat(t.getPropertyValue(`padding-${e}`))||0,s={left:e.left+o(`left`),right:e.right-o(`right`),top:e.top+o(`top`),bottom:e.bottom-o(`bottom`)};if(n){let e=r?a:i,t=r?i:a,n=e&&t?(e.right+t.left)/2:e?.right??t?.left??s.left,o=a??i,c=o?.top??s.top,l=o?.bottom??s.bottom;return{x:n,y:c,width:0,height:Math.max(0,l-c)}}let c=r?a:i,l=r?i:a,u=c&&l?(c.bottom+l.top)/2:c?.bottom??l?.top??s.top;return{x:s.left,y:u,width:Math.max(0,s.right-s.left),height:0}}function kB(e,t,n){let r=bB(e,t,n),i=t.find(e=>e.ref===r?.frame.ref);if(!i)return null;let a=jB(e,i.ref),o=a?oz(a):null,s=a&&o?DB(a,{x:n.x-i.box.x,y:n.y-i.box.y}):null;return o&&s?{frame:i,hash:o,gap:s}:null}function AB(e,t,n,{frame:r,index:i}){let a=kB(e,t,n),o=a?.frame.ref===r?jB(e,r):null,s=o?az(o,i):null,c=o&&a?az(o,a.gap.parent):null;if(!a||!o||!s||!c||s.contains(c))return null;let l=s.nextElementSibling;return c===s.parentElement&&(a.gap.before===i||a.gap.before===(l?iz(o,l):null))?null:a}function jB(e,t){return e.querySelector(`[data-frame="${CSS.escape(t)}"] iframe`)?.contentDocument??null}async function MB(e,t,n,r,i,{selection:a=HN,mode:o=qg,live:s=Lg,send:c=fetch,notify:l=e=>tg.add({...e,type:`warning`}),size:u,asset:d}={}){let f=kB(e,n,r);if(!f||i===`asset`&&!d)return null;let{gap:p}=f,m=i===`asset`&&d?{kind:i,path:d.path,...u??mB(d.natural,p.room)}:i===`divider`?{kind:i,vertical:p.row}:i===`text`||!u?{kind:i}:{kind:i,...u};return RB(f,`Nothing placed`,e=>({url:`/api/frames/insert`,body:{ref:f.frame.ref,hash:e,parent:p.parent,before:p.before,element:m}}),e=>{kN(a,t,e),o.setState({tool:`move`})},{live:s,send:c,notify:l})}async function NB(e,t,n,r,i,{measure:a=hB,...o}={}){let s=o.size?null:await a(Jj(i.project,i.path),i.kind);return MB(e,t,n,r,`asset`,{...o,asset:{path:i.path,natural:s}})}async function PB(e,t,n,r,i,{selection:a=HN,live:o=Lg,send:s=fetch,notify:c=e=>tg.add({...e,type:`warning`})}={}){let l=AB(e,n,r,i);return l?RB(l,`Nothing moved`,e=>({url:`/api/frames/move`,body:{ref:i.frame,hash:e,index:i.index,parent:l.gap.parent,before:l.gap.before}}),e=>kN(a,t,e),{live:o,send:s,notify:c}):null}async function FB(e,t,n,{selection:r=HN,live:i=Lg,send:a=fetch,notify:o=e=>tg.add({...e,type:`warning`}),tree:s=LB}={}){let c=t.frame,l=i.getState().claims[c];if(l)return o({title:`Nothing moved`,description:`${l.tag} is editing ${c.split(`/`).at(-1)??c}, so nothing was written.`}),null;let u=null;return await oB(c,async i=>{let l=i?await i:void 0;if(l===null)return null;let d=l!==void 0&&l.from.includes(t.hash),f=d?l.moves?.get(IB(t.hash,t.index))??l.at.get(t.index):void 0,p=d&&(!l.shifted||f!==void 0),m=p?l.to:t.hash,h=p?f??t.index:t.index,g=await s(c,m);if(!g)return o({title:`Nothing moved`,description:`The frame changed since it was read, so nothing was written.`}),null;let _=$z(g.elements,h,n);if(!_)return l??{from:[m],to:m,at:new Map,shifted:!1};let v=IN(c);RN(c,m);try{let n=await lx(`/api/frames/move`,{ref:c,hash:m,index:h,parent:_.parent,before:_.before},`POST`,a);RN(c,n.hash),qz(c,n.hash),u={frame:c,index:n.index,hash:n.hash},kN(r,e,u);let i=new Map(d?l.at:[]);i.set(t.index,n.index);let o=new Map;for(let[e,t]of d&&l.moves||[])t===h&&o.set(e,n.index);return o.set(IB(t.hash,t.index),n.index),o.set(IB(m,h),n.index),{from:d?[...l.from,m]:[m],to:n.hash,at:i,shifted:!0,moves:o}}catch(e){return o({title:`Nothing moved`,description:e instanceof cx?lB(e.message):`The board could not be reached, so nothing was written.`}),null}finally{v()}}),u}function IB(e,t){return`${e}\n${t}`}async function LB(e,t){let n=Wz(e);if(n?.hash===t)return n;let r=await Hz(e).catch(()=>null);return r?.hash===t?r:null}async function RB({frame:e,hash:t},n,r,i,{live:a,send:o,notify:s}){let c=e.ref,l=a.getState().claims[c];if(l)return s({title:n,description:`${l.tag} is editing ${e.name}, so nothing was written.`}),null;let u=null;return await oB(c,async e=>{let a=e?await e:void 0;if(a===null)return null;let l=a!==void 0&&a.from.includes(t)&&!a.shifted?a.to:t,d=IN(c);RN(c,l);try{let{url:e,body:t}=r(l),n=await lx(e,t,`POST`,o);return RN(c,n.hash),qz(c,n.hash),u={frame:c,index:n.index,hash:n.hash},i(u),{from:[l],to:n.hash,at:new Map,shifted:!0}}catch(e){return s({title:n,description:e instanceof cx?lB(e.message):`The board could not be reached, so nothing was written.`}),null}finally{d()}}),u}async function zB(e,t,{selection:n=HN,live:r=Lg,send:i=fetch,notify:a=e=>tg.add({...e,type:`warning`})}={}){let o=t.frame;return await oB(o,async s=>{let c=s?await s:void 0;if(c===null)return null;let l=c!==void 0&&c.from.includes(t.hash)&&!c.shifted?c.to:t.hash,u=()=>{};try{let a=await uk([o],`delete`,async()=>{u=IN(o),RN(o,l);try{return await lx(`/api/frames/remove`,{ref:o,index:t.index,hash:l},`POST`,i)}catch(e){throw u(),e}},{live:r});return RN(o,a.hash),qz(o,a.hash),DN(n,e,[o]),{from:[l],to:a.hash,at:new Map,shifted:!0}}catch(e){return e instanceof nk||a({title:`Nothing deleted`,description:e instanceof cx?lB(e.message):`The board could not be reached, so nothing was written.`}),null}finally{u()}})!==null}var BB=new Map;function VB({frame:e,index:t}){return`${e}\n${t}`}async function HB(e,t,n,{selection:r=HN,live:i=Lg,send:a=fetch,notify:o=e=>tg.add({...e,type:`warning`}),inline:s}={}){let c=t.frame,l=n?`Nothing placed`:`Nothing moved`,u=BB.get(VB(t))??{},d=n?[]:[`width`,`height`].filter(e=>u[e]!==void 0&&s?.[e]===u[e]),f=i.getState().claims[c];return f?(o({title:l,description:`${f.tag} is editing ${c.split(`/`).at(-1)??c}, so nothing was written.`}),!1):await oB(c,async i=>{let s=i?await i:void 0;if(s===null)return null;let u=s!==void 0&&s.from.includes(t.hash)&&!s.shifted,f=u?s.to:t.hash,p=u?s.at.get(t.index)??t.index:t.index,m=IN(c);RN(c,f);try{let i=await lx(`/api/frames/place`,{ref:c,hash:f,index:p,spot:n,...d.length>0?{drop:d}:{}},`POST`,a);RN(c,i.hash),qz(c,i.hash),kN(r,e,{frame:c,index:i.index,hash:i.hash});let o=VB({frame:c,index:i.index});n?BB.set(o,Object.fromEntries(i.sized.map(e=>[e,`${n[e]??0}px`]))):BB.delete(o);let l=new Map(u?s.at:[]);return l.set(t.index,i.index),{from:u?[...s.from,f]:[f],to:i.hash,at:l,shifted:!1}}catch(e){return o({title:l,description:e instanceof cx?lB(e.message):`The board could not be reached, so nothing was written.`}),null}finally{m()}})!==null}function UB(){let e=document.activeElement;return!e||e===document.body||e.closest(`[data-canvas]`)!==null&&e.closest(`[data-note-marker], [data-note-card]`)===null}function WB(e){let{selection:t,mode:n}=e,r=()=>{let{page:r,frames:i,element:a}=t.getState(),o=i[0];if(n.getState().mode!==`edit`||r!==e.page()||i.length!==1||!o)return null;let s=e.treeOf(o);return!s||a&&a.hash!==s.hash?null:{page:r,frame:o,at:a?.index??null,tree:s}},i=e=>{let n=()=>{let t=r();if(!t)return;let n=e(t.tree.elements,t.at);return n===void 0?void 0:{...t,next:n}};return{enabled:()=>n()!==void 0,run:()=>{let e=n();if(!e)return;let{page:r,frame:i,next:a,tree:o}=e;if(a===null)DN(t,r,[i]);else{let e={frame:i,index:a,hash:o.hash};kN(t,r,e)}}}},a=e=>(t,n)=>n===null?void 0:e(t,n),o=t=>({enabled:()=>e.boardFocused()&&t.enabled(),run:t.run}),s=i(a(Xz)),c=()=>{let{page:r,element:i}=t.getState();return n.getState().mode===`edit`&&r===e.page()&&!!i},l=n=>({enabled:()=>c()&&e.writable()&&e.boardFocused(),run:()=>{let{page:r,element:i}=t.getState();r&&i&&e.move(r,i,e=>e+n)}}),u=n=>{let i=()=>{let e=r();if(!e||e.at===null)return!1;let t=Qz(e.tree.elements,e.at);if(!t)return!1;let i=n(t.place,t.count);return i!==t.place&&i>=0&&i<t.count};return{enabled:()=>c()&&e.writable()&&i(),run:()=>{let{page:r,element:i}=t.getState();r&&i&&e.move(r,i,n)}}};return[{id:`element.down`,label:`Select child`,group:`selection`,keys:[`Enter`],...o(i(Yz))},{id:`element.up`,label:`Select parent`,group:`selection`,keys:[`Escape`],enabled:()=>c()&&(e.noteOpen()||n.getState().tool===`move`&&s.enabled()),run:()=>{e.noteOpen()||s.run()}},{id:`element.delete`,label:`Delete`,group:`selection`,keys:[`Backspace`,`Delete`],enabled:()=>c()&&e.writable(),run:()=>{let{page:n,element:r}=t.getState();n&&r&&e.remove(n,r)}},{id:`element.moveUp`,label:`Move up among siblings`,group:`selection`,keys:[`Alt+Shift+ArrowUp`],...l(-1)},{id:`element.moveDown`,label:`Move down among siblings`,group:`selection`,keys:[`Alt+Shift+ArrowDown`],...l(1)},{id:`element.toFront`,label:`Bring to front`,group:`selection`,...u((e,t)=>t-1)},{id:`element.forward`,label:`Bring forward`,group:`selection`,...u(e=>e+1)},{id:`element.backward`,label:`Send backward`,group:`selection`,...u(e=>e-1)},{id:`element.toBack`,label:`Send to back`,group:`selection`,...u(()=>0)},{id:`element.next`,label:`Select next sibling`,group:`selection`,keys:[`Tab`],...o(i(a((e,t)=>Zz(e,t,1))))},{id:`element.previous`,label:`Select previous sibling`,group:`selection`,keys:[`Shift+Tab`],...o(i(a((e,t)=>Zz(e,t,-1))))}]}function GB(e){(0,_.useEffect)(()=>{let t=xe(WB({page:()=>e,selection:HN,mode:qg,treeOf:Wz,noteOpen:()=>bN.getState().open!==null,boardFocused:UB,writable:()=>Lg.getState().canWrite,remove:(e,t)=>void zB(e,t),move:(e,t,n)=>void FB(e,t,n)})),n=()=>{let{frames:e}=HN.getState();e.length===1&&e[0]&&Kz(e[0])};n();let r=[HN.subscribe(n),Lg.subscribe((e,t)=>{e.reloads!==t.reloads&&n()}),HN.subscribe(U),qg.subscribe(U),Lg.subscribe((e,t)=>{e.canWrite!==t.canWrite&&U()}),bN.subscribe(U),Uz.store.subscribe(U)];return()=>{for(let e of r)e();t()}},[e])}var KB=[{left:0,top:0},{left:`100%`,top:0},{left:0,top:`100%`},{left:`100%`,top:`100%`}];function qB({frames:e,container:t}){let n=UN(e=>e.element??null),r=e.find(e=>e.ref===n?.frame),i=rN(r?.ref??``),a=JB(t,n),o=i??r?.box;return!o||!a?null:(0,X.jsxs)(`div`,{"data-element-selection":!0,className:`pointer-events-none absolute`,style:{left:o.x+a.x,top:o.y+a.y,width:a.width,height:a.height,outline:cz,outlineOffset:sz(2),zIndex:Cz},children:[KB.map(e=>(0,X.jsx)(`span`,{"data-element-corner":!0,className:`absolute -translate-1/2 border-primary bg-white`,style:{...e,width:sz(7),height:sz(7),borderWidth:sz(1.5)}},`${e.left}-${e.top}`)),(0,X.jsx)(`span`,{"data-chip":!0,className:wz,children:lz(a)})]})}function JB(e,t){let[n,r]=(0,_.useState)(null),i=t?.frame,a=t?.index,o=t?.hash,s=t?`${i}:${a}:${o}`:null;return(0,_.useEffect)(()=>{if(!e||s===null||i===void 0||a===void 0)return;let t=e=>r({key:s,box:e}),n=()=>{},c=()=>{n();let r=e.querySelector(`[data-frame="${CSS.escape(i)}"] iframe`)?.contentDocument,s=r&&oz(r)===o?az(r,a):null,c=r?.defaultView;if(!s||!c){t(null);return}let l=()=>{let e=s.getBoundingClientRect();t({x:Math.round(e.left),y:Math.round(e.top),width:Math.round(e.width),height:Math.round(e.height)})};l();let u=new c.ResizeObserver(l);u.observe(s),u.observe(s.ownerDocument.documentElement),c.addEventListener(`scroll`,l,!0),n=()=>{u.disconnect(),c.removeEventListener(`scroll`,l,!0)}};return c(),e.addEventListener(`load`,c,!0),()=>{e.removeEventListener(`load`,c,!0),n()}},[e,s,i,a,o]),n?.key===s?n.box:null}function YB(e,t,n,r){let i=bB(e,t,n);if(!i||i.element===null)return null;let a=e.querySelector(`[data-frame="${CSS.escape(i.frame.ref)}"] iframe`)?.contentDocument,o=a?oz(a):null;if(!a||!o)return null;let s=r(i.frame.ref);if(s?.hash!==o)return null;for(let e=az(a,i.element);e&&e!==a.body;e=e.parentElement){let t=iz(a,e);if(t!==null&&s.elements.find(e=>e.index===t)?.tag===e.localName)return{frame:i.frame.ref,index:t,hash:o}}return null}async function XB(e,t,n,r){let i=bB(e,t,n);if(!i||i.element===null)return null;let a=await r(i.frame.ref);return a?YB(e,t,n,()=>a):null}function ZB(e,t,n,r){let i=0,a=0,o=!1,s=()=>{!o&&a!==i&&t.getState().canWrite&&(o=!0,a=i,r({tab:n,...QB(e.getState())}).catch(()=>{}).finally(()=>{o=!1,s()}))},c=()=>{i+=1,s()};c();let l=e.subscribe(c),u=t.subscribe((e,t)=>{e.canWrite&&!t.canWrite&&c()});return()=>{u(),l()}}function QB({page:e,frames:t,element:n}){return{page:e,frames:[...t],element:n?{ref:n.frame,index:n.index,hash:n.hash}:null}}function $B({className:e,...t}){return(0,X.jsx)(`kbd`,{"data-slot":`kbd`,className:Q(`pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm bg-muted px-1 font-sans text-xs font-medium text-muted-foreground select-none in-data-[slot=tooltip-content]:bg-background/20 in-data-[slot=tooltip-content]:text-background dark:in-data-[slot=tooltip-content]:bg-background/10 [&_svg:not([class*='size-'])]:size-3`,e),...t})}function eV({className:e,...t}){return(0,X.jsx)(`kbd`,{"data-slot":`kbd-group`,className:Q(`inline-flex items-center gap-1`,e),...t})}function tV({className:e,...t}){return(0,X.jsx)(`textarea`,{"data-slot":`textarea`,className:Q(`flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...t})}function nV(e){let{nativeEvent:t,currentTarget:n}=e;return t instanceof InputEvent&&(t.inputType===`historyUndo`||t.inputType===`historyRedo`)&&n.ownerDocument.activeElement!==n}var rV=/\r\n|\r|\n/g;function iV({text:e,disabled:t,write:n,element:r}){let[i,a]=(0,_.useState)(()=>rB(r)),[o,s]=(0,_.useState)(null);o&&o.over!==e&&s(null);let c=o?.over===e?o.value:null,[l,u]=(0,_.useState)(!1),d=(0,_.useRef)(!1),f=()=>{d.current?d.current=!1:i!==null&&(a(null),iB(r),i!==e&&(s({value:i,over:e}),n({kind:`text`,value:i}).then(e=>{e||(s(null),a(rB(r)))})))};return(0,X.jsxs)(`section`,{"aria-labelledby":`inspector-text`,className:`border-b border-sidebar-border px-3 pt-2.5 pb-3`,children:[(0,X.jsx)(`h2`,{id:`inspector-text`,className:`mb-2 text-xs font-semibold`,children:`Text`}),(0,X.jsx)(tV,{"aria-labelledby":`inspector-text`,value:i??c??e,disabled:t,onChange:e=>{nV(e)||a(e.currentTarget.value.replace(rV,` `))},onFocus:()=>u(!0),onBlur:()=>{u(!1),f()},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),e.shiftKey||f()),e.key===`Escape`&&(a(null),iB(r),d.current=!0,e.currentTarget.blur())},className:`max-h-28 min-h-11 resize-none overflow-y-auto rounded-md border-0 bg-input px-2 py-1.5 text-xs leading-[1.4] md:text-xs dark:bg-input`}),(0,X.jsxs)(`p`,{className:Q(`mt-2.5 flex items-center gap-1 text-(length:--text-caption) font-normal text-muted-foreground`,!l&&`invisible`),children:[(0,X.jsx)($B,{children:`Enter`}),` to apply, `,(0,X.jsx)($B,{children:`Esc`}),` to cancel`]})]})}var aV=`data-frameboard-editing`;function oV(e,t,n){let r=e.defaultView,i=az(e,t.index);if(!r||oz(e)!==t.hash||!(i instanceof r.HTMLElement)||i.childElementCount>0||(i.textContent??``).trim()===``)return null;let a=i,o=a.textContent??``,s=!0,c=()=>{s=!1,a.removeAttribute(`contenteditable`),a.removeAttribute(aV),a.removeEventListener(`keydown`,d),a.removeEventListener(`paste`,f),a.removeEventListener(`blur`,u),r.removeEventListener(`pagehide`,c)},l=()=>{s&&(c(),a.textContent=o)};function u(){if(!s)return;c();let e=(a.textContent??``).replace(rV,` `);a.textContent=e,e!==o&&n({kind:`text`,value:e}).then(e=>{!e&&a.isConnected&&(a.textContent=o)})}function d(e){e.key===`Enter`&&(e.preventDefault(),e.shiftKey?p(` `):u()),e.key===`Escape`&&(e.preventDefault(),l())}function f(e){e.preventDefault(),p((e.clipboardData?.getData(`text/plain`)??``).replace(rV,` `))}let p=t=>{let n=r.getSelection()?.getRangeAt(0);if(!n||!a.contains(n.commonAncestorContainer))return;n.deleteContents();let i=e.createTextNode(t);n.insertNode(i),n.setStartAfter(i),n.collapse(!0),a.normalize()};a.setAttribute(`contenteditable`,`plaintext-only`),a.setAttribute(aV,``),a.addEventListener(`keydown`,d),a.addEventListener(`paste`,f),a.addEventListener(`blur`,u),r.addEventListener(`pagehide`,c),a.focus();let m=e.createRange();m.selectNodeContents(a);let h=r.getSelection();return h?.removeAllRanges(),h?.addRange(m),l}function sV(e,t){return e.querySelector(`[data-frame="${CSS.escape(t)}"] iframe`)?.contentDocument??null}function cV(e,t,n,r){let i=t.find(e=>e.ref===n.frame),a=i&&sV(e,i.ref),o=a&&az(a,n.index);if(!i||!o)return!1;let s=o.getBoundingClientRect(),c=r.x-i.box.x,l=r.y-i.box.y;return c>=s.left&&c<s.right&&l>=s.top&&l<s.bottom}function lV(e,t,n,r){let i=null,a=()=>{e.removeEventListener(`load`,o,!0),s()};function o(){let r=sV(e,t.frame);i=r?oV(r,t,n):null,i&&a()}let s=r.subscribe(({element:e})=>{(e?.frame!==t.frame||e.index!==t.index)&&a()});return e.addEventListener(`load`,o,!0),o(),()=>{a(),i?.()}}function uV({name:e,label:t,onCommit:n,onCancel:r,hug:i=!1,clearable:a=!1}){let o=(0,_.useRef)(null),s=(0,_.useRef)(!1),[c,l]=(0,_.useState)(e);(0,_.useEffect)(()=>{o.current?.focus(),o.current?.select()},[]);let u=t=>{if(s.current)return;s.current=!0;let i=o.current?.value.trim()??``;t&&(a||i!==``)&&i!==e?n(i):r()},d=(0,X.jsx)(`input`,{ref:o,"aria-label":t,value:c,onChange:e=>l(e.target.value),size:i?1:void 0,spellCheck:!1,onClick:e=>e.preventDefault(),onKeyDown:e=>{if(e.key===`Enter`)u(!0);else if(e.key===`Escape`)u(!1);else return;e.preventDefault(),e.stopPropagation()},onBlur:()=>u(!0),className:Q(`h-[22px] min-w-0 rounded-[5px] bg-background px-1.5 text-foreground ring-[1.5px] ring-primary outline-none selection:bg-primary/45`,i?`col-start-1 row-start-1 w-full`:`-ml-1.5 flex-1`)});return i?(0,X.jsxs)(`span`,{className:`-ml-1.5 inline-grid max-w-[calc(100%+0.375rem)] min-w-0 grid-cols-[minmax(0,auto)]`,children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:`invisible col-start-1 row-start-1 h-0 px-1.5 whitespace-pre`,children:`${c} `}),d]}):d}var dV=_.createContext(void 0);function fV(e){let t=_.useContext(dV);if(t===void 0&&!e)throw Error(La(47));return t}var pV={...ep,disabled:e=>e.disabled,instantType:e=>e.instantType===`trigger-change`&&!ep.open(e)?void 0:e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,isPressOpenedByTrigger:(e,t)=>e.openChangeReason===`trigger-press`&&ep.isOpenedByTrigger(e,t),isTouchPressOpen:(e,t)=>t&&e.openMethod===`touch`&&e.openChangeReason===`trigger-press`,hasTriggerFocusGuards:(e,t)=>ep.isOpenedByTrigger(e,t)&&!e.focusManagerModal,modal:e=>e.modal,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},mV=class extends lo{constructor(e,t,n){let r=new Gf;super(hV(e,r,t,n),gV(r),pV)}setOpen=(e,t)=>{let n=t.reason===ed,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null),a=Rf(t),o=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&o!=null&&(t.trigger=this.context.triggerElements.getById(o)??this.select(`activeTriggerElement`)??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let s=()=>{let n=Lf(this.state,e,t.trigger,a());n.openChangeReason=t.reason,this.update(n)};n?(this.context.stickIfOpen=!0,this.context.stickIfOpenTimeout.start(500,()=>{this.context.stickIfOpen=!1}),tu.flushSync(s)):s();let c;r?c=`click`:i?c=`dismiss`:t.reason===`focus-out`&&(c=`focus`),this.set(`instantType`,c)}};function hV(e,t,n,r=!1){let i={...Jf(t,n,r),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return i.open&&e?.mounted===void 0&&(i.mounted=!0),i}function gV(e){return{popupRef:_.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:_.createRef(),beforeTriggerFocusGuardRef:_.createRef(),beforeContentFocusGuardRef:_.createRef(),stickIfOpenTimeout:new Uo,stickIfOpen:!0,triggerElements:e}}var _V=Ja(function({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=yV(s,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});u.useControlledProp(`openProp`,n),u.useControlledProp(`triggerIdProp`,c);let d=u.useState(`open`),f=u.useState(`mounted`),p=u.useState(`payload`);u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a),Wf(u,d),Vf(u);let{forceUnmount:m}=Hf(d,u,()=>{u.context.stickIfOpen=!0,u.set(`openChangeReason`,null)});u.useSyncedValues({modal:o}),_.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]),_.useImperativeHandle(e.actionsRef,()=>({unmount:m,close:()=>u.setOpen(!1,Z(Cd))}),[m,u]);let h=d||f||s!=null;return(0,X.jsxs)(dV.Provider,{value:u,children:[s&&(0,X.jsx)(Pf,{handle:s,store:u}),h&&(0,X.jsx)(bV,{store:u,modal:o}),typeof t==`function`?t({payload:p}):t]})});function vV(e){return fV(!0)?(0,X.jsx)(_V,{props:e}):(0,X.jsx)(df,{children:(0,X.jsx)(_V,{props:e})})}function yV(e,t){let n=Nf((e,n)=>new mV(t,e,n));return _.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function bV({store:e,modal:t}){let n=Df(e.useState(`floatingRootContext`),{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),r=n.reference,i=n.floating;return Uf(e,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:i}),null}function xV(e){return Fu(e,`base-ui`)}function SV(e,t){function n(n,r,i){let a=n.currentTarget;tu.flushSync(()=>{e.setOpen(!1,Z(ud,n.nativeEvent,a))}),nl(a.isConnected?a:t.current,r,i)?.focus()}function r(t){n(t,-1,e.select(`positionerElement`))}function i(t){let r=e.select(`positionerElement`);r&&rl(t,r)?e.context.beforeContentFocusGuardRef.current?.focus():n(t,1,r)}return{handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function CV(e){let t=_.useRef(``),n=_.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:_.useCallback(n=>{n.detail===0?e(n,`keyboard`):(`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``)},[e]),onPointerDown:n}}function wV(e,t){let n=_.useRef(e),r=K(t);G(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function TV(e,t){let{onClick:n,onPointerDown:r}=CV(K((n,r)=>{(typeof e==`function`?e():e)||t(r||(ns?`touch`:``))}));return _.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function EV(e){let[t,n]=_.useState(null),r=TV(e,n);return wV(e,t=>{t&&!e&&n(null)}),_.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}var DV=Ya(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,handle:s,payload:c,openOnHover:l=!1,delay:u=300,closeDelay:d=0,id:f,...p}=e,m=fV(!0),h=tp(s)??m;if(!h)throw Error(La(74));let g=xV(f),v=h.useState(`isTriggerActive`,g),y=h.useState(`floatingRootContext`),b=h.useState(`isOpenedByTrigger`,g),x=h.useState(`triggerPopupId`,g),S=_.useRef(null),{registerTrigger:C,isMountedByThisTrigger:w}=Bf(g,S,h,{payload:c,disabled:a,openOnHover:l,closeDelay:d}),T=h.useState(`isPressOpenedByTrigger`,g),E=h.useState(`isTouchPressOpen`,l),D=h.useState(`hasTriggerFocusGuards`,g),O=dp(y,{enabled:!a&&l&&!E,mouseOnly:!0,move:!1,handleClose:Dp(),restMs:u,delay:{close:d},triggerElementRef:S,isActiveTrigger:v,isClosing:()=>h.select(`transitionStatus`)===`ending`}),k=xf(y,{stickIfOpen:K(()=>h.context.stickIfOpen)}),A=TV(()=>h.select(`open`),e=>{h.set(`openMethod`,e)}),j=h.useState(`triggerProps`,w),{getButtonProps:M,buttonRef:N}=Ku({disabled:a,native:o}),P={open(e){return T?Is.open(e):Fs.open(e)}},{handlePreFocusGuardFocus:F,handleFocusTargetFocus:I}=SV(h,S),L=Vl(`button`,e,{state:{disabled:a,open:b},ref:[N,t,C,S],props:[k.reference,O,j,A,{[su]:``,id:g,"aria-haspopup":`dialog`,"aria-expanded":b,"aria-controls":x},p,M],stateAttributesMapping:P}),R=(0,X.jsx)(_.Fragment,{children:L},g);return D?(0,X.jsxs)(_.Fragment,{children:[(0,X.jsx)(hl,{ref:h.context.beforeTriggerFocusGuardRef,onFocus:F}),R,(0,X.jsx)(hl,{ref:h.context.triggerFocusTargetRef,onFocus:I})]}):R}),OV=_.createContext(void 0);function kV(){let e=_.useContext(OV);if(e===void 0)throw Error(La(45));return e}var AV=_.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return fV().useState(`mounted`)||n?(0,X.jsx)(OV.Provider,{value:n,children:(0,X.jsx)(kd,{ref:t,...r})}):null}),jV=_.createContext(void 0);function MV(){let e=_.useContext(jV);if(!e)throw Error(La(46));return e}var NV=_.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,X.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});function PV(e){let{store:t,domReference:n,positionerElement:r,open:i}=e,a=_.useRef(null),o=_.useRef(null),s=iu(r);G(()=>{i||(o.current?.abort(),o.current=null,t.state.instantType===`trigger-change`&&t.set(`instantType`,void 0))},[i,t]),G(()=>{let e=n,r=a.current;if(e&&(a.current=e),!r||!e||e===r||!t.select(`open`))return;t.set(`instantType`,void 0);let i=new AbortController;return o.current=i,s(()=>{t.select(`open`)&&t.set(`instantType`,`trigger-change`)},i.signal),()=>{i.abort()}},[n,s,t])}var FV={},IV={},LV=``;function RV(e,t){return yo(e)?e:t}function zV(e,t,n){return/hidden|clip/.test(e.getComputedStyle(RV(t,n)).overflowY)}function BV(e){if(typeof document>`u`)return!1;let t=q(e);return po(t).innerWidth-t.documentElement.clientWidth>0}function VV(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=q(e),n=t.documentElement,r=t.body,i=RV(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function HV(e){let t=q(e),n=t.documentElement,r=t.body,i=RV(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function UV(e){let t=q(e),n=t.documentElement,r=t.body,i=po(n),a=0,o=0,s=!1,c=Bo.create();if(ss&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,FV={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},LV=n.style.scrollBehavior,IV={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=RV(n,r);s=VV(e),s?(n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`):(Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`)}function u(){Object.assign(n.style,FV),Object.assign(r.style,IV),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=LV)}function d(){u(),c.request(l)}l();let f=J(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var WV=new class{lockCount=0;restore=null;timeoutLock=Uo.create();timeoutUnlock=Uo.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=q(e),n=t.documentElement,r=t.body,i=po(n);if(zV(i,n,r)){let t=new i.MutationObserver(()=>{zV(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=ns||!BV(e);this.restore=a?HV(e):UV(e)}};function GV(e=!0,t=null){G(()=>{if(e)return WV.acquire(t)},[e,t])}var KV=20;function qV(e,t,n,r){let[i,a]=_.useState(!1);G(()=>{if(!e||!t||n==null){a(!1);return}let r=q(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-KV)},[e,t,n]),GV(e&&(!t||i),r)}var JV=_.forwardRef(function(e,t){let{render:n,className:r,style:i,anchor:a,positionMethod:o,side:s,align:c,sideOffset:l,alignOffset:u,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f,arrowPadding:p,sticky:m,disableAnchorTracking:h=!1,collisionAvoidance:g=pu,..._}=e,v=fV(),y=kV(),b=lf(),x=v.useState(`floatingRootContext`),S=v.useState(`mounted`),C=v.useState(`open`),w=v.useState(`openChangeReason`),T=v.useState(`activeTriggerElement`),E=v.useState(`modal`),D=v.useState(`openMethod`),O=v.useState(`positionerElement`),k=v.useState(`instantType`),A=v.useState(`transitionStatus`),j=qm({anchor:a,floatingRootContext:x,positionMethod:o,mounted:S,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:m,disableAnchorTracking:h,keepMounted:y,nodeId:b,collisionAvoidance:g,adaptiveOrigin:v.useState(`adaptiveOrigin`)});PV({store:v,domReference:x.useState(`domReferenceElement`),positionerElement:O,open:C});let M=E===!0&&w!==`trigger-hover`;qV(C&&M,D===`touch`,O,T);let N=v.useStateSetter(`positionerElement`),P=Zm(e,{open:C,side:j.side,align:j.align,anchorHidden:j.anchorHidden,instant:k},{styles:j.positionerStyles,transitionStatus:A,props:_,refs:[t,N],hidden:!S,inert:!C});return(0,X.jsxs)(jV.Provider,{value:j,children:[S&&M&&(0,X.jsx)(NV,{inert:Xl(!C),cutout:T}),(0,X.jsx)(uf,{id:b,children:P})]})}),YV=`ArrowUp`,XV=`ArrowDown`,ZV=`ArrowLeft`,QV=`ArrowRight`,$V=`Home`,eH=`PageUp`,tH=`PageDown`,nH=new Set([YV,XV,ZV,QV,$V,`End`]),rH=[`Shift`,`Control`,`Alt`,`Meta`];function iH(e){return _o(e)&&e.tagName===`INPUT`}function aH(e){return!!(iH(e)&&e.selectionStart!=null||_o(e)&&e.tagName===`TEXTAREA`)}function oH(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop,o=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(o&&r!==`vertical`){let r=sH(e,t,`left`),a=cH(e),o=cH(t);n===`ltr`&&(r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(i=r-o.scrollMarginLeft-a.scrollPaddingLeft)),n===`rtl`&&(r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft?i=r-o.scrollMarginLeft-a.scrollPaddingLeft:r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(s&&r!==`horizontal`){let n=sH(e,t,`top`),r=cH(e),i=cH(t);n-i.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?a=n-i.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+i.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(a=n+t.offsetHeight+i.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:`auto`})}function sH(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function cH(e){let t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}var lH=_.createContext(void 0);function uH(e){let t=_.useContext(lH);if(t===void 0&&!e)throw Error(La(69));return t}var dH=_.createContext(void 0);function fH(){let[e,t]=_.useState(0),n=K(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:_.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}var pH=_.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=fV(),l=MV(),u=uH(!0)!=null,{context:d,hasClosePart:f}=fH(),p=c.useState(`open`),m=c.useState(`openMethod`),h=c.useState(`instantType`),g=c.useState(`transitionStatus`),_=c.useState(`popupProps`),v=c.useState(`titleElementId`),y=c.useState(`descriptionElementId`),b=c.useState(`modal`),x=c.useState(`mounted`),S=c.useState(`openChangeReason`),C=c.useState(`activeTriggerElement`),w=c.useState(`floatingRootContext`),T=w.useState(`floatingId`),E=c.useState(`disabled`),D=c.useState(`openOnHover`),O=c.useState(`closeDelay`);au({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}}),lp(w,{enabled:D&&!E,closeDelay:O});let k=a===void 0?Mf(c.context.popupRef):a,A=b!==!1&&f;c.useSyncedValue(`focusManagerModal`,A);let j=c.useStateSetter(`popupElement`),M=Vl(`div`,e,{state:{open:p,side:l.side,align:l.align,instant:h,transitionStatus:g},ref:[t,c.context.popupRef,j],props:[_,{id:T,role:`dialog`,...jf,"aria-labelledby":v,"aria-describedby":y,onKeyDown(e){u&&nH.has(e.key)&&e.stopPropagation()}},Xm(g),s],stateAttributesMapping:Rs});return(0,X.jsx)(bf,{context:w,openInteractionType:m,modal:A,disabled:!x||S===`trigger-hover`,initialFocus:k,returnFocus:o,restoreFocus:`popup`,getInsideElements:()=>[c.context.beforeTriggerFocusGuardRef.current],previousFocusableElement:_o(C)?C:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:(0,X.jsx)(dH.Provider,{value:d,children:M})})}),mH=_.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=fV(),s=xV(a.id);return o.useSyncedValueWithCleanup(`titleElementId`,s),Vl(`h2`,e,{ref:t,props:[{id:s},a]})});function hH({...e}){return(0,X.jsx)(vV,{"data-slot":`popover`,...e})}function gH({...e}){return(0,X.jsx)(DV,{"data-slot":`popover-trigger`,...e})}function _H({className:e,align:t=`center`,alignOffset:n=0,side:r=`bottom`,sideOffset:i=4,anchor:a,...o}){return(0,X.jsx)(AV,{children:(0,X.jsx)(JV,{align:t,alignOffset:n,side:r,sideOffset:i,anchor:a,className:`isolate z-50`,children:(0,X.jsx)(pH,{"data-slot":`popover-content`,className:Q(`z-50 flex w-72 origin-(--transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...o})})})}function vH({className:e,...t}){return(0,X.jsx)(mH,{"data-slot":`popover-title`,className:Q(`font-medium`,e),...t})}function yH(){return N()(()=>({ref:null,mode:`flip`,hash:null,split:.5}))}var bH=yH();function xH(e){return F(bH,e)}var SH={compare:bH,unseen:j_,held:async(e,t)=>{try{return(await fetch(bM(e,`light`,void 0,t),{cache:`no-store`})).ok}catch{return!1}}};async function CH(e,t,{compare:n,unseen:r,held:i}=SH){let a=r.getState().base[e];if(!a)return;let o=n.getState();o.ref===e&&o.hash===a?n.setState({mode:t}):await i(e,a)?r.getState().base[e]===a&&n.setState({ref:e,mode:t,hash:a,split:.5}):(x_(r,e),tg.add({title:`The version before is gone`,description:`The server keeps it until it restarts or 200 later changes land.`,type:`warning`}))}function wH(e=bH){e.getState().ref!==null&&e.setState({ref:null,hash:null})}function TH(e,t=bH){let{ref:n}=t.getState(),r=n&&document.querySelector(`[data-frame="${CSS.escape(n)}"]`);if(!r)return;let{left:i,width:a}=r.getBoundingClientRect();a<=0||t.setState({split:Math.min(1,Math.max(0,(e-i)/a))})}var EH={...SH,selection:HN,mode:qg};function DH(e=EH){(0,_.useEffect)(()=>{let{compare:t,unseen:n,selection:r,mode:i}=e,a=()=>i.getState().mode===`edit`,o=()=>{let{frames:e}=r.getState(),[t]=e;return e.length===1&&t&&n.getState().base[t]?t:null},s=e=>()=>{let n=t.getState();return n.ref!==null&&n.mode===e},c=t=>()=>{let n=o();n&&CH(n,t,e)},l=xe([{id:`frame.compare`,label:`Compare with before`,group:`frame`,command:{label:`Compare with before`,icon:Sn},enabled:()=>a()&&o()!==null,checked:s(`flip`),run:c(`flip`)},{id:`frame.compare.split`,label:`Split with before`,group:`frame`,command:{label:`Split with before`,icon:qt},enabled:()=>a()&&o()!==null,checked:s(`split`),run:c(`split`)},{id:`frame.compare.end`,label:`End compare`,group:`frame`,keys:[`Escape`],command:{label:`End compare`,icon:Ii},enabled:()=>t.getState().ref!==null,run:()=>wH(t)}]),u=[t.subscribe(U),n.subscribe(e=>{let{ref:n,hash:r}=t.getState();n&&e.base[n]!==r&&wH(t),U()}),r.subscribe(()=>wH(t)),i.subscribe(e=>{(e.mode===`play`||e.tool===`note`)&&wH(t)})];return()=>{for(let e of u)e();l(),wH(t)}},[e])}var OH=.05;function kH({frameRef:e,name:t,hash:n}){let r=xH(e=>e.mode),i=xH(e=>e.split),a=MM(e),o=(0,_.useRef)(null),s=(0,_.useMemo)(()=>bM(e,AM(e),void 0,n),[e,n]);(0,_.useEffect)(()=>{let e=o.current;if(!e)return;let t=()=>{let t=e.contentDocument?.documentElement;t&&vM(t,a)};return t(),e.addEventListener(`load`,t),()=>e.removeEventListener(`load`,t)},[a]);let c=r===`split`,l=`${Math.round(i*1e3)/10}%`;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{"data-compare-before":e,className:`absolute inset-0 overflow-hidden`,style:c?{clipPath:`inset(0 calc(100% - ${l}) 0 0)`}:void 0,children:(0,X.jsx)(`iframe`,{ref:o,title:`${t} before`,src:s,tabIndex:-1,style:{colorScheme:a},className:`block size-full border-0 bg-[color:Canvas]`})}),(0,X.jsx)(AH,{side:`left`,children:`Before`}),c?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(AH,{side:`right`,children:`Now`}),(0,X.jsx)(jH,{frameRef:e,name:t,at:i,percent:l})]}):null]})}function AH({side:e,children:t}){return(0,X.jsx)(`span`,{"aria-hidden":!0,className:Q(`pointer-events-none absolute bottom-[calc(6px/var(--zoom,1))] flex h-[18px] items-center rounded-[9px] bg-[color-mix(in_srgb,var(--claim)_22%,var(--card))] px-1.5 text-label font-medium text-claim [transform:scale(calc(1/var(--zoom,1)))]`,e===`left`?`left-[calc(6px/var(--zoom,1))] origin-bottom-left`:`right-[calc(6px/var(--zoom,1))] origin-bottom-right`),children:t})}function jH({frameRef:e,name:t,at:n,percent:r}){let i=e=>bH.setState({split:Math.min(1,Math.max(0,e))});return(0,X.jsx)(`div`,{"data-compare-divider":e,role:`slider`,tabIndex:0,"aria-label":`Split between ${t} before and now`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(n*100),"aria-valuetext":`${Math.round(n*100)}% before`,onKeyDown:e=>{let t={ArrowLeft:-.05,ArrowDown:-.05,ArrowRight:OH,ArrowUp:OH}[e.key];if(t!==void 0)i(n+t);else if(e.key===`Home`)i(0);else if(e.key===`End`)i(1);else return;e.preventDefault(),e.stopPropagation()},className:`absolute top-0 bottom-0 w-[calc(2px/var(--zoom,1))] -translate-x-1/2 bg-claim outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,style:{left:r},children:(0,X.jsx)(`span`,{"aria-hidden":!0,className:`absolute top-1/2 left-1/2 h-7 w-3.5 rounded-[7px] bg-card shadow-[0_0_0_2px_var(--claim)] [transform:translate(-50%,-50%)_scale(calc(1/var(--zoom,1)))]`})})}var MH=[{value:`now`,label:`Now`},{value:`flip`,label:`Before`},{value:`split`,label:`Split`}];function NH({frameRef:e,name:t}){let n=xH(t=>t.ref===e),r=xH(e=>e.mode),i=t=>{t===`now`?wH():CH(e,t)};if(!n)return(0,X.jsx)(`button`,{type:`button`,"data-label-control":!0,"aria-label":`Compare ${t} with before`,title:`Compare with before`,onClick:()=>i(`flip`),className:`grid size-[18px] shrink-0 place-items-center rounded-[5px] bg-secondary text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50`,children:(0,X.jsx)(Sn,{"aria-hidden":!0,className:`size-3`})});let a=r;return(0,X.jsx)(`div`,{role:`radiogroup`,"aria-label":`Compare ${t}`,onKeyDown:t=>{let n={ArrowLeft:-1,ArrowUp:-1,ArrowRight:1,ArrowDown:1}[t.key];if(n===void 0)return;t.preventDefault(),t.stopPropagation();let r=MH[(MH.findIndex(e=>e.value===a)+n+MH.length)%MH.length];r&&(i(r.value),r.value!==`now`&&requestAnimationFrame(()=>document.querySelector(`[data-compare-option="${CSS.escape(`${e}:${r.value}`)}"]`)?.focus()))},className:`flex shrink-0 gap-px rounded-md bg-secondary p-0.5`,children:MH.map(({value:t,label:n})=>{let r=t===a;return(0,X.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":r,tabIndex:r?0:-1,"data-label-control":!0,"data-compare-option":`${e}:${t}`,onClick:()=>i(t),className:Q(`flex h-4 items-center rounded px-1.5 font-medium outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,r?`bg-card text-foreground shadow-[0_0_0_1px_var(--border)]`:`text-muted-foreground hover:text-foreground`),children:n},t)})})}function PH(){return(0,X.jsx)(`span`,{role:`img`,"aria-label":`Unseen change`,"data-unseen":!0,className:`inline-block size-[7px] shrink-0 rounded-full bg-claim`})}function FH({claim:e}){let t=Pz(),n=`${Az(e.tag)}${e.tag.slice(1)}`;return(0,X.jsxs)(`span`,{"data-claim-tag":!0,className:`inline-flex min-w-0 items-center gap-1.5 rounded-full bg-[color-mix(in_srgb,var(--claim)_18%,transparent)] py-0.5 pr-2 pl-[3px] font-medium text-[color-mix(in_srgb,var(--claim)_70%,var(--foreground))] motion-safe:animate-claim-tag`,children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:`grid size-4 shrink-0 place-items-center rounded-full bg-claim text-[9px] font-bold text-card motion-safe:animate-claim-dot`,children:Az(e.agent)}),(0,X.jsxs)(`span`,{className:`truncate`,children:[n,(0,X.jsxs)(`span`,{"data-claim-elapsed":!0,className:`ml-1.5 font-normal text-[color-mix(in_srgb,var(--muted-foreground)_60%,var(--foreground))]`,children:[`editing · `,Nz(e.claimedAt,t)]})]})]})}function IH({findings:e}){return(0,X.jsx)(`ul`,{className:`flex flex-col`,children:e.map((e,t)=>(0,X.jsxs)(`li`,{"data-severity":e.severity,className:`grid grid-cols-[14px_1fr] gap-1.5 rounded-md p-1.5 hover:bg-accent data-[severity=error]:[--h:var(--destructive)] data-[severity=warning]:[--h:var(--note)]`,children:[(0,X.jsx)(Si,{role:`img`,"aria-label":e.severity===`error`?`Error`:`Warning`,className:`mt-px size-[11px] text-[var(--h)]`,strokeWidth:2}),(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsxs)(`p`,{className:`text-xs break-words`,children:[(0,X.jsx)(`span`,{className:`font-semibold`,children:e.rule}),(0,X.jsx)(LH,{finding:e})]}),(0,X.jsx)(`p`,{className:`mt-0.5 text-[11px] break-words text-muted-foreground`,children:e.message})]})]},`${e.rule}:${e.location?.startOffset??``}:${t}`))})}function LH({finding:e}){let t=[RH(e),e.location?`line ${e.location.line}`:null].filter(Boolean).join(`, `);return t?(0,X.jsxs)(`span`,{className:`text-muted-foreground`,children:[` · `,t]}):null}function RH(e){if(e.frame===null||e.path===`${e.frame}.html`)return null;let t=`${e.frame.split(`/`)[0]}/`;return e.path.startsWith(t)?e.path.slice(t.length):e.path}var zH=N()(()=>({ref:null}));function BH(e){zH.setState({ref:e})}function VH(e){return F(zH,t=>t.ref===e)}function HH(e,t){let n=e.contentDocument;if(!n?.body)return null;let r=e.style.height;try{e.style.height=`1px`;let r=UH(n);return e.style.height=`${t}px`,r===UH(n)?r:null}finally{e.style.height=r}}function UH(e){let t=e.defaultView;if(!t)return 1;let n=e=>{let n=t.getComputedStyle(e);return n.overflowX!==`visible`||n.overflowY!==`visible`},r=t=>{for(let r=t.parentElement;r&&r!==e.body;r=r.parentElement)if(n(r))return!0;return!1},i=(e,t)=>e<t?(t-e)/2:0,a=r=>{let a=-1/0;if(n(r))return a;let o=parseFloat(t.getComputedStyle(r).lineHeight);for(let n of r.childNodes){if(n.nodeType!==t.Node.TEXT_NODE)continue;let r=e.createRange();r.selectNodeContents(n);for(let e of r.getClientRects())(e.width!==0||e.height!==0)&&(a=Math.max(a,e.bottom-i(o,e.height)))}return a},o=[`img`,`video`,`canvas`,`iframe`,`object`,`embed`,`audio`],s=e=>{let n=e.getBoundingClientRect();if(e.namespaceURI!==`http://www.w3.org/1999/xhtml`||o.includes(e.localName))return n.bottom;let r=t.getComputedStyle(e);if(r.display!==`inline`||parseFloat(r.paddingBottom)+parseFloat(r.borderBottomWidth)>0)return n.bottom;let a=parseFloat(r.paddingTop)+parseFloat(r.borderTopWidth);return n.bottom-i(parseFloat(r.lineHeight),n.height-a)},c=e.documentElement.getBoundingClientRect().bottom;for(let t of e.querySelectorAll(`body *`))r(t)||(c=Math.max(c,s(t),a(t)));return Math.max(1,Math.ceil(c+t.scrollY))}function WH(){return N()(()=>({held:0}))}var GH=WH(),KH=N()(()=>({ref:null,surface:`layers`}));function qH(e){return F(KH,t=>t.surface===e?t.ref:null)}function JH(e,t){KH.setState({ref:e,surface:t})}function YH(){KH.setState({ref:null})}async function XH(e,t,n=gk){try{await n.renameFrame(e.ref,t)}catch(t){Ck(`Couldn't rename ${e.name}`)(t)}}function ZH(e){let{selection:t,mode:n,live:r,clipboard:i,calls:a}=e,o=()=>n.getState().mode===`edit`&&r.getState().canWrite&&!t.getState().element,s=()=>{let{page:n,frames:r}=t.getState();return n===e.page()?e.frames().filter(e=>r.includes(e.ref)):[]},c=()=>s().map(e=>e.ref),l=()=>o()&&s().length>0,u=()=>l()&&s().every(e=>!e.locked),d=n=>DN(t,e.page(),n.map(e=>e.ref)),f=e=>e.length===1?e[0]?.name??``:`${e.length} frames`,p=(e,t)=>n=>{i.setState(n),tg.add({title:`${e} ${f(t)}`,description:`Paste with ${V(`$mod+KeyV`)} on any page.`,type:`success`})};return[{id:`frame.rename`,label:`Rename frame`,group:`frame`,keys:[`F2`],command:{label:`Rename frame`,icon:br},enabled:()=>o()&&s().length===1&&!n.getState().hideUi,run:()=>{let[e]=s();e&&(n.setState({tool:`move`}),JH(e.ref,`inspector`))}},{id:`frame.duplicate`,label:`Duplicate`,group:`frame`,command:{label:`Duplicate frame`,icon:Zt},keys:[`$mod+KeyD`],enabled:l,run:()=>{let e=s();a.duplicateFrames(c()).then(d,Ck(`Couldn't duplicate ${f(e)}`))}},{id:`frame.delete`,label:`Delete`,group:`frame`,command:{label:`Delete frame`,icon:bi},keys:[`Backspace`,`Delete`],enabled:u,run:()=>{let e=s();a.deleteFrames(c()).catch(Ck(`Couldn't delete ${f(e)}`))}},{id:`frame.hide`,label:`Hide`,group:`frame`,command:{label:`Hide frame`,icon:on},keys:[`$mod+Shift+KeyH`],enabled:l,run:()=>{let e=s();a.flagFrames(c(),`hidden`,!0).catch(Ck(`Couldn't hide ${f(e)}`))}},{id:`frame.lock`,label:`Lock`,group:`frame`,command:{label:`Lock or unlock frame`,icon:Qn},keys:[`$mod+Shift+KeyL`],enabled:l,checked:()=>{let e=s();return e.length>0&&e.every(e=>e.locked)},run:()=>{let e=s(),t=!e.every(e=>e.locked);a.flagFrames(c(),`locked`,t).catch(Ck(`Couldn't ${t?`lock`:`unlock`} ${f(e)}`))}},{id:`frame.copy`,label:`Copy`,group:`frame`,command:{label:`Copy frame`,icon:$t},keys:[`$mod+KeyC`],enabled:l,run:()=>{let e=s();a.copyFrames(c()).then(p(`Copied`,e),Ck(`Couldn't copy ${f(e)}`))}},{id:`frame.cut`,label:`Cut`,group:`frame`,command:{label:`Cut frame`,icon:Kr},keys:[`$mod+KeyX`],enabled:u,run:()=>{let e=s();a.cutFrames(c()).then(p(`Cut`,e),Ck(`Couldn't cut ${f(e)}`))}},{id:`frame.paste`,label:`Paste`,group:`frame`,command:{label:`Paste frames`,icon:Ut},keys:[`$mod+KeyV`],enabled:()=>o()&&i.getState().held>0,run:()=>{a.pasteFrames(e.page()).then(d,Ck(`Couldn't paste`))}}]}function QH(e,t){let n=(0,_.useRef)(e),r=(0,_.useRef)(t);(0,_.useEffect)(()=>{n.current=e,r.current=t},[e,t]),(0,_.useEffect)(()=>{let e=xe(ZH({page:()=>n.current,frames:()=>r.current,selection:HN,mode:qg,live:Lg,clipboard:GH,calls:gk})),t=[HN.subscribe(U),qg.subscribe(U),GH.subscribe(U),Lg.subscribe((e,t)=>{!e.connected&&t.connected&&GH.setState({held:0}),U()})];return()=>{for(let e of t)e();e()}},[])}var $H=[`Escape`],eU=(0,_.memo)(function({frame:e,live:t,version:n,findings:r,claim:i,unseen:a=!1}){let{x:o,y:s,width:c,height:l}=oN(e),u=(rN(e.ref)??e.box).width,d=zM(e.ref),f=qH(`canvas`)===e.ref,p=UN(t=>t.frames.includes(e.ref)),m=(0,_.useRef)(null),h=Jg(e=>e.mode===`play`),g=MM(e.ref),v=VH(e.ref),y=M_(t=>e.ref in t.base),b=xH(t=>t.ref===e.ref?t.hash:null),x=(0,_.useRef)(e.modifiedAt);(0,_.useEffect)(()=>{x.current=e.modifiedAt},[e.modifiedAt]);let[S,C]=(0,_.useState)({ref:e.ref,version:n,live:t});(S.version!==n||S.live!==t)&&C({ref:e.ref,version:n,live:t});let w=(0,_.useMemo)(()=>S.live?bM(S.ref,AM(S.ref),S.version):null,[S]);(0,_.useEffect)(()=>{let e=m.current;if(!t||!e)return;let n=()=>{let t=e.contentDocument?.documentElement;t&&vM(t,g)};return n(),e.addEventListener(`load`,n),()=>e.removeEventListener(`load`,n)},[g,t]),(0,_.useEffect)(()=>{let e=m.current;if(!t||!e)return;let n=()=>{e.dataset.renderedAt=x.current};return e.addEventListener(`load`,n),()=>e.removeEventListener(`load`,n)},[t]),(0,_.useEffect)(()=>{let n=m.current;if(!t||!n)return;let r=()=>{let{page:t,element:r}=HN.getState(),i=n.contentDocument;if(r?.frame!==e.ref||!t||!i)return;let a=oz(i);a===r.hash||zN(e.ref,a)||DN(HN,t,[e.ref])};return n.addEventListener(`load`,r),()=>n.removeEventListener(`load`,r)},[t,e.ref]);let T=d?.width,{hugHeight:E,box:D}=e;(0,_.useEffect)(()=>{let n=m.current;if(!t||!n||T===void 0||!E)return;let r=()=>KM(e.ref,T,HH(n,D.height));return r(),n.addEventListener(`load`,r),()=>n.removeEventListener(`load`,r)},[t,T,E,e.ref,D.height]),(0,_.useEffect)(()=>{let e=m.current;if(!h||!e)return;let t=()=>{},n=()=>{t();let n=e.contentWindow;t=n?De(n,$H):()=>{}};return n(),e.addEventListener(`load`,n),()=>{e.removeEventListener(`load`,n),t()}},[h,t]);let O=i&&!h?i:void 0;return(0,X.jsxs)(`div`,{"data-frame":e.ref,"data-selected":p||void 0,"data-claimed":O?!0:void 0,"data-findings-open":v||void 0,className:`absolute`,style:{left:o,top:s,width:c,height:l,zIndex:e.order},children:[(0,X.jsxs)(`div`,{className:Q(`absolute bottom-full left-0 flex origin-bottom-left items-center gap-1.5 pb-1 text-label [transform:scale(calc(1/var(--zoom,1)))]`,`[[data-label-crowded]:not([data-label-hover]):not([data-selected]):not([data-findings-open])>&]:hidden`,O?`text-claim`:`text-muted-foreground`,f&&`invisible`),style:{maxWidth:`calc(${Math.max(c,u)}px * var(--zoom, 1))`},title:e.name,children:[e.locked?(0,X.jsx)(Qn,{role:`img`,"aria-label":`Locked`,className:`size-[11px] shrink-0`,strokeWidth:1.6}):null,a&&!i?(0,X.jsx)(PH,{}):null,(0,X.jsx)(`span`,{className:Q(`truncate`,(d||O)&&`shrink-[1000]`),children:e.name}),d?(0,X.jsx)(iU,{width:d.width}):null,h?null:(0,X.jsx)(rU,{frameRef:e.ref,name:e.name,theme:g}),y&&!h?(0,X.jsx)(NH,{frameRef:e.ref,name:e.name}):null,O?(0,X.jsx)(FH,{claim:O}):null,r&&r.length>0?(0,X.jsx)(sU,{frame:e,findings:r}):null]}),t?(0,X.jsx)(`iframe`,{ref:m,title:e.name,src:w??void 0,style:{colorScheme:g},className:`block size-full border-0 bg-[color:Canvas]`}):(0,X.jsx)(`div`,{"data-placeholder":!0,className:`size-full border border-border bg-card`}),t&&b&&!h?(0,X.jsx)(kH,{frameRef:e.ref,name:e.name,hash:b}):null,O?(0,X.jsx)(oU,{}):null,r&&r.length>0?(0,X.jsx)(`span`,{"aria-hidden":!0,"data-findings-dot":!0,"data-findings-badge":e.ref,"data-severity":aU(r),className:Q(`absolute top-0 left-0 hidden size-2.5 rounded-full shadow-[0_0_0_2px_var(--background)] [transform:translate(-50%,-50%)_scale(calc(1/var(--zoom,1)))] data-[severity=error]:bg-destructive data-[severity=warning]:bg-note`,`[[data-label-crowded]:not([data-label-hover]):not([data-selected]):not([data-findings-open])>&]:block`)}):null]})});function tU({frames:e,calls:t=gk}){let n=qH(`canvas`),r=e.find(e=>e.ref===n);return r?(0,X.jsx)(nU,{frame:r,calls:t}):null}function nU({frame:e,calls:t}){let{x:n,y:r,width:i}=oN(e);return(0,X.jsx)(`div`,{className:`absolute`,style:{left:n,top:r},children:(0,X.jsx)(`div`,{className:`pointer-events-auto absolute bottom-0 left-0 flex w-max origin-bottom-left pr-1.5 pb-0.5 text-label [transform:scale(calc(1/var(--zoom,1)))]`,style:{maxWidth:`clamp(160px, calc(${i}px * var(--zoom, 1)), 240px)`},children:(0,X.jsx)(uV,{hug:!0,name:e.name,label:`Rename frame ${e.name}`,onCommit:n=>{YH(),XH(e,n,t)},onCancel:YH})})})}function rU({frameRef:e,name:t,theme:n}){let r=jM(),i=`Flip ${t} to ${n===`dark`?`light`:`dark`}`;return n===r?(0,X.jsx)(`button`,{type:`button`,"data-label-control":!0,"aria-label":i,title:i,onClick:()=>OM(e),className:`invisible grid h-[18px] w-[18px] min-w-0 shrink place-items-center overflow-hidden rounded-[5px] text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 [[data-label-hover]_&]:visible`,children:(0,X.jsx)(oi,{"aria-hidden":!0,className:`size-3`})}):(0,X.jsxs)(`button`,{type:`button`,"data-label-control":!0,"aria-label":i,title:i,onClick:()=>OM(e),className:`flex h-[18px] min-w-0 shrink items-center gap-1 overflow-hidden rounded-[5px] bg-[color-mix(in_srgb,var(--foreground)_14%,transparent)] px-[5px] text-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,children:[(0,X.jsx)(n===`dark`?cr:oi,{"aria-hidden":!0,className:`size-3`}),n===`dark`?`Dark`:`Light`]})}function iU({width:e}){return(0,X.jsxs)(`span`,{"data-preview-chip":!0,title:`Previewed at ${e} px wide. The frame's size is unchanged.`,className:`flex h-[18px] min-w-0 shrink items-center gap-1 overflow-hidden rounded-[5px] bg-[color-mix(in_srgb,var(--foreground)_14%,transparent)] px-[5px] text-foreground`,children:[(0,X.jsx)(fr,{"aria-hidden":!0,className:`size-3 shrink-0`}),(0,X.jsxs)(`span`,{className:`truncate`,children:[`Preview `,e]})]})}function aU(e){return e.some(e=>e.severity===`error`)?`error`:`warning`}function oU(){return(0,X.jsx)(`svg`,{"aria-hidden":!0,"data-claim-outline":!0,className:`pointer-events-none absolute -inset-[calc(3px/var(--zoom,1))] size-[calc(100%+6px/var(--zoom,1))] overflow-visible`,children:(0,X.jsx)(`rect`,{width:`100%`,height:`100%`,fill:`none`,className:`stroke-claim [stroke-width:calc(1.5px/var(--zoom,1))] [stroke-dasharray:calc(4.5px/var(--zoom,1))_calc(3px/var(--zoom,1))] motion-safe:animate-claim-outline`})})}function sU({frame:e,findings:t}){let n=VH(e.ref),r=t.length,i=aU(t),a=`${r} finding${r===1?``:`s`}`;return(0,X.jsxs)(hH,{open:n,onOpenChange:t=>BH(t?e.ref:null),children:[(0,X.jsxs)(gH,{"data-findings-badge":e.ref,"aria-label":`${r} check finding${r===1?``:`s`}`,"data-severity":i,className:`flex h-[18px] shrink-0 items-center gap-[3px] rounded-[9px] bg-[color-mix(in_srgb,var(--h)_34%,transparent)] pr-1.5 pl-[5px] font-medium text-[color-mix(in_srgb,var(--h)_55%,var(--foreground))] shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--h)_75%,transparent)] outline-none focus-visible:ring-2 focus-visible:ring-ring/50 data-[severity=error]:[--h:var(--destructive)] data-[severity=warning]:[--h:var(--note)]`,children:[(0,X.jsx)(Si,{"aria-hidden":!0,className:`size-3 text-[var(--h)]`}),r]}),(0,X.jsxs)(_H,{side:`bottom`,align:`start`,sideOffset:6,initialFocus:!0,className:`w-[330px] gap-1.5 p-2.5 text-body`,children:[(0,X.jsxs)(vH,{className:`text-[11px] font-semibold text-muted-foreground`,children:[a,` on `,e.name]}),(0,X.jsx)(IH,{findings:t})]})]})}function cU(e,t){let n=Object.entries(e),r=eN(n.map(([,e])=>e));if(!r||n.length<2)return{...e};let i=e=>{switch(t){case`left`:return{...e,x:r.x};case`center`:return{...e,x:Math.round(r.x+(r.width-e.width)/2)};case`right`:return{...e,x:r.x+r.width-e.width};case`top`:return{...e,y:r.y};case`middle`:return{...e,y:Math.round(r.y+(r.height-e.height)/2)};case`bottom`:return{...e,y:r.y+r.height-e.height}}};return Object.fromEntries(n.map(([e,t])=>[e,i(t)]))}function lU(e,t){let n=Object.entries(e);if(n.length<3)return{...e};let r=e=>t===`horizontal`?e.x:e.y,i=e=>t===`horizontal`?e.width:e.height,a=n.toSorted(([,e],[,t])=>r(e)-r(t)||i(e)-i(t)),[,o]=a[0]??[],[,s]=a.at(-1)??[];if(!o||!s)return{...e};let c=(r(s)+i(s)-r(o)-a.reduce((e,[,t])=>e+i(t),0))/(a.length-1),l={},u=r(o);for(let[e,n]of a){let r=Math.round(u);l[e]=t===`horizontal`?{...n,x:r}:{...n,y:r},u+=i(n)+c}return l}var uU=[{name:`Left`,key:`ArrowLeft`,dx:-1,dy:0},{name:`Right`,key:`ArrowRight`,dx:1,dy:0},{name:`Up`,key:`ArrowUp`,dx:0,dy:-1},{name:`Down`,key:`ArrowDown`,dx:0,dy:1}],dU=[{id:`arrange.alignLeft`,label:`Align left`,alignment:`left`,key:`Alt+KeyA`},{id:`arrange.alignCenter`,label:`Align horizontal centers`,alignment:`center`,key:`Alt+KeyH`},{id:`arrange.alignRight`,label:`Align right`,alignment:`right`,key:`Alt+KeyD`},{id:`arrange.alignTop`,label:`Align top`,alignment:`top`,key:`Alt+KeyW`},{id:`arrange.alignMiddle`,label:`Align vertical centers`,alignment:`middle`,key:`Alt+KeyV`},{id:`arrange.alignBottom`,label:`Align bottom`,alignment:`bottom`,key:`Alt+KeyS`}],fU=[{id:`arrange.distributeHorizontal`,label:`Distribute horizontal spacing`,axis:`horizontal`,key:`Control+Alt+KeyH`},{id:`arrange.distributeVertical`,label:`Distribute vertical spacing`,axis:`vertical`,key:`Control+Alt+KeyV`}];function pU(e){let{selection:t,mode:n,live:r}=e,i=()=>n.getState().mode===`edit`,a=()=>{let{page:n,frames:r}=t.getState();return n===e.page()?e.frames().filter(e=>r.includes(e.ref)):[]},o=e=>()=>{let t=a();return i()&&r.getState().canWrite&&t.length>=e&&t.every(e=>!e.locked)},s=null,c,l=()=>{clearTimeout(c);let t=s;s=null,t&&e.write(t.page,t.boxes,t.started)},u=t=>{let n=a(),r=e.page(),i=n.map(e=>e.ref);s&&(s.page!==r||!hU(s.refs,i))&&l(),s||={page:r,refs:i,started:gU(n),boxes:gU(n)};let{boxes:o}=s;for(let e of n){let n=o[e.ref]??e.box;o[e.ref]=t(n)}e.hold(o),clearTimeout(c),c=setTimeout(l,300)},d=t=>{let n=gU(a()),r=t(n),i=Object.keys(r).filter(e=>{let t=r[e],i=n[e];return t&&i&&(t.x!==i.x||t.y!==i.y)});e.write(e.page(),_U(r,i),_U(n,i))};return[{id:`selection.clear`,label:`Clear selection`,group:`selection`,keys:[`Escape`],enabled:()=>i()&&n.getState().tool===`move`&&(t.getState().frames.length>0||t.getState().section!==void 0),run:()=>jN(t)},{id:`selection.all`,label:`Select all`,group:`selection`,command:{label:`Select all`},keys:[`$mod+KeyA`],enabled:()=>i()&&e.frames().length>0,run:()=>DN(t,e.page(),e.frames().map(e=>e.ref))},...uU.flatMap(({name:e,key:t,dx:n,dy:r})=>[{id:`frame.nudge${e}`,label:`Nudge ${e.toLowerCase()}`,group:`frame`,keys:[t],enabled:o(1),run:()=>u(e=>({...e,x:e.x+n,y:e.y+r}))},{id:`frame.nudge${e}Far`,label:`Nudge ${e.toLowerCase()} 10 px`,group:`frame`,keys:[`Shift+${t}`],enabled:o(1),run:()=>u(e=>({...e,x:e.x+n*10,y:e.y+r*10}))},{id:`frame.resize${e}`,label:n===0?r>0?`Make taller`:`Make shorter`:n>0?`Make wider`:`Make narrower`,group:`frame`,keys:[`$mod+${t}`],enabled:o(1),run:()=>u(e=>({...e,width:Math.max(1,e.width+n),height:Math.max(1,e.height+r)}))}]),{id:`frame.fitHeight`,label:`Fit height`,group:`frame`,command:{label:`Fit height to content`},enabled:()=>o(1)()&&a().length===1,run:()=>{let[t]=a();t&&e.fit(t.ref).catch(Ck(`Couldn't fit ${t.name} to its content`))}},...dU.map(({id:e,label:t,alignment:n,key:r})=>({id:e,label:t,group:`arrange`,command:{label:t},keys:[r],enabled:o(2),run:()=>d(e=>cU(e,n))})),...fU.map(({id:e,label:t,axis:n,key:r})=>({id:e,label:t,group:`arrange`,command:{label:t},keys:[r],enabled:o(3),run:()=>d(e=>lU(e,n))}))]}function mU(e,t){let n=(0,_.useRef)(e),r=(0,_.useRef)(t);(0,_.useEffect)(()=>{n.current=e,r.current=t},[e,t]),(0,_.useEffect)(()=>{let e=xe(pU({page:()=>n.current,frames:()=>aN(r.current),selection:HN,mode:qg,live:Lg,hold:uN,write:fN,fit:gk.fitFrame})),t=[HN.subscribe(U),Lg.subscribe(U)];return()=>{for(let e of t)e();e()}},[])}function hU(e,t){return e.length===t.length&&e.every(e=>t.includes(e))}function gU(e){return Object.fromEntries(e.map(e=>[e.ref,e.box]))}function _U(e,t){return Object.fromEntries(t.flatMap(t=>{let n=e[t];return n?[[t,n]]:[]}))}function vU(e,t,n){let r=n.width/t.width,i=n.height/t.height;return Object.fromEntries(Object.entries(e).map(([e,a])=>{let o=Math.round(n.x+(a.x-t.x)*r),s=Math.round(n.y+(a.y-t.y)*i),c=Math.round(n.x+(a.x+a.width-t.x)*r),l=Math.round(n.y+(a.y+a.height-t.y)*i);return[e,{x:o,y:s,width:Math.max(1,c-o),height:Math.max(1,l-s)}]}))}function yU(e,t,n,r){let i=t===`nw`||t===`sw`,a=t===`nw`||t===`ne`,o=Math.round(e.x),s=Math.round(e.y),c=Math.round(e.x+e.width),l=Math.round(e.y+e.height),u=i?Math.min(Math.round(o+n),c-1):o,d=a?Math.min(Math.round(s+r),l-1):s;return{x:u,y:d,width:i?c-u:Math.max(1,Math.round(c+n)-o),height:a?l-d:Math.max(1,Math.round(l+r)-s)}}function bU(e,t,n){return e===`grid`||e===`inline-grid`?`grid`:e!==`flex`&&e!==`inline-flex`?`block`:n===`nowrap`?t.startsWith(`column`)?`vertical`:`horizontal`:`wrap`}function xU(e){let[t,n]=(0,_.useState)(null),r=e?.frame,i=e?.index,a=e?.hash,o=e?`${r}:${i}`:null;return(0,_.useEffect)(()=>{if(r===void 0||i===void 0||o===null)return;let e=document.querySelector(`[data-frame="${CSS.escape(r)}"] iframe`);if(!e)return;let t=()=>{let t=e.contentDocument;if(!t||oz(t)!==a)return;let r=az(t,i),s=t.defaultView;r&&s&&n({at:o,live:CU(r,s)})};return t(),e.addEventListener(`load`,t),()=>e.removeEventListener(`load`,t)},[r,i,a,o]),t?.at===o?t.live:null}function SU(e){let[t,n]=(0,_.useState)(null);return(0,_.useEffect)(()=>{let t=`[data-frame="${CSS.escape(e)}"]`,r=t=>{let r=t?.contentDocument,i=r?oz(r):null,a=r?.body?iz(r,r.body):null;i!==null&&a!==null&&n({frame:e,index:a,hash:i})},i=e=>{let n=e.target;n instanceof HTMLIFrameElement&&n.closest(t)&&r(n)};return r(document.querySelector(`${t} iframe`)),document.addEventListener(`load`,i,!0),()=>document.removeEventListener(`load`,i,!0)},[e]),t?.frame===e?t:null}function CU(e,t){let n=t.getComputedStyle(e),r=e.textContent??``,i=[n.borderTopWidth,n.borderRightWidth,n.borderBottomWidth,n.borderLeftWidth];return{opacity:Number(n.opacity),radius:Math.round(parseFloat(n.borderTopLeftRadius)||0),fontFamily:n.fontFamily,fontSize:jU(n.fontSize),fontWeight:Number(n.fontWeight),lineHeight:n.lineHeight===`normal`?null:jU(n.lineHeight),letterSpacing:n.letterSpacing===`normal`?0:jU(n.letterSpacing),textAlign:NU(n.textAlign,n.direction),textDecorationLine:n.textDecorationLine,textTransform:n.textTransform,textWrapStyle:n.getPropertyValue(`text-wrap-style`)||`auto`,truncated:n.textOverflow===`ellipsis`&&n.overflowX!==`visible`&&n.getPropertyValue(`text-wrap-mode`)===`nowrap`,display:n.display,color:n.color,bordered:i.some(e=>parseFloat(e)>0),holdsText:r.trim()!==``,textOnly:e.childElementCount===0&&r.trim()!==``,text:r,rotation:{degrees:DU(n.rotate),scale:OU(n.scale),own:AU(e,t),translated:kU(n.transform)},placement:wU(e,n,t),layout:TU(e,n,t),inline:MU(e)}}function wU(e,t,n){let r=t.position===`absolute`||t.position===`fixed`,i=e=>{let t=parseFloat(e);return Number.isNaN(t)?null:Math.round(t)},a=i(t.width),o=i(t.height),s=`style`in e?e.style:null,c={width:s?.getPropertyValue(`width`)??``,height:s?.getPropertyValue(`height`)??``};if(r&&t.left.endsWith(`px`)&&t.top.endsWith(`px`))return{free:r,left:Math.round(parseFloat(t.left)),top:Math.round(parseFloat(t.top)),width:a,height:o,inline:c};let l=e.ownerDocument,u=e.parentElement,d=e=>{let t=n.getComputedStyle(e);return t.position!==`static`||t.transform!==`none`},f=null;if(t.position!==`fixed`){if(!r&&u&&u!==l.body&&u!==l.documentElement)f=u;else for(let e=u;e&&!f;e=e.parentElement)d(e)&&(f=e)}let p=t.position===`fixed`?0:-n.scrollX,m=t.position===`fixed`?0:-n.scrollY;if(f){let e=f.getBoundingClientRect();p=e.left+f.clientLeft-f.scrollLeft,m=e.top+f.clientTop-f.scrollTop}let h=e.getBoundingClientRect();return{free:r,left:Math.round(h.left-p-(parseFloat(t.marginLeft)||0)),top:Math.round(h.top-m-(parseFloat(t.marginTop)||0)),width:a,height:o,inline:c}}function TU(e,t,n){let r=e.parentElement,i=r?n.getComputedStyle(r):null,a=`offsetWidth`in e?e:null,o=e=>jU(e)||0;return{flow:bU(t.display,t.flexDirection,t.flexWrap),inline:t.display.startsWith(`inline-`),direction:t.flexDirection,wrap:t.flexWrap,justify:t.justifyContent,alignItems:t.alignItems,ownJustify:!!a?.style.getPropertyValue(`justify-content`),rowGap:t.rowGap===`normal`?0:o(t.rowGap),columnGap:t.columnGap===`normal`?0:o(t.columnGap),padding:{top:o(t.paddingTop),right:o(t.paddingRight),bottom:o(t.paddingBottom),left:o(t.paddingLeft)},parent:i?bU(i.display,i.flexDirection,i.flexWrap):`block`,parentAlignItems:i?.alignItems??`normal`,width:Math.round(a?.offsetWidth??0),height:Math.round(a?.offsetHeight??0)}}var EU={deg:1,grad:.9,rad:180/Math.PI,turn:360};function DU(e){if(e===`none`||e===``)return 0;let t=/^(-?[\d.]+(?:e[+-]?\d+)?)(deg|grad|rad|turn)$/.exec(e),n=t?.[2]?EU[t[2]]:void 0;return!t||n===void 0?null:Math.round(Number(t[1])*n*100)/100}function OU(e){if(e===`none`||e===``)return{x:1,y:1};let t=e.split(/\s+/).map(e=>e.endsWith(`%`)?parseFloat(e)/100:Number(e)),[n,r=n,i=1]=t;return n===void 0||r===void 0||t.some(Number.isNaN)||t.length>3||i!==1?null:{x:n,y:r}}function kU(e){if(e===`none`||e===``)return!1;let t=/^matrix(3d)?\(([^)]*)\)$/.exec(e);if(!t?.[2])return!0;let n=t[2].split(`,`).map(Number);return(t[1]?n.slice(12,15):n.slice(4,6)).some(e=>e!==0)}function AU(e,t){let n=`style`in e?e:null,r=!!n?.style.getPropertyValue(`rotate`),i=!!n?.style.getPropertyValue(`scale`);if(!n||!r&&!i)return{};let a=n.getAttribute(`style`);n.style.removeProperty(`rotate`),n.style.removeProperty(`scale`);let o=t.getComputedStyle(n),s={...r?{rotate:DU(o.rotate)}:{},...i?{scale:OU(o.scale)}:{}};return a===null?n.removeAttribute(`style`):n.setAttribute(`style`,a),s}function jU(e){return Math.round(parseFloat(e)*100)/100}function MU(e){let t=`style`in e?e.style:null,n=t?Array.from({length:t.length},(e,n)=>t.item(n)):[];return{color:n.includes(`color`),backgroundColor:n.includes(`background-color`),background:/(?:^|;)\s*background\s*:/i.test(e.getAttribute(`style`)??``),border:n.some(e=>e.startsWith(`border-`)&&!e.endsWith(`-radius`))}}function NU(e,t){return e===`start`?t===`rtl`?`right`:`left`:e===`end`?t===`rtl`?`left`:`right`:e}function PU(e,t,n,r=FU){let[i,a]=(0,_.useState)(null),o=e===null?null:`${e}:${t??``}`;return(0,_.useEffect)(()=>{if(e===null||o===null)return;let n=!0;return r(e,t).catch(()=>null).then(e=>{n&&e&&a({at:o,styles:e})}),()=>{n=!1}},[e,t,n,o,r]),i?.at===o?i.styles:null}async function FU(e,t){let n=new URLSearchParams({ref:e});t!==void 0&&n.set(`index`,String(t));let r=await(await fetch(`/api/frames/styles?${n}`)).json();return r.ok?r.data:null}var IU=new Map;function LU(e,t,n){let r=`${e.frame}:${e.index}:${t}`,i=document.querySelector(`[data-frame="${CSS.escape(e.frame)}"] iframe`)?.contentDocument,a=i?az(i,e.index):null,o=a&&`style`in a?a:null,s=IU.get(r);if(n===null){if(IU.delete(r),!s||s.element!==o||!o)return;s.value===``?o.style.removeProperty(t):o.style.setProperty(t,s.value,s.priority),o.getAttribute(`style`)===``&&o.removeAttribute(`style`)}else o&&(s?.element!==o&&IU.set(r,{element:o,value:o.style.getPropertyValue(t),priority:o.style.getPropertyPriority(t)}),o.style.setProperty(t,n,`important`))}function RU(e){return e?.localName===`div`&&e.childElementCount===0&&(e.textContent??``).trim()===``}function zU(e,t,n,r,i){let{width:a,height:o}=yU(e,t,n,r);if(!i||e.width<=0||e.height<=0)return{width:a,height:o};let s=Math.max(a/e.width,o/e.height);return{width:Math.max(1,Math.round(e.width*s)),height:Math.max(1,Math.round(e.height*s))}}function BU(e,t){let n=e.querySelector(`[data-frame="${CSS.escape(t.frame)}"] iframe`)?.contentDocument;if(!n||oz(n)!==t.hash)return!1;let r=az(n,t.index),i=r?n.defaultView?.getComputedStyle(r).rotate:void 0;return RU(r)&&i!==void 0&&DU(i)===0}function VU(e,t){let n=Lg.getState().claims[t.frame];if(n)return tg.add({title:`Nothing resized`,description:`${n.tag} is editing ${t.frame.split(`/`).at(-1)}, so nothing was written.`,type:`warning`}),null;let r=e=>{LU(t,`width`,e?`${e.width}px`:null),LU(t,`height`,e?`${e.height}px`:null)};return{preview:r,commit:async({width:n,height:i})=>{let a=await aB(e,t,{kind:`styles`,declarations:[{property:`width`,value:`${n}px`},{property:`height`,value:`${i}px`}]});return a||r(null),a},cancel:()=>r(null)}}function HU(e,t){let n=e.querySelector(`[data-frame="${CSS.escape(t.frame)}"] iframe`)?.contentDocument;if(!n||oz(n)!==t.hash)return null;let r=az(n,t.index),i=r?n.defaultView?.getComputedStyle(r):void 0;if(!i||i.position!==`absolute`&&i.position!==`fixed`)return null;let a=parseFloat(i.left),o=parseFloat(i.top);return Number.isNaN(a)||Number.isNaN(o)?null:{left:a,top:o}}function UU(e,t){let n=Lg.getState().claims[t.frame];if(n)return tg.add({title:`Nothing moved`,description:`${n.tag} is editing ${t.frame.split(`/`).at(-1)}, so nothing was written.`,type:`warning`}),null;let r=e=>{LU(t,`left`,e?`${e.left}px`:null),LU(t,`top`,e?`${e.top}px`:null)};return{preview:r,commit:async({left:n,top:i})=>{let a=await aB(e,t,{kind:`styles`,declarations:[{property:`left`,value:`${n}px`},{property:`top`,value:`${i}px`}]});return a||r(null),a},cancel:()=>r(null)}}function WU(e,t,n){let{x:r,y:i,width:a}=e.box,o=t===null?null:n?.querySelector(`[data-frame="${CSS.escape(e.ref)}"] iframe`)?.contentDocument,s=o&&t!==null?az(o,t):null;if(!s)return{x:r+a,y:i};let c=s.getBoundingClientRect();return{x:r+Math.min(c.right,a),y:i+Math.max(c.top,0)}}var GU=`tool.image`,KU=[{kind:`rectangle`,id:`tool.rectangle`,label:`Rectangle`,key:`r`,icon:ei},{kind:`ellipse`,id:`tool.ellipse`,label:`Ellipse`,key:`o`,icon:Vt},{kind:`divider`,id:`tool.divider`,label:`Divider`,key:`l`,icon:ir}],qU=N()(()=>({shape:`rectangle`})),JU=N()(()=>({file:null})),YU=N()(()=>({open:!1}));function XU(e){JU.setState({file:e}),YU.setState({open:!1}),qg.setState({tool:`image`,mode:`edit`}),U()}var ZU=N()(()=>({carried:null})),QU=null;function $U(e){QU=e}function eW(){let e=QU;return QU=null,e}function tW(e){return KU.find(t=>t.kind===e)??KU[0]}function nW(){return tW(F(qU,e=>e.shape))}function rW(){let{mode:e,tool:t}=qg.getState();return e===`edit`?t===`text`?`text`:t===`image`?JU.getState().file?`asset`:null:t===`shape`?qU.getState().shape:null:null}function iW(e){return e===`text`||e===`shape`||e===`image`}var aW=()=>Lg.getState().canWrite,oW=()=>iW(qg.getState().tool);function sW(){(0,_.useEffect)(()=>{let e=xe([{id:`tool.text`,label:`Text`,group:`tool`,command:{label:`Add text`,icon:Oi},keys:[`t`],enabled:aW,run:()=>qg.setState({tool:`text`,mode:`edit`}),checked:()=>qg.getState().mode===`edit`&&qg.getState().tool===`text`},...KU.map(e=>({id:e.id,label:e.label,group:`tool`,command:{label:`Add a ${e.label.toLowerCase()}`,icon:e.icon},keys:[e.key],enabled:aW,run:()=>{qU.setState({shape:e.kind}),qg.setState({tool:`shape`,mode:`edit`}),U()},checked:()=>qg.getState().mode===`edit`&&qg.getState().tool===`shape`&&qU.getState().shape===e.kind})),{id:GU,label:`Image or video`,group:`tool`,command:{label:`Add an image or video`,icon:On},keys:[`$mod+Shift+KeyK`],enabled:aW,run:()=>YU.setState({open:!0}),checked:()=>qg.getState().mode===`edit`&&qg.getState().tool===`image`}]),t=Lg.subscribe((e,t)=>{e.canWrite!==t.canWrite&&(U(),!e.canWrite&&(YU.setState({open:!1}),oW()&&qg.setState({tool:`move`})))});return()=>{t(),e(),YU.setState({open:!1}),oW()&&qg.setState({tool:`move`})}},[])}function cW(e,t,n){let r=6/n,i=(e,t)=>Math.abs(e-t)<=r,a=i(t.x,e.x),o=i(t.x,e.x+e.width),s=i(t.y,e.y),c=i(t.y,e.y+e.height);return s&&a?`nw`:s&&o?`ne`:c&&a?`sw`:c&&o?`se`:null}function lW(e,t,n){let r=6/n,i=(e,t,n)=>e>=t-r&&e<=n+r,a=(e,t)=>Math.abs(e-t)<=r,o=e.x+e.width,s=e.y+e.height;return i(t.x,e.x,o)&&(a(t.y,e.y)||a(t.y,s))||i(t.y,e.y,s)&&(a(t.x,e.x)||a(t.x,o))}function uW(e,t,n){for(let r of e.querySelectorAll(t)){let{left:e,right:t,top:i,bottom:a}=r.getBoundingClientRect();if(n.clientX>=e&&n.clientX<=t&&n.clientY>=i&&n.clientY<=a)return r}return null}function dW(e,t){return uW(e,`[data-findings-badge]`,t)?.dataset.findingsBadge??null}function fW(e){let t=e.querySelector(`[data-element-selection]`);if(!t)return null;let{left:n,top:r,width:i,height:a}=t.style;return{x:parseFloat(n),y:parseFloat(r),width:parseFloat(i),height:parseFloat(a)}}function pW(e,t,n){let r=20/n;for(let n=e.length-1;n>=0;--n){let i=e[n];if(!i||i.hidden)continue;let{x:a,y:o,width:s,height:c}=i.box;if(t.x>=a&&t.x<=a+s&&t.y>=o-r&&t.y<=o+c)return i}return null}function mW(e,t){return e.filter(({hidden:e,box:n})=>!e&&n.x<=t.x+t.width&&n.x+n.width>=t.x&&n.y<=t.y+t.height&&n.y+n.height>=t.y)}var hW=[`start`,`center`,`end`];function gW(e,t,n){let r=vW(e,t,`x`,hW,n),i=vW(e,t,`y`,hW,n);return bW({...e,x:Math.round(e.x+(r?.delta??0)),y:Math.round(e.y+(i?.delta??0))},r,i)}function _W(e,t,n,r){let i=vW(e,n,`x`,[t.x],r),a=vW(e,n,`y`,[t.y],r),o={...e},s=Math.round(i?.delta??0),c=Math.round(a?.delta??0);return t.x===`start`?(o.x+=s,o.width-=s):o.width+=s,t.y===`start`?(o.y+=c,o.height-=c):o.height+=c,o.width<1||o.height<1?{box:e,guides:[],gaps:[]}:bW(o,i,a)}function vW(e,t,n,r,i){let a=null;for(let o of r.map(t=>yW(e,n,t)))for(let e of t)for(let t of hW.map(t=>yW(e,n,t))){let n=t-o;Math.abs(n)>i||a&&Math.abs(n)>Math.abs(a.delta)||(a&&n===a.delta&&t===a.at?a.targets.includes(e)||a.targets.push(e):a={delta:n,at:t,targets:[e]})}return a}function yW(e,t,n){let r=t===`x`?e.x:e.y,i=t===`x`?e.width:e.height;return n===`start`?r:n===`end`?r+i:r+i/2}function bW(e,t,n){let r=[];if(t){let n=[e,...t.targets];r.push({axis:`x`,at:t.at,from:Math.min(...n.map(e=>e.y)),to:Math.max(...n.map(e=>e.y+e.height))})}if(n){let t=[e,...n.targets];r.push({axis:`y`,at:n.at,from:Math.min(...t.map(e=>e.x)),to:Math.max(...t.map(e=>e.x+e.width))})}let i=[],a=n?xW(e,n.targets,`x`):null;a&&i.push(a);let o=t?xW(e,t.targets,`y`):null;return o&&i.push(o),{box:e,guides:r,gaps:i}}function xW(e,t,n){let r=null,i=e=>n===`x`?e.x:e.y,a=e=>i(e)+(n===`x`?e.width:e.height),o=n===`x`?e.y+e.height/2:e.x+e.width/2;for(let s of t){let t=a(s)<=i(e)?{from:a(s),to:i(e)}:a(e)<=i(s)?{from:a(e),to:i(s)}:null;!t||t.to-t.from<=0||r&&r.to-r.from<=t.to-t.from||(r={axis:n,at:o,...t})}return r}var SW={selection:HN,mode:qg,canWrite:()=>Lg.getState().canWrite,write:fN,duplicate:gk.duplicateFrames,openFindings:BH,splitAt:TH,moveElement:PB,isShape:BU,resizeShape:VU,placedOffsets:HU,movePlaced:UU};function CW(e,t,n=SW){let{selection:r,mode:i}=n,a={kind:`none`},o={x:0,y:0},s={x:0,y:0},c=!1,l=!1,u=null,d=new Map,f=()=>t.layer.querySelector(`[data-overlay]`),p=(e,n)=>{let r=t.layer.querySelector(`[data-element-selection]`);r&&(r.style.transform=e===0&&n===0?``:`translate(${e}px, ${n}px)`)},m=(e,n,r)=>{let i=t.viewport.querySelectorAll(`[data-note-frame]`);for(let t of i){let i=e.includes(t.dataset.noteFrame??``)&&(n!==0||r!==0);t.style.translate=i?`${n}px ${r}px`:``}},h=(e,n,r)=>{let i=t.viewport.querySelectorAll(`[data-note-frame="${CSS.escape(e.frame)}"][data-note-element="${e.index}"]`);for(let e of i)e.style.translate=n!==0||r!==0?`${n}px ${r}px`:``},g=e=>{let n=t.viewport.querySelectorAll(`[data-note-frame]`);for(let r of n){let n=r.dataset.noteFrame??``,i=e[n];if(!i){r.style.translate=``;continue}let a=r.dataset.noteElement,o=WU({ref:n,box:i},a===void 0?null:Number(a),t.layer),s=o.x-parseFloat(r.style.left),c=o.y-parseFloat(r.style.top);r.style.translate=s!==0||c!==0?`${s}px ${c}px`:``}},_=()=>BR(t.viewport).k,v=e=>{let[n,r]=ZF(e,t.viewport),{x:i,y:a,k:o}=BR(t.viewport);return{x:(n-i)/o,y:(r-a)/o}},y=e=>{let{page:n,frames:i}=r.getState();return n===t.page?e.filter(e=>i.includes(e.ref)):[]},b=e=>Object.fromEntries(e.map(e=>[e.ref,e.box])),x=e=>t.sections?.().find(t=>t.name===e),S=e=>t.layer.querySelector(`[data-section="${CSS.escape(e)}"]`),C=(e,t)=>{let n=S(e);n&&Object.assign(n.style,{left:`${t.x}px`,top:`${t.y}px`,width:`${t.width}px`,height:`${t.height}px`})},w=e=>{let i=cN(t.frames()),d=v(e);o=d,s={x:e.clientX,y:e.clientY},c=!1,u=e;let f=wW();l=f!==null,f?.blur();let p=uW(t.layer,`[data-label-control]`,e);if(p){a={kind:`control`,element:p};return}if(uW(t.layer,`[data-compare-divider]`,e)){a={kind:`divider`},n.splitAt(e.clientX);return}let m=dW(t.layer,e);if(m){a={kind:`badge`,ref:m};return}let h=r.getState().element,g=h?fW(t.layer):null,S=g?cW(g,d,_()):null;if(h&&g&&S&&n.isShape(t.layer,h)){a={kind:`shape`,key:h,corner:S,box:g};return}if(h&&g){let r=lW(g,d,_());if(r||TW(g,d)){a={kind:`element`,key:h,frame:r?null:pW(i,d,_()),shift:e.shiftKey,placed:n.placedOffsets(t.layer,h)};return}}let C=x(r.getState().page===t.page?r.getState().section:void 0),w=C?uW(t.layer,`[data-section-corner]`,e):null;if(C&&w){a={kind:`section-resize`,section:C,corner:w.dataset.sectionCorner,moved:!1};return}let T=eN(y(i).map(e=>e.box)),E=T&&!h?cW(T,d,_()):null,D=y(aN(t.frames())),O=eN(D.map(e=>e.box));if(O&&E){a={kind:`resize`,corner:E,boxes:b(D),bounds:O};return}let k=i.some(e=>TW(e.box,d))?null:EW(t.layer,`[data-section-label]`,e),A=x(k?.dataset.sectionLabel);if(A){l||ON(r,t.page,A.name),a={kind:`section`,section:A};return}let j=pW(i,d,_());if(j){let n=!D.some(({ref:e})=>e===j.ref);!l&&!e.shiftKey&&n&&DN(r,t.page,[j.ref]),a={kind:`press`,frame:j,shift:e.shiftKey}}else a={kind:`marquee`,shift:e.shiftKey,base:e.shiftKey?r.getState().frames:[]}},T=()=>{if(a.kind===`shape`){let e=n.canWrite()?n.resizeShape(t.page,a.key):null;a=e?{...a,kind:`shape-resize`,resize:e,size:null}:{kind:`none`}}else if(a.kind===`element`&&a.placed){let e=n.canWrite()?n.movePlaced(t.page,a.key):null;a=e?{kind:`placed`,key:a.key,from:a.placed,move:e,to:null}:{kind:`none`}}else if(a.kind===`element`)a=n.canWrite()?{kind:`carry`,key:a.key}:{kind:`none`},a.kind===`carry`&&ZU.setState({carried:a.key});else if(a.kind===`section`){let{section:e}=a,i=aN(t.pageFrames?.()??t.frames()).filter(t=>e.frames.includes(t.name));a=n.canWrite()&&i.every(({locked:e})=>!e)?{kind:`section-move`,section:e,boxes:b(i)}:{kind:`none`},a.kind===`section-move`&&(ON(r,t.page,e.name),GM(Object.keys(a.boxes)),d=E(Object.keys(a.boxes)))}else if(a.kind===`section-resize`)n.canWrite()||(a={kind:`none`});else if(a.kind===`press`||a.kind===`resize`){if(a.kind===`press`){let{frame:e,shift:i}=a,o=!r.getState().frames.includes(e.ref);i&&o?AN(r,t.page,e.ref):l&&o&&DN(r,t.page,[e.ref]);let s=y(aN(t.frames())),c=eN(s.map(({box:e})=>e));a=c&&s.every(({locked:e})=>!e)&&n.canWrite()?{kind:`move`,boxes:b(s),bounds:c}:{kind:`none`}}else{let e=Object.keys(a.boxes);(t.frames().some(t=>e.includes(t.ref)&&t.locked)||!n.canWrite())&&(a={kind:`none`})}(a.kind===`move`||a.kind===`resize`)&&(GM(Object.keys(a.boxes)),d=E(Object.keys(a.boxes)))}},E=e=>new Map(e.flatMap(e=>{let n=t.layer.querySelector(`[data-frame="${CSS.escape(e)}"]`);return n?[[e,n]]:[]})),D=e=>{let n=f();if(!n)return;let r=v(e),i=r.x-o.x,s=r.y-o.y,c=e.ctrlKey?-1:6/_(),l=()=>cN(t.frames()).filter(e=>!(`boxes`in a&&e.ref in a.boxes)).map(e=>e.box);switch(a.kind){case`move`:{let{bounds:e,boxes:t}=a,r=gW({...e,x:Math.round(e.x+i),y:Math.round(e.y+s)},l(),c),o=r.box.x-e.x,u=r.box.y-e.y;for(let[e,n]of Object.entries(t)){let t=d.get(e);t&&(t.style.left=`${n.x+o}px`,t.style.top=`${n.y+u}px`)}dz(n,o,u,r.box),p(o,u),m(Object.keys(t),o,u),mz(n,r.guides,r.gaps);return}case`resize`:{let{bounds:e,boxes:t,corner:r}=a,o=_W(yU(e,r,i,s),{x:r.endsWith(`w`)?`start`:`end`,y:r.startsWith(`n`)?`start`:`end`},l(),c),u=vU(t,e,o.box);for(let[e,t]of Object.entries(u)){let n=d.get(e);n&&Object.assign(n.style,{left:`${t.x}px`,top:`${t.y}px`,width:`${t.width}px`,height:`${t.height}px`})}g(u),fz(n,u),mz(n,o.guides,o.gaps);return}case`section-move`:{let{section:e,boxes:t}=a,r=gW({...e.box,x:Math.round(e.box.x+i),y:Math.round(e.box.y+s)},l(),c),o=r.box.x-e.box.x,u=r.box.y-e.box.y;C(e.name,r.box);for(let[e,n]of Object.entries(t)){let t=d.get(e);t&&(t.style.left=`${n.x+o}px`,t.style.top=`${n.y+u}px`)}m(Object.keys(t),o,u),mz(n,r.guides,r.gaps);return}case`section-resize`:a.moved=!0,C(a.section.name,DW(yU(a.section.box,a.corner,i,s)));return;case`placed`:{let e=Math.round(i),t=Math.round(s);a.to={left:a.from.left+e,top:a.from.top+t},a.move.preview(a.to),p(e,t),h(a.key,e,t);return}case`shape-resize`:a.size=zU(a.box,a.corner,i,s,e.shiftKey),a.resize.preview(a.size);return;case`marquee`:{let e=OW(o,r);pz(n,e,mW(cN(t.frames()),e).map(e=>e.box));return}default:return}},O=e=>{let[i]=Object.entries(e),a=i?d.get(i[0]):void 0;if(!i||!a)return;let o={x:parseFloat(a.style.left)-i[1].x,y:parseFloat(a.style.top)-i[1].y};for(let[t,n]of Object.entries(e)){let e=d.get(t);e&&(e.style.left=`${n.x}px`,e.style.top=`${n.y}px`)}if(o.x===0&&o.y===0)return;let s=Object.keys(e);n.duplicate(s,o).then(e=>DN(r,t.page,e.map(e=>e.ref)),Ck(s.length===1?`Couldn't duplicate ${s[0]?.split(`/`).at(-1)??`the frame`}`:`Couldn't duplicate ${s.length} frames`))},k=e=>{let i=f();if(!c){if(l){a={kind:`none`};return}a.kind===`badge`?n.openFindings(a.ref):a.kind===`control`?a.element.click():a.kind===`press`||a.kind===`element`&&a.frame?a.shift?AN(r,t.page,a.frame.ref):DN(r,t.page,[a.frame.ref]):a.kind===`section`?ON(r,t.page,a.section.name):a.kind===`marquee`&&!a.shift&&jN(r),a={kind:`none`};return}i&&hz(i),p(0,0),m([],0,0);let s=v(e);if(a.kind===`marquee`){let e=mW(cN(t.frames()),OW(o,s)).map(e=>e.ref);DN(r,t.page,[...a.base,...e])}else if(a.kind===`shape-resize`){let{box:e,corner:t,resize:n,size:r}=a,i=zU(e,t,0,0,!1);r&&(r.width!==i.width||r.height!==i.height)?n.commit(r):n.cancel()}else if(a.kind===`placed`){let{from:e,to:t,move:n}=a;t&&(t.left!==e.left||t.top!==e.top)?n.commit(t):n.cancel()}else if(a.kind===`carry`)ZU.setState({carried:null}),n.moveElement(t.layer,t.page,cN(t.frames()),s,a.key);else if(a.kind===`section-move`)A(a.section,a.boxes);else if(a.kind===`section-resize`&&a.moved)A(a.section,{});else if(a.kind===`move`&&e.altKey)O(a.boxes);else if(a.kind===`move`||a.kind===`resize`){let e={},r={};for(let[t,n]of Object.entries(a.boxes)){let i=d.get(t);if(!i)continue;let o=a.kind===`move`?{...n,x:parseFloat(i.style.left),y:parseFloat(i.style.top)}:{x:parseFloat(i.style.left),y:parseFloat(i.style.top),width:parseFloat(i.style.width),height:parseFloat(i.style.height)};$M(o,n)||(e[t]=o,r[t]=n)}n.write(t.page,e,r)}a={kind:`none`},d=new Map},A=(e,r)=>{let i=S(e.name);if(!i)return;let a={x:parseFloat(i.style.left),y:parseFloat(i.style.top),width:parseFloat(i.style.width),height:parseFloat(i.style.height)};if($M(a,e.box))return;let o={},s={},c=a.x-e.box.x,l=a.y-e.box.y;for(let[e,t]of Object.entries(r))o[e]={...t,x:t.x+c,y:t.y+l},s[e]=t;n.write(t.page,o,s,void 0,{boxes:{[e.name]:a},expected:{[e.name]:e.box}}).then(t=>{t||C(e.name,e.box)})},j=e=>{e.key===`Escape`&&a.kind===`placed`&&(e.preventDefault(),e.stopImmediatePropagation(),a.move.cancel(),p(0,0),h(a.key,0,0),a={kind:`none`})},M=e=>{e.key===`Control`&&c&&u&&D(new MouseEvent(`mousemove`,{clientX:u.clientX,clientY:u.clientY,ctrlKey:e.type===`keydown`}))},N=gI().container(()=>t.viewport).filter(e=>{let{mode:t,tool:n,spacePan:r}=i.getState();return e.button===0&&t===`edit`&&n===`move`&&!r}).touchable(!1).on(`start`,e=>{w(e.sourceEvent),addEventListener(`keydown`,j,!0),addEventListener(`keydown`,M),addEventListener(`keyup`,M)}).on(`drag`,e=>{let t=e.sourceEvent;if(u=t,a.kind===`divider`)n.splitAt(t.clientX);else{if(!c){if(Math.hypot(t.clientX-s.x,t.clientY-s.y)<=3)return;c=!0,T()}D(t)}}).on(`end`,e=>{removeEventListener(`keydown`,j,!0),removeEventListener(`keydown`,M),removeEventListener(`keyup`,M),k(e.sourceEvent),u=null}),P=e=>{e.ctrlKey&&e.button===0&&e.preventDefault()},F=YF(e);return F.call(N),e.addEventListener(`contextmenu`,P),()=>{F.on(`.drag`,null),e.removeEventListener(`contextmenu`,P),removeEventListener(`keydown`,j,!0),removeEventListener(`keydown`,M),removeEventListener(`keyup`,M)}}function wW(){let e=document.activeElement;return e instanceof HTMLElement&&e.matches(`input, textarea`)&&e.closest(`[data-inspector]`)?e:null}function TW(e,t){return t.x>=e.x&&t.x<=e.x+e.width&&t.y>=e.y&&t.y<=e.y+e.height}function EW(e,t,n){return[...e.querySelectorAll(t)].reverse().find(e=>{let{left:t,right:r,top:i,bottom:a}=e.getBoundingClientRect();return n.clientX>=t&&n.clientX<=r&&n.clientY>=i&&n.clientY<=a})??null}function DW(e){return{x:Math.round(e.x),y:Math.round(e.y),width:Math.max(1,Math.round(e.width)),height:Math.max(1,Math.round(e.height))}}function OW(e,t){return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),width:Math.abs(e.x-t.x),height:Math.abs(e.y-t.y)}}var kW=/^#[0-9a-f]{6}$/i,AW=`flex h-[26px] items-center gap-2 rounded-md bg-input px-2 text-xs`,jW=`-ml-1 max-w-max truncate rounded-[4px] bg-[color-mix(in_srgb,var(--foreground)_9%,transparent)] px-1.5 py-px`,MW=`shadow-[inset_0_0_0_1px_var(--faint)]`;function NW(e,t){let n=`token`in e?`var(${e.token})`:e.raw;if(t>=100)return n;if(`raw`in e&&kW.test(e.raw)){let n=Math.round(t/100*255).toString(16).padStart(2,`0`);return`${e.raw}${n}`}return`color-mix(in srgb, ${n} ${t}%, transparent)`}function PW(e,t,n){return e.find(e=>e.name===t)?.[n]??null}function FW(e,t,n){let r=e.token?PW(t,e.token,n):e.value;return r===null?null:e.percent>=100?r:`color-mix(in srgb, ${r} ${e.percent}%, transparent)`}function IW(e){return e.replace(/^--/,``)}var LW={phone:{width:390,height:844},tablet:{width:834,height:1194},desktop:{width:1440,height:900}},RW=[{name:`small-phone`,label:`Small phone`,group:`phone`,width:375,height:667},{name:`iphone-16`,label:`iPhone 16`,group:`phone`,width:393,height:852},{name:`android`,label:`Android`,group:`phone`,width:412,height:917},{name:`iphone-16-pro-max`,label:`iPhone 16 Pro Max`,group:`phone`,width:440,height:956},{name:`ipad-mini`,label:`iPad mini`,group:`tablet`,width:744,height:1133},{name:`ipad-pro-12-9`,label:`iPad Pro 12.9`,group:`tablet`,width:1024,height:1366},{name:`macbook-air`,label:`MacBook Air`,group:`desktop`,width:1280,height:832},{name:`full-hd`,label:`Full HD`,group:`desktop`,width:1920,height:1080},{name:`slide-16-9`,label:`Slide 16:9`,group:`slide`,width:1920,height:1080},{name:`slide-4-3`,label:`Slide 4:3`,group:`slide`,width:1024,height:768}];[...RW.map(e=>e.name)];var zW=`desktop`;function BW(e){return Object.hasOwn(LW,e)}function VW(e){let{width:t,height:n}=BW(e)?LW[e]:RW.find(t=>t.name===e)??LW.desktop;return{width:t,height:n}}var HW=200,UW={width:800,height:600},WW=N()(()=>({tool:`frame`}));function GW(){return F(WW,e=>e.tool)}var KW=N()(()=>({name:null}));function qW(){return F(KW,e=>e.name)}function JW(e){KW.setState({name:e})}function YW(){KW.setState({name:null})}function XW(e){let t=eN(e.map(e=>e.box));return t?{x:Math.round(t.x-40),y:Math.round(t.y-HW),width:Math.round(t.width+80),height:Math.round(t.height+40+HW)}:null}var ZW=[{name:`Left`,key:`ArrowLeft`,dx:-1,dy:0},{name:`Right`,key:`ArrowRight`,dx:1,dy:0},{name:`Up`,key:`ArrowUp`,dx:0,dy:-1},{name:`Down`,key:`ArrowDown`,dx:0,dy:1}];function QW(e){let{selection:t,mode:n,live:r,calls:i}=e,a=()=>n.getState().mode===`edit`&&r.getState().canWrite&&!t.getState().element,o=()=>{let{page:n,frames:r}=t.getState();return n===e.page()?e.frames().filter(e=>r.includes(e.ref)):[]},s=()=>{let{page:n,section:r}=t.getState();if(n===e.page()&&r!==void 0)return e.sections().find(e=>e.name===r)},c=()=>a()&&s()!==void 0,l=t=>aN(e.frames()).filter(e=>t.frames.includes(e.name)),u=()=>{let e=s();return a()&&e!==void 0&&l(e).every(e=>!e.locked)},d=!1,f=(t,n)=>{let r=s();if(!r||d)return;let i=l(r),a=e=>({...e,x:e.x+t,y:e.y+n});d=!0,(e.write??fN)(e.page(),Object.fromEntries(i.map(e=>[e.ref,a(e.box)])),Object.fromEntries(i.map(e=>[e.ref,e.box])),void 0,{boxes:{[r.name]:a(r.box)},expected:{[r.name]:r.box}}).finally(()=>{d=!1})};return[{id:`section.wrap`,label:`Wrap in section`,group:`frame`,command:{label:`Wrap frames in a section`,icon:vr},keys:[`$mod+Alt+KeyG`],enabled:()=>a()&&o().length>0,run:()=>{let n=XW(o());if(!n)return;let r=e.page();i.addSection(r,n).then(e=>ON(t,r,e.name)).catch(Ck(`Couldn't wrap in a section`))}},{id:`section.rename`,label:`Rename section`,group:`section`,command:{label:`Rename section`,icon:br},keys:[`F2`],enabled:c,run:()=>{let e=s();e&&JW(e.name)}},{id:`section.delete`,label:`Delete section`,group:`section`,command:{label:`Delete section, keeping its frames`,icon:bi},keys:[`Backspace`,`Delete`],enabled:c,run:()=>{let n=s();n&&i.deleteSection(e.page(),n.name).then(()=>jN(t)).catch(Ck(`Couldn't delete ${n.name}`))}},...ZW.flatMap(({name:e,key:t,dx:n,dy:r})=>[{id:`section.nudge${e}`,label:`Nudge section ${e.toLowerCase()}`,group:`section`,keys:[t],enabled:u,run:()=>f(n,r)},{id:`section.nudge${e}Far`,label:`Nudge section ${e.toLowerCase()} 10 px`,group:`section`,keys:[`Shift+${t}`],enabled:u,run:()=>f(n*10,r*10)}]),{id:`tool.section`,label:`Section`,group:`tool`,command:{label:`Draw a section`,icon:vr},keys:[`Shift+KeyS`],enabled:()=>r.getState().canWrite,run:()=>{WW.setState({tool:`section`}),n.setState({tool:`section`,mode:`edit`})},checked:()=>n.getState().mode===`edit`&&n.getState().tool===`section`}]}async function $W(e,t,{calls:n=gk,selection:r=HN,mode:i=qg}={}){try{let a=await n.addSection(e,{x:Math.round(t.x),y:Math.round(t.y),width:Math.round(t.width??UW.width),height:Math.round(t.height??UW.height)});return ON(r,e,a.name),i.setState({tool:`move`}),a}catch(e){return Ck(`Couldn't add a section`)(e),null}}function eG(e,t,n){let r=(0,_.useRef)({page:e,frames:t,sections:n});(0,_.useEffect)(()=>{r.current={page:e,frames:t,sections:n}},[e,t,n]),(0,_.useEffect)(()=>{let e=xe(QW({page:()=>r.current.page,frames:()=>r.current.frames,sections:()=>r.current.sections,selection:HN,mode:qg,live:Lg,calls:gk})),t=[HN.subscribe(U),qg.subscribe(U),Lg.subscribe((e,t)=>{U(),e.canWrite!==t.canWrite&&!e.canWrite&&qg.getState().tool===`section`&&qg.setState({tool:`move`})})];return()=>{for(let e of t)e();e()}},[])}var tG=N()(()=>({preset:zW}));function nG(){return F(tG,e=>e.preset)}function rG(e){tG.setState({preset:e})}var iG=`frame`;async function aG(e,{page:t,frames:n,preset:r=tG,selection:i=HN,mode:a=qg,calls:o=gk,visible:s,view:c=a_}){let{width:l,height:u}=e,d=l===void 0||u===void 0?null:{width:l,height:u},f=r.getState().preset,p=vk(d?iG:f,n.map(e=>e.name));try{let n=await o.addFrame(`${t}/${p}`,d??VW(f),Math.round(e.x),Math.round(e.y));return DN(i,t,[n.ref]),a.setState({tool:`move`}),s&&!oG(n.box,s)&&c.centerOn(n.box),n}catch(e){return Ck(`Couldn't add a frame`)(e),null}}function oG(e,t){return e.x>=t.x&&e.y>=t.y&&e.x+e.width<=t.x+t.width&&e.y+e.height<=t.y+t.height}var sG=()=>Lg.getState().canWrite;function cG(){(0,_.useEffect)(()=>{let e=xe([{id:`tool.frame`,label:`Frame`,group:`tool`,command:{label:`Add a frame`,icon:bn},keys:[`f`],enabled:sG,run:()=>{WW.setState({tool:`frame`}),qg.setState({tool:`frame`,mode:`edit`})},checked:()=>qg.getState().mode===`edit`&&qg.getState().tool===`frame`}]),t=Lg.subscribe((e,t)=>{e.canWrite!==t.canWrite&&(U(),!e.canWrite&&qg.getState().tool===`frame`&&qg.setState({tool:`move`}))});return()=>{t(),e()}},[])}function lG(e,t=uG){let n=Rg(e=>e.board),[r,i]=(0,_.useState)();return(0,_.useEffect)(()=>{let n=!0;return t(e).catch(()=>null).then(e=>{n&&i(e)}),()=>{n=!1}},[e,n,t]),r}async function uG(e){let t=await(await fetch(`/api/projects/${encodeURIComponent(e)}/tokens`)).json();return t.ok?t.data:null}var dG=[{family:`Geist`,package:`@fontsource-variable/geist`,packageFamily:`Geist Variable`,folder:`geist`,weights:{min:100,max:900},fallback:`sans-serif`,startsLook:!0},{family:`Geist Mono`,package:`@fontsource-variable/geist-mono`,packageFamily:`Geist Mono Variable`,folder:`geist-mono`,weights:{min:100,max:900},fallback:`monospace`,startsLook:!0},{family:`Inter`,package:`@fontsource-variable/inter`,packageFamily:`Inter Variable`,folder:`inter`,weights:{min:100,max:900},fallback:`sans-serif`,startsLook:!0},{family:`Source Serif 4`,package:`@fontsource-variable/source-serif-4`,packageFamily:`Source Serif 4 Variable`,folder:`source-serif-4`,weights:{min:200,max:900},fallback:`serif`,startsLook:!0},{family:`Caveat`,package:`@fontsource-variable/caveat`,packageFamily:`Caveat Variable`,folder:`caveat`,weights:{min:400,max:700},fallback:`cursive`,startsLook:!1}],fG=`/frameboard/faces`;function pG(e){return`${fG}/${e.folder}/index.css`}function mG(e){return`${/\s/.test(e.family)?`'${e.family}'`:e.family}, ${e.fallback}`}var hG={blue:{light:`#2f7bf0`,dark:`#4e92f6`},red:{light:`#e5484d`,dark:`#ff6369`},green:{light:`#30a46c`,dark:`#3dd68c`},orange:{light:`#f76b15`,dark:`#ff801f`},purple:{light:`#8e4ec6`,dark:`#9a5cd0`}},gG=Object.fromEntries(dG.filter(e=>e.startsLook).map(e=>[e.folder,{family:e.family,stack:mG(e)}])),_G={accent:`blue`,font:`geist`},vG=`untitled`,yG=`page-1`;function bG(e,t){if(!e||!t)return!1;let[n,...r]=e.projects;if(!n||r.length>0||n.name!==`untitled`)return!1;let[i,...a]=n.pages;return i!==void 0&&a.length===0&&i.name===`page-1`&&i.frames.length===0}var xG={phase:`idle`,project:null,at:0,withLook:null,name:null,size:`phone`,accent:_G.accent,font:_G.font,drawer:`agent`,refusal:null,busy:!1,moved:!1,landing:!1},SG=N()(()=>xG);function CG(e){let t=Rg(e=>e.board),n=Rg(e=>e.canWrite),r=F(SG,e=>e.phase),i=F(SG,e=>e.project);return!n||e.frames.length>0?!1:r===`open`?e.project===i:r===`idle`&&bG(t,n)}function wG(e){SG.setState({landing:e===`/`})}function TG(){let e=Rg(e=>e.board),t=Rg(e=>e.canWrite),n=Rg(e=>e.accessKnown),r=F(SG,e=>e.landing),i=F(SG,e=>e.phase),[,a]=ya(),o=i===`idle`&&bG(e,t),s=e!==null&&n;return(0,_.useEffect)(()=>{r&&s&&(SG.setState({landing:!1}),o&&a(Qg(vG,yG),{replace:!0}))},[r,s,o,a]),r&&(!s||o)}function EG(e){return e.trim().toLowerCase().replace(/[^a-z0-9._-]+/g,`-`).replace(/^-+|-+$/g,``)}function DG(e){let t=e.replace(/\/+$/,``),n=t.lastIndexOf(`/`);return t.slice(n+1)===`.frameboard`?n>0?t.slice(0,n):`/`:e}function OG(e,t){return`Draw a ${e} screen for ${t} on frameboard`}var kG={phone:`Phone`,tablet:`Tablet`,desktop:`Desktop`},AG={phone:`h-9 w-5`,tablet:`h-[38px] w-[30px]`,desktop:`h-[30px] w-[46px]`},jG={blue:`Blue`,red:`Red`,green:`Green`,orange:`Orange`,purple:`Purple`};function MG({page:e,calls:t=gk,loadTokens:n}){let r=F(SG),i=lG(e.project,n),a=Rg(e=>e.board?.root??``),[,o]=ya(),s=(0,_.useRef)(null),c=r.project??e.project,l=r.withLook??(i==null||i.sheets.length===0),u=l?[`name`,`size`,`look`,`agent`]:[`name`,`size`,`agent`],d=Math.min(r.at,u.length-1),f=u[d]??`name`,p=r.name??c,m=EG(p);(0,_.useEffect)(()=>{r.moved&&(s.current?.focus(),SG.setState({moved:!1}))},[r.moved]);let h=e=>SG.setState(e),g=()=>h({phase:`open`,project:c,withLook:l,refusal:null}),v=()=>h({at:d+1,refusal:null,busy:!1,moved:!0}),y=(e,t)=>{e instanceof cx?h({refusal:e.message,busy:!1}):(h({busy:!1}),Ck(t)(e))},b=async()=>{if(l)try{await t.projectTokens(c,{accent:r.accent,font:r.font})}catch(e){if(!(e instanceof cx&&e.code===`tokens-exist`))return h({busy:!1}),Ck(`Couldn't write ${c}/tokens.css`)(e)}if(r.drawer===`self`){rG(r.size);let n=await aG({x:0,y:0},{page:e.ref,frames:e.frames,calls:t});n&&a_.fitTo([n.box])}h({phase:`done`,busy:!1}),tg.add({title:`Board set up`,description:r.drawer===`self`?`Added a ${r.size} frame to ${e.name}.`:`Paste the prompt into Claude Code to draw the first frame of ${c}.`,type:`success`})},x=async()=>{if(!r.busy){if(g(),h({busy:!0}),f===`name`){if(m===``)return h({refusal:`Enter a name for the project.`,busy:!1});if(m===c)return v();try{await t.renameProject(c,m)}catch(e){return y(e,`Couldn't rename ${c}`)}return Mk(c,m),h({project:m,name:null}),o(Qg(m,e.name),{replace:!0}),v()}if(f===`agent`)return b();v()}};return(0,X.jsxs)(`section`,{"aria-labelledby":`guide-title`,className:`pointer-events-auto absolute top-1/2 left-1/2 w-110 max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-[52%] overflow-hidden rounded-[14px] border border-border bg-card text-body text-card-foreground shadow-[0_16px_48px_rgba(0,0,0,.16),0_1px_3px_rgba(0,0,0,.08)]`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 px-4 pt-3.5`,children:[(0,X.jsx)(`h2`,{id:`guide-title`,className:`text-sm font-semibold`,children:`Set up your board`}),(0,X.jsxs)(`span`,{className:`ml-auto text-muted-foreground tabular-nums`,children:[d+1,` of `,u.length]})]}),(0,X.jsx)(`div`,{"aria-hidden":!0,className:`flex gap-1 px-4 pt-2.5`,children:u.map((e,t)=>(0,X.jsx)(`i`,{className:Q(`h-[3px] flex-1 rounded-sm`,t<=d?`bg-primary`:`bg-muted`)},e))}),(0,X.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),x()},children:[(0,X.jsxs)(`div`,{className:`p-4`,children:[(0,X.jsx)(`h3`,{ref:s,id:`guide-step`,tabIndex:-1,className:`mb-1 text-base font-semibold outline-none`,children:NG[f]}),f===`name`?(0,X.jsx)(RG,{name:p,project:c,folder:m,refusal:r.refusal,onChange:e=>h({name:e,refusal:null})}):f===`size`?(0,X.jsx)(BG,{size:r.size,page:e.name,onChange:e=>h({size:e})}):f===`look`?(0,X.jsx)(VG,{accent:r.accent,font:r.font,project:c,refusal:r.refusal,onChange:e=>h(e)}):(0,X.jsx)(HG,{drawer:r.drawer,folder:DG(a),sheet:l?`${c}/tokens.css`:null,prompt:OG(r.size,c),size:r.size,page:e.name,onChange:e=>h({drawer:e})})]}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2 border-t border-border px-4 py-3`,children:[(0,X.jsx)(`button`,{type:`button`,onClick:()=>h({phase:`done`}),className:`h-[30px] rounded-lg px-1 text-muted-foreground outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50`,children:`Skip setup`}),d>0?(0,X.jsx)(`button`,{type:`button`,onClick:()=>h({at:d-1,refusal:null,moved:!0}),className:`ml-auto h-[30px] rounded-lg bg-muted px-3 font-medium outline-none hover:bg-accent focus-visible:ring-3 focus-visible:ring-ring/50`,children:`Back`}):null,(0,X.jsx)(`button`,{type:`submit`,"aria-disabled":r.busy,className:Q(`h-[30px] rounded-lg bg-primary px-3 font-medium text-primary-foreground outline-none hover:bg-primary/85 focus-visible:ring-3 focus-visible:ring-ring/50 aria-disabled:opacity-60`,d===0&&`ml-auto`),children:f===`agent`?`Finish`:`Next`})]})]})]})}var NG={name:`What are you designing?`,size:`Which screen first?`,look:`Pick a starting look`,agent:`Who draws the first frame?`};function PG({children:e}){return(0,X.jsx)(`p`,{className:`leading-[1.55] text-muted-foreground`,children:e})}function FG({children:e}){return(0,X.jsx)(`p`,{className:`mt-2.5 flex flex-wrap items-center gap-1.5 text-label font-normal text-muted-foreground`,children:e})}function IG({children:e,className:t}){return(0,X.jsx)(`code`,{className:Q(`rounded bg-muted px-[5px] py-px font-mono text-[10.5px]`,t),children:e})}function LG({id:e,children:t}){return(0,X.jsx)(`p`,{id:e,role:`alert`,className:`mt-1.5 text-label leading-[1.45] font-normal text-destructive`,children:t})}function RG({name:e,project:t,folder:n,refusal:r,onChange:i}){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(PG,{children:`Give the project a name. You can rename it any time from the header.`}),(0,X.jsx)(`input`,{autoFocus:!0,"aria-labelledby":`guide-step`,"aria-invalid":r!==null,"aria-describedby":r?`guide-refusal`:void 0,value:e,spellCheck:!1,onChange:e=>i(e.target.value),className:`mt-3 h-[34px] w-full rounded-lg bg-background px-2.5 text-[13px] text-foreground ring-[1.5px] ring-primary outline-none selection:bg-primary/45 aria-invalid:ring-destructive`}),r?(0,X.jsx)(LG,{id:`guide-refusal`,children:r}):null,(0,X.jsx)(FG,{children:n===t||n===``?(0,X.jsxs)(X.Fragment,{children:[`Keeps `,(0,X.jsxs)(IG,{children:[t,`/`]})]}):(0,X.jsxs)(X.Fragment,{children:[`Renames `,(0,X.jsxs)(IG,{children:[t,`/`]}),` to `,(0,X.jsxs)(IG,{children:[n,`/`]})]})})]})}function zG({group:e,checked:t,onSelect:n,className:r,children:i,label:a,labelledBy:o,disabled:s=!1}){return(0,X.jsxs)(`label`,{className:Q(`relative has-checked:border-primary has-checked:shadow-[0_0_0_1px_var(--primary)] has-[input:focus-visible]:ring-3 has-[input:focus-visible]:ring-ring/50 has-disabled:opacity-60`,r),children:[(0,X.jsx)(`input`,{type:`radio`,name:e,checked:t,onChange:n,disabled:s,"aria-label":a,"aria-labelledby":o,className:`peer sr-only`}),i]})}function BG({size:e,page:t,onChange:n}){let r=Object.keys(LW);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(PG,{children:`Sets the size of your first frame. Add other sizes later from the Frame tool.`}),(0,X.jsx)(`div`,{role:`radiogroup`,"aria-labelledby":`guide-step`,className:`mt-3 grid grid-cols-3 gap-2`,children:r.map(t=>(0,X.jsxs)(zG,{group:`guide-size`,checked:e===t,onSelect:()=>n(t),className:`flex flex-col items-center gap-2 rounded-[10px] border border-border px-2 pt-3.5 pb-2.5 text-muted-foreground has-checked:text-primary`,children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:Q(`rounded border-[1.5px] border-current`,AG[t])}),(0,X.jsx)(`b`,{className:`font-semibold text-foreground`,children:kG[t]}),LW[t].width,` × `,LW[t].height]},t))}),(0,X.jsxs)(FG,{children:[`Sizes the first frame on `,(0,X.jsx)(IG,{children:t})]})]})}function VG({accent:e,font:t,project:n,refusal:r,onChange:i}){let a=Object.keys(hG),o=Object.keys(gG);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(PG,{children:`Every frame in this project reads these tokens, in light and dark. The Theme tab shows them.`}),(0,X.jsxs)(`div`,{className:`mt-3 grid grid-cols-2 gap-2`,children:[(0,X.jsxs)(`div`,{className:`rounded-lg bg-muted px-2.5 py-2`,children:[(0,X.jsx)(`span`,{id:`guide-accent`,className:`mb-1.5 block text-label font-normal text-muted-foreground`,children:`Accent`}),(0,X.jsx)(`div`,{role:`radiogroup`,"aria-labelledby":`guide-accent`,className:`flex gap-1.5`,children:a.map(n=>(0,X.jsx)(zG,{group:`guide-accent`,label:jG[n],checked:e===n,onSelect:()=>i({accent:n,font:t}),className:`size-5 overflow-hidden rounded-[5px] has-checked:shadow-[0_0_0_2px_var(--muted),0_0_0_3.5px_var(--foreground)]`,children:(0,X.jsx)(`span`,{"aria-hidden":!0,className:Q(`absolute inset-0 rounded-[5px] bg-(--swatch) dark:bg-(--swatch-dark)`,MW),style:{"--swatch":hG[n].light,"--swatch-dark":hG[n].dark}})},n))})]}),(0,X.jsxs)(`label`,{className:`rounded-lg bg-muted px-2.5 py-2`,children:[dG.filter(e=>e.startsLook).map(e=>(0,X.jsx)(`link`,{rel:`stylesheet`,href:pG(e)},e.folder)),(0,X.jsx)(`span`,{className:`mb-1.5 block text-label font-normal text-muted-foreground`,children:`Font`}),(0,X.jsxs)(`span`,{className:`relative block`,children:[(0,X.jsx)(`select`,{value:t,onChange:t=>i({accent:e,font:t.target.value}),className:`h-[26px] w-full appearance-none rounded-md bg-card px-2 text-foreground shadow-[0_0_0_1px_var(--border)] outline-none focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-60`,children:o.map(e=>(0,X.jsx)(`option`,{value:e,style:{fontFamily:gG[e].stack},children:gG[e].family},e))}),(0,X.jsx)(jt,{"aria-hidden":!0,className:`pointer-events-none absolute top-1/2 right-2 size-2.5 -translate-y-1/2`})]})]})]}),r?(0,X.jsx)(LG,{id:`guide-refusal`,children:r}):null,(0,X.jsxs)(FG,{children:[`Finish writes `,(0,X.jsxs)(IG,{children:[n,`/tokens.css`]})]})]})}function HG({drawer:e,folder:t,sheet:n,prompt:r,size:i,page:a,onChange:o}){let[s,c]=(0,_.useState)(null),l=`flex gap-2.5 rounded-[10px] border border-border px-3 py-2.5 text-left`,u=`mt-px size-3.5 flex-none rounded-full border-[1.5px] border-muted-foreground peer-checked:border-4 peer-checked:border-primary`;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(PG,{children:`Frameboard is drawn on by a coding agent. You can also start from a blank frame.`}),(0,X.jsxs)(`div`,{role:`radiogroup`,"aria-labelledby":`guide-step`,className:`mt-3 flex flex-col gap-2`,children:[(0,X.jsxs)(zG,{group:`guide-drawer`,checked:e===`agent`,onSelect:()=>o(`agent`),labelledBy:`guide-agent-name guide-agent-hint`,className:l,children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:u}),(0,X.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,X.jsx)(`b`,{id:`guide-agent-name`,className:`mb-0.5 block font-semibold`,children:`My agent`}),(0,X.jsxs)(`span`,{id:`guide-agent-hint`,className:`leading-[1.45] text-muted-foreground`,children:[`Paste this into Claude Code opened in`,` `,(0,X.jsx)(IG,{className:`inline-block max-w-full wrap-anywhere`,children:t})]}),e===`agent`?(0,X.jsxs)(`span`,{className:`mt-2.5 flex items-center gap-2 rounded-lg bg-muted py-2 pr-2 pl-2.5`,children:[(0,X.jsx)(`code`,{className:`min-w-0 flex-1 font-mono text-[11.5px] text-foreground`,children:r}),(0,X.jsx)(`button`,{type:`button`,onClick:()=>void navigator.clipboard.writeText(r).then(()=>c(r),Ck(`Couldn't copy the prompt`)),className:`h-6 rounded-md px-1.5 text-label font-normal text-muted-foreground outline-none hover:bg-accent hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50`,children:s===r?`Copied`:`Copy`})]}):null]})]}),(0,X.jsxs)(zG,{group:`guide-drawer`,checked:e===`self`,onSelect:()=>o(`self`),className:l,children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:u}),(0,X.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,X.jsx)(`b`,{className:`mb-0.5 block font-semibold`,children:`I’ll start myself`}),(0,X.jsxs)(`span`,{className:`leading-[1.45] text-muted-foreground`,children:[`Adds an empty `,i,` frame to `,a,`.`]})]})]})]}),(0,X.jsx)(FG,{children:n===null?e===`agent`?`Writes nothing until your agent draws`:`Writes one frame file`:e===`agent`?(0,X.jsxs)(X.Fragment,{children:[`Finish writes only `,(0,X.jsx)(IG,{children:n})]}):(0,X.jsxs)(X.Fragment,{children:[`Finish writes `,(0,X.jsx)(IG,{children:n}),` and one frame file`]})})]})}function UG(e){let t=new Map;for(let{ref:n,box:r}of e){let i=1/0;for(let t of e)t.ref!==n&&(!(t.box.x<r.x+r.width&&t.box.x+t.box.width>r.x)||t.box.y>=r.y||(i=Math.min(i,Math.max(0,r.y-(t.box.y+t.box.height)))));t.set(n,i)}return t}function WG(e,t,n){for(let r of e.querySelectorAll(`[data-frame]`)){let e=t.get(r.dataset.frame??``)??1/0;r.toggleAttribute(`data-label-crowded`,e*n<20)}}function GG(e,t){for(let n of e.querySelectorAll(`[data-frame]`))n.toggleAttribute(`data-label-hover`,n.dataset.frame===t)}function KG(){return N()(()=>({at:null,frame:null}))}var qG=KG();function JG(e){let{place:t,selection:n,mode:r,live:i,clipboard:a,theme:o,notes:s,calls:c}=e,l=()=>r.getState().mode===`edit`,u=()=>l()&&i.getState().canWrite,d=()=>{let{page:t,frames:r}=n.getState();return t===e.page()?r:[]},f=()=>{let e=d(),n=t.getState().frame;return n&&e.includes(n)?n:e[0]},p=()=>{let e=f();return e?yM(AM(e,o)):null};return[{id:`frame.flipTheme`,get label(){let e=p();return e?`Flip to ${e}`:`Flip frame theme`},group:`frame`,command:{label:`Flip frame theme`,icon:ii},enabled:()=>l()&&d().length>0,run:()=>{let e=p();if(e)for(let t of d())AM(t,o)!==e&&OM(t,o)}},{id:`frame.pasteAt`,label:`Paste here`,group:`frame`,enabled:()=>u()&&a.getState().held>0&&t.getState().at!==null,run:()=>{let{at:r}=t.getState();if(!r)return;let i=e.page();c.pasteFrames(i,{x:Math.round(r.x),y:Math.round(r.y)}).then(e=>DN(n,i,e.map(e=>e.ref)),Ck(`Couldn't paste`))}},{id:`frame.newAt`,label:`New frame here`,group:`frame`,enabled:()=>u()&&t.getState().at!==null,run:()=>{let{at:i}=t.getState();i&&aG(i,{page:e.page(),frames:e.frames(),preset:e.preset,selection:n,mode:r,calls:c})}},{id:`note.addHere`,label:`Add a note here`,group:`note`,enabled:()=>u()&&!!n.getState().element&&d().length>0&&t.getState().at!==null,run:()=>{let{at:i}=t.getState(),{element:a}=n.getState(),o=e.frames().find(e=>e.ref===a?.frame);if(!i||!a||!o)return;let c=e.renderedAt(o.ref);r.setState({tool:`note`}),s.setState({open:{kind:`new`,pick:{frame:{ref:o.ref,name:o.name},element:c?a.index:null,renderedAt:c,at:i}}})}},{id:`note.addOnFrame`,label:`Add a note`,group:`note`,enabled:()=>u()&&t.getState().at!==null&&t.getState().frame!==null,run:()=>{let{at:n,frame:i}=t.getState(),a=e.frames().find(e=>e.ref===i);n&&a&&(r.setState({tool:`note`}),s.setState({open:{kind:`new`,pick:{frame:{ref:a.ref,name:a.name},element:null,renderedAt:null,at:n}}}))}}]}function YG(e,t,n){let r=(0,_.useRef)(e),i=(0,_.useRef)(t),a=(0,_.useRef)(n);(0,_.useEffect)(()=>{r.current=e,i.current=t,a.current=n},[e,t,n]),(0,_.useEffect)(()=>{let e=xe(JG({page:()=>r.current,frames:()=>i.current,renderedAt:e=>a.current(e),place:qG,selection:HN,mode:qg,live:Lg,clipboard:GH,theme:IM,preset:tG,notes:bN,calls:gk})),t=[qG.subscribe(U),IM.subscribe(U),HN.subscribe(U),qg.subscribe(U),GH.subscribe(U),Lg.subscribe(U)];return()=>{for(let e of t)e();e()}},[])}var XG=_.createContext(void 0);function ZG(e=!0){let t=_.useContext(XG);if(t===void 0&&!e)throw Error(La(25));return t}var QG=_.createContext(void 0);function $G(e){let t=_.useContext(QG);if(t===void 0&&!e)throw Error(La(33));return t}var eK=_.createContext(void 0);function tK(e){let t=_.useContext(eK);if(t===void 0&&!e)throw Error(La(36));return t}function nK({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=_.useRef(e!==void 0),[a,o]=_.useState(()=>t);return[i&&e!==void 0?e:a,_.useCallback(e=>{i||o(e)},[])]}var rK=_.createContext(null);function iK(e=`root`){let t=_.useContext(rK),n=_.useContext(eK);return t===null||n===void 0?null:(e===`submenu-trigger`?n.virtualFocus||n.parentVirtualFocus:n.virtualFocus)?t:null}var aK={visible:!0,ref:null};function oK(){return aK}function sK(e,t,n=`root`){let r=iK(n),i=((n===`submenu-trigger`?r?.useSubmenuTrigger:r?.useItem)??oK)({label:e.label,children:e.children,render:e.render}),a=gl(t,i.ref);return{visible:i.visible,ref:a,props:i.props}}function cK(e){e.preventDefault()}function lK(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,l=tK(),u=ZG(!0),d=c.type===`submenu-trigger`,f=d?l.parentVirtualFocus:l.virtualFocus,p=(d&&l.parent.type===`menu`?l.parent.store:l.store).useState(`webkitAriaSelected`,n),{events:m}=a.useState(`floatingTreeRoot`),h=a.useState(`open`),g=u!==void 0,v=!f&&h&&n?0:-1;return _.useMemo(()=>({id:r,role:`menuitem`,tabIndex:v,"aria-selected":p,onMouseDown:f?cK:void 0,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&m.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&m.emit(`close`,{domEvent:e.nativeEvent,reason:rd})},onMouseUp(e){if(u){let t=u.initialCursorPointRef.current;if(u.initialCursorPointRef.current=null,g&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||g&&!as&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!g||e.button===2)&&c.type===`regular-item`&&Gu(s.current,e,{detail:1,pointerType:`mouse`})}}),[t,v,r,m,i,a.context.allowMouseUpTriggerRef,o,s,u,g,c.type,p,f])}var uK={type:`regular-item`};function dK(e){let{closeOnClick:t,disabled:n,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=_.useRef(null),{getButtonProps:d,buttonRef:f}=Ku({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=lK({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=_.useCallback(e=>Ol(p,{onMouseEnter(e){c.type===`submenu-trigger`&&c.setActive(e.nativeEvent)}},e,d),[p,d,c]),h=gl(u,f);return _.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}var fK=_.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function pK(){return _.useContext(fK)}function mK(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=pK(),u=_.useRef(-1),[d,f]=_.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),p=a??d,m=_.useRef(null),h=_.useCallback(e=>{let t=m.current;t&&s(t),m.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return G(()=>{if(a==null)return c(e=>{let t=m.current?e.get(m.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:h,index:p}}var hK=`data-checked`,gK=`data-unchecked`,_K={checked(e){return e?{[hK]:``}:{[gK]:``}},...ws},vK=_.createContext(void 0);function yK(){let e=_.useContext(vK);if(e===void 0)throw Error(La(31));return e}var bK=_.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,[o,s]=_.useState(void 0),c=Vl(`div`,e,{ref:t,props:{role:`group`,"aria-labelledby":o,...a}});return(0,X.jsx)(vK.Provider,{value:s,children:c})}),xK=_.forwardRef(function(e,t){let n=iK()?.Group??bK;return(0,X.jsx)(n,{...e,ref:t})}),SK=_.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=xV(a),c=yK();return G(()=>(c(s),()=>{c(e=>e===s?void 0:e)}),[c,s]),Vl(`div`,e,{ref:t,props:{id:s,"aria-hidden":!0,...o}})}),CK=_.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,{store:d}=tK(),f=mK({guess:!0,label:a}),p=xV(i),m=d.useState(`disabled`),h=d.useState(`isActive`,f.index),g=d.useState(`floatingNodeId`),_=d.useState(`itemProps`),v=s||m,{getItemProps:y,itemRef:b}=dK({closeOnClick:c,disabled:v,highlighted:h,id:p,store:d,nativeButton:o,nodeId:g,itemMetadata:uK});return Vl(`div`,e,{state:{disabled:v,highlighted:h},props:[_,u,y],ref:[b,t,f.ref]})}),wK=_.forwardRef(function(e,t){let n=sK(e,t);return n.visible?(0,X.jsx)(CK,{...e,ref:n.ref}):null}),TK=_.createContext(void 0);function EK(){return _.useContext(TK)}function DK(e,t){let n=Gl(e.render);if(_.isValidElement(n)){let e=n.props;if(Object.hasOwn(e,`id`))return e.id??``}return e.id??t}function OK(e,t,n){let r=DK(e,t),i=r===t?void 0:r;return[r,_.useCallback(e=>n?.(e?i:void 0),[i,n])]}function kK(e,t,n){let r=Gl(e.render),i=_.isValidElement(r)?r.props:void 0,a=e[`aria-label`]??i?.[`aria-label`],o=e[`aria-labelledby`]??i?.[`aria-labelledby`];return o==null&&!a&&(o=t?t.id||void 0:n||void 0),o}var AK=_.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,id:o,initialFocus:s,...c}=e,{store:l,defaultFloatingId:u,setRenderedFloatingId:d,virtualFocus:f,orientation:p}=tK(),m=EK(),{side:h,align:g}=$G(),v=uH(!0)!=null,y=l.useState(`open`),b=l.useState(`transitionStatus`),x=l.useState(`popupProps`),S=l.useState(`mounted`),C=l.useState(`instantType`),w=l.useState(`activeTriggerElement`),T=l.useState(`parent`),E=l.useState(`lastOpenChangeReason`),D=l.useState(`rootId`),O=l.useState(`floatingRootContext`),k=l.useState(`floatingTreeRoot`),A=l.useState(`closeDelay`),j=l.useState(`hoverEnabled`),M=l.useState(`disabled`),N=l.useState(`openMethod`),P=l.useState(`activeTriggerId`),F=l.useState(`listElement`),[I,L]=OK(e,u,d),R=kK(e,w,P),z=T.type===`menu`?m:void 0,ee=T.type===`context-menu`,te=s??T.type!==`menu`;s===void 0&&F&&T.type!==`menu`&&(te=()=>l.state.activeIndex===null&&F),au({open:y,ref:l.context.popupRef,onComplete(){y&&l.context.onOpenChangeComplete?.(!0)}}),_.useEffect(()=>{function e(e){l.setOpen(!1,Z(e.reason,e.domEvent))}return k.events.on(`close`,e),()=>{k.events.off(`close`,e)}},[k.events,l]),lp(O,{enabled:j&&!M&&!ee&&T.type!==`menubar`,closeDelay:A});let ne=l.useStateSetter(`popupElement`),{parentVirtualFocusRef:re,handleFocus:ie}=(_.useContext(rK)?.useParentHandoff??MK)(l,T,y,f),ae=Vl(`div`,e,{state:{transitionStatus:b,side:h,align:g,open:y,nested:T.type===`menu`,instant:C},ref:[t,l.context.popupRef,ne,L],stateAttributesMapping:Rs,props:[x,{id:I,...F?{role:`presentation`}:{role:`menu`,"aria-orientation":p===`horizontal`?`horizontal`:void 0,"aria-labelledby":R},onKeyDown(e){z?.onPopupKeyDown?.(e),v&&nH.has(e.key)&&e.stopPropagation()},onFocus:ie},Xm(b),c,{"data-rootownerid":D}]}),B=T.type===void 0||ee;(w||T.type===`menubar`&&E!==`outside-press`)&&(B=!0);let V=z?.getReturnElement??re;return(0,X.jsx)(bf,{context:O,openInteractionType:N,modal:ee,disabled:!S,returnFocus:a??V??B,explicitReturnFocus:a===void 0&&V?!1:void 0,initialFocus:te,restoreFocus:!0,getInsideElements:T.type===void 0?()=>[l.context.beforeTriggerFocusGuardRef.current]:void 0,externalTree:T.type===`menubar`?void 0:k,previousFocusableElement:w,nextFocusableElement:T.type===void 0?l.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:l.context.beforeContentFocusGuardRef,children:ae})}),jK={parentVirtualFocusRef:void 0,handleFocus:void 0};function MK(){return jK}var NK=_.forwardRef(function(e,t){let n=iK()?.Popup??AK;return(0,X.jsx)(n,{...e,ref:t})}),PK=_.createContext(void 0);function FK(){let e=_.useContext(PK);if(e===void 0)throw Error(La(32));return e}var IK=_.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i,parent:a}=tK();if(!(i.useState(`mounted`)||n))return null;let o=a.type===`menu`||a.type===`menubar`?`group`:void 0;return(0,X.jsx)(PK.Provider,{value:n,children:(0,X.jsx)(kd,{ref:t,...r,portalOwnerRole:o})})});function LK(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=K(i),[,o]=_.useState(0),s=Fa(zK).current,c=Fa(RK).current,l=_.useRef(0),u=_.useRef(!0),d=_.useRef(null),f=_.useRef(null),p=K(()=>{u.current||(u.current=!0,o(e=>e+1))}),m=K((e,t)=>{c.set(e,t),p()}),h=K(e=>{c.delete(e),p()}),g=K(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function v(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!HK(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&UK(r,n)>0){t.disconnect(),p();return}r=n}});f.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=VK(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let y=K(()=>{let[e,t]=BK(c),n=g(e),r=d.current,i=!r||r.length!==e.length||e.some((e,t)=>{let n=r[t];return e.index!==n.index||e.element!==n.element||e.registration.index!==n.registration.index||e.registration.metadata!==n.registration.metadata});v(t),d.current=e,u.current=!1,i&&(s.forEach(e=>e(n)),a(n))});G(()=>(!u.current&&d.current&&g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),G(()=>{u.current&&y()}),G(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let b=K(e=>(s.add(e),()=>{s.delete(e)})),x=_.useMemo(()=>({register:m,unregister:h,subscribeMapChange:b,nextIndexRef:l}),[m,h,b,l]);return(0,X.jsx)(fK.Provider,{value:x,children:t})}function RK(){return new Map}function zK(){return new Set}function BK(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>UK(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function VK(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function HK(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function UK(e,t){return e.nextElementSibling===t?-1:t.nextElementSibling===e?1:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var WK=_.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=fu,style:g,...v}=e,{store:y,virtualFocus:b,syncHighlightedItem:x}=tK(),S=FK(),C=ZG(!0),w=y.useState(`parent`),T=y.useState(`floatingRootContext`),E=y.useState(`floatingTreeRoot`),D=y.useState(`mounted`),O=y.useState(`open`),k=y.useState(`modal`),A=y.useState(`openMethod`),j=y.useState(`activeTriggerElement`),M=y.useState(`transitionStatus`),N=y.useState(`positionerElement`),P=y.useState(`instantType`),F=y.useState(`adaptiveOrigin`),I=y.useState(`lastOpenChangeReason`),L=y.useState(`floatingNodeId`),R=y.useState(`floatingParentNodeId`),z=T.useState(`domReferenceElement`),ee=n,te=c,ne=l,re=s,ie=h;w.type===`context-menu`&&(ee=n??w.context?.anchor,re??=`start`,!o&&re!==`center`&&(ne=e.alignOffset??2,te=e.sideOffset??-5));let ae=o,B=re;w.type===`menu`?(ae??=`inline-end`,B??=`start`,ie=e.collisionAvoidance??pu):w.type===`menubar`&&(ae??=w.context.orientation===`vertical`?`inline-end`:`bottom`,B??=`start`);let V=w.type===`context-menu`,oe=qm({anchor:ee,floatingRootContext:T,positionMethod:C?`fixed`:r,mounted:D,side:ae,sideOffset:te,align:B,alignOffset:ne,arrowPadding:V?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:L,keepMounted:S,disableAnchorTracking:m,collisionAvoidance:ie,shift:V?{crossAxis:!(`side`in ie&&ie.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:E,adaptiveOrigin:F,lazyFlip:b?`placement`:!1});_.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===L&&y.set(`hoverEnabled`,!1),e.nodeId!==L&&e.parentNodeId===y.select(`floatingParentNodeId`)&&y.setOpen(!1,Z(yd)))}return E.events.on(`menuopenchange`,e),()=>{E.events.off(`menuopenchange`,e)}},[y,E.events,L]),_.useEffect(()=>{if(y.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==y.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;y.setOpen(!1,Z(t))}return E.events.on(`menuopenchange`,e),()=>{E.events.off(`menuopenchange`,e)}},[E.events,y]);let se=Wo();_.useEffect(()=>{O||se.clear()},[O,se]),_.useEffect(()=>{function e(e){if(O&&e.nodeId===y.select(`floatingParentNodeId`)){if(e.target&&j&&j!==e.target){let e=y.select(`closeDelay`);e>0?se.isStarted()||se.start(e,()=>{y.setOpen(!1,Z(yd))}):y.setOpen(!1,Z(yd))}else se.clear()}}return E.events.on(`itemhover`,e),()=>{E.events.off(`itemhover`,e)}},[E.events,O,j,y,se]),_.useEffect(()=>{let e={open:O,nodeId:L,parentNodeId:R,reason:y.select(`lastOpenChangeReason`)};E.events.emit(`menuopenchange`,e)},[E.events,O,y,L,R]),PV({store:y,domReference:z,positionerElement:N,open:O});let ce={open:O,side:oe.side,align:oe.align,anchorHidden:oe.anchorHidden,nested:w.type===`menu`,instant:P},H=w.type===`menubar`&&w.context.modal;qV(O&&(H||k&&I!==`trigger-hover`),A===`touch`,N,j);let le=Zm(e,ce,{styles:oe.positionerStyles,transitionStatus:M,props:v,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!D,inert:!O}),ue=D&&w.type!==`menu`&&(w.type!==`menubar`&&k&&I!==`trigger-hover`||w.type===`menubar`&&w.context.modal),de=null;return w.type===`menubar`?de=w.context.contentElement:w.type===void 0&&(de=j),(0,X.jsxs)(QG.Provider,{value:oe,children:[ue&&(0,X.jsx)(NV,{ref:w.type===`context-menu`||w.type===`nested-context-menu`?w.context.internalBackdropRef:null,inert:Xl(!O),cutout:de}),(0,X.jsx)(uf,{id:L,children:(0,X.jsx)(LK,{elementsRef:y.context.itemDomElements,labelsRef:y.context.itemLabels,onMapChange:x,children:le})})]})}),GK=_.createContext(void 0);function KK(){let e=_.useContext(GK);if(e===void 0)throw Error(La(34));return e}var qK=_.forwardRef(function(e,t){let{render:n,className:r,value:i,defaultValue:a,onValueChange:o,disabled:s=!1,style:c,"aria-labelledby":l,...u}=e,[d,f]=_.useState(void 0),[p,m]=nK({controlled:i,default:a,name:`MenuRadioGroup`}),h=K((e,t)=>{o?.(e,t),!t.isCanceled&&m(e)}),g=Vl(`div`,e,{state:{disabled:s},ref:t,props:{role:`group`,"aria-labelledby":l??d,"aria-disabled":s||void 0,...u}}),v=_.useMemo(()=>({value:p,setValue:h,disabled:s}),[p,h,s]);return(0,X.jsx)(vK.Provider,{value:f,children:(0,X.jsx)(GK.Provider,{value:v,children:g})})}),JK=_.memo(_.forwardRef(function(e,t){let n=iK()?.RadioGroup??qK;return(0,X.jsx)(n,{...e,ref:t})})),YK=_.createContext(void 0);function XK(){let e=_.useContext(YK);if(e===void 0)throw Error(La(35));return e}var ZK=_.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!1,value:l,style:u,...d}=e,{store:f}=tK(),{value:p,setValue:m,disabled:h}=KK(),g=mK({guess:!0,label:a}),v=xV(i),y=f.useState(`isActive`,g.index),b=f.useState(`floatingNodeId`),x=f.useState(`itemProps`),S=f.useState(`disabled`),C=s||h||S,w=p===l,{getItemProps:T,itemRef:E}=dK({closeOnClick:c,disabled:C,highlighted:y,id:v,store:f,nativeButton:o,nodeId:b,itemMetadata:uK}),D=_.useMemo(()=>({disabled:C,highlighted:y,checked:w}),[C,y,w]);function O(e){let t=Z(rd,e.nativeEvent,void 0,{preventUnmountOnClose:Aa});m(l,t)}let k=Vl(`div`,e,{state:D,stateAttributesMapping:_K,props:[x,{role:`menuitemradio`,"aria-checked":w,onClick:O},d,T],ref:[E,t,g.ref]});return(0,X.jsx)(YK.Provider,{value:D,children:k})}),QK=_.forwardRef(function(e,t){let n=sK(e,t);return n.visible?(0,X.jsx)(ZK,{...e,ref:n.ref}):null}),$K=_.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,s=XK(),c=_.useRef(null),{transitionStatus:l,mounted:u,setMounted:d}=kf(s.checked);return au({batch:!0,enabled:!s.checked,open:s.checked,ref:c,onComplete(){s.checked||d(!1)}}),Vl(`span`,e,{state:{checked:s.checked,disabled:s.disabled,highlighted:s.highlighted,transitionStatus:l},stateAttributesMapping:_K,ref:[t,c],props:{"aria-hidden":!0,...o},enabled:a||u})}),eq=_.createContext(null);function tq(e){let t=_.useContext(eq);if(t===null&&!e)throw Error(La(5));return t}function nq(e){return e==null?Qu:e.type.startsWith(`key`)?pd:e.type.startsWith(`mouse`)||e.type.startsWith(`pointer`)?md:Qu}var rq={...ep,disabled:e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0),openMethod:e=>e.openMethod,keyboardOpen:e=>e.keyboardOpen,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId,activeIndex:e=>e.activeIndex,listElement:e=>e.listElement,triggerControlsId:(e,t)=>{let n=ep.triggerPopupId(e,t);return n?e.listElement?.id||n:void 0},filterTriggerProps:e=>e.filterTriggerProps,inputProps:e=>e.inputProps,webkitAriaSelected:(e,t)=>ss&&e.inputFocused&&t?!0:void 0,highlightedItemId:e=>e.highlightedItem?.id||void 0,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType===`trigger-change`&&!ep.open(e)?void 0:e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)}},iq=class extends lo{constructor(e,t,n=!1){let r=new Gf,i=oq(r,t,n,e);super(i,aq(r),rq),this.observe(`parent`,e=>{e.type===`menu`?this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef:e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef)})}subscribeToParentMenu(){let e=this.state.parent;if(e.type!==`menu`)return;let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);return e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);(t!==i||n!==a||r!==o)&&(t=i,n=a,r=o,this.notifyAll())})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}setActiveIndex(e,t,n){if(this.state.activeIndex!==e){let r=(e===null?void 0:this.context.itemDomElements.current[e])===this.context.reportedItem;this.context.highlightReason=r?`none`:t,this.context.highlightEvent=r?void 0:n}this.set(`activeIndex`,e)}highlightItem(e,t,n){let r=this.context.itemDomElements.current.indexOf(e);r>-1&&this.setActiveIndex(r,t,n)}};function aq(e){return{positionerRef:_.createRef(),popupRef:_.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},highlightReason:`none`,highlightEvent:void 0,reportedItem:void 0,allowMouseUpTriggerRef:{current:!1},virtualFocusRef:void 0,triggerFocusTargetRef:_.createRef(),beforeTriggerFocusGuardRef:_.createRef(),beforeContentFocusGuardRef:_.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function oq(e,t,n=!1,r){return{...Jf(e,t,n),disabled:!1,modal:!0,openMethod:null,keyboardOpen:!1,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,listElement:null,filterTriggerProps:Ma,inputProps:Ma,inputFocused:!1,highlightedItem:void 0,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new rf,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Ma,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}var sq=_.createContext(null);function cq(e,t){return(e===`trigger-press`||e===`item-press`)&&t?.detail===0}function lq(e,t){return e===`list-navigation`||cq(e,t)}var uq=Ja(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,onItemHighlighted:a,defaultOpen:o=!1,disabled:s=!1,modal:c,loopFocus:l=!0,orientation:u=`vertical`,actionsRef:d,closeParentOnEsc:f=!1,handle:p,triggerId:m,defaultTriggerId:h=null,highlightItemOnHover:g=!0,isSubmenu:v=!1,virtualFocus:y=!1,virtualFocusRef:b,allowEscape:x=!0,resetOnPointerLeave:S=!0}=e,C=ZG(!0),w=tK(!0),T=tq(!0),E=w?.store,D=w?.virtualFocus??!1,O=_.useMemo(()=>v&&E?{type:`menu`,store:E}:T?{type:`menubar`,context:T}:C&&!E?{type:`context-menu`,context:C}:{type:void 0},[C,E,T,v]),k=xV(),A=xV(),[j,M]=_.useState(void 0),N=(j??A)||void 0,P=sf(),F=O.type===`menu`?O.store:void 0,I=(n??o)&&F?.state.transitionStatus===`starting`,L=Fa(()=>I?F?.state.instantType:void 0).current,R=Fa(()=>{let e=new iq({open:o,openProp:n,activeTriggerId:h,triggerIdProp:m,parent:O,disabled:s,highlightItemOnHover:g,modal:O.type===void 0?c:void 0,rootId:k,instantType:L},N,P!=null);return e.context.virtualFocusRef=b,e}).current;R.useControlledProp(`openProp`,n),R.useControlledProp(`triggerIdProp`,m),R.useContextCallback(`onOpenChangeComplete`,i);let z=R.useState(`floatingTreeRoot`),ee=lf(z),te=R.useState(`open`),ne=R.useState(`activeTriggerElement`),re=R.useState(`positionerElement`),ie=R.useState(`hoverEnabled`),ae=R.useState(`disabled`),B=R.useState(`lastOpenChangeReason`),V=R.useState(`parent`),oe=R.useState(`activeIndex`),se=R.useState(`keyboardOpen`),ce=R.useState(`payload`),H=R.useState(`floatingParentNodeId`),le=_.useRef(null),ue=_.useRef(V.type!==`context-menu`),de=Wo(),fe=_.useRef(!0),pe=Wo(),me=H!=null,{openMethod:he,triggerProps:ge}=EV(te);R.useSyncedValues({disabled:s,highlightItemOnHover:g,modal:V.type===void 0?c:void 0,openMethod:he,rootId:k}),Vf(R);let{forceUnmount:_e,transitionStatus:ve}=Hf(te,R,()=>{R.set(`allowMouseEnter`,!1)},I),ye=iu(R.context.popupRef);_.useEffect(()=>{if(L===void 0)return;let e=()=>{R.state.instantType===L&&R.set(`instantType`,void 0)};if(!te){e();return}if(ve!==void 0)return;if(R.context.popupRef.current==null){e();return}let t=new AbortController;return ye(e,t.signal),()=>{t.abort()}},[L,te,ve,ye,R]),G(()=>{C&&!w?R.update({parent:{type:`context-menu`,context:C},floatingNodeId:ee,floatingParentNodeId:P}):(w||!R.select(`activeTriggerElement`))&&R.update({floatingNodeId:ee,floatingParentNodeId:P})},[C,w,ee,P,ne,R]),_.useEffect(()=>{te||(le.current=null),V.type===`context-menu`&&(te?de.start(500,()=>{ue.current=!0}):(de.clear(),ue.current=!1))},[de,te,V.type]),G(()=>{!te&&!ie&&R.set(`hoverEnabled`,!0)},[te,ie,R]);let be=K((e,t)=>{let n=t.reason;if(!e&&!R.select(`open`)||te===e&&t.trigger===ne&&B===n)return;let i=Rf(t);if(!e&&t.trigger==null&&(t.trigger=ne??void 0),r?.(e,t),t.isCanceled)return;R.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&n!==`item-press`&&a?.type===`click`&&a.pointerType===`touch`&&!fe.current)return;e&&n===`trigger-focus`?(fe.current=!1,pe.start(300,()=>{fe.current=!0})):(fe.current=!0,pe.clear());let o=!e&&(n===`escape-key`||n==null);le.current=t.event;let s=Lf(R.state,e,t.trigger,i());s.openChangeReason=n,s.keyboardOpen=e&&lq(n,a),s.instantType=V.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?`group`:cq(n,a)?`click`:o?`dismiss`:void 0,R.update(s)}),xe=Of({popupStore:R,floatingRootContext:R.state.floatingRootContext,floatingId:N,nested:P!=null,onOpenChange:be}),U=xe.context.events;G(()=>{let e=({open:e,eventDetails:t})=>be(e,t);return U.on(`setOpen`,e),()=>{U?.off(`setOpen`,e)}},[U,be]),G(()=>R.subscribeToParentMenu(),[R]);let Se=_.useCallback(()=>{R.setOpen(!1,Z(Cd))},[R]);_.useImperativeHandle(d,()=>({unmount:_e,close:Se}),[_e,Se]);let Ce;V.type===`context-menu`&&(Ce=V.context),_.useImperativeHandle(Ce?.positionerRef,()=>re,[re]),_.useImperativeHandle(Ce?.actionsRef,()=>({setOpen:be}),[be]);let we=Df(xe,{enabled:!ae,bubbles:{escapeKey:f&&V.type===`menu`},outsidePress(){return V.type!==`context-menu`||le.current?.type===`contextmenu`||ue.current},externalTree:me?z:void 0}),Te=Nm(),Ee=vp(xe,{enabled:!ae,listRef:R.context.itemDomElements,activeIndex:oe,virtual:y,nested:V.type===`menubar`||!y&&V.type!==void 0,parentOrientation:V.type===`menubar`?V.context.orientation:void 0,loopFocus:l,focusItemOnOpen:y?se:void 0,allowEscape:y&&l&&x,orientation:u,triggerOrientation:y?`vertical`:u,rtl:Te===`rtl`,disabledIndices:ja,onNavigate(e,t){R.setActiveIndex(e,nq(t),t?.nativeEvent)},openOnArrowKeyDown:V.type!==`context-menu`&&!(y&&v),externalTree:!y&&me?z:void 0,nestedReturnFocusRef:F?.context.virtualFocusRef,focusItemOnHover:g,resetOnPointerLeave:S}),De=_.useCallback(e=>{R.context.typingRef.current=e},[R]),Oe=yp(xe,{enabled:!ae&&!y,listRef:R.context.itemLabels,elementsRef:R.context.itemDomElements,activeIndex:oe,resetMs:500,onMatch:(e,t)=>{te&&e!==oe&&R.setActiveIndex(e,pd,t.nativeEvent)},onTyping:De}),ke=K(a),Ae=_.useRef(-1),je=K(()=>{let e=R.state.activeIndex,t=e===null?void 0:R.context.itemDomElements.current[e]??void 0;if(t?.isConnected===!1)return;let n=t===void 0?-1:e;if(Ae.current===n&&R.context.reportedItem===t)return;Ae.current=n,R.context.reportedItem=t,y&&R.set(`highlightedItem`,t);let{highlightReason:r,highlightEvent:i}=R.context;R.context.highlightReason=Qu,R.context.highlightEvent=void 0,a&&ke(t,Zu(r,i,{label:t===void 0?void 0:R.context.itemLabels.current[n]??void 0}))});G(()=>{je()},[oe,je]);let Me=_.useMemo(()=>{if(!y)return Ee.reference;if(!Ee.trigger)return Ma;let{onFocus:e,...t}=Ee.trigger;return t},[y,Ee.reference,Ee.trigger]);R.useSyncedValue(`inputProps`,y?Ee.reference??Ma:Ma);let Ne=_.useMemo(()=>{let e=Ol(Oe.reference,Me,we.reference,{onMouseMove(){R.set(`allowMouseEnter`,!0)}},ge);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=te,e},[R,Oe.reference,Me,we.reference,ge,te]),Pe=_.useMemo(()=>{let e=Ol(Ee.trigger,we.trigger,ge);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[Ee.trigger,we.trigger,ge]);Fa(()=>(R.update({inactiveTriggerProps:Pe}),null)),Uf(R,{floatingRootContext:xe,activeTriggerProps:Ne,inactiveTriggerProps:Pe,popupProps:_.useMemo(()=>Ol(jf,{onMouseMove(){R.set(`allowMouseEnter`,!0),V.type===`menu`&&R.set(`hoverEnabled`,!1)},onClick(){R.select(`hoverEnabled`)&&R.set(`hoverEnabled`,!1)},onKeyDown(e){let t=R.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},Oe.floating,Ee.floating,we.floating),[V.type,R,Oe.floating,Ee.floating,we.floating]),itemProps:Ee.item??Ma});let Fe=_.useMemo(()=>({store:R,parent:O,orientation:u,loopFocus:l,allowEscape:x,defaultFloatingId:A,setRenderedFloatingId:M,virtualFocus:y,parentVirtualFocus:D,syncHighlightedItem:je}),[R,O,u,l,x,A,y,D,je]),Ie=typeof t==`function`?t({payload:ce}):t,Le=(0,X.jsxs)(eK.Provider,{value:Fe,children:[p&&(0,X.jsx)(Pf,{handle:p,store:R}),Ie]});return(V.type===void 0||V.type===`context-menu`)&&(Le=(0,X.jsx)(df,{externalTree:z,children:Le})),Le});function dq(e){let t=_.useContext(sq);if(t===null)return(0,X.jsx)(uq,{...e});let n=t.Root;return(0,X.jsx)(sq.Provider,{value:null,children:(0,X.jsx)(n,{...t.options,...e})})}var fq={};function pq(e){tK();let t=_.useContext(sq);if(t!==null){let n=t.SubmenuRoot;return(0,X.jsx)(sq.Provider,{value:null,children:(0,X.jsx)(n,{...t.options,...e})})}return(0,X.jsx)(TK.Provider,{value:fq,children:(0,X.jsx)(uq,{...e,isSubmenu:!0})})}var mq=5;function hq(e,t){let n=gq(t);return e.clientX>=n.left-mq&&e.clientX<=n.right+mq&&e.clientY>=n.top-mq&&e.clientY<=n.bottom+mq}function gq(e){let t=e.getBoundingClientRect(),n=po(e);if(us)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function _q(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=Uu(),{ref:i,index:a}=mK(e),o=n===a,s=_.useRef(null),c=gl(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}function vq(e){let{render:t,className:n,style:r,state:i=Ma,props:a=ja,refs:o=ja,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=_q({metadata:s});return Vl(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}function yq(e){if(_o(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!ko(e))return yq(Mo(e))}function bq(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=_.useRef(!1);return _.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,q(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:Ma,[t,n,r])}var xq=Ya(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,openOnHover:c,delay:l=100,closeDelay:u=0,handle:d,payload:f,...p}=e,m=tK(!0),h=tp(d)??m?.store;if(!h)throw Error(La(85));let g=xV(s),v=h.useState(`isTriggerActive`,g),y=h.useState(`floatingRootContext`),b=h.useState(`isOpenedByTrigger`,g),x=h.useState(`triggerControlsId`,g),S=_.useRef(null),C=Cq(),w=Uu(!0),T=cf(),E=_.useMemo(()=>T??new rf,[T]),{registerTrigger:D,isMountedByThisTrigger:O}=Bf(g,S,h,{payload:f,closeDelay:u,parent:C,floatingTreeRoot:E,floatingNodeId:lf(E),floatingParentNodeId:sf(),keyboardEventRelay:w?.relayKeyboardEvent}),k=C.type===`menubar`,A=h.useState(`disabled`),j=a||A||k&&C.context.disabled,{getButtonProps:M,buttonRef:N}=Ku({disabled:j,native:o});_.useEffect(()=>{!b&&C.type===void 0&&(h.context.allowMouseUpTriggerRef.current=!1)},[h,b,C.type]);let P=_.useRef(null),F=Wo(),I=K(e=>{if(!P.current)return;F.clear(),h.context.allowMouseUpTriggerRef.current=!1;let t=e.target;Y(P.current,t)||Y(h.select(`positionerElement`),t)||t===P.current||t!=null&&yq(t)===h.select(`rootId`)||hq(e,P.current)||E.events.emit(`close`,{domEvent:e,reason:vd})});_.useEffect(()=>{let e=q(P.current);if(b&&h.select(`lastOpenChangeReason`)===`trigger-hover`)return e.addEventListener(`mouseup`,I,{once:!0}),()=>{e.removeEventListener(`mouseup`,I)}},[b,I,h]);let L=k&&C.context.hasSubmenuOpen,R=dp(y,{enabled:(c??L)&&!j&&(!k||L&&!O),handleClose:Dp({blockPointerEvents:!k}),mouseOnly:!0,move:!1,restMs:C.type===void 0?l:void 0,delay:{close:u},triggerElementRef:S,externalTree:E,isActiveTrigger:v,isClosing:()=>h.select(`transitionStatus`)===`ending`}),z=Sq(b,h.select(`lastOpenChangeReason`)),ee=xf(y,{enabled:!j,event:b&&k?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:C.type===void 0&&z}),te=rp(y,{enabled:!j&&L}),ne=bq({open:b,enabled:k,mouseDownAction:`open`}),re=_.useMemo(()=>Ol(te.reference,ee.reference),[te.reference,ee.reference]),ie=h.useState(`triggerProps`,O),ae=h.useState(`filterTriggerProps`),{handlePreFocusGuardFocus:B,handleFocusTargetFocus:V}=SV(h,S),oe={disabled:j,open:b},se=[P,t,N,D,S],ce=[re,R??Ma,ie,{"aria-haspopup":`menu`,"aria-controls":x,id:g,onMouseDown:e=>{h.select(`open`)||(F.start(200,()=>{h.context.allowMouseUpTriggerRef.current=!0}),q(e.currentTarget).addEventListener(`mouseup`,I,{once:!0}))}},ae,k?{role:`menuitem`}:{},ne,p,M],H=Vl(`button`,e,{enabled:!k,stateAttributesMapping:Is,state:oe,ref:se,props:ce});return k?(0,X.jsx)(vq,{tag:`button`,render:n,className:r,style:i,state:oe,refs:se,props:ce,stateAttributesMapping:Is}):b?(0,X.jsxs)(_.Fragment,{children:[(0,X.jsx)(hl,{ref:h.context.beforeTriggerFocusGuardRef,onFocus:B},`${g}-pre-focus-guard`),(0,X.jsx)(_.Fragment,{children:H},g),(0,X.jsx)(hl,{ref:h.context.triggerFocusTargetRef,onFocus:V},`${g}-post-focus-guard`)]}):(0,X.jsx)(_.Fragment,{children:H},g)});function Sq(e,t){let n=Wo(),[r,i]=_.useState(!1);return G(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function Cq(){let e=tq(!0);return _.useMemo(()=>e?{type:`menubar`,context:e}:{type:void 0},[e])}var wq=_.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return Vl(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})});function Tq(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}var Eq={"aria-expanded":void 0},Dq=_.forwardRef(function(e,t){let{render:n,className:r,style:i,label:a,id:o,nativeButton:s=!1,openOnHover:c=!0,delay:l=100,closeDelay:u=0,disabled:d=!1,...f}=e,p=tK(!0);if(p?.parent.type!==`menu`)throw Error(La(37));let m=$G(),h=EK(),{store:g,parentVirtualFocus:v}=p,y=p.parent.store,b=mK({guess:!0,label:a}),x=xV(o),S=g.useState(`open`),C=_.useRef(!1),w=g.useState(`positionerElement`),T=g.useState(`floatingRootContext`),E=g.useState(`floatingTreeRoot`),D=g.useState(`triggerPopupId`,x),O=If(x,g),k=K(e=>{O(e);let t=g.select(`activeTriggerElement`);e!==null&&g.select(`open`)&&(t===e||g.select(`activeTriggerId`)==null)&&g.update({activeTriggerId:x??null,activeTriggerElement:e,closeDelay:u})}),A=_.useRef(null),j=_.useCallback(e=>{A.current=e,g.set(`activeTriggerElement`,e)},[g]);G(()=>(k(A.current),()=>k(null)),[k,x,g]),G(()=>{if(!S||!w)return;function e(e){ps(e)===g.context.beforeContentFocusGuardRef.current&&(C.current=e.relatedTarget===A.current)}return w.addEventListener(`focusout`,e,!0),()=>{C.current=!1,w.removeEventListener(`focusout`,e,!0)}},[S,w,g]),g.useSyncedValue(`closeDelay`,u);let M=g.useState(`disabled`),N=y.useState(`disabled`),P=d||M||N,F=y.useState(`itemProps`),I=y.useState(`isActive`,b.index),L=_.useMemo(()=>({type:`submenu-trigger`,setActive(e){y.select(`highlightItemOnHover`)&&y.setActiveIndex(b.index,md,e)}}),[y,b.index]),{getItemProps:R,itemRef:z}=dK({closeOnClick:!1,disabled:P,highlighted:I,id:x,store:g,typingRef:y.context.typingRef,nativeButton:s,itemMetadata:L,nodeId:m?.context.nodeId}),ee=dp(T,{enabled:g.useState(`hoverEnabled`)&&c&&!P,handleClose:Dp({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:l,delay:{open:l,close:u},shouldOpen:l>0?()=>y.select(`allowMouseEnter`):void 0,triggerElementRef:A,externalTree:E,isClosing:()=>g.select(`transitionStatus`)===`ending`,guardStaleOpen:!0}),te=xf(T,{enabled:!P,event:`mousedown`,toggle:!0,ignoreMouse:c,stickIfOpen:c}).reference??Ma,ne=g.useState(`triggerProps`,!0);delete ne.id;let re={disabled:P,highlighted:I,open:S},ie=g.useState(`openMethod`),ae=g.useState(`lastOpenChangeReason`)===`list-navigation`||ie===`keyboard`,B=S&&ae&&ls;return Vl(`div`,e,{state:re,stateAttributesMapping:Fs,props:[te,ee,ne,h?.onTriggerKeyDown?{onKeyDown:h.onTriggerKeyDown}:void 0,F,B?Eq:void 0,{"aria-controls":D,tabIndex:v||!(S||I)?-1:0,onFocus(e){g.select(`open`)&&C.current&&(C.current=!1,g.setOpen(!1,Z(ud,e.nativeEvent)))},onBlur(){I&&y.setActiveIndex(null,Qu)}},f,R],ref:[t,b.ref,z,k,j]})}),Oq=_.forwardRef(function(e,t){let n=sK(e,t,`submenu-trigger`);if(!n.visible)return null;let r=n.props?Ol(n.props,e):e;return(0,X.jsx)(Dq,{...r,ref:n.ref})});function kq(e){return Array.isArray(e)?e.map(e=>kq(e)).join(`,`):e==null?``:String(e)}function Aq(e){let[t,n]=_.useState({getBoundingClientRect(){return DOMRect.fromRect({width:0,height:0,x:0,y:0})}}),r=_.useRef(null),i=_.useRef(null),a=_.useRef(null),o=_.useRef(null),s=_.useRef(!0),c=_.useRef(null),l=Fu(),u=_.useMemo(()=>({anchor:t,setAnchor:n,actionsRef:a,backdropRef:r,internalBackdropRef:i,positionerRef:o,allowMouseUpTriggerRef:s,initialCursorPointRef:c,rootId:l}),[t,l]);return(0,X.jsx)(XG.Provider,{value:u,children:(0,X.jsx)(eK.Provider,{value:void 0,children:(0,X.jsx)(dq,{...e})})})}var jq=500,Mq=_.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{setAnchor:o,actionsRef:s,internalBackdropRef:c,backdropRef:l,positionerRef:u,allowMouseUpTriggerRef:d,initialCursorPointRef:f,rootId:p}=ZG(!1),{store:m}=tK(!1),h=m.useState(`open`),g=m.useState(`disabled`),v=_.useRef(null),y=_.useRef(null),b=Wo(),x=Wo(),S=_.useRef(!1),C=_.useRef(null);function w(e,t,n){let r=n.type.startsWith(`touch`);f.current={x:e,y:t},o({getBoundingClientRect(){return DOMRect.fromRect({width:r?10:0,height:r?10:0,x:e,y:t})}}),S.current=!1,s.current?.setOpen(!0,Z($u,n)),x.start(jq,()=>{S.current=!0})}function T(e){if(g)return;d.current=!0,Xs(e),w(e.clientX,e.clientY,e.nativeEvent);let t=q(v.current);C.current?.abort();let n=new AbortController;C.current=n,t.addEventListener(`mouseup`,e=>{if(d.current=!1,!S.current)return;x.clear(),S.current=!1;let t=ps(e);Y(u.current,t)||p&&t&&yq(t)===p||s.current?.setOpen(!1,Z(vd,e))},{once:!0,signal:n.signal})}function E(){b.clear(),y.current=null}function D(e){if(g||(d.current=!1,e.touches.length!==1)){E();return}e.stopPropagation();let t=e.touches[0],n={x:t.clientX,y:t.clientY};y.current=n,b.start(jq,()=>{w(n.x,n.y,e.nativeEvent)})}function O(e){if(e.touches.length!==1)E();else if(b.isStarted()&&y.current){let t=e.touches[0],n=Math.abs(t.clientX-y.current.x),r=Math.abs(t.clientY-y.current.y);(n>10||r>10)&&E()}}return _.useEffect(()=>()=>{C.current?.abort()},[]),_.useEffect(()=>{function e(e){if(g)return;let t=ps(e);(Y(v.current,t)||Y(c.current,t)||Y(l.current,t))&&e.preventDefault()}return J(q(v.current),`contextmenu`,e)},[l,g,c]),Vl(`div`,e,{state:{open:h},ref:[v,t],props:[{onContextMenu:T,onTouchStart:D,onTouchMove:O,onTouchEnd:E,onTouchCancel:E,style:{WebkitTouchCallout:`none`}},a],stateAttributesMapping:Is})}),Nq=WK;function Pq({...e}){return(0,X.jsx)(Aq,{"data-slot":`context-menu`,...e})}function Fq({className:e,...t}){return(0,X.jsx)(Mq,{"data-slot":`context-menu-trigger`,className:Q(`select-none`,e),...t})}function Iq({className:e,align:t=`start`,alignOffset:n=4,side:r=`right`,sideOffset:i=0,...a}){return(0,X.jsx)(IK,{children:(0,X.jsx)(Nq,{className:`isolate z-50 outline-none`,align:t,alignOffset:n,side:r,sideOffset:i,children:(0,X.jsx)(NK,{"data-slot":`context-menu-content`,className:Q(`z-50 max-h-(--available-height) w-50 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-[10px] bg-popover p-1 text-xs text-popover-foreground shadow-[0_12px_40px_rgba(0,0,0,.3)] ring-1 ring-border duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...a})})})}function Lq({...e}){return(0,X.jsx)(xK,{"data-slot":`context-menu-group`,...e})}function Rq({className:e,inset:t,...n}){return(0,X.jsx)(SK,{"data-slot":`context-menu-label`,"data-inset":t,className:Q(`px-2 pt-1.5 pb-1 text-[11px] font-semibold text-muted-foreground data-inset:pl-7`,e),...n})}function zq({className:e,inset:t,variant:n=`default`,...r}){return(0,X.jsx)(wK,{"data-slot":`context-menu-item`,"data-inset":t,"data-variant":n,className:Q(`group/context-menu-item relative flex h-7 cursor-default items-center gap-1.5 rounded-md px-2 py-0 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 focus:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive`,e),...r})}function Bq({className:e,...t}){return(0,X.jsx)(wq,{"data-slot":`context-menu-separator`,className:Q(`my-1 h-px bg-border`,e),...t})}function Vq({className:e,...t}){return(0,X.jsx)(`kbd`,{"data-slot":`context-menu-shortcut`,className:Q(`ml-auto grid h-5 min-w-5 place-items-center rounded-[5px] bg-muted px-[5px] font-sans text-[11px] font-normal text-muted-foreground`,e),...t})}function Hq({action:e,children:t,binding:n,chips:r,keyName:i,variant:a}){let o=he(n===void 0?e?.keys:[n],me()),s=r??(o?oe(o):[]);return(0,X.jsxs)(zq,{variant:a,disabled:!e||!Se(e),"aria-keyshortcuts":i,onClick:()=>e?.run(),children:[t??e?.label,s.length>0?(0,X.jsx)(`span`,{"aria-hidden":!0,className:`ml-auto flex gap-[3px]`,children:s.map((e,t)=>(0,X.jsx)(`kbd`,{className:`grid h-5 min-w-5 place-items-center rounded-[5px] bg-muted px-[5px] font-sans text-[11px] font-normal text-muted-foreground`,children:e},t))}):null]})}function Uq({action:e}){return(0,X.jsx)(Hq,{action:e,chips:[`⌫`],keyName:`Delete`,variant:`destructive`,children:`Delete`})}function Wq({children:e}){return(0,X.jsx)(Rq,{children:e})}function Gq(e,t,n,r){let i=r?e.find(e=>e.ref===r.frame&&!e.hidden):void 0;if(r&&i&&Kq(r.box,t))return{kind:`element`,frame:i,at:t};let a=pW(e,t,n);return a?{kind:`frame`,frame:a,at:t}:{kind:`canvas`,at:t}}function Kq(e,{x:t,y:n}){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}var qq={frame:`w-55`,element:`w-[230px]`,canvas:`w-[210px]`};function Jq({page:e,frames:t,viewport:n,layer:r,trigger:i}){let[a,o]=(0,_.useState)(null),s=e=>{let i=n.current,a=r.current;if(!i||!a)return null;let o=BR(i),[s,c]=o.invert(ZF(e,i)),{element:l}=HN.getState(),u=l?fW(a):null;return Gq(t(),{x:s,y:c},o.k,l&&u?{frame:l.frame,box:u}:null)};return(0,X.jsxs)(Pq,{onOpenChangeComplete:e=>{e||qG.setState({at:null,frame:null})},children:[(0,X.jsx)(Fq,{render:i,onContextMenu:t=>{let n=t.nativeEvent.defaultPrevented?null:s(t.nativeEvent);if(!n)t.preventBaseUIHandler();else{if(n.kind===`frame`){let{frames:t,element:r}=HN.getState();(r||!t.includes(n.frame.ref))&&DN(HN,e,[n.frame.ref])}qG.setState({at:n.at,frame:n.kind===`canvas`?null:n.frame.ref}),o(n)}}}),(0,X.jsxs)(Iq,{className:a?qq[a.kind]:void 0,children:[a?.kind===`frame`?(0,X.jsx)(Xq,{}):null,a?.kind===`element`?(0,X.jsx)(Qq,{noteable:!0}):null,a?.kind===`canvas`?(0,X.jsx)(eJ,{}):null]})]})}var Yq=[`frame.copy`,`frame.cut`,`frame.copyPng`,`frame.duplicate`,`section.wrap`,`frame.rename`,`frame.fitHeight`,`frame.compare`,`note.addOnFrame`,`tool.note`,`frame.hide`,`frame.lock`,`frame.flipTheme`,`frame.delete`];function Xq(){let[e,t,n,r,i,a,o,s,c,l,u,d,f,p]=Ce(Yq),m=UN(e=>e.frames.length);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(Lq,{children:[(0,X.jsx)(Wq,{children:m>1?`${m} frames`:`Frame`}),(0,X.jsx)(Hq,{action:e,children:`Copy`}),(0,X.jsx)(Hq,{action:t,children:`Cut`}),(0,X.jsx)(Hq,{action:n,children:`Copy as PNG`}),(0,X.jsx)(Hq,{action:r,children:`Duplicate`}),(0,X.jsx)(Hq,{action:i,children:`Wrap in section`}),(0,X.jsx)(Hq,{action:a,children:`Rename`}),(0,X.jsx)(Hq,{action:o,children:`Fit height`}),(0,X.jsx)(Hq,{action:s,children:`Compare with before`}),(0,X.jsx)(Hq,{action:c,binding:l?.keys?.[0],children:`Add a note`})]}),(0,X.jsx)(Bq,{}),(0,X.jsxs)(Lq,{children:[(0,X.jsx)(Hq,{action:u,children:`Hide`}),(0,X.jsx)(Hq,{action:d,children:d?.checked?.()?`Unlock`:`Lock`}),(0,X.jsx)(Hq,{action:f})]}),(0,X.jsx)(Bq,{}),(0,X.jsx)(Uq,{action:p})]})}var Zq=[`note.addHere`,`tool.note`,`element.up`,`view.zoomToSelection`,`element.toFront`,`element.forward`,`element.moveDown`,`element.backward`,`element.moveUp`,`element.toBack`,`frame.copyPng`,`element.delete`];function Qq({noteable:e}){let[t,n,r,i,a,o,s,c,l,u,d,f]=Ce(Zq),p=UN(e=>e.element??null),m=p?Wz(p.frame):null,h=p&&m?Xz(m.elements,p.index)===null:!0;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(Lq,{children:[(0,X.jsx)(Wq,{children:`Element`}),e?(0,X.jsx)(Hq,{action:t,binding:n?.keys?.[0],children:`Add a note here`}):null,(0,X.jsx)(Hq,{action:r,children:h?`Select frame`:`Select parent`}),(0,X.jsx)(Hq,{action:i,children:`Zoom to selection`}),(0,X.jsx)(Bq,{}),(0,X.jsx)(Hq,{action:a,children:`Bring to front`}),(0,X.jsx)(Hq,{action:o,binding:s?.keys?.[0],children:`Bring forward`}),(0,X.jsx)(Hq,{action:c,binding:l?.keys?.[0],children:`Send backward`}),(0,X.jsx)(Hq,{action:u,children:`Send to back`}),(0,X.jsx)(Bq,{}),(0,X.jsx)(Hq,{action:d,children:`Copy frame as PNG`})]}),(0,X.jsx)(Bq,{}),(0,X.jsx)(Uq,{action:f})]})}var $q=[`frame.pasteAt`,`frame.paste`,`frame.newAt`,`tool.frame`,`selection.all`,`view.zoomToFit`,`view.hideUi`];function eJ(){let[e,t,n,r,i,a,o]=Ce($q);return(0,X.jsxs)(Lq,{children:[(0,X.jsx)(Wq,{children:`Empty canvas`}),(0,X.jsx)(Hq,{action:e,binding:t?.keys?.[0],children:`Paste here`}),(0,X.jsx)(Hq,{action:n,binding:r?.keys?.[0],children:`New frame here`}),(0,X.jsx)(Bq,{}),(0,X.jsx)(Hq,{action:i,children:`Select all`}),(0,X.jsx)(Hq,{action:a,children:`Zoom to fit`}),(0,X.jsx)(Hq,{action:o,children:`Hide UI`})]})}var tJ=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`]),nJ=`Only PNG, JPEG, GIF, and WebP images go in a note.`;function rJ(){let[e,t]=(0,_.useState)([]),[n,r]=(0,_.useState)(null),i=(0,_.useRef)(e);return(0,_.useEffect)(()=>{i.current=e},[e]),(0,_.useEffect)(()=>()=>{for(let e of i.current)URL.revokeObjectURL(e.url)},[]),{images:e,refusal:n,add:e=>{let n=e.filter(e=>tJ.has(e.type));r(n.length<e.length?nJ:null),n.length!==0&&t(e=>[...e,...n.map(e=>({id:crypto.randomUUID(),file:e,url:URL.createObjectURL(e)}))])},remove:n=>{let i=e.find(e=>e.id===n);i&&URL.revokeObjectURL(i.url),r(null),t(e=>e.filter(e=>e.id!==n))},upload:async t=>{if(e.length===0)return[];let n=new FormData;n.append(`page`,t);for(let t of e)n.append(`files`,t.file);return(await lx(`/api/notes/images`,n)).images},clear:()=>{for(let t of e)URL.revokeObjectURL(t.url);r(null),t([])}}}function iJ(e){return[...e?.files??[]].filter(e=>e.type.startsWith(`image/`))}function aJ(e){return[...e?.types??[]].includes(`Files`)}var oJ=`frameboard:new-session`;function sJ(e,t,n=!1){return t&&e.some(e=>e.session===t)?t:e.length===1?e[0]?.session??``:e.length===0&&n?oJ:``}function cJ(e,t,n,r,i=r){return e===`frameboard:new-session`&&r||t.some(t=>t.session===e)?e:sJ(t,n,r&&i)}function lJ(e){return e===``?{}:e===`frameboard:new-session`?{dispatch:!0}:{to:e}}function uJ(e){if(e instanceof cx){if(e.code===`stale-address`)return`The frame changed since it was clicked. Click the element again.`;if(e.code===`unauthorized`)return`This tab cannot write. Run frameboard open for a tab that can.`;if(e.code===`notes-invalid`)return`This page's notes.json does not read. Fix it by hand and try again.`;if(e.code===`dispatch-unavailable`)return`Restart serve with FRAMEBOARD_DISPATCH set to start a session.`;if(e.code===`image-type-refused`)return`Only PNG, JPEG, GIF, and WebP images go in a note.`;if(e.code===`asset-too-large`)return`The images are too large to send. Remove one and try again.`;if(e.code===`dispatch-failed`)return`The session did not start. Check .run/dispatch.log and try again.`}return`The note did not save. Try again.`}var dJ=`.notes/`,fJ=`block size-12 overflow-hidden rounded-md border border-border bg-muted object-cover`;function pJ({images:e,onRemove:t}){return e.length===0?null:(0,X.jsx)(`ul`,{"aria-label":`Images`,className:`mb-1.5 flex flex-wrap gap-1.5`,children:e.map((e,n)=>(0,X.jsxs)(`li`,{className:`relative`,children:[(0,X.jsx)(`img`,{src:e.url,alt:`Image ${n+1}: ${e.file.name}`,className:fJ}),(0,X.jsx)(`button`,{type:`button`,"aria-label":`Remove image ${n+1}`,onClick:()=>t(e.id),className:`absolute -top-1.5 -right-1.5 grid size-6 place-items-center rounded-full outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,children:(0,X.jsx)(`span`,{className:`grid size-4 place-items-center rounded-full bg-foreground text-card hover:bg-foreground/80`,children:(0,X.jsx)(Ii,{"aria-hidden":!0,className:`size-3`})})})]},e.id))})}function mJ({page:e,images:t}){let[n,r]=e.split(`/`),i=t.filter(e=>e.startsWith(dJ));return!n||!r||i.length===0?null:(0,X.jsx)(`ul`,{"aria-label":`Images`,className:`mt-1.5 flex flex-wrap gap-1.5`,children:i.map((e,t)=>{let i=`/api/note-images/${encodeURIComponent(n)}/${encodeURIComponent(r)}/${encodeURIComponent(e.slice(7))}`;return(0,X.jsx)(`li`,{children:(0,X.jsx)(`a`,{href:i,target:`_blank`,rel:`noreferrer`,"aria-label":`Open image ${t+1} full size`,className:`block rounded-md outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,children:(0,X.jsx)(`img`,{src:i,alt:``,className:fJ})})},e)})})}function hJ({listeners:e}){return(0,X.jsxs)(`span`,{className:`ml-auto flex items-center gap-1.5 font-normal text-muted-foreground`,children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 rounded-full bg-claim`}),e.length===0?`No session listening`:`${e.length} listening`]})}function gJ({listeners:e,value:t,onChange:n,disabled:r,dispatch:i=!1,optional:a=!1}){let o=e.length===0&&!i,s=e.length===0&&(o||a);return(0,X.jsxs)(`label`,{className:`relative flex h-[26px] min-w-0 items-center gap-1.5 rounded-md bg-muted pr-6 pl-2 text-foreground has-[select:disabled]:opacity-60 has-[select:focus-visible]:ring-3 has-[select:focus-visible]:ring-ring/50`,children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:`size-[7px] shrink-0 rounded-full bg-claim`}),(0,X.jsx)(`span`,{className:`sr-only`,children:`Send to`}),(0,X.jsxs)(`select`,{value:t,disabled:r||o,onChange:e=>n(e.target.value),className:`min-w-0 appearance-none truncate bg-transparent outline-none disabled:cursor-not-allowed`,children:[s?(0,X.jsx)(`option`,{value:``,children:`No session`}):null,e.length>1?(0,X.jsx)(`option`,{value:``,disabled:!0,children:`Pick a session`}):null,e.map(e=>(0,X.jsx)(`option`,{value:e.session,children:e.tag},e.session)),i?(0,X.jsx)(`option`,{value:oJ,children:`New session`}):null]}),(0,X.jsx)(jt,{"aria-hidden":!0,className:`pointer-events-none absolute right-2 size-2.5 text-muted-foreground`})]})}function _J({pick:e,onClose:t}){let n=Rg(e=>e.listeners),r=Rg(t=>t.claims[e.frame.ref]?.session),i=Rg(e=>e.canWrite),a=Rg(e=>e.dispatch),o=yN(e.frame.ref),s=xN(e=>e.drafts[o]??``),c=e=>SN(o,e),[l,u]=(0,_.useState)(()=>sJ(n,r,a)),[d,f]=(0,_.useState)(null),[p,m]=(0,_.useState)(!1),h=rJ(),g=cJ(l,n,r,a),v=async n=>{if(s.trim()===``)f(`Write the note first`);else if(n===``)f(`Pick a session to send it to`);else{m(!0);try{let r=e.frame.ref.split(`/`).slice(0,-1).join(`/`),i=await h.upload(r);await lx(`/api/notes`,{frame:e.frame.ref,text:s.trim(),...i.length===0?{}:{images:i},...e.element===null?{}:{element:e.element,renderedAt:e.renderedAt},...n===null?{}:lJ(n)}),c(``),h.clear(),qg.getState().tool===`note`&&qg.setState({tool:`move`}),t()}catch(e){f(uJ(e))}finally{m(!1)}}};return(0,X.jsx)(vJ,{title:`New note on ${e.frame.name}`,listeners:n,onClose:t,children:(0,X.jsxs)(`form`,{className:`m-3 rounded-lg border border-border p-2`,onSubmit:e=>{e.preventDefault(),v(g)},onDragOver:e=>{i&&aJ(e.dataTransfer)&&e.preventDefault()},onDrop:e=>{i&&aJ(e.dataTransfer)&&(e.preventDefault(),e.stopPropagation(),h.add([...e.dataTransfer.files]))},children:[(0,X.jsx)(`textarea`,{"aria-label":`Note on ${e.frame.name}`,autoFocus:!0,value:s,disabled:!i,onChange:e=>{c(e.target.value),f(null)},onPaste:e=>{let t=iJ(e.clipboardData);t.length!==0&&(e.preventDefault(),h.add(t))},onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&e.currentTarget.form?.requestSubmit()},rows:2,className:`block min-h-7 w-full resize-none bg-transparent text-foreground outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed`}),(0,X.jsx)(pJ,{images:h.images,onRemove:h.remove}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(gJ,{listeners:n,value:g,onChange:e=>{u(e),f(null)},disabled:!i,dispatch:a}),(0,X.jsx)(yJ,{variant:`ghost`,className:`ml-auto`,disabled:!i||p,onClick:()=>void v(null),children:`Save`}),(0,X.jsx)(yJ,{type:`submit`,variant:`primary`,disabled:!i||p||n.length===0&&!a,children:`Send`})]}),d??h.refusal?(0,X.jsx)(`p`,{role:`alert`,className:`mt-2 text-destructive`,children:d??h.refusal}):null]})})}function vJ({title:e,listeners:t,onClose:n,children:r}){return(0,X.jsxs)(`section`,{"aria-label":e,"data-note-card":!0,onKeyDown:e=>{e.key===`Escape`&&(e.stopPropagation(),n())},onPointerDown:e=>e.stopPropagation(),onWheel:e=>e.stopPropagation(),className:`pointer-events-auto flex w-[300px] flex-col overflow-hidden rounded-xl border border-border bg-card text-body text-card-foreground shadow-[0_12px_40px_rgba(0,0,0,.3)]`,children:[(0,X.jsxs)(`header`,{className:`flex items-center gap-2 border-b border-border px-3 py-2.5 font-semibold`,children:[(0,X.jsx)(`h2`,{className:`truncate`,children:e}),(0,X.jsx)(hJ,{listeners:t})]}),r]})}function yJ({variant:e,className:t,type:n=`button`,...r}){return(0,X.jsx)(`button`,{type:n,className:Q(`flex h-[26px] shrink-0 items-center rounded-lg px-3 font-medium outline-none focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50`,e===`primary`?`bg-primary text-primary-foreground hover:bg-primary/90`:`bg-muted text-foreground hover:bg-accent`,t),...r})}function bJ({title:e,notes:t,onPick:n,onClose:r}){let i=(0,_.useRef)([]),[a,o]=(0,_.useState)(0);(0,_.useEffect)(()=>{i.current[0]?.focus()},[]);let s=e=>{let n=(e+t.length)%t.length;o(n),i.current[n]?.focus()},c={ArrowDown:()=>s(a+1),ArrowUp:()=>s(a-1),Home:()=>s(0),End:()=>s(t.length-1)};return(0,X.jsxs)(`section`,{"aria-label":e,"data-note-card":!0,onKeyDown:e=>{if(e.key===`Escape`){e.stopPropagation(),r();return}let t=c[e.key];t&&(e.preventDefault(),e.stopPropagation(),t())},onPointerDown:e=>e.stopPropagation(),onWheel:e=>e.stopPropagation(),className:`pointer-events-auto flex min-h-0 w-[240px] flex-col overflow-hidden rounded-xl border border-border bg-card text-body text-card-foreground shadow-[0_12px_40px_rgba(0,0,0,.3)]`,children:[(0,X.jsx)(`h2`,{className:`px-3 pt-2.5 pb-1 font-normal text-muted-foreground`,children:e}),(0,X.jsx)(`div`,{role:`menu`,"aria-label":e,className:`flex min-h-0 flex-col overflow-y-auto p-1`,children:t.map((e,t)=>(0,X.jsxs)(`button`,{ref:e=>{i.current[t]=e},type:`button`,role:`menuitem`,"aria-label":`Note ${e.number}: ${xJ(e.text)}`,tabIndex:t===a?0:-1,onFocus:()=>o(t),onClick:()=>n(e.id),className:`flex h-7 shrink-0 items-center gap-2 rounded-md px-1.5 text-left outline-none hover:bg-accent focus-visible:bg-accent focus-visible:ring-3 focus-visible:ring-ring/50`,children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:`grid size-[18px] shrink-0 place-items-center rounded-[9px_9px_9px_2px] bg-note text-caption font-semibold text-[#1a1a1a]`,children:e.number}),(0,X.jsx)(`span`,{className:`truncate`,children:xJ(e.text)})]},e.id))})]})}function xJ(e){return e.split(`
68
- `,1)[0]??``}function SJ(e){return e.split(/\s+/).filter(Boolean).slice(0,2).map(e=>e[0]?.toUpperCase()).join(``)}var CJ,wJ=!1,TJ=new Set;function EJ(){return(0,_.useSyncExternalStore)(AJ,()=>CJ?.name)}function DJ(){return(0,_.useSyncExternalStore)(AJ,()=>CJ?.source??null)}async function OJ(e){kJ(await lx(`/api/author`,{name:e}))}function kJ(e){CJ=e;for(let e of TJ)e()}function AJ(e){return TJ.add(e),wJ||(wJ=!0,fetch(`/api/author`).then(e=>e.json()).then(e=>e.ok?e.data:{name:null,source:null}).catch(()=>({name:null,source:null})).then(e=>{CJ===void 0&&kJ(e)})),()=>{TJ.delete(e)}}function jJ({notes:e,page:t,onClose:n}){let r=Rg(e=>e.listeners),i=Rg(n=>t?n.claims[`${t}/${e[0]?.frame}`]?.session:void 0),a=Rg(e=>e.canWrite),o=Rg(e=>e.dispatch),s=e[0]?.id??``,c=xN(e=>e.drafts[s]??``),l=e=>SN(s,e),[u,d]=(0,_.useState)(()=>sJ(r,i)),[f,p]=(0,_.useState)(null),[m,h]=(0,_.useState)(!1),g=rJ(),v=(0,_.useRef)(null),y=PJ(v,e.length),b=e[0];if(!b)return null;let x=cJ(u,r,i,o,!1),S=async(e,t)=>{h(!0);try{await e(),t?.()}catch(e){p(uJ(e))}finally{h(!1)}},C=()=>{let e=c.trim();e===``&&g.images.length>0?p(`Write a reply to go with the images`):e===``&&x===``?p(r.length>1?`Pick a session to send it to`:`Write a reply first`):e===``?S(()=>lx(`/api/notes/${b.id}/send`,lJ(x))):S(async()=>{let n=t?await g.upload(t):[];await lx(`/api/notes/${b.id}/replies`,{text:e,...n.length===0?{}:{images:n},...lJ(x)})},()=>{l(``),g.clear()})};return(0,X.jsxs)(vJ,{title:`Note ${b.number??``}`.trim(),listeners:r,onClose:n,children:[(0,X.jsx)(`ol`,{ref:v,"aria-label":`Messages`,tabIndex:0,onScroll:y,onKeyDown:e=>{NJ.has(e.key)&&e.stopPropagation()},className:`min-h-0 overflow-y-auto outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset`,children:e.map(e=>(0,X.jsx)(MJ,{note:e,page:t},e.id))}),(0,X.jsxs)(`form`,{className:`mx-3 mt-1.5 mb-3 rounded-lg border border-border p-2`,onSubmit:e=>{e.preventDefault(),C()},onDragOver:e=>{a&&t&&aJ(e.dataTransfer)&&e.preventDefault()},onDrop:e=>{a&&t&&aJ(e.dataTransfer)&&(e.preventDefault(),e.stopPropagation(),g.add([...e.dataTransfer.files]))},children:[(0,X.jsx)(`textarea`,{"aria-label":`Reply`,placeholder:`Reply, or hand it on…`,value:c,disabled:!a,onChange:e=>{l(e.target.value),p(null)},onPaste:e=>{let n=iJ(e.clipboardData);t&&n.length!==0&&(e.preventDefault(),g.add(n))},onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&e.currentTarget.form?.requestSubmit()},rows:1,className:`block min-h-7 w-full resize-none bg-transparent text-foreground outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed`}),(0,X.jsx)(pJ,{images:g.images,onRemove:g.remove}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(gJ,{listeners:r,value:x,onChange:e=>{d(e),p(null)},disabled:!a,dispatch:o,optional:!0}),(0,X.jsx)(yJ,{variant:`ghost`,className:`ml-auto`,disabled:!a||m,onClick:()=>void S(()=>lx(`/api/notes/${b.id}/done`,{}),n),children:`Done`}),(0,X.jsx)(yJ,{type:`submit`,variant:`primary`,disabled:!a||m,children:`Send`})]}),f??g.refusal?(0,X.jsx)(`p`,{role:`alert`,className:`mt-2 text-destructive`,children:f??g.refusal}):null]})]})}function MJ({note:e,page:t}){let n=EJ(),r=e.from===`agent`;return(0,X.jsxs)(`li`,{className:`flex gap-2.5 px-3 py-2.5`,children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:Q(`grid size-[22px] flex-none place-items-center rounded-full text-[10px] font-bold`,r?`bg-claim/25 text-claim`:`bg-foreground text-card`),children:r?`C`:SJ(e.author??n??``)||`Y`}),(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(`b`,{className:`font-semibold`,children:r?`claude`:`You`}),(0,X.jsx)(`time`,{dateTime:e.createdAt,className:`ml-1.5 text-muted-foreground`,children:FJ(e.createdAt)}),(0,X.jsx)(`p`,{className:`mt-0.5 leading-[1.45] break-words whitespace-pre-wrap`,children:e.text}),t&&e.images?(0,X.jsx)(mJ,{page:t,images:e.images}):null]})]})}var NJ=new Set([`ArrowUp`,`ArrowDown`,`PageUp`,`PageDown`,`Home`,`End`,` `]);function PJ(e,t){let n=(0,_.useRef)(!0);return(0,_.useLayoutEffect)(()=>{let t=e.current;if(!t)return;let r=new ResizeObserver(()=>{n.current&&t.scrollTo({top:t.scrollHeight})});return r.observe(t),()=>r.disconnect()},[e]),(0,_.useLayoutEffect)(()=>{let t=e.current;n.current&&t?.scrollTo({top:t.scrollHeight})},[e,t]),()=>{let t=e.current;t&&(n.current=t.scrollHeight-t.scrollTop-t.clientHeight<1)}}function FJ(e){let t=new Date(e);return Number.isNaN(t.getTime())?``:`${t.getHours()%12||12}:${String(t.getMinutes()).padStart(2,`0`)}`}function IJ({page:e,frames:t,container:n}){let r=Rg(t=>t.notes[e]),i=Jg(e=>e.mode===`play`),a=xN(e=>e.open),[o,s]=(0,_.useState)(null);ZJ(n),XJ(a!==null);let c=sN(t),l=new Map(c.map(e=>[e.name,e])),u=e=>{let t=l.get(e.frame);return t?WU(t,e.element,n):null},d=RJ(i?[]:LJ((r??[]).filter(e=>e.thread===null&&e.state!==`done`),u)),f=d.find(e=>e.key===o&&e.notes.length>1),p=BJ(f,d);if(i)return null;let m=Math.max(0,...(r??[]).map(e=>e.number??0))+1,h=t=>{s(null),bN.setState({open:{kind:`thread`,page:e,id:t}})},g=a?.kind===`thread`&&a.page===e?(r??[]).filter(e=>e.id===a.id||e.thread===a.id):null,v=g?.[0],y=v?d.find(e=>e.notes.some(e=>e.id===v.id))?.at??u(v):null;o!==null&&!f&&s(null);let b=e=>{s(null),document.querySelector(`[data-note-spot="${CSS.escape(e)}"]`)?.focus()};return(0,X.jsxs)(X.Fragment,{children:[d.map(e=>{let[t]=e.notes;if(!t||t.number===null)return null;let n=l.get(t.frame)?.ref;if(e.notes.length===1)return(0,X.jsx)(GJ,{content:t.number,at:e.at,frame:n,element:t.element,pin:e.key,active:a?.kind===`thread`&&a.id===t.id,label:`Note ${t.number} on ${t.frame}`,onOpen:()=>h(t.id)},t.id);let r=e.notes.some(e=>a?.kind===`thread`&&a.id===e.id);return(0,X.jsx)(GJ,{content:e.notes.length,at:e.at,frame:n,element:t.element,pin:e.key,spot:e.key,active:r||o===e.key,expanded:o===e.key,label:`${e.notes.length} notes on ${t.frame}`,onOpen:()=>{CN(),s(t=>t===e.key?null:e.key)}},e.key)}),a?.kind===`new`&&t.some(e=>e.ref===a.pick.frame.ref)?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(GJ,{content:m,at:a.pick.at,active:!0}),(0,X.jsx)(YJ,{at:a.pick.at,onDismiss:CN,children:(0,X.jsx)(_J,{pick:a.pick,onClose:CN},a.pick.frame.ref)})]}):null,f?(0,X.jsx)(YJ,{at:f.at,onDismiss:()=>s(null),children:(0,X.jsx)(`div`,{className:`contents`,onFocus:p.onFocus,onBlur:p.onBlur,children:(0,X.jsx)(bJ,{title:`${f.notes.length} notes on ${f.notes[0]?.frame}`,notes:f.notes,onPick:e=>{b(f.key),h(e)},onClose:()=>b(f.key)})})}):null,g&&y?(0,X.jsx)(YJ,{at:y,onDismiss:CN,children:(0,X.jsx)(jJ,{notes:g,page:e,onClose:CN})}):null]})}function LJ(e,t){let n=[];for(let r of e){let e=t(r);e&&r.number!==null&&n.push({note:r,at:e})}return n}function RJ(e){let t=()=>zJ(e,a_.zoom()),n=(0,_.useSyncExternalStore)(a_.onZoom,t,t),r=new Map(e.map(e=>[e.note.id,e]));return n===``?[]:n.split(`|`).map(e=>{let[t=``,n=``]=e.split(`:`);return{key:t,at:r.get(t)?.at??{x:0,y:0},notes:n.split(`,`).flatMap(e=>r.get(e)?.note??[])}})}function zJ(e,t){return VJ(e,t).map(e=>`${e.key}:${e.notes.map(e=>e.id).join(`,`)}`).join(`|`)}function BJ(e,t){let n=(0,_.useRef)(!1),r=(0,_.useRef)(null);return(0,_.useLayoutEffect)(()=>{let i=r.current;if(r.current=e?.notes[0]?.id??null,e||i===null||!n.current)return;n.current=!1;let a=t.find(e=>e.notes.some(e=>e.id===i));a&&document.querySelector(`[data-note-pin="${CSS.escape(a.key)}"]`)?.focus()}),{onFocus:()=>{n.current=!0},onBlur:e=>{let t=e.relatedTarget;t instanceof Node&&e.currentTarget.contains(t)||(n.current=!1)}}}function VJ(e,t){let n=HJ/t,r=[];for(let{note:t,at:i}of e){let e=r.find(e=>Math.abs(e.at.x-i.x)<n&&Math.abs(e.at.y-i.y)<n);e?e.notes.push(t):r.push({key:t.id,at:i,notes:[t]})}for(let e of r)e.notes.sort((e,t)=>(e.number??0)-(t.number??0));return r}var HJ=24,UJ=7,WJ={x:UJ+HJ/2,y:-(UJ+HJ/2)};function GJ({content:e,at:t,frame:n,element:r,pin:i,spot:a,active:o,expanded:s=o,label:c,onOpen:l}){let u=Q(`pointer-events-auto absolute grid size-[24px] origin-top-left place-items-center rounded-[12px_12px_12px_2px] bg-note text-label font-semibold text-[#1a1a1a] shadow-[0_2px_6px_rgba(0,0,0,.25)] outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,o&&`shadow-[0_0_0_3px_color-mix(in_srgb,var(--note)_35%,transparent),0_2px_6px_rgba(0,0,0,.25)]`),d={left:t.x,top:t.y,transform:`scale(calc(1 / var(--zoom, 1))) translate(${UJ}px, ${-(UJ+HJ)}px)`};return l?(0,X.jsx)(`button`,{type:`button`,"data-note-marker":!0,"data-note-frame":n,"data-note-element":r??void 0,"data-note-pin":i,"data-note-spot":a,"aria-label":c,"aria-haspopup":a===void 0?void 0:`menu`,"aria-expanded":s,onPointerDown:e=>e.stopPropagation(),onClick:l,className:u,style:d,children:e}):(0,X.jsx)(`span`,{"aria-hidden":!0,className:u,style:d,children:e})}var KJ={x:21,y:-25},qJ={left:WJ.x+KJ.x,right:KJ.x-WJ.x,top:WJ.y+KJ.y},JJ=12;function YJ({at:e,onDismiss:t,children:n}){let r=(0,_.useRef)(null),[i,a]=(0,_.useState)({flip:!1,y:0,cap:null});(0,_.useEffect)(()=>{let e=e=>{let n=e.target;n instanceof Node&&r.current?.contains(n)||n instanceof Element&&n.closest(`[data-note-marker]`)||t()};return document.addEventListener(`pointerdown`,e,!0),()=>document.removeEventListener(`pointerdown`,e,!0)},[t]);let[o,s]=(0,_.useState)(0);return(0,_.useEffect)(()=>{let e=()=>s(e=>e+1),t=a_.onZoom(e),n=a_.onHandMove(e);return()=>{t(),n()}},[]),(0,_.useLayoutEffect)(()=>{let e=r.current,t=e?.closest(`[data-canvas]`);if(!e||!t)return;let n=t.getBoundingClientRect(),o=document.querySelector(`[role="toolbar"][aria-label="Tools"]`),s=Math.min(n.bottom,o?.getBoundingClientRect().top??n.bottom),c=document.querySelector(`[data-view-only-notice]`),l=Math.max(n.top,c?.getBoundingClientRect().bottom??n.top),u=e.getBoundingClientRect(),d=i.flip?u.right+u.width+2*KJ.x:u.right,f=u.top-i.y,p={flip:d>n.right-JJ,y:f<l+JJ?l+JJ-f:Math.min(0,s-JJ-(f+u.height)),cap:s-l-24};(p.flip!==i.flip||Math.abs(p.y-i.y)>.5||p.cap!==i.cap)&&a(p)},[e.x,e.y,i,o]),(0,X.jsx)(`div`,{className:`absolute origin-top-left [transform:scale(calc(1/var(--zoom,1)))]`,style:{left:e.x,top:e.y},children:(0,X.jsx)(`div`,{ref:r,className:`absolute flex flex-col`,onBlur:e=>{let n=e.relatedTarget;n instanceof Node&&!e.currentTarget.contains(n)&&t()},style:{top:qJ.top+i.y,maxHeight:i.cap??void 0,...i.flip?{right:qJ.right}:{left:qJ.left}},children:n})})}function XJ(e){(0,_.useEffect)(()=>{if(!e)return;let t=e=>{e.key===`Escape`&&CN()};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e])}function ZJ(e){let[,t]=(0,_.useState)(0);(0,_.useEffect)(()=>{if(!e)return;let n=()=>t(e=>e+1);return e.addEventListener(`load`,n,!0),()=>e.removeEventListener(`load`,n,!0)},[e])}var QJ=N()(()=>({at:null}));function $J(e,{enabled:t,container:n,page:r,frames:i,toBoard:a,place:o=NB}){(0,_.useEffect)(()=>{let s=e.current;if(!t||!s||!n)return;let c=e=>{e.dataTransfer?.types.includes(`Files`)&&e.preventDefault()};s.addEventListener(`dragover`,c),s.addEventListener(`drop`,c);let l=e=>QJ.setState({at:e&&a(e)}),u=Ij({element:s,canDrop:({source:e})=>Lg.getState().canWrite&&Qj(e.data)!==null,onDragEnter:({location:e})=>l(e.current.input),onDrag:({location:e})=>l(e.current.input),onDragLeave:()=>l(null),onDrop:({source:e,location:t})=>{l(null);let s=Qj(e.data);s&&o(n,r,i(),a(t.current.input),s)}});return()=>{u(),s.removeEventListener(`dragover`,c),s.removeEventListener(`drop`,c),l(null)}},[e,t,n,r,i,a,o])}function eY({viewport:e,container:t,frames:n,toBoard:r}){let i=Jg(e=>e.mode===`edit`&&iW(e.tool)),a=F(ZU,e=>e.carried),o=F(QJ,e=>e.at),s=i||a!==null,[c,l]=(0,_.useState)(null),[u,d]=(0,_.useState)(null);(0,_.useEffect)(()=>{if(t)return QJ.subscribe(({at:e})=>{let r=e&&kB(t,n(),e),i=r?tY(r):null;d(e=>rY(e,i)?e:i)})},[t,n]),(0,_.useEffect)(()=>{let i=e.current;if(!s||!i||!t)return;let o=e=>{if(!a&&e.buttons&1&&nY())return;let i=r(e),o=a?AB(t,n(),i,a):kB(t,n(),i),s=o&&tY(o);l(e=>rY(e,s)?e:s)},c=()=>l(null);return i.addEventListener(`pointermove`,o),i.addEventListener(`pointerleave`,c),()=>{i.removeEventListener(`pointermove`,o),i.removeEventListener(`pointerleave`,c),l(null)}},[s,a,e,t,n,r]);let f=o?u:s?c:null;if(!f)return null;let p=f.height===0;return(0,X.jsx)(`div`,{"data-drop-line":!0,"aria-hidden":!0,className:`pointer-events-none absolute rounded-full bg-primary`,style:{left:f.x,top:f.y,width:p?f.width:sz(2),height:p?sz(2):f.height,translate:p?`0 -50%`:`-50% 0`,zIndex:Cz}})}function tY({frame:e,gap:t}){return{...t.line,x:e.box.x+t.line.x,y:e.box.y+t.line.y}}function nY(){let e=rW();return e===`rectangle`||e===`ellipse`||e===`asset`}function rY(e,t){return e===t||e!==null&&t!==null&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function iY({viewport:e,toBoard:t}){let n=F(qU,e=>e.shape),r=Jg(e=>e.mode===`edit`&&(e.tool===`frame`||e.tool===`section`||e.tool===`image`||e.tool===`shape`&&n!==`divider`)),[i,a]=(0,_.useState)(null);return(0,_.useEffect)(()=>{let n=e.current;if(!r||!n)return;let i=null,o=null,s=e=>{$U(null),o=null,i=e.button===0&&!qg.getState().spacePan?{from:t(e),x:e.clientX,y:e.clientY}:null},c=e=>{if(!i)return;let n=Math.hypot(e.clientX-i.x,e.clientY-i.y);!o&&n<=3||(o=aY(i.from,t(e)),a(o))},l=()=>{i&&o&&$U({from:i.from,at:{x:Math.round(o.x),y:Math.round(o.y)},size:{width:Math.max(1,Math.round(o.width)),height:Math.max(1,Math.round(o.height))}}),i=null,o=null,a(null)};return n.addEventListener(`pointerdown`,s),addEventListener(`pointermove`,c),addEventListener(`pointerup`,l),()=>{n.removeEventListener(`pointerdown`,s),removeEventListener(`pointermove`,c),removeEventListener(`pointerup`,l),$U(null),a(null)}},[r,e,t]),!r||!i?null:(0,X.jsx)(`div`,{"data-shape-draft":!0,"aria-hidden":!0,className:`pointer-events-none absolute bg-primary/10`,style:{left:i.x,top:i.y,width:i.width,height:i.height,border:`${sz(1)} solid var(--primary)`,zIndex:Cz}})}function aY(e,t){return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),width:Math.abs(e.x-t.x),height:Math.abs(e.y-t.y)}}var oY=[`nw`,`ne`,`sw`,`se`],sY={nw:`top-0 left-0`,ne:`top-0 right-0`,sw:`bottom-0 left-0`,se:`right-0 bottom-0`};function cY({page:e,sections:t}){let n=UN(t=>t.page===e?t.section:void 0);return t.map(e=>(0,X.jsx)(lY,{section:e,selected:e.name===n},e.name))}function lY({section:e,selected:t}){let{x:n,y:r,width:i,height:a}=e.box;return(0,X.jsxs)(`div`,{"data-section":e.name,"data-selected":t||void 0,className:Q(`pointer-events-none absolute rounded-[calc(10px/var(--zoom,1))] bg-foreground/5`,t&&`outline-solid outline-primary [outline-width:calc(1.5px/var(--zoom,1))]`),style:{left:n,top:r,width:i,height:a},children:[(0,X.jsx)(`div`,{"data-section-label":e.name,className:Q(`absolute top-0 left-0 origin-top-left truncate px-3 pt-2 text-body font-medium [transform:scale(calc(1/var(--zoom,1)))]`,t?`text-foreground`:`text-muted-foreground`),style:{maxWidth:`calc(${i}px * var(--zoom, 1))`},title:e.name,children:e.name}),t?oY.map(e=>(0,X.jsx)(`div`,{"data-section-corner":e,className:Q(`absolute size-[7px] border-[1.5px] border-primary bg-background [transform:translate(var(--hx),var(--hy))_scale(calc(1/var(--zoom,1)))]`,sY[e],e.startsWith(`n`)?`[--hy:-50%]`:`[--hy:50%]`,e.endsWith(`w`)?`[--hx:-50%]`:`[--hx:50%]`)},e)):null]})}var uY=1.2;function dY(e,t){return e===0?!1:t===WheelEvent.DOM_DELTA_LINE||Math.abs(e)>=50}function fY(e,t){return t===WheelEvent.DOM_DELTA_LINE?e*16:e}function pY(e,t){return e===0?1:dY(e,t)?e<0?uY:1/uY:2**(-e*.01)}function mY(e){return 1-(1-e)**3}var hY=[.02,4],gY=64,_Y=150,vY=400,yY=new Map,bY=new Set;function xY({page:e,reloads:t,findings:n,claims:r,focus:i,onFocused:a,calls:o=gk}){let s=(0,_.useRef)(null),c=(0,_.useRef)(null),l=(0,_.useRef)(null),u=(0,_.useRef)(null),[d,f]=(0,_.useState)(null),p=(0,_.useRef)(null),m=(0,_.useRef)(null),h=Rg(e=>e.aliases),g=gg(h,e.ref),v=(0,_.useRef)(0),y=(0,_.useRef)(null),b=(0,_.useRef)(null);(0,_.useEffect)(()=>()=>{b.current?.(),b.current=null},[e.ref]);let x=Jg(e=>e.mode===`play`),S=Jg(e=>e.tool===`hand`),C=Jg(e=>e.tool===`note`),w=Jg(e=>e.tool===`frame`),T=Jg(e=>e.tool===`section`),E=Jg(e=>iW(e.tool)),D=Jg(e=>e.spacePan);(0,_.useEffect)(()=>Gg(window),[]),TN(),sW();let O=M_(e=>e.unseen),[k,A]=(0,_.useState)(null),j=(0,_.useMemo)(()=>e.frames.filter(e=>!e.hidden),[e.frames]),M=(0,_.useRef)(j),N=(0,_.useRef)(e.sections),P=(0,_.useRef)(e.frames);(0,_.useLayoutEffect)(()=>{M.current=j,N.current=e.sections,P.current=e.frames},[j,e.sections,e.frames]);let F=(0,_.useMemo)(()=>UG(j),[j]),I=(0,_.useRef)(F);(0,_.useLayoutEffect)(()=>{I.current=F;let e=s.current,t=c.current;e&&t&&WG(t,F,BR(e).k)},[F]),GB(e.ref),mU(e.ref,j),YG(e.ref,e.frames,e=>c.current?.querySelector(`[data-frame="${CSS.escape(e)}"] iframe`)?.dataset.renderedAt??null),(0,_.useLayoutEffect)(()=>{let e=s.current,t=c.current;if(!e||!t)return;let n=YF(e),r,i=!1,a=t=>A({view:t,size:EY(e)}),o=YR().scaleExtent(hY).filter(e=>{if(e.type===`wheel`||e.type.startsWith(`touch`))return!0;let{button:t,ctrlKey:n}=e;if(n)return!1;let{mode:r,tool:i,spacePan:a}=qg.getState();return t===1||t===0&&(i===`hand`||r===`play`||a)}).on(`zoom`,({transform:{x:e,y:n,k:a}})=>{clearTimeout(r);for(let r of[t,u.current])r&&(r.style.transform=`translate(${e}px, ${n}px) scale(${a})`,r.style.setProperty(`--zoom`,String(a)));WG(t,I.current,a),yY.set(g,{x:e,y:n,k:a}),l_(a),i||(bY.delete(g),c_())}).on(`end`,({transform:{x:e,y:t,k:n}})=>{clearTimeout(r),r=setTimeout(()=>a({x:e,y:t,k:n}),_Y)});n.call(o).on(`dblclick.zoom`,null).on(`wheel.zoom`,t=>{if(t.preventDefault(),t.ctrlKey||t.metaKey){o.scaleBy(n,pY(t.deltaY,t.deltaMode),ZF(t,e));return}let r=t.shiftKey&&t.deltaX===0,i=r?t.deltaY:t.deltaX,a=r?0:t.deltaY,{deltaMode:s}=t,c=-fY(i,s),l=-fY(a,s),u=dY(i,s),f=dY(a,s);d(u?0:c,f?0:l),(u||f)&&v(u?c:0,f?l:0)},{passive:!1});let l=0,d=(t,r)=>{if(t===0&&r===0)return;let i=BR(e).k;o.translateBy(n,t/i,r/i)},f=0,h={x:0,y:0},_=()=>{cancelAnimationFrame(f),h={x:0,y:0}},v=(e,t)=>{if(cancelAnimationFrame(l),matchMedia(`(prefers-reduced-motion: reduce)`).matches){d(e,t);return}cancelAnimationFrame(f);let n={x:h.x+e,y:h.y+t};h=n;let r=performance.now(),i=0,a=e=>{let t=mY(Math.min(1,Math.max(0,e-r)/120));d(n.x*(t-i),n.y*(t-i)),i=t,h={x:n.x*(1-t),y:n.y*(1-t)},t<1&&(f=requestAnimationFrame(a))};f=requestAnimationFrame(a)},y=({x:e,y:t,k:r})=>{i=!0;try{o.transform(n,zR.translate(e,t).scale(r))}finally{i=!1}},b=yY.get(g),x=!b||bY.has(g),S=M.current.length===0;S&&x?bY.add(g):bY.delete(g);let C=b&&(S||!x)?b:DY(M.current,EY(e));y(C),clearTimeout(r),a(C);let w=new ResizeObserver(()=>a(yY.get(g)??C));w.observe(e),p.current=t=>{if(cancelAnimationFrame(l),_(),matchMedia(`(prefers-reduced-motion: reduce)`).matches){y(t);return}let n=BR(e),r=performance.now(),i=e=>{let a=Math.min(1,(e-r)/vY);if(a===1){y(t);return}let o=a<.5?4*a**3:1-(-2*a+2)**3/2;y({x:n.x+(t.x-n.x)*o,y:n.y+(t.y-n.y)*o,k:n.k*(t.k/n.k)**o}),l=requestAnimationFrame(i)};l=requestAnimationFrame(i)};let T=()=>{_(),c_()};e.addEventListener(`pointerdown`,T,{capture:!0});let E=null,D=e=>{e!==E&&(E=e,GG(t,e))},O=t=>{let n=BR(e),[r,i]=n.invert(ZF(t,e));D(pW(cN(M.current),{x:r,y:i},n.k)?.ref??null)},k=()=>D(null);return e.addEventListener(`pointermove`,O),e.addEventListener(`pointerleave`,k),m.current={zoomBy:e=>o.scaleBy(n,e),zoomTo:e=>o.scaleTo(n,e),fit:()=>{c_(),p.current?.(DY(M.current,EY(e)))},fitTo:t=>{c_(),p.current?.(DY(t.map(e=>({box:e})),EY(e)))},panBy:(t,r)=>{let i=BR(e).k;o.translateBy(n,-t/i,-r/i)},centerOn:(t,n)=>p.current?.(TY(t,n??BR(e).k,EY(e))),visible:()=>{let t=BR(e),{width:n,height:r}=EY(e),[i,a]=t.invert([0,0]);return{x:i,y:a,width:n/t.k,height:r/t.k}}},()=>{e.removeEventListener(`pointerdown`,T,{capture:!0}),e.removeEventListener(`pointermove`,O),e.removeEventListener(`pointerleave`,k),m.current=null,clearTimeout(r),cancelAnimationFrame(l),cancelAnimationFrame(f),p.current=null,w.disconnect(),n.on(`.zoom`,null)}},[g]),(0,_.useLayoutEffect)(()=>{let t=m.current;return t?s_(t,e.ref):void 0},[g,e.ref]),(0,_.useEffect)(()=>{let t=PN(HN,e.ref,Lg,qg),n=hN(Lg),r=ZB(HN,Lg,ZR,e=>lx(`/api/selection`,e));return()=>{r(),n(),t()}},[e.ref]),(0,_.useEffect)(()=>{let t=s.current,n=c.current,r=l.current;if(t&&n&&r)return CW(r,{viewport:t,layer:n,page:e.ref,frames:()=>M.current,sections:()=>N.current,pageFrames:()=>P.current})},[e.ref,x]),(0,_.useEffect)(()=>{let e=s.current;if(j.length===0||!e||!p.current||!bY.delete(g))return;let t=BR(e),n=EY(e),[r,i]=t.invert([0,0]),[a,o]=t.invert([n.width,n.height]);j.every(({box:e})=>e.x>=r&&e.y>=i&&e.x+e.width<=a&&e.y+e.height<=o)||p.current(DY(j,n))},[j,g]),(0,_.useEffect)(()=>{let e=j.find(e=>e.ref===i),t=s.current;e&&t&&p.current&&(p.current(DY([e],EY(t))),a?.())},[i,j,a]);let L=(0,_.useCallback)(e=>{let t=s.current;if(!t)return{x:0,y:0};let[n,r]=BR(t).invert(ZF(e,t));return{x:n,y:r}},[]),R=(0,_.useCallback)(()=>cN(M.current),[]);$J(l,{enabled:!x,container:d,page:e.ref,frames:R,toBoard:L});let z=(t,n)=>{if(!d)return!1;let r=n=>aB(e.ref,t,n);if(b.current?.(),b.current=null,n)return b.current=lV(d,t,r,HN),!0;let i=d.querySelector(`[data-frame="${CSS.escape(t.frame)}"] iframe`)?.contentDocument;return kN(HN,e.ref,t),b.current=i?oV(i,t,r):null,b.current!==null},ee=e=>{let t=s.current,n=y.current;if(t&&d&&n&&!(C||S||w||T||E)){let[r,i]=BR(t).invert(ZF(e,t)),a=cN(j);if(cV(d,a,n,{x:r,y:i})&&z(n,!1))return}te(e)},te=t=>{let n=s.current;if(C||S||w||T||E||!n||!d)return;let[r,i]=BR(n).invert(ZF(t,n)),a=++v.current;XB(d,cN(j),{x:r,y:i},Jz).then(t=>{t&&a===v.current&&kN(HN,e.ref,t)})},ne=t=>{let n=s.current;if(C||S||w||T||E||!n||!d||uW(d,`[data-label-control]`,t))return!1;let r=BR(n),[i,a]=r.invert(ZF(t,n)),o=pW(cN(j),{x:i,y:a},r.k),c=HN.getState();return o!==null&&a<o.box.y&&c.page===e.ref&&c.frames.length===1&&c.frames[0]===o.ref},re=(0,_.useMemo)(()=>k?Bz(j,k.view,k.size):null,[j,k]);return tz((0,_.useMemo)(()=>k?{frames:j,...k}:null,[j,k])),(0,X.jsxs)(`div`,{ref:s,"data-canvas":!0,className:Q(`relative size-full touch-none overflow-hidden bg-background`,(C||w||T||E)&&!x&&`cursor-crosshair`,(D||S&&!x)&&`cursor-grab active:cursor-grabbing`),children:[(0,X.jsx)(`div`,{ref:e=>{c.current=e,f(e)},"data-layer":!0,className:`absolute top-0 left-0 origin-top-left`,children:e.layoutError?null:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(cY,{page:e.ref,sections:e.sections}),j.map(e=>(0,X.jsx)(eU,{frame:e,live:re?.has(e.ref)??!1,version:t[e.ref]??0,findings:n?.[e.ref],claim:r?.[e.ref],unseen:e.ref in O},gg(h,e.ref))),(0,X.jsx)(Tz,{frames:j}),(0,X.jsx)(qB,{frames:j,container:d}),(0,X.jsx)(eY,{viewport:s,container:d,frames:R,toBoard:L}),(0,X.jsx)(iY,{viewport:s,toBoard:L}),(0,X.jsx)(kz,{frames:j,container:d}),(0,X.jsx)(Iz,{page:e.ref,frames:j})]})}),x?null:(0,X.jsx)(Jq,{page:e.ref,frames:()=>cN(M.current),viewport:s,layer:c,trigger:(0,X.jsx)(`div`,{ref:l,"data-hit-layer":!0,className:`absolute inset-0`,onClickCapture:t=>{let n=s.current;if(!(C||w||T||E)||!n||!d)return;t.stopPropagation();let r=BR(n),[i,a]=r.invert(ZF(t.nativeEvent,n)),c=rW(),l=JU.getState().file;if(c===`asset`&&l){let t=eW();NB(d,e.ref,cN(j),t?.from??{x:i,y:a},l,{size:t?.size});return}if(c){let t=eW();MB(d,e.ref,cN(j),t?.from??{x:i,y:a},c,{size:t?.size}).then(e=>{e&&c===`text`&&z(e,!0)});return}if(T){let t=eW(),n=t&&t.size.width*r.k>=40&&t.size.height*r.k>=40?{...t.at,...t.size}:null;$W(e.ref,n??{x:i,y:a},{calls:o});return}if(w){let t=eW(),o=t&&t.size.width*r.k>=40&&t.size.height*r.k>=40?{...t.at,...t.size}:null,s=EY(n),[c,l]=r.invert([0,0]);aG(o??{x:i,y:a},{page:e.ref,frames:e.frames,visible:{x:c,y:l,width:s.width/r.k,height:s.height/r.k}});return}let u=bB(d,cN(j),{x:i,y:a});u?bN.setState({open:{kind:`new`,pick:u}}):CN()},onClick:e=>{e.metaKey&&te(e.nativeEvent)},onMouseDownCapture:e=>{e.detail<=1&&(y.current=HN.getState().element??null)},onDoubleClick:e=>{if(ne(e.nativeEvent)){let e=we(`frame.rename`),[t]=HN.getState().frames;e&&Se(e)&&t&&JH(t,`canvas`)}else ee(e.nativeEvent)}})}),(0,X.jsxs)(`div`,{ref:u,"data-notes-layer":!0,className:`pointer-events-none absolute top-0 left-0 origin-top-left`,children:[(0,X.jsx)(IJ,{page:e.ref,frames:j,container:d}),(0,X.jsx)(tU,{frames:j})]}),(0,X.jsx)(Lz,{frames:j}),e.layoutError?(0,X.jsx)(SY,{error:e.layoutError}):j.length===0?(0,X.jsx)(CY,{page:e,calls:o}):null]})}function SY({error:e}){return(0,X.jsx)(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center p-6`,children:(0,X.jsxs)(`div`,{role:`alert`,className:`max-w-md rounded-lg border border-border bg-card p-4 text-body text-card-foreground`,children:[(0,X.jsx)(`p`,{className:`text-panel`,children:`This page's layout does not read`}),(0,X.jsx)(`p`,{className:`mt-1 break-all text-muted-foreground`,children:e.path}),(0,X.jsx)(`p`,{className:`mt-2`,children:e.message})]})})}function CY({page:e,calls:t}){return CG(e)?(0,X.jsx)(MG,{page:e,calls:t}):(0,X.jsx)(wY,{hidden:e.frames,calls:t})}function wY({hidden:e,calls:t}){let n=me(),r=Rg(e=>e.canWrite);if(e.length>0){let n=e.length===1?`1 hidden frame stays`:`${e.length} hidden frames stay`,i=`Show ${e.length} frame${e.length===1?``:`s`}`;return(0,X.jsxs)(`div`,{role:`status`,className:`pointer-events-none absolute top-1/2 left-1/2 w-105 max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-[55%] text-center text-body leading-[1.6] text-[color-mix(in_srgb,var(--muted-foreground)_85%,var(--foreground))]`,children:[(0,X.jsx)(`div`,{"aria-hidden":!0,className:`mx-auto mb-3.5 h-12 w-16 rounded-lg border-[1.5px] border-dashed border-faint`}),(0,X.jsx)(`p`,{className:`mb-1 text-sm font-semibold text-foreground`,children:`Every frame on this page is hidden`}),(0,X.jsxs)(`p`,{children:[n,` listed under Layers.`]}),r?(0,X.jsx)(`button`,{type:`button`,onClick:()=>void t.flagFrames(e.map(e=>e.ref),`hidden`,!1).catch(Ck(`Couldn't show the hidden frames`)),className:`pointer-events-auto mt-3.5 h-[30px] rounded-lg bg-muted px-3 font-medium text-foreground outline-none hover:bg-accent focus-visible:ring-3 focus-visible:ring-ring/50`,children:i}):null]})}return(0,X.jsxs)(`div`,{role:`status`,className:`pointer-events-none absolute top-1/2 left-1/2 w-105 max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-[55%] text-center text-body leading-[1.6] text-[color-mix(in_srgb,var(--muted-foreground)_85%,var(--foreground))]`,children:[(0,X.jsx)(`div`,{"aria-hidden":!0,className:`mx-auto mb-3.5 h-12 w-16 rounded-lg border-[1.5px] border-dashed border-faint`}),(0,X.jsx)(`p`,{className:`mb-1 text-sm font-semibold text-foreground`,children:`This page has no frames`}),(0,X.jsxs)(`p`,{children:[`Pick the Frame tool`,` `,n?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`kbd`,{className:`rounded-[5px] bg-muted px-1.5 py-0.5 font-mono text-label font-normal text-foreground`,children:`F`}),` `]}):null,`and click on the canvas,`,(0,X.jsx)(`br`,{}),`or ask your agent to draw one.`]})]})}function TY(e,t,n){return e.width*t>n.width-128||e.height*t>n.height-128?DY([{box:e}],n):{x:n.width/2-(e.x+e.width/2)*t,y:n.height/2-(e.y+e.height/2)*t,k:t}}function EY(e){return{width:e.clientWidth,height:e.clientHeight}}function DY(e,t){if(e.length===0||t.width===0||t.height===0)return{x:gY,y:gY,k:1};let n=Math.min(...e.map(({box:e})=>e.x)),r=Math.min(...e.map(({box:e})=>e.y)),i=Math.max(...e.map(({box:e})=>e.x+e.width)),a=Math.max(...e.map(({box:e})=>e.y+e.height)),o=Math.min((t.width-128)/(i-n),(t.height-128)/(a-r),1),s=Math.max(hY[0],o);return{x:(t.width-(i-n)*s)/2-n*s,y:(t.height-(a-r)*s)/2-r*s,k:s}}function OY({...e}){return(0,X.jsx)(dq,{"data-slot":`dropdown-menu`,...e})}function kY({...e}){return(0,X.jsx)(xq,{"data-slot":`dropdown-menu-trigger`,...e})}function AY({align:e=`start`,alignOffset:t=0,side:n=`bottom`,sideOffset:r=4,className:i,...a}){return(0,X.jsx)(IK,{children:(0,X.jsx)(WK,{className:`isolate z-50 outline-none`,align:e,alignOffset:t,side:n,sideOffset:r,children:(0,X.jsx)(NK,{"data-slot":`dropdown-menu-content`,className:Q(`z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95`,i),...a})})})}function jY({...e}){return(0,X.jsx)(xK,{"data-slot":`dropdown-menu-group`,...e})}function MY({className:e,inset:t,...n}){return(0,X.jsx)(SK,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:Q(`px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7`,e),...n})}function NY({className:e,inset:t,variant:n=`default`,...r}){return(0,X.jsx)(wK,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:Q(`group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive`,e),...r})}function PY({...e}){return(0,X.jsx)(pq,{"data-slot":`dropdown-menu-sub`,...e})}function FY({className:e,inset:t,children:n,...r}){return(0,X.jsxs)(Oq,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":t,className:Q(`flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[n,(0,X.jsx)(Nt,{className:`ml-auto`})]})}function IY({align:e=`start`,alignOffset:t=-3,side:n=`right`,sideOffset:r=0,className:i,...a}){return(0,X.jsx)(AY,{"data-slot":`dropdown-menu-sub-content`,className:Q(`w-auto min-w-[96px] rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,i),align:e,alignOffset:t,side:n,sideOffset:r,...a})}function LY({...e}){return(0,X.jsx)(JK,{"data-slot":`dropdown-menu-radio-group`,...e})}function RY({className:e,children:t,inset:n,...r}){return(0,X.jsxs)(QK,{"data-slot":`dropdown-menu-radio-item`,"data-inset":n,className:Q(`relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[(0,X.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex items-center justify-center`,"data-slot":`dropdown-menu-radio-item-indicator`,children:(0,X.jsx)($K,{children:(0,X.jsx)(kt,{})})}),t]})}function zY({className:e,...t}){return(0,X.jsx)(wq,{"data-slot":`dropdown-menu-separator`,className:Q(`-mx-1 my-1 h-px bg-border`,e),...t})}var BY=_.createContext(void 0);function VY(e){let t=_.useContext(BY);if(t===void 0&&!e)throw Error(La(72));return t}var HY={...ep,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,appliedTriggerProps:(e,t)=>t?e.activeTriggerProps:void 0,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},UY=class extends lo{constructor(e,t,n){let r=new Gf;super(WY(e,r,t,n),GY(r),HY)}setOpen=(e,t)=>{zf(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,Z($u,e))}};function WY(e,t,n,r=!1){return{...Jf(t,n,r),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function GY(e){return{popupRef:_.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}var KY=Ja(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=Nf((e,t)=>new UY({open:n,openProp:r,activeTriggerId:d,triggerIdProp:u},e,t));p.useControlledProp(`openProp`,r),p.useControlledProp(`triggerIdProp`,u),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),h=!t&&m,g=p.useState(`activeTriggerId`),v=p.useState(`mounted`),y=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i,disabled:t}),Vf(p,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:b,transitionStatus:x}=Hf(h,p),S=p.useState(`isInstantPhase`),C=p.useState(`instantType`),w=p.useState(`lastOpenChangeReason`),T=_.useRef(null);G(()=>{m&&t&&p.setOpen(!1,Z(bd))},[m,t,p]),G(()=>{x===`ending`&&w===`none`||x!==`ending`&&S?(C!==`delay`&&(T.current=C),p.set(`instantType`,`delay`)):T.current!==null&&(p.set(`instantType`,T.current),T.current=null)},[x,S,w,C,p]),G(()=>{h&&(g??p.set(`payload`,void 0))},[p,g,h]),_.useImperativeHandle(o,()=>({unmount:b,close:()=>p.setOpen(!1,Z(Cd))}),[b,p]);let E=h||v||!t&&a!==`none`;return(0,X.jsxs)(BY.Provider,{value:p,children:[l&&(0,X.jsx)(Pf,{handle:l,store:p}),E&&(0,X.jsx)(qY,{store:p,disabled:t,trackCursorAxis:a}),typeof f==`function`?f({payload:y}):f]})});function qY({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),i=Df(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),a=wf(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n}),o=_.useMemo(()=>Ol(a.reference,i.reference),[a.reference,i.reference]);return Uf(e,{activeTriggerProps:o,inactiveTriggerProps:o,popupProps:i.floating??Ma}),null}var JY=_.createContext(void 0);function YY(){return _.useContext(JY)}var XY=`data-base-ui-tooltip-trigger`;function ZY(e){let t=ps(e);return go(t)?t:null}var QY=Ya(function(e,t){let{render:n,className:r,style:i,handle:a,payload:o,disabled:s,delay:c,closeOnClick:l=!0,closeDelay:u,id:d,...f}=e,p=VY(!0),m=tp(a)??p;if(!m)throw Error(La(82));let h=xV(d),g=m.useState(`isTriggerActive`,h),v=m.useState(`isOpenedByTrigger`,h),y=m.useState(`floatingRootContext`),b=_.useRef(null),x=u??0,{registerTrigger:S,isMountedByThisTrigger:C}=Bf(h,b,m,{payload:o,closeOnClick:l,closeDelay:x}),w=YY(),{activeIdRef:T,delayRef:E,isInstantPhase:D,hasProvider:O}=Hd(y,{open:v}),k=cp(y);m.useSyncedValue(`isInstantPhase`,D);let A=m.useState(`disabled`),j=s??A,M=Md(j),N=m.useState(`trackCursorAxis`),P=m.useState(`disableHoverablePopup`),F=_.useRef(!1),I=Wo(),L=_.useRef(void 0);function R(){return O&&T.current!=null?0:c??w??600}function z(e){let t=b.current;if(!t||!e)return!1;let n=fs(e,`[${XY}]`);return n!==null&&n!==t&&Y(t,n)}function ee(e){let t=z(e);return F.current=t,t&&(k.openChangeTimeout.clear(),k.restTimeout.clear(),k.restTimeoutPending=!1,I.clear()),t}let te=dp(y,{enabled:!j,mouseOnly:!0,move:!1,handleClose:!P&&N!==`both`?Dp():null,restMs:R,delay(){return u==null&&O?{close:Fd(E.current,`close`)}:{close:x}},triggerElementRef:b,isActiveTrigger:g,isClosing:()=>m.select(`transitionStatus`)===`ending`,shouldOpen(){return!F.current}}),ne=rp(y,{enabled:!j}).reference,re=e=>{let t=F.current,n=ZY(e),r=ee(n),i=b.current,a=i&&n&&Y(i,n);if(r&&m.select(`open`)&&m.select(`lastOpenChangeReason`)===`trigger-hover`)m.setOpen(!1,Z(ed,e));else if(t&&!r&&a&&!M.current&&!m.select(`open`)&&i&&ec(L.current)){let t=()=>{F.current||M.current||m.select(`open`)||m.setOpen(!0,Z(ed,e,i))},n=R();n===0?(I.clear(),t()):I.start(n,t)}},ie=m.useState(`appliedTriggerProps`,C||N!==`none`);return Vl(`button`,e,{state:{open:v},ref:[t,S,b],props:[te,ne,ie,{onMouseOver(e){re(e.nativeEvent)},onFocus(e){z(ZY(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){F.current=!1,I.clear(),L.current=void 0},onPointerEnter(e){L.current=e.pointerType},onPointerDown(e){L.current=e.pointerType,m.set(`closeOnClick`,l),l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},onClick(e){l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},id:h,[zs]:j?``:void 0,[XY]:j?void 0:``},f],stateAttributesMapping:Fs})}),$Y=_.createContext(void 0);function eX(){let e=_.useContext($Y);if(e===void 0)throw Error(La(70));return e}var tX=_.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return VY().useState(`mounted`)||n?(0,X.jsx)($Y.Provider,{value:n,children:(0,X.jsx)(Ad,{ref:t,...r})}):null}),nX=_.createContext(void 0);function rX(){let e=_.useContext(nX);if(e===void 0)throw Error(La(71));return e}var iX=_.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=pu,style:g,...v}=e,y=VY(),b=eX(),x=y.useState(`open`),S=y.useState(`mounted`),C=y.useState(`trackCursorAxis`),w=y.useState(`disableHoverablePopup`),T=y.useState(`floatingRootContext`),E=y.useState(`instantType`),D=y.useState(`transitionStatus`),O=qm({anchor:i,positionMethod:a,floatingRootContext:T,mounted:S,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:b,collisionAvoidance:h,adaptiveOrigin:y.useState(`adaptiveOrigin`)}),k=Zm(e,_.useMemo(()=>({open:x,side:O.side,align:O.align,anchorHidden:O.anchorHidden,instant:C===`none`?E:`tracking-cursor`}),[x,O.side,O.align,O.anchorHidden,C,E]),{styles:O.positionerStyles,transitionStatus:D,props:v,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!S,inert:!x||C===`both`||w});return(0,X.jsx)(nX.Provider,{value:O,children:k})}),aX=_.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=VY(),{side:s,align:c}=rX(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`disabled`),h=o.useState(`closeDelay`);au({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),lp(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return Vl(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[jf,f,Xm(d),a],stateAttributesMapping:Rs})}),oX=_.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=VY(),{arrowRef:s,side:c,align:l,arrowUncentered:u,arrowStyles:d}=rX();return Vl(`div`,e,{state:{open:o.useState(`open`),side:c,align:l,uncentered:u,instant:o.useState(`instantType`)},ref:[t,s],props:[{style:d,"aria-hidden":!0},a],stateAttributesMapping:Ls})}),sX=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=_.useMemo(()=>({open:t,close:n}),[t,n]);return(0,X.jsx)(JY.Provider,{value:t,children:(0,X.jsx)(Vd,{delay:i,timeoutMs:r,children:e.children})})};function cX({delay:e=0,...t}){return(0,X.jsx)(sX,{"data-slot":`tooltip-provider`,delay:e,...t})}function lX({...e}){return(0,X.jsx)(KY,{"data-slot":`tooltip`,...e})}function uX({...e}){return(0,X.jsx)(QY,{"data-slot":`tooltip-trigger`,...e})}function dX({className:e,side:t=`top`,sideOffset:n=4,align:r=`center`,alignOffset:i=0,children:a,...o}){return(0,X.jsx)(tX,{children:(0,X.jsx)(iX,{align:r,alignOffset:i,side:t,sideOffset:n,className:`isolate z-50`,children:(0,X.jsxs)(aX,{"data-slot":`tooltip-content`,className:Q(`z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background motion-reduce:animate-none! has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...o,children:[a,(0,X.jsx)(oX,{className:`z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5`})]})})})}function fX({label:e,keys:t,children:n,side:r=`top`}){let i=he(t,me());return(0,X.jsxs)(lX,{children:[(0,X.jsx)(uX,{render:n}),(0,X.jsx)(dX,{side:r,sideOffset:6,className:`rounded-md px-2 py-[5px] text-[11px]`,children:i?`${e} ${V(i)}`:e})]})}function pX({className:e,...t}){return(0,X.jsx)(AY,{className:Q(`w-60 rounded-[10px] p-1 text-xs shadow-[0_12px_40px_rgba(0,0,0,.3)] ring-border`,e),...t})}function mX({action:e,label:t,keys:n,children:r}){let i=he(e?.keys??n,me());return(0,X.jsxs)(NY,{disabled:!e||!Se(e),onClick:()=>e?.run(),className:hX,children:[r??e?.label??t,i?(0,X.jsx)(gX,{children:V(i)}):null]})}var hX=`h-7 rounded-md px-2 py-0 text-xs`;function gX({children:e}){return(0,X.jsx)(`kbd`,{className:`ml-auto grid h-5 min-w-5 place-items-center rounded-[5px] bg-muted px-[5px] font-sans text-label font-normal text-muted-foreground`,children:e})}var _X=[`view.hideUi`],vX=[`project.rename`,`project.duplicate`,`nav.home`],yX=[];function bX({project:e,page:t,calls:n}){let[r]=Ce(_X);return(0,X.jsxs)(`div`,{className:`flex h-11 shrink-0 items-center gap-1.5 border-b border-sidebar-border px-2`,children:[(0,X.jsx)(fX,{label:`Home`,side:`bottom`,children:(0,X.jsx)(Ea,{href:`/`,"aria-label":`Home`,className:SX,children:(0,X.jsx)(En,{"aria-hidden":!0,className:`size-[15px]`})})}),(0,X.jsx)(xX,{project:e,page:t,calls:n}),(0,X.jsx)(fX,{label:`Hide UI`,keys:r?.keys,side:`bottom`,children:(0,X.jsx)(`button`,{type:`button`,"aria-label":`Hide UI`,onClick:()=>r?.run(),className:SX,children:(0,X.jsx)(gr,{"aria-hidden":!0,className:`size-[15px]`})})})]})}function xX({project:e,page:t,calls:n}){let[r,i,a]=Ce(vX),o=Hk(e.name),s=Rg(e=>e.board?.projects??yX),[,c]=ya(),l=s.filter(t=>t.name!==e.name),u=r!==void 0&&Se(r);return o?(0,X.jsx)(`span`,{className:`flex min-w-0 flex-1 text-panel`,children:(0,X.jsx)(uV,{name:o.draft,label:`Rename project ${e.name}`,onCommit:r=>{qk(e.name,r,n).then(e=>{e&&c(Qg(e,t),{replace:!0})})},onCancel:Gk},o.attempt)}):(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center`,children:[(0,X.jsx)(`button`,{type:`button`,disabled:!u,title:u?`Rename ${e.name}`:e.name,onClick:()=>r?.run(),className:`min-w-0 truncate rounded-[5px] px-1 -ml-1 text-left text-panel outline-none hover:bg-sidebar-accent focus-visible:ring-2 focus-visible:ring-ring/50 disabled:hover:bg-transparent`,children:e.name}),(0,X.jsxs)(OY,{children:[(0,X.jsx)(kY,{"aria-label":`Project menu`,className:`grid size-6 shrink-0 place-items-center rounded-[5px] text-muted-foreground outline-none hover:bg-sidebar-accent hover:text-sidebar-foreground focus-visible:ring-2 focus-visible:ring-ring/50 aria-expanded:bg-sidebar-accent`,children:(0,X.jsx)(jt,{"aria-hidden":!0,className:`size-3`})}),(0,X.jsxs)(pX,{align:`start`,sideOffset:6,className:`w-56`,children:[(0,X.jsx)(mX,{action:r,label:`Rename`}),(0,X.jsx)(mX,{action:i,label:`Duplicate`}),(0,X.jsxs)(PY,{children:[(0,X.jsx)(FY,{disabled:l.length===0,className:hX,children:`Switch project`}),(0,X.jsx)(IY,{className:`w-56 rounded-[10px] p-1 text-xs shadow-[0_12px_40px_rgba(0,0,0,.3)] ring-border`,children:l.map(e=>(0,X.jsx)(NY,{onClick:()=>c(Kk(e)),className:hX,children:(0,X.jsx)(`span`,{className:`truncate`,children:e.name})},e.name))})]}),(0,X.jsx)(zY,{}),(0,X.jsx)(mX,{action:a,label:`All projects`})]})]})]})}var SX=`grid size-[26px] shrink-0 place-items-center rounded-md text-muted-foreground outline-none hover:bg-accent hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50`,CX={name:`frameboard`,version:`0.22.0`,description:`A local design board that coding agents draw on as plain HTML files`,keywords:[`design`,`board`,`canvas`,`html`,`coding-agent`,`claude-code`,`cli`],homepage:`https://github.com/erclx/frameboard#readme`,bugs:{url:`https://github.com/erclx/frameboard/issues`},repository:{type:`git`,url:`git+https://github.com/erclx/frameboard.git`},license:`MIT`,type:`module`,bin:{frameboard:`dist/cli.js`},files:[`dist`],engines:{node:`>=22`},scripts:{typecheck:`tsc --noEmit`,build:`vite build && rolldown -c rolldown.config.ts && bun scripts/copy-faces.ts`,dev:`WORKTREE_PORT_OFFSET=$(bash scripts/worktree-port.sh) && export WORKTREE_PORT_OFFSET && bun scripts/dev.ts`,preview:`bun scripts/preview.ts`,test:`vitest`,"test:run":`bun scripts/test-locked.ts vitest run --reporter=verbose --maxWorkers=50%`,"test:ui":`vitest --ui`,"test:coverage":`vitest run --coverage --project node`,"test:e2e":`WORKTREE_PORT_OFFSET=$(bash scripts/worktree-port.sh) && export WORKTREE_PORT_OFFSET && bun scripts/test-locked.ts playwright test`,"test:e2e:changed":`WORKTREE_PORT_OFFSET=$(bash scripts/worktree-port.sh) && export WORKTREE_PORT_OFFSET && bun scripts/test-locked.ts playwright test --only-changed`,"test:e2e:ui":`WORKTREE_PORT_OFFSET=$(bash scripts/worktree-port.sh) && export WORKTREE_PORT_OFFSET && playwright test --ui`,"test:e2e:report":`playwright show-report`,"check:full":`bun scripts/verify.ts && bun run test:e2e`,"measure:canvas":`bun run build && playwright test -c e2e/perf/playwright.config.ts`,"smoke:prod":`bun e2e/screenshot.ts --check-console-clean --require-base-url`,prepare:`husky`,"design:sync":`bun scripts/design-sync.ts`,check:`bun scripts/verify.ts`,"check:format":`oxfmt --check .`,format:`oxfmt .`,lint:`oxlint --max-warnings 0 --disable-nested-config`,"lint:fix":`oxlint --fix --max-warnings 0 --disable-nested-config`,screenshot:`PREVIEW_PORT=$(bash scripts/worktree-port.sh 4173) && export PREVIEW_PORT && bash scripts/screenshot.sh`,"screenshot:compare":`bun run build && bun scripts/screenshot-compare.ts`,"readme-screenshot":`PREVIEW_PORT=$(bash scripts/worktree-port.sh 4173) && export PREVIEW_PORT && bash scripts/readme-screenshot.sh`},devDependencies:{"@atlaskit/pragmatic-drag-and-drop":`4.0.0`,"@atlaskit/pragmatic-drag-and-drop-hitbox":`3.0.0`,"@base-ui/react":`^1.9.0`,"@bramus/specificity":`^2.4.3`,"@commitlint/cli":`^21.2.3`,"@commitlint/config-conventional":`^21.2.3`,"@fontsource-variable/caveat":`^5.3.0`,"@fontsource-variable/geist":`^5.3.0`,"@fontsource-variable/geist-mono":`^5.3.0`,"@fontsource-variable/inter":`^5.3.0`,"@fontsource-variable/source-serif-4":`^5.3.1`,"@hono/node-server":`^2.1.5`,"@playwright/test":`^1.64.1`,"@tailwindcss/vite":`^4.3.3`,"@testing-library/jest-dom":`^7.0.1`,"@testing-library/react":`^16.3.3`,"@testing-library/user-event":`^14.6.8`,"@types/d3-drag":`^3.0.7`,"@types/d3-selection":`^3.0.12`,"@types/d3-zoom":`^3.0.9`,"@types/jsdom":`^30.0.0`,"@types/node":`^26.6.5`,"@types/react":`^19.3.0`,"@types/react-dom":`^19.3.0`,"@types/ws":`^8.18.2`,"@vitejs/plugin-react":`^6.1.2`,"@vitest/browser-playwright":`^5.0.4`,"@vitest/coverage-v8":`^5`,"@vitest/ui":`^5`,chokidar:`^6.0.0`,"class-variance-authority":`^0.7.1`,cmdk:`^1.1.1`,cn:`^0.5.0`,commander:`^15.0.0`,"css-select":`^7.0.0`,"d3-drag":`3.0.0`,"d3-selection":`^3.0.0`,"d3-zoom":`^3.0.0`,"eslint-plugin-check-file":`^3.3.2`,"eslint-plugin-simple-import-sort":`^14.0.0`,"fast-check":`^4.10.2`,hono:`^4.13.13`,husky:`^9.1.7`,jsdom:`^30.1.2`,"lucide-react":`^1.57.0`,oxfmt:`0.74.0`,oxlint:`1.89.0`,parse5:`^8.0.1`,"parse5-htmlparser2-tree-adapter":`^8.0.1`,playwright:`^1.64.1`,postcss:`^8.5.6`,react:`^19.3.1`,"react-dom":`^19.3.1`,"react-resizable-panels":`^4.14.5`,rolldown:`^1.2.14`,shadcn:`^4.21.5`,tailwindcss:`^4.3.3`,tinykeys:`^4.0.1`,"tw-animate-css":`^1.4.0`,typescript:`^7`,vite:`^8.3.4`,vitest:`^5`,wouter:`^3.13.0`,ws:`^8.22.0`,zod:`^4.6.7`,zustand:`^5.0.15`},dependencies:{"playwright-core":`1.64.1`}},wX={config:`Saved on this machine`,git:`From git user.name`};function TX({name:e,source:t=null,align:n=`start`}){let[r]=Ce([`help.shortcuts`]),i=Ee(`theme`),a=i.find(e=>e.checked?.()),o=t?wX[t]:null;return(0,X.jsxs)(OY,{children:[(0,X.jsx)(kY,{"aria-label":e&&o?`${e}, ${o.toLowerCase()}`:`Account`,className:`rounded-full outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,children:(0,X.jsx)(OX,{name:e??null})}),(0,X.jsxs)(pX,{align:n,alignOffset:n===`start`?-25:-10,sideOffset:7,children:[e===void 0?null:(0,X.jsx)(EX,{name:e,caption:o}),(0,X.jsx)(mX,{action:r,label:`Keyboard shortcuts`}),(0,X.jsxs)(PY,{children:[(0,X.jsxs)(FY,{disabled:i.length===0,className:`${hX} data-disabled:opacity-50`,children:[`Theme`,a?(0,X.jsx)(`span`,{className:`ml-auto text-muted-foreground`,children:a.label}):null]}),(0,X.jsx)(IY,{className:`rounded-[10px] ring-border`,children:(0,X.jsx)(LY,{value:a?.id??``,children:i.map(e=>(0,X.jsx)(RY,{value:e.id,onClick:()=>e.run(),className:`h-7 py-0 text-xs`,children:e.label},e.id))})})]}),(0,X.jsx)(NY,{className:hX,render:(0,X.jsx)(`a`,{href:CX.homepage}),children:`Docs`})]})]})}function EX({name:e,caption:t}){let n=Rg(e=>e.canWrite),[r,i]=(0,_.useState)(!1),a=(0,_.useRef)(null),o=(0,_.useRef)(!1);if((0,_.useEffect)(()=>{!r&&o.current&&(o.current=!1,a.current?.focus())},[r]),!e&&!n)return null;let s=()=>{o.current=!0,i(!1)};return r?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2.5 p-2`,onKeyDown:e=>{e.key!==`Tab`&&e.stopPropagation()},children:[(0,X.jsx)(OX,{name:e}),(0,X.jsxs)(`div`,{className:`min-w-0 flex-1 pl-1.5`,children:[(0,X.jsx)(uV,{hug:!0,clearable:!0,name:e??``,label:`Your name`,onCommit:e=>{s(),OJ(e).catch(e=>tg.add({title:`Couldn't save your name`,description:e instanceof Error?e.message:String(e),type:`error`}))},onCancel:s}),(0,X.jsx)(`p`,{className:`mt-0.5 text-label font-normal text-muted-foreground`,children:e?t??``:`Signs your notes`})]})]}),(0,X.jsx)(zY,{})]}):(0,X.jsxs)(X.Fragment,{children:[n?(0,X.jsx)(NY,{ref:a,closeOnClick:!1,onClick:()=>i(!0),"aria-label":e?`Edit your name, ${e}`:`Set your name`,className:`gap-2.5 p-2`,children:(0,X.jsx)(DX,{name:e,caption:t})}):(0,X.jsx)(`div`,{className:`flex items-center gap-2.5 p-2`,children:(0,X.jsx)(DX,{name:e,caption:t})}),(0,X.jsx)(zY,{})]})}function DX({name:e,caption:t}){return e?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(OX,{name:e}),(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(`p`,{className:`truncate font-semibold`,title:e,children:e}),t?(0,X.jsx)(`p`,{className:`text-label font-normal text-muted-foreground`,children:t}):null]})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:`grid size-[22px] shrink-0 place-items-center rounded-full bg-muted text-[10px] font-bold text-muted-foreground`,children:`?`}),(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(`p`,{className:`font-semibold text-primary`,children:`Set your name`}),(0,X.jsx)(`p`,{className:`text-label font-normal text-muted-foreground`,children:`Signs your notes`})]})]})}function OX({name:e}){return(0,X.jsx)(`span`,{"aria-hidden":!0,"data-avatar":!0,className:`grid size-[22px] shrink-0 place-items-center rounded-full bg-foreground text-[10px] font-bold text-card`,children:e?SJ(e):(0,X.jsx)(Pi,{className:`size-3`})})}var kX=[{id:`view.zoomIn`,label:`Zoom in`},{id:`view.zoomOut`,label:`Zoom out`},{id:`view.zoomToFit`,label:`Zoom to fit`}],AX=[{id:`view.zoom50`,label:`50%`},{id:`view.zoom100`,label:`100%`},{id:`view.zoom200`,label:`200%`}],jX=[...kX,...AX].map(e=>e.id);function MX({align:e=`end`,className:t}){let n=(0,_.useRef)(null),r=Ce(jX);return(0,_.useEffect)(()=>{let e=()=>{n.current&&(n.current.textContent=NX(a_.zoom()))};return e(),a_.onZoom(e)},[]),(0,X.jsxs)(OY,{children:[(0,X.jsxs)(kY,{"aria-label":`Zoom`,className:Q(`flex h-6 items-center gap-1 rounded-md px-1 text-muted-foreground tabular-nums outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 aria-expanded:text-foreground`,t),children:[(0,X.jsx)(`span`,{ref:n,"data-zoom-level":!0}),(0,X.jsx)(jt,{"aria-hidden":!0,className:`size-2.5`})]}),(0,X.jsxs)(pX,{align:e,sideOffset:8,className:`w-48`,children:[kX.map((e,t)=>(0,X.jsx)(mX,{action:r[t],label:e.label},e.id)),(0,X.jsx)(zY,{}),AX.map((e,t)=>(0,X.jsx)(mX,{action:r[kX.length+t],label:e.label,children:e.label},e.id))]})]})}function NX(e){return`${Math.round(e*100)}%`}function PX({project:e,page:t,calls:n}){let[r]=Ce([`view.hideUi`]),i=EJ(),a=DJ();return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`absolute top-3 left-3 z-10 flex max-w-[calc(100%-10rem)] items-center gap-2 rounded-[10px] border border-border bg-card py-1.5 pr-2 pl-1.5 shadow-[0_2px_8px_rgba(0,0,0,.12)]`,children:[(0,X.jsx)(fX,{label:`Home`,side:`bottom`,children:(0,X.jsx)(Ea,{href:`/`,"aria-label":`Home`,className:FX,children:(0,X.jsx)(En,{"aria-hidden":!0,className:`size-[15px]`})})}),(0,X.jsx)(`span`,{"aria-hidden":!0,className:`h-4 w-px shrink-0 bg-border`}),(0,X.jsx)(xX,{project:e,page:t,calls:n}),(0,X.jsx)(fX,{label:`Show UI`,keys:r?.keys,side:`bottom`,children:(0,X.jsx)(`button`,{type:`button`,"aria-label":`Show UI`,onClick:()=>r?.run(),className:FX,children:(0,X.jsx)(gr,{"aria-hidden":!0,className:`size-[15px]`})})})]}),(0,X.jsxs)(`div`,{className:`absolute top-3 right-3 z-10 flex h-[34px] items-center gap-1.5 rounded-lg border border-border bg-card pr-2.5 pl-1.5`,children:[(0,X.jsx)(TX,{name:i,source:a,align:`end`}),(0,X.jsx)(MX,{className:`text-foreground`})]})]})}var FX=`grid size-7 shrink-0 place-items-center rounded-md text-muted-foreground outline-none hover:bg-accent hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50`,IX=`a[href], button, input, select, textarea, summary, [onclick], [tabindex], [contenteditable], video[controls], audio[controls], script`;function LX(e){return rz(e).some(e=>e.matches(IX))}function RX(e,t=document){let n=e.filter(e=>!e.hidden);if(n.length===0)return`unread`;let r=!1;for(let e of n){let n=t.querySelector(`[data-frame="${CSS.escape(e.ref)}"] > iframe`)?.contentDocument;if(!n||!zX(n))r=!0;else if(LX(n))return`clickable`}return r?`unread`:`static`}function zX(e){return e.readyState===`complete`&&e.URL!==`about:blank`}function BX(e){return document.addEventListener(`load`,e,!0),()=>document.removeEventListener(`load`,e,!0)}function VX({frames:e}){let t=(0,_.useSyncExternalStore)(BX,(0,_.useCallback)(()=>RX(e),[e]),()=>`unread`);return(0,X.jsxs)(`p`,{role:`status`,className:`pointer-events-none absolute top-3.5 left-1/2 z-10 flex -translate-x-1/2 flex-col items-center rounded-[14px] bg-primary px-3 py-1.5 font-medium whitespace-nowrap text-primary-foreground`,children:[(0,X.jsx)(`span`,{children:`Playing. Clicks go to the frames. Esc to edit`}),t===`static`?(0,X.jsx)(`span`,{className:`font-normal`,children:`Nothing on this page takes a click`}):null]})}var HX=`font-mono text-label font-normal text-foreground`;function UX({project:e,anchor:t,load:n=oA,upload:r=aM}){let i=Rg(e=>e.canWrite),a=F(YU,e=>e.open)&&i;return(0,X.jsx)(hH,{open:a,onOpenChange:e=>YU.setState({open:e}),children:(0,X.jsx)(_H,{anchor:t,side:`top`,sideOffset:8,"aria-label":`Image or video`,className:`w-[260px] gap-0 p-0 text-xs`,children:a?(0,X.jsx)(WX,{project:e,load:n,upload:r}):null})})}function WX({project:e,load:t,upload:n}){let[r,i]=(0,_.useState)(0),[a,o]=(0,_.useState)(),[s,c]=(0,_.useState)(!1),[l,u]=(0,_.useState)(null),d=(0,_.useRef)(null);(0,_.useEffect)(()=>{let n=!0;return t(e).catch(()=>null).then(e=>{n&&o(e)}),()=>{n=!1}},[e,t,r]);async function f(t){if(t.length!==0){c(!0);try{let r=await n(e,t);u(r.refused.length>0?r.refused.map(e=>`${e.name}: ${e.message}`).join(` `):null)}catch(e){u(e instanceof Error?e.message:String(e))}finally{c(!1),i(e=>e+1)}}}if(a===void 0)return null;if(a===null)return(0,X.jsx)(`p`,{className:`m-3 text-muted-foreground`,children:`The assets did not load. Reload the board to try again.`});let p=a.files.filter(Yj);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`h3`,{className:`px-3 pt-2.5 pb-1 text-label text-muted-foreground`,children:[`Image or video · `,p.length,` `,p.length===1?`file`:`files`]}),p.length===0?(0,X.jsxs)(`div`,{className:`flex flex-col items-start gap-2 px-3 pt-1 pb-3`,children:[(0,X.jsxs)(`p`,{className:`leading-normal text-muted-foreground`,children:[`No images or videos in `,(0,X.jsx)(`code`,{className:HX,children:`assets/`}),` yet.`]}),(0,X.jsx)(`button`,{type:`button`,disabled:s,onClick:()=>d.current?.click(),className:`h-7 rounded-md bg-primary px-2.5 font-medium text-primary-foreground outline-none hover:bg-primary/90 focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50`,children:s?`Adding files…`:`Add files`}),(0,X.jsx)(`input`,{ref:d,type:`file`,multiple:!0,hidden:!0,accept:`image/*,video/*,.svg`,"aria-label":`Choose files to add`,onChange:e=>{let t=[...e.target.files??[]];e.target.value=``,f(t)}})]}):(0,X.jsx)(`ul`,{className:`grid max-h-[320px] grid-cols-2 gap-2 overflow-y-auto px-2 pt-1 pb-2`,children:p.map(t=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,onClick:()=>XU({project:e,path:t.path,kind:t.kind}),"aria-label":`Place ${t.path}`,className:`block w-full overflow-hidden rounded-lg bg-muted text-left outline-none hover:ring-[1.5px] hover:ring-primary focus-visible:ring-[1.5px] focus-visible:ring-primary`,children:[(0,X.jsx)(iM,{project:e,file:t}),(0,X.jsxs)(`span`,{className:`block truncate px-[7px] py-[5px] text-label font-normal`,children:[(0,X.jsx)(`span`,{title:t.path,children:t.path}),(0,X.jsx)(`span`,{className:`block text-[10px] text-muted-foreground`,children:Wj(t)})]})]})},t.path))}),l?(0,X.jsx)(`p`,{role:`alert`,className:`mx-3 mb-2 text-destructive`,children:l}):null]})}var GX=`tool.shape`,KX=`tool.frame`,qX=`tool.section`,JX=[{tool:`frame`,id:KX,label:`Frame`,key:`f`,icon:bn},{tool:`section`,id:qX,label:`Section`,key:`Shift+KeyS`,icon:vr}],YX=[[{id:`tool.move`,label:`Move`,keys:[`v`],icon:ur},{id:`tool.hand`,label:`Hand`,keys:[`h`],icon:wn},{id:KX,label:`Frame`,keys:[`f`],icon:bn},{id:`tool.text`,label:`Text`,keys:[`t`],icon:Oi},{id:GX,label:`Shape`,icon:KU[0].icon},{id:`tool.note`,label:`Note`,keys:[`n`],icon:nr}],[{id:`edit.undo`,label:`Undo`,icon:Mi},{id:`edit.redo`,label:`Redo`,icon:Pr}],[{id:`view.zoomToFit`,label:`Zoom to fit`,keys:[`Shift+Digit1`],icon:er},{id:`theme.toggle`,label:`Theme`,icon:oi,darkIcon:cr}]],XX=[{id:`mode.edit`,label:`Edit`,icon:Sr},{id:`mode.play`,label:`Play`,icon:Or}],ZX=[...[...YX.flat(),...XX].map(e=>e.id).filter(e=>e!==GX),...KU.map(e=>e.id),GU,qX];function QX({project:e}){let t=Ce(ZX),n=new Map(ZX.map((e,n)=>[e,t[n]])),r=(0,_.useRef)(null);return(0,X.jsxs)(`div`,{ref:r,role:`toolbar`,"aria-label":`Tools`,className:`absolute bottom-4 left-1/2 z-10 flex max-w-[calc(100%-1.5rem)] -translate-x-1/2 items-center gap-0.5 overflow-x-auto rounded-xl border border-border bg-card p-[5px] shadow-[0_6px_24px_rgba(0,0,0,.18),0_1px_3px_rgba(0,0,0,.12)]`,children:[YX.map((e,t)=>(0,X.jsxs)(_.Fragment,{children:[t>0?(0,X.jsx)(rZ,{}):null,e.map(e=>e.id===GX?(0,X.jsx)(eZ,{actions:n},e.id):e.id===KX?(0,X.jsx)(tZ,{actions:n},e.id):(0,X.jsx)($X,{slot:e,action:n.get(e.id)},e.id))]},e[0]?.id)),(0,X.jsx)(rZ,{}),(0,X.jsx)(`div`,{className:`flex shrink-0 rounded-lg bg-muted p-0.5`,children:XX.map(e=>(0,X.jsx)(nZ,{slot:e,action:n.get(e.id)},e.id))}),e===void 0?null:(0,X.jsx)(UX,{project:e,anchor:r})]})}function $X({slot:e,action:t,pressed:n}){let r=iZ(e,t),{label:i,keys:a,enabled:o,run:s}=r,c=n??r.on,l=e.icon,u=e.darkIcon;return(0,X.jsx)(fX,{label:i,keys:a,children:(0,X.jsxs)(`button`,{type:`button`,"aria-label":i,"aria-pressed":t?.checked||n!==void 0?c:void 0,"aria-disabled":!o||void 0,onClick:s,className:Q(`grid size-8 shrink-0 place-items-center rounded-[7px] text-foreground outline-none hover:bg-accent focus-visible:ring-3 focus-visible:ring-ring/50 aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-disabled:hover:bg-transparent`,c&&`bg-primary text-primary-foreground hover:bg-primary aria-disabled:hover:bg-primary`),children:[(0,X.jsx)(l,{"aria-hidden":!0,className:Q(`size-4`,u&&`dark:hidden`)}),u?(0,X.jsx)(u,{"aria-hidden":!0,className:`hidden size-4 dark:block`}):null]})})}function eZ({actions:e}){let t=nW(),n=me(),r=e.get(t.id),i={id:t.id,label:t.label,keys:[t.key],icon:t.icon},a=KU.some(t=>e.get(t.id)?.checked?.()??!1);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)($X,{slot:i,action:r,pressed:a}),(0,X.jsxs)(OY,{children:[(0,X.jsx)(kY,{"aria-label":`Shapes`,className:`-ml-0.5 grid h-8 w-6 shrink-0 place-items-center rounded-[5px] text-muted-foreground outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 aria-expanded:text-foreground`,children:(0,X.jsx)(jt,{"aria-hidden":!0,className:`size-[9px]`})}),(0,X.jsxs)(pX,{side:`top`,align:`start`,sideOffset:8,className:`w-[220px]`,children:[(0,X.jsx)(LY,{value:t.kind,onValueChange:t=>{let n=e.get(tW(t).id);n&&Se(n)&&n.run()},children:KU.map(t=>{let r=e.get(t.id),i=he(r?.keys??[t.key],n),a=t.icon;return(0,X.jsxs)(RY,{value:t.kind,closeOnClick:!0,disabled:!r||!Se(r),className:Q(hX,`gap-2 pr-2 data-checked:bg-primary data-checked:text-primary-foreground [&_[data-slot=dropdown-menu-radio-item-indicator]]:hidden`),children:[(0,X.jsx)(a,{"aria-hidden":!0,className:`size-[13px]`}),t.label,i?(0,X.jsx)(gX,{children:V(i)}):null]},t.id)})}),(0,X.jsx)(zY,{}),(0,X.jsx)(mX,{action:e.get(GU),label:`Image or video`,keys:[`$mod+Shift+KeyK`],children:(0,X.jsxs)(`span`,{className:`flex items-center gap-2 whitespace-nowrap`,children:[(0,X.jsx)(On,{"aria-hidden":!0,className:`size-[13px]`}),`Image or video…`]})})]})]})]})}function tZ({actions:e}){let t=GW(),n=me(),r=JX.find(e=>e.tool===t)??JX[0],i={id:r.id,label:r.label,keys:[r.key],icon:r.icon},a=JX.some(t=>e.get(t.id)?.checked?.()??!1);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)($X,{slot:i,action:e.get(r.id),pressed:a}),(0,X.jsxs)(OY,{children:[(0,X.jsx)(kY,{"aria-label":`Frame tools`,className:`-ml-0.5 grid h-8 w-6 shrink-0 place-items-center rounded-[5px] text-muted-foreground outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 aria-expanded:text-foreground`,children:(0,X.jsx)(jt,{"aria-hidden":!0,className:`size-[9px]`})}),(0,X.jsx)(pX,{side:`top`,align:`start`,sideOffset:8,className:`w-[196px]`,children:(0,X.jsx)(LY,{value:t,onValueChange:t=>{let n=JX.find(e=>e.tool===t),r=n&&e.get(n.id);r&&Se(r)&&r.run()},children:JX.map(t=>{let r=e.get(t.id),i=he(r?.keys??[t.key],n),a=t.icon;return(0,X.jsxs)(RY,{value:t.tool,closeOnClick:!0,disabled:!r||!Se(r),className:Q(hX,`gap-2 pr-2 data-checked:bg-primary data-checked:text-primary-foreground [&_[data-slot=dropdown-menu-radio-item-indicator]]:hidden`),children:[(0,X.jsx)(a,{"aria-hidden":!0,className:`size-[13px]`}),t.label,i?(0,X.jsx)(gX,{children:V(i)}):null]},t.id)})})})]})]})}function nZ({slot:e,action:t}){let{label:n,keys:r,on:i,enabled:a,run:o}=iZ(e,t),s=e.icon;return(0,X.jsx)(fX,{label:n,keys:r,children:(0,X.jsxs)(`button`,{type:`button`,"aria-pressed":i,"aria-disabled":!a||void 0,onClick:o,className:Q(`flex h-[26px] items-center gap-[5px] rounded-md px-[9px] font-medium text-muted-foreground outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 aria-disabled:cursor-not-allowed aria-disabled:opacity-50`,i&&e.id===`mode.play`?`bg-primary text-primary-foreground hover:text-primary-foreground`:i&&`bg-card text-foreground ring-1 ring-border`),children:[(0,X.jsx)(s,{"aria-hidden":!0,className:`size-3.5`}),n]})})}function rZ(){return(0,X.jsx)(`span`,{"aria-hidden":!0,className:`mx-[5px] h-5 w-px shrink-0 bg-border`})}function iZ(e,t){let n=t?Se(t):!1;return{label:t?.label??e.label,keys:t?.keys??e.keys,on:t?.checked?.()??!1,enabled:n,run:()=>{t&&n&&t.run()}}}function aZ(){return N()(()=>({open:!1,focusRequest:0}))}var oZ=aZ();function sZ(e){return F(oZ,e)}function cZ(e=oZ,t=qg){t.setState({hideUi:!1}),e.setState(e=>({open:!0,focusRequest:e.focusRequest+1}))}function lZ(e=oZ){e.setState({open:!1})}function uZ(e=oZ,t=qg){(0,_.useEffect)(()=>{let n=xe([{id:`find.open`,label:`Find`,group:`tool`,keys:[`$mod+KeyF`],run:()=>cZ(e,t),command:{label:`Find frames, elements, and text`,icon:Jr}}]);return()=>{n(),lZ(e)}},[e,t])}function dZ({listeners:e,claims:t}){let n=F(N_,e=>e.session);if(e.length===0)return null;let r=new Map(Object.values(t).map(e=>[e.session,e.agent]));return(0,X.jsx)(`span`,{className:`ml-1 flex items-center`,children:e.map((e,t)=>{let i=r.has(e.session),a=n===e.session,o=(0,X.jsx)(`span`,{"aria-hidden":!0,className:Q(`grid size-[22px] place-items-center rounded-full text-[9px] font-bold text-card shadow-[0_0_0_2px_var(--sidebar)]`,i?`bg-claim`:`bg-[color-mix(in_srgb,var(--claim)_55%,var(--sidebar))]`),children:Az(r.get(e.session)??Mz(e.tag))});return(0,X.jsxs)(`button`,{type:`button`,"aria-label":`${e.tag}, ${i?`editing`:`listening`}`,"aria-pressed":a,title:a?`Stop following ${e.tag}`:`Follow ${e.tag}`,"data-editing":i||void 0,onClick:()=>a?I_():F_(e.session),className:Q(`rounded-full outline-none hover:brightness-110 focus-visible:ring-2 focus-visible:ring-ring/50`,a?`flex items-center gap-1.5 py-0.5 pr-2 pl-0.5 text-[11px] font-semibold text-claim shadow-[0_0_0_1.5px_var(--claim)]`:t>0&&`-ml-1.5`,a&&t>0&&`ml-1.5`),children:[o,a?`Following`:null]},e.session)})})}var fZ=[[{id:`arrange.alignLeft`,icon:rt},{id:`arrange.alignCenter`,icon:qe},{id:`arrange.alignRight`,icon:Ze}],[{id:`arrange.alignTop`,icon:at},{id:`arrange.alignMiddle`,icon:Ge},{id:`arrange.alignBottom`,icon:Ye}],[{id:`arrange.distributeHorizontal`,icon:$e},{id:`arrange.distributeVertical`,icon:st}]],pZ=fZ.flat().map(({id:e})=>e);function mZ(){let e=Ce(pZ),t=new Map(e.flatMap(e=>e?[[e.id,e]]:[]));return(0,X.jsxs)(`section`,{"aria-labelledby":`inspector-arrange`,className:`border-b border-sidebar-border px-3 pt-2.5 pb-3`,children:[(0,X.jsx)(`h2`,{id:`inspector-arrange`,className:`mb-2 text-xs font-semibold`,children:`Arrange`}),(0,X.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:fZ.map(e=>(0,X.jsx)(`div`,{role:`group`,className:`flex gap-0.5 rounded-md bg-input p-0.5`,children:e.map(({id:e,icon:n})=>(0,X.jsx)(hZ,{action:t.get(e),icon:n},e))},e[0]?.id))})]})}function hZ({action:e,icon:t}){return e?(0,X.jsx)(fX,{label:e.label,keys:e.keys,side:`bottom`,children:(0,X.jsx)(`button`,{type:`button`,"aria-label":e.label,disabled:!Se(e),onClick:e.run,className:`grid h-[22px] w-7 place-items-center rounded-[5px] text-muted-foreground outline-none hover:bg-sidebar hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 active:bg-sidebar disabled:pointer-events-none disabled:opacity-40`,children:(0,X.jsx)(t,{"aria-hidden":!0,className:`size-[13px]`,strokeWidth:1.6})})}):null}function gZ({frame:e}){let t=Rg(t=>t.findings[e]);return!t||t.length===0?null:(0,X.jsxs)(`section`,{"aria-labelledby":`inspector-checks`,className:`border-b border-sidebar-border px-3 pt-2.5 pb-2`,children:[(0,X.jsxs)(`h2`,{id:`inspector-checks`,className:`mb-1 text-xs font-semibold`,children:[`Checks · `,t.length]}),(0,X.jsx)(`div`,{className:`-mx-1.5`,children:(0,X.jsx)(IH,{findings:t})})]})}var _Z=new Map;function vZ(e,t){let n=JSON.stringify({locale:kq(e),options:t}),r=_Z.get(n);if(r)return r;let i=new Intl.NumberFormat(e,t);return _Z.set(n,i),i}function yZ(e,t,n){return e==null?``:vZ(t,n).format(e)}var bZ=_.createContext(void 0);function xZ(){let e=_.useContext(bZ);if(e===void 0)throw Error(La(43));return e}var SZ=`data-valid`,CZ=`data-invalid`,wZ={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},TZ={disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},EZ={valid(e){return e===null?null:e?{[SZ]:``}:{[CZ]:``}}},DZ={invalid:void 0,name:void 0,validityData:{state:wZ,errors:[],error:``,value:``,initialValue:null},setValidityData:Aa,disabled:void 0,setTouched:Aa,setDirty:Aa,setFilled:Aa,setFocused:Aa,focusOwnerRef:{current:void 0},validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:TZ,registerFieldControl:Aa,validation:{getValidationProps:(e,t=Ma)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:Aa,getInputControl:()=>null,commit:async()=>{},change:Aa}},OZ=_.createContext(DZ);function kZ(e=!0){let t=_.useContext(OZ);if(t.setValidityData===Aa&&!e)throw Error(La(28));return t}var AZ=_.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:Aa,validationMode:`onSubmit`,submitCountRef:{current:0}});function jZ(){return _.useContext(AZ)}var MZ=_.createContext({controlId:void 0,registerControlId:Aa,resetControlId:Aa,labelId:void 0,setLabelId:Aa,messageIds:[],setMessageIds:Aa,getDescriptionProps:e=>e});function NZ(){return _.useContext(MZ)}function PZ(e={}){let{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:i,resetControlId:a}=NZ(),o=xV(),s=Fa(()=>Symbol()),c=_.useRef(!1),l=_.useRef(!1),u=K(()=>{c.current&&i!==Aa&&(c.current=!1,i(s.current,void 0))});return G(()=>{if(!n||i===Aa){u();return}let e;if(t!==void 0)l.current=!0,e=t;else if(l.current)e=o;else{a();return}e===void 0?u():(c.current=!0,i(s.current,e))},[t,n,i,a,o,s,u]),G(()=>u,[u]),(n?r:void 0)??t??o}var FZ={inputValue:()=>null,value:()=>null,...EZ},IZ=`零〇一二三四五六七八九`,LZ=/[٠-٩۰-۹0-9]/g,RZ=/[零〇一二三四五六七八九]/g,zZ=[`%`,`٪`,`%`,`﹪`],BZ=[`‰`,`؉`],VZ=/[%٪%﹪]/,HZ=/[‰؉]/,UZ=/[%٪%﹪]/g,WZ=/[‰؉]/g,GZ=/[٠-٩۰-۹]/,KZ=/[零〇一二三四五六七八九]/,qZ=/[0-9٠-٩۰-۹0-9零〇一二三四五六七八九]/;function JZ(e){return qZ.test(e)}var YZ=[`.`,`,`,`.`,`,`,`٫`,`٬`],XZ=/\p{Zs}/u,ZZ=/\p{Cf}/u,QZ=/\p{Cf}/gu,$Z=[`+`,`+`,`﹢`],eQ=[`-`,`−`,`-`,`‒`,`–`,`—`,`﹣`],tQ=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);function nQ(e,t){let[n,r=`0`]=String(e).split(`e`);return Number(`${n}e${Number(r)+t}`)}var rQ=/[-−-‒–—﹣]/gu,iQ=/[++﹢]/gu,aQ=/[-−-‒–—﹣]/,oQ=/[++﹢]/,sQ=11111.1;function cQ(e,t){return vZ(e,t).formatToParts(sQ)}function lQ(e,t){let n=cQ(e,t),r={};n.forEach(e=>{r[e.type]=e.value});let i=`.`;return vZ(e).formatToParts(.1).forEach(e=>{e.type===`decimal`&&(i=e.value)}),{...r,decimal:i}}function uQ(e,t,n){let r=e.replace(QZ,``).trim();r=r.replace(rQ,`-`).replace(iQ,`+`);let i=!1,a=(e,t)=>(t===`-`&&(i=!0),``);r=r.replace(/([+-])\s*$/,a).replace(/^\s*([+-])/,a);let o=t;o===void 0&&(GZ.test(r)?o=`ar`:KZ.test(r)&&(o=`zh`));let{group:s,decimal:c,currency:l,exponentSeparator:u}=lQ(o,n),d=vZ(o,n).formatToParts(1).filter(e=>e.type===`unit`).map(e=>tQ(e.value)),f=d.length?new RegExp(d.join(`|`),`g`):null,p=null;s&&(p=/\p{Zs}/u.test(s)?/\p{Zs}/gu:s===`'`||s===`’`?/['’]/g:new RegExp(tQ(s),`g`));let m=[[p,``],[new RegExp(tQ(c),`g`),`.`],[/[.٫]/g,`.`],[/[,٬]/g,``],[l?new RegExp(tQ(l),`g`):null,``],[f,``],[UZ,``],[WZ,``],[u?new RegExp(tQ(u),`g`):null,`e`],[LZ,e=>String(e.charCodeAt(0)%16)],[RZ,e=>String(Math.max(IZ.indexOf(e)-1,0))]].reduce((e,[t,n])=>t?e.replace(t,n):e,r),h=m.lastIndexOf(`.`);if(h!==-1&&(m=`${m.slice(0,h).replace(/\./g,``)}.${m.slice(h+1).replace(/\./g,``)}`),/^[-+]?Infinity$/i.test(r)||r.includes(`∞`))return null;let g=(i?`-`:``)+m,_=parseFloat(g),v=n?.style,y=v===`unit`&&n?.unit===`percent`,b=VZ.test(e)||v===`percent`;return HZ.test(e)?_=nQ(_,-3):!y&&b&&(_=nQ(_,-2)),Number.isFinite(_)?_:null}var dQ=1e-10,fQ=1e-10;function pQ(e){return e?.maximumFractionDigits!=null||e?.minimumFractionDigits!=null||e?.maximumSignificantDigits!=null||e?.minimumSignificantDigits!=null||e?.roundingIncrement!=null||e?.roundingMode!=null||e?.roundingPriority!=null}function mQ(e,t){if(!Number.isFinite(e))return e;if(!pQ(t)){let t=parseFloat(e.toPrecision(15));return Math.abs(t-e)<=Math.min(2**-52*Math.max(1,Math.abs(e)),fQ)?t:e}let n=vZ(`en-US`,{...t,signDisplay:`auto`,currencySign:`standard`,notation:t.notation===`compact`?`standard`:t.notation,useGrouping:!1}),r=n.format(e),i=uQ(r,`en-US`,t);return i===null?e:n.format(i)===r?i:e}function hQ(e,t,n,r){let i=Math.abs(n),a=Math.sign(n),o=i*dQ*a,s=e-t+o;return r?t+Math.round(s/n)*n:t+(a>0?Math.floor(s/i):Math.ceil(s/i))*i}function gQ(e,t,n,r,i,a,o,s,c){if(e===null)return e;let l=e;if(t!=null&&o&&t!==0&&(l=hQ(l,s||n===-(2**53-1)?i:n,t,s)),c&&(l=hu(l,n,r)),t==null&&!pQ(a))return l;let u=mQ(l,a);return c?hu(u,n,r):u}var _Q=_.forwardRef(function(e,t){let{id:n,min:r,max:i,smallStep:a=.1,step:o=1,largeStep:s=10,required:c=!1,disabled:l=!1,readOnly:u=!1,form:d,name:f,defaultValue:p=null,value:m,onValueChange:h,onValueCommitted:g,allowWheelScrub:v=!1,snapOnStep:y=!1,allowOutOfRange:b=!1,format:x,locale:S,render:C,className:w,inputRef:T,style:E,...D}=e,{setDirty:O,validityData:k,disabled:A,setFilled:j,name:M,state:N,validation:P}=kZ(),{clearErrors:F}=jZ(),I=A||l,L=M??f,R=o===`any`?1:o,[z,ee]=_.useState(!1),te=r??-(2**53-1),ne=i??2**53-1,re=r??0,ie=x?.style,ae=_.useRef(null),B=gl(T,P.inputRef),V=PZ({id:n}),[oe,se]=nK({controlled:m,default:p,name:`NumberField`,state:`value`}),ce=Md(oe);G(()=>{j(oe!==null)},[j,oe]);let H=Lo(),le=Md(x),ue=_.useRef(!1),de=K((e,t)=>{ue.current=!1,g?.(e,t)}),fe=_.useRef(!0),pe=_.useRef(null),[me,he]=_.useState(()=>yZ(oe,S,x)),[ge,_e]=_.useState(`numeric`),ve=K(()=>{let e=cQ(S,x),t=new Set(YZ),n=e=>e.forEach(e=>t.add(e)),r=e.find(e=>e.type===`decimal`)?.value??lQ(S,x).decimal;t.add(r),e.forEach(e=>{e.type!==`integer`&&e.type!==`fraction`&&e.type!==`exponentInteger`&&e.type!==`compact`&&(n(Array.from(e.value)),XZ.test(e.value)&&t.add(` `))});let i=ie===`percent`||ie===`unit`&&x?.unit===`percent`,a=ie===`percent`||ie===`unit`&&x?.unit===`permille`;return i&&n(zZ),a&&n(BZ),n($Z),(te<0||b)&&n(eQ),t}),ye=K(e=>e?.altKey?a:e?.shiftKey?s:R),be=K((e,t)=>{let n=t.event,r=t.direction,i=t.reason.startsWith(`input-`)||t.reason===`none`,a=!b||!i,o=gQ(e,r?ye(n)*r:void 0,te,ne,re,le.current,y,n?.altKey??!1,a),s=o!==oe||i&&(e!==oe||fe.current===!1);if(s){if(h?.(o,t),t.isCanceled)return!1;se(o),O(o!==k.initialValue),ue.current=!0}return pe.current=o,fe.current&&he(yZ(o,S,x)),H(),s}),xe=K((e,{direction:t,currentValue:n,event:r,reason:i})=>{let a=n??ce.current,o=r;return typeof a==`number`?be(a+e*t,Z(i,o,void 0,{direction:t})):be(0,Z(i,o))});G(function(){if(!fe.current)return;let e=yZ(oe,S,x);e!==me&&he(e)}),G(function(){if(!ns)return;let e=`text`;te>=0&&(e=`decimal`),_e(e)},[te]);let U=K(()=>{let e=ae.current;if(!e)return;let t=e.value.length;e.setSelectionRange(t,t),e.focus()});_.useEffect(function(){let e=ae.current;if(I||u||!v||!e)return;function t(e){if(e.ctrlKey||ds(q(ae.current))!==ae.current)return;let t=Math.abs(e.deltaX)>Math.abs(e.deltaY),n=e.shiftKey&&t?e.deltaX:e.deltaY;if(n===0||!e.shiftKey&&t)return;e.preventDefault(),fe.current=!0;let r=ye(e);xe(r,{direction:n>0?-1:1,event:e,reason:`wheel`})&&de(pe.current,Zu(gd,e))}return J(e,`wheel`,t)},[v,xe,I,u,ye,de,pe,ce]);let Se=_.useMemo(()=>({...N,disabled:I,readOnly:u,required:c,value:oe,inputValue:me,scrubbing:z}),[N,I,u,c,oe,me,z]),Ce=_.useMemo(()=>({inputRef:ae,focusInput:U,minWithDefault:te,maxWithDefault:ne,id:V,setValue:be,incrementValue:xe,getStepAmount:ye,allowInputSyncRef:fe,formatOptionsRef:le,valueRef:ce,lastChangedValueRef:pe,hasPendingCommitRef:ue,name:L,nameProp:f,inputMode:ge,getAllowedNonNumericKeys:ve,min:r,max:i,setInputValue:he,locale:S,setIsScrubbing:ee,state:Se,onValueCommitted:de}),[ae,U,te,ne,V,be,xe,ye,le,ce,L,f,ge,ve,r,i,he,S,Se,de]),we=Vl(`div`,e,{ref:t,state:Se,props:D,stateAttributesMapping:FZ});return(0,X.jsxs)(bZ.Provider,{value:Ce,children:[we,(0,X.jsx)(`input`,{...P.getValidationProps(I,{onFocus(){U()},onChange(e){if(e.nativeEvent.defaultPrevented||I||u)return;let t=e.currentTarget.valueAsNumber,n=Number.isNaN(t)?null:t,r=Z(Qu,e.nativeEvent);be(n,r),F(L),P.change(pe.current??n)}}),ref:B,type:`number`,form:d,name:L,value:oe??``,min:r,max:i,step:o,disabled:I,readOnly:u,required:c,"aria-hidden":!0,tabIndex:-1,style:L?ml:pl,suppressHydrationWarning:!0})]})});function vQ(e){return e===`touch`||e===`pen`}function yQ(e,t,n){let{setFocused:r,focusOwnerRef:i}=kZ(),a=K(t=>{(t?!e:i.current===a)&&(i.current=t&&a,n?.(t),r(t))});return G(()=>{let e=t.current;return e?.getRootNode()?.activeElement===e&&a(!0),()=>a(!1)},[e,t,a]),a}function bQ(e,t,n,r,i=!0,a){let{registerFieldControl:o}=kZ(),s=Fa(()=>Symbol());G(()=>{let c=s.current;i?o(c,{controlRef:e,getValue:r,id:t,name:a,value:n}):o(c,void 0)},[e,i,r,t,a,o,s,n]),G(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}var xQ=new Set([`Backspace`,`Delete`,`ArrowLeft`,`ArrowRight`,`Tab`,`Enter`,`Escape`]),SQ=_.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{allowInputSyncRef:o,formatOptionsRef:s,getAllowedNonNumericKeys:c,getStepAmount:l,id:u,incrementValue:d,inputMode:f,max:p,min:m,name:h,nameProp:g,setValue:v,state:y,setInputValue:b,locale:x,inputRef:S,onValueCommitted:C,lastChangedValueRef:w,hasPendingCommitRef:T,valueRef:E}=xZ(),{disabled:D,readOnly:O,required:k,value:A,inputValue:j}=y,{clearErrors:M}=jZ(),{validationMode:N,setTouched:P,invalid:F,shouldValidateOnChange:I,validation:L}=kZ(),{labelId:R}=NZ(),z=yQ(D,S),ee=_.useRef(!1),te=_.useRef(null);return bQ(S,u,A,void 0,!D,g),G(()=>{if(te.current!=null){let e=te.current;te.current=null,S.current?.setSelectionRange(e,e)}}),wV(A,()=>{M(h),ee.current&&!I()?ee.current=!1:L.change(A)}),Vl(`input`,e,{ref:[t,S],state:y,props:[{id:u,required:k,disabled:D,readOnly:O,inputMode:f,value:j,type:`text`,autoComplete:`off`,autoCorrect:`off`,spellCheck:`false`,"aria-roledescription":`Number field`,"aria-invalid":!D&&F?!0:void 0,"aria-labelledby":R,suppressHydrationWarning:!0,onFocus(e){e.defaultPrevented||D||z(!0)},onBlur(e){if(e.defaultPrevented||D||(P(!0),z(!1),O))return;let t=!o.current,n=T.current;if(o.current=!0,j.trim()===``){let r=Z(sd,e.nativeEvent);if(v(null,r),r.isCanceled)return;N===`onBlur`&&L.commit(null),(t||n||A!==null)&&C(null,Zu(sd,e.nativeEvent));return}let r=s.current,i=uQ(j,x,r);if(i===null)return;let a=pQ(r),c;c=!t&&!a?A:a?mQ(i,r):i;let l=Zu(cd,e.nativeEvent),u=A!==c,d=t||u||n,f=c;if(u){let t=Z(cd,e.nativeEvent);if(ee.current=!0,v(c,t),t.isCanceled){ee.current=!1;return}f=w.current,f===A&&(ee.current=!1)}N===`onBlur`&&L.commit(f),d&&C(f,l);let p=yZ(f,x,r);j!==p&&b(p)},onChange(e){if(e.nativeEvent.defaultPrevented)return;o.current=!1;let t=e.currentTarget.value;if(t.trim()===``){b(t),v(null,Z(sd,e.nativeEvent));return}let n=c();if(!Array.from(t).every(e=>JZ(e)||aQ.test(e)||n.has(e)||ZZ.test(e)))return;let r=uQ(t,x,s.current);b(t),r!==null&&v(r,Z(od,e.nativeEvent))},onKeyDown(e){if(e.defaultPrevented||O||D)return;let t=e.nativeEvent,n=!o.current,r=c(),i=r.has(e.key),{decimal:a,currency:u,percentSign:f}=lQ(x,s.current),h=e.currentTarget.selectionStart,g=e.currentTarget.selectionEnd,_=h===0&&g===j.length,y=e=>h!=null&&g!=null&&e>=h&&e<g;[[aQ,rQ],[oQ,iQ]].forEach(([t,n])=>{if(t.test(e.key)&&Array.from(r).some(e=>t.test(e))){let e=j.search(n),t=e!==-1&&y(e);i=!(aQ.test(j)||oQ.test(j))||_||t}}),[a,u,f].forEach(t=>{if(e.key===t){let e=j.indexOf(t),n=y(e);i=e===-1||_||n}});let b=xQ.has(e.key),S=e.key===`ArrowUp`||e.key===`ArrowDown`;if(e.which===229||e.altKey&&!S||e.ctrlKey||e.metaKey||i||JZ(e.key)||b)return;let T=null;if(e.key===`Home`&&m!=null?T=m:e.key===`End`&&p!=null&&(T=p),e.key.length>1&&!S&&T===null)return;let k=n?uQ(j,x,s.current):null,A=l(e);e.preventDefault(),e.stopPropagation();let M=Zu(pd,t),N=!1;(S||T!==null)&&(o.current=!0),S?(n||(w.current=E.current),N=d(A,{direction:e.key===`ArrowUp`?1:-1,currentValue:k,event:t,reason:pd})):T!==null&&(N=v(T,Z(pd,t))),N&&C(w.current,M)},onPaste(e){if(e.defaultPrevented||O||D)return;let t=``;try{t=e.clipboardData?.getData(`text/plain`)??``}catch{return}e.preventDefault();let n=e.currentTarget,r=n.selectionStart,i=n.selectionEnd,a=j.slice(0,r)+t+j.slice(i),c=uQ(a,x,s.current);c!==null&&(o.current=!1,te.current=r+t.length,v(c,Z(ld,e.nativeEvent)),b(a))}},a,e=>L.getValidationProps(D,e)],stateAttributesMapping:FZ})}),CQ=_.createContext(void 0);function wQ(){let e=_.useContext(CQ);if(e===void 0)throw Error(La(44));return e}function TQ(e,t){let n=po(t);if(e!=null){let n=t.getBoundingClientRect();return{left:n.left-e/2,top:n.top-e/2,right:n.right+e/2,bottom:n.bottom+e/2}}let r=n.visualViewport;return r?{left:r.offsetLeft,top:r.offsetTop,right:r.offsetLeft+r.width,bottom:r.offsetTop+r.height}:{left:0,top:0,right:n.document.documentElement.clientWidth,bottom:n.document.documentElement.clientHeight}}var EQ={touchAction:`none`,WebkitUserSelect:`none`,userSelect:`none`},DQ=_.forwardRef(function(e,t){let{render:n,className:r,direction:i=`horizontal`,pixelSensitivity:a=2,teleportDistance:o,style:s,...c}=e,{state:l,setIsScrubbing:u,inputRef:d,focusInput:f,incrementValue:p,allowInputSyncRef:m,getStepAmount:h,onValueCommitted:g,lastChangedValueRef:v,valueRef:y}=xZ(),{disabled:b,readOnly:x}=l,S=_.useRef(null),C=_.useRef(!1),w=_.useRef(!1),T=_.useRef(null),E=_.useRef(!1),D=_.useRef(null),O=_.useRef({x:0,y:0}),k=Wo(),A=Wo(),[j,M]=_.useState(!1),[N,P]=_.useState(!1),[F,I]=_.useState(!1);function L(e,t,n){let r=po(e).visualViewport?.scale??1;e.style.transform=`translate3d(${t}px,${n}px,0) scale(${1/r})`}let R=K(({movementX:e,movementY:t})=>{let n=D.current,r=S.current;if(!n||!r)return;let i=TQ(o,r),a=O.current,s=(e,t,n,r)=>e+t<n?r-t:e+t>r?n-t:e,c={x:s(Math.round(a.x+e),n.offsetWidth/2,i.left,i.right),y:s(Math.round(a.y+t),n.offsetHeight/2,i.top,i.bottom)};O.current=c,L(n,c.x,c.y)}),z=K((e,{clientX:t,clientY:n})=>{tu.flushSync(()=>{I(e),u(e)});let r=D.current;if(!r||!e)return;let i={x:t-r.offsetWidth/2,y:n-r.offsetHeight/2};O.current=i,L(r,i.x,i.y)});_.useEffect(function(){if(!d.current||b||x||!F)return;let e=0;function t(e){function t(){try{q(S.current).exitPointerLock()}catch{}finally{C.current=!1,z(!1,e),g(v.current??y.current,Zu(_d,e));let t=T.current,n=d.current;if(!w.current&&t!=null&&n){let e=po(n).MouseEvent;A.start(0,()=>{E.current||t.dispatchEvent(new e(`click`,{bubbles:!0,cancelable:!0}))})}w.current=!1,T.current=null}}cs?k.start(20,t):t()}function n(t){if(!C.current)return;t.preventDefault(),R(t);let{movementX:n,movementY:r}=t;if(e+=i===`vertical`?r:n,Math.abs(e)>=a){e=0,w.current=!0;let a=(i===`vertical`?-r:n)*h(t);a!==0&&(m.current=!0,p(Math.abs(a),{direction:a>=0?1:-1,event:t,reason:_d}))}}let r=po(d.current),o=Io(J(r,`pointerup`,t,!0),J(r,`pointermove`,n,!0));return()=>{k.clear(),o()}},[b,x,m,p,F,h,d,z,R,i,a,v,g,y,k,A]),_.useEffect(()=>()=>{if(C.current){C.current=!1,u(!1);try{q(S.current).exitPointerLock()}catch{}}},[u]),_.useEffect(function(){let e=S.current;if(!e||b||x)return;function t(e){e.touches.length===1&&e.preventDefault()}return J(e,`touchstart`,t)},[b,x]);let ee=Vl(`span`,e,{ref:[t,S],state:l,props:[{role:`presentation`,style:EQ,onClickCapture(){E.current=!0},async onPointerDown(e){if(e.defaultPrevented||x||e.button||b)return;let t=e.pointerType===`touch`;if(M(t),e.pointerType===`mouse`&&(e.preventDefault(),f()),C.current=!0,w.current=!1,E.current=!1,A.clear(),T.current=ps(e.nativeEvent),z(!0,e.nativeEvent),!t&&!ss)try{await q(S.current).body.requestPointerLock(),P(!1)}catch{P(!0)}finally{C.current&&z(!0,e.nativeEvent)}}},c],stateAttributesMapping:FZ}),te=_.useMemo(()=>({isScrubbing:F,isTouchInput:j,isPointerLockDenied:N,scrubAreaCursorRef:D}),[F,j,N]);return(0,X.jsx)(CQ.Provider,{value:te,children:ee})}),OQ={position:`fixed`,top:0,left:0,pointerEvents:`none`},kQ=_.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{state:o}=xZ(),{isScrubbing:s,isTouchInput:c,isPointerLockDenied:l,scrubAreaCursorRef:u}=wQ(),[d,f]=_.useState(null),p=Vl(`span`,e,{enabled:s&&!ss&&!c&&!l,ref:[t,u,f],state:o,props:[{role:`presentation`,style:OQ},a],stateAttributesMapping:FZ});return p&&tu.createPortal(p,q(d).body)}),AQ=new Set([`ArrowUp`,`ArrowDown`]),jQ=`group-has-[[data-scrub]:hover]/number:bg-foreground/10 group-has-[[data-scrub]:hover]/number:text-foreground group-data-[scrubbing]/number:bg-foreground/10 group-data-[scrubbing]/number:text-foreground`,MQ=`group-has-[[data-scrub]:hover]/number:text-foreground group-data-[scrubbing]/number:text-foreground`;function NQ({label:e,caption:t,prefix:n,inset:r=`pl-[26px]`,scrubValue:i=!1,className:a,inputClassName:o,value:s,empty:c=`Mixed`,step:l=1,min:u,max:d,format:f,disabled:p,onPreview:m,onCommit:h}){let[g,v]=(0,_.useState)(null),y=(0,_.useRef)(null),[b,x]=(0,_.useState)(null);b&&b.over!==s&&x(null);let S=b?.over===s?b.value:null,C=(0,_.useRef)(null),w=e=>{!y.current&&e&&(C.current=S??s),y.current=e,v(e)},T=(0,_.useRef)(!1),E=(0,_.useRef)(!1),D=(0,_.useRef)(!1),O=e=>Math.min(d??1/0,Math.max(u??-1/0,e)),k=({value:e,offset:t})=>t?t=>O(t+e):()=>O(e),A=e=>{e.value!==null&&m?.(k({value:e.value,offset:e.offset}))},j=()=>{y.current&&m?.(null),w(null),T.current&&(E.current=!0)},M=()=>{let e=y.current;if(!e)return;w(null);let t=e.offset?e.value===0:e.value===C.current;if(e.value===null||t){m?.(null);return}let n=k({value:e.value,offset:e.offset});s!==null&&!e.offset&&x({value:O(e.value),over:s}),Promise.resolve(h(n)).then(e=>{e===!1&&(x(null),m?.(null))})},N=e=>{let t=(e.shiftKey?l*10:l)*(e.key===`ArrowUp`?1:-1),n=y.current,r=S??s,i=n?.value==null?r===null?{offset:!0,value:t}:{offset:!1,value:O(r+t)}:{offset:n.offset,value:n.offset?n.value+t:O(n.value+t)};w(i),A(i)},P=e=>{if(AQ.has(e.key)&&(e.preventDefault(),e.stopPropagation(),N(e)),e.key===`Enter`){M();let t=e.currentTarget;t.blur(),t.focus()}e.key===`Escape`&&(j(),D.current=!0,e.currentTarget.blur())},F=e=>{p||e.button!==0||(T.current=!0,E.current=!1,s===null&&!y.current&&w({value:0,offset:!0}))},I=(0,_.useMemo)(()=>({useGrouping:!1,...f,...g?.offset?{signDisplay:`exceptZero`}:{}}),[g?.offset,f]),L=(0,X.jsx)(SQ,{"aria-label":e,placeholder:s===null?c:void 0,className:Q(`h-[26px] w-full min-w-0 rounded-md border-0 bg-input px-2 text-xs text-foreground tabular-nums outline-none placeholder:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,n?r:void 0,i&&`cursor-ew-resize`,i&&!p&&jQ,o),onFocus:e=>e.currentTarget.select(),onChange:e=>{nV(e)&&e.preventBaseUIHandler()},onKeyDown:P,onKeyUp:e=>{AQ.has(e.key)&&M()},onBlur:()=>{D.current?D.current=!1:M()}});return(0,X.jsxs)(_Q,{className:Q(`group/number block`,a),value:g?g.value:S??s,step:l,largeStep:l*10,min:u,max:d,format:I,disabled:p,onValueChange:(e,t)=>{if(t.reason===`scrub`){if(E.current)return;let t={value:e,offset:s===null};w(t),A(t)}else(t.reason===`input-change`||t.reason===`input-clear`||t.reason===`input-paste`)&&w({value:e,offset:!1})},onValueCommitted:(e,t)=>{t.reason===`scrub`&&(T.current=!1,E.current?E.current=!1:M())},children:[t?(0,X.jsxs)(DQ,{"aria-hidden":!0,"data-scrub":!0,className:Q(`mb-[3px] ml-0.5 block w-max cursor-ew-resize text-(length:--text-caption) font-normal text-muted-foreground select-none`,!p&&MQ),onPointerDown:F,children:[t,(0,X.jsx)(PQ,{})]}):null,(t=>n&&typeof n!=`string`?(0,X.jsx)(fX,{label:e,children:t}):t)((0,X.jsxs)(`div`,{className:`relative`,children:[n?(0,X.jsxs)(DQ,{"aria-hidden":!0,"data-scrub":!0,className:Q(`absolute inset-y-0 left-0 flex min-w-6 cursor-ew-resize items-center justify-center rounded-l-md px-1.5 text-xs text-muted-foreground select-none`,!p&&jQ),onPointerDown:F,children:[n,(0,X.jsx)(PQ,{})]}):null,i?(0,X.jsxs)(DQ,{"data-scrub":!0,className:`block`,onPointerDown:F,children:[L,(0,X.jsx)(PQ,{})]}):L]}))]})}function PQ(){return(0,X.jsx)(kQ,{className:`z-50`,children:(0,X.jsx)(fr,{"aria-hidden":!0,className:`-mt-2 -ml-2 size-4 text-foreground drop-shadow-[0_0_1px_var(--background)]`})})}var FQ={style:`unit`,unit:`degree`,unitDisplay:`narrow`,maximumFractionDigits:2};function IQ(e){let t=(e%360+360)%360;return Math.round((t>180?t-360:t)*100)/100}function LQ(e,{rotate:t}){return t===e?``:`${e}deg`}function RQ(e,t,{scale:n}){let r=t===`x`?-e.x:e.x,i=t===`y`?-e.y:e.y;return n?.x===r&&n.y===i?``:`${r} ${i}`}function zQ(){return(0,X.jsxs)(`svg`,{"aria-hidden":!0,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:1.6,strokeLinecap:`round`,strokeLinejoin:`round`,className:`size-3`,children:[(0,X.jsx)(`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`}),(0,X.jsx)(`path`,{d:`M3 11a10 10 0 0 1 10 10`})]})}function BQ({degrees:e,scale:t,translated:n}){return n?`Its transform moves it, so a rotation would swing it away`:e===null||t===null?`A 3D rotate or scale has no rotation here`:null}function VQ({rotation:e,disabled:t,write:n,preview:r}){let{degrees:i,scale:a,own:o}=e,s=BQ(e),c=t||s!==null,l=i??0,u=e=>n({kind:`style`,property:`rotate`,value:LQ(e,o)}),d=[{label:`Rotate 90°`,icon:Rr,press:()=>void u(IQ(l+90))},...[`x`,`y`].map(e=>({label:e===`x`?`Flip horizontal`:`Flip vertical`,icon:e===`x`?Ei:wi,press:()=>void n({kind:`style`,property:`scale`,value:RQ(a??{x:1,y:1},e,o)})}))];return(0,X.jsxs)(X.Fragment,{children:[s?(0,X.jsx)(`span`,{id:`inspector-rotation-lock`,className:`sr-only`,children:s}):null,(0,X.jsxs)(`div`,{className:`mt-1.5 grid grid-cols-2 items-end gap-1.5`,children:[(0,X.jsx)(NQ,{label:`Rotation`,caption:`Rotation`,prefix:(0,X.jsx)(zQ,{}),inset:`pl-[28px]`,value:i,empty:`3D`,format:FQ,disabled:c,onPreview:e=>r?.(`rotate`,e?`${e(l)}deg`:null),onCommit:e=>{let t=IQ(e(l));return t===l?Promise.resolve(!1):u(t)}}),(0,X.jsx)(`div`,{role:`group`,"aria-label":`Rotate and flip`,className:`grid grid-cols-3 gap-0.5 rounded-md bg-input p-0.5`,children:d.map(({label:e,icon:n,press:r})=>(0,X.jsx)(fX,{label:s??e,children:(0,X.jsx)(`button`,{type:`button`,"aria-label":e,"aria-describedby":s?`inspector-rotation-lock`:void 0,"aria-disabled":s!==null||void 0,disabled:t,onClick:()=>{c||r()},className:Q(`grid h-[22px] place-items-center rounded-[5px] text-muted-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50`,c?`opacity-50`:`hover:text-foreground`),children:(0,X.jsx)(n,{"aria-hidden":!0,className:`size-[13px]`})})},e))})]})]})}var HQ={style:`unit`,unit:`percent`,maximumFractionDigits:0},UQ={maximumFractionDigits:0};function WQ(){return(0,X.jsxs)(`svg`,{"aria-hidden":!0,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:1.6,strokeLinecap:`round`,strokeLinejoin:`round`,className:`size-3`,children:[(0,X.jsx)(`circle`,{cx:`12`,cy:`12`,r:`8`}),(0,X.jsx)(`path`,{d:`M12 4a8 8 0 0 1 0 16z`,fill:`currentColor`})]})}function GQ(){return(0,X.jsx)(`svg`,{"aria-hidden":!0,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:1.6,strokeLinecap:`round`,strokeLinejoin:`round`,className:`size-3`,children:(0,X.jsx)(`path`,{d:`M4 20V10a6 6 0 0 1 6-6h10`})})}function KQ({opacity:e,radius:t,rotation:n,disabled:r,write:i,preview:a}){let o=Math.round(e*100);return(0,X.jsxs)(`section`,{"aria-labelledby":`inspector-appearance`,className:`border-b border-sidebar-border px-3 pt-2.5 pb-3`,children:[(0,X.jsx)(`h2`,{id:`inspector-appearance`,className:`mb-2 text-xs font-semibold`,children:`Appearance`}),(0,X.jsxs)(`div`,{className:`grid grid-cols-2 gap-1.5`,children:[(0,X.jsx)(NQ,{label:`Opacity`,caption:`Opacity`,prefix:(0,X.jsx)(WQ,{}),inset:`pl-[28px]`,value:o,min:0,max:100,format:HQ,disabled:r,...uB(`opacity`,o,e=>String(e/100),i,a)}),(0,X.jsx)(NQ,{label:`Corner radius`,caption:`Corner radius`,prefix:(0,X.jsx)(GQ,{}),inset:`pl-[28px]`,value:t,min:0,format:UQ,disabled:r,...uB(`border-radius`,t,e=>`${e}px`,i,a)})]}),(0,X.jsx)(VQ,{rotation:n,disabled:r,write:i,preview:a})]})}function qQ(e,t,n=Object.is){let{length:r}=e;if(r!==t.length)return!1;for(let i=0;i<r;i+=1)if(!n(e[i],t[i]))return!1;return!0}function JQ(e){return e==null?void 0:`${e}-label`}function YQ(e,t){return e??t}function XQ(e,t){return e-t}function ZQ(e,t,n,r,i,a){let o=hu(e,n,r);if(!i)return o;let s=a.slice();return s[t]=hu(o,a[t-1]??-1/0,a[t+1]??1/0),s.sort(XQ)}function QQ(e,t,n){if(!Array.isArray(e))return!0;let r=t*n;for(let t=0;t<e.length-1;t+=1)if(!(Math.abs(e[t]-e[t+1])>=r))return!1;return!0}var $Q=()=>null,e$={activeThumbIndex:$Q,max:$Q,min:$Q,minStepsBetweenValues:$Q,step:$Q,values:$Q,...EZ},t$=_.createContext(void 0);function n$(){let e=_.useContext(t$);if(e===void 0)throw Error(La(62));return e}function r$(e,t){return e===t||Array.isArray(e)&&Array.isArray(t)&&qQ(e,t)}var i$=_.forwardRef(function(e,t){let{"aria-labelledby":n,className:r,defaultValue:i,disabled:a=!1,id:o,format:s,largeStep:c=10,locale:l,render:u,max:d=100,min:f=0,minStepsBetweenValues:p=0,form:m,name:h,onValueChange:g,onValueCommitted:v,orientation:y=`horizontal`,step:b=1,thumbCollisionBehavior:x=`push`,thumbAlignment:S=`center`,value:C,style:w,...T}=e,E=xV(o),D=JQ(E),O=K(g),k=K(v),{clearErrors:A}=jZ(),{state:j,disabled:M,name:N,setTouched:P,setDirty:F,validityData:I,validation:L}=kZ(),{labelId:R}=NZ(),[z,ee]=_.useState(),te=n??YQ(R,z),ne=M||a,re=N??h,[ie,ae]=nK({controlled:C,default:i??f,name:`Slider`}),B=_.useRef(null),V=_.useRef(null),oe=_.useRef([]),se=_.useRef(null),ce=_.useRef(-1),H=_.useRef(null),le=_.useRef(Qu),[ue,de]=_.useState(-1),[fe,pe]=_.useState(-1),[me,he]=_.useState(!1),[ge,_e]=_.useState(()=>new Map),[ve,ye]=_.useState([void 0,void 0]),be=K(e=>{de(e),e!==-1&&pe(e)}),xe=K(e=>{e&&(V.current=e)}),U=Array.isArray(ie),Se=_.useMemo(()=>U?ie.map(e=>hu(e,f,d)).sort(XQ):[hu(ie,f,d)],[d,f,U,ie]),Ce=U?Se:Se[0];bQ(L.inputRef,E,Ce,void 0,!ne,h),wV(Ce,()=>{A(re),L.change(Ce);let e=I.initialValue,t;t=Array.isArray(Ce)&&Array.isArray(e)?!qQ(Ce,e):Ce!==e,F(t)});let we=K((e,t)=>{if(Number.isNaN(e)||r$(e,ie))return!1;let n=t.event,r=n.constructor,i=new r(n.type,n);return Object.defineProperty(i,"target",{writable:!0,value:{value:e,name:re}}),t.event=i,O(e,t),!t.isCanceled&&(le.current=t.reason,ae(e),!0)}),Te=K((e,t,n)=>{let r=ZQ(e,t,f,d,U,Se);if(QQ(r,b,p)){let e=`key`in n?pd:od,i=we(r,Z(e,n.nativeEvent,void 0,{activeThumbIndex:t}));P(!0),i&&k(r,Zu(e,n.nativeEvent))}});G(()=>{if(!ne)return;let e=ds(q(B.current));Y(B.current,e)&&e.blur(),ue!==-1&&be(-1)},[ue,ne,be]);let Ee=_.useMemo(()=>({...j,activeThumbIndex:ue,disabled:ne,dragging:me,orientation:y,max:d,min:f,minStepsBetweenValues:p,step:b,values:Se}),[j,ue,ne,me,d,f,p,y,b,Se]),De=_.useMemo(()=>({active:ue,controlRef:V,disabled:ne,dragging:me,validation:L,format:s,handleInputChange:Te,indicatorPosition:ve,inset:S!==`center`,isArrayValue:U,labelId:te,rootLabelId:D,largeStep:c,lastUsedThumbIndex:fe,lastChangeReasonRef:le,form:m,locale:l,max:d,min:f,minStepsBetweenValues:p,name:re,onValueCommitted:k,orientation:y,pressedThumbCenterOffsetRef:se,pressedThumbIndexRef:ce,pressedValuesRef:H,registerFieldControlRef:xe,renderBeforeHydration:S===`edge`,setActive:be,setDragging:he,setIndicatorPosition:ye,setLabelId:ee,setValue:we,state:Ee,step:b,thumbCollisionBehavior:x,thumbMap:ge,thumbRefs:oe,values:Se}),[ue,te,D,ne,me,L,s,Te,ve,c,fe,m,l,d,f,p,re,k,y,U,xe,be,we,Ee,b,x,S,ge,Se]),Oe=Vl(`div`,e,{state:Ee,ref:[t,B],props:[{"aria-labelledby":te,id:E,role:`group`},T,e=>L.getValidationProps(ne,e)],stateAttributesMapping:e$});return(0,X.jsx)(t$.Provider,{value:De,children:(0,X.jsx)(LK,{elementsRef:oe,onMapChange:_e,children:Oe})})});function a$(e,t){let n=e.getBoundingClientRect();return t?(n.top+n.bottom)/2:(n.left+n.right)/2}function o$(e){if(e===0)return 0;if(Math.abs(e)<1){let t=e.toExponential().split(`e-`),n=t[0].split(`.`)[1];return(n?n.length:0)+parseInt(t[1],10)}let t=e.toString().split(`.`)[1];return t?t.length:0}function s$(e,t,n){let r=Math.round((e-n)/t)*t+n;return Number(r.toFixed(Math.max(o$(t),o$(n))))}function c$(e,t,n,r,i,a,o,s){let c=e.slice(),l=a*o,u=c.length-1,d=s??e;c[t]=hu(n,r+t*l,i-(u-t)*l);for(let e=t+1;e<=u;e+=1){let t=c[e-1]+l,n=i-(u-e)*l,r=d[e],a=Math.max(c[e],t);r<a&&(a=Math.max(r,t)),c[e]=hu(a,t,n)}for(let e=t-1;e>=0;--e){let t=c[e+1]-l,n=r+e*l,i=d[e],a=Math.min(c[e],t);i>a&&(a=Math.min(i,t)),c[e]=hu(a,n,t)}for(let e=0;e<=u;e+=1)c[e]=Number(c[e].toFixed(12));return c}function l$(e,t,n,r,i,a,o,s,c,l){let u=n??t,d=r??t;if(!(u.length>1))return{value:a,thumbIndex:0,didSwap:!1};let f=c*l;if(e===`push`)return{value:c$(u,i,a,o,s,c,l),thumbIndex:i,didSwap:!1};let p=u.slice(),m=p[i-1],h=p[i+1],g=m==null?o:m+f,_=h==null?s:h-f,v=Number(hu(a,g,_).toFixed(12));switch(p[i]=v,e){case`swap`:{let e=u[i],t=1e-7,n=a>e,r=a<e,g=n&&h!=null&&a>=h-t,_=r&&m!=null&&a<=m+t;if(!g&&!_)return{value:p,thumbIndex:i,didSwap:!1};let y=g?i+1:i-1,b=p.map((e,t)=>t===i?v:d[t]??u[t]),x=a;x=g?Math.max(a,p[y]):Math.min(a,p[y]);let S=c$(p,y,x,o,s,c,l,b),C=g?y-1:y+1,w=S[C-1],T=S[C+1],E=w==null?o:w+f;E=Math.max(E,o+C*f);let D=T==null?s:T-f;D=Math.min(D,s-(S.length-1-C)*f);let O=hu(v,E,D);return S[C]=Number(O.toFixed(12)),{value:S,thumbIndex:y,didSwap:!0}}default:return{value:p,thumbIndex:i,didSwap:!1}}}var u$=2;function d$(e,t){if(!e)return{start:0,end:0};function n(e){let t=e==null?0:parseFloat(e);return Number.isNaN(t)?0:t}let r=t?`Top`:`InlineStart`,i=t?`Bottom`:`InlineEnd`;return{start:n(e[`border${r}Width`])+n(e[`padding${r}`]),end:n(e[`border${i}Width`])+n(e[`padding${i}`])}}function f$(e,t){if(t.current!=null&&e.changedTouches){let n=e;for(let e=0;e<n.changedTouches.length;e+=1){let r=n.changedTouches[e];if(r.identifier===t.current)return{x:r.clientX,y:r.clientY}}return null}return{x:e.clientX,y:e.clientY}}var p$=_.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{disabled:o,dragging:s,inset:c,isArrayValue:l,lastChangeReasonRef:u,max:d,min:f,minStepsBetweenValues:p,onValueCommitted:m,orientation:h,pressedThumbCenterOffsetRef:g,pressedThumbIndexRef:v,pressedValuesRef:y,registerFieldControlRef:b,renderBeforeHydration:x,setActive:S,setDragging:C,setValue:w,state:T,step:E,thumbCollisionBehavior:D,thumbRefs:O,values:k}=n$(),A=Nm(),j=k.length>1,M=h===`vertical`,N=_.useRef(null),P=_.useRef(null),F=K(e=>{e&&P.current==null&&(P.current=po(e).getComputedStyle(e))}),I=_.useRef(null),L=_.useRef(0),R=_.useRef(0),z=_.useRef(null),ee=_.useRef(!1),te=Md(k);function ne(e){return e?.querySelector(`input[type="range"]`)}function re(e){v.current=e,O.current[e]||(g.current=null)}function ie(){v.current=-1,g.current=null}function ae(e){return go(e)?O.current.some(t=>!go(t)||!Y(t,e)?!1:ne(t)?.disabled===!0):!1}function B(e){let t=N.current,n=v.current;if(!t||n<0||n>=k.length)return n>=k.length&&(z.current=null),null;let{width:r,height:i,bottom:a,left:o,right:s}=t.getBoundingClientRect(),c=d$(P.current,M),u=R.current,m=(M?i:r)-c.start-c.end-u*2,h=g.current??0,_=e.x-h,b=e.y-h,x=hu(((M?a-b-c.end:(A===`rtl`?s-_:_-o)-c.start)-u)/m,0,1),S=(d-f)*x+f;return S=s$(S,E,f),S=hu(S,f,d),j?l$(D,k,te.current,y.current,n,S,f,d,E,p):{value:l?[S]:S,thumbIndex:n,didSwap:!1}}function V(e){y.current=j?k.slice():null,z.current=null,te.current=k;let t=v.current,n=t;if(t>-1&&t<k.length){if(k[t]===d){let e=t;for(;e>0&&k[e-1]===d;)--e;n=e}}else{let t=M?`y`:`x`,r;n=-1;for(let i=0;i<O.current.length;i+=1){let a=O.current[i];if(go(a)&&!ne(a)?.disabled){let o=a$(a,M),s=Math.abs(e[t]-o);(r===void 0||s<=r)&&(n=i,r=s)}}}if(n>-1&&n!==t&&re(n),c){let e=O.current[n];if(go(e)){let t=e.getBoundingClientRect();R.current=t[M?`height`:`width`]/2}}}function oe(e){let t=ne(O.current?.[e]);t&&t.focus({preventScroll:!0,focusVisible:!1})}function se(e,t,n){let r=w(e.value,Z(t,n,void 0,{activeThumbIndex:e.thumbIndex}));return r&&(z.current=e.value,te.current=Array.isArray(e.value)?e.value:[e.value],e.didSwap&&(re(e.thumbIndex),oe(e.thumbIndex))),r}let ce=K(e=>{let t=f$(e,I);if(t==null)return;if(L.current+=1,e.type===`pointermove`&&e.buttons===0){H(e);return}let n=B(t);n!=null&&QQ(n.value,E,p)&&(!s&&L.current>u$&&C(!0),se(n,hd,e))}),H=K(e=>{if(f$(e,I)==null)return;S(-1),C(!1),g.current=null;let t=z.current;if(Array.isArray(t)&&t.length!==k.length&&(z.current=null),z.current!=null){let t=u.current;m(z.current,Zu(t,e))}`pointerType`in e&&N.current?.hasPointerCapture(e.pointerId)&&N.current?.releasePointerCapture(e.pointerId),v.current=-1,de()}),le=K(e=>{I.current??H(e)}),ue=K(e=>{let t=ee.current;if(ee.current=!1,o)return;if(ae(ps(e))){ie();return}let n=e.changedTouches[0];if(n==null)return;if(I.current=n.identifier,!t){let t={x:n.clientX,y:n.clientY};V(t);let r=B(t);if(r==null)return;oe(r.thumbIndex),se(r,ad,e),L.current=0}let r=q(N.current);r.addEventListener(`touchmove`,ce,{passive:!0}),r.addEventListener(`touchend`,H,{passive:!0}),r.addEventListener(`touchcancel`,H,{passive:!0})}),de=K(()=>{let e=q(N.current);e.removeEventListener(`pointermove`,ce),e.removeEventListener(`pointerup`,H),e.removeEventListener(`pointercancel`,le),e.removeEventListener(`touchmove`,ce),e.removeEventListener(`touchend`,H),e.removeEventListener(`touchcancel`,H),I.current=null,y.current=null,z.current=null,ee.current=!1}),fe=Vo();return _.useEffect(()=>{let e=N.current;if(!e)return()=>de();let t=J(e,`touchstart`,ue,{passive:!0});return()=>{t(),fe.cancel(),de()}},[de,ue,N,fe]),_.useEffect(()=>{o&&de()},[o,de]),Vl(`div`,e,{state:T,ref:[t,b,N,F],props:[{"data-base-ui-slider-control":x?``:void 0,onPointerDown(e){ee.current=!1;let t=N.current,n=ps(e.nativeEvent);if(!t||o||e.defaultPrevented||!go(n)||e.button!==0)return;if(ae(n)){ie();return}let r={x:e.clientX,y:e.clientY};V(r);let i=B(r);if(i==null)return;Y(O.current[i.thumbIndex],ds(q(t)))?e.preventDefault():fe.request(()=>{oe(i.thumbIndex)}),C(!0),g.current??se(i,ad,e.nativeEvent),e.nativeEvent.pointerId&&t.setPointerCapture(e.nativeEvent.pointerId),L.current=0,ee.current=vQ(e.pointerType);let a=q(t);a.addEventListener(`pointermove`,ce,{passive:!0}),a.addEventListener(`pointerup`,H,{once:!0}),a.addEventListener(`pointercancel`,le,{once:!0})}},a],stateAttributesMapping:e$})}),m$=_.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{state:o}=n$();return Vl(`div`,e,{state:o,ref:t,props:[{style:{position:`relative`}},a],stateAttributesMapping:e$})}),h$=()=>()=>{},g$=()=>!0,_$=()=>!1;function v$(){return(0,Wi.useSyncExternalStore)(h$,g$,_$)}function y$(){let[e,t]=_.useState(!1);return _.useEffect(()=>{t(!0)},[]),e}var b$=Ua(18)?v$:y$;function x$(){return!b$()}function S$(e,t,n){return(e-t)*100/(n-t)}var C$=_.createContext(void 0),w$={disableStyleElements:!1};function T$(){return _.useContext(C$)??w$}function E$(e){let{script:t}=e,{nonce:n}=T$();return x$()?(0,X.jsx)(`script`,{nonce:n,dangerouslySetInnerHTML:{__html:t},suppressHydrationWarning:!0}):null}var D$=`data-index`,O$,k$=new Set([...nH,eH,tH]);function A$(e,t,n,r){if(!(t<0))return e.length===2?`${yZ(e[t],r,n)} ${t===0?`start`:`end`} range`:n?yZ(e[t],r,n):void 0}function j$(e,t,n,r,i){let a=e+t*n;return hu(Number(a.toFixed(Math.max(o$(e),o$(t),o$(r)))),r,i)}var M$=_.forwardRef(function(e,t){let{render:n,children:r,className:i,"aria-describedby":a,"aria-label":o,"aria-labelledby":s,"aria-valuetext":c,disabled:l=!1,getAriaLabel:u,getAriaValueText:d,id:f,index:p,inputRef:m,onBlur:h,onFocus:g,onKeyDown:v,tabIndex:y,style:b,...x}=e,S=xV(f),{active:C,lastUsedThumbIndex:w,controlRef:T,disabled:E,validation:D,format:O,handleInputChange:k,inset:A,isArrayValue:j,labelId:M,largeStep:N,locale:P,max:F,min:I,minStepsBetweenValues:L,form:R,name:z,orientation:ee,pressedThumbCenterOffsetRef:te,pressedThumbIndexRef:ne,renderBeforeHydration:re,setActive:ie,setIndicatorPosition:ae,state:B,step:V,thumbRefs:oe,values:se}=n$(),ce=Nm(),H=l||E,le=se.length>1,ue=ee===`vertical`,de=ce===`rtl`,{setTouched:fe,validationMode:pe}=kZ(),me=_.useRef(null),he=_.useRef(null),ge=yQ(H,he),_e=_.useRef(!1),ve=K(e=>{_e.current||g?.(e)}),ye=K(e=>{_e.current||h?.(e)}),be=xV(),xe=PZ(),U=le?be:xe,{ref:Se,index:Ce}=mK({metadata:_.useMemo(()=>({inputId:U}),[U])}),we=le?p??Ce:0,Te=we===se.length-1,Ee=se[we],De=S$(Ee,I,F),[Oe,ke]=_.useState(),Ae=x$(),je=w>=0&&w<se.length?w:-1,Me=K(()=>{let e=T.current,t=me.current;if(!e||!t)return;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=ue?`height`:`width`,a=r[i]-n[i],o=(n[i]/2+a*De/100)/r[i]*100,s=Number.isFinite(o)?o:void 0;ke(s),we===0?ae(e=>[s,e[1]]):Te&&ae(e=>[e[0],s])});G(()=>{A&&queueMicrotask(Me)},[Me,A]),G(()=>{A&&Me()},[Me,A,De]),G(()=>{if(!A)return;let e=T.current,t=me.current;if(!e||!t)return;let n=po(e).ResizeObserver;if(typeof n!=`function`)return;let r=new n(Me);return r.observe(e),r.observe(t),()=>{r.disconnect()}},[T,Me,A]);let Ne=ue?`bottom`:`insetInlineStart`,Pe=ue?`left`:`top`,Fe;le?C===we?Fe=2:je===we&&(Fe=1):C===we&&(Fe=1);let Ie;Ie=!A&&!Number.isFinite(De)?pl:{position:`absolute`,[Ne]:A?`var(--position)`:`${De}%`,[Pe]:`50%`,translate:`${(ue||!de?-1:1)*50}% ${(ue?1:-1)*50}%`,zIndex:Fe,...A&&{"--position":`${Oe??0}%`,visibility:re&&Ae||Oe===void 0?`hidden`:void 0}};let Le;ue&&(Le=de?`vertical-rl`:`vertical-lr`);let Re=typeof u==`function`?u(we):o,ze=Ol({"aria-label":Re,"aria-labelledby":s??(Re==null?M:void 0),"aria-describedby":a,"aria-orientation":ee,"aria-valuenow":Ee,"aria-valuetext":typeof d==`function`?d(yZ(Ee,P,O),Ee,we):c??A$(se,we,O,P),disabled:H,form:R,id:U,max:F,min:I,name:z,onChange(e){k(e.currentTarget.valueAsNumber,we,e)},onFocus(e){let t=_e.current;_e.current=!1,ie(we),ge(!0),t&&e.stopPropagation()},onBlur(e){_e.current?e.stopPropagation():(ie(-1),!oe.current.some(t=>Y(t,e.relatedTarget))&&(fe(!0),ge(!1),pe===`onBlur`&&D.commit(ZQ(Ee,we,I,F,j,se))))},onKeyDown(e){if(e.defaultPrevented||!k$.has(e.key))return;nH.has(e.key)&&e.stopPropagation();let t=null,n=0,r=e.shiftKey?N:V,i=s$(Ee,V,I);switch(e.key){case YV:n=1;break;case QV:n=de?-1:1;break;case XV:n=-1;break;case ZV:n=de?1:-1;break;case eH:r=N,n=1;break;case tH:r=N,n=-1;break;case`End`:t=le&&Number.isFinite(se[we+1])?se[we+1]-V*L:F;break;case $V:t=le&&Number.isFinite(se[we-1])?se[we-1]+V*L:I}if(n!==0&&(t=j$(i,r,n,I,F)),t!==null){let n=e.currentTarget;Ks(n)||(_e.current=!0,n.blur(),n.focus({preventScroll:!0,focusVisible:!0})),k(t,we,e),e.preventDefault()}},step:V,style:{...pl,width:`100%`,height:`100%`,writingMode:Le},tabIndex:y,type:`range`,value:Ee??``},e=>D.getValidationProps(H,e),{onFocus:ve,onBlur:ye,onKeyDown:v}),Be=gl(he,D.inputRef,m);return Vl(`div`,e,{state:B,ref:[t,Se,me],props:[{[D$]:we,children:(0,X.jsxs)(_.Fragment,{children:[r,(0,X.jsx)(`input`,{ref:Be,...ze,suppressHydrationWarning:!0}),A&&Te&&re&&(O$||=(0,X.jsx)(E$,{script:``}))]}),id:S,onPointerDown(e){if(H)return;ne.current=we;let t=a$(e.currentTarget,ue);te.current=(ue?e.clientY:e.clientX)-t},style:Ie,suppressHydrationWarning:re||void 0},x],stateAttributesMapping:e$})}),N$=_.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:s=!1,onValueChange:c,defaultValue:l,autoFocus:u=!1,style:d,...f}=e,{state:p,name:m,disabled:h,setTouched:g,setDirty:v,validityData:y,setFilled:b,validationMode:x,validation:S}=kZ(),{clearErrors:C,elementRef:w,submitCountRef:T}=jZ(),E=h||s,D=m??a,O={...p,disabled:E},{labelId:k}=NZ(),A=PZ({id:i}),j=o!==void 0,M=o==null?void 0:String(o),N=K(()=>S.inputRef.current?.value);bQ(S.inputRef,A,M,N,!E,a),G(()=>{let e=M??S.inputRef.current?.value;e!==void 0&&b(e!==``)},[M,l,S.inputRef,b]),wV(M,()=>{M!==void 0&&(C(D),v(M!==(y.initialValue??``)),S.change(M))});let P=_.useRef(null),F=yQ(E,P),I=Wo();return Vl(`input`,e,{ref:[t,P],state:O,props:[{id:A,disabled:E,name:D,ref:S.inputRef,"aria-labelledby":k,autoFocus:u,...j?{value:o}:{defaultValue:l},onChange(e){let t=e.currentTarget.value,n=Z(Qu,e.nativeEvent);c?.(t,n),!j&&(v(t!==(y.initialValue??``)),b(t!==``),!e.nativeEvent.defaultPrevented&&!n.isCanceled&&(C(D),S.change(t)))},onFocus(){F(!0)},onBlur(e){if(g(!0),F(!1),x===`onBlur`){let t=e.currentTarget.value;S.commit(t),j&&queueMicrotask(()=>{let e=S.inputRef.current?.value;e!==void 0&&e!==t&&e!==(y.initialValue??``)&&S.commit(e)})}},onKeyDown(e){if(e.currentTarget.tagName===`INPUT`&&e.key===`Enter`){g(!0);let t=e.currentTarget.value,n=e.currentTarget.form;if(n&&n===w.current&&!e.defaultPrevented){let t=e.currentTarget,n=T.current;I.start(0,()=>{T.current===n&&S.commit(t.value)})}else S.commit(t)}}},f,e=>S.getValidationProps(E,e)],stateAttributesMapping:EZ})}),P$=_.forwardRef(function(e,t){return(0,X.jsx)(N$,{ref:t,...e})});function F$({className:e,type:t,...n}){return(0,X.jsx)(P$,{type:t,"data-slot":`input`,className:Q(`h-[26px] w-full min-w-0 rounded-md border-0 bg-input px-2 text-xs text-foreground tabular-nums outline-none placeholder:text-muted-foreground focus-visible:ring-2 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-2 aria-invalid:ring-destructive/40`,e),...n})}var I$=_.createContext(void 0);function L$(){let e=_.useContext(I$);if(e===void 0)throw Error(La(64));return e}var R$=`data-activation-direction`,z$={tabActivationDirection:e=>({[R$]:e})},B$=_.forwardRef(function(e,t){let{className:n,defaultValue:r=0,onValueChange:i,orientation:a=`horizontal`,render:o,value:s,style:c,...l}=e,u=e.defaultValue!==void 0,d=_.useRef([]),[f,p]=_.useState(()=>new Map),[m,h]=nK({controlled:s,default:r,name:`Tabs`,state:`value`}),g=s!==void 0,[v,y]=_.useState(()=>new Map),b=_.useRef(void 0),x=_.useCallback(e=>V$(v,e),[v]),[S,C]=_.useState(()=>({previousValue:m,tabActivationDirection:`none`})),{previousValue:w,tabActivationDirection:T}=S,E=T,D=!1;w!==m&&(E=H$(w,m,a,v),D=w!=null&&m!=null&&x(m)==null);let O=D?w:m,k=w!==O||T!==E;G(()=>{k&&C({previousValue:O,tabActivationDirection:E})},[O,k,E]);let A=K((e,t)=>{t.activationDirection=H$(m,e,a,v),i?.(e,t),!t.isCanceled&&h(()=>e)}),j=K((e,t)=>{i?.(e,Z(t,void 0,void 0,{activationDirection:`none`}))}),M=K((e,t)=>(p(n=>{let r=new Map(n);return r.set(e,t),r}),()=>{p(n=>{if(n.get(e)!==t)return n;let r=new Map(n);return r.delete(e),r})})),N=_.useCallback(e=>f.get(e),[f]),P=_.useCallback(e=>{for(let t of v.values())if(e===t.value)return t.id},[v]),F=_.useMemo(()=>({getTabElementBySelectedValue:x,getTabIdByPanelValue:P,getTabPanelIdByValue:N,onValueChange:A,orientation:a,registerMountedTabPanel:M,setTabMap:y,tabActivationDirection:E,value:m}),[x,P,N,A,a,M,y,E,m]),I=_.useMemo(()=>{for(let e of v.values())if(e.value===m)return e},[v,m]),L=_.useMemo(()=>{for(let e of v.values())if(!e.disabled)return e.value},[v]),R=_.useRef(!u),z=_.useRef(r),ee=_.useRef(u),te=_.useRef(!1);G(()=>{if(g)return;function e(e,t){h(()=>e),C({previousValue:e,tabActivationDirection:`none`}),j(e,t),R.current=!1}if(v.size===0){te.current&&m!==null&&!b.current?.isConnected&&e(null,xd);return}te.current=!0,b.current=v.keys().next().value;let t=I?.disabled,n=I==null&&m!==null;if(!t&&m===z.current&&(ee.current=!1),ee.current&&t&&m===z.current)return;let r=R.current;if(t||n){let n=L??null;if(m===n){R.current=!1;return}let i=xd;r?i=Sd:t&&(i=bd),e(n,i)}else r&&I!=null&&(j(m,Sd),R.current=!1)},[L,g,j,I,h,v,m]);let ne=Vl(`div`,e,{state:{orientation:a,tabActivationDirection:E},ref:t,props:l,stateAttributesMapping:z$});return(0,X.jsx)(I$.Provider,{value:F,children:(0,X.jsx)(LK,{elementsRef:d,children:ne})})});function V$(e,t){for(let[n,r]of e.entries())if(t===r.value)return n;return null}function H$(e,t,n,r){if(e==null||t==null)return`none`;let[i,a,o]=n===`horizontal`?[`left`,`left`,`right`]:[`top`,`up`,`down`],s=V$(r,e),c=V$(r,t);if(s==null||c==null)return s!==c&&(typeof e==`number`||typeof e==`string`)&&typeof e==typeof t?t>e?o:a:`none`;let l=s.getBoundingClientRect()[i],u=c.getBoundingClientRect()[i];return u<l?a:u>l?o:`none`}var U$=`data-composite-item-active`,W$=_.createContext(void 0);function G$(){let e=_.useContext(W$);if(e===void 0)throw Error(La(65));return e}var K$=_.forwardRef(function(e,t){let{className:n,disabled:r=!1,render:i,value:a,id:o,nativeButton:s=!0,style:c,...l}=e,{value:u,getTabPanelIdByValue:d,onValueChange:f,orientation:p,tabActivationDirection:m}=L$(),{activateOnFocus:h,registerTabResizeObserverElement:g,tabsListElement:v}=G$(),{highlightedIndex:y,onHighlightedIndexChange:b}=Uu(),x=xV(o),{compositeProps:S,compositeRef:C,index:w}=_q({metadata:_.useMemo(()=>({disabled:r,id:x,value:a}),[r,x,a])}),T=a===u,E=_.useRef(!1),D=_.useRef(null),O=K(e=>{D.current?.(),D.current=e?g(e):null});G(()=>{if(E.current){E.current=!1;return}if(!(T&&w>-1&&y!==w))return;let e=v;if(e!=null){let t=ds(q(e));if(t&&Y(e,t))return}r||b(w)},[T,w,y,b,r,v]);let{getButtonProps:k,buttonRef:A}=Ku({disabled:r,native:s,focusableWhenDisabled:!0}),j=d(a),M=_.useRef(!1),N=_.useRef(!1);function P(e){f(a,Z(Qu,e.nativeEvent,void 0,{activationDirection:`none`}))}function F(e){T||r||P(e)}function I(e){T||r||h&&(!M.current||N.current)&&P(e)}function L(e){if(T||r)return;M.current=!0,N.current=e.button===0;let t=q(e.currentTarget);function n(){M.current=!1,N.current=!1,t.removeEventListener(`pointerup`,n),t.removeEventListener(`pointercancel`,n)}t.addEventListener(`pointerup`,n),t.addEventListener(`pointercancel`,n)}return Vl(`button`,e,{state:{disabled:r,active:T,orientation:p,tabActivationDirection:m},ref:[t,A,C,O],props:[S,{role:`tab`,"aria-controls":j,"aria-selected":T,id:x,onClick:F,onFocus:I,onPointerDown:L,[U$]:T?``:void 0,onKeyDownCapture(){E.current=!0}},l,k],stateAttributesMapping:z$})}),q$=`data-index`,J$={...z$,...ws},Y$=_.forwardRef(function(e,t){let{className:n,value:r,render:i,keepMounted:a=!1,style:o,...s}=e,{value:c,getTabIdByPanelValue:l,orientation:u,tabActivationDirection:d,registerMountedTabPanel:f}=L$(),p=xV(),{ref:m,index:h}=mK(),g=r===c,{mounted:v,transitionStatus:y,setMounted:b}=kf(g),x=!v,S=l(r),C={hidden:x,orientation:u,tabActivationDirection:d,transitionStatus:y},w=_.useRef(null),T=Vl(`div`,e,{state:C,ref:[t,m,w],props:[{"aria-labelledby":S,hidden:x,id:p,role:`tabpanel`,tabIndex:g?0:-1,inert:Xl(!g),[q$]:h},s],stateAttributesMapping:J$});return au({open:g,ref:w,onComplete(){g||b(!1)}}),G(()=>{if(!(p==null||x&&!a))return f(r,p)},[x,a,r,p,f]),a||v?T:null});function X$(e){let{loopFocus:t=!0,orientation:n=`both`,grid:r,onLoop:i,direction:a,highlightedIndex:o,onHighlightedIndexChange:s,rootRef:c,enableHomeAndEndKeys:l=!1,stopEventPropagation:u,disabledIndices:d,modifierKeys:f=ja}=e,[p,m]=_.useState(0),h=r!=null,g=_.useRef(null),v=gl(g,c),y=_.useRef([]),b=_.useRef(!1),x=_.useRef(null),S=o??p,C=K((e,t=!1)=>{if(x.current=y.current[e]??null,(s??m)(e),t){let t=y.current[e];oH(g.current,t,a,n)}}),w=K(e=>{if(e.size===0)return;if(b.current){let e=y.current,t=e.indexOf(x.current);if(t===-1){let t=e[S];!t||Pc(e,S,d)?C(Z$(e,d)):x.current=t}else t!==S&&C(t);return}b.current=!0;let t=Array.from(e.keys()),r=t.find(e=>e?.hasAttribute(`data-composite-item-active`))??null,i=r?e.get(r)?.index??-1:-1;if(i!==-1)C(i);else if(Pc(t,S,d)){let e=Nc(t,{disabledIndices:d});kc(t,e)||C(e)}oH(g.current,r,a,n)});G(()=>{if(d==null||o!=null||!b.current)return;let e=y.current;if(Pc(e,S,d)){let t=Nc(e,{disabledIndices:d});kc(e,t)||C(t)}},[d,o,S,y,C]);let T=K((e,t,n)=>i?i(e,t,n,y):n),E=K(e=>{let o=e.key===`Home`||e.key===`End`;if(!nH.has(e.key)||!l&&o||Q$(e,f)||!g.current)return;let s=a===`rtl`,c=s?ZV:QV,p=s?QV:ZV,m=n===`vertical`?XV:c,_=n===`vertical`?YV:p,v=ps(e.nativeEvent);if(v!=null&&aH(v)&&!Tq(v)){let t=v.selectionStart,n=v.selectionEnd,r=v.value;if(t==null||e.shiftKey||t!==n||e.key!==_&&t<r.length||e.key!==m&&t>0)return}let b=S,x=Ac(y,d),w=jc(y,d);r!=null&&(b=r({disabledIndices:d,elementsRef:y,event:e,highlightedIndex:S,loopFocus:t,maxIndex:w,minIndex:x,onLoop:T,orientation:n,rtl:s}));let E=n!==`vertical`&&e.key===c||n!==`horizontal`&&e.key===`ArrowDown`,D=n!==`vertical`&&e.key===p||n!==`horizontal`&&e.key===`ArrowUp`;l&&(e.key===`Home`?b=x:e.key===`End`&&(b=w)),b===S&&(E||D)&&(t&&b===w&&E?(b=x,i&&(b=i(e,S,b,y))):t&&b===x&&D?(b=w,i&&(b=i(e,S,b,y))):b=Nc(y.current,{startingIndex:b,decrement:D,disabledIndices:d})),b!==S&&!kc(y.current,b)&&(u&&e.stopPropagation(),(h||o||E||D)&&e.preventDefault(),C(b,!0),queueMicrotask(()=>{y.current[b]?.focus()}))});return{props:{ref:v,onFocus(e){let t=g.current,n=ps(e.nativeEvent);t&&n!=null&&aH(n)&&n.setSelectionRange(0,n.value.length)},onKeyDown:E},highlightedIndex:S,onHighlightedIndexChange:C,elementsRef:y,onMapChange:w,relayKeyboardEvent:E}}function Z$(e,t){let n=-1;for(let r=0;r<e.length;r+=1){let i=e[r];if(i&&!Pc(e,r,t)){if(i.hasAttribute(`data-composite-item-active`))return r;n===-1&&(n=r)}}return Math.max(n,0)}function Q$(e,t){for(let n of rH)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function $$(e){let{render:t,className:n,style:r,refs:i=ja,props:a=ja,state:o=Ma,stateAttributesMapping:s,highlightedIndex:c,onHighlightedIndexChange:l,orientation:u,grid:d,loopFocus:f,onLoop:p,enableHomeAndEndKeys:m,onMapChange:h,stopEventPropagation:g=!0,rootRef:v,disabledIndices:y,modifierKeys:b,highlightItemOnHover:x=!1,tag:S=`div`,...C}=e,{props:w,highlightedIndex:T,onHighlightedIndexChange:E,elementsRef:D,onMapChange:O,relayKeyboardEvent:k}=X$({grid:d,loopFocus:f,onLoop:p,orientation:u,highlightedIndex:c,onHighlightedIndexChange:l,rootRef:v,stopEventPropagation:g,enableHomeAndEndKeys:m,direction:Nm(),disabledIndices:y,modifierKeys:b}),A=Vl(S,e,{state:o,ref:i,props:[w,...a,C],stateAttributesMapping:s}),j=_.useMemo(()=>({highlightedIndex:T,onHighlightedIndexChange:E,highlightItemOnHover:x,relayKeyboardEvent:k}),[T,E,x,k]);return(0,X.jsx)(Hu.Provider,{value:j,children:(0,X.jsx)(LK,{elementsRef:D,onMapChange:e=>{h?.(e),O(e)},children:A})})}var e1=_.forwardRef(function(e,t){let{activateOnFocus:n=!1,className:r,loopFocus:i=!0,render:a,style:o,...s}=e,{orientation:c,setTabMap:l,tabActivationDirection:u}=L$(),[d,f]=_.useState(0),[p,m]=_.useState(null),h=_.useRef(new Set),g=_.useRef(new Set),v=_.useRef(null);G(()=>{if(typeof ResizeObserver>`u`)return;let e=new ResizeObserver(()=>{h.current.forEach(e=>{e()})});return v.current=e,p&&e.observe(p),g.current.forEach(t=>{e.observe(t)}),()=>{e.disconnect(),v.current=null}},[p]);let y=K(e=>(h.current.add(e),()=>{h.current.delete(e)})),b=K(e=>(g.current.add(e),v.current?.observe(e),()=>{g.current.delete(e),v.current?.unobserve(e)})),x={orientation:c,tabActivationDirection:u},S={"aria-orientation":c===`vertical`?`vertical`:void 0,role:`tablist`},C=_.useMemo(()=>({activateOnFocus:n,registerIndicatorUpdateListener:y,registerTabResizeObserverElement:b,tabsListElement:p}),[n,y,b,p]);return(0,X.jsx)(W$.Provider,{value:C,children:(0,X.jsx)($$,{render:a,className:r,style:o,state:x,refs:[t,m],props:[S,s],stateAttributesMapping:z$,highlightedIndex:d,enableHomeAndEndKeys:!0,loopFocus:i,orientation:c,onHighlightedIndexChange:f,onMapChange:l,disabledIndices:ja})})});function t1({className:e,orientation:t=`horizontal`,...n}){return(0,X.jsx)(B$,{"data-slot":`tabs`,"data-orientation":t,className:Q(`group/tabs flex gap-2 data-horizontal:flex-col`,e),...n})}var n1=Qh(`group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function r1({className:e,variant:t=`default`,...n}){return(0,X.jsx)(e1,{"data-slot":`tabs-list`,"data-variant":t,className:Q(n1({variant:t}),e),...n})}function i1({className:e,...t}){return(0,X.jsx)(K$,{"data-slot":`tabs-trigger`,className:Q(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent`,`data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100`,e),...t})}function a1({className:e,...t}){return(0,X.jsx)(Y$,{"data-slot":`tabs-content`,className:Q(`flex-1 text-sm outline-none`,e),...t})}var o1={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,1],ArrowDown:[0,-1]};function s1({hsv:e,onChange:t}){let n=n=>{let r=n.currentTarget.getBoundingClientRect();t({h:e.h,s:c1((n.clientX-r.left)/r.width),v:c1(1-(n.clientY-r.top)/r.height)})};return(0,X.jsx)(`div`,{role:`slider`,tabIndex:0,"aria-label":`Saturation and brightness`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(e.s*100),"aria-valuetext":`Saturation ${Math.round(e.s*100)}%, brightness ${Math.round(e.v*100)}%`,className:`relative h-[150px] touch-none rounded-[7px] outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,style:{background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${e.h} 100% 50%))`},onPointerDown:e=>{e.currentTarget.setPointerCapture(e.pointerId),e.currentTarget.focus(),n(e)},onPointerMove:e=>{e.currentTarget.hasPointerCapture(e.pointerId)&&n(e)},onKeyDown:n=>{let r=o1[n.key];if(!r)return;n.preventDefault();let i=n.shiftKey?.1:.01;t({h:e.h,s:c1(e.s+r[0]*i),v:c1(e.v+r[1]*i)})},children:(0,X.jsx)(`span`,{"aria-hidden":!0,className:`pointer-events-none absolute size-3 -translate-1/2 rounded-full border-2 border-white shadow-[0_0_0_1px_rgba(0,0,0,.4)]`,style:{left:`${e.s*100}%`,top:`${(1-e.v)*100}%`}})})}function c1(e){return Math.min(1,Math.max(0,e))}var l1=/^#?([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;function u1(e){let t=l1.exec(e.trim())?.[1];if(!t)return null;let n=t.length<=4?[...t].map(e=>e+e).join(``):t,r=e=>parseInt(n.slice(e,e+2),16);return{r:r(0),g:r(2),b:r(4),a:n.length===8?b1(r(6)/255,3):1}}function d1({r:e,g:t,b:n}){return[e,t,n].map(e=>Math.round(y1(e,0,255)).toString(16).padStart(2,`0`)).join(``).toUpperCase()}function f1(e){let t=e.trim().toLowerCase(),n=/^rgba?\(([^)]*)\)$/.exec(t);if(n?.[1]){let e=n[1].split(/[\s,/]+/).filter(Boolean).map(Number),[t,r,i,a=1]=e;return t===void 0||r===void 0||i===void 0||e.some(e=>!Number.isFinite(e))?null:{r:t,g:r,b:i,a}}let r=/^color\(srgb ([^)]*)\)$/.exec(t);if(r?.[1]){let e=r[1].split(/[\s/]+/).filter(Boolean).map(Number),[t,n,i,a=1]=e;return t===void 0||n===void 0||i===void 0||e.some(e=>!Number.isFinite(e))?null:{r:t*255,g:n*255,b:i*255,a}}return u1(t)}function p1(e,t){let n=t.ownerDocument.createElement(`span`);if(n.style.color=e,n.style.color===``)return null;n.style.display=`none`,t.append(n);let r=getComputedStyle(n).color;n.remove();let i=f1(r);return i?m1(i):null}function m1({r:e,g:t,b:n}){let[r,i,a]=[e/255,t/255,n/255],o=Math.max(r,i,a),s=o-Math.min(r,i,a);return{h:v1(r,i,a,o,s),s:o===0?0:s/o,v:o}}function h1({h:e,s:t,v:n},r=1){let i=r=>{let i=(r+e/60)%6;return(n-n*t*Math.max(0,Math.min(i,4-i,1)))*255};return{r:i(5),g:i(3),b:i(1),a:r}}function g1({r:e,g:t,b:n}){let[r,i,a]=[e/255,t/255,n/255],o=Math.max(r,i,a),s=Math.min(r,i,a),c=o-s,l=(o+s)/2,u=c===0?0:c/(1-Math.abs(2*l-1));return{h:v1(r,i,a,o,c),s:u*100,l:l*100}}function _1({h:e,s:t,l:n},r=1){let i=t/100,a=n/100,o=i*Math.min(a,1-a),s=t=>{let n=(t+e/30)%12;return(a-o*Math.max(-1,Math.min(n-3,9-n,1)))*255};return{r:s(0),g:s(8),b:s(4),a:r}}function v1(e,t,n,r,i){return i===0?0:((r===e?(t-n)/i%6:r===t?(n-e)/i+2:(e-t)/i+4)*60+360)%360}function y1(e,t,n){return Math.min(n,Math.max(t,e))}function b1(e,t){let n=10**t;return Math.round(e*n)/n}var x1=[{mode:`hex`,label:`Hex`},{mode:`rgb`,label:`RGB`},{mode:`hsl`,label:`HSL`}],S1=`h-6 rounded-[5px] border-0 text-xs font-medium text-muted-foreground data-active:bg-card data-active:text-foreground data-active:shadow-none data-active:ring-1 data-active:ring-border dark:data-active:bg-card`,C1={style:`unit`,unit:`percent`,maximumFractionDigits:0};function w1(){let e=window.EyeDropper;return e?new e:null}function T1({label:e,color:t,onColor:n,onSubmit:r,tab:i,onTab:a,tokens:o,theme:s,token:c,onToken:l,tokensTab:u=!0}){let[d,f]=(0,_.useState)(`hex`),p=h1(t.hsv),m=d1(p),h=typeof window<`u`&&`EyeDropper`in window,g=e=>n({...t,hsv:e}),v=e=>{let n=m1({...e,a:1});g(n.s===0?{...n,h:t.hsv.h}:n)};return(0,X.jsxs)(t1,{value:i,onValueChange:e=>a(e),className:`gap-0`,children:[u?(0,X.jsxs)(r1,{className:`mb-2.5 h-7 w-full shrink-0 rounded-[7px] p-0.5`,children:[(0,X.jsx)(i1,{value:`custom`,className:S1,children:`Custom`}),(0,X.jsx)(i1,{value:`tokens`,className:S1,children:`Tokens`})]}):null,(0,X.jsxs)(a1,{value:`custom`,className:`text-xs`,children:[(0,X.jsx)(s1,{hsv:t.hsv,onChange:g}),(0,X.jsxs)(`div`,{className:`mt-2.5 flex items-center gap-2`,children:[h?(0,X.jsx)(`button`,{type:`button`,"aria-label":`Pick a color from the screen`,onClick:()=>{w1()?.open().then(({sRGBHex:e})=>{let t=f1(e);t&&v(t)}).catch(()=>{})},className:`grid size-5 shrink-0 place-items-center rounded-sm text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50`,children:(0,X.jsx)(Er,{"aria-hidden":!0,className:`size-3.5`})}):null,(0,X.jsxs)(`div`,{className:`flex flex-1 flex-col gap-1.5`,children:[(0,X.jsx)(E1,{label:`Hue`,value:t.hsv.h,max:360,onChange:e=>g({...t.hsv,h:e}),background:`linear-gradient(to right, red, #ff0, lime, cyan, blue, #f0f, red)`}),(0,X.jsx)(E1,{label:`Opacity`,value:t.percent,max:100,onChange:e=>n({...t,percent:e}),background:`linear-gradient(to right, transparent, #${m}), repeating-conic-gradient(#ccc 0 25%, #fff 0 50%) 0 0 / 8px 8px`})]})]}),(0,X.jsxs)(`div`,{className:`mt-2.5 flex gap-1.5`,children:[(0,X.jsxs)(OY,{children:[(0,X.jsxs)(kY,{"aria-label":`Color format`,className:`flex h-[26px] shrink-0 items-center gap-1 rounded-md bg-input px-2 text-muted-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,children:[x1.find(e=>e.mode===d)?.label,(0,X.jsx)(jt,{"aria-hidden":!0,className:`size-2.5`})]}),(0,X.jsx)(pX,{align:`start`,sideOffset:6,className:`w-28`,children:x1.map(e=>(0,X.jsx)(NY,{className:hX,onClick:()=>f(e.mode),children:e.label},e.mode))})]}),d===`hex`?(0,X.jsx)(D1,{hex:m,onHex:v,onSubmit:r}):null,(0,X.jsx)(NQ,{label:`${e} opacity`,className:`ml-auto w-14 shrink-0`,inputClassName:`text-right`,value:t.percent,min:0,max:100,format:C1,disabled:!1,onCommit:e=>n({...t,percent:e(t.percent)})})]}),d===`rgb`?(0,X.jsx)(O1,{values:[p.r,p.g,p.b].map(Math.round),names:[`Red`,`Green`,`Blue`],maxes:[255,255,255],onChange:([e=0,t=0,n=0])=>v({r:e,g:t,b:n})}):d===`hsl`?(0,X.jsx)(k1,{hsv:t.hsv,onChange:v}):null,o.length>0?(0,X.jsxs)(`div`,{className:`mt-2.5 border-t border-border pt-2`,children:[(0,X.jsx)(`p`,{className:`mb-1.5 text-label font-semibold text-muted-foreground`,children:`Tokens`}),(0,X.jsx)(`div`,{className:`grid grid-cols-7 gap-1.5`,children:o.map(e=>(0,X.jsx)(`button`,{type:`button`,"aria-label":IW(e.name),"aria-pressed":e.name===c,title:IW(e.name),onClick:()=>l(e.name),className:Q(`aspect-square rounded-[5px] outline-none focus-visible:ring-2 focus-visible:ring-ring/50 aria-pressed:shadow-[0_0_0_2px_var(--primary)]`,MW),style:{background:e[s]??void 0}},e.name))})]}):null]}),(0,X.jsx)(a1,{value:`tokens`,className:`text-xs`,children:o.length===0?(0,X.jsx)(`p`,{className:`text-muted-foreground`,children:`This project names no color tokens.`}):(0,X.jsx)(`ul`,{"aria-label":`${e} tokens`,className:`-mx-1 flex max-h-56 flex-col overflow-y-auto`,children:o.map(e=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,"aria-pressed":e.name===c,onClick:()=>l(e.name),className:`flex h-7 w-full items-center gap-2 rounded-md px-1.5 text-left outline-none hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring/50 aria-pressed:bg-accent`,children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:Q(`size-3.5 shrink-0 rounded-[3px]`,MW),style:{background:e[s]??void 0}}),IW(e.name)]})},e.name))})})]})}function E1({label:e,value:t,max:n,onChange:r,background:i}){return(0,X.jsx)(i$,{value:t,max:n,onValueChange:e=>r(Array.isArray(e)?e[0]??0:e),children:(0,X.jsx)(p$,{className:`flex h-3.5 touch-none items-center select-none`,children:(0,X.jsx)(m$,{className:`h-2.5 w-full rounded-full select-none`,style:{background:i},children:(0,X.jsx)(M$,{"aria-label":e,className:`size-3.5 rounded-full bg-white shadow-[0_0_0_1px_rgba(0,0,0,.35)] select-none has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-ring/50`})})})})}function D1({hex:e,onHex:t,onSubmit:n}){let[r,i]=(0,_.useState)(e),[a,o]=(0,_.useState)(e);if(a!==e){o(e);let t=u1(r);t&&d1(t)===e||i(e)}return(0,X.jsx)(F$,{"aria-label":`Hex`,className:`flex-1`,value:r,spellCheck:!1,onFocus:e=>e.currentTarget.select(),onChange:e=>{let n=e.currentTarget.value;i(n);let r=/^#?[0-9a-f]{6}$/i.test(n.trim())?u1(n):null;r&&t(r)},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),n())}})}function O1({values:e,names:t,maxes:n,onChange:r}){return(0,X.jsx)(`div`,{className:`mt-1.5 grid grid-cols-3 gap-1`,children:t.map((t,i)=>(0,X.jsx)(NQ,{label:t,prefix:t[0],inset:`pl-[26px]`,inputClassName:`pr-1`,value:e[i]??0,min:0,max:n[i],format:{maximumFractionDigits:0},disabled:!1,onCommit:t=>r(e.map((e,n)=>n===i?t(e):e))},t))})}function k1({hsv:e,onChange:t}){let n=g1(h1(e));return(0,X.jsx)(O1,{values:[e.h,n.s,n.l].map(Math.round),names:[`Hue`,`Saturation`,`Lightness`],maxes:[360,100,100],onChange:([e=0,n=0,r=0])=>t(_1({h:e,s:n,l:r}))})}function A1({color:e,className:t}){return(0,X.jsx)(`span`,{"aria-hidden":!0,className:Q(`size-3.5 shrink-0 rounded-[3px]`,MW,e===null&&`border border-dashed border-faint`,t),style:e===null?void 0:{background:e}})}function j1(){return(0,X.jsx)(`span`,{role:`img`,"aria-label":`Raw value, not a token`,title:`Raw value`,children:(0,X.jsx)(Ft,{"aria-hidden":!0,className:`size-[13px] text-note`})})}var M1={hsv:{h:0,s:0,v:0},percent:100};function N1({hsv:e,percent:t}){return NW({raw:`#${d1(h1(e)).toLowerCase()}`},t)}var P1={style:`unit`,unit:`percent`,maximumFractionDigits:0};function F1({label:e,value:t,tokens:n,theme:r,disabled:i,onWrite:a,onRemove:o,onPreview:s,currentColor:c}){let l=(0,_.useRef)(null),[u,d]=(0,_.useState)(null),f=t.token?{token:t.token}:{raw:t.value},p=t.token?PW(n,t.token,r):null,m=FW(t,n,r),h=t.token!==null||kW.test(t.value),g=e=>{let n=t.token?p:t.value,r=n?.trim().toLowerCase()===`currentcolor`?c??n:n,i=r&&l.current?p1(r,l.current):null,a=i?{hsv:i,percent:t.percent}:M1;d({tab:e,from:a,color:a})},v=e=>{if(!u)return;d(null);let t=N1(u.color);t!==N1(u.from)&&(e?a(t).then(e=>{e||s?.(null)}):s?.(null))};return(0,X.jsxs)(`div`,{ref:l,className:AW,children:[(0,X.jsx)(`button`,{type:`button`,"aria-label":`${e} color`,disabled:i,onClick:()=>g(`custom`),className:`grid shrink-0 place-items-center rounded-[3px] outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,children:(0,X.jsx)(A1,{color:m})}),(0,X.jsx)(`button`,{type:`button`,"aria-label":`${e} token`,disabled:i,onClick:()=>g(`tokens`),className:Q(`min-w-0 truncate text-left outline-none focus-visible:ring-2 focus-visible:ring-ring/50 disabled:cursor-default`,t.token?jW:`flex-1 tabular-nums`),children:t.token?IW(t.token):t.value.replace(/^#/,``)}),(0,X.jsx)(hH,{open:u!==null,onOpenChange:(e,t)=>{e||v(t.reason!==`escape-key`)},children:(0,X.jsx)(_H,{anchor:l,side:`left`,align:`start`,sideOffset:12,"aria-label":`${e} color picker`,className:`w-[248px] gap-0 rounded-xl p-2.5 text-xs shadow-[0_14px_40px_rgba(0,0,0,.28)]`,children:u?(0,X.jsx)(T1,{label:e,color:u.color,onColor:e=>{d({...u,color:e}),s?.(N1(e))},onSubmit:()=>v(!0),tab:u.tab,onTab:e=>d({...u,tab:e}),tokens:n,theme:r,token:t.token,onToken:e=>{let n=u?.color.percent??t.percent;d(null),s?.(null),a(NW({token:e},n))}}):null})}),(0,X.jsx)(NQ,{label:`${e} opacity`,className:`ml-auto w-12 shrink-0`,inputClassName:`h-5 rounded-sm px-1 text-right text-muted-foreground focus-visible:text-foreground`,value:t.percent,min:0,max:100,format:P1,disabled:i||!h,scrubValue:!0,onPreview:e=>s?.(e?NW(f,e(t.percent)):null),onCommit:e=>a(NW(f,e(t.percent)))}),t.token?(0,X.jsx)(`button`,{type:`button`,"aria-label":`Detach ${IW(t.token)}`,title:`Detach the token to its value`,disabled:i||p===null,onClick:()=>{p!==null&&a(NW({raw:p},t.percent))},className:`grid shrink-0 place-items-center rounded-sm text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 disabled:opacity-50`,children:(0,X.jsx)(Bn,{"aria-hidden":!0,className:`size-[13px]`})}):(0,X.jsx)(j1,{}),o?(0,X.jsx)(`button`,{type:`button`,"aria-label":`Remove ${e.toLowerCase()}`,title:`Remove the ${e.toLowerCase()}`,disabled:i,onClick:o,className:`grid shrink-0 place-items-center rounded-sm text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 disabled:opacity-50`,children:(0,X.jsx)(ir,{"aria-hidden":!0,className:`size-[13px]`})}):null]})}function I1({title:e,add:t,children:n}){let r=`inspector-${e.toLowerCase()}`;return(0,X.jsxs)(`section`,{"aria-labelledby":r,className:`border-b border-sidebar-border px-3 pt-2.5 pb-3`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,X.jsx)(`h2`,{id:r,className:`text-xs font-semibold`,children:e}),(0,X.jsx)(`button`,{type:`button`,"aria-label":t.label,disabled:t.disabled,onClick:t.onAdd,className:`grid size-5 place-items-center rounded-sm text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50`,children:(0,X.jsx)(Ar,{"aria-hidden":!0,className:`size-[13px]`})})]}),n?(0,X.jsx)(`div`,{className:`mt-2`,children:n}):null]})}function L1({textOnly:e,color:t,backgroundColor:n,tokens:r,theme:i,inline:a,shorthand:o=!1,disabled:s,write:c,preview:l,currentColor:u}){let d=e?`color`:`background-color`,f=e?t:n,p=f&&f.value.trim().toLowerCase()!==`transparent`?f:null,m=r[0],h=e=>c({kind:`style`,property:d,value:e});return(0,X.jsx)(I1,{title:`Fill`,add:{label:`Add fill`,disabled:s||p!==null||!m,onAdd:()=>{m&&h(`var(${m.name})`)}},children:p?(0,X.jsx)(F1,{label:`Fill`,value:p,tokens:r,theme:i,disabled:s,onWrite:h,onRemove:a?()=>void c({kind:`style`,property:e?`color`:o?`background`:`background-color`,value:``}):e?void 0:()=>void h(`transparent`),onPreview:e=>l?.(d,e),currentColor:u}):null})}var R1={maximumFractionDigits:0},z1={fixed:`Fixed`,hug:`Hug`,fill:`Fill`},B1=new Set([`normal`,`stretch`]);function V1(e,t,n,r,i){let a=e.parent===`vertical`||e.parent===`horizontal`||e.parent===`wrap`,o=a&&e.parent===`vertical`==(t===`height`),s=[];return r===`fixed`?(s.push({property:t,value:`${i??(t===`width`?e.width:e.height)}px`}),o&&n===`fill`&&s.push({property:`flex`,value:`0 1 auto`}),s):r===`fill`?((n===`fixed`||!o&&n===`hug`)&&s.push({property:t,value:`auto`}),s.push(o?{property:`flex`,value:`1 1 0`}:{property:`align-self`,value:`stretch`}),s):a?((n===`fixed`||n===null)&&s.push({property:t,value:`auto`}),o&&(n===`fill`||n===null)&&s.push({property:`flex`,value:`0 1 auto`}),o||s.push({property:`align-self`,value:B1.has(e.parentAlignItems)?`flex-start`:`auto`}),s):(s.push({property:t,value:t===`width`?`fit-content`:`auto`}),s)}function H1({layout:e,size:t,disabled:n,write:r,preview:i}){let a=e.parent===`vertical`||e.parent===`horizontal`||e.parent===`wrap`?[`fixed`,`hug`,`fill`]:[`fixed`,`hug`],o=o=>{let s=o===`width`?e.width:e.height,c=t?.[o]??null,l=o===`width`?`Width`:`Height`,u=(t,n)=>{let i=V1(e,o,c,t,n);return i.length===0?Promise.resolve(!1):r({kind:`styles`,declarations:i})};return(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)(NQ,{label:l,prefix:o===`width`?`W`:`H`,inputClassName:`pr-[44px]`,value:s,min:0,format:R1,disabled:n,onPreview:e=>i?.(o,e?`${Math.max(0,e(s))}px`:null),onCommit:e=>u(`fixed`,Math.max(0,e(s)))}),(0,X.jsxs)(OY,{children:[(0,X.jsxs)(kY,{"aria-label":`${l} mode`,disabled:n||t===null,className:`absolute inset-y-0 right-0 flex items-center gap-px rounded-r-md px-1 text-caption text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 disabled:opacity-50`,children:[c?z1[c]:`Auto`,(0,X.jsx)(jt,{"aria-hidden":!0,className:`size-2.5`})]}),(0,X.jsx)(pX,{align:`end`,sideOffset:6,className:`w-auto`,children:(0,X.jsx)(LY,{value:c,onValueChange:e=>{e!==c&&u(e)},children:a.map(e=>(0,X.jsx)(RY,{value:e,closeOnClick:!0,className:`${hX} pr-8`,children:z1[e]},e))})})]})]},o)};return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`p`,{className:`mt-1.5 mb-[3px] ml-0.5 text-caption text-muted-foreground`,children:`Size`}),(0,X.jsxs)(`div`,{className:`grid grid-cols-2 gap-1.5`,children:[o(`width`),o(`height`)]})]})}var U1=[{value:`none`,label:`No decoration`,icon:ir},{value:`underline`,label:`Underline`,icon:Ai},{value:`line-through`,label:`Strikethrough`,icon:ni}],W1=[{value:`none`,label:`No case`,icon:ir},{value:`uppercase`,label:`Uppercase`,icon:Dt},{value:`lowercase`,label:`Lowercase`,icon:Ct},{value:`capitalize`,label:`Title case`,icon:Tt}],G1=[{value:`off`,label:`No truncation`,icon:ir},{value:`on`,label:`Truncate text`,icon:rn}],K1={on:[{property:`overflow`,value:`hidden`},{property:`text-wrap-mode`,value:`nowrap`},{property:`text-overflow`,value:`ellipsis`}],off:[{property:`overflow`,value:`visible`},{property:`text-wrap-mode`,value:`wrap`},{property:`text-overflow`,value:`clip`}]},q1=[{value:`auto`,name:`Auto`},{value:`balance`,name:`Balance`},{value:`pretty`,name:`Pretty`}];function J1({details:e,disabled:t,write:n}){let[r,i]=(0,_.useState)(!1),a=(0,_.useRef)(null),o=e=>{e.key===`Escape`&&e.target instanceof Node&&a.current?.contains(e.target)&&(e.stopPropagation(),i(!1))},s=q1.find(({value:t})=>t===e.textWrapStyle)??q1[0];return(0,X.jsxs)(hH,{open:r,onOpenChange:i,children:[(0,X.jsx)(fX,{label:`Type details`,children:(0,X.jsx)(gH,{"aria-label":`Type details`,disabled:t,className:`grid size-[26px] place-items-center rounded-md bg-input text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-expanded:text-foreground`,children:(0,X.jsx)(Xr,{"aria-hidden":!0,className:`size-[13px]`})})}),(0,X.jsxs)(_H,{side:`bottom`,align:`end`,sideOffset:6,ref:a,initialFocus:a,onKeyDownCapture:o,"aria-label":`Type details`,className:`w-60 gap-2 rounded-[10px] p-2.5 text-xs shadow-[0_12px_40px_rgba(0,0,0,.3)] ring-border`,children:[(0,X.jsx)(Y1,{id:`type-details-decoration`,label:`Decoration`,children:(0,X.jsx)(Z1,{labelledBy:`type-details-decoration`,options:U1,current:e.textDecorationLine,disabled:t,onPick:e=>void n({kind:`style`,property:`text-decoration-line`,value:e})})}),(0,X.jsx)(Y1,{id:`type-details-case`,label:`Case`,children:(0,X.jsx)(Z1,{labelledBy:`type-details-case`,options:W1,current:e.textTransform,disabled:t,onPick:e=>void n({kind:`style`,property:`text-transform`,value:e})})}),(0,X.jsx)(Y1,{id:`type-details-truncate`,label:`Truncate`,children:(0,X.jsx)(Z1,{labelledBy:`type-details-truncate`,options:G1,current:e.truncated?`on`:`off`,disabled:t||e.display===`inline`,onPick:e=>void n({kind:`styles`,declarations:e===`on`?K1.on:K1.off})})}),(0,X.jsx)(Y1,{id:`type-details-wrap`,label:`Wrap`,children:(0,X.jsxs)(OY,{children:[(0,X.jsxs)(kY,{"aria-label":`Wrap`,disabled:t,className:`flex h-[26px] w-24 items-center gap-1 rounded-md bg-input px-2 text-left text-xs text-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring/50 disabled:opacity-50`,children:[(0,X.jsx)(`span`,{className:`flex-1 truncate`,children:s.name}),(0,X.jsx)(jt,{"aria-hidden":!0,className:`size-2.5 shrink-0 text-muted-foreground`})]}),(0,X.jsx)(pX,{align:`end`,sideOffset:6,className:`w-auto min-w-(--anchor-width)`,children:(0,X.jsx)(LY,{value:s.value,onValueChange:e=>{e!==s.value&&n({kind:`style`,property:`text-wrap-style`,value:e})},children:q1.map(({value:e,name:t})=>(0,X.jsx)(RY,{value:e,closeOnClick:!0,className:Q(hX,`pr-8`),children:t},e))})})]})})]})]})}function Y1({id:e,label:t,children:n}){return(0,X.jsxs)(`div`,{className:`flex h-[26px] items-center justify-between gap-2`,children:[(0,X.jsx)(`span`,{id:e,className:`text-muted-foreground`,children:t}),n]})}var X1={ArrowRight:(e,t)=>(e+1)%t,ArrowDown:(e,t)=>(e+1)%t,ArrowLeft:(e,t)=>(e-1+t)%t,ArrowUp:(e,t)=>(e-1+t)%t,Home:()=>0,End:(e,t)=>t-1};function Z1({labelledBy:e,options:t,current:n,disabled:r,onPick:i}){let a=(0,_.useRef)([]),o=t.findIndex(({value:e})=>e===n),s=o===-1?0:o,c=(e,n)=>{let r=X1[e.key];r&&(e.preventDefault(),a.current[r(n,t.length)]?.focus())};return(0,X.jsx)(`div`,{role:`group`,"aria-labelledby":e,className:`flex w-max gap-0.5 rounded-md bg-input p-0.5`,children:t.map(({value:e,label:t,icon:o},l)=>(0,X.jsx)(fX,{label:t,children:(0,X.jsx)(`button`,{ref:e=>{a.current[l]=e},type:`button`,"aria-label":t,"aria-pressed":e===n,tabIndex:l===s?0:-1,disabled:r,onKeyDown:e=>c(e,l),onClick:()=>{e!==n&&i(e)},className:Q(`grid h-[22px] w-7 place-items-center rounded-[5px] text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50`,e===n&&`bg-sidebar text-foreground`),children:(0,X.jsx)(o,{"aria-hidden":!0,className:`size-[13px]`})})},e))})}var Q1={maximumFractionDigits:0},$1=[{value:`block`,label:`Block`,icon:ei},{value:`vertical`,label:`Vertical`,icon:dt},{value:`horizontal`,label:`Horizontal`,icon:ht},{value:`wrap`,label:`Wrap`,icon:vi},{value:`grid`,label:`Grid`,icon:Pn}],e0=[{value:`fixed`,label:`Gap between: space items by the Gap value`,icon:$e},{value:`auto`,label:`Auto gap: spread items with space between`,icon:tt}],t0=[`start`,`center`,`end`],n0={start:`flex-start`,center:`center`,end:`flex-end`};function r0(e){return e===`center`?`center`:[`flex-end`,`end`,`right`,`last baseline`].includes(e)?`end`:`start`}function i0(e,t){let n=[],r=(e,t,r)=>{t!==r&&n.push({property:e,value:t})};return r(`display`,t===`block`?e.inline?`inline-block`:`block`:t===`grid`?e.inline?`inline-grid`:`grid`:e.inline?`inline-flex`:`flex`,a0(e)),(t===`vertical`||t===`horizontal`||t===`wrap`)&&(r(`flex-direction`,t===`vertical`?`column`:`row`,e.direction),r(`flex-wrap`,t===`wrap`?`wrap`:`nowrap`,e.wrap)),n}function a0({flow:e,inline:t}){return e===`grid`?t?`inline-grid`:`grid`:e===`block`?t?`inline-block`:`block`:t?`inline-flex`:`flex`}function o0({layout:e,flow:t,textOnly:n,disabled:r,write:i,preview:a}){let o=t?.rule??null,s=e.flow===`vertical`||e.flow===`horizontal`||e.flow===`wrap`,c=t=>{let n=i0(e,t);n.length>0&&i({kind:`styles`,declarations:n})};return(0,X.jsxs)(`section`,{"aria-labelledby":`inspector-layout`,className:`border-b border-sidebar-border px-3 pt-2.5 pb-3`,children:[(0,X.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[(0,X.jsx)(`h2`,{id:`inspector-layout`,className:`text-xs font-semibold`,children:`Layout`}),o&&o.count>1?(0,X.jsx)(fX,{label:`The flow comes from a rule these elements share. An edit writes this element alone.`,children:(0,X.jsxs)(`span`,{tabIndex:0,className:`min-w-0 truncate text-caption text-muted-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,children:[(0,X.jsx)(`code`,{className:`font-mono text-foreground`,children:o.selector}),` · `,`shared by `,o.count,` elements`]})}):null,!n&&e.flow===`block`?(0,X.jsx)(fX,{label:`Add flow`,children:(0,X.jsx)(`button`,{type:`button`,"aria-label":`Add flow`,disabled:r,onClick:()=>c(`vertical`),className:`grid size-5 place-items-center rounded-[5px] text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 disabled:opacity-50`,children:(0,X.jsx)(Ar,{"aria-hidden":!0,className:`size-[13px]`})})}):null]}),n?null:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`p`,{id:`inspector-flow`,className:`sr-only`,children:`Flow`}),(0,X.jsx)(Z1,{labelledBy:`inspector-flow`,options:$1,current:e.flow,disabled:r,onPick:e=>c(e)})]}),(0,X.jsx)(H1,{layout:e,size:t?.size??null,disabled:r,write:i,preview:a}),s||e.flow===`grid`?(0,X.jsx)(s0,{layout:e,flex:s,disabled:r,write:i,preview:a}):null,(0,X.jsx)(d0,{padding:e.padding,disabled:r,write:i,preview:a})]})}function s0({layout:e,flex:t,disabled:n,write:r,preview:i}){let a=e.flow===`vertical`,o=e.justify===`space-between`,s=a?e.rowGap:e.columnGap,c=(0,X.jsx)(NQ,{label:`Gap`,prefix:(0,X.jsx)(p0,{}),inset:`pl-[28px]`,value:s,min:0,format:Q1,disabled:n,onPreview:e=>i?.(`gap`,e?`${e(s)}px`:null),onCommit:e=>r({kind:`style`,property:`gap`,value:`${e(s)}px`})});if(!t)return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`p`,{className:`mt-1.5 mb-[3px] ml-0.5 text-caption text-muted-foreground`,children:`Gap`}),c]});let l=r0(e.justify),u=r0(e.alignItems);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`p`,{id:`inspector-alignment-gap`,className:`mt-1.5 mb-[3px] ml-0.5 text-caption text-muted-foreground`,children:`Alignment and gap`}),(0,X.jsxs)(`div`,{className:`grid grid-cols-[62px_1fr] gap-1.5`,children:[(0,X.jsx)(u0,{vertical:a,main:o?null:l,cross:u,disabled:n,onPick:(e,t)=>void r({kind:`styles`,declarations:[{property:`justify-content`,value:n0[e]},{property:`align-items`,value:n0[t]}]})}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[c,(0,X.jsx)(Z1,{labelledBy:`inspector-alignment-gap`,options:e0,current:o?`auto`:`fixed`,disabled:n,onPick:t=>void r({kind:`style`,property:`justify-content`,value:t===`auto`?`space-between`:e.ownJustify?``:`flex-start`})})]})]})]})}var c0={ArrowRight:e=>e%3==2?e:e+1,ArrowLeft:e=>e%3==0?e:e-1,ArrowDown:e=>e>=6?e:e+3,ArrowUp:e=>e<3?e:e-3},l0={start:[`top`,`left`],center:[`center`,`center`],end:[`bottom`,`right`]};function u0({vertical:e,main:t,cross:n,disabled:r,onPick:i}){let a=(0,_.useRef)([]),o=(r,i)=>{let a=t0[e?r:i];return t0[e?i:r]===n&&(t===null||a===t)},[s,c]=(0,_.useState)(null),l=Array.from({length:9},(e,t)=>o(Math.floor(t/3),t%3)).indexOf(!0),u=s??(l===-1?0:l),d=(e,t)=>{let n=c0[e.key];n&&(e.preventDefault(),a.current[n(t)]?.focus())};return(0,X.jsx)(`div`,{role:`group`,"aria-label":`Alignment`,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||c(null)},className:`grid h-[58px] grid-cols-3 grid-rows-3 rounded-md bg-input p-1`,children:t0.flatMap((t,n)=>t0.map((s,l)=>{let f=e?t:s,p=e?s:t,m=n*3+l,h=o(n,l),g=`Align ${l0[t][0]} ${l0[s][1]}`;return(0,X.jsx)(`button`,{ref:e=>{a.current[m]=e},type:`button`,"aria-label":g,"aria-pressed":h,tabIndex:m===u?0:-1,disabled:r,onFocus:()=>c(m),onKeyDown:e=>d(e,m),onClick:()=>i(f,p),className:`group/cell grid place-items-center rounded-[3px] outline-none focus-visible:ring-2 focus-visible:ring-ring/50 disabled:opacity-50`,children:(0,X.jsx)(`span`,{"aria-hidden":!0,className:Q(`rounded-full`,h?`h-0.5 w-2.5 bg-primary`:`size-[3px] bg-muted-foreground/50 group-hover/cell:bg-foreground`)})},`${t}-${s}`)}))})}function d0({padding:e,disabled:t,write:n,preview:r}){let[i,a]=(0,_.useState)(e.left!==e.right||e.top!==e.bottom),o=(i,a,o)=>{let s=o.map(t=>e[t]),[c=0]=s,l=s.every(e=>e===c);return(0,X.jsx)(NQ,{label:i,prefix:a,inset:`pl-[28px]`,value:l?c:null,min:0,format:Q1,disabled:t,onPreview:t=>{for(let n of o)r?.(`padding-${n}`,t?`${Math.max(0,t(e[n]))}px`:null)},onCommit:t=>n({kind:`styles`,declarations:o.map(n=>({property:`padding-${n}`,value:`${Math.max(0,t(e[n]))}px`}))})},i)};return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`p`,{className:`mt-1.5 mb-[3px] ml-0.5 text-caption text-muted-foreground`,children:`Padding`}),(0,X.jsxs)(`div`,{className:`grid grid-cols-[1fr_1fr_26px] gap-1.5`,children:[i?(0,X.jsxs)(X.Fragment,{children:[o(`Left padding`,(0,X.jsx)(g0,{side:`left`}),[`left`]),o(`Top padding`,(0,X.jsx)(g0,{side:`top`}),[`top`])]}):(0,X.jsxs)(X.Fragment,{children:[o(`Horizontal padding`,(0,X.jsx)(m0,{vertical:!1}),[`left`,`right`]),o(`Vertical padding`,(0,X.jsx)(m0,{vertical:!0}),[`top`,`bottom`])]}),(0,X.jsx)(fX,{label:`Padding per side`,children:(0,X.jsx)(`button`,{type:`button`,"aria-label":`Padding per side`,"aria-pressed":i,disabled:t,onClick:()=>a(!i),className:Q(`grid h-[26px] place-items-center rounded-md text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 disabled:opacity-50`,i&&`bg-input text-foreground`),children:(0,X.jsx)(Wr,{"aria-hidden":!0,className:`size-[13px]`})})}),i?(0,X.jsxs)(X.Fragment,{children:[o(`Right padding`,(0,X.jsx)(g0,{side:`right`}),[`right`]),o(`Bottom padding`,(0,X.jsx)(g0,{side:`bottom`}),[`bottom`])]}):null]})]})}function f0({children:e}){return(0,X.jsx)(`svg`,{"aria-hidden":!0,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:1.6,strokeLinecap:`round`,strokeLinejoin:`round`,className:`size-3`,children:e})}function p0(){return(0,X.jsx)(f0,{children:(0,X.jsx)(`path`,{d:`M4 5v14M20 5v14M10 9v6M14 9v6`})})}function m0({vertical:e}){return e?(0,X.jsxs)(f0,{children:[(0,X.jsx)(`path`,{d:`M5 4h14M5 20h14`}),(0,X.jsx)(`rect`,{x:`9`,y:`8`,width:`6`,height:`8`,rx:`1`})]}):(0,X.jsxs)(f0,{children:[(0,X.jsx)(`path`,{d:`M4 5v14M20 5v14`}),(0,X.jsx)(`rect`,{x:`8`,y:`9`,width:`8`,height:`6`,rx:`1`})]})}var h0={top:`M5 4h14`,right:`M20 5v14`,bottom:`M5 20h14`,left:`M4 5v14`};function g0({side:e}){return(0,X.jsxs)(f0,{children:[(0,X.jsx)(`path`,{d:h0[e]}),(0,X.jsx)(`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,opacity:.5})]})}var _0={maximumFractionDigits:0},v0=`Free positions it inside its parent`;function y0({placement:e,disabled:t,write:n,preview:r,place:i}){let{free:a,left:o,top:s,width:c,height:l}=e,u=e=>{e!==a&&i(e?{left:o,top:s,...c===null?{}:{width:c},...l===null?{}:{height:l}}:null)},d=[{label:`In flow`,on:!a,value:!1},{label:`Free`,on:a,value:!0}];return(0,X.jsxs)(`section`,{"aria-labelledby":`inspector-position`,className:`border-b border-sidebar-border px-3 pt-2.5 pb-3`,children:[(0,X.jsxs)(`div`,{className:Q(`flex items-center justify-between`,a?`mb-2`:void 0),children:[(0,X.jsx)(`h2`,{id:`inspector-position`,className:`text-xs font-semibold`,children:`Position`}),(0,X.jsx)(`div`,{role:`group`,"aria-label":`Placement`,className:`flex gap-0.5 rounded-md bg-input p-0.5`,children:d.map(({label:e,on:n,value:r})=>{let i=(0,X.jsx)(`button`,{type:`button`,"aria-pressed":n,disabled:t,onClick:()=>u(r),className:Q(`flex h-5 items-center rounded-[5px] px-2 text-[11px] font-medium text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50`,n&&`bg-sidebar text-foreground shadow-xs`),children:e},e);return r?(0,X.jsx)(fX,{label:v0,side:`bottom`,children:i},e):i})})]}),a?(0,X.jsxs)(`div`,{className:`grid grid-cols-2 gap-1.5`,children:[(0,X.jsx)(NQ,{prefix:`X`,label:`X position in its parent`,value:o,format:_0,disabled:t,...uB(`left`,o,e=>`${e}px`,n,r)}),(0,X.jsx)(NQ,{prefix:`Y`,label:`Y position in its parent`,value:s,format:_0,disabled:t,...uB(`top`,s,e=>`${e}px`,n,r)})]}):null]})}function b0({boxShadow:e,shadows:t,theme:n,disabled:r,write:i}){let a=!e||e.value.trim().toLowerCase()===`none`,o=a?null:e.token?PW(t,e.token,n):e.value,s=e=>void i({kind:`style`,property:`box-shadow`,value:e});return(0,X.jsxs)(`section`,{"aria-labelledby":`inspector-shadow`,className:`border-b border-sidebar-border px-3 pt-2.5 pb-3`,children:[(0,X.jsx)(`h2`,{id:`inspector-shadow`,className:`mb-2 text-xs font-semibold`,children:`Shadow`}),(0,X.jsxs)(OY,{children:[(0,X.jsxs)(kY,{"aria-label":`Shadow`,disabled:r,className:`${AW} w-full text-left outline-none focus-visible:ring-2 focus-visible:ring-ring/50 disabled:opacity-50`,children:[(0,X.jsx)(x0,{shadow:o}),a?(0,X.jsx)(`span`,{className:`flex-1 text-muted-foreground`,children:`None`}):e.token?(0,X.jsx)(`span`,{className:jW,children:IW(e.token)}):(0,X.jsx)(`span`,{className:`flex-1 truncate`,children:e.value}),!a&&!e.token?(0,X.jsx)(j1,{}):null,(0,X.jsx)(jt,{"aria-hidden":!0,className:`ml-auto size-2.5 shrink-0 text-muted-foreground`})]}),(0,X.jsxs)(pX,{align:`start`,sideOffset:6,className:`w-(--anchor-width)`,children:[t.map(e=>(0,X.jsxs)(NY,{className:hX,onClick:()=>s(`var(${e.name})`),children:[(0,X.jsx)(x0,{shadow:e[n]}),IW(e.name)]},e.name)),t.length>0?(0,X.jsx)(zY,{}):null,(0,X.jsx)(NY,{className:hX,onClick:()=>{a||s(`none`)},children:`None`})]})]})]})}function x0({shadow:e}){return(0,X.jsx)(`span`,{"aria-hidden":!0,className:Q(`size-3.5 shrink-0 rounded-[3px] bg-sidebar`,MW),style:e?{boxShadow:e}:void 0})}var S0=`--border`;function C0({bordered:e,borderColor:t,tokens:n,theme:r,inline:i,disabled:a,write:o,preview:s,currentColor:c}){let l=n.find(e=>e.name===S0)?.name??n[0]?.name,u=e?t??{value:`currentcolor`,token:null,percent:100}:null;return(0,X.jsx)(I1,{title:`Stroke`,add:{label:`Add stroke`,disabled:a||e||l===void 0,onAdd:()=>{l!==void 0&&o({kind:`style`,property:`border`,value:`1px solid var(${l})`})}},children:u?(0,X.jsx)(F1,{label:`Stroke`,value:u,tokens:n,theme:r,disabled:a,onWrite:e=>o({kind:`style`,property:`border-color`,value:e}),onPreview:e=>s?.(`border-color`,e),currentColor:c,onRemove:()=>void o(i?{kind:`style`,property:`border`,value:``}:{kind:`style`,property:`border-style`,value:`none`})}):null})}function w0(e){return(e.split(`,`)[0]??``).trim().replace(/^["']|["']$/g,``)}function T0(e){let t=w0(e).toLowerCase();return dG.find(e=>e.family.toLowerCase()===t)??null}function E0(e){let t=e.flatMap(e=>{let t=e.light??e.dark;return!t||/^-?[\d.]/.test(t.trim())?[]:[{value:`var(${e.name})`,name:e.name.replace(/^--/,``),token:e.name,stack:t}]}),n=dG.map(e=>{let t=/\s/.test(e.family)?`'${e.family}'`:e.family;return{value:t,name:e.family,token:null,stack:t}});return[...t,...n]}function D0(e,t,n){if(t)return n.find(e=>e.token===t)??{value:`var(${t})`,name:t.replace(/^--/,``),token:t,stack:e};let r=T0(e);return n.find(e=>!e.token&&e.name===r?.family)??null}var O0=[{value:100,name:`Thin`},{value:200,name:`Extra Light`},{value:300,name:`Light`},{value:400,name:`Regular`},{value:500,name:`Medium`},{value:600,name:`Semi Bold`},{value:700,name:`Bold`},{value:800,name:`Extra Bold`},{value:900,name:`Black`}];function k0(e){if(!e)return O0;let{min:t,max:n}=e.weights;return O0.filter(({value:e})=>e>=t&&e<=n)}function A0(e,t){return t.find(({value:t})=>t===e)?.name??String(e)}var j0=[{value:`left`,label:`Align text left`,icon:gi},{value:`center`,label:`Align text center`,icon:ui},{value:`right`,label:`Align text right`,icon:fi},{value:`justify`,label:`Justify text`,icon:mi}],M0={maximumFractionDigits:2},N0=1.2;function P0({fonts:e,fontFamily:t,fontToken:n,fontSize:r,fontWeight:i,lineHeight:a,letterSpacing:o,textAlign:s,details:c,disabled:l,write:u,preview:d}){let f=k0(T0(t)),p=E0(e),m=D0(t,n,p);return(0,X.jsxs)(`section`,{"aria-labelledby":`inspector-typography`,className:`border-b border-sidebar-border px-3 pt-2.5 pb-3`,children:[(0,X.jsx)(`h2`,{id:`inspector-typography`,className:`mb-2 text-xs font-semibold`,children:`Typography`}),dG.map(e=>(0,X.jsx)(`link`,{rel:`stylesheet`,href:pG(e)},e.folder)),(0,X.jsxs)(`div`,{className:`grid grid-cols-2 gap-1.5`,children:[(0,X.jsx)(I0,{label:`Font family`,shown:m?.token?(0,X.jsx)(`span`,{className:jW,children:m.name}):m?.name??w0(t),current:m?.value??null,options:p.map(({value:e,name:t,stack:n})=>({value:e,name:t,font:n})),disabled:l,onPick:e=>void u({kind:`style`,property:`font-family`,value:e}),className:`col-span-2`}),(0,X.jsx)(I0,{label:`Font weight`,shown:(0,X.jsxs)(X.Fragment,{children:[A0(i,f),f.some(({value:e})=>e===i)?(0,X.jsx)(F0,{value:i}):null]}),current:String(i),options:f.map(({value:e,name:t})=>({value:String(e),name:t,hint:(0,X.jsx)(F0,{value:e})})),disabled:l,onPick:e=>void u({kind:`style`,property:`font-weight`,value:e})}),(0,X.jsx)(NQ,{label:`Font size`,prefix:`Size`,inset:`pl-[40px]`,value:r,min:1,format:M0,disabled:l,...uB(`font-size`,r,e=>`${e}px`,u,d)}),(0,X.jsx)(NQ,{label:`Line height`,caption:`Line height`,prefix:(0,X.jsx)(Rn,{"aria-hidden":!0,className:`size-3`,strokeWidth:1.6}),inset:`pl-[28px]`,value:a,empty:`Auto`,min:0,format:M0,disabled:l,...uB(`line-height`,a??Math.round(r*N0),e=>`${e}px`,u,d)}),(0,X.jsx)(NQ,{label:`Letter spacing`,caption:`Letter spacing`,prefix:(0,X.jsx)(In,{"aria-hidden":!0,className:`size-3`,strokeWidth:1.6}),inset:`pl-[28px]`,value:o,format:M0,disabled:l,...uB(`letter-spacing`,o,e=>`${e}px`,u,d)})]}),(0,X.jsx)(`p`,{id:`inspector-alignment`,className:`mt-1.5 mb-[3px] ml-0.5 text-caption text-muted-foreground`,children:`Alignment`}),(0,X.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,X.jsx)(Z1,{labelledBy:`inspector-alignment`,options:j0,current:s,disabled:l,onPick:e=>void u({kind:`style`,property:`text-align`,value:e})}),(0,X.jsx)(J1,{details:c,disabled:l,write:u})]})]})}function F0({value:e}){return(0,X.jsx)(`span`,{className:`ml-auto pl-2 text-muted-foreground tabular-nums`,children:e})}function I0({label:e,shown:t,current:n,options:r,disabled:i,onPick:a,className:o}){return(0,X.jsxs)(OY,{children:[(0,X.jsxs)(kY,{"aria-label":e,disabled:i,className:Q(`flex h-[26px] min-w-0 items-center gap-1 rounded-md bg-input px-2 text-left text-xs text-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring/50 disabled:opacity-50`,o),children:[(0,X.jsx)(`span`,{className:`flex min-w-0 flex-1 items-center truncate`,children:t}),(0,X.jsx)(jt,{"aria-hidden":!0,className:`size-2.5 shrink-0 text-muted-foreground`})]}),(0,X.jsx)(pX,{align:`start`,sideOffset:6,className:`w-auto min-w-(--anchor-width)`,children:(0,X.jsx)(LY,{value:n,onValueChange:e=>{e!==n&&a(e)},children:r.map(e=>(0,X.jsxs)(RY,{value:e.value,closeOnClick:!0,className:Q(hX,`pr-8`),style:e.font?{fontFamily:e.font}:void 0,children:[e.name,e.hint]},e.value))})})]})}var L0=[1,2,3],R0=[{value:`light`,label:`Light`},{value:`dark`,label:`Dark`},{value:`both`,label:`Both themes`}],z0=N()(()=>({scale:2,theme:`both`}));function B0(e,t,n){return`${e}.${t}@${n}x.png`}function V0({frame:e}){let t=F(z0,e=>e.scale),n=F(z0,e=>e.theme),[r,i]=(0,_.useState)(!1),a=n===`both`?mM:[n],o=a.map(n=>B0(e.name,n,t));return(0,X.jsxs)(`section`,{"aria-labelledby":`inspector-export`,className:`border-b border-sidebar-border px-3 pt-2.5 pb-3`,children:[(0,X.jsx)(`h2`,{id:`inspector-export`,className:`mb-2 text-xs font-semibold`,children:`Export`}),(0,X.jsxs)(`div`,{className:`mb-2 grid grid-cols-[70px_1fr] gap-1.5`,children:[(0,X.jsx)(H0,{label:`Export scale`,shown:`${t}x`,value:String(t),options:L0.map(e=>({value:String(e),label:`${e}x`})),onPick:e=>{let t=L0.find(t=>String(t)===e);t&&z0.setState({scale:t})}}),(0,X.jsx)(H0,{label:`Export theme`,shown:R0.find(e=>e.value===n)?.label??``,value:n,options:R0,onPick:e=>{let t=R0.find(t=>t.value===e);t&&z0.setState({theme:t.value})}})]}),(0,X.jsx)(eg,{variant:`outline`,size:`sm`,disabled:r,onClick:()=>{i(!0),U0(e.ref,a,t).then(e=>{e.forEach((e,t)=>G0(e,o[t]??``))},Ck(`Couldn't export ${e.name}`)).finally(()=>i(!1))},className:`w-full bg-transparent text-xs dark:bg-transparent`,children:r?`Exporting`:`Export ${e.name}`}),(0,X.jsxs)(`p`,{className:`mt-1.5 text-caption text-muted-foreground`,children:[`PNG, `,o.join(` and `)]})]})}function H0({label:e,shown:t,value:n,options:r,onPick:i}){return(0,X.jsxs)(OY,{children:[(0,X.jsxs)(kY,{"aria-label":e,className:Q(AW,`min-w-0 text-left outline-none focus-visible:ring-2 focus-visible:ring-ring/50`),children:[(0,X.jsx)(`span`,{className:`flex-1 truncate`,children:t}),(0,X.jsx)(jt,{"aria-hidden":!0,className:`size-2.5 shrink-0 text-muted-foreground`})]}),(0,X.jsx)(pX,{align:`start`,sideOffset:6,className:`w-auto min-w-(--anchor-width)`,children:(0,X.jsx)(LY,{value:n,onValueChange:i,children:r.map(e=>(0,X.jsx)(RY,{value:e.value,closeOnClick:!0,className:Q(hX,`pr-8`),children:e.label},e.value))})})]})}async function U0(e,t,n){let r=[];for(let i of t){let t=new URLSearchParams({ref:e,theme:i,scale:String(n)}),a=await fetch(`/api/frames/png?${t}`);if(!a.ok)throw Error(await W0(a));r.push(await a.blob())}return r}async function W0(e){let t=await e.json().catch(()=>null);return typeof t==`object`&&t&&`error`in t&&typeof t.error==`object`&&t.error!==null&&`message`in t.error&&typeof t.error.message==`string`?t.error.message:`The board answered ${e.status}.`}function G0(e,t){let n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=t,r.click(),URL.revokeObjectURL(n)}var K0=[{preset:`phone`,label:`Phone`,icon:Qr},{preset:`tablet`,label:`Tablet`,icon:ci},{preset:`desktop`,label:`Desktop`,icon:or}],q0=[...K0.map(({preset:e,label:t,icon:n})=>({group:e,label:t,icon:n,rows:[{name:e,label:t,...LW[e]},...J0(e)]})),{group:`slide`,label:`Slide`,icon:Mr,rows:J0(`slide`)}].map(e=>({...e,rows:e.rows.toSorted((e,t)=>e.width-t.width)}));function J0(e){return RW.filter(t=>t.group===e)}function Y0({width:e,height:t}){for(let{rows:n}of q0){let r=n.find(n=>n.width===e&&n.height===t);if(r)return r}}function X0({frames:e}){let t=BM(),n=e.map(e=>e.ref),r=e.map(e=>t[e.ref]?.width??e.box.width),i=n.some(e=>t[e]!==void 0),a=n.length>0&&n.every(e=>t[e]),o=Q0(r),s=(0,_.useRef)(null),c=e=>{s.current??={widths:r,previews:Object.fromEntries(n.map(e=>[e,t[e]]))};let i=s.current.widths;for(let[t,r]of n.entries()){let n=i[t];n!==void 0&&WM([r],e(n))}};return(0,X.jsxs)(`div`,{role:`group`,"aria-labelledby":`inspector-preview`,className:`mt-2.5`,children:[(0,X.jsxs)(`div`,{className:`mb-1.5 flex h-4 items-center justify-between`,children:[(0,X.jsx)(`span`,{id:`inspector-preview`,className:`text-caption text-muted-foreground`,children:`Preview`}),i?(0,X.jsx)(`span`,{className:`text-caption text-muted-foreground`,children:`Size unchanged`}):null]}),(0,X.jsxs)(`div`,{className:`grid grid-cols-2 gap-1.5`,children:[(0,X.jsx)(`div`,{className:`flex h-[26px] gap-0.5 rounded-md bg-input p-0.5`,children:K0.map(({preset:e,label:t,icon:r})=>{let i=LW[e].width,s=a&&o===i,c=`Preview at ${t.toLowerCase()} width, ${i}`;return(0,X.jsx)(fX,{label:c,side:`bottom`,children:(0,X.jsx)(`button`,{type:`button`,"aria-label":c,"aria-pressed":s,onClick:()=>WM(n,i),className:Q(`grid flex-1 place-items-center rounded-[5px] text-muted-foreground outline-none hover:bg-sidebar hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 active:bg-sidebar`,s&&`bg-sidebar text-foreground shadow-xs`),children:(0,X.jsx)(r,{"aria-hidden":!0,className:`size-[13px]`,strokeWidth:1.6})})},e)})}),(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)(NQ,{prefix:(0,X.jsx)(fr,{"aria-hidden":!0,className:`size-[13px]`,strokeWidth:1.6}),label:`Preview width`,value:o,min:1,format:Z0,disabled:!1,inputClassName:i?`pr-7`:void 0,onPreview:e=>{if(e){c(e);return}let t=s.current;if(s.current=null,t)for(let[e,n]of Object.entries(t.previews))n?WM([e],n.width):GM([e])},onCommit:e=>{c(e),s.current=null}}),i?(0,X.jsx)(`span`,{className:`absolute inset-y-0 right-0.5 flex items-center`,children:(0,X.jsx)(fX,{label:`End preview`,side:`bottom`,children:(0,X.jsx)(`button`,{type:`button`,"aria-label":`End preview`,onClick:()=>GM(n),className:`grid size-6 place-items-center rounded-[5px] text-muted-foreground outline-none hover:bg-sidebar hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 active:bg-sidebar`,children:(0,X.jsx)(Ii,{"aria-hidden":!0,className:`size-[13px]`,strokeWidth:1.6})})})}):null]})]})]})}var Z0={maximumFractionDigits:0};function Q0(e){let[t]=e;return t!==void 0&&e.every(e=>e===t)?t:null}var $0=[{key:`x`,letter:`X`,label:`X position`},{key:`y`,letter:`Y`,label:`Y position`},{key:`width`,letter:`W`,label:`Width`},{key:`height`,letter:`H`,label:`Height`}],e2=[`frame.fitHeight`];function t2({frames:e,page:t,named:n=!0,write:r=fN,calls:i}){let a=Rg(e=>e.canWrite),o=qH(`inspector`),[s]=Ce(e2),c=(0,_.useRef)(null),[l]=e;if(!l)return null;let u=e.length>1,d=e.some(e=>e.locked),f=(t,n)=>{let r=c.current??Object.fromEntries(e.map(({ref:e,box:t})=>[e,t])),i={},a={};for(let[e,o]of Object.entries(r)){let r={...o,[t]:n(o[t])};r[t]!==o[t]&&(i[e]=r,a[e]=o)}return{boxes:i,expected:a}},p=(t,n)=>{n?(c.current??=Object.fromEntries(e.map(({ref:e,box:t})=>[e,t])),uN({...c.current,...f(t,n).boxes})):(c.current&&mN(Object.keys(c.current)),c.current=null)},m=(e,n)=>{let{boxes:i,expected:a}=f(e,n),o=c.current;return c.current=null,o&&mN(Object.keys(o).filter(e=>!(e in i))),r(t,i,a)};return(0,X.jsxs)(`section`,{"aria-labelledby":`inspector-frame`,className:`border-b border-sidebar-border px-3 pt-2.5 pb-3`,children:[(0,X.jsx)(n2,{frames:e,disabled:!a||d,onPick:n=>{let i=VW(n),a={},o={};for(let{ref:t,box:n}of e)(n.width!==i.width||n.height!==i.height)&&(a[t]={...n,...i},o[t]=n);r(t,a,o)}}),u||!n?null:o===l.ref?(0,X.jsx)(`div`,{className:`mb-1.5 flex h-[26px] items-center pl-1.5`,children:(0,X.jsx)(uV,{name:l.name,label:`Rename frame ${l.name}`,onCommit:e=>{YH(),XH(l,e,i)},onCancel:YH})}):(0,X.jsx)(`button`,{type:`button`,"aria-label":`Rename frame ${l.name}`,disabled:!a,onClick:()=>JH(l.ref,`inspector`),className:`mb-1.5 block h-[26px] w-full truncate rounded-md bg-input px-2 text-left text-xs outline-none hover:ring-1 hover:ring-border focus-visible:ring-2 focus-visible:ring-ring/50 disabled:hover:ring-0`,children:l.name}),(0,X.jsx)(`div`,{className:`grid grid-cols-2 gap-1.5`,children:$0.map(({key:t,letter:n,label:r})=>{let i=t===`height`&&!u&&s?s:null;return(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)(NQ,{prefix:n,label:r,value:a2(e.map(({box:e})=>e[t])),min:t===`width`||t===`height`?1:void 0,format:r2,disabled:!a||d,inputClassName:i?`pr-7`:void 0,onPreview:e=>p(t,e),onCommit:e=>m(t,e)}),i?(0,X.jsx)(`span`,{className:`absolute inset-y-0 right-0.5 flex items-center`,children:(0,X.jsx)(i2,{action:i})}):null]},t)})}),(0,X.jsx)(X0,{frames:e})]})}function n2({frames:e,disabled:t,onPick:n}){let r=e.map(({box:e})=>Y0(e)),[i]=r,a=r.every(e=>e?.name===i?.name),o=a?i?.name:void 0,s=a?i?.label??`Custom`:`Mixed`;return(0,X.jsxs)(`div`,{className:`mb-2 flex h-5 items-center justify-between gap-2`,children:[(0,X.jsx)(`h2`,{id:`inspector-frame`,className:`-ml-1 text-xs font-semibold`,children:(0,X.jsxs)(OY,{children:[(0,X.jsxs)(kY,{disabled:t,"aria-describedby":`inspector-frame-size`,className:`flex h-5 items-center gap-1 rounded-[5px] px-1 outline-none hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring/50 disabled:hover:bg-transparent aria-expanded:bg-accent`,children:[e.length>1?`${e.length} frames`:`Frame`,(0,X.jsx)(jt,{"aria-hidden":!0,className:Q(`size-2.5 text-muted-foreground`,t&&`opacity-0`)})]}),(0,X.jsx)(pX,{align:`start`,sideOffset:4,className:`w-auto min-w-[220px]`,children:q0.map(({group:e,label:t,rows:r},i)=>(0,X.jsxs)(_.Fragment,{children:[i>0?(0,X.jsx)(zY,{}):null,(0,X.jsxs)(LY,{value:r.some(e=>e.name===o)?o:null,onValueChange:e=>{e!==o&&n(e)},children:[(0,X.jsx)(MY,{className:`px-2 text-label font-normal`,children:t}),r.map(e=>(0,X.jsxs)(RY,{value:e.name,closeOnClick:!0,className:Q(hX,`pr-8 whitespace-nowrap`),children:[e.label,(0,X.jsxs)(`span`,{className:`ml-auto pl-2 text-muted-foreground tabular-nums`,children:[e.width,` × `,e.height]})]},e.name))]})]},e))})]})}),(0,X.jsx)(`span`,{id:`inspector-frame-size`,className:`truncate text-muted-foreground`,children:s})]})}var r2={maximumFractionDigits:0};function i2({action:e}){return(0,X.jsx)(fX,{label:e.label,keys:e.keys,side:`bottom`,children:(0,X.jsx)(`button`,{type:`button`,"aria-label":e.label,disabled:!Se(e),onClick:e.run,className:`grid size-6 place-items-center rounded-[5px] text-muted-foreground outline-none hover:bg-sidebar hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 active:bg-sidebar disabled:pointer-events-none disabled:opacity-40`,children:(0,X.jsx)(mn,{"aria-hidden":!0,className:`size-[13px]`,strokeWidth:1.6})})})}function a2(e){let[t]=e;return t!==void 0&&e.every(e=>e===t)?t:null}function o2({colors:e,tokens:t,theme:n}){return e.length===0?null:(0,X.jsxs)(`section`,{"aria-labelledby":`inspector-selection-colors`,className:`border-b border-sidebar-border px-3 pt-2.5 pb-3`,children:[(0,X.jsx)(`h2`,{id:`inspector-selection-colors`,className:`mb-2 text-xs font-semibold`,children:`Selection colors`}),(0,X.jsx)(`ul`,{className:`flex flex-col gap-1.5`,children:e.map(e=>(0,X.jsxs)(`li`,{className:AW,children:[(0,X.jsx)(A1,{color:FW(e,t,n)}),e.token?(0,X.jsx)(`span`,{className:jW,children:IW(e.token)}):(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate tabular-nums`,children:e.value.replace(/^#/,``)}),(0,X.jsxs)(`span`,{className:`ml-auto text-muted-foreground tabular-nums`,children:[e.percent,`%`]}),e.token?(0,X.jsx)(Bn,{role:`img`,"aria-label":`Token`,className:`size-[13px] shrink-0 text-muted-foreground`}):(0,X.jsx)(j1,{})]},`${e.token??e.value}:${e.percent}`))})]})}function s2(){let e=EJ(),t=DJ(),n=Jg(e=>e.mode===`play`),r=Jg(e=>e.mode===`edit`&&e.tool===`frame`),i=Yg(),a=Rg(e=>e.listeners),o=Rg(e=>e.claims),s=UN(e=>e.page),c=UN(e=>e.frames),l=UN(e=>e.element??null),u=iN(Rg(e=>e.board?.projects.flatMap(e=>e.pages).find(e=>e.ref===s))?.frames.filter(e=>c.includes(e.ref))??[]),d=l&&u.length===1?l:null;return(0,X.jsxs)(`aside`,{"aria-label":`Inspector`,"data-inspector":!0,className:`flex h-full min-w-0 flex-col overflow-y-auto bg-sidebar text-body text-sidebar-foreground`,children:[(0,X.jsxs)(`div`,{className:`flex h-11 shrink-0 items-center justify-between border-b border-sidebar-border px-3`,children:[(0,X.jsxs)(`span`,{className:`flex items-center`,children:[(0,X.jsx)(TX,{name:e,source:t}),(0,X.jsx)(dZ,{listeners:a,claims:o})]}),(0,X.jsx)(MX,{})]}),i?(0,X.jsx)(`p`,{className:`border-b border-sidebar-border px-3 py-2.5 text-muted-foreground`,children:`View only. Run frameboard open to edit`}):null,r?(0,X.jsx)(p2,{}):s&&u.length>0?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(t2,{page:s,frames:u,named:!d}),u.length>1?(0,X.jsx)(mZ,{}):null,u.length===1&&!d&&u[0]?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(d2,{page:s,frame:u[0].ref}),(0,X.jsx)(gZ,{frame:u[0].ref})]}):null,d?(0,X.jsx)(u2,{page:s,element:d}):(0,X.jsx)(f2,{frames:u}),u.length===1&&!d&&u[0]?(0,X.jsx)(V0,{frame:u[0]},u[0].ref):null]}):(0,X.jsx)(`div`,{className:`px-3 pt-2.5 pb-3 text-muted-foreground`,children:n?(0,X.jsx)(`p`,{children:`Playing. Nothing selects while frames take the clicks.`}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`p`,{children:`Select a frame to see its details.`}),(0,X.jsx)(`p`,{className:`mt-4`,children:`Click a frame, or drag on the canvas to select several.`})]})})]})}var c2=`--shadow`;function l2(e){let t=lG(e.split(`/`)[0]??``)?.tokens??[];return{colors:t.filter(e=>e.group===`color`&&!e.name.startsWith(c2)),shadows:t.filter(e=>e.name.startsWith(c2)),fonts:t.filter(e=>e.group===`font`)}}function u2({page:e,element:t}){let n=Rg(e=>e.canWrite),r=MM(t.frame),i=xU(t),a=PU(t.frame,t.index,t.hash),{colors:o,shadows:s,fonts:c}=l2(t.frame);if(!i)return(0,X.jsx)(`p`,{className:`px-3 pt-2.5 pb-3 text-muted-foreground`,children:`The element’s details show once its frame is on screen.`});let l=!n,u=n=>aB(e,t,n),d=(e,n)=>LU(t,e,n),f=a?.element;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(y0,{placement:i.placement,disabled:l,write:u,preview:d,place:n=>HB(e,t,n,{inline:i.placement.inline})}),(0,X.jsx)(o0,{layout:i.layout,flow:f?.flow,textOnly:i.textOnly,disabled:l,write:u,preview:d}),(0,X.jsx)(KQ,{opacity:i.opacity,radius:i.radius,rotation:i.rotation,disabled:l,write:u,preview:d}),i.holdsText?(0,X.jsx)(P0,{fonts:c,fontFamily:i.fontFamily,fontToken:f?.fontFamily?.token??null,fontSize:i.fontSize,fontWeight:i.fontWeight,lineHeight:i.lineHeight,letterSpacing:i.letterSpacing,textAlign:i.textAlign,details:i,disabled:l,write:u,preview:d}):null,(0,X.jsx)(L1,{textOnly:i.textOnly,color:f?.color??null,backgroundColor:f?.backgroundColor??null,tokens:o,theme:r,inline:i.textOnly?i.inline.color:i.inline.backgroundColor,shorthand:!i.textOnly&&i.inline.background,disabled:l,write:u,preview:d,currentColor:i.color}),i.textOnly?(0,X.jsx)(iV,{text:i.text,disabled:l,write:u,element:t},`${t.frame}\n${t.index}`):null,(0,X.jsx)(C0,{bordered:i.bordered,borderColor:f?.borderColor??null,tokens:o,theme:r,inline:i.inline.border,disabled:l,write:u,preview:d,currentColor:i.color}),(0,X.jsx)(b0,{boxShadow:f?.boxShadow??null,shadows:s,theme:r,disabled:l,write:u}),(0,X.jsx)(o2,{colors:a?.colors??[],tokens:o,theme:r})]})}function d2({page:e,frame:t}){let n=Rg(e=>e.canWrite),r=MM(t),i=SU(t),a=xU(i),o=PU(t,i?.index,i?.hash??``),{colors:s}=l2(t);return!i||!a?null:(0,X.jsx)(L1,{textOnly:!1,color:null,backgroundColor:o?.element?.backgroundColor??null,tokens:s,theme:r,inline:a.inline.backgroundColor,shorthand:a.inline.background,disabled:!n,write:t=>aB(e,i,t),preview:(e,t)=>LU(i,e,t),currentColor:a.color})}function f2({frames:e}){let[t]=e,n=MM(t?.ref??``),{colors:r}=l2(t?.ref??``),i=e.map(e=>e.ref).join(`
69
- `),a=Rg(e=>i.split(`
70
- `).map(t=>e.reloads[t]??0).join(`:`)),[o,s]=(0,_.useState)(null);return(0,_.useEffect)(()=>{let e=!0;return Promise.all(i.split(`
71
- `).map(e=>FU(e).catch(()=>null))).then(t=>{if(!e)return;let n=new Map;for(let e of t.flatMap(e=>e?.colors??[])){let t=`${e.token??e.value.toLowerCase()}:${e.percent}`;n.has(t)||n.set(t,e)}s({refs:i,colors:[...n.values()]})}),()=>{e=!1}},[i,a]),(0,X.jsx)(o2,{colors:o?.refs===i?o.colors:[],tokens:r,theme:n})}function p2(){let e=nG();return(0,X.jsxs)(`section`,{"aria-labelledby":`inspector-presets`,className:`border-b border-sidebar-border px-3 pt-2.5 pb-3`,children:[(0,X.jsx)(`h2`,{id:`inspector-presets`,className:`mb-2 text-xs font-semibold`,children:`Frame`}),(0,X.jsx)(`div`,{className:`-mx-1.5 flex flex-col`,children:q0.map(({group:t,label:n,icon:r,rows:i})=>(0,X.jsxs)(`div`,{role:`radiogroup`,"aria-labelledby":`inspector-presets-${t}`,className:`flex flex-col`,children:[(0,X.jsx)(`h3`,{id:`inspector-presets-${t}`,className:`px-1.5 pt-1.5 pb-0.5 text-label text-muted-foreground`,children:n}),i.map(t=>(0,X.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":t.name===e,onClick:()=>rG(t.name),className:Q(`flex h-[26px] items-center gap-1.5 rounded-md px-1.5 text-left outline-none hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring/50`,t.name===e&&`bg-accent`),children:[(0,X.jsx)(r,{"aria-hidden":!0,className:`size-[13px] text-muted-foreground`,strokeWidth:1.6}),(0,X.jsx)(`span`,{className:`flex-1`,children:t.label}),(0,X.jsxs)(`span`,{className:Q(`tabular-nums`,t.name===e?`text-accent-foreground`:`text-muted-foreground`),children:[t.width,` × `,t.height]})]},t.name))]},t))}),(0,X.jsx)(`p`,{className:`mt-2 text-muted-foreground`,children:`Click on the canvas to place it.`})]})}var m2=W(`layout-row-glyph`,[[`rect`,{x:`4`,y:`5`,width:`4`,height:`14`,rx:`1`,key:`a`}],[`rect`,{x:`10`,y:`5`,width:`4`,height:`14`,rx:`1`,key:`b`}],[`rect`,{x:`16`,y:`5`,width:`4`,height:`9`,rx:`1`,key:`c`}]]),h2=W(`layout-column-glyph`,[[`rect`,{x:`5`,y:`4`,width:`14`,height:`4`,rx:`1`,key:`a`}],[`rect`,{x:`5`,y:`10`,width:`14`,height:`4`,rx:`1`,key:`b`}],[`rect`,{x:`5`,y:`16`,width:`9`,height:`4`,rx:`1`,key:`c`}]]),g2=W(`grid-glyph`,[[`rect`,{x:`4`,y:`4`,width:`7`,height:`7`,rx:`1`,key:`a`}],[`rect`,{x:`13`,y:`4`,width:`7`,height:`7`,rx:`1`,key:`b`}],[`rect`,{x:`4`,y:`13`,width:`7`,height:`7`,rx:`1`,key:`c`}],[`rect`,{x:`13`,y:`13`,width:`7`,height:`7`,rx:`1`,key:`d`}]]),_2=W(`block-glyph`,[[`rect`,{x:`5`,y:`7`,width:`14`,height:`10`,rx:`1`,key:`a`}]]),v2=W(`placed-glyph`,[[`path`,{d:`M4 8V4h4`,key:`a`}],[`rect`,{x:`8`,y:`8`,width:`12`,height:`10`,rx:`1`,key:`b`}]]),y2={row:m2,column:h2,grid:g2,block:_2};function b2(e){return e.textOnly?Oi:e.tag===`img`||e.tag===`video`?On:e.placed?v2:e.tag===`hr`?ir:e.round?Vt:y2[e.layout]}var x2=null;function S2(e,t){let[n=``,r=``]=e.split(`/`),i=Qg(n,r);if(x2?.(),x2=null,t(),C2(i)&&a_.attached()){w2();return}let a=a_.onAttach(()=>{a_.attached()&&(a(),x2=null,w2())});x2=a,ia(i)}function C2(e){return decodeURIComponent(location.pathname)===decodeURIComponent(e)}function w2(){we(`view.zoomToSelection`)?.run()}function T2(e,t,n=HN,r=cB){let i=`${e}/${t.page}`,{index:a,hash:o}=t;S2(i,()=>{let e=r(t.ref),s=e!==null&&e!==o&&!zN(t.ref,e);a===null||o===null||s?DN(n,i,[t.ref]):kN(n,i,{frame:t.ref,index:a,hash:o})})}function E2(e,t,n,r=O2){let[i,a]=(0,_.useState)(null),o=(0,_.useRef)(0),s=(0,_.useRef)(n);(0,_.useEffect)(()=>{s.current=n},[n]);let c=Rg(t=>D2(t.reloads,e)),l=t.trim()===``,u=`${c}\n${e}\n${t}`;if((0,_.useEffect)(()=>{let n=++o.current;if(l)return;let i=setTimeout(()=>{r(e,t).then(e=>{n===o.current&&a({key:u,status:`ready`,result:e,lead:s.current})},e=>{if(n!==o.current)return;let t=e instanceof Error?e.message:String(e);a({key:u,status:`refused`,message:t})})},120);return()=>clearTimeout(i)},[e,t,l,u,r]),l)return{status:`idle`};if(i?.status===`ready`){let{result:e,lead:t}=i;return{status:`ready`,result:e,lead:t,updating:i.key!==u}}return i?.status===`refused`&&i.key===u?i:{status:`loading`}}function D2(e,t){let n=0;for(let[r,i]of Object.entries(e))r.startsWith(`${t}/`)&&(n+=i);return n}async function O2(e,t,n=fetch){let r=await n(`/api/find?${new URLSearchParams({project:e,q:t})}`),i=await r.json().catch(()=>null);if(!i)throw Error(`The board answered ${r.status}.`);if(!i.ok)throw Error(i.error.message);return i.data}var k2=[{value:`all`,label:`All`},{value:`frame`,label:`Frames`},{value:`element`,label:`Elements`},{value:`text`,label:`Text`}],A2={frame:bn,element:_2,text:Oi},j2={frame:`frame`,element:`element`,text:`text`};function M2({project:e,page:t,load:n,pick:r=T2,trees:i=Uz}){let[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(`all`),[l,u]=(0,_.useState)(null),d=(0,_.useRef)(null),f=sZ(e=>e.focusRequest),p=E2(e,a,t,n),m=(0,_.useId)();(0,_.useEffect)(()=>{d.current?.focus(),d.current?.select()},[f]);let h=R2(p.status===`ready`?p.result.hits.filter(e=>s===`all`||e.kind===s):[],p.status===`ready`?p.lead:``),g=h.flatMap(e=>e.hits),v=g.find(e=>z2(e)===l)??g[0]??null,y=e=>`${m}-${z2(e)}`,b=t=>{u(z2(t)),r(e,t)};return(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col text-xs`,onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),lZ())},children:[(0,X.jsxs)(`div`,{className:`m-2 flex shrink-0 items-center gap-1.5`,children:[(0,X.jsxs)(`label`,{className:`flex h-7 min-w-0 flex-1 items-center gap-1.5 rounded-[7px] bg-muted px-2 focus-within:ring-[1.5px] focus-within:ring-primary`,children:[(0,X.jsx)(Jr,{"aria-hidden":!0,className:`size-3.5 shrink-0`}),(0,X.jsx)(`input`,{ref:d,role:`combobox`,"aria-label":`Find in ${e}`,"aria-expanded":g.length>0,"aria-controls":m,"aria-autocomplete":`list`,"aria-activedescendant":v?y(v):void 0,value:a,onChange:e=>o(e.target.value),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){if(e.preventDefault(),g.length===0)return;let t=v?g.indexOf(v):-1,n=e.key===`ArrowDown`?1:-1,r=g[(t+n+g.length)%g.length];r&&u(z2(r))}else e.key===`Enter`&&v&&(e.preventDefault(),b(v))},spellCheck:!1,autoComplete:`off`,className:`min-w-0 flex-1 bg-transparent text-xs text-foreground outline-none`})]}),(0,X.jsx)(`button`,{type:`button`,"aria-label":a===``?`Close find`:`Clear the search`,onClick:()=>{a===``?lZ():(o(``),d.current?.focus())},className:`grid size-[26px] shrink-0 place-items-center rounded-md text-muted-foreground outline-none hover:bg-accent hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 active:bg-accent`,children:(0,X.jsx)(Ii,{"aria-hidden":!0,className:`size-3.5`})})]}),(0,X.jsx)(`div`,{role:`group`,"aria-label":`Show`,className:`flex shrink-0 gap-1 px-2 pb-1.5`,children:k2.map(e=>(0,X.jsx)(`button`,{type:`button`,"aria-pressed":s===e.value,onClick:()=>c(e.value),className:Q(`flex h-[22px] items-center rounded-full px-2 text-[11px] outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,s===e.value?`bg-foreground text-sidebar`:`bg-muted text-muted-foreground hover:bg-accent hover:text-foreground`),children:e.label},e.value))}),(0,X.jsx)(`div`,{id:m,role:`listbox`,"aria-label":`Matches`,"aria-busy":p.status===`ready`&&p.updating,className:Q(`min-h-0 overflow-y-auto pb-1`,p.status===`ready`&&p.updating&&`opacity-60`),children:h.map(e=>(0,X.jsxs)(`div`,{role:`group`,"aria-labelledby":`${m}-${e.page}`,children:[(0,X.jsxs)(`div`,{className:`flex justify-between px-3 pt-2 pb-0.5 text-[11px] font-semibold text-muted-foreground`,children:[(0,X.jsx)(`span`,{id:`${m}-${e.page}`,children:e.page}),(0,X.jsx)(`span`,{children:e.hits.length})]}),e.hits.map(e=>(0,X.jsx)(N2,{id:y(e),hit:e,query:a,active:e===v,onPick:()=>b(e),trees:i},z2(e)))]},e.page))}),(0,X.jsx)(I2,{answer:p,project:e,shown:g.length,filter:s,onShowAll:()=>c(`all`)}),(0,X.jsx)(`p`,{className:`shrink-0 px-3 pt-2 pb-3 text-[11px] text-muted-foreground`,children:`Esc goes back to the layers`})]})}function N2({id:e,hit:t,query:n,active:r,onPick:i,trees:a}){let o=F2(t,a),s=t.kind===`text`?`Text in ${t.frame}`:(0,X.jsx)(L2,{text:t.name,query:n}),c=t.kind===`text`?(0,X.jsxs)(X.Fragment,{children:[`“`,(0,X.jsx)(L2,{text:t.snippet??``,query:n}),`”`]}):t.kind===`element`?`in ${t.frame}`:j2.frame;return(0,X.jsxs)(`div`,{id:e,role:`option`,"aria-selected":r,onMouseDown:e=>e.preventDefault(),onClick:i,className:Q(`mx-1.5 flex items-start gap-2 rounded-md px-2 py-[5px] text-foreground hover:bg-sidebar-accent`,r&&`bg-accent`),children:[(0,X.jsx)(P2,{icon:o?b2(o):A2[t.kind]}),(0,X.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,X.jsx)(`div`,{className:`truncate`,children:s}),(0,X.jsx)(`div`,{className:`truncate text-[11px] text-muted-foreground`,children:c})]})]})}function P2({icon:e}){return(0,X.jsx)(e,{"aria-hidden":!0,className:`mt-px size-[13px] shrink-0 text-muted-foreground`})}function F2(e,t){let n=e.kind===`frame`?null:e.ref,r=Rg(e=>n?e.reloads[n]??0:0);(0,_.useEffect)(()=>{n&&t.request(n,r)},[n,r,t]);let i=F(t.store,e=>n?e.byRef[n]:void 0);return i?.status!==`ready`||i.tree.hash!==e.hash?null:i.tree.elements.find(({index:t})=>t===e.index)??null}function I2({answer:e,project:t,shown:n,filter:r,onShowAll:i}){let a=`shrink-0 px-3 pt-2 text-[11px]`;if(e.status===`idle`)return(0,X.jsxs)(`p`,{className:Q(a,`text-muted-foreground`),children:[`Type to find frames, elements, and text across every page of `,t,`.`]});if(e.status===`loading`)return null;if(e.status===`refused`)return(0,X.jsx)(`p`,{role:`alert`,className:Q(a,`text-destructive`),children:e.message});let{hits:o,truncated:s,query:c}=e.result;return o.length===0?(0,X.jsxs)(`p`,{className:Q(a,`text-muted-foreground`),children:[`Nothing in `,t,` matches “`,c.trim(),`”.`]}):n===0&&r!==`all`?(0,X.jsxs)(`p`,{className:Q(a,`text-muted-foreground`),children:[s?`The first ${o.length} matches hold no ${j2[r]}. Type more to narrow them.`:`No ${j2[r]} matches.`,` `,(0,X.jsx)(`button`,{type:`button`,onClick:i,className:`text-foreground underline underline-offset-2 outline-none hover:text-primary focus-visible:ring-3 focus-visible:ring-ring/50`,children:`Show all`})]}):s?(0,X.jsxs)(`p`,{className:Q(a,`text-muted-foreground`),children:[`Showing the first `,o.length,` matches. Type more to narrow them.`]}):null}function L2({text:e,query:t}){let n=t.trim().toLowerCase(),r=n===``?-1:e.toLowerCase().indexOf(n);return r===-1?(0,X.jsx)(X.Fragment,{children:e}):(0,X.jsxs)(X.Fragment,{children:[e.slice(0,r),(0,X.jsx)(`mark`,{className:`rounded-[2px] bg-primary/35 text-foreground`,children:e.slice(r,r+n.length)}),e.slice(r+n.length)]})}function R2(e,t){let n=[];for(let t of e){let e=n.find(e=>e.page===t.page);e?e.hits.push(t):n.push({page:t.page,hits:[t]})}let r=n.findIndex(e=>e.page===t);return r>0&&n.unshift(...n.splice(r,1)),n}function z2(e){return`${e.kind}:${e.ref}:${e.index??``}`}function B2(e){let t=(0,_.useRef)(!1);return{onKeyDown:e=>{if(!(e.key===`ContextMenu`||e.key===`F10`&&e.shiftKey))return;e.preventDefault(),e.stopPropagation(),t.current=!0;let n=e.currentTarget.getBoundingClientRect();e.currentTarget.dispatchEvent(new MouseEvent(`contextmenu`,{bubbles:!0,cancelable:!0,clientX:n.left+n.width/2,clientY:n.top+n.height/2}))},onOpenChangeComplete:n=>{n&&t.current&&(t.current=!1,e.current?.querySelector(`[role="menuitem"]:not([aria-disabled="true"])`)?.focus())}}}var V2=[`view.zoomToSelection`,`frame.duplicate`,`frame.hide`,`frame.lock`,`frame.delete`];function H2({frame:e,page:t,trigger:n}){let r=Ce(V2),[i,a,o,s,c]=UN(n=>n.page===t&&!n.element&&n.frames.includes(e.ref))?r:r.map(()=>void 0),l=Rg(e=>e.canWrite),u=(0,_.useRef)(null),d=B2(u);return(0,X.jsxs)(Pq,{onOpenChange:n=>{if(!n||e.hidden||qg.getState().mode!==`edit`)return;let{page:r,frames:i,element:a}=HN.getState();(a||r!==t||!i.includes(e.ref))&&DN(HN,t,[e.ref])},onOpenChangeComplete:d.onOpenChangeComplete,children:[(0,X.jsx)(Fq,{render:n,onKeyDown:d.onKeyDown}),(0,X.jsxs)(Iq,{ref:u,className:`w-55`,children:[(0,X.jsxs)(Lq,{children:[(0,X.jsx)(Wq,{children:`Frame in layers`}),(0,X.jsx)(Hq,{action:i,children:`Zoom to frame`}),(0,X.jsx)(Hq,{action:{id:`layers.rename`,label:`Rename`,group:`frame`,enabled:()=>l&&qg.getState().mode===`edit`,run:()=>JH(e.ref,`layers`)}}),(0,X.jsx)(Hq,{action:a,children:`Duplicate`}),(0,X.jsx)(Hq,{action:o,children:`Hide`}),(0,X.jsx)(Hq,{action:s,children:s?.checked?.()?`Unlock`:`Lock`})]}),(0,X.jsx)(Bq,{}),(0,X.jsx)(Uq,{action:c})]})]})}var U2=[`section.delete`];function W2({section:e,page:t,trigger:n}){let[r]=Ce(U2),i=Rg(e=>e.canWrite),a=(0,_.useRef)(null),o=B2(a);return(0,X.jsxs)(Pq,{onOpenChange:n=>{n&&qg.getState().mode===`edit`&&ON(HN,t,e.name)},onOpenChangeComplete:o.onOpenChangeComplete,children:[(0,X.jsx)(Fq,{render:n,onKeyDown:o.onKeyDown}),(0,X.jsxs)(Iq,{ref:a,className:`w-55`,children:[(0,X.jsxs)(Lq,{children:[(0,X.jsx)(Wq,{children:`Section`}),(0,X.jsx)(Hq,{action:{id:`layers.renameSection`,label:`Rename`,group:`section`,enabled:()=>i&&qg.getState().mode===`edit`,run:()=>JW(e.name)}})]}),(0,X.jsx)(Bq,{}),(0,X.jsx)(Uq,{action:r})]})]})}function G2({page:e,element:t,trigger:n}){let r=(0,_.useRef)(null),i=B2(r);return(0,X.jsxs)(Pq,{onOpenChange:n=>{n&&kN(HN,e,t)},onOpenChangeComplete:i.onOpenChangeComplete,children:[(0,X.jsx)(Fq,{render:n,onKeyDown:i.onKeyDown}),(0,X.jsx)(Iq,{ref:r,className:`w-[230px]`,children:(0,X.jsx)(Qq,{noteable:!1})})]})}function K2({edge:e}){return e===null?null:(0,X.jsx)(`span`,{"aria-hidden":!0,className:Q(`pointer-events-none absolute right-1.5 left-5 z-10 h-0.5 rounded-[1px] bg-primary`,`before:absolute before:-top-[3px] before:-left-[5px] before:size-2 before:rounded-full before:border-2 before:border-primary before:bg-sidebar before:content-['']`,e===`top`?`-top-px`:`-bottom-px`)})}function q2(e){return e[J2]??null}var J2=Symbol(`closestEdge`);function Y2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function X2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Y2(Object(n),!0).forEach(function(t){SA(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Y2(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Z2={top:function(e,t){return Math.abs(t.y-e.top)},right:function(e,t){return Math.abs(e.right-t.x)},bottom:function(e,t){return Math.abs(e.bottom-t.y)},left:function(e,t){return Math.abs(t.x-e.left)}};function Q2(e,t){var n=t.element,r=t.input,i=t.allowedEdges,a={x:r.clientX,y:r.clientY},o=n.getBoundingClientRect(),s=i.map(function(e){return{edge:e,value:Z2[e](o,a)}}).sort(function(e,t){return e.value-t.value})[0]?.edge??null;return X2(X2({},e),{},SA({},J2,s))}function $2(e){var t=e.startIndex,n=e.closestEdgeOfTarget,r=e.indexOfTarget,i=e.axis;if(t===-1||r===-1||t===r)return t;if(n==null)return r;var a=i===`vertical`&&n===`bottom`||i===`horizontal`&&n===`right`;return t<r?a?r:r-1:a?r+1:r}function e4(e,t){return e.list===t&&typeof e.index==`number`}function t4(e,{list:t,index:n,enabled:r}){let[i,a]=(0,_.useState)(null);return(0,_.useEffect)(()=>{let i=e.current;if(!i||!r)return;let o={list:t,index:n};return fj(Rj({element:i,getInitialData:()=>o}),Ij({element:i,canDrop:({source:e})=>e4(e.data,t),getData:({input:e})=>Q2(o,{element:i,input:e,allowedEdges:[`top`,`bottom`]}),onDrag:({self:e,source:t})=>{let r=q2(e.data),i=t.data.index,o=i===n||r===`top`&&i===n-1||r===`bottom`&&i===n+1;a(o?null:r)},onDragLeave:()=>a(null),onDrop:()=>a(null)}))},[e,t,n,r]),i}function n4(e,t){(0,_.useEffect)(()=>Lj({canMonitor:({source:t})=>typeof e==`string`?e4(t.data,e):typeof t.data.list==`string`&&e(t.data.list)&&e4(t.data,t.data.list),onDrop:({source:e,location:n})=>{let r=n.current.dropTargets[0],i=e.data.list;if(!r||!e4(r.data,i))return;let a=e.data.index,o=$2({startIndex:a,indexOfTarget:r.data.index,closestEdgeOfTarget:q2(r.data),axis:`vertical`});o!==a&&t(a,o,i)}}),[e,t])}var r4=14,i4=8;function a4(e,t){return`elements\n${e}\n${t??``}`}function o4({frame:e,page:t,selected:n,frameSelected:r,isOpen:i,toggle:a}){let o=Gz(e.ref),s=Rg(e=>e.canWrite),[c,l]=(0,_.useState)(null),u=o?.status===`ready`?o.tree:null,d=a4(e.ref,null).slice(0,-1);if(n4((0,_.useCallback)(e=>e.startsWith(d),[d]),(0,_.useCallback)((n,r,i)=>{let a=u?.elements.filter(t=>a4(e.ref,t.parent)===i)[n];u&&a&&FB(t,{frame:e.ref,index:a.index,hash:u.hash},()=>r)},[u,e.ref,t])),!o||o.status===`loading`)return(0,X.jsx)(l4,{depth:1,children:`Reading elements`});if(o.status===`refused`)return(0,X.jsx)(l4,{depth:1,title:o.message,children:`This frame cannot be addressed`});let f=d4(o.tree.elements,i);if(f.length===0)return(0,X.jsx)(l4,{depth:1,children:`No elements`});let p=new Set(o.tree.elements.map(e=>e.parent)),m=u4(o.tree.elements);return(0,X.jsx)(`ul`,{"aria-label":`Elements of ${e.name}`,children:f.map(({element:u,depth:d})=>(0,X.jsx)(s4,{page:t,element:u,elementKey:{frame:e.ref,index:u.index,hash:o.tree.hash},depth:d,place:m.get(u.index)??0,list:a4(e.ref,u.parent),open:i(u.index),holds:p.has(u.index),toggle:()=>a(u.index),tint:u.index===n?`bg-primary/26`:r?`bg-primary/13`:n===null?`hover:bg-accent`:`bg-primary/7`,isSelected:u.index===n,canWrite:s,renaming:c===u.index,setRenaming:e=>l(e?u.index:null)},u.index))})}function s4({page:e,element:t,elementKey:n,depth:r,place:i,list:a,open:o,holds:s,toggle:c,tint:l,isSelected:u,canWrite:d,renaming:f,setRenaming:p}){let m=(0,_.useRef)(null),h=t4(m,{list:a,index:i,enabled:d&&!f}),g=(0,X.jsx)(c4,{icon:b2(t),selected:u});return(0,X.jsx)(G2,{page:e,element:n,trigger:(0,X.jsxs)(`li`,{ref:m,className:Q(`relative flex h-[26px] items-center gap-1.5 pr-2 text-foreground`,l),style:{paddingLeft:i4+r*r4},children:[(0,X.jsx)(K2,{edge:h}),s?(0,X.jsx)(`button`,{type:`button`,"aria-label":`${o?`Hide`:`Show`} what ${t.name} holds`,"aria-expanded":o,onClick:c,className:`-mr-1.5 -ml-[7px] grid size-6 shrink-0 place-items-center text-muted-foreground outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50`,children:o?(0,X.jsx)(jt,{"aria-hidden":!0,className:`size-2.5`}):(0,X.jsx)(Nt,{"aria-hidden":!0,className:`size-2.5`})}):(0,X.jsx)(`span`,{"aria-hidden":!0,className:`w-2.5 shrink-0`}),f?(0,X.jsxs)(X.Fragment,{children:[g,(0,X.jsx)(uV,{hug:!0,name:t.name,label:`Rename ${t.name}`,onCommit:t=>{p(!1),aB(e,n,{kind:`attribute`,name:`data-name`,value:t})},onCancel:()=>p(!1)})]}):(0,X.jsxs)(`button`,{type:`button`,"aria-current":u?`true`:void 0,onClick:()=>kN(HN,e,n),onDoubleClick:()=>{d&&p(!0)},onKeyDown:e=>{e.key===`F2`&&d&&(e.preventDefault(),e.stopPropagation(),p(!0))},className:`flex min-w-0 flex-1 items-center gap-1.5 self-stretch text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset`,children:[g,(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,title:t.name,children:t.name})]})]})})}function c4({icon:e,selected:t}){return(0,X.jsx)(e,{"aria-hidden":!0,className:Q(`size-[13px] shrink-0`,t?`text-primary`:`text-muted-foreground`)})}function l4({depth:e,title:t,children:n}){return(0,X.jsx)(`p`,{title:t,className:`flex h-[26px] items-center truncate pr-2 text-muted-foreground`,style:{paddingLeft:i4+e*r4+16},children:n})}function u4(e){let t=new Map,n=new Map;for(let r of e){let e=t.get(r.parent)??0;n.set(r.index,e),t.set(r.parent,e+1)}return n}function d4(e,t){let n=new Map,r=[];for(let i of e){if(i.parent===null){n.set(i.index,1),r.push({element:i,depth:1});continue}let e=n.get(i.parent);e!==void 0&&t(i.parent)&&(n.set(i.index,e+1),r.push({element:i,depth:e+1}))}return r}function f4({id:e,title:t,children:n}){return(0,X.jsxs)(`div`,{className:`flex h-[29px] items-center justify-between px-3 pt-1 text-label text-muted-foreground`,children:[(0,X.jsx)(`h2`,{id:e,children:t}),n]})}function p4({section:e,page:t,open:n,onToggle:r,selected:i,canWrite:a,calls:o,children:s}){let c=qW()===e.name,l=e.frames.length,u=(0,X.jsx)(vr,{"aria-hidden":!0,className:`size-[13px] shrink-0 text-muted-foreground`});return(0,X.jsxs)(`li`,{"aria-label":`Section ${e.name}`,className:`flex flex-col`,children:[(0,X.jsx)(`div`,{className:`mx-1.5 overflow-hidden rounded-md`,children:(0,X.jsx)(W2,{section:e,page:t,trigger:(0,X.jsxs)(`div`,{className:Q(`group flex h-[26px] items-center gap-1.5 pr-1 pl-2 text-foreground`,i?`bg-primary/26`:`hover:bg-accent`),children:[(0,X.jsx)(`button`,{type:`button`,"aria-label":`${n?`Hide`:`Show`} the frames of ${e.name}`,"aria-expanded":n,onClick:r,className:`-mr-1.5 -ml-[7px] grid size-6 shrink-0 place-items-center text-muted-foreground outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50`,children:n?(0,X.jsx)(jt,{"aria-hidden":!0,className:`size-2.5`}):(0,X.jsx)(Nt,{"aria-hidden":!0,className:`size-2.5`})}),c?(0,X.jsxs)(X.Fragment,{children:[u,(0,X.jsx)(`span`,{className:`flex min-w-0 flex-1`,children:(0,X.jsx)(uV,{hug:!0,name:e.name,label:`Rename section ${e.name}`,onCommit:n=>{YW(),n!==e.name&&o.renameSection(t,e.name,n).then(e=>ON(HN,t,e.name)).catch(Ck(`Couldn't rename ${e.name}`))},onCancel:YW})})]}):(0,X.jsxs)(`button`,{type:`button`,"aria-label":`Select section ${e.name}`,onClick:()=>{qg.getState().mode===`edit`&&(ON(HN,t,e.name),a_.reveal(e.box))},onDoubleClick:()=>{a&&JW(e.name)},onKeyDown:t=>{t.key===`F2`&&a&&(t.preventDefault(),t.stopPropagation(),JW(e.name))},className:`flex h-full min-w-0 flex-1 items-center gap-1.5 rounded-[5px] text-left outline-none focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:ring-inset`,children:[u,(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium`,children:e.name}),(0,X.jsx)(`span`,{"aria-label":`${l} frame${l===1?``:`s`}`,className:`shrink-0 pr-1.5 text-[color-mix(in_srgb,var(--muted-foreground)_70%,var(--foreground))] tabular-nums`,children:l})]})]})})}),n&&l>0?(0,X.jsx)(`ul`,{"aria-label":`Frames of ${e.name}`,className:`flex flex-col pl-3.5`,children:s}):null]})}var m4=`layers`,h4=`layers:section:`,g4=e=>e===m4||e.startsWith(h4),_4=[];function v4({frames:e,sections:t=_4,calls:n=gk}){let[r,i]=(0,_.useState)(new Set),[a,o]=(0,_.useState)(new Set),s=UN(e=>e.page),c=UN(e=>e.section),l=UN(e=>e.frames),u=UN(e=>e.element??null),d=Rg(e=>e.canWrite);k4(i);let f=O4(e,t);n4(g4,(0,_.useCallback)((r,i,a)=>{let o=O4(e,t).find(e=>e.list===a),s=o?.rows[r];if(!o||!s)return;let c=o.rows.filter(e=>e.ref!==s.ref),l=e.filter(e=>e.ref!==s.ref),u=c[i],d=c[i-1],f=u?l.findIndex(e=>e.ref===u.ref)+1:d?l.findIndex(e=>e.ref===d.ref):0;n.orderFrame(s.ref,f).catch(Ck(`Couldn't move ${s.name}`))},[e,t,n]));let p=e=>r.has(e),m=e=>i(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n}),h=(e,t,r)=>{let i=p(e.ref),a=u?.frame===e.ref,o=!a&&s===E4(e)&&l.includes(e.ref);return(0,X.jsx)(w4,{frame:e,index:t,list:r,canWrite:d,calls:n,tint:o?`bg-primary/26`:a?`bg-primary/7`:void 0,chevron:(0,X.jsx)(`button`,{type:`button`,"aria-label":`${i?`Hide`:`Show`} the elements of ${e.name}`,"aria-expanded":i,onClick:()=>m(e.ref),className:`-mr-1.5 -ml-[7px] grid size-6 shrink-0 place-items-center text-muted-foreground outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50`,children:i?(0,X.jsx)(jt,{"aria-hidden":!0,className:`size-2.5`}):(0,X.jsx)(Nt,{"aria-hidden":!0,className:`size-2.5`})}),children:i?(0,X.jsx)(o4,{frame:e,page:E4(e),selected:a?u?.index??null:null,frameSelected:o,isOpen:t=>p(T4(e.ref,t)),toggle:t=>m(T4(e.ref,t))}):null},e.ref)};return(0,X.jsxs)(`section`,{"aria-labelledby":`layers-heading`,className:`flex min-h-0 flex-col`,children:[(0,X.jsx)(f4,{id:`layers-heading`,title:`Layers`,children:(0,X.jsx)(`button`,{type:`button`,"aria-label":`Collapse all layers`,title:`Collapse all layers`,onClick:()=>{i(new Set),o(new Set(t.map(e=>e.name)))},className:`group/target grid size-6 place-items-center text-muted-foreground outline-none hover:text-foreground`,children:(0,X.jsx)(`span`,{className:`grid size-5 place-items-center rounded-md group-hover/target:bg-accent group-focus-visible/target:ring-3 group-focus-visible/target:ring-ring/50`,children:(0,X.jsx)(Hn,{"aria-hidden":!0,className:`size-[15px]`})})})}),e.length===0?(0,X.jsx)(`p`,{className:`px-3.5 py-1 text-muted-foreground`,children:`No frames on this page`}):(0,X.jsx)(`ul`,{className:`flex min-h-0 flex-col overflow-y-auto pb-1`,children:f.map(t=>{let r=t.rows.map((e,n)=>h(e,n,t.list));if(!t.section)return r;let{section:i}=t,s=t.rows.some(e=>l.includes(e.ref)||u?.frame===e.ref);return(0,X.jsx)(p4,{section:i,page:D4(e),open:!a.has(i.name)||s,onToggle:()=>o(e=>{let t=new Set(e);return t.delete(i.name)||t.add(i.name),t}),selected:c===i.name,canWrite:d,calls:n,children:r},`${h4}${i.name}`)})})]})}var y4=`group/target grid size-6 shrink-0 place-items-center outline-none hover:text-foreground disabled:pointer-events-none`,b4=`text-[color-mix(in_srgb,var(--muted-foreground)_70%,var(--foreground))]`,x4=`grid size-5 place-items-center rounded-[5px] group-hover/target:bg-accent group-focus-visible/target:ring-2 group-focus-visible/target:ring-ring/50`,S4=`opacity-0 group-hover:opacity-100 group-focus-within:opacity-100`,C4={hidden:[`show`,`hide`],locked:[`unlock`,`lock`]};function w4({frame:e,index:t,list:n,canWrite:r,calls:i,tint:a,chevron:o,children:s}){let c=(0,_.useRef)(null),l=qH(`layers`)===e.ref,u=Rg(t=>t.claims[e.ref]),d=M_(t=>e.ref in t.unseen),f=t4(c,{list:n,index:t,enabled:r&&!l}),p=t=>{if(e.hidden||qg.getState().mode!==`edit`)return;t.shiftKey?AN(HN,E4(e),e.ref):DN(HN,E4(e),[e.ref]);let[n]=cN([e]);n&&HN.getState().frames.includes(e.ref)&&a_.reveal(n.box)},m=(t,n)=>i.flagFrames([e.ref],t,n).catch(Ck(`Couldn't ${C4[t][+!!n]} ${e.name}`)),h=(0,X.jsx)(bn,{"aria-hidden":!0,className:Q(`size-[13px] shrink-0`,e.hidden?b4:`text-muted-foreground`)});return(0,X.jsxs)(`li`,{ref:c,"aria-label":e.hidden?`${e.name}, hidden`:e.name,className:`relative mx-1.5`,children:[(0,X.jsx)(K2,{edge:f}),(0,X.jsxs)(`div`,{className:`flex flex-col overflow-hidden rounded-md`,children:[(0,X.jsx)(H2,{frame:e,page:E4(e),trigger:(0,X.jsxs)(`div`,{className:Q(`group flex h-[26px] items-center gap-1.5 pr-1 pl-2 text-foreground`,e.hidden&&b4,a??`hover:bg-accent`),children:[o,l?(0,X.jsxs)(X.Fragment,{children:[h,(0,X.jsx)(`span`,{className:`flex min-w-0 flex-1`,children:(0,X.jsx)(uV,{hug:!0,name:e.name,label:`Rename frame ${e.name}`,onCommit:t=>{YH(),XH(e,t,i)},onCancel:YH})})]}):(0,X.jsxs)(`button`,{type:`button`,"aria-label":`Select ${e.name}`,onClick:p,onDoubleClick:()=>{r&&JH(e.ref,`layers`)},onKeyDown:t=>{t.key===`F2`&&r&&(t.preventDefault(),t.stopPropagation(),JH(e.ref,`layers`))},className:`flex h-full min-w-0 flex-1 items-center gap-1.5 rounded-[5px] text-left outline-none focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:ring-inset`,children:[h,(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name})]}),u?(0,X.jsx)(`span`,{role:`img`,"aria-label":`${u.tag} is editing`,className:`ml-auto size-[7px] shrink-0 rounded-full bg-claim shadow-[0_0_0_3px_color-mix(in_srgb,var(--claim)_25%,transparent)]`}):d?(0,X.jsx)(PH,{}):null,(0,X.jsx)(`button`,{type:`button`,"aria-label":`${e.hidden?`Show`:`Hide`} ${e.name}`,"aria-pressed":e.hidden,disabled:!r,onClick:()=>void m(`hidden`,!e.hidden),className:Q(y4,e.hidden?b4:Q(`text-muted-foreground`,S4)),children:(0,X.jsx)(`span`,{className:x4,children:e.hidden?(0,X.jsx)(on,{"aria-hidden":!0,className:`size-[13px]`}):(0,X.jsx)(cn,{"aria-hidden":!0,className:`size-[13px]`})})}),(0,X.jsx)(`button`,{type:`button`,"aria-label":`${e.locked?`Unlock`:`Lock`} ${e.name}`,"aria-pressed":e.locked,disabled:!r,onClick:()=>void m(`locked`,!e.locked),className:Q(y4,`text-muted-foreground`,!e.locked&&S4),children:(0,X.jsx)(`span`,{className:x4,children:e.locked?(0,X.jsx)(Qn,{"aria-hidden":!0,className:`size-[13px]`}):(0,X.jsx)(Xn,{"aria-hidden":!0,className:`size-[13px]`})})})]})}),s]})]})}function T4(e,t){return`${e}#${t}`}function E4(e){return`${e.project}/${e.page}`}function D4(e){let[t]=e;return t?E4(t):``}function O4(e,t){let n=[...e].reverse(),r=new Set(t.flatMap(e=>e.frames));return[...[...t].reverse().map(e=>({list:`${h4}${e.name}`,section:e,rows:n.filter(t=>e.frames.includes(t.name))})),{list:m4,rows:n.filter(e=>!r.has(e.name))}]}function k4(e){(0,_.useEffect)(()=>{let t=null,n=()=>{let n=t;if(!n)return;let r=Wz(n.frame),i=[n.frame];if(r){t=null;for(let e=Xz(r.elements,n.index);typeof e==`number`;e=Xz(r.elements,e))i.push(T4(n.frame,e))}e(e=>i.every(t=>e.has(t))?e:new Set([...e,...i]))},r=HN.subscribe((e,r)=>{e.element&&e.element!==r.element&&(t=e.element,n())}),i=Uz.store.subscribe(n);return()=>{i(),r()}},[e])}function A4({count:e,className:t}){return e===0?null:(0,X.jsx)(`span`,{role:`img`,"aria-label":`${e} unseen ${e===1?`change`:`changes`}`,"data-unseen-count":!0,className:Q(`shrink-0 text-[11px] font-semibold text-claim`,t),children:e})}var j4=[`page.rename`,`page.duplicate`,`page.new`,`page.moveUp`,`page.moveDown`,`page.delete`];function M4({onOpen:e,trigger:t}){let[n,r,i,a,o,s]=Ce(j4),c=(0,_.useRef)(null),l=B2(c);return(0,X.jsxs)(Pq,{onOpenChange:t=>{t&&e()},onOpenChangeComplete:l.onOpenChangeComplete,children:[(0,X.jsx)(Fq,{render:t,onKeyDown:l.onKeyDown}),(0,X.jsxs)(Iq,{ref:c,children:[(0,X.jsxs)(Lq,{children:[(0,X.jsx)(Wq,{children:`Page`}),(0,X.jsx)(Hq,{action:n,children:`Rename`}),(0,X.jsx)(Hq,{action:r,children:`Duplicate`}),(0,X.jsx)(Hq,{action:i,children:`New page below`})]}),(0,X.jsx)(Bq,{}),(0,X.jsxs)(Lq,{children:[(0,X.jsx)(Hq,{action:a,children:`Move up`}),(0,X.jsx)(Hq,{action:o,children:`Move down`})]}),(0,X.jsx)(Bq,{}),(0,X.jsx)(Uq,{action:s})]})]})}var N4=`pages`,P4=`group/target grid size-6 place-items-center text-muted-foreground outline-none hover:text-foreground aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-pressed:text-foreground`,F4=`grid size-5 place-items-center rounded-md group-hover/target:bg-accent group-focus-visible/target:ring-3 group-focus-visible/target:ring-ring/50 group-aria-disabled/target:bg-transparent group-aria-pressed/target:bg-accent`;function I4({pages:e,current:t,calls:n=gk}){let[,r]=ya(),i={current:t,navigate:r,calls:n},[a]=Ce([`page.new`]),o=a?Se(a):!1,s=Rg(e=>e.canWrite),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(``),f=u.trim().toLowerCase(),p=f?e.filter(e=>e.name.toLowerCase().includes(f)):e;n4(N4,(0,_.useCallback)((t,r)=>{let i=e[t];i&&n.movePage(i.ref,r).catch(Ck(`Couldn't move ${i.name}`))},[e,n]));let m=()=>{l(!1),d(``)};return(0,X.jsxs)(`nav`,{"aria-labelledby":`pages-heading`,className:`flex h-full min-h-0 flex-col`,children:[(0,X.jsx)(f4,{id:`pages-heading`,title:`Pages`,children:(0,X.jsxs)(`span`,{className:`flex gap-0.5`,children:[(0,X.jsx)(fX,{label:`Search pages`,children:(0,X.jsx)(`button`,{type:`button`,"aria-label":`Search pages`,"aria-pressed":c,onClick:()=>c?m():l(!0),className:P4,children:(0,X.jsx)(`span`,{className:F4,children:(0,X.jsx)(Jr,{"aria-hidden":!0,className:`size-[13px]`})})})}),(0,X.jsx)(fX,{label:a?.label??`Add page`,keys:a?.keys,children:(0,X.jsx)(`button`,{type:`button`,"aria-label":a?.label??`Add page`,"aria-disabled":!o||void 0,onClick:()=>{a&&o&&a.run()},className:P4,children:(0,X.jsx)(`span`,{className:F4,children:(0,X.jsx)(Ar,{"aria-hidden":!0,className:`size-[13px]`})})})})]})}),c?(0,X.jsxs)(`div`,{className:`mx-2 mb-1.5 flex h-[26px] shrink-0 items-center gap-1.5 rounded-md bg-muted px-2 ring-[1.5px] ring-primary`,children:[(0,X.jsx)(Jr,{"aria-hidden":!0,className:`size-[13px] shrink-0 text-muted-foreground`}),(0,X.jsx)(`input`,{autoFocus:!0,"aria-label":`Search pages`,value:u,spellCheck:!1,onChange:e=>d(e.target.value),onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),m())},className:`min-w-0 flex-1 bg-transparent text-foreground outline-none`}),(0,X.jsx)(`span`,{"aria-hidden":!0,className:`text-muted-foreground`,children:`Esc`})]}):null,p.length===0&&f?(0,X.jsxs)(`p`,{className:`px-3.5 py-1 text-muted-foreground`,children:[`No page names match `,u.trim()]}):(0,X.jsx)(`ul`,{className:`flex min-h-0 flex-col mt-[3px] overflow-y-auto pt-1 pb-0.5`,children:p.map(t=>(0,X.jsx)(R4,{page:t,pages:e,context:i,needle:f,canWrite:s},t.ref))})]})}var L4=`mx-1.5 flex h-[26px] items-center gap-1.5 rounded-md pr-2 pl-2 text-foreground`;function R4({page:e,pages:t,context:n,needle:r,canWrite:i}){let{current:a}=n,o=(0,_.useRef)(null),s=e.name===a;(0,_.useEffect)(()=>{s&&o.current?.scrollIntoView({block:`nearest`})},[s]);let c=bk()===e.ref,l=M_(t=>w_(t.unseen,e.ref)),u=t4(o,{list:N4,index:e.index,enabled:i&&!r&&!c});return(0,X.jsxs)(`li`,{ref:o,className:`relative`,children:[(0,X.jsx)(K2,{edge:u}),c?(0,X.jsx)(`div`,{className:Q(L4,e.name===a&&`bg-accent`),children:(0,X.jsx)(uV,{hug:!0,name:e.name,label:`Rename page ${e.name}`,onCommit:t=>{Sk(),Tk(e,t,n)},onCancel:Sk})}):(0,X.jsx)(M4,{onOpen:()=>{e.name!==a&&n.navigate(Qg(e.project,e.name))},trigger:(0,X.jsxs)(Ea,{href:Qg(e.project,e.name),"aria-current":e.name===a?`page`:void 0,draggable:!1,onDoubleClick:()=>{i&&xk(e.ref)},onKeyDown:r=>{if(i){if(r.key===`F2`)xk(e.ref);else if(r.key===`Delete`||r.key===`Backspace`)Ek(e,t,n);else return;r.preventDefault(),r.stopPropagation()}},className:Q(L4,`outline-none hover:bg-accent focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset aria-[current=page]:bg-accent`),children:[(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,title:e.name,children:(0,X.jsx)(z4,{name:e.name,needle:r})}),(0,X.jsx)(A4,{count:l}),e.layoutError?(0,X.jsx)(Si,{role:`img`,"aria-label":`Layout does not read`,className:`size-3.5 shrink-0 text-note`,children:(0,X.jsx)(`title`,{children:`Layout does not read`})}):null]})})]})}function z4({name:e,needle:t}){let n=t?e.toLowerCase().indexOf(t):-1;return n<0?e:(0,X.jsxs)(X.Fragment,{children:[e.slice(0,n),(0,X.jsx)(`mark`,{className:`rounded-[2px] bg-primary/30 text-inherit`,children:e.slice(n,n+t.length)}),e.slice(n+t.length)]})}function B4(e){return`frameboard.board.pages.${e}`}var V4=26,H4=12,U4=64;function W4(e){return 36+e*V4+H4}var G4=`h-6 rounded-[5px] border-0 text-xs font-medium text-muted-foreground data-active:bg-card data-active:text-foreground data-active:shadow-none data-active:ring-1 data-active:ring-border dark:data-active:bg-card`;function K4({project:e,page:t,theme:n,assets:r,storage:i,calls:a}){let o=sZ(e=>e.open),s=B4(e.name),c=Xb({id:s,onlySaveAfterUserInteractions:!0,storage:i}),l=tx(),u=(0,_.useRef)(!1),d=W4(Math.min(Math.max(e.pages.length,4),8)),[f,p]=(0,_.useState)(`design`),m=!o&&f===`design`,h=(0,_.useRef)({project:e.name,pages:e.pages.length});(0,_.useEffect)(()=>{if(!m)return;let t=requestAnimationFrame(()=>{let t=l.current;if(!t)return;let n=h.current;h.current={project:e.name,pages:e.pages.length},n.project!==e.name||e.pages.length<=n.pages||t.getSize().inPixels>d-1||(u.current=!0,t.resize(d))});return()=>cancelAnimationFrame(t)},[m,e.name,e.pages.length,d,l]);let g=e.pages.find(e=>e.name===t),v=g?.frames??[];return(0,X.jsxs)(`aside`,{"aria-label":`Pages and layers`,className:`flex h-full min-w-0 flex-col bg-sidebar text-sidebar-foreground`,children:[(0,X.jsx)(bX,{project:e,page:t,calls:a}),o?(0,X.jsx)(M2,{project:e.name,page:t}):(0,X.jsxs)(t1,{value:f,onValueChange:e=>p(String(e)),className:`min-h-0 flex-1 gap-0`,children:[(0,X.jsxs)(r1,{className:`m-2 h-7 w-auto shrink-0 rounded-[7px] p-0.5`,children:[(0,X.jsx)(i1,{value:`design`,className:G4,children:`Design`}),(0,X.jsx)(i1,{value:`theme`,disabled:!n,className:G4,children:`Theme`}),(0,X.jsx)(i1,{value:`assets`,disabled:!r,className:G4,children:`Assets`})]}),(0,X.jsx)(a1,{value:`design`,className:`flex min-h-0 flex-col text-xs`,children:(0,X.jsxs)(ax,{id:s,orientation:`vertical`,defaultLayout:c.defaultLayout,onLayoutChanged:(e,t)=>{c.onLayoutChanged(e,u.current?{...t,isUserInteraction:!0}:t),u.current=!1},children:[(0,X.jsx)(ox,{id:`pages`,panelRef:l,defaultSize:d,minSize:U4,children:(0,X.jsx)(I4,{pages:e.pages,current:t,calls:a})}),(0,X.jsx)(sx,{"aria-label":`Resize the pages list`,disableDoubleClick:!0,onDoubleClick:()=>{let e=l.current;!e||Math.abs(e.getSize().inPixels-d)<1||(u.current=!0,e.resize(d))},className:`group cursor-row-resize aria-[orientation=horizontal]:h-[9px] border-t border-sidebar-border bg-transparent after:hidden focus-visible:ring-0 data-[separator=active]:border-t-2 data-[separator=active]:border-faint focus-visible:border-t-2 focus-visible:border-primary`,children:(0,X.jsx)(`span`,{"aria-hidden":!0,className:`h-[3px] w-7 rounded-[2px] bg-faint group-data-[separator=active]:bg-muted-foreground group-focus-visible:bg-primary`})}),(0,X.jsx)(ox,{id:`layers`,minSize:U4,children:(0,X.jsx)(v4,{frames:v,sections:g?.sections,calls:a})})]},s)}),(0,X.jsx)(a1,{value:`theme`,className:`min-h-0 text-xs`,children:n}),(0,X.jsx)(a1,{value:`assets`,className:`min-h-0 text-xs`,children:r})]})]})}var q4=[`color`,`radius`,`font`,`other`],J4=xO({name:VD(),group:OO(q4),light:VD().nullable(),dark:VD().nullable(),sheet:VD(),overrides:pO()});xO({sheets:yO(xO({path:VD(),kind:OO([`board`,`project`]),error:VD().nullable(),hash:VD()})),tokens:yO(J4)});var Y4=`mx-1.5 grid h-7 items-center gap-1.5 rounded-md px-1.5`;function X4({row:e,fromProject:t,editable:n,onWrite:r}){let i=(0,_.useRef)(null);return(0,X.jsxs)(`li`,{ref:i,className:Q(Y4,`grid-cols-[1fr_18px_18px]`),children:[(0,X.jsx)($4,{row:e,fromProject:t,editable:n,onWrite:r}),[`light`,`dark`].map(t=>n?(0,X.jsx)(i3,{name:e.name,side:t,value:e[t],row:i,onWrite:r},t):(0,X.jsx)(t3,{side:t,value:e[t]},t))]})}function Z4({row:e,fromProject:t,editable:n,onWrite:r}){let i=e.light??e.dark??``,a=Q4.exec(i.trim());return(0,X.jsxs)(`li`,{className:Q(Y4,`grid-cols-[1fr_auto]`),children:[(0,X.jsx)($4,{row:e,fromProject:t,editable:n,onWrite:r}),n?a?(0,X.jsx)(a3,{name:e.name,value:Number(a[1]),unit:a[2]??``,onWrite:r}):(0,X.jsx)(o3,{name:e.name,value:i,shown:s3(e),onWrite:r}):(0,X.jsx)(`span`,{className:`max-w-32 truncate text-muted-foreground`,title:s3(e),children:s3(e)})]})}var Q4=/^(-?\d*\.?\d+)([a-z%]*)$/i;function $4({row:e,fromProject:t,editable:n,onWrite:r}){return(0,X.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,X.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,title:e.name,children:[(0,X.jsx)(`span`,{className:`text-faint`,children:`--`}),e.name.replace(/^--/,``)]}),(0,X.jsx)(`span`,{className:Q(`shrink-0 rounded-[3px] border px-1 text-[9px] leading-[14px]`,t?`border-primary text-foreground`:`border-border text-muted-foreground`),children:t?`Project`:`Board`}),n&&e.overrides?(0,X.jsx)(`button`,{type:`button`,"aria-label":`Reset ${e.name.replace(/^--/,``)} to the board value`,title:`Reset to the board value`,onClick:()=>void r({name:e.name,reset:!0}),className:`-ml-1 grid size-6 shrink-0 place-items-center rounded-sm text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50`,children:(0,X.jsx)(Ir,{"aria-hidden":!0,className:`size-3`})}):null]})}var e3={light:`Light`,dark:`Dark`};function t3({side:e,value:t}){return t===null?(0,X.jsx)(`span`,{role:`img`,"aria-label":`${e3[e]}: not set`,title:`Not set in ${e}`,className:`size-4 rounded-[4px] border border-dashed border-faint`}):(0,X.jsx)(`span`,{role:`img`,"aria-label":`${e3[e]}: ${t}`,title:t,className:Q(`size-4 rounded-[4px]`,MW),style:{background:t}})}var n3={hsv:{h:0,s:0,v:0},percent:100};function r3({hsv:e,percent:t}){return NW({raw:`#${d1(h1(e)).toLowerCase()}`},t)}function i3({name:e,side:t,value:n,row:r,onWrite:i}){let a=(0,_.useRef)(null),[o,s]=(0,_.useState)(null),c=e3[t],l=o?r3(o.color):n,u=()=>{let e=n&&a.current?p1(n,a.current):null,t=e?{hsv:e,percent:100}:n3;s({from:t,color:t})},d=n=>{if(!o)return;s(null);let r=r3(o.color);n&&r!==r3(o.from)&&i({name:e,side:t,value:r})};return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`button`,{ref:a,type:`button`,"aria-label":`${c}: ${n??`not set`}`,title:n??`Not set in ${t}`,onClick:u,className:`-m-[3px] grid size-6 place-items-center rounded-md outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,children:(0,X.jsx)(`span`,{"aria-hidden":!0,className:Q(`size-4 rounded-[4px]`,l===null?`border border-dashed border-faint`:MW),style:l===null?void 0:{background:l}})}),(0,X.jsx)(hH,{open:o!==null,onOpenChange:(e,t)=>{e||d(t.reason!==`escape-key`)},children:(0,X.jsx)(_H,{anchor:r,side:`right`,align:`start`,sideOffset:16,"aria-label":`${e.replace(/^--/,``)} ${t} color`,className:`w-[248px] gap-0 rounded-xl p-2.5 text-xs shadow-[0_14px_40px_rgba(0,0,0,.28)]`,children:o?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`p`,{className:`mb-2 text-xs font-semibold`,children:c}),(0,X.jsx)(T1,{label:c,color:o.color,onColor:e=>s({...o,color:e}),onSubmit:()=>d(!0),tab:`custom`,onTab:()=>{},tokens:[],theme:t,token:null,onToken:()=>{},tokensTab:!1})]}):null})})]})}function a3({name:e,value:t,unit:n,onWrite:r}){return(0,X.jsxs)(`span`,{className:`flex items-center text-muted-foreground`,children:[(0,X.jsx)(NQ,{label:`${e.replace(/^--/,``)} value`,className:`w-12`,inputClassName:`h-5 rounded-sm px-1 text-right text-muted-foreground focus-visible:text-foreground`,value:t,min:t>=0?0:void 0,format:{maximumFractionDigits:3},disabled:!1,scrubValue:!0,onCommit:i=>r({name:e,side:`both`,value:`${i(t)}${n}`})}),n]})}function o3({name:e,value:t,shown:n,onWrite:r}){let[i,a]=(0,_.useState)(null),o=(0,_.useRef)(!1),s=(0,_.useRef)(!1),c=`${e.replace(/^--/,``)} value`,l=(n,c)=>{if(i===null||s.current)return;s.current=!0,o.current=c,a(null);let l=i.trim();n&&l!==``&&l!==t.trim()&&r({name:e,side:`both`,value:l})};return i===null?(0,X.jsx)(`button`,{ref:e=>{e&&o.current&&(o.current=!1,e.focus())},type:`button`,"aria-label":`${c}: ${t}`,title:t,onClick:()=>{s.current=!1,a(t)},className:`max-w-32 truncate rounded-sm px-1 text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50`,children:n}):(0,X.jsx)(`input`,{"aria-label":c,autoFocus:!0,value:i,spellCheck:!1,onFocus:e=>e.currentTarget.select(),onChange:e=>a(e.currentTarget.value),onBlur:()=>l(!0,!1),onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),l(!0,!0)):e.key===`Escape`&&(e.preventDefault(),l(!1,!0))},className:`h-5 w-32 rounded-sm bg-input px-1 text-right outline-none focus-visible:ring-2 focus-visible:ring-ring/50`})}function s3(e){let t=e.light??e.dark??``;return e.group===`font`?t.split(`,`)[0]?.trim().replace(/^["']|["']$/g,``)??t:t}async function c3(e,t,n,{send:r=fetch,notify:i=e=>tg.add({...e,type:`error`})}={}){try{return await lx(`/api/tokens/edit`,{project:e,hash:t,...n},`POST`,r)}catch(e){return i({title:`Couldn't change ${n.name.replace(/^--/,``)}`,description:e instanceof cx&&e.code===`stale-tokens`?`The token sheet changed since the tab read it. Try again on the value it shows now.`:e instanceof Error?e.message:String(e)}),null}}var l3={color:`Color`,radius:`Radius`,font:`Font`,other:`Other`},u3=`font-mono text-label font-normal text-foreground`;function d3({project:e,load:t=uG,write:n=c3}){let r=lG(e,t),i=Rg(e=>e.canWrite),a=(0,_.useRef)(Promise.resolve()),o=(0,_.useRef)(null);if(r===void 0)return null;if(r===null)return(0,X.jsx)(`p`,{className:`m-3 text-muted-foreground`,children:`The tokens did not load. Reload the board to try again.`});if(r.sheets.length===0)return(0,X.jsx)(f3,{});let s=r.sheets.find(e=>e.kind===`board`),c=r.sheets.find(e=>e.kind===`project`),l=i&&(c?.error??null)===null,u=c?.hash??null,d=t=>{let r=a.current.then(async()=>{let r=o.current,i=await n(e,r&&r.over===u?r.hash:u,t);return i&&(o.current={over:u,hash:i.hash}),i!==null});return a.current=r,r};return(0,X.jsxs)(`div`,{className:`flex flex-col pb-2`,children:[(0,X.jsxs)(`p`,{className:`mx-3 mt-1 mb-2 rounded-lg bg-muted px-2.5 py-2 leading-[1.45] text-muted-foreground`,children:[`From`,` `,s?(0,X.jsxs)(X.Fragment,{children:[`board `,(0,X.jsx)(`code`,{className:u3,children:s.path}),c?`, overridden by `:null]}):null,c?(0,X.jsxs)(X.Fragment,{children:[`project `,(0,X.jsx)(`code`,{className:u3,children:c.path})]}):null,`.`,l?` Click a value to edit it.`:null]}),r.sheets.filter(e=>e.error!==null).map(e=>(0,X.jsxs)(`p`,{role:`alert`,className:`mx-3 mb-2 leading-[1.45] text-destructive`,children:[(0,X.jsx)(`code`,{className:u3,children:e.path}),` does not parse, so its tokens are missing here: `,e.error,`. Fix the file or ask the agent.`]},e.path)),r.tokens.length===0?(0,X.jsx)(`p`,{className:`mx-3 text-muted-foreground`,children:`These sheets set no tokens under :root, [data-theme], or .dark.`}):null,q4.map(e=>{let t=r.tokens.filter(t=>t.group===e);if(t.length===0)return null;let n=e===`color`?X4:Z4;return(0,X.jsxs)(`section`,{"aria-labelledby":`tokens-${e}`,children:[(0,X.jsx)(`h3`,{id:`tokens-${e}`,className:`px-3 pt-2.5 pb-1 text-label text-muted-foreground`,children:l3[e]}),e===`color`?(0,X.jsx)(p3,{}):null,(0,X.jsx)(`ul`,{children:t.map(e=>(0,X.jsx)(n,{row:e,fromProject:e.sheet===c?.path,editable:l,onWrite:d},e.name))})]},e)})]})}function f3(){return(0,X.jsxs)(`div`,{className:`m-3 rounded-[10px] border border-dashed border-border p-4 leading-normal text-muted-foreground`,children:[(0,X.jsx)(`p`,{className:`mb-1 font-semibold text-foreground`,children:`No tokens yet`}),`Frames render unstyled until a token sheet exists. Add one at`,` `,(0,X.jsx)(`code`,{className:u3,children:`tokens.css`}),` in this project, or in the board folder for every project.`]})}function p3(){return(0,X.jsxs)(`div`,{"aria-hidden":!0,className:`grid grid-cols-[1fr_18px_18px] gap-1.5 px-3 py-1 text-center text-[10px] text-muted-foreground`,children:[(0,X.jsx)(`span`,{}),(0,X.jsx)(`span`,{children:`L`}),(0,X.jsx)(`span`,{children:`D`})]})}function m3(e=HN){let t=()=>e.getState().frames;return[...K0.map(({preset:e,label:n,icon:r})=>{let{width:i}=LW[e],a=`Preview at ${n.toLowerCase()} width`;return{id:`preview.${e}`,label:a,group:`preview`,command:{label:a,icon:r,hint:()=>`${i}`},enabled:()=>t().length>0,checked:()=>t().length>0&&t().every(e=>VM(e)?.width===i),run:()=>WM(t(),i)}}),{id:`preview.end`,label:`End preview`,group:`preview`,command:{label:`End preview`,icon:fr},enabled:()=>t().some(e=>VM(e)!==void 0),run:()=>GM(t())}]}function h3(){(0,_.useEffect)(()=>{let e=xe(m3()),t=[HN.subscribe(U),UM(U),XM(Lg)];return()=>{for(let e of t)e();e()}},[])}var g3={defaultSize:240,minSize:200,maxSize:400},_3=[],v3=[],y3=`frameboard.board.panels`;function b3({project:e,page:t}){let n=Rg(t=>t.board?.projects.find(t=>t.name===e)),r=Rg(e=>e.reloads),i=Rg(e=>e.findings),a=Rg(e=>e.claims),o=Rg(e=>e.focus),s=(0,_.useCallback)(()=>Lg.setState({focus:null}),[]),c=Jg(e=>e.hideUi),l=Jg(e=>e.mode===`play`),u=Xb({id:y3,panelIds:c?[`canvas`]:[`left`,`canvas`,`right`],onlySaveAfterUserInteractions:!0,storage:S3}),d=n?.pages.find(e=>e.name===t),f=Rg(e=>d?gg(e.aliases,d.ref):``),[,p]=ya();(0,_.useEffect)(()=>{if(t!==void 0)return Lg.subscribe((n,r)=>{let i=Cg(r,n,`${e}/${t}`);if(i===null)return;let[a=``,o=``]=i.split(`/`);p(Qg(a,o),{replace:!0})})},[e,t,p]);let m=(0,_.useCallback)(()=>e,[e]),h=(0,_.useCallback)(()=>p(`/`),[p]);if(Zk(m,{onDeleted:h}),Yk(h),Xk(gk,h),JN(),Dk(e,t),QH(d?.ref??``,d?.frames??_3),cG(),eG(d?.ref??``,d?.frames??_3,d?.sections??v3),av(),DH(),L_(),uZ(),h3(),!n)return(0,X.jsx)(x3,{message:`No project ${e} on this board.`});let g=n.pages[0];return t===void 0&&g?(0,X.jsx)(ka,{to:Qg(e,g.name),replace:!0}):(0,X.jsxs)(ax,{id:`board`,className:`text-body`,defaultLayout:u.defaultLayout,onLayoutChanged:u.onLayoutChanged,children:[c?null:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(ox,{id:`left`,...g3,groupResizeBehavior:`preserve-pixel-size`,children:(0,X.jsx)(K4,{project:n,page:t??``,theme:(0,X.jsx)(d3,{project:n.name}),assets:(0,X.jsx)(sM,{project:n.name},n.name),storage:S3})}),(0,X.jsx)(sx,{"aria-label":`Resize the left panel`})]}),(0,X.jsx)(ox,{id:`canvas`,children:(0,X.jsxs)(`main`,{className:`relative size-full min-w-0`,children:[d?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(xY,{page:d,reloads:r,findings:i,claims:a,focus:o,onFocused:s},f),(0,X.jsx)(QX,{project:n.name}),(0,X.jsx)(dv,{})]}):(0,X.jsx)(x3,{message:g?`No page ${t} in ${e}.`:`${e} has no pages yet. An agent adds one with frameboard page add <name>.`}),l?(0,X.jsx)(VX,{frames:d?.frames??_3}):null,c?(0,X.jsx)(PX,{project:n,page:t??``}):null]})}),c?null:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(sx,{"aria-label":`Resize the inspector`}),(0,X.jsx)(ox,{id:`right`,...g3,groupResizeBehavior:`preserve-pixel-size`,children:(0,X.jsx)(s2,{})})]})]})}function x3({message:e}){return(0,X.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3 p-6 text-center`,children:[(0,X.jsx)(`p`,{className:`text-body text-muted-foreground`,children:e}),(0,X.jsx)(Ea,{href:`/`,className:$h({variant:`outline`}),children:`Go home`})]})}var S3={getItem:e=>{try{return localStorage.getItem(e)}catch{return null}},setItem:(e,t)=>{try{localStorage.setItem(e,t)}catch{}}},C3=[`home.layoutGrid`,`home.layoutList`,`project.new`,`theme.toggle`];function w3({hasProjects:e}){let[t,n,r,i]=Ce(C3);return(0,X.jsxs)(`header`,{className:`flex h-14 shrink-0 items-center gap-3 border-b border-border bg-card px-4 sm:px-6`,children:[(0,X.jsxs)(`span`,{className:`flex flex-1 items-center gap-2 text-base font-semibold`,children:[(0,X.jsx)(O3,{}),`Frameboard`]}),e?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{role:`group`,"aria-label":`Layout`,className:`flex rounded-lg bg-muted p-0.5`,children:[(0,X.jsx)(E3,{action:t,label:`Grid`,children:(0,X.jsx)(Pn,{"aria-hidden":!0,className:`size-3.5`})}),(0,X.jsx)(E3,{action:n,label:`List`,children:(0,X.jsx)(Wn,{"aria-hidden":!0,className:`size-3.5`})})]}),(0,X.jsx)(T3,{action:r,compact:!0})]}):null,(0,X.jsxs)(`button`,{type:`button`,"aria-label":i?.label??`Theme`,title:i?.label??`Theme`,...D3(i),className:`grid size-[26px] place-items-center rounded-md text-muted-foreground outline-none hover:bg-accent hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-disabled:hover:bg-transparent`,children:[(0,X.jsx)(oi,{"aria-hidden":!0,className:`size-[15px] dark:hidden`}),(0,X.jsx)(cr,{"aria-hidden":!0,className:`hidden size-[15px] dark:block`})]})]})}function T3({action:e,className:t,compact:n=!1}){return(0,X.jsxs)(`button`,{type:`button`,"aria-label":`New project`,...D3(e),className:Q(`flex h-[30px] items-center gap-1.5 rounded-lg bg-primary px-3 font-medium text-primary-foreground outline-none hover:bg-primary/90 focus-visible:ring-3 focus-visible:ring-ring/50 aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-disabled:hover:bg-primary`,t),children:[(0,X.jsx)(Ar,{"aria-hidden":!0,className:`size-3.5`}),(0,X.jsx)(`span`,{className:Q(`whitespace-nowrap`,n&&`hidden sm:inline`),children:`New project`})]})}function E3({action:e,label:t,children:n}){let r=e?.checked?.()??!1;return(0,X.jsx)(`button`,{type:`button`,"aria-label":t,title:t,"aria-pressed":r,...D3(e),className:Q(`grid h-[26px] w-7 place-items-center rounded-md text-muted-foreground outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50`,r&&`bg-card text-foreground ring-1 ring-border`),children:n})}function D3(e){let t=e?Se(e):!1;return{"aria-disabled":!t||void 0,onClick:()=>{e&&t&&e.run()}}}function O3(){return(0,X.jsxs)(`svg`,{"aria-hidden":!0,viewBox:`0 0 64 64`,className:`size-6 -translate-y-[1.5px]`,children:[(0,X.jsx)(`rect`,{x:`4`,y:`12`,width:`48`,height:`48`,rx:`12`,className:`fill-primary`}),(0,X.jsx)(`rect`,{x:`34`,y:`4`,width:`26`,height:`26`,rx:`7`,strokeWidth:`4`,className:`fill-foreground stroke-card`})]})}function k3(){let[e]=Ce([`project.new`]);return(0,X.jsx)(`div`,{className:`relative flex-1`,children:(0,X.jsxs)(`div`,{className:`absolute top-1/2 left-1/2 w-105 max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-[55%] text-center leading-[1.6] text-muted-foreground`,children:[(0,X.jsx)(`div`,{"aria-hidden":!0,className:`mx-auto mb-3.5 h-12 w-16 rounded-lg border-[1.5px] border-dashed border-faint`}),(0,X.jsx)(`h1`,{className:`mb-1 text-sm font-semibold text-foreground`,children:`No projects yet`}),(0,X.jsx)(`p`,{children:`A project holds the pages and frames for one thing you are designing.`}),(0,X.jsx)(T3,{action:e,className:`mx-auto mt-3.5 mb-2.5`}),(0,X.jsxs)(`p`,{children:[`or from a terminal`,` `,(0,X.jsx)(`code`,{className:`rounded-[5px] bg-muted px-1.5 py-0.5 font-mono text-label font-normal text-foreground`,children:`frameboard project add <name>`})]})]})})}var A3=`frameboard.home.layout`;function j3(){let[e,t]=(0,_.useState)(M3),n=(0,_.useRef)(e);return(0,_.useEffect)(()=>{let e=e=>{n.current=e,t(e),N3(e),U()};return xe([{id:`home.layoutGrid`,label:`Grid`,group:`home`,command:{label:`Show projects as a grid`,icon:Pn},run:()=>e(`grid`),checked:()=>n.current===`grid`},{id:`home.layoutList`,label:`List`,group:`home`,command:{label:`Show projects as a list`,icon:Wn},run:()=>e(`list`),checked:()=>n.current===`list`}])},[]),e}function M3(){try{return localStorage.getItem(A3)===`list`?`list`:`grid`}catch{return`grid`}}function N3(e){try{localStorage.setItem(A3,e)}catch{}}var P3=[`project.open`,`project.rename`,`project.duplicate`,`project.pin`,`project.delete`];function F3({project:e,trigger:t}){let[n,r,i,a,o]=Ce(P3),s=(0,_.useRef)(null),c=B2(s);return(0,X.jsxs)(Pq,{onOpenChange:t=>{t&&Uk(e)},onOpenChangeComplete:c.onOpenChangeComplete,children:[(0,X.jsx)(Fq,{render:t,onKeyDown:c.onKeyDown}),(0,X.jsxs)(Iq,{ref:s,children:[(0,X.jsxs)(Lq,{children:[(0,X.jsx)(Rq,{children:`Project`}),(0,X.jsx)(I3,{action:n,keyHint:`↵`,keyName:`Enter`,children:`Open`}),(0,X.jsx)(I3,{action:r,children:`Rename`}),(0,X.jsx)(I3,{action:i,children:`Duplicate`}),(0,X.jsx)(I3,{action:a,children:a?.checked?.()?`Unpin`:`Pin`})]}),(0,X.jsx)(Bq,{}),(0,X.jsx)(I3,{action:o,keyHint:`⌫`,keyName:`Delete`,variant:`destructive`,children:`Delete`})]})]})}function I3({action:e,children:t,keyHint:n,keyName:r,variant:i}){return(0,X.jsxs)(zq,{variant:i,disabled:!e||!Se(e),"aria-keyshortcuts":r,onClick:()=>e?.run(),children:[t,n?(0,X.jsx)(Vq,{"aria-hidden":!0,children:n}):null]})}function L3(e){for(let t of e.pages){let e=t.frames.filter(e=>!e.hidden);if(e.length>0)return e}return[]}function R3({project:e,captures:t,className:n}){let r=L3(e);if(r.length===0)return null;let i=r.map(e=>e.box),a=Math.min(...i.map(e=>e.x)),o=Math.min(...i.map(e=>e.y)),s=Math.max(...i.map(e=>e.x+e.width)),c=Math.max(...i.map(e=>e.y+e.height));return(0,X.jsx)(`svg`,{"aria-hidden":!0,"data-skeleton":!0,viewBox:`${a} ${o} ${s-a} ${c-o}`,preserveAspectRatio:`xMidYMin meet`,className:n,children:r.map(({ref:e,box:n})=>{let r=t?.stamps[e];return(0,X.jsxs)(`g`,{children:[(0,X.jsx)(`rect`,{x:n.x,y:n.y,width:n.width,height:n.height,className:`fill-white stroke-black/6`,strokeWidth:1,vectorEffect:`non-scaling-stroke`}),t&&r?(0,X.jsx)(`image`,{href:z3(e,t.theme,r),x:n.x,y:n.y,width:n.width,height:n.height,preserveAspectRatio:`none`}):null]},e)})})}function z3(e,t,n){return`/api/thumbnails/png?${new URLSearchParams({ref:e,theme:t,v:n})}`}var B3=[`home.sortEdited`,`home.sortCreated`,`home.sortName`],V3=[`home.sortReverse`],H3={dates:[`Newest first`,`Oldest first`],name:[`A to Z`,`Z to A`]},U3=`h-7 px-2 py-0 text-xs`;function W3(){let e=Ce(B3).filter(e=>e!==void 0),[t]=Ce(V3),n=e.find(e=>e.checked?.()),r=t?.checked?.()??!1,[i,a]=n?.id===`home.sortName`?H3.name:H3.dates;return(0,X.jsxs)(OY,{children:[(0,X.jsxs)(kY,{className:`flex h-7 items-center gap-1.5 rounded-lg pr-2 pl-2.5 font-medium text-foreground outline-none hover:bg-accent focus-visible:ring-3 focus-visible:ring-ring/50 data-popup-open:bg-muted`,children:[(0,X.jsx)(_t,{"aria-hidden":!0,className:`size-3.5 text-muted-foreground`}),`Sort: `,n?.label??`Last edited`,(0,X.jsx)(jt,{"aria-hidden":!0,className:`size-3 text-muted-foreground`})]}),(0,X.jsxs)(pX,{align:`end`,className:`w-45`,children:[(0,X.jsxs)(jY,{children:[(0,X.jsx)(MY,{className:`px-2 pt-1.5 pb-1 text-[11px] font-semibold text-muted-foreground`,children:`Sort by`}),(0,X.jsx)(LY,{value:n?.id??``,children:e.map(e=>(0,X.jsx)(RY,{value:e.id,closeOnClick:!0,onClick:()=>e.run(),className:U3,children:e.label},e.id))})]}),t?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(zY,{}),(0,X.jsx)(LY,{value:r?a:i,children:[i,a].map(e=>(0,X.jsx)(RY,{value:e,closeOnClick:!0,onClick:()=>{e===a!==r&&t.run()},className:U3,children:e},e))})]}):null]})]})}function G3({projects:e,layout:t,now:n,calls:r}){let i=M_(e=>e.unseen),a=jM(),o={theme:a,stamps:Rg(e=>e.thumbnails[a])},s=F(Vk,e=>e.focused),c=kk(),l=e.some(e=>e.name===s)?s:e[0]?.name,u=e.findIndex(e=>!c.has(e.name)),d=u>0?u:-1;return(0,X.jsxs)(`main`,{className:`px-4 py-8 sm:px-12`,children:[(0,X.jsxs)(`div`,{className:`mb-5 flex items-center justify-between gap-3`,children:[(0,X.jsx)(`h1`,{className:`text-title`,children:`Projects`}),(0,X.jsx)(W3,{})]}),t===`grid`?(0,X.jsx)(`ul`,{onKeyDown:e=>K3(e,`grid`),className:`grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-5`,children:e.map((e,t)=>(0,X.jsxs)(_.Fragment,{children:[t===d?(0,X.jsx)(`li`,{"aria-hidden":!0,"data-pin-divider":!0,className:`col-span-full h-px bg-border`}):null,(0,X.jsx)(`li`,{children:(0,X.jsxs)(Z3,{project:e,tabbable:e.name===l,className:`block overflow-hidden rounded-xl border border-border bg-card text-card-foreground outline-none hover:ring-2 hover:ring-primary focus-visible:ring-2 focus-visible:ring-primary data-popup-open:ring-2 data-popup-open:ring-primary`,children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:`m-1.5 block h-[150px] overflow-hidden rounded-lg bg-background p-3.5`,children:(0,X.jsx)(R3,{project:e,captures:o,className:`size-full`})}),(0,X.jsxs)(`span`,{className:`flex flex-col px-3 pt-1.5 pb-3`,children:[(0,X.jsx)($3,{project:e,calls:r,type:`text-panel`,unseen:w_(i,e.name),pinned:c.has(e.name)}),(0,X.jsx)(t6,{project:e,now:n,prefix:`Edited `})]})]})})]},e.name))}):(0,X.jsxs)(`div`,{className:`overflow-hidden rounded-xl border border-border bg-card text-card-foreground`,children:[(0,X.jsxs)(`div`,{"aria-hidden":!0,className:`grid h-9 grid-cols-[48px_1fr] sm:grid-cols-[48px_1fr_160px_160px] items-center border-b border-border px-4 text-label text-muted-foreground`,children:[(0,X.jsx)(`span`,{}),(0,X.jsx)(`span`,{children:`Name`}),(0,X.jsx)(`span`,{className:`hidden sm:block`,children:`Edited`}),(0,X.jsx)(`span`,{className:`hidden sm:block`,children:`Created`})]}),(0,X.jsx)(`ul`,{onKeyDown:e=>K3(e,`list`),children:e.map((e,t)=>(0,X.jsxs)(_.Fragment,{children:[t===d?(0,X.jsx)(`li`,{"aria-hidden":!0,"data-pin-divider":!0,className:`h-1.5 border-b border-border bg-muted`}):null,(0,X.jsx)(`li`,{className:`not-last:border-b`,children:(0,X.jsxs)(Z3,{project:e,tabbable:e.name===l,className:`grid h-12 grid-cols-[48px_1fr] sm:grid-cols-[48px_1fr_160px_160px] items-center px-4 outline-none hover:bg-accent focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset data-popup-open:ring-2 data-popup-open:ring-primary data-popup-open:ring-inset`,children:[(0,X.jsx)(e6,{project:e}),(0,X.jsx)($3,{project:e,calls:r,type:`font-medium`,unseen:w_(i,e.name),pinned:c.has(e.name),className:`pr-4`}),(0,X.jsx)(`span`,{className:`hidden truncate sm:block`,children:(0,X.jsx)(t6,{project:e,now:n,prefix:``})}),(0,X.jsx)(`span`,{className:`hidden sm:block`,children:(0,X.jsx)(n6,{project:e})})]})})]},e.name))})]})]})}function K3(e,t){let n=e.target;if(!(n instanceof HTMLElement)||!n.matches(X3))return;let r=[...e.currentTarget.querySelectorAll(X3)],i=r.indexOf(n),a=t===`grid`,o=q3(e),s={ArrowLeft:a?i-1:i,ArrowRight:a?i+1:i,ArrowUp:a?Y3(r,i,-1):i-1,ArrowDown:a?Y3(r,i,1):i+1,Home:0,End:r.length-1}[o];s!==void 0&&(e.preventDefault(),r[Math.min(Math.max(s,0),r.length-1)]?.focus())}function q3(e){let t=e.ctrlKey||e.metaKey||e.altKey,n=J3[e.key];return n&&!t&&pe()?n:e.key}var J3={h:`ArrowLeft`,j:`ArrowDown`,k:`ArrowUp`,l:`ArrowRight`};function Y3(e,t,n){let r=e.map(e=>e.getBoundingClientRect()),i=r[t];if(!i)return t;let a=r.map(e=>e.top).filter(e=>(e-i.top)*n>0);if(a.length===0)return t;let o=n>0?Math.min(...a):Math.max(...a),s=t;return r.forEach((e,n)=>{if(e.top!==o)return;let a=r[s];(s===t||a&&Math.abs(e.left-i.left)<Math.abs(a.left-i.left))&&(s=n)}),s}var X3=`[data-project-link]`;function Z3({project:e,tabbable:t,className:n,children:r}){return Hk(e.name)===null?(0,X.jsx)(F3,{project:e.name,trigger:(0,X.jsx)(Ea,{href:Kk(e),"data-project-link":!0,tabIndex:t?0:-1,onFocus:()=>Uk(e.name),onKeyDown:t=>{let n=Q3[t.key];if(!n)return;Uk(e.name);let r=we(n);r&&Se(r)&&r.run(),t.preventDefault()},className:n,children:r})}):(0,X.jsx)(`div`,{className:n,children:r})}var Q3={F2:`project.rename`,Delete:`project.delete`,Backspace:`project.delete`};function $3({project:e,calls:t,type:n,unseen:r,pinned:i,className:a}){let o=Hk(e.name);return o?(0,X.jsxs)(`span`,{className:Q(`flex min-w-0 flex-col`,n),children:[(0,X.jsx)(`span`,{className:`flex h-lh items-center pl-1.5`,children:(0,X.jsx)(uV,{name:o.draft,label:`Rename project ${e.name}`,onCommit:n=>void qk(e.name,n,t),onCancel:Gk},o.attempt)}),o.refusal?(0,X.jsx)(`span`,{role:`alert`,className:`mt-1 text-label font-normal text-destructive`,children:o.refusal}):null]}):(0,X.jsxs)(`span`,{className:Q(`flex min-w-0 items-center gap-1.5`,a),children:[(0,X.jsx)(`span`,{className:Q(`truncate`,n),title:e.name,children:e.name}),(0,X.jsxs)(`span`,{className:`ml-auto flex items-center gap-1.5`,children:[i?(0,X.jsx)(wr,{role:`img`,"aria-label":`Pinned`,className:`size-[13px] shrink-0 fill-current text-foreground`}):null,(0,X.jsx)(A4,{count:r})]})]})}function e6({project:e}){return(0,X.jsx)(`span`,{"aria-hidden":!0,className:`block h-[22px] w-8 overflow-hidden rounded bg-background p-[5px]`,children:(0,X.jsx)(R3,{project:e,className:`size-full`})})}function t6({project:e,now:t,prefix:n}){return(0,X.jsxs)(`span`,{"data-edited":!0,className:`truncate text-body text-muted-foreground`,title:new Date(e.modifiedAt).toLocaleString(),children:[n,i6(Date.parse(e.modifiedAt),t)]})}function n6({project:e}){if(!e.createdAt)return(0,X.jsx)(`span`,{});let t=new Date(e.createdAt);return(0,X.jsx)(`time`,{dateTime:e.createdAt,className:`text-body text-muted-foreground`,title:t.toLocaleString(),children:a6(t)})}var r6=[[`year`,31536e3],[`month`,2592e3],[`week`,604800],[`day`,86400],[`hour`,3600],[`minute`,60]];function i6(e,t){let n=Math.max(0,(t-e)/1e3),r=new Intl.RelativeTimeFormat(`en`,{numeric:`auto`});for(let[e,t]of r6)if(n>=t)return r.format(-Math.floor(n/t),e);return`just now`}function a6(e){let t=e=>String(e).padStart(2,`0`);return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}`}var o6=`frameboard.home.sort`,s6=`frameboard.home.sortDirection`,c6=[`edited`,`created`,`name`],l6={edited:`desc`,created:`desc`,name:`asc`};function u6(){let[e,t]=(0,_.useState)(g6),n=(0,_.useRef)(e);return(0,_.useEffect)(()=>{let e=e=>{n.current=e,t(e),_6(e),U()},r=(t,r,i,a)=>({id:t,label:i,group:`home`,command:{label:`Sort projects by ${i.toLowerCase()}`,icon:a},run:()=>e({by:r,direction:l6[r]}),checked:()=>n.current.by===r});return xe([r(`home.sortEdited`,`edited`,`Last edited`,Gt),r(`home.sortCreated`,`created`,`Created`,xt),r(`home.sortName`,`name`,`Name`,Tt),{id:`home.sortReverse`,label:`Reverse`,group:`home`,command:{label:`Reverse project order`,icon:lt},run:()=>{let{by:t,direction:r}=n.current;e({by:t,direction:r===`asc`?`desc`:`asc`})},checked:()=>n.current.direction!==l6[n.current.by]}])},[]),e}function d6(e,t,n,r=l6[t]){let i=p6[t],a=r===`asc`?1:-1;return[...e].sort((e,r)=>Number(n.has(r.name))-Number(n.has(e.name))||(t===`created`?m6(e,r):0)||a*i(e,r)||f6(e,r))}var f6=(e,t)=>e.name.localeCompare(t.name,`en`,{sensitivity:`base`})||(e.name<t.name?-1:+(e.name>t.name)),p6={edited:(e,t)=>Date.parse(e.modifiedAt)-Date.parse(t.modifiedAt),created:(e,t)=>h6(e)-h6(t),name:f6},m6=(e,t)=>Number(e.createdAt===null)-Number(t.createdAt===null);function h6(e){return e.createdAt?Date.parse(e.createdAt):0}function g6(){try{let e=localStorage.getItem(o6),t=c6.find(t=>t===e)??`edited`,n=localStorage.getItem(s6);return{by:t,direction:n===`asc`||n===`desc`?n:l6[t]}}catch{return{by:`edited`,direction:l6.edited}}}function _6({by:e,direction:t}){try{localStorage.setItem(o6,e),localStorage.setItem(s6,t)}catch{}}var v6=100;function y6(e=fetch){let t=jM(),n=Rg(e=>e.connected),r=Rg(e=>e.board),i=Rg(e=>e.reloads),a=(0,_.useRef)(new Map);(0,_.useEffect)(()=>{a.current=new Map},[t,n]),(0,_.useEffect)(()=>{if(!n||!r)return;let o=new Map(r.projects.flatMap(e=>L3(e)).map(({ref:e,box:t})=>[e,`${t.width}x${t.height}#${i[e]??0}`]));if(![...o].some(([e,t])=>a.current.get(e)!==t))return;let s=setTimeout(()=>{for(let[e,t]of o)a.current.set(e,t);b6(e,t)},v6);return()=>clearTimeout(s)},[e,t,n,r,i])}async function b6(e,t){try{let n=await(await e(`/api/thumbnails?theme=${t}`)).json();n.ok&&n.data&&Mg(Lg,t,n.data.stamps)}catch{}}function x6({projects:e,calls:t}){let[n]=(0,_.useState)(Date.now),r=TG(),i=j3(),a=u6(),o=kk();return Xk(t),Zk(Jk,{calls:t}),S6(),y6(),r?null:(0,X.jsxs)(`div`,{className:`flex min-h-full flex-col text-body`,children:[(0,X.jsx)(w3,{hasProjects:e.length>0}),e.length===0?(0,X.jsx)(k3,{}):(0,X.jsx)(G3,{projects:d6(e,a.by,o,a.direction),layout:i,now:n,calls:t})]})}function S6(){let e=()=>[...document.querySelectorAll(`[data-project-link]`)];(0,_.useEffect)(()=>{let t=()=>(document.activeElement??document.body)===document.body&&e().length>0,n=t=>()=>t(e())?.focus();return xe([{id:`home.focusCards`,label:`Focus the projects`,group:`project`,keys:[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`h`,`j`,`k`,`l`],enabled:t,run:n(e=>e.find(e=>e.tabIndex===0))},{id:`home.focusFirst`,label:`Focus the first project`,group:`project`,keys:[`Home`],enabled:t,run:n(e=>e[0])},{id:`home.focusLast`,label:`Focus the last project`,group:`project`,keys:[`End`],enabled:t,run:n(e=>e.at(-1))}])},[])}var C6=1,w6=.9,T6=.8,E6=.17,D6=.1,O6=.999,k6=.9999,A6=.99,j6=/[\\\/_+.#"@\[\(\{&]/,M6=/[\\\/_+.#"@\[\(\{&]/g,N6=/[\s-]/,P6=/[\s-]/g;function F6(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?C6:A6;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=F6(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=C6:j6.test(e.charAt(l-1))?(d*=T6,p=e.slice(i,l-1).match(M6),p&&i>0&&(d*=O6**+p.length)):N6.test(e.charAt(l-1))?(d*=w6,m=e.slice(i,l-1).match(P6),m&&i>0&&(d*=O6**+m.length)):(d*=E6,i>0&&(d*=O6**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=k6)),(d<D6&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=F6(e,t,n,r,l+1,a+2,o),f*D6>d&&(d=f*D6)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function I6(e){return e.toLowerCase().replace(P6,` `)}function L6(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,F6(e,t,I6(e),I6(t),0,0,{})}var R6=Object.defineProperty,z6=(e,t)=>R6(e,`name`,{value:t,configurable:!0}),B6=!!(typeof window<`u`&&window.document&&window.document.createElement);function V6(e,t,{checkForDefaultPrevented:n=!0}={}){return z6(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}z6(V6,`composeEventHandlers`);function H6(e){if(!B6)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}z6(H6,`getOwnerWindow`);function U6(e){if(!B6)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}z6(U6,`getOwnerDocument`);function W6(e,t=!1){let{activeElement:n}=U6(e);if(!n?.nodeName)return null;if(G6(n)&&n.contentDocument)return W6(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=U6(n).getElementById(e);if(t)return t}}return n}z6(W6,`getActiveElement`);function G6(e){return e.tagName===`IFRAME`}z6(G6,`isFrame`);var K6=Object.defineProperty,q6=(e,t)=>K6(e,`name`,{value:t,configurable:!0});function J6(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}q6(J6,`setRef`);function Y6(...e){return t=>{let n=!1,r=e.map(e=>{let r=J6(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():J6(e[t],null)}}}}q6(Y6,`composeRefs`);function X6(...e){return _.useCallback(Y6(...e),e)}q6(X6,`useComposedRefs`);var Z6=Object.defineProperty,Q6=(e,t)=>Z6(e,`name`,{value:t,configurable:!0});function $6(e,t){let n=_.createContext(t);n.displayName=e+`Context`;let r=Q6(e=>{let{children:t,...r}=e,i=_.useMemo(()=>r,Object.values(r));return(0,X.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=_.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return Q6(i,`useContext`),[r,i]}Q6($6,`createContext`);function e8(e,t=[]){let n=[];function r(t,r){let i=_.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=Q6(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=_.useMemo(()=>o,Object.values(o));return(0,X.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=_.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return Q6(s,`useContext`),[o,s]}Q6(r,`createContext`);let i=Q6(()=>{let t=n.map(e=>_.createContext(e));return Q6(function(n){let r=n?.[e]||t;return _.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,t8(i,...t)]}Q6(e8,`createContextScope`);function t8(...e){let t=e[0];if(e.length===1)return t;let n=Q6(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return Q6(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}Q6(t8,`composeContextScopes`);var n8=globalThis?.document?_.useLayoutEffect:()=>{},r8=Object.defineProperty,i8=(e,t)=>r8(e,`name`,{value:t,configurable:!0}),a8=_.useId||(()=>void 0),o8=0;function s8(e){let[t,n]=_.useState(a8());return n8(()=>{e||n(e=>e??String(o8++))},[e]),e||(t?`radix-${t}`:``)}i8(s8,`useId`);var c8=Object.defineProperty,l8=(e,t)=>c8(e,`name`,{value:t,configurable:!0}),u8=_.useEffectEvent,d8=_.useInsertionEffect;function f8(e){if(typeof u8==`function`)return u8(e);let t=_.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof d8==`function`?d8(()=>{t.current=e}):n8(()=>{t.current=e}),_.useMemo(()=>((...e)=>t.current?.(...e)),[])}l8(f8,`useEffectEvent`);var p8=Object.defineProperty,m8=(e,t)=>p8(e,`name`,{value:t,configurable:!0}),h8=_.useInsertionEffect||n8;function g8({prop:e,defaultProp:t,onChange:n=m8(()=>{},`onChange`),caller:r}){let[i,a,o]=_8({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,_.useCallback(t=>{if(s){let n=v8(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}m8(g8,`useControllableState`);function _8({defaultProp:e,onChange:t}){let[n,r]=_.useState(e),i=_.useRef(n),a=_.useRef(t);return h8(()=>{a.current=t},[t]),_.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}m8(_8,`useUncontrolledState`);function v8(e){return typeof e==`function`}m8(v8,`isFunction`);var y8=Symbol(`RADIX:SYNC_STATE`);function b8(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=f8(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=_.useReducer((t,n)=>{if(n.type===y8)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=_.useRef(p);_.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=_.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return _.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:y8,state:i})},[i,d.state,c]),[h,f]}m8(b8,`useControllableStateReducer`);var x8=Object.defineProperty,S8=(e,t)=>x8(e,`name`,{value:t,configurable:!0});function C8(e){let t=_.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];r=N8(r),_.Children.forEach(r,e=>{if(k8(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;for(;j8(n)&&typeof L8==`function`;)n=L8(n._payload);a=E8(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=_.cloneElement(a,void 0,s):!o&&_.Children.count(r)===1&&_.isValidElement(r)&&(a=r);let c=a?O8(a):void 0,l=X6(n,c);if(!a){if(r||r===0)throw Error(o?I8(e):F8(e));return r}let u=D8(i,a.props??{});return a.type!==_.Fragment&&(u.ref=n?l:c),_.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}S8(C8,`createSlot`);var w8=Symbol.for(`radix.slottable`);function T8(e){let t=S8(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=w8,t}S8(T8,`createSlottable`);var E8=S8((e,t)=>`child`in e.props?_.isValidElement(t)?_.cloneElement(t,void 0,e.props.children(t.props.children)):null:_.isValidElement(t)?t:null,`getSlottableElementFromSlottable`);function D8(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(` `):r===`aria-describedby`&&(n[r]=P8(a,i))}return{...e,...n}}S8(D8,`mergeProps`);function O8(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)}S8(O8,`getElementRef`);function k8(e){return _.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===w8}S8(k8,`isSlottable`);var A8=Symbol.for(`react.lazy`);function j8(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===A8&&`_payload`in e&&M8(e._payload)}S8(j8,`isLazyComponent`);function M8(e){return typeof e==`object`&&!!e&&`then`in e}S8(M8,`isPromiseLike`);function N8(e){let t=e;for(;j8(t)&&typeof L8==`function`;)t=L8(t._payload);return t}S8(N8,`useUnwrappedLazy`);function P8(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}S8(P8,`concatAriaDescribedby`);var F8=S8(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),I8=S8(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),L8=_.use,R8=Object.defineProperty,z8=(e,t)=>R8(e,`name`,{value:t,configurable:!0}),B8=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=C8(`Primitive.${t}`),r=_.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,X.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function V8(e,t){e&&tu.flushSync(()=>e.dispatchEvent(t))}z8(V8,`dispatchDiscreteCustomEvent`);var H8=Object.defineProperty,U8=(e,t)=>H8(e,`name`,{value:t,configurable:!0}),W8=_.useInsertionEffect;function G8(e){let t=_.useRef(e);return typeof W8==`function`?W8(()=>{t.current=e}):n8(()=>{t.current=e}),_.useMemo(()=>((...e)=>t.current?.(...e)),[])}U8(G8,`useCallbackRef`);var K8=Object.defineProperty,q8=(e,t)=>K8(e,`name`,{value:t,configurable:!0}),J8=`dismissableLayer.update`,Y8=`dismissableLayer.pointerDownOutside`,X8=`dismissableLayer.focusOutside`,Z8,Q8=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),$8=_.forwardRef(q8(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=_.useContext(Q8),[d,f]=_.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=_.useState({}),h=X6(t,f),g=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=v?g.indexOf(v):-1,b=d?g.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=_.useRef(!1),w=n5(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:_.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return S&&!t},[u.branches,S])}),T=r5(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=G8(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return _.useEffect(()=>{if(E)return p.addEventListener(`keydown`,D,{capture:!0}),()=>p.removeEventListener(`keydown`,D,{capture:!0})},[p,E,D]),_.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Z8=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),i5(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=Z8))}},[d,p,n,u]),_.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),i5())},[d,u]),_.useEffect(()=>{let e=q8(()=>m({}),`handleUpdate`);return document.addEventListener(J8,e),()=>document.removeEventListener(J8,e)},[]),(0,X.jsx)(B8.div,{...l,ref:h,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:V6(e.onFocusCapture,T.onFocusCapture),onBlurCapture:V6(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:V6(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function e5(){let e=_.useContext(Q8),[t,n]=_.useState(null);return _.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}q8(e5,`useDismissableLayerSurface`);var t5=q8(()=>!0,`IS_TRUE`);function n5(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=t5}=t,s=G8(e),c=_.useRef(!1),l=_.useRef(!1),u=_.useRef(new Map),d=_.useRef(()=>{});return _.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}q8(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}q8(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)}q8(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}q8(p,`handleInteractionBubble`);let m=q8(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||a5(Y8,s,p,{discrete:!0})};if(q8(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:q8(()=>c.current=!0,`onPointerDownCapture`)}}q8(n5,`usePointerDownOutside`);function r5(e,t=globalThis?.document){let n=G8(e),r=_.useRef(!1);return _.useEffect(()=>{let e=q8(e=>{e.target&&!r.current&&a5(X8,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:q8(()=>r.current=!0,`onFocusCapture`),onBlurCapture:q8(()=>r.current=!1,`onBlurCapture`)}}q8(r5,`useFocusOutside`);function i5(){let e=new CustomEvent(J8);document.dispatchEvent(e)}q8(i5,`dispatchUpdate`);function a5(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?V8(i,a):i.dispatchEvent(a)}q8(a5,`handleAndDispatchCustomEvent`);var o5=Object.defineProperty,s5=(e,t)=>o5(e,`name`,{value:t,configurable:!0}),c5=`focusScope.autoFocusOnMount`,l5=`focusScope.autoFocusOnUnmount`,u5={bubbles:!1,cancelable:!0},d5=_.forwardRef(s5(function(e,t){let{loop:n=!1,trapped:r=!1,branches:i,onMountAutoFocus:a,onUnmountAutoFocus:o,...s}=e,[c,l]=_.useState(null),u=G8(a),d=G8(o),f=_.useRef(null),p=X6(t,l),m=_.useRef(i);_.useEffect(()=>{m.current=i});let h=_.useCallback(e=>e?c?.contains(e)?!0:!!m.current?.some(t=>t.contains(e)):!1,[c]),g=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(r){let e=function(e){if(g.paused||!c)return;let t=e.target;h(t)?f.current=t:S5(f.current,{select:!0})},t=function(e){if(g.paused||!c)return;let t=e.relatedTarget;t!==null&&(h(t)||S5(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&S5(c)};s5(e,`handleFocusIn`),s5(t,`handleFocusOut`),s5(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,c,g.paused,h]),_.useEffect(()=>{if(c){C5.add(g);let e=document.activeElement;if(!c.contains(e)){let t=new CustomEvent(c5,u5);c.addEventListener(c5,u),c.dispatchEvent(t),t.defaultPrevented||(g5(E5(v5(c)),{select:!0}),document.activeElement===e&&S5(c))}return()=>{c.removeEventListener(c5,u);let t=c.ownerDocument,n=CustomEvent;setTimeout(()=>{let r=new n(l5,u5);c.addEventListener(l5,d),c.dispatchEvent(r),r.defaultPrevented||S5(e??t.body,{select:!0}),c.removeEventListener(l5,d),C5.remove(g)},0)}}},[c,u,d,g]);let v=_.useCallback(e=>{if(!n&&!r||g.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]=_5(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&S5(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&S5(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,g.paused]);return(0,X.jsx)(B8.div,{tabIndex:-1,...s,ref:p,onKeyDown:v})},`FocusScope`)),f5=_.createContext(null);function p5({registry:e,children:t}){return e?(0,X.jsx)(f5.Provider,{value:e,children:t}):t}s5(p5,`FocusScopeBranchProvider`);function m5(){let[e,t]=_.useState([]);return{nodes:e,registry:_.useMemo(()=>({add:s5(e=>t(t=>t.includes(e)?t:[...t,e]),`add`),remove:s5(e=>t(t=>t.filter(t=>t!==e)),`remove`)}),[])}}s5(m5,`useFocusScopeBranchRegistry`);function h5(e){let t=_.useContext(f5);_.useEffect(()=>{if(e&&t)return t.add(e),()=>t.remove(e)},[e,t])}s5(h5,`useFocusScopeBranch`);function g5(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(S5(r,{select:t}),document.activeElement!==n)return}s5(g5,`focusFirst`);function _5(e){let t=v5(e);return[y5(t,e),y5(t.reverse(),e)]}s5(_5,`getTabbableEdges`);function v5(e){let t=[],n=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s5(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}s5(v5,`getTabbableCandidates`);function y5(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):b5(r,{upTo:t})))return r}s5(y5,`findVisible`);function b5(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}s5(b5,`isHidden`);function x5(e){return e.tagName===`INPUT`&&typeof e.select==`function`}s5(x5,`isSelectableInput`);function S5(e,{select:t=!1}={}){if(e&&e.focus){let n=(e.ownerDocument??document).activeElement;e.focus({preventScroll:!0}),e!==n&&x5(e)&&t&&e.select()}}s5(S5,`focus`);var C5=w5();function w5(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=T5(e,t),e.unshift(t)},remove(t){e=T5(e,t),e[0]?.resume()}}}s5(w5,`createFocusScopesStack`);function T5(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}s5(T5,`arrayRemove`);function E5(e){return e.filter(e=>e.tagName!==`A`)}s5(E5,`removeLinks`);var D5=Object.defineProperty,O5=_.forwardRef(((e,t)=>D5(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=_.useState(!1);n8(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?tu.createPortal((0,X.jsx)(B8.div,{...r,ref:t}),o):null},`Portal`)),k5=Object.defineProperty,A5=(e,t)=>k5(e,`name`,{value:t,configurable:!0});function j5(e,t){return _.useReducer((e,n)=>t[e][n]??e,e)}A5(j5,`useStateMachine`);var M5=A5(e=>{let{present:t,children:n}=e,r=N5(t),i=typeof n==`function`?n({present:r.isPresent}):_.Children.only(n),a=F5(r.ref,L5(i));return typeof n==`function`||r.isPresent?_.cloneElement(i,{ref:a}):null},`Presence`);function N5(e){let[t,n]=_.useState(),r=_.useRef(null),i=_.useRef(e),a=_.useRef(`none`),o=_.useRef(void 0),[s,c]=j5(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return _.useEffect(()=>{s===`mounted`?(a.current=o.current??I5(r.current),o.current=void 0):a.current=`none`},[s]),n8(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=I5(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]),n8(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=A5(a=>{let o=I5(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=A5(e=>{e.target===t&&(a.current=I5(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:_.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=I5(t)}else r.current=null;n(e)},[])}}A5(N5,`usePresence`);function P5(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}A5(P5,`setRef`);function F5(...e){let t=_.useRef(e);return t.current=e,_.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=P5(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():P5(n[e],null)}}},[])}A5(F5,`useStableComposedRefs`);function I5(e){return e?.animationName||`none`}A5(I5,`getAnimationName`);function L5(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)}A5(L5,`getElementRef`);var R5=Object.defineProperty,z5=(e,t)=>R5(e,`name`,{value:t,configurable:!0}),B5=0,V5=null;function H5(e){return U5(),e.children}z5(H5,`FocusGuards`);function U5(){_.useEffect(()=>{V5||={start:W5(),end:W5()};let{start:e,end:t}=V5;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),B5++,()=>{B5===1&&(V5?.start.remove(),V5?.end.remove(),V5=null),B5=Math.max(0,B5-1)}},[])}z5(U5,`useFocusGuards`);function W5(){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}z5(W5,`createFocusGuard`);var G5=function(){return G5=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},G5.apply(this,arguments)};function K5(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 q5(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 J5=`right-scroll-bar-position`,Y5=`width-before-scroll-bar`,X5=`with-scroll-bars-hidden`,Z5=`--removed-body-scroll-bar-size`;function Q5(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function $5(e,t){var n=(0,_.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 e7=typeof window<`u`?_.useLayoutEffect:_.useEffect,t7=new WeakMap;function n7(e,t){var n=$5(t||null,function(t){return e.forEach(function(e){return Q5(e,t)})});return e7(function(){var t=t7.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Q5(e,null)}),i.forEach(function(e){r.has(e)||Q5(e,a)})}t7.set(n,e)},[e]),n}function r7(e){return e}function i7(e,t){t===void 0&&(t=r7);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 a7(e){e===void 0&&(e={});var t=i7(null);return t.options=G5({async:!0,ssr:!1},e),t}var o7=function(e){var t=e.sideCar,n=K5(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 _.createElement(r,G5({},n))};o7.isSideCarExport=!0;function s7(e,t){return e.useMedium(t),o7}var c7=a7(),l7=function(){},u7=_.forwardRef(function(e,t){var n=_.useRef(null),r=_.useState({onScrollCapture:l7,onWheelCapture:l7,onTouchMoveCapture:l7}),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,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=K5(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=n7([n,t]),w=G5(G5({},x),i);return _.createElement(_.Fragment,null,u&&_.createElement(S,{sideCar:c7,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:b}),o?_.cloneElement(_.Children.only(s),G5(G5({},w),{ref:C})):_.createElement(y,G5({},w,{className:c,ref:C}),s))});u7.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},u7.classNames={fullWidth:Y5,zeroRight:J5};var d7=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function f7(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=d7();return t&&e.setAttribute(`nonce`,t),e}function p7(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function m7(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var h7=function(){var e=0,t=null;return{add:function(n){e==0&&(t=f7())&&(p7(t,n),m7(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},g7=function(){var e=h7();return function(t,n){_.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},_7=function(){var e=g7();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},v7={left:0,top:0,right:0,gap:0},y7=function(e){return parseInt(e||``,10)||0},b7=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[y7(n),y7(r),y7(i)]},x7=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return v7;var t=b7(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])}},S7=_7(),C7=`data-scroll-locked`,w7=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
72
- .${X5} {
73
- overflow: hidden ${r};
74
- padding-right: ${s}px ${r};
75
- }
76
- body[${C7}] {
77
- overflow: hidden ${r};
78
- overscroll-behavior: contain;
79
- ${[t&&`position: relative ${r};`,n===`margin`&&`
80
- padding-left: ${i}px;
81
- padding-top: ${a}px;
82
- padding-right: ${o}px;
83
- margin-left:0;
84
- margin-top:0;
85
- margin-right: ${s}px ${r};
86
- `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
87
- }
88
-
89
- .${J5} {
90
- right: ${s}px ${r};
91
- }
92
-
93
- .${Y5} {
94
- margin-right: ${s}px ${r};
95
- }
96
-
97
- .${J5} .${J5} {
98
- right: 0 ${r};
99
- }
100
-
101
- .${Y5} .${Y5} {
102
- margin-right: 0 ${r};
103
- }
104
-
105
- body[${C7}] {
106
- ${Z5}: ${s}px;
107
- }
108
- `},T7=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},E7=function(){_.useEffect(function(){return document.body.setAttribute(C7,(T7()+1).toString()),function(){var e=T7()-1;e<=0?document.body.removeAttribute(C7):document.body.setAttribute(C7,e.toString())}},[])},D7=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;E7();var a=_.useMemo(function(){return x7(i)},[i]);return _.createElement(S7,{styles:w7(a,!t,i,n?``:`!important`)})},O7=!1;if(typeof window<`u`)try{var k7=Object.defineProperty({},"passive",{get:function(){return O7=!0,!0}});window.addEventListener(`test`,k7,k7),window.removeEventListener(`test`,k7,k7)}catch{O7=!1}var A7=O7?{passive:!1}:!1,j7=function(e){return e.tagName===`TEXTAREA`},M7=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!j7(e)&&n[t]===`visible`)},N7=function(e){return M7(e,`overflowY`)},P7=function(e){return M7(e,`overflowX`)},F7=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),R7(e,r)){var i=z7(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},I7=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},L7=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},R7=function(e,t){return e===`v`?N7(t):P7(t)},z7=function(e,t){return e===`v`?I7(t):L7(t)},B7=function(e,t){return e===`h`&&t===`rtl`?-1:1},V7=function(e,t,n,r,i){var a=B7(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=z7(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&R7(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},H7=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},U7=function(e){return[e.deltaX,e.deltaY]},W7=function(e){return e&&`current`in e?e.current:e},G7=function(e,t){return e[0]===t[0]&&e[1]===t[1]},K7=function(e){return`
109
- .block-interactivity-${e} {pointer-events: none;}
110
- .allow-interactivity-${e} {pointer-events: all;}
111
- `},q7=0,J7=[];function Y7(e){var t=_.useRef([]),n=_.useRef([0,0]),r=_.useRef(),i=_.useState(q7++)[0],a=_.useState(_7)[0],o=_.useRef(e);_.useEffect(function(){o.current=e},[e]),_.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=q5([e.lockRef.current],(e.shards||[]).map(W7),!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=_.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=H7(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=F7(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=F7(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 V7(h,t,e,h===`h`?s:c,!0)},[]),c=_.useCallback(function(e){var n=e;if(J7.length&&J7[J7.length-1]===a){var r=`deltaY`in n?U7(n):H7(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&G7(e.delta,r)})[0];if(i&&i.should)n.cancelable&&n.preventDefault();else if(!i){var c=(o.current.shards||[]).map(W7).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=_.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:X7(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=_.useCallback(function(e){n.current=H7(e),r.current=void 0},[]),d=_.useCallback(function(t){l(t.type,U7(t),t.target,s(t,e.lockRef.current))},[]),f=_.useCallback(function(t){l(t.type,H7(t),t.target,s(t,e.lockRef.current))},[]);_.useEffect(function(){return J7.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,A7),document.addEventListener(`touchmove`,c,A7),document.addEventListener(`touchstart`,u,A7),function(){J7=J7.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,A7),document.removeEventListener(`touchmove`,c,A7),document.removeEventListener(`touchstart`,u,A7)}},[]);var p=e.removeScrollBar,m=e.inert;return _.createElement(_.Fragment,null,m?_.createElement(a,{styles:K7(i)}):null,p?_.createElement(D7,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function X7(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Z7=s7(c7,Y7),Q7=_.forwardRef(function(e,t){return _.createElement(u7,G5({},e,{ref:t,sideCar:Z7}))});Q7.classNames=u7.classNames;var $7=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},e9=new WeakMap,t9=new WeakMap,n9={},r9=0,i9=function(e){return e&&(e.host||i9(e.parentNode))},Qee=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=i9(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})},$ee=function(e,t,n,r){var i=Qee(t,Array.isArray(e)?e:[e]);n9[n]||(n9[n]=new WeakMap);var a=n9[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=(e9.get(e)||0)+1,l=(a.get(e)||0)+1;e9.set(e,c),a.set(e,l),o.push(e),c===1&&i&&t9.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(),r9++,function(){o.forEach(function(e){var t=e9.get(e)-1,i=a.get(e)-1;e9.set(e,t),a.set(e,i),t||(t9.has(e)||e.removeAttribute(r),t9.delete(e)),i||e.removeAttribute(n)}),r9--,r9||(e9=new WeakMap,e9=new WeakMap,t9=new WeakMap,n9={})}},ete=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||$7(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),$ee(r,i,n,`aria-hidden`)):function(){return null}},tte=Object.defineProperty,a9=(e,t)=>tte(e,`name`,{value:t,configurable:!0}),o9=`Dialog`,[s9,nte]=e8(o9),[rte,c9]=s9(o9),ite=a9(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=_.useRef(null),c=_.useRef(null),{nodes:l,registry:u}=m5(),[d,f]=g8({prop:r,defaultProp:i??!1,onChange:a,caller:o9}),[p,m]=_.useState(0),[h,g]=_.useState(0);return(0,X.jsx)(rte,{scope:t,triggerRef:s,contentRef:c,contentId:s8(),titleId:s8(),descriptionId:s8(),titlePresent:p>0,descriptionPresent:h>0,setTitleCount:m,setDescriptionCount:g,open:d,onOpenChange:f,onOpenToggle:_.useCallback(()=>f(e=>!e),[f]),modal:o,branchNodes:l,branchRegistry:u,children:n})},`Dialog`),l9=`DialogPortal`,[ate,u9]=s9(l9,{forceMount:void 0}),ote=a9(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=c9(l9,t);return(0,X.jsx)(ate,{scope:t,forceMount:n,children:_.Children.map(r,e=>(0,X.jsx)(M5,{present:n||a.open,children:(0,X.jsx)(O5,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),d9=`DialogOverlay`,ste=_.forwardRef(a9(function(e,t){let n=u9(d9,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=c9(d9,e.__scopeDialog);return a.modal?(0,X.jsx)(M5,{present:r||a.open,children:(0,X.jsx)(lte,{...i,ref:t})}):null},`DialogOverlay`)),cte=C8(`DialogOverlay.RemoveScroll`),lte=_.forwardRef(a9(function(e,t){let{__scopeDialog:n,...r}=e,i=c9(d9,n),a=X6(t,e5());return(0,X.jsx)(Q7,{as:cte,allowPinchZoom:!0,shards:_.useMemo(()=>[i.contentRef,...i.branchNodes.map(e=>({current:e}))],[i.contentRef,i.branchNodes]),children:(0,X.jsx)(B8.div,{"data-state":h9(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),f9=`DialogContent`,ute=_.forwardRef(a9(function(e,t){let n=u9(f9,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=c9(f9,e.__scopeDialog);return(0,X.jsx)(M5,{present:r||a.open,children:a.modal?(0,X.jsx)(dte,{...i,ref:t}):(0,X.jsx)(fte,{...i,ref:t})})},`DialogContent`)),dte=_.forwardRef(a9(function(e,t){let n=c9(f9,e.__scopeDialog),r=_.useRef(null),i=X6(t,n.contentRef,r);return _.useEffect(()=>{let e=r.current;if(e)return ete(e)},[]),(0,X.jsx)(p9,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:V6(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:V6(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:V6(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),fte=_.forwardRef(a9(function(e,t){let n=c9(f9,e.__scopeDialog),r=_.useRef(!1),i=_.useRef(!1);return(0,X.jsx)(p9,{...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`)),p9=_.forwardRef(a9(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,"aria-describedby":o,children:s,...c}=e,l=c9(f9,n);return U5(),(0,X.jsx)(p5,{registry:l.branchRegistry,children:(0,X.jsx)(d5,{asChild:!0,loop:!0,trapped:r,branches:l.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,X.jsx)($8,{role:`dialog`,id:l.contentId,"aria-labelledby":l.titlePresent?l.titleId:void 0,"aria-describedby":l.descriptionPresent?m9(o,l.descriptionId):o,"data-state":h9(l.open),...c,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1),children:s})})})},`DialogContentImpl`));function m9(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}a9(m9,`concatAriaDescribedby`);function h9(e){return e?`open`:`closed`}a9(h9,`getState`);var g9=`[cmdk-group=""]`,_9=`[cmdk-group-items=""]`,pte=`[cmdk-group-heading=""]`,v9=`[cmdk-item=""]`,y9=`${v9}:not([aria-disabled="true"])`,b9=`cmdk-item-select`,x9=`data-value`,mte=(e,t,n)=>L6(e,t,n),S9=_.createContext(void 0),C9=()=>_.useContext(S9),w9=_.createContext(void 0),T9=()=>_.useContext(w9),E9=_.createContext(void 0),D9=_.forwardRef((e,t)=>{let n=j9(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=j9(()=>new Set),i=j9(()=>new Map),a=j9(()=>new Map),o=j9(()=>new Set),s=k9(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,...v}=e,y=s8(),b=s8(),x=s8(),S=_.useRef(null),C=Tte();A9(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,w.emit()}},[u]),A9(()=>{C(6,A)},[]);let w=_.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)k(),D(),C(1,O);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(x);e?e.focus():(i=document.getElementById(y))==null||i.focus()}if(C(7,()=>{n.current.selectedItemId=j()?.id,w.emit()}),r||C(5,A),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}w.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),T=_.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,E(t,r)),C(2,()=>{D(),w.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),C(3,()=>{k(),D(),n.current.value||O(),w.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=j();C(4,()=>{k(),t?.getAttribute(`id`)===e&&O(),w.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:y,inputId:x,labelId:b,listInnerRef:S}),[]);function E(e,t){let r=s.current?.filter??mte;return e?r(e,n.current.search,t):0}function D(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=S.current;M().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(_9);t?t.appendChild(e.parentElement===t?e:e.closest(`${_9} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${_9} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=S.current?.querySelector(`${g9}[${x9}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function O(){let e=M().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(x9);w.setState(`value`,e||void 0)}function k(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=E(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function A(){var e;let t=j();t&&(t.parentElement?.firstChild===t&&((e=t.closest(g9)?.querySelector(pte))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function j(){return S.current?.querySelector(`${v9}[aria-selected="true"]`)}function M(){return Array.from(S.current?.querySelectorAll(y9)||[])}function N(e){let t=M()[e];t&&w.setState(`value`,t.getAttribute(x9))}function P(e){var t;let n=j(),r=M(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&w.setState(`value`,a.getAttribute(x9))}function F(e){let t=j()?.closest(g9),n;for(;t&&!n;)t=e>0?Cte(t,g9):wte(t,g9),n=t?.querySelector(y9);n?w.setState(`value`,n.getAttribute(x9)):P(e)}let I=()=>N(M().length-1),L=e=>{e.preventDefault(),e.metaKey?I():e.altKey?F(1):P(1)},R=e=>{e.preventDefault(),e.metaKey?N(0):e.altKey?F(-1):P(-1)};return _.createElement(B8.div,{ref:t,tabIndex:-1,...v,"cmdk-root":``,onKeyDown:e=>{var t;(t=v.onKeyDown)==null||t.call(v,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:g&&e.ctrlKey&&L(e);break;case`ArrowDown`:L(e);break;case`p`:case`k`:g&&e.ctrlKey&&R(e);break;case`ArrowUp`:R(e);break;case`Home`:e.preventDefault(),N(0);break;case`End`:e.preventDefault(),I();break;case`Enter`:{e.preventDefault();let t=j();if(t){let e=new Event(b9);t.dispatchEvent(e)}}}}},_.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:Dte},c),P9(e,e=>_.createElement(w9.Provider,{value:w},_.createElement(S9.Provider,{value:T},e))))}),hte=_.forwardRef((e,t)=>{let n=s8(),r=_.useRef(null),i=_.useContext(E9),a=C9(),o=k9(e),s=o.current?.forceMount??i?.forceMount;A9(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=N9(n,r,[e.value,e.children,r],e.keywords),l=T9(),u=M9(e=>e.value&&e.value===c.current),d=M9(e=>s||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);_.useEffect(()=>{let t=r.current;if(t&&!e.disabled)return t.addEventListener(b9,f),()=>t.removeEventListener(b9,f)},[d,e.onSelect,e.disabled]);function f(){var e,t;p(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function p(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:m,value:h,onSelect:g,forceMount:v,keywords:y,...b}=e;return _.createElement(B8.div,{ref:Y6(r,t),...b,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!m,"aria-selected":!!u,"data-disabled":!!m,"data-selected":!!u,onPointerMove:m||a.getDisablePointerSelection()?void 0:p,onClick:m?void 0:f},e.children)}),gte=_.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=s8(),s=_.useRef(null),c=_.useRef(null),l=s8(),u=C9(),d=M9(e=>i||u.filter()===!1?!0:!e.search||e.filtered.groups.has(o));A9(()=>u.group(o),[]),N9(o,s,[e.value,e.heading,c]);let f=_.useMemo(()=>({id:o,forceMount:i}),[i]);return _.createElement(B8.div,{ref:Y6(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:!d||void 0},n&&_.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),P9(e,e=>_.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},_.createElement(E9.Provider,{value:f},e))))}),_te=_.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=_.useRef(null),a=M9(e=>!e.search);return!n&&!a?null:_.createElement(B8.div,{ref:Y6(i,t),...r,"cmdk-separator":``,role:`separator`})}),vte=_.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=T9(),o=M9(e=>e.search),s=M9(e=>e.selectedItemId),c=C9();return _.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),_.createElement(B8.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),yte=_.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=_.useRef(null),o=_.useRef(null),s=M9(e=>e.selectedItemId),c=C9();return _.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),_.createElement(B8.div,{ref:Y6(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},P9(e,e=>_.createElement(`div`,{ref:Y6(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),bte=_.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return _.createElement(ite,{open:n,onOpenChange:r},_.createElement(ote,{container:o},_.createElement(ste,{"cmdk-overlay":``,className:i}),_.createElement(ute,{"aria-label":e.label,"cmdk-dialog":``,className:a},_.createElement(D9,{ref:t,...s}))))}),xte=_.forwardRef((e,t)=>M9(e=>e.filtered.count===0)?_.createElement(B8.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),Ste=_.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return _.createElement(B8.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},P9(e,e=>_.createElement(`div`,{"aria-hidden":!0},e)))}),O9=Object.assign(D9,{List:yte,Item:hte,Input:vte,Group:gte,Separator:_te,Dialog:bte,Empty:xte,Loading:Ste});function Cte(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function wte(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function k9(e){let t=_.useRef(e);return A9(()=>{t.current=e}),t}var A9=typeof window>`u`?_.useEffect:_.useLayoutEffect;function j9(e){let t=_.useRef();return t.current===void 0&&(t.current=e()),t}function M9(e){let t=T9(),n=()=>e(t.snapshot());return _.useSyncExternalStore(t.subscribe,n,n)}function N9(e,t,n,r=[]){let i=_.useRef(),a=C9();return A9(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(x9,s),i.current=s}),i}var Tte=()=>{let[e,t]=_.useState(),n=j9(()=>new Map);return A9(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function Ete(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function P9({asChild:e,children:t},n){return e&&_.isValidElement(t)?_.cloneElement(Ete(t),{ref:t.ref},n(t.props.children)):n(t)}var Dte={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},F9=_.createContext(void 0);function I9(e){let t=_.useContext(F9);if(!e&&t===void 0)throw Error(La(27));return t}var Ote=_.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=I9(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return Vl(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:Rs,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),kte=_.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,c=I9(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=Ku({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,Z(id,e.nativeEvent))}return Vl(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),Ate=_.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=I9(),c=xV(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),Vl(`p`,e,{ref:t,props:[{id:c},o]})}),L9=_.createContext(void 0);function jte(){let e=_.useContext(L9);if(e===void 0)throw Error(La(26));return e}var Mte=`--nested-dialogs`,Nte=`data-nested-dialog-open`,Pte={...Ls,...ws,nestedDialogOpen(e){return e?{[Nte]:``}:null}},Fte=_.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=I9(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),g=c.useState(`nestedOpenDialogCount`),_=c.useState(`open`),v=c.useState(`openMethod`),y=c.useState(`titleElementId`),b=c.useState(`transitionStatus`),x=c.useState(`role`),S=d.useState(`floatingId`);jte(),au({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});let C=o===void 0?Mf(c.context.popupRef):o,w=g>0,T=c.useStateSetter(`popupElement`),E=Vl(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:w},props:[f,{id:S,"aria-labelledby":y,"aria-describedby":l,role:x,...jf,hidden:!m,onKeyDown(e){nH.has(e.key)&&e.stopPropagation()},style:{[Mte]:g}},s],ref:[t,c.context.popupRef,T],stateAttributesMapping:Pte});return(0,X.jsx)(bf,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:C,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:E})}),Ite=_.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=I9(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,X.jsx)(L9.Provider,{value:n,children:(0,X.jsxs)(kd,{ref:t,...r,children:[a&&o===!0&&(0,X.jsx)(NV,{ref:i.context.internalBackdropRef,inert:Xl(!s)}),e.children]})}):null});function Lte({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`mounted`),a=e.useState(`disablePointerDismissal`),o=e.useState(`modal`),s=e.useState(`popupElement`),c=e.useState(`floatingRootContext`),[l,u]=_.useState(0),[d,f]=_.useState(0),p=l===0,m=Df(c,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=ps(t);if(p&&!a){if(o){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||Y(n,s)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:p});return GV(r&&o===!0,s),e.useContextCallback(`onNestedDialogOpen`,(t,n)=>{(e.select(`open`)||e.select(`mounted`))&&(u(t),f(n))}),G(()=>{!r&&!i&&(u(0),f(0))},[r,i]),G(()=>(t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(l+1,d+ +!!n),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,l,d,t]),Uf(e,{activeTriggerProps:m.reference,inactiveTriggerProps:m.trigger,popupProps:m.floating,nestedOpenDialogCount:l,nestedOpenDrawerCount:d}),null}var Rte={...ep,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},zte=class extends lo{constructor(e,t,n){let r=new Gf,i=Bte(e,r,t,n);super(i,Vte(r),Rte)}setOpen=(e,t)=>{t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),!t.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(Lf(this.state,e,t.trigger)))}};function Bte(e,t,n,r=!1){return{...Jf(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}function Vte(e){return{popupRef:_.createRef(),backdropRef:_.createRef(),internalBackdropRef:_.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function Hte(e,t){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null}=t,p=e===`drawer`,m=e===`alert-dialog`,h=m?!0:c,g=m||s,v=m?`alertdialog`:`dialog`,y=I9(!0),b={modal:h,disablePointerDismissal:g,nested:y!=null,role:v},x=Nf((e,t)=>new zte({open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...b},e,t),!0);x.useControlledProp(`openProp`,r),x.useControlledProp(`triggerIdProp`,d),x.useSyncedValues(b),x.useContextCallback(`onOpenChange`,a),x.useContextCallback(`onOpenChangeComplete`,o);let S=x.useState(`open`),C=x.useState(`mounted`),w=x.useState(`payload`);Wf(x,S),Vf(x);let{forceUnmount:T}=Hf(S,x);_.useImperativeHandle(l,()=>({unmount:T,close:()=>x.setOpen(!1,Z(Cd))}),[T,x]);let E=S||C||u!=null;return(0,X.jsxs)(F9.Provider,{value:x,children:[u&&(0,X.jsx)(Pf,{handle:u,store:x}),E&&(0,X.jsx)(Lte,{store:x,parentContext:y?.context,isDrawer:p}),typeof n==`function`?n({payload:w}):n]})}var Ute=Ja(function(e){return Hte(`dialog`,e)}),Wte=_.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=I9(),c=xV(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),Vl(`h2`,e,{ref:t,props:[{id:c},o]})});function R9({...e}){return(0,X.jsx)(Ute,{"data-slot":`dialog`,...e})}function Gte({...e}){return(0,X.jsx)(Ite,{"data-slot":`dialog-portal`,...e})}function Kte({className:e,...t}){return(0,X.jsx)(Ote,{"data-slot":`dialog-overlay`,className:Q(`fixed inset-0 isolate z-50 bg-black/20 duration-100 motion-reduce:animate-none! dark:bg-black/45 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function z9({className:e,children:t,showCloseButton:n=!0,...r}){return(0,X.jsxs)(Gte,{children:[(0,X.jsx)(Kte,{}),(0,X.jsxs)(Fte,{"data-slot":`dialog-content`,className:Q(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl border border-border bg-popover p-4 text-[12px] text-popover-foreground shadow-[0_24px_64px_rgba(0,0,0,0.35)] duration-100 outline-none motion-reduce:animate-none! sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[t,n&&(0,X.jsxs)(kte,{"data-slot":`dialog-close`,render:(0,X.jsx)(eg,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`}),children:[(0,X.jsx)(Ii,{}),(0,X.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function qte({className:e,...t}){return(0,X.jsx)(`div`,{"data-slot":`dialog-header`,className:Q(`flex flex-col gap-2`,e),...t})}function B9({className:e,...t}){return(0,X.jsx)(Wte,{"data-slot":`dialog-title`,className:Q(`font-heading text-base leading-none font-medium`,e),...t})}function Jte({className:e,...t}){return(0,X.jsx)(Ate,{"data-slot":`dialog-description`,className:Q(`text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function Yte({className:e,...t}){return(0,X.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:Q(`group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5`,e),...t})}var Xte=Qh(`flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4`,{variants:{align:{"inline-start":`order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]`,"inline-end":`order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]`,"block-start":`order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2`,"block-end":`order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2`}},defaultVariants:{align:`inline-start`}});function Zte({className:e,align:t=`inline-start`,...n}){return(0,X.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":t,className:Q(Xte({align:t}),e),onClick:e=>{e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()},...n})}function Qte({className:e,...t}){return(0,X.jsx)(O9,{"data-slot":`command`,className:Q(`flex size-full flex-col overflow-hidden rounded-xl! bg-popover text-popover-foreground`,e),...t})}function $te({title:e=`Command Palette`,description:t=`Search for a command to run...`,children:n,className:r,showCloseButton:i=!1,...a}){return(0,X.jsxs)(R9,{...a,children:[(0,X.jsxs)(qte,{className:`sr-only`,children:[(0,X.jsx)(B9,{children:e}),(0,X.jsx)(Jte,{children:t})]}),(0,X.jsx)(z9,{className:Q(`top-[120px] translate-y-0 gap-0 overflow-hidden rounded-xl! p-0 sm:max-w-[560px]`,r),showCloseButton:i,children:n})]})}function ene({className:e,...t}){return(0,X.jsx)(`div`,{"data-slot":`command-input-wrapper`,children:(0,X.jsxs)(Yte,{className:`h-12 rounded-none! border-0 border-b border-border bg-transparent px-2 shadow-none! dark:bg-transparent *:data-[slot=input-group-addon]:pl-2!`,children:[(0,X.jsx)(O9.Input,{"data-slot":`command-input`,className:Q(`w-full text-[14px] outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,e),...t}),(0,X.jsx)(Zte,{children:(0,X.jsx)(Jr,{className:`size-4 shrink-0 opacity-50`})})]})})}function tne({className:e,...t}){return(0,X.jsx)(O9.List,{"data-slot":`command-list`,className:Q(`no-scrollbar max-h-[420px] scroll-py-2 overflow-x-hidden overflow-y-auto outline-none`,e),...t})}function nne({className:e,...t}){return(0,X.jsx)(O9.Empty,{"data-slot":`command-empty`,className:Q(`py-6 text-center text-body text-muted-foreground`,e),...t})}function V9({className:e,...t}){return(0,X.jsx)(O9.Group,{"data-slot":`command-group`,className:Q(`overflow-hidden px-2 py-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-[11px] **:[[cmdk-group-heading]]:font-semibold **:[[cmdk-group-heading]]:text-muted-foreground`,e),...t})}function H9({className:e,children:t,...n}){return(0,X.jsx)(O9.Item,{"data-slot":`command-item`,className:Q(`group/command-item relative flex h-[34px] cursor-default items-center gap-2.5 rounded-[7px] px-2 text-body outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-accent data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:text-muted-foreground [&_svg:not([class*='size-'])]:size-[15px]`,e),...n,children:t})}var U9=N()(()=>({open:null}));function W9(e){U9.setState({open:e})}function G9(){return F(U9,e=>e.open)}function rne(e,t){let n=e.projects.map(({name:e})=>({ref:e,label:e}));if(t===null)return{projects:n,pages:[],frames:[]};let r=[...e.projects.filter(e=>e.name===t),...e.projects.filter(e=>e.name!==t)];return{projects:n,pages:r.flatMap(e=>e.pages.map(t=>({ref:t.ref,label:t.name,hint:e.name}))),frames:r.flatMap(e=>e.pages.flatMap(t=>t.frames.map(n=>({ref:n.ref,label:n.name,hint:`${e.name} / ${t.name}`,...n.hidden?{hidden:!0}:{}}))))}}function ine(e){ia(`/p/${encodeURIComponent(e)}`)}function ane(e){let[t=``,n=``]=e.split(`/`);ia(Qg(t,n))}function K9(e){let[t=``,n=``]=e.split(`/`),r=`${t}/${n}`;S2(r,()=>DN(HN,r,[e]))}async function one(e,t=Lg,n=gk){await n.flagFrames([e],`hidden`,!1),await new Promise(n=>{let r=()=>{let r=sne(t.getState().board,e);return r!==`hidden`&&(n(r===`shown`),!0)};if(r())return;let i=t.subscribe(()=>{r()&&i()})})&&K9(e)}function sne(e,t){for(let n of e?.projects??[])for(let e of n.pages){let n=e.frames.find(e=>e.ref===t);if(n)return n.hidden?`hidden`:`shown`}return`gone`}function cne(e){let t=e.split(`/`).at(-1)??e;one(e).catch(Ck(`Couldn't show ${t}`))}function lne(){let e=G9()===`commands`;return(0,X.jsx)($te,{open:e,onOpenChange:e=>W9(e?`commands`:null),title:`Command palette`,description:`Search for a frame, page, project, or action to run.`,children:(0,X.jsx)(une,{})})}function une(){let e=Rg(e=>e.board),[,t]=xa(`/p/:project/:page?`),n=Te().filter(e=>!(e.group===`mode`&&e.checked?.())),r=Rg(e=>e.canWrite),{frames:i,pages:a,projects:o}=e?rne(e,t?.project??null):{frames:[],pages:[],projects:[]},s=e=>()=>{W9(null),e()},c=(e,t,n,i)=>e.map(e=>(0,X.jsxs)(H9,{value:`${i}:${e.ref}`,keywords:[e.label,e.hint??``],disabled:e.hidden&&!r,onSelect:s(()=>e.hidden?cne(e.ref):n(e.ref)),children:[e.hidden?(0,X.jsx)(on,{}):t,(0,X.jsx)(`span`,{className:`flex-1 truncate`,children:e.label}),e.hidden?(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:`Hidden`}):null,e.hint?(0,X.jsx)(`span`,{className:`truncate text-muted-foreground`,children:e.hint}):null]},e.ref));return(0,X.jsxs)(Qte,{filter:fne,children:[(0,X.jsx)(ene,{placeholder:`Search frames, pages, and actions`}),(0,X.jsxs)(tne,{children:[(0,X.jsx)(nne,{children:`Nothing matches.`}),i.length>0?(0,X.jsx)(V9,{heading:`Frames`,children:c(i,(0,X.jsx)(ei,{}),K9,`frame`)}):null,a.length>0?(0,X.jsx)(V9,{heading:`Pages`,children:c(a,(0,X.jsx)(fn,{}),ane,`page`)}):null,n.length>0?(0,X.jsx)(V9,{heading:`Actions`,children:n.map(e=>(0,X.jsx)(dne,{action:e,choose:s},e.id))}):null,o.length>0?(0,X.jsx)(V9,{heading:`Projects`,children:c(o,(0,X.jsx)(vn,{}),ine,`project`)}):null]})]})}function dne({action:e,choose:t}){let n=e.command?.label??e.label,r=e.command?.icon??Yt,i=he(e.keys,me()),a=e.command?.hint?.();return(0,X.jsxs)(H9,{value:`action:${e.id}`,keywords:[n,...e.command?.keywords??[]],onSelect:t(e.run),children:[(0,X.jsx)(r,{}),(0,X.jsx)(`span`,{className:`flex-1 truncate`,children:n}),a?(0,X.jsx)(`span`,{className:`truncate text-muted-foreground`,children:a}):null,i?(0,X.jsx)(eV,{children:oe(i).map(e=>(0,X.jsx)($B,{children:e},e))}):null]})}function fne(e,t,n=[]){let r=t.trim().toLowerCase();return r===``?1:Math.max(...n.map(e=>{let t=e.toLowerCase();return t.startsWith(r)?1:t.includes(r)?.8:q9(t.split(/[^\p{L}\p{N}]+/u).filter(Boolean),r.replace(/\s+/g,``))?.3:0}))}function q9(e,t){return t===``||e.some((n,r)=>{for(let i=pne(n,t);i>0;--i)if(q9(e.slice(r+1),t.slice(i)))return!0;return!1})}function pne(e,t){let n=0;for(;n<e.length&&e[n]===t[n];)n+=1;return n}var J9=B?`⌘`:`Ctrl`,Y9=B?`⇧`:`Shift`,mne=B?`⌃`:`Ctrl`,X9=[{title:`Tools`,rows:[{label:`Move`,actions:[`tool.move`]},{label:`Hand`,actions:[`tool.hand`]},{label:`Frame`,actions:[`tool.frame`]},{label:`Text`,actions:[`tool.text`]},{label:`Rectangle, ellipse, divider`,actions:[`tool.rectangle`,`tool.ellipse`,`tool.divider`]},{label:`Note`,actions:[`tool.note`]},{label:`Find`,actions:[`find.open`]},{label:`Command palette`,actions:[`palette.open`]},{label:`This list`,actions:[`help.shortcuts`]},{label:`All projects`,actions:[`nav.home`]}]},{title:`Selection`,rows:[{label:`Into an element`,gestures:[`${J9} click`]},{label:`One level down`,actions:[`element.down`]},{label:`One level up`,actions:[`element.up`]},{label:`Next sibling`,actions:[`element.next`]},{label:`Add to selection`,gestures:[`${Y9} click`]}]},{title:`View`,rows:[{label:`Zoom to fit`,actions:[`view.zoomToFit`]},{label:`Zoom to selection`,actions:[`view.zoomToSelection`]},{label:`Zoom to 100%`,actions:[`view.zoom100`]},{label:`Hide UI`,actions:[`view.hideUi`]},{label:`Undo`,actions:[`edit.undo`]},{label:`Redo`,actions:[`edit.redo`]}]},{title:`Frames`,rows:[{label:`Nudge`,gestures:[`Arrows`]},{label:`Bigger nudge`,gestures:[`${Y9} Arrows`]},{label:`Resize`,gestures:[`${J9} Arrows`]},{label:`Duplicate`,actions:[`frame.duplicate`]},{label:`Copy as PNG`,actions:[`frame.copyPng`]},{label:`Hide`,actions:[`frame.hide`]},{label:`Lock`,actions:[`frame.lock`]},{label:`Delete`,actions:[`frame.delete`]}]},{title:`Arrange`,rows:[{label:`Align left, right`,actions:[`arrange.alignLeft`,`arrange.alignRight`]},{label:`Align top, bottom`,actions:[`arrange.alignTop`,`arrange.alignBottom`]},{label:`Center`,actions:[`arrange.alignCenter`,`arrange.alignMiddle`]},{label:`Distribute`,actions:[`arrange.distributeHorizontal`,`arrange.distributeVertical`]},{label:`Snap off while dragging`,gestures:[`${mne} drag`]}]},{title:`Agents`,rows:[{label:`Next change`,actions:[`changes.next`]},{label:`Previous change`,actions:[`changes.previous`]}]}],Z9=[{title:`Projects`,rows:[{label:`Move between projects`,gestures:[`Arrows`],characterGestures:[`H J K L`]},{label:`First, last`,gestures:[`Home`,`End`]},{label:`Open`,gestures:[`↵`]},{label:`Rename`,gestures:[`F2`]},{label:`Delete`,gestures:[`Delete`]},{label:`Menu`,gestures:[`${Y9} F10`]}]},{title:`General`,rows:[{label:`Command palette`,actions:[`palette.open`]},{label:`This list`,actions:[`help.shortcuts`]},{label:`Undo`,actions:[`edit.undo`]},{label:`Redo`,actions:[`edit.redo`]}]}],Q9=[...X9,...Z9].flatMap(e=>e.rows.flatMap(e=>e.actions??[]));function hne(){let e=G9()===`shortcuts`,[t]=xa(`/`),n=t?Z9:X9,r=Ce(Q9),i=new Map(Q9.map((e,t)=>[e,r[t]]));return(0,X.jsx)(R9,{open:e,onOpenChange:e=>W9(e?`shortcuts`:null),children:(0,X.jsxs)(z9,{showCloseButton:!1,className:`top-[90px] translate-y-0 gap-0 p-0 sm:max-w-[760px]`,children:[(0,X.jsxs)(`div`,{className:`flex h-12 items-center gap-4 border-b border-border px-4 text-[14px]`,children:[(0,X.jsx)(B9,{className:`text-[14px] leading-none font-semibold`,children:`Keyboard shortcuts`}),(0,X.jsx)(gne,{}),(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:`Esc`})]}),(0,X.jsx)(`div`,{className:Q(`grid gap-x-7 gap-y-[18px] px-5 pt-4 pb-5`,t?`grid-cols-[1.3fr_1fr_1fr]`:`grid-cols-3`),children:n.map(e=>(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h3`,{className:`pb-1.5 text-label text-muted-foreground`,children:e.title}),(0,X.jsx)(`ul`,{children:e.rows.map(e=>(0,X.jsx)(_ne,{row:e,byId:i,spaced:t},e.label))})]},e.title))})]})})}function gne(){let e=me();return(0,X.jsxs)(`label`,{className:`ml-auto flex items-center gap-2 text-body text-muted-foreground`,children:[`Single-key shortcuts`,(0,X.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e,onClick:()=>fe(!e),className:`relative h-4 w-7 shrink-0 rounded-full bg-muted outline-none focus-visible:ring-2 focus-visible:ring-ring/50 aria-checked:bg-primary`,children:(0,X.jsx)(`span`,{"aria-hidden":!0,className:Q(`absolute top-0.5 left-0.5 size-3 rounded-full bg-background shadow-sm transition-transform motion-reduce:transition-none`,e&&`translate-x-3`)})})]})}function _ne({row:e,byId:t,spaced:n}){let r=me(),i=[...(e.actions??[]).flatMap(e=>{let n=t.get(e)?.keys?.[0];return n?[{text:oe(n).join(B?` `:`+`),off:!r&&le(n)}]:[]}),...(e.gestures??[]).map(e=>({text:e,off:!1})),...(e.characterGestures??[]).map(e=>({text:e,off:!r}))],a=e.actions!==void 0&&e.actions.every(e=>!t.get(e));return(0,X.jsxs)(`li`,{"aria-disabled":a||void 0,className:Q(`flex h-[26px] items-center justify-between aria-disabled:text-faint`,n&&`gap-3.5`),children:[(0,X.jsx)(`span`,{className:`whitespace-nowrap`,children:e.label}),(0,X.jsx)(eV,{children:i.map(e=>(0,X.jsx)($B,{"data-off":e.off||void 0,className:`px-1.5 text-label font-normal whitespace-nowrap data-off:text-faint`,children:e.text},e.text))})]})}var vne={[uv]:pv,[B_]:vv},yne=1.6;function bne(){return(0,X.jsx)(Ve,{strokeWidth:yne,children:(0,X.jsx)(cX,{delay:500,children:(0,X.jsxs)(mg,{bodies:vne,children:[(0,X.jsx)(xne,{}),(0,X.jsx)(lne,{}),(0,X.jsx)(hne,{})]})})})}function xne(){let e=Rg(e=>e.board?.projects),t=Rg(e=>e.connected);return(0,_.useEffect)(()=>Vg(),[]),(0,X.jsxs)(`div`,{className:`relative h-svh overflow-auto bg-background text-foreground`,children:[e?(0,X.jsxs)(Oa,{children:[(0,X.jsx)(Ta,{path:`/`,children:(0,X.jsx)(x6,{projects:e})}),(0,X.jsx)(Ta,{path:`/p/:project/:page`,children:({project:e,page:t})=>(0,X.jsx)(b3,{project:e,page:t})}),(0,X.jsx)(Ta,{path:`/p/:project`,children:({project:e})=>(0,X.jsx)(b3,{project:e})}),(0,X.jsx)(Ta,{children:(0,X.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3 p-6`,children:[(0,X.jsx)(`p`,{className:`text-body text-muted-foreground`,children:`Nothing on the board at this address.`}),(0,X.jsx)(Ea,{href:`/`,className:$h({variant:`outline`}),children:`Go home`})]})})]}):(0,X.jsx)(`p`,{role:`status`,className:`flex h-full items-center justify-center text-body text-muted-foreground`,children:`Connecting to the board`}),e&&!t?(0,X.jsx)(`p`,{role:`status`,className:`absolute top-3 left-1/2 -translate-x-1/2 rounded-xl border border-border bg-card px-3 py-1 text-body text-muted-foreground`,children:`Reconnecting to frameboard serve`}):null,e?(0,X.jsx)(Xg,{}):null]})}function Sne(e,t,n){return e.elements.length===t.elements.length&&e.elements.every((e,r)=>{let i=t.elements[r];return i!==void 0&&i.index===e.index&&i.parent===e.parent&&i.tag===e.tag&&(e.index===n||i.name===e.name)})&&t.elements.some(e=>e.index===n)}function Cne({store:e=Lg,calls:t=gk,navigate:n=ia,selection:r=HN,notify:i=e=>tg.add({...e,type:`warning`}),mac:a=B,treeAt:o=async(e,t)=>{await qz(e,t);let n=await Jz(e);return n?.hash===t?n:null}}={}){let s=(e,t)=>{mN(e.frames);for(let[t,n]of Object.entries(e.hashes??{}))RN(t,n);let{page:i,element:a}=r.getState(),s=a?e.hashes?.[a.frame]:void 0;if(i&&a&&s&&o(a.frame,s).then(e=>{r.getState().element===a&&(t?.hash===a.hash&&e&&Sne(t,e,a.index)?kN(r,i,{...a,hash:s}):DN(r,i,[a.frame]))}),e.page===null)return;let[c=``,l=``]=e.page.split(`/`);n(Qg(c,l))},c=(t,n,a)=>()=>{let c=()=>{},l=null,u=e.getState().history;uk([],a,async()=>{c=IN(null);let e=r.getState().element;return l=e?await o(e.frame,e.hash):null,t().catch(e=>{throw c(),e})},{live:e,dropWhen:({history:e})=>e.undo!==u.undo||e.redo!==u.redo}).then(e=>{c(),s(e,l),VN(r,cB)},e=>{c(),BN(r,cB),e instanceof cx&&e.code!==`nothing-to-undo`&&i({title:n,description:e.message})})},l=t=>()=>{let{canWrite:n,history:r}=e.getState();return n&&r[t]>0},u=xe([{id:`edit.undo`,label:`Undo`,group:`edit`,keys:[`$mod+KeyZ`],run:c(t.undo,`Undo skipped`,`undo`),enabled:l(`undo`),command:{label:`Undo`,icon:Mi}},{id:`edit.redo`,label:`Redo`,group:`edit`,keys:a?[`$mod+Shift+KeyZ`]:[`$mod+Shift+KeyZ`,`Control+KeyY`],run:c(t.redo,`Redo skipped`,`redo`),enabled:l(`redo`),command:{label:`Redo`,icon:Pr}}]),d=e.subscribe((e,t)=>{(e.history!==t.history||e.canWrite!==t.canWrite)&&U()});return()=>{d(),u()}}function wne(){let e=xe([{id:`palette.open`,label:`Command palette`,group:`help`,keys:[`$mod+KeyK`],run:()=>W9(`commands`)},{id:`help.shortcuts`,label:`Keyboard shortcuts`,group:`help`,keys:[`Shift+?`],run:()=>W9(`shortcuts`),command:{label:`Keyboard shortcuts`,icon:zt}},{id:`help.characterKeys`,label:`Single-key shortcuts`,group:`help`,run:()=>fe(!pe()),checked:pe,command:{get label(){return pe()?`Turn single-key shortcuts off`:`Turn single-key shortcuts on`},icon:Mn}}]),t=ye.subscribe(U);return()=>{t(),e()}}var Tne=[{choice:`system`,label:`System`},{choice:`light`,label:`Light`},{choice:`dark`,label:`Dark`}];function Ene(e=IM){let t=xe([{id:`theme.toggle`,label:`Theme`,group:`view`,command:{label:`Toggle theme`,icon:ii,keywords:[`dark`,`light`,`mode`]},run:()=>DM(e)},...Tne.map(({choice:t,label:n})=>({id:`theme.${t}`,label:n,group:`theme`,run:()=>EM(t,e),checked:()=>e.getState().choice===t}))]),n=e.subscribe(U);return()=>{n(),t()}}var $9=document.getElementById(`root`);if(!$9)throw Error(`Missing #root element`);wG(window.location.pathname),Z_(),$R(Lg,{onShow:W_,onDisconnect:Q_}),wM(IM,TM(window)),Ene(),Cne(),wne(),De(window),(0,v.createRoot)($9).render((0,X.jsx)(_.StrictMode,{children:(0,X.jsx)(bne,{})}));