@opencraw/studio 0.0.29 → 0.0.31

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,38 +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),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 ee(e,t){return D(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function te(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var k=/\/+/g;function ne(e,t){return typeof e==`object`&&e&&e.key!=null?te(``+e.key):t.toString(36)}function re(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 ie(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,ie(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ne(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(k,`$&/`)+`/`),ie(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=ee(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(k,`$&/`)+`/`)+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+ne(a,u),c+=ie(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+ne(a,u++),c+=ie(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ie(re(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 A(e,t,n){if(e==null)return e;var r=[],i=0;return ie(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ae(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 oe=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 se(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,oe)}catch(e){oe(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function ce(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 se(ce.bind(null,e))}var j={map:A,forEach:function(e,t,n){A(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return A(e,function(){t++}),t},toArray:function(e){return A(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=j,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=ce,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=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ae}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=se,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.0`})),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,ee());else{var t=n(l);t!==null&&k(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&&k(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?ee():S=!1}}}var ee;if(typeof y==`function`)ee=function(){y(D)};else if(typeof MessageChannel<`u`){var O=new MessageChannel,te=O.port2;O.port1.onmessage=D,ee=function(){te.postMessage(null)}}else ee=function(){_(D,0)};function k(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,k(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,ee()))),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.0`})),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,ee=Symbol.for(`react.element`),O=Symbol.for(`react.transitional.element`),te=Symbol.for(`react.portal`),k=Symbol.for(`react.fragment`),ne=Symbol.for(`react.strict_mode`),re=Symbol.for(`react.profiler`),ie=Symbol.for(`react.consumer`),A=Symbol.for(`react.context`),ae=Symbol.for(`react.forward_ref`),oe=Symbol.for(`react.suspense`),se=Symbol.for(`react.suspense_list`),ce=Symbol.for(`react.memo`),j=Symbol.for(`react.lazy`),le=Symbol.for(`react.activity`),ue=Symbol.for(`react.legacy_hidden`),de=Symbol.for(`react.memo_cache_sentinel`),fe=Symbol.for(`react.view_transition`),pe=Symbol.for(`react.recoverable`),me=Symbol.iterator;function he(e){return typeof e!=`object`||!e?null:(e=me&&e[me]||e[`@@iterator`],typeof e==`function`?e:null)}var ge=Symbol.for(`react.client.reference`);function _e(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ge?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case k:return`Fragment`;case re:return`Profiler`;case ne:return`StrictMode`;case oe:return`Suspense`;case se:return`SuspenseList`;case le:return`Activity`;case fe:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case te:return`Portal`;case A:return e.displayName||`Context`;case ie:return(e._context.displayName||`Context`)+`.Consumer`;case ae:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ce:return t=e.displayName||null,t===null?_e(e.type)||`Memo`:t;case j:t=e._payload,e=e._init;try{return _e(e(t))}catch{}}return null}var ve=Array.isArray,M=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ye={pending:!1,data:null,method:null,action:null},be=[],xe=-1;function Se(e){return{current:e}}function Ce(e){0>xe||(e.current=be[xe],be[xe]=null,xe--)}function we(e,t){xe++,be[xe]=e.current,e.current=t}var Te=Se(null),Ee=Se(null),De=Se(null),Oe=Se(null);function ke(e,t){switch(we(De,t),we(Ee,e),we(Te,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?bp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=bp(t),e=xp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}Ce(Te),we(Te,e)}function Ae(){Ce(Te),Ce(Ee),Ce(De)}function je(e){var t=e.memoizedState;t!==null&&(gh._currentValue=t.memoizedState,we(Oe,e)),t=Te.current;var n=xp(t,e.type);t!==n&&(we(Ee,e),we(Te,n))}function Me(e){Ee.current===e&&(Ce(Te),Ce(Ee)),Oe.current===e&&(Ce(Oe),gh._currentValue=ye)}var Ne,Pe;function Fe(e){if(Ne===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Ne=t&&t[1]||``,Pe=-1<e.stack.indexOf(`
2
- at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
- `+Ne+e+Pe}var Ie=!1;function Le(e,t){if(!e||Ie)return``;Ie=!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{Ie=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Fe(n):``}function Re(e,t){switch(e.tag){case 26:case 27:case 5:return Fe(e.type);case 16:return Fe(`Lazy`);case 13:return e.child!==t&&t!==null?Fe(`Suspense Fallback`):Fe(`Suspense`);case 19:return Fe(`SuspenseList`);case 0:case 15:return Le(e.type,!1);case 11:return Le(e.type.render,!1);case 1:return Le(e.type,!0);case 31:return Fe(`Activity`);case 30:return Fe(`ViewTransition`);default:return``}}function ze(e){try{var t=``,n=null;do t+=Re(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
- Error generating stack: `+e.message+`
8
- `+e.stack}}var Be=Object.prototype.hasOwnProperty,Ve=t.unstable_scheduleCallback,He=t.unstable_cancelCallback,Ue=t.unstable_shouldYield,We=t.unstable_requestPaint,Ge=t.unstable_now,Ke=t.unstable_getCurrentPriorityLevel,qe=t.unstable_ImmediatePriority,Je=t.unstable_UserBlockingPriority,Ye=t.unstable_NormalPriority,Xe=t.unstable_LowPriority,Ze=t.unstable_IdlePriority,Qe=t.log,$e=t.unstable_setDisableYieldValue,et=null,P=null;function tt(e){if(typeof Qe==`function`&&$e(e),P&&typeof P.setStrictMode==`function`)try{P.setStrictMode(et,e)}catch{}}var nt=Math.clz32?Math.clz32:it,F=Math.log,rt=Math.LN2;function it(e){return e>>>=0,e===0?32:31-(F(e)/rt|0)|0}var at=256,ot=262144,st=4194304;function ct(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 lt(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=ct(n))):i=ct(o):i=ct(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=ct(n))):i=ct(o)):i=ct(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 ut(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function dt(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-nt(n),i=1<<r;t|=e[r],n&=~i}return t}function ft(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 pt(){var e=st;return st<<=1,!(st&62914560)&&(st=4194304),e}function mt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ht(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function gt(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-nt(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&&_t(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function _t(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-nt(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function vt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-nt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function yt(e,t){var n=t&-t;return n=n&42?1:bt(n),(n&(e.suspendedLanes|t))===0?n:0}function bt(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 xt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function St(){var e=N.p;return e===0?(e=window.event,e===void 0?32:Mh(e.type)):e}function Ct(e,t){var n=N.p;try{return N.p=e,t()}finally{N.p=n}}var wt=Math.random().toString(36).slice(2),Tt=`__reactFiber$`+wt,Et=`__reactProps$`+wt,Dt=`__reactContainer$`+wt,Ot=`__reactEvents$`+wt,kt=`__reactListeners$`+wt,At=`__reactHandles$`+wt,jt=`__reactResources$`+wt,Mt=`__reactMarker$`+wt,Nt=`__reactLoad$`+wt;function Pt(e){delete e[Tt],delete e[Et],delete e[kt],delete e[At]}function Ft(e){var t;if(t=e[Tt])return t;for(var n=e.parentNode;n;){if(t=n[Dt]||n[Tt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=xm(e);e!==null;){if(n=e[Tt])return n;e=xm(e)}return t}e=n,n=e.parentNode}return null}function It(e){if(e=e[Tt]||e[Dt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Lt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Rt(e){var t=e[jt];return t||=e[jt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function zt(e){e[Mt]=!0}function Bt(e){e[Nt]=void 0}var Vt=new Set,Ht={};function Ut(e,t){Wt(e,t),Wt(e+`Capture`,t)}function Wt(e,t){for(Ht[e]=t,e=0;e<t.length;e++)Vt.add(t[e])}var Gt=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]*$`),Kt={},qt={};function Jt(e){return Be.call(qt,e)?!0:Be.call(Kt,e)?!1:Gt.test(e)?qt[e]=!0:(Kt[e]=!0,!1)}var Yt=!1;function Xt(){var e=Yt;return Yt=!1,e}function Zt(e,t,n){if(Jt(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 Qt(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 $t(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 en(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function tn(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function nn(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 rn(e){if(!e._valueTracker){var t=tn(e)?`checked`:`value`;e._valueTracker=nn(e,t,``+e[t])}}function an(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=tn(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var on=/[\n"\\]/g;function sn(e){return e.replace(on,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function cn(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=``+en(t)):e.value!==``+en(t)&&(e.value=``+en(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):un(e,en(n)):o===`number`&&e.value==t?un(e,en(e.value)):un(e,en(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=``+en(s):e.removeAttribute(`name`)}function ln(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)){rn(e);return}n=n==null?``:``+en(n),t=t==null?n:``+en(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),rn(e)}function un(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function dn(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=``+en(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 fn(e,t,n){if(t!=null&&(t=``+en(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+en(n)}function pn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ve(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=en(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),rn(e)}function mn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var hn=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 gn(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||hn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function _n(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]=``,Yt=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(gn(e,a,r),Yt=!0)}else for(var o in t)t.hasOwnProperty(o)&&gn(e,o,t[o])}function vn(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 yn=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`]]),bn=/^[\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 I(e){return bn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function xn(){}var Sn=null;function Cn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var wn=null,Tn=null;function En(e){var t=It(e);if(t&&(e=t.stateNode)){var n=e[Et]||null;a:switch(e=t.stateNode,t.type){case`input`:if(cn(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="`+sn(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[Et]||null;if(!a)throw Error(i(90));cn(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&&an(r)}break a;case`textarea`:fn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&dn(e,!!n.multiple,t,!1)}}}var Dn=!1;function On(e,t,n){if(Dn)return e(t,n);Dn=!0;try{return e(t)}finally{if(Dn=!1,(wn!==null||Tn!==null)&&(Kd(),wn&&(t=wn,e=Tn,Tn=wn=null,En(t),e)))for(t=0;t<e.length;t++)En(e[t])}}function kn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Et]||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 An=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,jn=!1;if(An)try{var Mn={};Object.defineProperty(Mn,"passive",{get:function(){jn=!0}}),window.addEventListener(`test`,Mn,Mn),window.removeEventListener(`test`,Mn,Mn)}catch{jn=!1}var Nn=null,Pn=null,Fn=null;function In(){if(Fn)return Fn;var e,t=Pn,n=t.length,r,i=`value`in Nn?Nn.value:Nn.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 Fn=i.slice(e,1<r?1-r:void 0)}function Ln(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 Rn(){return!0}function zn(){return!1}function Bn(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)?Rn:zn,this.isPropagationStopped=zn,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=Rn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Rn)},persist:function(){},isPersistent:Rn}),t}var Vn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Hn=Bn(Vn),Un=D({},Vn,{view:0,detail:0}),Wn=Bn(Un),Gn,Kn,qn,Jn=D({},Un,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ar,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!==qn&&(qn&&e.type===`mousemove`?(Gn=e.screenX-qn.screenX,Kn=e.screenY-qn.screenY):Kn=Gn=0,qn=e),Gn)},movementY:function(e){return`movementY`in e?e.movementY:Kn}}),Yn=Bn(Jn),Xn=Bn(D({},Jn,{dataTransfer:0})),Zn=Bn(D({},Un,{relatedTarget:0})),Qn=Bn(D({},Vn,{animationName:0,elapsedTime:0,pseudoElement:0})),$n=Bn(D({},Vn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),er=Bn(D({},Vn,{data:0})),tr={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},nr={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`},rr={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function ir(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=rr[e])?!!t[e]:!1}function ar(){return ir}var or=Bn(D({},Un,{key:function(e){if(e.key){var t=tr[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Ln(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?nr[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ar,charCode:function(e){return e.type===`keypress`?Ln(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Ln(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),sr=Bn(D({},Jn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),cr=Bn(D({},Vn,{submitter:0})),lr=Bn(D({},Un,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ar})),ur=Bn(D({},Vn,{propertyName:0,elapsedTime:0,pseudoElement:0})),dr=Bn(D({},Jn,{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})),fr=Bn(D({},Vn,{newState:0,oldState:0,source:0})),pr=[9,13,27,32],mr=An&&`CompositionEvent`in window,hr=null;An&&`documentMode`in document&&(hr=document.documentMode);var gr=An&&`TextEvent`in window&&!hr,_r=An&&(!mr||hr&&8<hr&&11>=hr),vr=` `,yr=!1;function br(e,t){switch(e){case`keyup`:return pr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function xr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Sr=!1;function Cr(e,t){switch(e){case`compositionend`:return xr(t);case`keypress`:return t.which===32?(yr=!0,vr):null;case`textInput`:return e=t.data,e===vr&&yr?null:e;default:return null}}function wr(e,t){if(Sr)return e===`compositionend`||!mr&&br(e,t)?(e=In(),Fn=Pn=Nn=null,Sr=!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 _r&&t.locale!==`ko`?null:t.data;default:return null}}var Tr={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 Er(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Tr[e.type]:t===`textarea`}function Dr(e,t,n,r){wn?Tn?Tn.push(r):Tn=[r]:wn=r,t=rp(t,`onChange`),0<t.length&&(n=new Hn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Or=null,kr=null;function Ar(e){Yf(e,0)}function jr(e){if(an(Lt(e)))return e}function Mr(e,t){if(e===`change`)return t}var Nr=!1;if(An){var Pr;if(An){var Fr=`oninput`in document;if(!Fr){var Ir=document.createElement(`div`);Ir.setAttribute(`oninput`,`return;`),Fr=typeof Ir.oninput==`function`}Pr=Fr}else Pr=!1;Nr=Pr&&(!document.documentMode||9<document.documentMode)}function Lr(){Or&&(Or.detachEvent(`onpropertychange`,Rr),kr=Or=null)}function Rr(e){if(e.propertyName===`value`&&jr(kr)){var t=[];Dr(t,kr,e,Cn(e)),On(Ar,t)}}function zr(e,t,n){e===`focusin`?(Lr(),Or=t,kr=n,Or.attachEvent(`onpropertychange`,Rr)):e===`focusout`&&Lr()}function Br(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return jr(kr)}function Vr(e,t){if(e===`click`)return jr(t)}function L(e,t){if(e===`input`||e===`change`)return jr(t)}function Hr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Ur=typeof Object.is==`function`?Object.is:Hr;function Wr(e,t){if(Ur(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(!Be.call(t,i)||!Ur(e[i],t[i]))return!1}return!0}function Gr(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 Kr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function qr(e,t){var n=Kr(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=Kr(n)}}function Jr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Jr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Yr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Gr(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=Gr(e.document)}return t}function Xr(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 Zr=An&&`documentMode`in document&&11>=document.documentMode,Qr=null,$r=null,ei=null,ti=!1;function ni(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ti||Qr==null||Qr!==Gr(r)||(r=Qr,`selectionStart`in r&&Xr(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}),ei&&Wr(ei,r)||(ei=r,r=rp($r,`onSelect`),0<r.length&&(t=new Hn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Qr)))}function ri(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var ii={animationend:ri(`Animation`,`AnimationEnd`),animationiteration:ri(`Animation`,`AnimationIteration`),animationstart:ri(`Animation`,`AnimationStart`),transitionrun:ri(`Transition`,`TransitionRun`),transitionstart:ri(`Transition`,`TransitionStart`),transitioncancel:ri(`Transition`,`TransitionCancel`),transitionend:ri(`Transition`,`TransitionEnd`)},ai={},oi={};An&&(oi=document.createElement(`div`).style,`AnimationEvent`in window||(delete ii.animationend.animation,delete ii.animationiteration.animation,delete ii.animationstart.animation),`TransitionEvent`in window||delete ii.transitionend.transition);function si(e){if(ai[e])return ai[e];if(!ii[e])return e;var t=ii[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in oi)return ai[e]=t[n];return e}var ci=si(`animationend`),li=si(`animationiteration`),ui=si(`animationstart`),di=si(`transitionrun`),fi=si(`transitionstart`),pi=si(`transitioncancel`),mi=si(`transitionend`),hi=new Map,gi=`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(` `);gi.push(`scrollEnd`);function _i(e,t){hi.set(e,t),Ut(t,[e])}var vi=0;function yi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=Dd.identifierPrefix;var n=vi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function bi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Fd;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 xi(e,t){return e=bi(e),t=bi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var R=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)},Si=[],Ci=0,wi=0;function Ti(){for(var e=Ci,t=wi=Ci=0;t<e;){var n=Si[t];Si[t++]=null;var r=Si[t];Si[t++]=null;var i=Si[t];Si[t++]=null;var a=Si[t];if(Si[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&&ki(n,i,a)}}function Ei(e,t,n,r){Si[Ci++]=e,Si[Ci++]=t,Si[Ci++]=n,Si[Ci++]=r,wi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Di(e,t,n,r){return Ei(e,t,n,r),Ai(e)}function Oi(e,t){return Ei(e,null,null,t),Ai(e)}function ki(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-nt(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Ai(e){if(50<Id)throw Id=0,Ld=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ji={};function Mi(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 Ni(e,t,n,r){return new Mi(e,t,n,r)}function Pi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Fi(e,t){var n=e.alternate;return n===null?(n=Ni(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 Ii(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 Li(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Pi(r)&&(s=1);else if(typeof r==`string`)s=nh(e,n,Te.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case le:return e=Ni(31,n,t,a),e.elementType=le,e.lanes=o,e;case k:return Ri(n.children,a,o,t);case ne:s=8,a|=24;break;case re:return e=Ni(12,n,t,a|2),e.elementType=re,e.lanes=o,e;case oe:return e=Ni(13,n,t,a),e.elementType=oe,e.lanes=o,e;case se:return e=Ni(19,n,t,a),e.elementType=se,e.lanes=o,e;case ue:case fe:return e=a|32,e=Ni(30,n,t,e),e.elementType=fe,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case A:s=10;break a;case ie:s=9;break a;case ae:s=11;break a;case ce:s=14;break a;case j:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Ni(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Ri(e,t,n,r){return e=Ni(7,e,r,t),e.lanes=n,e}function zi(e,t,n){return e=Ni(6,e,null,t),e.lanes=n,e}function Bi(e){var t=Ni(18,null,null,0);return t.stateNode=e,t}function Vi(e,t,n){return t=Ni(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Hi=new WeakMap;function Ui(e,t){if(typeof e==`object`&&e){var n=Hi.get(e);return n===void 0?(t={value:e,source:t,stack:ze(t)},Hi.set(e,t),t):n}return{value:e,source:t,stack:ze(t)}}var Wi=[],Gi=0,Ki=null,qi=0,Ji=[],Yi=0,Xi=null,Zi=1,Qi=``;function $i(e,t){Wi[Gi++]=qi,Wi[Gi++]=Ki,Ki=e,qi=t}function ea(e,t,n){Ji[Yi++]=Zi,Ji[Yi++]=Qi,Ji[Yi++]=Xi,Xi=e;var r=Zi;e=Qi;var i=32-nt(r)-1;r&=~(1<<i),n+=1;var a=32-nt(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Zi=1<<32-nt(t)+i|n<<i|r,Qi=a+e}else Zi=1<<a|n<<i|r,Qi=e}function ta(e){e.return!==null&&($i(e,1),ea(e,1,0))}function na(e){for(;e===Ki;)Ki=Wi[--Gi],Wi[Gi]=null,qi=Wi[--Gi],Wi[Gi]=null;for(;e===Xi;)Xi=Ji[--Yi],Ji[Yi]=null,Qi=Ji[--Yi],Ji[Yi]=null,Zi=Ji[--Yi],Ji[Yi]=null}function ra(e,t){Ji[Yi++]=Zi,Ji[Yi++]=Qi,Ji[Yi++]=Xi,Zi=t.id,Qi=t.overflow,Xi=e}var ia=null,aa=null,oa=!1,sa=null,ca=!1,la=Error(i(519));function ua(e){throw ga(Ui(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),la}function da(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Tt]=e,t[Et]=r,n){case`dialog`:Xf(`cancel`,t),Xf(`close`,t);break;case`iframe`:case`object`:case`embed`:Xf(`load`,t);break;case`video`:case`audio`:for(n=0;n<qf.length;n++)Xf(qf[n],t);break;case`source`:Xf(`error`,t);break;case`img`:case`image`:case`link`:Xf(`error`,t),Xf(`load`,t);break;case`details`:Xf(`toggle`,t);break;case`input`:Xf(`invalid`,t),ln(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Xf(`invalid`,t);break;case`textarea`:Xf(`invalid`,t),pn(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||lp(t.textContent,n)?(r.popover!=null&&(Xf(`beforetoggle`,t),Xf(`toggle`,t)),r.onScroll!=null&&Xf(`scroll`,t),r.onScrollEnd!=null&&Xf(`scrollend`,t),r.onClick!=null&&(t.onclick=xn),t=!0):t=!1,t||ua(e,!0)}function fa(e){for(ia=e.return;ia;)switch(ia.tag){case 5:case 31:case 13:ca=!1;return;case 27:case 3:ca=!0;return;default:ia=ia.return}}function pa(e){if(e!==ia)return!1;if(!oa)return fa(e),oa=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||Cp(e.type,e.memoizedProps)),n=!n),n&&aa&&ua(e),fa(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));aa=bm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));aa=bm(e)}else t===27?(t=aa,jp(e.type)?(e=ym,ym=null,aa=e):aa=t):aa=ia?vm(e.stateNode.nextSibling):null;return!0}function ma(){aa=ia=null,oa=!1}function ha(){var e=sa;return e!==null&&(yd===null?yd=e:yd.push.apply(yd,e),sa=null),e}function ga(e){sa===null?sa=[e]:sa.push(e)}var _a=Se(null),va=null,ya=null;function ba(e,t,n){we(_a,t._currentValue),t._currentValue=n}function xa(e){e._currentValue=_a.current,Ce(_a)}function Sa(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 Ca(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),Sa(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),Sa(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),Sa(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 wa(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;Ur(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===Oe.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[gh]:e.push(gh))}a=a.return}return e!==null&&Ca(t,e,n,r),t.flags|=262144,e!==null}function Ta(e){for(e=e.firstContext;e!==null;){if(!Ur(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ea(e){va=e,ya=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Da(e){return ka(va,e)}function Oa(e,t){return va===null&&Ea(e),ka(e,t)}function ka(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ya===null){if(e===null)throw Error(i(308));ya=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ya=ya.next=t;return n}var Aa=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()})}},ja=t.unstable_scheduleCallback,Ma=t.unstable_NormalPriority,z={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Na(){return{controller:new Aa,data:new Map,refCount:0}}function Pa(e){e.refCount--,e.refCount===0&&ja(Ma,function(){e.controller.abort()})}function Fa(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 Ia=null;function La(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Ra=null,za=0,Ba=0,Va=null;function Ha(e,t){if(Ra===null){var n=Ra=[];za=0,Ba=Hf(),Va={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return za++,t.then(Ua,Ua),t}function Ua(){if(--za===0&&(Ia=null,Ra!==null)){Va!==null&&(Va.status=`fulfilled`);var e=Ra;Ra=null,Ba=0,Va=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Wa(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 Ga=M.S;M.S=function(e,t){if(Sd=Ge(),typeof t==`object`&&t&&typeof t.then==`function`&&Ha(e,t),Ia!==null)for(var n=Of;n!==null;)Fa(n,Ia),n=n.next;if(n=e.types,n!==null){for(var r=Of;r!==null;)Fa(r,n),r=r.next;if(Ba!==0){r=Ia,r===null&&(r=Ia=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ga!==null&&Ga(e,t)};var Ka=Se(null);function qa(){var e=Ka.current;return e===null?rd.pooledCache:e}function Ja(e,t){t===null?we(Ka,Ka.current):we(Ka,t.pool)}function Ya(){var e=qa();return e===null?null:{parent:z._currentValue,pool:e}}var Xa=Error(i(460)),Za=Error(i(474)),Qa=Error(i(542)),$a={then:function(){}};function eo(e){return e=e.status,e===`fulfilled`||e===`rejected`}function to(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(xn,xn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ao(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(xn,xn);else{if(e=rd,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ao(e),e}throw ro=t,Xa}}function no(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(ro=e,Xa):e}}var ro=null;function io(){if(ro===null)throw Error(i(459));var e=ro;return ro=null,e}function ao(e){if(e===Xa||e===Qa)throw Error(i(483))}var oo=null,so=0;function co(e){var t=so;return so+=1,oo===null&&(oo=[]),to(oo,e,t)}function lo(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function uo(e,t){throw t.$$typeof===ee?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function fo(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=Fi(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=zi(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===k?(e=d(e,t,n.props.children,r,n.key),lo(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===j&&no(i)===t.type)?(t=a(t,n.props),lo(t,n),t.return=e,t):(t=Li(n.type,n.key,n.props,null,e.mode,r),lo(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=Vi(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=Ri(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=zi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case O:return n=Li(t.type,t.key,t.props,null,e.mode,n),lo(n,t),n.return=e,n;case te:return t=Vi(t,e.mode,n),t.return=e,t;case j:return t=no(t),f(e,t,n)}if(ve(t)||he(t))return t=Ri(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,co(t),n);if(t.$$typeof===A)return f(e,Oa(e,t),n);uo(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case O:return n.key===i?l(e,t,n,r):null;case te:return n.key===i?u(e,t,n,r):null;case j:return n=no(n),p(e,t,n,r)}if(ve(n)||he(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,co(n),r);if(n.$$typeof===A)return p(e,t,Oa(e,n),r);uo(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case O:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case te:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case j:return r=no(r),m(e,t,n,r,i)}if(ve(r)||he(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,co(r),i);if(r.$$typeof===A)return m(e,t,n,Oa(t,r),i);uo(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),oa&&$i(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 oa&&$i(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)}),oa&&$i(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),oa&&$i(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 oa&&$i(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)}),oa&&$i(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===k&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case O:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===k){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),lo(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===j&&no(l)===r.type){n(e,r.sibling),c=a(r,o.props),lo(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===k?(c=Ri(o.props.children,e.mode,c,o.key),lo(c,o),c.return=e,e=c):(c=Li(o.type,o.key,o.props,null,e.mode,c),lo(c,o),c.return=e,e=c)}return s(e);case te: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=Vi(o,e.mode,c),c.return=e,e=c}return s(e);case j:return o=no(o),_(e,r,o,c)}if(ve(o))return h(e,r,o,c);if(he(o)){if(l=he(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,co(o),c);if(o.$$typeof===A)return _(e,r,Oa(e,o),c);uo(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=zi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{so=0;var i=_(e,t,n,r);return oo=null,i}catch(t){if(t===Xa||t===Qa)throw t;var a=Ni(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var po=fo(!0),mo=fo(!1),ho=!1;function go(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function _o(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 vo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function yo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,nd&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ai(e),ki(e,null,n),t}return Ei(e,r,t,n),Ai(e)}function bo(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,vt(e,n)}}function xo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var So=!1;function Co(){if(So){var e=Va;if(e!==null)throw e}}function wo(e,t,n,r){So=!1;var i=e.updateQueue;ho=!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?(ad&f)===f:(r&f)===f){f!==0&&f===Ba&&(So=!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:ho=!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),pd|=o,e.lanes=o,e.memoizedState=d}}function To(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Eo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)To(n[e],t)}var Do=Se(null),Oo=Se(0);function ko(e,t){e=dd,we(Oo,e),we(Do,t),dd=e|t.baseLanes}function Ao(){we(Oo,dd),we(Do,Do.current)}function jo(){dd=Oo.current,Ce(Do),Ce(Oo)}var Mo=Se(null),No=null;function Po(e){var t=e.alternate;we(zo,zo.current&1),we(Mo,e),No===null&&(t===null||Do.current!==null||t.memoizedState!==null)&&(No=e)}function Fo(e){we(zo,zo.current),we(Mo,e),No===null&&(No=e)}function Io(e){e.tag===22?(we(zo,zo.current),we(Mo,e),No===null&&(No=e)):Lo()}function Lo(){we(zo,zo.current),we(Mo,Mo.current)}function Ro(e){Ce(Mo),No===e&&(No=null),Ce(zo)}var zo=Se(0);function Bo(e,t){we(Mo,Mo.current),we(zo,t)}function Vo(e){Ce(zo),Ce(Mo),No===e&&(No=null)}function Ho(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||hm(n)||gm(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 Uo=0,B=null,Wo=null,Go=null,Ko=!1,qo=!1,Jo=!1,Yo=0,Xo=0,Zo=null,Qo=0;function $o(){throw Error(i(321))}function es(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ur(e[n],t[n]))return!1;return!0}function ts(e,t,n,r,i,a){return Uo=a,B=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,M.H=e===null||e.memoizedState===null?gc:_c,Jo=!1,a=n(r,i),Jo=!1,qo&&(a=rs(t,n,r,i)),ns(e),a}function ns(e){M.H=hc;var t=Wo!==null&&Wo.next!==null;if(Uo=0,Go=Wo=B=null,Ko=!1,Xo=0,Zo=null,t)throw Error(i(300));e===null||Pc||(e=e.dependencies,e!==null&&Ta(e)&&(Pc=!0))}function rs(e,t,n,r){B=e;var a=0;do{if(qo&&(Zo=null),Xo=0,qo=!1,25<=a)throw Error(i(301));if(a+=1,Go=Wo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}M.H=vc,o=t(n,r)}while(qo);return o}function is(){var e=M.H,t=e.useState()[0];return t=typeof t.then==`function`?ds(t):t,e=e.useState()[0],(Wo===null?null:Wo.memoizedState)!==e&&(B.flags|=1024),t}function as(){var e=Yo!==0;return Yo=0,e}function os(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ss(e){if(Ko){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ko=!1}Uo=0,Go=Wo=B=null,qo=!1,Xo=Yo=0,Zo=null}function cs(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Go===null?B.memoizedState=Go=e:Go=Go.next=e,Go}function ls(){if(Wo===null){var e=B.alternate;e=e===null?null:e.memoizedState}else e=Wo.next;var t=Go===null?B.memoizedState:Go.next;if(t!==null)Go=t,Wo=e;else{if(e===null)throw B.alternate===null?Error(i(467)):Error(i(310));Wo=e,e={memoizedState:Wo.memoizedState,baseState:Wo.baseState,baseQueue:Wo.baseQueue,queue:Wo.queue,next:null},Go===null?B.memoizedState=Go=e:Go=Go.next=e}return Go}function us(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ds(e){var t=Xo;return Xo+=1,Zo===null&&(Zo=[]),e=to(Zo,e,t),t=B,(Go===null?t.memoizedState:Go.next)===null&&(t=t.alternate,M.H=t===null||t.memoizedState===null?gc:_c),e}function fs(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ds(e);if(e.$$typeof===pe)return;if(e.$$typeof===A)return Da(e)}throw Error(i(438,String(e)))}function ps(e){var t=null,n=B.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=B.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=us(),B.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]=de;return t.index++,n}function ms(e,t){return typeof t==`function`?t(e):t}function hs(e){return gs(ls(),Wo,e)}function gs(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?(Uo&f)===f:(ad&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===Ba&&(d=!0);else if((Uo&p)===p){u=u.next,p===Ba&&(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,B.lanes|=p,pd|=p;f=u.action,Jo&&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,B.lanes|=f,pd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Ur(o,e.memoizedState)&&(Pc=!0,d&&(n=Va,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 V(e){var t=ls(),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);Ur(o,t.memoizedState)||(Pc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function _s(e,t,n){var r=B,a=ls(),o=oa;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Ur((Wo||a).memoizedState,n);if(s&&(a.memoizedState=n,Pc=!0),a=a.queue,Hs(bs.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Go!==null&&!!(Go.memoizedState.tag&1),Ls(e?9:8,{destroy:void 0},ys.bind(null,r,a,n,t),null),e){if(r.flags|=2048,rd===null)throw Error(i(349));o||Uo&127||vs(r,t,n)}return n}function vs(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=B.updateQueue,t===null?(t=us(),B.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ys(e,t,n,r){t.value=n,t.getSnapshot=r,xs(t)&&Ss(e)}function bs(e,t,n){return n(function(){xs(t)&&Ss(e)})}function xs(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ur(e,n)}catch{return!0}}function Ss(e){var t=Oi(e,2);t!==null&&Vd(t,e,2)}function Cs(e){var t=cs();if(typeof e==`function`){var n=e;if(e=n(),Jo){tt(!0);try{n()}finally{tt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ms,lastRenderedState:e},t}function ws(e,t,n,r){return e.baseState=n,gs(e,Wo,typeof r==`function`?r:ms)}function Ts(e,t,n,r,a){if(fc(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)}};M.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Es(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Es(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=M.T,o={};o.types=a===null?null:a.types,M.T=o;try{var s=n(i,r),c=M.S;c!==null&&c(o,s),Ds(e,t,s)}catch(n){ks(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),M.T=a}}else try{a=n(i,r),Ds(e,t,a)}catch(n){ks(e,t,n)}}function Ds(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Os(e,t,n)},function(n){return ks(e,t,n)}):Os(e,t,n)}function Os(e,t,n){t.status=`fulfilled`,t.value=n,As(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Es(e,n)))}function ks(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,As(t),t=t.next;while(t!==r)}e.action=null}function As(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function js(e,t){return t}function Ms(e,t){if(oa){var n=rd.formState;if(n!==null){a:{var r=B;if(oa){if(aa){b:{for(var i=aa,a=ca;i.nodeType!==8;){if(!a){i=null;break b}if(i=vm(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){aa=vm(i.nextSibling),r=i.data===`F!`;break a}}ua(r)}r=!1}r&&(t=n[0])}}return n=cs(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:js,lastRenderedState:t},n.queue=r,n=lc.bind(null,B,r),r.dispatch=n,r=Cs(!1),a=dc.bind(null,B,!1,r.queue),r=cs(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Ts.bind(null,B,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ns(e){return Ps(ls(),Wo,e)}function Ps(e,t,n){if(t=gs(e,t,js)[0],e=hs(ms)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ds(t)}catch(e){throw e===Xa?Qa:e}else r=t;t=ls();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(B.flags|=2048,Ls(9,{destroy:void 0},Fs.bind(null,i,n),null)),[r,a,e]}function Fs(e,t){e.action=t}function Is(e){var t=ls(),n=Wo;if(n!==null)return Ps(t,n,e);ls(),t=t.memoizedState,n=ls();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Ls(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=B.updateQueue,t===null&&(t=us(),B.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Rs(){return ls().memoizedState}function zs(e,t,n,r){var i=cs();B.flags|=e,i.memoizedState=Ls(1|t,{destroy:void 0},n,r===void 0?null:r)}function Bs(e,t,n,r){var i=ls();r=r===void 0?null:r;var a=i.memoizedState.inst;Wo!==null&&r!==null&&es(r,Wo.memoizedState.deps)?i.memoizedState=Ls(t,a,n,r):(B.flags|=e,i.memoizedState=Ls(1|t,a,n,r))}function Vs(e,t){zs(8390656,8,e,t)}function Hs(e,t){Bs(2048,8,e,t)}function Us(e){B.flags|=4;var t=B.updateQueue;if(t===null)t=us(),B.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Ws(e){var t=ls().memoizedState;return Us({ref:t,nextImpl:e}),function(){if(nd&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Gs(e,t){return Bs(4,2,e,t)}function Ks(e,t){return Bs(4,4,e,t)}function H(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 qs(e,t,n){n=n==null?null:n.concat([e]),Bs(4,4,H.bind(null,t,e),n)}function Js(){}function Ys(e,t){var n=ls();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&es(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Xs(e,t){var n=ls();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&es(t,r[1]))return r[0];if(r=e(),Jo){tt(!0);try{e()}finally{tt(!1)}}return n.memoizedState=[r,t],r}function Zs(e,t,n){return n===void 0||Uo&1073741824&&!(ad&261930)?e.memoizedState=t:(e.memoizedState=n,e=zd(),B.lanes|=e,pd|=e,n)}function Qs(e,t,n,r){return Ur(n,t)?n:Do.current===null?!(Uo&106)||Uo&1073741824&&!(ad&261930)?(Pc=!0,e.memoizedState=n):(e=zd(),B.lanes|=e,pd|=e,t):(e=Zs(e,n,r),Ur(e,t)||(Pc=!0),e)}function $s(e,t,n,r,i){var a=N.p;N.p=a!==0&&8>a?a:8;var o=M.T,s={};s.types=o===null?null:o.types,M.T=s,dc(e,!1,t,n);try{var c=i(),l=M.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?uc(e,t,Wa(c,r),Rd(e)):uc(e,t,r,Rd(e))}catch(n){uc(e,t,{then:function(){},status:`rejected`,reason:n},Rd())}finally{N.p=a,o!==null&&s.types!==null&&(o.types=s.types),M.T=o}}function ec(){}function tc(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=nc(e).queue;$s(e,a,t,ye,n===null?ec:function(){return rc(e),n(r)})}function nc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ye,baseState:ye,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ms,lastRenderedState:ye},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ms,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function rc(e){var t=nc(e);t.next===null&&(t=e.alternate.memoizedState),uc(e,t.next.queue,{},Rd())}function ic(){return Da(gh)}function ac(){return ls().memoizedState}function oc(){return ls().memoizedState}function sc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Rd();e=vo(n);var r=yo(t,e,n);r!==null&&(Vd(r,t,n),bo(r,t,n)),t={cache:Na()},e.payload=t;return}t=t.return}}function cc(e,t,n){var r=Rd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},fc(e)?pc(t,n):(n=Di(e,t,n,r),n!==null&&(Vd(n,e,r),mc(n,t,r)))}function lc(e,t,n){uc(e,t,n,Rd())}function uc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(fc(e))pc(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,Ur(s,o))return Ei(e,t,i,0),rd===null&&Ti(),!1}catch{}if(n=Di(e,t,i,r),n!==null)return Vd(n,e,r),mc(n,t,r),!0}return!1}function dc(e,t,n,r){if(r={lane:2,revertLane:Hf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},fc(e)){if(t)throw Error(i(479))}else t=Di(e,n,r,2),t!==null&&Vd(t,e,2)}function fc(e){var t=e.alternate;return e===B||t!==null&&t===B}function pc(e,t){qo=Ko=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function mc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,vt(e,n)}}var hc={readContext:Da,use:fs,useCallback:$o,useContext:$o,useEffect:$o,useImperativeHandle:$o,useLayoutEffect:$o,useInsertionEffect:$o,useMemo:$o,useReducer:$o,useRef:$o,useState:$o,useDebugValue:$o,useDeferredValue:$o,useTransition:$o,useSyncExternalStore:$o,useId:$o,useHostTransitionStatus:$o,useFormState:$o,useActionState:$o,useOptimistic:$o,useMemoCache:$o,useCacheRefresh:$o,useEffectEvent:$o},gc={readContext:Da,use:fs,useCallback:function(e,t){return cs().memoizedState=[e,t===void 0?null:t],e},useContext:Da,useEffect:Vs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),zs(4194308,4,H.bind(null,t,e),n)},useLayoutEffect:function(e,t){return zs(4194308,4,e,t)},useInsertionEffect:function(e,t){zs(4,2,e,t)},useMemo:function(e,t){var n=cs();t=t===void 0?null:t;var r=e();if(Jo){tt(!0);try{e()}finally{tt(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=cs();if(n!==void 0){var i=n(t);if(Jo){tt(!0);try{n(t)}finally{tt(!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=cc.bind(null,B,e),[r.memoizedState,e]},useRef:function(e){var t=cs();return e={current:e},t.memoizedState=e},useState:function(e){e=Cs(e);var t=e.queue,n=lc.bind(null,B,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Js,useDeferredValue:function(e,t){return Zs(cs(),e,t)},useTransition:function(){var e=Cs(!1);return e=$s.bind(null,B,e.queue,!0,!1),cs().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=B,a=cs();if(oa){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),rd===null)throw Error(i(349));ad&127||vs(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Vs(bs.bind(null,r,o,e),[e]),r.flags|=2048,Ls(9,{destroy:void 0},ys.bind(null,r,o,n,t),null),n},useId:function(){var e=cs(),t=rd.identifierPrefix;if(oa){var n=Qi,r=Zi;n=(r&~(1<<32-nt(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Yo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Qo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ic,useFormState:Ms,useActionState:Ms,useOptimistic:function(e){var t=cs();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=dc.bind(null,B,!0,n),n.dispatch=t,[e,t]},useMemoCache:ps,useCacheRefresh:function(){return cs().memoizedState=sc.bind(null,B)},useEffectEvent:function(e){var t=cs(),n={impl:e};return t.memoizedState=n,function(){if(nd&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},_c={readContext:Da,use:fs,useCallback:Ys,useContext:Da,useEffect:Hs,useImperativeHandle:qs,useInsertionEffect:Gs,useLayoutEffect:Ks,useMemo:Xs,useReducer:hs,useRef:Rs,useState:function(){return hs(ms)},useDebugValue:Js,useDeferredValue:function(e,t){return Qs(ls(),Wo.memoizedState,e,t)},useTransition:function(){var e=hs(ms)[0],t=ls().memoizedState;return[typeof e==`boolean`?e:ds(e),t]},useSyncExternalStore:_s,useId:ac,useHostTransitionStatus:ic,useFormState:Ns,useActionState:Ns,useOptimistic:function(e,t){return ws(ls(),Wo,e,t)},useMemoCache:ps,useCacheRefresh:oc,useEffectEvent:Ws},vc={readContext:Da,use:fs,useCallback:Ys,useContext:Da,useEffect:Hs,useImperativeHandle:qs,useInsertionEffect:Gs,useLayoutEffect:Ks,useMemo:Xs,useReducer:V,useRef:Rs,useState:function(){return V(ms)},useDebugValue:Js,useDeferredValue:function(e,t){var n=ls();return Wo===null?Zs(n,e,t):Qs(n,Wo.memoizedState,e,t)},useTransition:function(){var e=V(ms)[0],t=ls().memoizedState;return[typeof e==`boolean`?e:ds(e),t]},useSyncExternalStore:_s,useId:ac,useHostTransitionStatus:ic,useFormState:Is,useActionState:Is,useOptimistic:function(e,t){var n=ls();return Wo===null?(n.baseState=e,[e,n.queue.dispatch]):ws(n,Wo,e,t)},useMemoCache:ps,useCacheRefresh:oc,useEffectEvent:Ws};function yc(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 bc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Rd(),i=vo(r);i.payload=t,n!=null&&(i.callback=n),t=yo(e,i,r),t!==null&&(Vd(t,e,r),bo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Rd(),i=vo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=yo(e,i,r),t!==null&&(Vd(t,e,r),bo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Rd(),r=vo(n);r.tag=2,t!=null&&(r.callback=t),t=yo(e,r,n),t!==null&&(Vd(t,e,n),bo(t,e,n))}};function xc(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?!Wr(n,r)||!Wr(i,a):!0}function Sc(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&&bc.enqueueReplaceState(t,t.state,null)}function Cc(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 wc(e){R(e)}function Tc(e){console.error(e)}function Ec(e){R(e)}function Dc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Oc(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 kc(e,t,n){return n=vo(n),n.tag=3,n.payload={element:null},n.callback=function(){Dc(e,t)},n}function Ac(e){return e=vo(e),e.tag=3,e}function jc(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(){Oc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Oc(t,n,r),typeof i!=`function`&&(Td===null?Td=new Set([this]):Td.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Mc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&wa(t,n,a,!0),n=Mo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return No===null?$d():n.alternate===null&&fd===0&&(fd=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===$a?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Sf(e,r,a)),!1;case 22:return n.flags|=65536,r===$a?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)),Sf(e,r,a)),!1}throw Error(i(435,n.tag))}return Sf(e,r,a),$d(),!1}if(oa)return t=Mo.current,t===null?(r!==la&&(t=Error(i(423),{cause:r}),ga(Ui(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Ui(r,n),a=kc(e.stateNode,r,a),xo(e,a),fd!==4&&(fd=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==la&&(e=Error(i(422),{cause:r}),ga(Ui(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Ui(o,n),vd===null?vd=[o]:vd.push(o),fd!==4&&(fd=2),t===null)return!0;r=Ui(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=kc(n.stateNode,r,e),xo(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`&&(Td===null||!Td.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Ac(a),jc(a,e,n,r),xo(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Nc=Error(i(461)),Pc=!1;function Fc(e,t,n,r){t.child=e===null?mo(t,null,n,r):po(t,e.child,n,r)}function Ic(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 Ea(t),r=ts(e,t,n,o,a,i),s=as(),e!==null&&!Pc?(os(e,t,i),ll(e,t,i)):(oa&&s&&ta(t),t.flags|=1,Fc(e,t,r,i),t.child)}function Lc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Pi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Rc(e,t,a,r,i)):(e=Li(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!ul(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Wr:n,n(o,r)&&e.ref===t.ref)return ll(e,t,i)}return t.flags|=1,e=Fi(a,r),e.ref=t.ref,e.return=t,t.child=e}function Rc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Wr(a,r)&&e.ref===t.ref){if(Pc=!1,t.pendingProps=r=a,ul(e,i))e.flags&131072&&(Pc=!0);else return t.lanes=e.lanes,ll(e,t,i)}}return U(e,t,n,r,i)}function zc(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 Vc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ja(t,a===null?null:a.cachePool),a===null?Ao():ko(t,a),Io(t);else return r=t.lanes=536870912,Vc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ja(t,null),Ao(),Lo()):(Ja(t,a.cachePool),ko(t,a),Lo(),t.memoizedState=null);return Fc(e,t,i,n),t.child}function Bc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Vc(e,t,n,r,i){var a=qa();return a=a===null?null:{parent:z._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ja(t,null),Ao(),Io(t),e!==null&&wa(e,t,r,!0),t.childLanes=i,null}function Hc(e,t){return t=el({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Uc(e,t,n){return po(t,e.child,null,n),e=Hc(t,t.pendingProps),e.flags|=2,Ro(t),t.memoizedState=null,e}function Wc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(oa){if(r.mode===`hidden`)return e=Hc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Bc(null,e);if(Fo(t),(e=aa)?(e=mm(e,ca),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Xi===null?null:{id:Zi,overflow:Qi},retryLane:536870912,hydrationErrors:null},n=Bi(e),n.return=t,t.child=n,ia=t,aa=null)):e=null,e===null)throw ua(t);return t.lanes=536870912,null}return Hc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Fo(t),a){if(t.flags&256)t.flags&=-257,t=Uc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Pc||wa(e,t,n,!1),a=(n&e.childLanes)!==0,Pc||a){if(Do.current===null){if(r=rd,r!==null&&(s=yt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Oi(e,s),Vd(r,e,s),Nc;$d()}t=Uc(e,t,n)}else e=o.treeContext,aa=vm(s.nextSibling),ia=t,oa=!0,sa=null,ca=!1,e!==null&&ra(t,e),t=Hc(t,r),t.flags|=134221824;return t}return e=Fi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Gc(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 U(e,t,n,r,i){return Ea(t),n=ts(e,t,n,r,void 0,i),r=as(),e!==null&&!Pc?(os(e,t,i),ll(e,t,i)):(oa&&r&&ta(t),t.flags|=1,Fc(e,t,n,i),t.child)}function Kc(e,t,n,r,i,a){return Ea(t),t.updateQueue=null,n=rs(t,r,n,i),ns(e),r=as(),e!==null&&!Pc?(os(e,t,a),ll(e,t,a)):(oa&&r&&ta(t),t.flags|=1,Fc(e,t,n,a),t.child)}function qc(e,t,n,r,i){if(Ea(t),t.stateNode===null){var a=ji,o=n.contextType;typeof o==`object`&&o&&(a=Da(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=bc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},go(t),o=n.contextType,a.context=typeof o==`object`&&o?Da(o):ji,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(yc(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&&bc.enqueueReplaceState(a,a.state,null),wo(t,r,a,i),Co(),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=Cc(n,s);a.props=c;var l=a.context,u=n.contextType;o=ji,typeof u==`object`&&u&&(o=Da(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)&&Sc(t,a,r,o),ho=!1;var f=t.memoizedState;a.state=f,wo(t,r,a,i),Co(),l=t.memoizedState,s||f!==l||ho?(typeof d==`function`&&(yc(t,n,d,r),l=t.memoizedState),(c=ho||xc(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,_o(e,t),o=t.memoizedProps,u=Cc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ji,typeof l==`object`&&l&&(c=Da(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)&&Sc(t,a,r,c),ho=!1,f=t.memoizedState,a.state=f,wo(t,r,a,i),Co();var p=t.memoizedState;o!==d||f!==p||ho||e!==null&&e.dependencies!==null&&Ta(e.dependencies)?(typeof s==`function`&&(yc(t,n,s,r),p=t.memoizedState),(u=ho||xc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Ta(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,Gc(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=po(t,e.child,null,i),t.child=po(t,null,n,i)):Fc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=ll(e,t,i),e}function Jc(e,t,n,r){return ma(),t.flags|=256,Fc(e,t,n,r),t.child}var Yc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Xc(e){return{baseLanes:e,cachePool:Ya()}}function Zc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=gd),e}function Qc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(zo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(oa){if(i?Po(t):Lo(),(e=aa)?(e=mm(e,ca),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Xi===null?null:{id:Zi,overflow:Qi},retryLane:536870912,hydrationErrors:null},n=Bi(e),n.return=t,t.child=n,ia=t,aa=null)):e=null,e===null)throw ua(t);return t.lanes=gm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Lo(),i=t.mode,a=el({mode:`hidden`,children:a},i),r=Ri(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Xc(n),r.childLanes=Zc(e,o,n),t.memoizedState=Yc,Bc(null,r)):(Po(t),$c(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return nl(e,t,a,o,r,c,s,n)}return i?(Lo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Fi(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Ri(i,a,n,null),i.flags|=2):i=Fi(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Bc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Xc(n):(a=i.cachePool,a===null?a=Ya():(s=z._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Zc(e,o,n),t.memoizedState=Yc,Bc(e.child,r)):(Po(t),n=e.child,e=n.sibling,n=Fi(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 $c(e,t){return t=el({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function el(e,t){return e=Ni(22,e,null,t),e.lanes=0,e}function tl(e,t,n){return po(t,e.child,null,n),e=$c(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function nl(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Po(t),t.flags&=-257,tl(e,t,c)):t.memoizedState===null?(Lo(),o=a.fallback,s=t.mode,a=el({mode:`visible`,children:a.children},s),o=Ri(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,po(t,e.child,null,c),a=t.child,a.memoizedState=Xc(c),a.childLanes=Zc(e,r,c),t.memoizedState=Yc,Bc(null,a)):(Lo(),t.child=e.child,t.flags|=128,null);if(Po(t),gm(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,ga({value:a,source:null,stack:null})),tl(e,t,c)}if(Pc||wa(e,t,c,!1),r=(c&e.childLanes)!==0,Pc||r){if(Do.current!==null)return tl(e,t,c);if(r=rd,r!==null&&(a=yt(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Oi(e,a),Vd(r,e,a),Nc;return hm(o)||$d(),tl(e,t,c)}return hm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,aa=vm(o.nextSibling),ia=t,oa=!0,sa=null,ca=!1,e!==null&&ra(t,e),t=$c(t,a.children),t.flags|=134221824,t)}function rl(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Sa(e.return,t,n)}function il(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Ho(n)===null&&(t=e),e=e.sibling}return t}function al(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 ol(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 sl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=zo.current;if(t.flags&128)return Bo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Bo(t,o),i===`backwards`&&e!==null?(ol(e),Fc(e,t,r,n),ol(e)):Fc(e,t,r,n),r=oa?qi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&rl(e,n,t);else if(e.tag===19)rl(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=il(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,ol(t)),al(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&&Ho(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}al(t,!0,n,null,a,r);break;case`together`:al(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=il(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),al(t,!1,i,n,a,r)}return t.child}function cl(e,t,n){var r=t.pendingProps;return ba(t,t.type,r.value),Fc(e,t,r.children,n),t.child}function ll(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),pd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(wa(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=Fi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Fi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function ul(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Ta(e)))}function dl(e,t,n){switch(t.tag){case 3:ke(t,t.stateNode.containerInfo),ba(t,z,e.memoizedState.cache),ma();break;case 27:case 5:je(t);break;case 4:ke(t,t.stateNode.containerInfo);break;case 10:ba(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Fo(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Po(t),t.flags|=128,null;r=wa(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Qc(e,t,n):(Po(t),e=ll(e,t,n),e===null?null:e.sibling)}Po(t);break;case 19:if(t.flags&128)return sl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(wa(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return sl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Bo(t,zo.current),r)break;return null;case 22:return t.lanes=0,zc(e,t,n,t.pendingProps);case 24:ba(t,z,e.memoizedState.cache)}return ll(e,t,n)}function fl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Pc=!0;else{if(!ul(e,n)&&!(t.flags&128))return Pc=!1,dl(e,t,n);Pc=!!(e.flags&131072)}}else Pc=!1,oa&&t.flags&1048576&&ea(t,qi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=no(t.elementType),t.type=e,typeof e==`function`)Pi(e)?(r=Cc(e,r),t.tag=1,t=qc(null,t,e,r,n)):(t.tag=0,t=U(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===ae){t.tag=11,t=Ic(null,t,e,r,n);break a}if(a===ce){t.tag=14,t=Lc(null,t,e,r,n);break a}if(a===A){t.tag=10,t.type=e,t=cl(null,t,n);break a}}throw t=_e(e)||e,Error(i(306,t,``))}}return t;case 0:return U(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Cc(r,t.pendingProps),qc(e,t,r,a,n);case 3:a:{if(ke(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,_o(e,t),wo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ba(t,z,r),r!==o.cache&&Ca(t,[z],n,!0),Co(),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=Jc(e,t,r,n);break a}if(r!==a){a=Ui(Error(i(424)),t),ga(a),t=Jc(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(aa=vm(e.firstChild),ia=t,oa=!0,sa=null,ca=!0,n=mo(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(ma(),r===a){t=ll(e,t,n);break a}Fc(e,t,r,n)}t=t.child}return t;case 26:return Gc(e,t),e===null?(n=Hm(t.type,null,t.pendingProps,null))?t.memoizedState=n:oa||(t.stateNode=Sp(t.type,t.pendingProps,De.current,t)):t.memoizedState=Hm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return je(t),e===null&&oa&&(r=t.stateNode=wm(t.type,t.pendingProps,De.current),ia=t,ca=!0,a=aa,jp(t.type)?(ym=a,aa=vm(r.firstChild)):aa=a),Fc(e,t,t.pendingProps.children,n),Gc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&oa&&((a=r=aa)&&(r=fm(r,t.type,t.pendingProps,ca),r===null?a=!1:(t.stateNode=r,ia=t,aa=vm(r.firstChild),ca=!1,a=!0)),a||ua(t)),je(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Cp(a,o)?r=null:s!==null&&Cp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=ts(e,t,is,null,null,n),gh._currentValue=a),Gc(e,t),Fc(e,t,r,n),t.child;case 6:return e===null&&oa&&((e=n=aa)&&(n=pm(n,t.pendingProps,ca),n===null?e=!1:(t.stateNode=n,ia=t,aa=null,e=!0)),e||ua(t)),null;case 13:return Qc(e,t,n);case 4:return ke(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=po(t,null,r,n):Fc(e,t,r,n),t.child;case 11:return Ic(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Gc(e,t),Fc(e,t,r,n),t.child;case 8:return Fc(e,t,t.pendingProps.children,n),t.child;case 12:return Fc(e,t,t.pendingProps.children,n),t.child;case 10:return cl(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,Ea(t),a=Da(a),r=r(a),t.flags|=1,Fc(e,t,r,n),t.child;case 14:return Lc(e,t,t.type,t.pendingProps,n);case 15:return Rc(e,t,t.type,t.pendingProps,n);case 19:return sl(e,t,n);case 31:return Wc(e,t,n);case 22:return zc(e,t,n,t.pendingProps);case 24:return Ea(t),r=Da(z),e===null?(a=qa(),a===null&&(a=rd,o=Na(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},go(t),ba(t,z,a)):((e.lanes&n)!==0&&(_o(e,t),wo(t,null,null,n),Co()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,ba(t,z,r),r!==a.cache&&Ca(t,[z],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ba(t,z,r))),Fc(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:oa&&ta(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Gc(e,t),Fc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function pl(e){e.flags|=4}function ml(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?rh(t,r):rh(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(Xd())e.flags|=8192;else throw ro=$a,Za}}else e.flags&=-16777217}function hl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!ih(t)){if(Xd())e.flags|=8192;else throw ro=$a,Za}}function gl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:pt(),e.lanes|=t,_d|=t)}function _l(e,t){if(!oa)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 vl(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 yl(e,t,n){var r=t.pendingProps;switch(na(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return vl(t),null;case 1:return vl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),xa(z),Ae(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(pa(t)?pl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ha())),vl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(pl(t),o===null?(vl(t),ml(t,a,null,r,n)):(vl(t),hl(t,o))):o?o===e.memoizedState?(vl(t),t.flags&=-16777217):(pl(t),vl(t),hl(t,o)):(e=e.memoizedProps,e!==r&&pl(t),vl(t),ml(t,a,e,r,n)),null;case 27:if(Me(t),n=De.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&pl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return vl(t),t.subtreeFlags&=-33554433,null}e=Te.current,pa(t)?da(t,e):(e=wm(a,r,n),t.stateNode=e,pl(t))}return vl(t),t.subtreeFlags&=-33554433,null;case 5:if(Me(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&pl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return vl(t),t.subtreeFlags&=-33554433,null}if(o=Te.current,pa(t))da(t,o);else{var s=yp(De.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[Tt]=t,o[Et]=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(fp(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&&pl(t)}}return vl(t),t.subtreeFlags&=-33554433,ml(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&pl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=De.current,pa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=ia,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[Tt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||lp(e.nodeValue,n)),e||ua(t,!0)}else e=yp(e).createTextNode(r),e[Tt]=t,t.stateNode=e}return vl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=pa(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[Tt]=t}else ma(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;vl(t),e=!1}else n=ha(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Ro(t),t):(Ro(t),null);if(t.flags&128)throw Error(i(558))}return vl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=pa(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[Tt]=t}else ma(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;vl(t),a=!1}else a=ha(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Ro(t),t):(Ro(t),null)}return Ro(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),gl(t,t.updateQueue),vl(t),null);case 4:return Ae(),e===null&&$f(t.stateNode.containerInfo),t.flags|=67108864,vl(t),null;case 10:return xa(t.type),vl(t),null;case 19:if(Vo(t),r=t.memoizedState,r===null)return vl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)_l(r,!1);else{if(fd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Ho(e),o!==null){for(t.flags|=128,_l(r,!1),e=o.updateQueue,t.updateQueue=e,gl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ii(n,e),n=n.sibling;return Bo(t,zo.current&1|2),oa&&$i(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ge()>Cd&&(t.flags|=128,a=!0,_l(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Ho(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,gl(t,e),_l(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!oa)return vl(t),null}else 2*Ge()-r.renderingStartTime>Cd&&n!==536870912&&(t.flags|=128,a=!0,_l(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=Ge(),e.sibling=null,o=zo.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||oa?Bo(t,o):(n=o,we(Mo,t),we(zo,n),No===null&&(No=t)),oa&&$i(t,r.treeForkCount),e}return vl(t),null;case 22:case 23:return Ro(t),jo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(vl(t),t.subtreeFlags&6&&(t.flags|=8192)):vl(t),n=t.updateQueue,n!==null&&gl(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&&Ce(Ka),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),xa(z),vl(t),null;case 25:return null;case 30:return t.flags|=33554432,vl(t),null}throw Error(i(156,t.tag))}function bl(e,t){switch(na(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return xa(z),Ae(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Me(t),null;case 31:if(t.memoizedState!==null){if(Ro(t),t.alternate===null)throw Error(i(340));ma()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ro(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));ma()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Vo(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 Ae(),null;case 10:return xa(t.type),null;case 22:case 23:return Ro(t),jo(),e!==null&&Ce(Ka),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return xa(z),null;case 25:return null;default:return null}}function xl(e,t){switch(na(t),t.tag){case 3:xa(z),Ae();break;case 26:case 27:case 5:Me(t);break;case 4:Ae();break;case 31:t.memoizedState!==null&&Ro(t);break;case 13:Ro(t);break;case 19:Vo(t);break;case 10:xa(t.type);break;case 22:case 23:Ro(t),jo(),e!==null&&Ce(Ka);break;case 24:xa(z)}}function Sl(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){xf(t,t.return,e)}}function Cl(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){xf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){xf(t,t.return,e)}}function wl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Eo(t,n)}catch(t){xf(e,e.return,t)}}}function Tl(e,t,n){n.props=Cc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){xf(e,t,n)}}function El(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=yi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Up(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Wp(e);h(e.child,!1,sm,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){xf(e,t,n)}}function Dl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){xf(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){xf(e,t,n)}else n.current=null}}function Ol(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++)lm(e.stateNode,t[n])}function kl(e){for(var t=e.return;t!==null&&(Ml(t)&&lm(e.stateNode,t.stateNode),!jl(t));)t=t.return}function Al(e){for(var t=e.return;t!==null&&(Ml(t)&&um(e.stateNode,t.stateNode),!jl(t));)t=t.return}function jl(e){return e.tag===5||e.tag===3||e.tag===27}function Ml(e){return e&&e.tag===7&&e.stateNode!==null}function Nl(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){xf(e,e.return,t)}}function Pl(e,t,n){try{var r=e.stateNode;mp(r,e.type,n,t),r[Et]=t}catch(t){xf(e,e.return,t)}}function Fl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&jp(e.type)||e.tag===4}function Il(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Fl(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&&jp(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 Ll(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=xn)),Ol(e,r),Yt=!0;else if(i!==4&&(i===27&&(Ol(e,r),r=null,jp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Ll(e,t,n,r),e=e.sibling;e!==null;)Ll(e,t,n,r),e=e.sibling}function Rl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Ol(e,r),Yt=!0;else if(i!==4&&(i===27&&(Ol(e,r),r=null,jp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Rl(e,t,n,r),e=e.sibling;e!==null;)Rl(e,t,n,r),e=e.sibling}function zl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);fp(t,r,n),t[Tt]=e,t[Et]=n}catch(t){xf(e,e.return,t)}}var Bl=!1,Vl=null;function Hl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Bl=!0)}var Ul=null;function Wl(){var e=Ul;return Ul=null,e}var Gl=0;function Kl(e,t,n,r,i){return Gl=0,ql(e.child,t,n,r,i)}function ql(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Lp(o);r.push(s),s.view&&(a=!0)}else a||Lp(o).view&&(a=!0);Bl=!0,Pp(o,Gl===0?t:t+`_`+Gl,n),Gl++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||ql(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Jl(e,t){for(;e!==null;)e.tag===5?Fp(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Jl(e.child,t)),e=e.sibling}function Yl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Yl(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=xi(t.default,t.share),t!==`none`&&(Kl(e,n,t,null,!1)||Jl(e.child,!1))}e=e.sibling}}function Xl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=yi(r,n),a=xi(r.default,n.paired?r.share:r.enter);a===`none`?Yl(e):Kl(e,i,a,null,!1)?(Yl(e),n.paired||t||Bd(e,r.onEnter)):Jl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Xl(e,t),e=e.sibling;else Yl(e)}function Zl(e){if(Vl!==null&&Vl.size!==0){var t=Vl;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=xi(n.default,n.share);if(a!==`none`&&(Kl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Bd(e,n.onShare)):Jl(e.child,!1)),t.delete(r),t.size===0)break}}}Zl(e)}e=e.sibling}}}function Ql(e){if(e.tag===30){var t=e.memoizedProps,n=yi(t,e.stateNode),r=Vl===null?void 0:Vl.get(n),i=xi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Kl(e,n,i,null,!1)?r===void 0?Bd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Vl.delete(n),Bd(e,t.onShare)):Jl(e.child,!1)),Vl!==null&&Zl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Ql(e),e=e.sibling;else Vl!==null&&Zl(e)}function $l(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=yi(t,e.stateNode);t=xi(t.default,t.update),e.flags&=-5,t!==`none`&&Kl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&$l(e);e=e.sibling}}function eu(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,Jl(e.child,!1))}eu(e)}e=e.sibling}}function tu(e){if(e.tag===30)e.stateNode.paired=null,Jl(e.child,!1),eu(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)tu(e),e=e.sibling;else eu(e)}function nu(e){for(e=e.child;e!==null;)e.tag===30?Jl(e.child,!1):e.subtreeFlags&33554432&&nu(e),e=e.sibling}function ru(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Gl<a.length){var l=a[Gl],u=Lp(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&&Pp(c,Gl===0?n:n+`_`+Gl,i),s&&e.flags&4||(Ul===null&&(Ul=[]),Ul.push(c,Gl===0?r:r+`_`+Gl,t.memoizedProps)),Gl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:ru(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function iu(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=yi(n,r),a=xi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Rp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Gl=0,i=ru(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Bd(e,n.onUpdate))}else e.subtreeFlags&33554432&&iu(e,t);e=e.sibling}}var au=!1,ou=!1,su=!1,cu=!1,lu=typeof WeakSet==`function`?WeakSet:Set,uu=null,du=!1,fu=!1,pu=!1,mu=!1;function hu(e,t,n){if(e=e.containerInfo,_p=Th,e=Yr(e),Xr(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(vp={focusedElem:e,selectionRange:r},Th=!1,n=(n&335544064)===n,uu=t,t=n?9270:1024;uu!==null;){if(e=uu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Ql(r[a]);if(e.alternate===null&&e.flags&2)n&&Hl(e),gu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Ql(r),gu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Hl(e),gu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,uu=r):(n&&$l(e),gu(n))}}Vl=null}function gu(e){for(;uu!==null;){var t=uu,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=Cc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){xf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)dm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:dm(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=yi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=xi(a.default,a.update),a!==`none`&&Kl(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,uu=r;break}uu=t.return}}function _u(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Lu(e,n),r&4&&Sl(5,n);break;case 1:if(Lu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){xf(n,n.return,e)}else{var i=Cc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){xf(n,n.return,e)}}}r&64&&wl(n),r&512&&El(n,n.return);break;case 3:if(Lu(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{Eo(e,t)}catch(e){xf(n,n.return,e)}}break;case 27:t===null&&r&4&&zl(n);case 26:case 5:Lu(e,n),t===null&&r&4&&Nl(n),r&512&&El(n,n.return);break;case 12:Lu(e,n);break;case 31:Lu(e,n),r&4&&Eu(e,n);break;case 13:Lu(e,n),r&4&&Du(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Tf.bind(null,n),_m(e,n))));break;case 22:if(r=n.memoizedState!==null||au,!r){var a=t!==null&&t.memoizedState!==null||ou;t=au,i=ou,au=r,(ou=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),zu(e,n,r)):Lu(e,n),au=t,ou=i}break;case 30:Lu(e,n),r&512&&El(n,n.return);break;case 7:r&512&&El(n,n.return);default:Lu(e,n)}}function vu(e,t){for(e=e.child;e!==null;)yu(e,t),e=e.sibling}function yu(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){xf(e,e.return,t)}bu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,Yt=!0}catch(t){xf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Np(s,!0):Np(e.stateNode,!1)}catch(t){xf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&vu(e,t);break;default:vu(e,t)}}function bu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:yu(n,r);break a;case 22:n.memoizedState===null&&bu(n,r);break a;default:bu(n,r)}}e=e.sibling}}function xu(e){var t=e.alternate;t!==null&&(e.alternate=null,xu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Pt(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 Su=null,Cu=!1;function wu(e,t,n){for(n=n.child;n!==null;)Tu(e,t,n),n=n.sibling}function Tu(e,t,n){if(P&&typeof P.onCommitFiberUnmount==`function`)try{P.onCommitFiberUnmount(et,n)}catch{}switch(n.tag){case 26:ou||Dl(n,t),wu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!ou&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:ou||Dl(n,t),Al(n);var r=Su,i=Cu;jp(n.type)&&(Su=n.stateNode,Cu=!1),wu(e,t,n),Tm(n.stateNode,n.type,n.memoizedProps),Su=r,Cu=i;break;case 5:ou||Dl(n,t),Al(n);case 6:if(n.tag===6&&Al(n),r=Su,i=Cu,Su=null,wu(e,t,n),Su=r,Cu=i,Su!==null){if(Cu)try{(Su.nodeType===9?Su.body:Su.nodeName===`HTML`?Su.ownerDocument.body:Su).removeChild(n.stateNode),Yt=!0}catch(e){xf(n,t,e)}else try{Su.removeChild(n.stateNode),Yt=!0}catch(e){xf(n,t,e)}}break;case 18:Su!==null&&(Cu?(e=Su,Mp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Zh(e)):Mp(Su,n.stateNode));break;case 4:r=Su,i=Cu,Su=n.stateNode.containerInfo,Cu=!0,wu(e,t,n),Su=r,Cu=i;break;case 0:case 11:case 14:case 15:Cl(2,n,t),ou||Cl(4,n,t),wu(e,t,n);break;case 1:ou||(Dl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Tl(n,t,r)),wu(e,t,n);break;case 21:wu(e,t,n);break;case 22:ou=(r=ou)||n.memoizedState!==null,wu(e,t,n),ou=r;break;case 30:Dl(n,t),wu(e,t,n);break;case 7:ou||Dl(n,t),wu(e,t,n);break;default:wu(e,t,n)}}function Eu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Zh(e)}catch(e){xf(t,t.return,e)}}}function Du(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Zh(e)}catch(e){xf(t,t.return,e)}}function Ou(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new lu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new lu),t;default:throw Error(i(435,e.tag))}}function ku(e,t){var n=Ou(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Ef.bind(null,e,t);t.then(r,r)}})}function Au(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(jp(l.type)){Su=l.stateNode,Cu=!1;break a}break;case 5:Su=l.stateNode,Cu=!1;break a;case 3:case 4:Su=l.stateNode.containerInfo,Cu=!0;break a}l=l.return}if(Su===null)throw Error(i(160));Tu(s,c,o),Su=null,Cu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Mu(t,e,n),t=t.sibling}var ju=null;function Mu(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}Au(t,e,n),Nu(e),a&4&&(Cl(3,e,e.return),Sl(3,e),Cl(5,e,e.return));break;case 1:Au(t,e,n),Nu(e),a&512&&(ou||r===null||Dl(r,r.return)),a&64&&au&&(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=ju,Au(t,e,n),Nu(e),a&512&&(ou||r===null||Dl(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(au)e.stateNode=Sp(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[Mt]||r[Tt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),fp(r,t,n),r[Tt]=e,zt(r),t=r;break a;case`link`:if(o=eh(`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),fp(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=eh(`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),fp(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[Tt]=e,zt(r),t=r}e.stateNode=t}}else au||th(o,e.type,e.stateNode)}else e.stateNode=Ym(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Pl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||ou||t.parentNode.removeChild(t)):a.count--,n===null?au||th(o,e.type,e.stateNode):Ym(o,n,e.memoizedProps))}break;case 27:Au(t,e,n),Nu(e),a&512&&(ou||r===null||Dl(r,r.return)),r!==null&&a&4&&Pl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=su,su=!1,Au(t,e,n),su=o,Nu(e),a&512&&(ou||r===null||Dl(r,r.return)),e.flags&32){t=e.stateNode;try{mn(t,``),Yt=!0}catch(t){xf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Pl(e,t,r===null?t:r.memoizedProps)),a&1024&&(cu=!0);break;case 6:if(Au(t,e,n),Nu(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Yt=!0}catch(t){xf(e,e.return,t)}}break;case 3:if(Yt=!1,$m=null,o=ju,ju=km(t.containerInfo),Au(t,e,n),ju=o,Nu(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Zh(t.containerInfo)}catch(t){xf(e,e.return,t)}cu&&(cu=!1,Pu(e)),Yt=!1;break;case 4:a=su,su=au,r=Xt(),o=ju,ju=km(e.stateNode.containerInfo),Au(t,e,n),Nu(e),ju=o,Yt&&fu&&(pu=!0),Yt=r,su=a;break;case 12:Au(t,e,n),Nu(e);break;case 31:Au(t,e,n),Nu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ku(e,t)));break;case 13:Au(t,e,n),Nu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(xd=Ge()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ku(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=au,l=ou,u=su;au=c||o,su=u||o,ou=l||s,Au(t,e,n),ou=l,su=u,au=c,Nu(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||au||ou||(t=s||ou,n=au,r=ou,au=o||au,ou=t,Ru(e,2),au=n,ou=r),!o&&su||vu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,ku(e,n))));break;case 19:Au(t,e,n),Nu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ku(e,t)));break;case 30:a&512&&(ou||r===null||Dl(r,r.return)),a=Xt(),o=fu,s=(n&335544064)===n,c=e.memoizedProps,fu=s&&xi(c.default,c.update)!==`none`,Au(t,e,n),Nu(e),s&&r!==null&&Yt&&(e.flags|=4),fu=o,Yt=a;break;case 21:break;case 7:a&512&&(ou||r===null||Dl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Au(t,e,n),Nu(e)}}function Nu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Fl(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Ml(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(jl(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Rl(e,Il(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(mn(l,``),n.flags&=-33),Rl(e,Il(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Ll(e,Il(e),u,s);break;default:throw Error(i(161))}}catch(t){xf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Pu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Pu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Th=!0,t.reset(),Th=!1),e=e.sibling}}function Fu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Iu(t,e),t=t.sibling;else iu(t,!1)}function Iu(e,t){var n=e.alternate;if(n===null)Xl(e,!1);else switch(e.tag){case 3:if(mu=du=!1,Wl(),Fu(t,e),!du&&!pu){if(e=Ul,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Fp(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`})),mu=!0}Ul=null;break;case 5:Fu(t,e);break;case 4:r=du,du=!1,Fu(t,e),du&&(pu=!0),du=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Fu(t,e):Xl(e,!1));break;case 30:r=du,i=Wl(),du=!1,Fu(t,e),du&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=yi(a,o),o=yi(n.memoizedProps,o);var s=xi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Gl=0,t=ru(e,n,t,o,s,a,!0),Gl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Bd(e,e.memoizedProps.onUpdate),Ul=i):i!==null&&(i.push.apply(i,Ul),Ul=i),du=e.flags&32?!0:r;break;default:Fu(t,e)}}function Lu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)_u(e,t.alternate,t),t=t.sibling}function Ru(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:Cl(4,n,n.return),Ru(n,r);break;case 1:Dl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&Tl(n,n.return,i),Ru(n,r);break;case 27:r&2&&Tm(n.stateNode,n.type,n.memoizedProps);case 5:Dl(n,n.return),n.tag!==5&&n.tag!==27||Al(n),Ru(n,r);break;case 6:Al(n);break;case 26:Dl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||ou||i.parentNode.removeChild(i),Ru(n,r);break;case 22:n.memoizedState===null&&Ru(n,r);break;case 30:Dl(n,n.return),Ru(n,r);break;case 7:Dl(n,n.return);default:Ru(n,r)}e=e.sibling}}function zu(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:zu(i,a,n),Sl(4,a);break;case 1:if(zu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){xf(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++)To(l[i],c)}catch(e){xf(r,r.return,e)}}s&&o&64&&wl(a),El(a,a.return);break;case 27:n&2&&zl(a);case 5:a.tag!==5&&a.tag!==27||kl(a),zu(i,a,n),s&&r===null&&o&4&&Nl(a),El(a,a.return);break;case 6:kl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||au||th(km(c.ownerDocument),a.type,c),zu(i,a,n),s&&r===null&&o&4&&Nl(a),El(a,a.return);break;case 12:zu(i,a,n);break;case 31:zu(i,a,n),s&&o&4&&Eu(i,a);break;case 13:zu(i,a,n),s&&o&4&&Du(i,a);break;case 22:a.memoizedState===null&&zu(i,a,n),El(a,a.return);break;case 30:zu(i,a,n),El(a,a.return);break;case 7:El(a,a.return);default:zu(i,a,n)}t=t.sibling}}function Bu(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&&Pa(n))}function Vu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Pa(e))}function Hu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Uu(e,t,n,r),t=t.sibling;else i&&nu(t)}function Uu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&tu(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Hu(e,t,n,r),a&2048&&Sl(9,t);break;case 1:Hu(e,t,n,r);break;case 3:Hu(e,t,n,r),i&&mu&&(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&&Pa(a)));break;case 12:if(a&2048){Hu(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){xf(t,t.return,e)}}else Hu(e,t,n,r);break;case 31:Hu(e,t,n,r);break;case 13:Hu(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&&tu(t),o._visibility&2?Hu(e,t,n,r):(o._visibility|=2,Wu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&tu(s),o._visibility&2?Hu(e,t,n,r):Gu(e,t)),a&2048&&Bu(s,t);break;case 24:Hu(e,t,n,r),a&2048&&Vu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Jl(a.child,!0),Jl(t.child,!0))),Hu(e,t,n,r);break;default:Hu(e,t,n,r)}}function Wu(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:Wu(a,o,s,c,i),Sl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Wu(a,o,s,c,i)):u._visibility&2?Wu(a,o,s,c,i):Gu(a,o),i&&l&2048&&Bu(o.alternate,o);break;case 24:Wu(a,o,s,c,i),i&&l&2048&&Vu(o.alternate,o);break;default:Wu(a,o,s,c,i)}t=t.sibling}}function Gu(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:Gu(n,r),i&2048&&Bu(r.alternate,r);break;case 24:Gu(n,r),i&2048&&Vu(r.alternate,r);break;default:Gu(n,r)}t=t.sibling}}var Ku=8192;function qu(e,t,n){if(e.subtreeFlags&Ku)for(e=e.child;e!==null;)Ju(e,t,n),e=e.sibling}function Ju(e,t,n){switch(e.tag){case 26:qu(e,t,n),e.flags&Ku&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&oh(n,e)):sh(n,ju,e.memoizedState,e.memoizedProps));break;case 5:qu(e,t,n),e.flags&Ku&&(e=e.stateNode,(t&335544128)===t&&oh(n,e));break;case 3:case 4:var r=ju;ju=km(e.stateNode.containerInfo),qu(e,t,n),ju=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Ku,Ku=16777216,qu(e,t,n),Ku=r):qu(e,t,n));break;case 30:if((e.flags&Ku)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Vl===null&&(Vl=new Map),Vl.set(r,i)}qu(e,t,n);break;default:qu(e,t,n)}}function Yu(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 Xu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];uu=r,$u(r,e)}Yu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Zu(e),e=e.sibling}function Zu(e){switch(e.tag){case 0:case 11:case 15:Xu(e),e.flags&2048&&Cl(9,e,e.return);break;case 3:Xu(e);break;case 12:Xu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Qu(e)):Xu(e);break;default:Xu(e)}}function Qu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];uu=r,$u(r,e)}Yu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Cl(8,t,t.return),Qu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Qu(t));break;default:Qu(t)}e=e.sibling}}function $u(e,t){for(;uu!==null;){var n=uu;switch(n.tag){case 0:case 11:case 15:Cl(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:Pa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,uu=r;else a:for(n=e;uu!==null;){r=uu;var i=r.sibling,a=r.return;if(xu(r),r===n){uu=null;break a}if(i!==null){i.return=a,uu=i;break a}uu=a}}}var ed={getCacheForType:function(e){var t=Da(z),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Da(z).controller.signal}},td=typeof WeakMap==`function`?WeakMap:Map,nd=0,rd=null,id=null,ad=0,od=0,sd=null,cd=!1,ld=!1,ud=!1,dd=0,fd=0,pd=0,md=0,hd=0,gd=0,_d=0,vd=null,yd=null,bd=!1,xd=0,Sd=0,Cd=1/0,wd=null,Td=null,Ed=0,Dd=null,Od=null,kd=0,Ad=0,jd=null,Md=null,Nd=null,Pd=null,Fd=null,Id=0,Ld=null;function Rd(){return nd&2&&ad!==0?ad&-ad:M.T===null?St():Hf()}function zd(){if(gd===0){if(!(ad&536870912)||oa){var e=ot;ot<<=1,!(ot&3932160)&&(ot=262144),gd=e}else gd=536870912}return e=Mo.current,e!==null&&(e.flags|=32),gd}function Bd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Up(yi(e.memoizedProps,n))),Pd===null&&(Pd=[]),Pd.push(t.bind(null,r))}}function Vd(e,t,n){(e===rd&&(od===2||od===9)||e.cancelPendingCommit!==null)&&(Jd(e,0),Gd(e,ad,gd,!1)),ht(e,n),(!(nd&2)||e!==rd)&&(e===rd&&(!(nd&2)&&(md|=n),fd===4&&Gd(e,ad,gd,!1)),Pf(e))}function Hd(e,t,n){if(nd&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||ut(e,t),a=r?nf(e,t):ef(e,t,!0),o=r;do{if(a===0){ld&&!r&&Gd(e,t,0,!1);break}if(n=e.current.alternate,o&&!Wd(n)){a=ef(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=vd;var l=c.current.memoizedState.isDehydrated;if(l&&(Jd(c,s).flags|=256),s=ef(c,s,!1),s!==2&&s!==6){if(ud&&!l){c.errorRecoveryDisabledLanes|=o,md|=o,a=4;break a}o=yd,yd=a,o!==null&&(yd===null?yd=o:yd.push.apply(yd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Jd(e,0),Gd(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:Gd(r,t,gd,!cd);break a;case 2:yd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=xd+300-Ge(),10<a)){if(Gd(r,t,gd,!cd),lt(r,0,!0)!==0)break a;kd=t,r.timeoutHandle=Tp(Ud.bind(null,r,n,yd,wd,bd,t,gd,md,_d,cd,o,`Throttled`,-0,0),a);break a}Ud(r,n,yd,wd,bd,t,gd,md,_d,cd,o,null,-0,0)}break}while(1);Pf(e)}function Ud(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;if(d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:xn},Vl=null,Ju(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=dh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?xd-Ge():(a&4194048)===a?Sd-Ge():0,m=lh(d,m),m!==null)){kd=a,e.cancelPendingCommit=m(uf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Gd(e,a,o,!l);return}uf(e,t,a,n,r,i,o,s,c,l,u,d)}function Wd(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(!Ur(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 Gd(e,t,n,r){t=dt(e,t),t&=~hd,t&=~md,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-nt(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&_t(e,n,t)}function Kd(){return nd&6?!0:(Ff(0,!1),!1)}function qd(){if(id!==null){if(od===0)var e=id.return;else e=id,ya=va=null,ss(e),oo=null,so=0,e=id;for(;e!==null;)xl(e.alternate,e),e=e.return;id=null}}function Jd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Ep(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),kd=0,qd(),rd=e,id=n=Fi(e.current,null),ad=t,od=0,sd=null,cd=!1,ld=ut(e,t),ud=!1,_d=gd=hd=md=pd=fd=0,yd=vd=null,bd=!1,dd=dt(e,t),Ti(),n}function Yd(e,t){B=null,M.H=hc,t===Xa||t===Qa?(t=io(),od=3):t===Za?(t=io(),od=4):od=t===Nc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,sd=t,id===null&&(fd=1,Dc(e,Ui(t,e.current)))}function Xd(){var e=Mo.current;return e===null?!0:(ad&4194048)===ad?No===null:(ad&62914560)===ad||ad&536870912?e===No:!1}function Zd(){var e=M.H;return M.H=hc,e===null?hc:e}function Qd(){var e=M.A;return M.A=ed,e}function $d(){fd=4,cd||(ad&4194048)!==ad&&Mo.current!==null||(ld=!0),!(pd&134217727)&&!(md&134217727)||rd===null||Gd(rd,ad,gd,!1)}function ef(e,t,n){var r=nd;nd|=2;var i=Zd(),a=Qd();(rd!==e||ad!==t)&&(wd=null,Jd(e,t)),t=!1;var o=fd;a:do try{if(od!==0&&id!==null){var s=id,c=sd;switch(od){case 8:qd(),o=6;break a;case 3:case 2:case 9:case 6:Mo.current===null&&(t=!0);var l=od;if(od=0,sd=null,sf(e,s,c,l),n&&ld){o=0;break a}break;default:l=od,od=0,sd=null,sf(e,s,c,l)}}tf(),o=fd;break}catch(t){Yd(e,t)}while(1);return t&&e.shellSuspendCounter++,ya=va=null,nd=r,M.H=i,M.A=a,id===null&&(rd=null,ad=0,Ti()),o}function tf(){for(;id!==null;)af(id)}function nf(e,t){var n=nd;nd|=2;var r=Zd(),a=Qd();rd!==e||ad!==t?(wd=null,Cd=Ge()+500,Jd(e,t)):ld=ut(e,t);a:do try{if(od!==0&&id!==null){t=id;var o=sd;b:switch(od){case 1:od=0,sd=null,sf(e,t,o,1);break;case 2:case 9:if(eo(o)){od=0,sd=null,of(t);break}t=function(){od!==2&&od!==9||rd!==e||(od=7),Pf(e)},o.then(t,t);break a;case 3:od=7;break a;case 4:od=5;break a;case 7:eo(o)?(od=0,sd=null,of(t)):(od=0,sd=null,sf(e,t,o,7));break;case 5:var s=null;switch(id.tag){case 26:s=id.memoizedState;case 5:case 27:var c=id;if(s?ih(s):c.stateNode.complete){od=0,sd=null;var l=c.sibling;if(l!==null)id=l;else{var u=c.return;u===null?id=null:(id=u,cf(u))}break b}}od=0,sd=null,sf(e,t,o,5);break;case 6:od=0,sd=null,sf(e,t,o,6);break;case 8:qd(),fd=6;break a;default:throw Error(i(462))}}rf();break}catch(t){Yd(e,t)}while(1);return ya=va=null,M.H=r,M.A=a,nd=n,id===null?(rd=null,ad=0,Ti(),fd):0}function rf(){for(;id!==null&&!Ue();)af(id)}function af(e){var t=fl(e.alternate,e,dd);e.memoizedProps=e.pendingProps,t===null?cf(e):id=t}function of(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Kc(n,t,t.pendingProps,t.type,void 0,ad);break;case 11:t=Kc(n,t,t.pendingProps,t.type.render,t.ref,ad);break;case 5:ss(t);var r=t;r===ia&&(oa?(fa(r),r.tag===5&&r.stateNode!=null&&(aa=r.stateNode)):(fa(r),oa=!0));default:xl(n,t),t=id=Ii(t,dd),t=fl(n,t,dd)}e.memoizedProps=e.pendingProps,t===null?cf(e):id=t}function sf(e,t,n,r){ya=va=null,ss(t),oo=null,so=0;var i=t.return;try{if(Mc(e,i,t,n,ad)){fd=1,Dc(e,Ui(n,e.current)),id=null;return}}catch(t){if(i!==null)throw id=i,t;fd=1,Dc(e,Ui(n,e.current)),id=null;return}t.flags&32768?(oa||r===1?e=!0:ld||ad&536870912?e=!1:(cd=e=!0,(r===2||r===9||r===3||r===6)&&(r=Mo.current,r!==null&&r.tag===13&&(r.flags|=16384))),lf(t,e)):cf(t)}function cf(e){var t=e;do{if(t.flags&32768){lf(t,cd);return}e=t.return;var n=yl(t.alternate,t,dd);if(n!==null){id=n;return}if(t=t.sibling,t!==null){id=t;return}id=t=e}while(t!==null);fd===0&&(fd=5)}function lf(e,t){do{var n=bl(e.alternate,e);if(n!==null){n.flags&=32767,id=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){id=e;return}id=e=n}while(e!==null);fd=6,id=null}function uf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do vf();while(Ed!==0);if(nd&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===rd&&(id=rd=null,ad=0),Od=t,Dd=e,kd=n,jd=a,Md=r,df(e,t,n,s,c,l,f)}}function df(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Ad=s,s|=wi,gt(e,n,s,r,i,a),Pd=null,(n&335544064)===n?(Fd=La(e),r=10262):(Fd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,Df(Ye,function(){return yf(),null})):(e.callbackNode=null,e.callbackPriority=0),Bl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=M.T,M.T=null,i=N.p,N.p=2,a=nd,nd|=4;try{hu(e,t,n)}finally{nd=a,N.p=i,M.T=r}}Ed=1,Bl?Nd=Vp(o,e.containerInfo,Fd,mf,hf,pf,gf,yf,ff,null,null):(mf(),hf(),gf())}function ff(e){if(Ed!==0){var t=Dd.onRecoverableError;t(e,{componentStack:null})}}function pf(){Ed===3&&(Ed=0,Iu(Od,Dd),Ed=4)}function mf(){if(Ed===1){Ed=0;var e=Dd,t=Od,n=kd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=M.T,M.T=null;var i=N.p;N.p=2;var a=nd;nd|=4;try{fu=pu=!1,Mu(t,e,n),n=vp;var o=Yr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Jr(s.ownerDocument.documentElement,s)){if(c!==null&&Xr(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 _=qr(s,h),v=qr(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}}Th=!!_p,vp=_p=null}finally{nd=a,N.p=i,M.T=r}}e.current=t,Ed=2}}function hf(){if(Ed===2){Ed=0;var e=Dd,t=Od,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=M.T,M.T=null;var r=N.p;N.p=2;var i=nd;nd|=4;try{_u(e,t.alternate,t)}finally{nd=i,N.p=r,M.T=n}}Ed=3}}function gf(){if(Ed===4||Ed===3){Ed=0;var e=Nd;Nd=null,We();var t=Dd,n=Od,r=kd,i=Md,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?Ed=5:(Ed=0,Od=Dd=null,_f(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(Td=null),xt(r),n=n.stateNode,P&&typeof P.onCommitFiberRoot==`function`)try{P.onCommitFiberRoot(et,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=M.T,a=N.p,N.p=2,M.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{M.T=n,N.p=a}}if(i=Pd,o=Fd,Fd=null,i!==null&&(Pd=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);kd&3&&vf(),Pf(t),a=t.pendingLanes,r&261930&&a&42?t===Ld?Id++:(Id=0,Ld=t):(Id=0,Ld=null),Ff(0,!1)}}function _f(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Pa(t)))}function vf(){return Nd!==null&&(Nd.skipTransition(),Nd=null),mf(),hf(),gf(),yf()}function yf(){if(Ed!==5)return!1;var e=Dd,t=Ad;Ad=0;var n=xt(kd),r=M.T,a=N.p;try{N.p=32>n?32:n,M.T=null,n=jd,jd=null;var o=Dd,s=kd;if(Ed=0,Od=Dd=null,kd=0,nd&6)throw Error(i(331));var c=nd;if(nd|=4,Zu(o.current),Uu(o,o.current,s,n),nd=c,Ff(0,!1),P&&typeof P.onPostCommitFiberRoot==`function`)try{P.onPostCommitFiberRoot(et,o)}catch{}return!0}finally{N.p=a,M.T=r,_f(e,t)}}function bf(e,t,n){t=Ui(n,t),t=kc(e.stateNode,t,2),e=yo(e,t,2),e!==null&&(ht(e,2),Pf(e))}function xf(e,t,n){if(e.tag===3)bf(e,e,n);else for(;t!==null;){if(t.tag===3){bf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Td===null||!Td.has(r))){e=Ui(n,e),n=Ac(2),r=yo(t,n,2),r!==null&&(jc(n,r,t,e),ht(r,2),Pf(r));break}}t=t.return}}function Sf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new td;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)||(ud=!0,i.add(n),e=Cf.bind(null,e,t,n),t.then(e,e))}function Cf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,rd===e&&(ad&n)===n&&(fd===4||fd===3&&(ad&62914560)===ad&&300>Ge()-xd?nd&2?hd|=n:Jd(e,0):hd|=n,_d===ad&&(_d=0)),Pf(e)}function wf(e,t){t===0&&(t=pt()),e=Oi(e,t),e!==null&&(ht(e,t),Pf(e))}function Tf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),wf(e,n)}function Ef(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),wf(e,n)}function Df(e,t){return Ve(e,t)}var Of=null,kf=null,Af=!1,jf=!1,Mf=!1,Nf=0;function Pf(e){e!==kf&&e.next===null&&(kf===null?Of=kf=e:kf=kf.next=e),jf=!0,Af||(Af=!0,Vf())}function Ff(e,t){if(!Mf&&jf){Mf=!0;do for(var n=!1,r=Of;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-nt(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Bf(r,a))}else a=ad,a=lt(r,r===rd?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||ut(r,a)||(n=!0,Bf(r,a))}r=r.next}while(n);Mf=!1}}function If(){Lf()}function Lf(){jf=Af=!1;var e=0;Nf!==0&&W()&&(e=Nf);for(var t=Ge(),n=null,r=Of;r!==null;){var i=r.next,a=Rf(r,t);a===0?(r.next=null,n===null?Of=i:n.next=i,i===null&&(kf=n)):(n=r,(e!==0||a&3)&&(jf=!0)),r=i}Ed!==0&&Ed!==5||Ff(e,!1),Nf!==0&&(Nf=0)}function Rf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-nt(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=ft(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=rd,n=ad,n=lt(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(od===2||od===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&He(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||ut(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&He(r),xt(n)){case 2:case 8:n=Je;break;case 32:n=Ye;break;case 268435456:n=Ze;break;default:n=Ye}return r=zf.bind(null,e),n=Ve(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&He(r),e.callbackPriority=2,e.callbackNode=null,2}function zf(e,t){if(Ed!==0&&Ed!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(vf()&&e.callbackNode!==n)return null;var r=ad;return r=lt(e,e===rd?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Hd(e,r,t),Rf(e,Ge()),e.callbackNode!=null&&e.callbackNode===n?zf.bind(null,e):null)}function Bf(e,t){if(vf())return null;Hd(e,t,!0)}function Vf(){kp(function(){nd&6?Ve(qe,If):Lf()})}function Hf(){if(Nf===0){var e=Ba;e===0&&(e=at,at<<=1,!(at&261888)&&(at=256)),Nf=e}return Nf}function Uf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:I(e)}function Wf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Uf((i[Et]||null).action),o=r.submitter;o&&(t=(t=o[Et]||null)?Uf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Hn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Nf!==0){var e=new FormData(i,o);tc(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),tc(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Gf=0;Gf<gi.length;Gf++){var Kf=gi[Gf];_i(Kf.toLowerCase(),`on`+(Kf[0].toUpperCase()+Kf.slice(1)))}_i(ci,`onAnimationEnd`),_i(li,`onAnimationIteration`),_i(ui,`onAnimationStart`),_i(`dblclick`,`onDoubleClick`),_i(`focusin`,`onFocus`),_i(`focusout`,`onBlur`),_i(di,`onTransitionRun`),_i(fi,`onTransitionStart`),_i(pi,`onTransitionCancel`),_i(mi,`onTransitionEnd`),Wt(`onMouseEnter`,[`mouseout`,`mouseover`]),Wt(`onMouseLeave`,[`mouseout`,`mouseover`]),Wt(`onPointerEnter`,[`pointerout`,`pointerover`]),Wt(`onPointerLeave`,[`pointerout`,`pointerover`]),Ut(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Ut(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Ut(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Ut(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Ut(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Ut(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var qf=`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(` `),Jf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(qf));function Yf(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){R(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){R(e)}i.currentTarget=null,a=c}}}}function Xf(e,t){var n=t[Ot];n===void 0&&(n=t[Ot]=new Set);var r=e+`__bubble`;n.has(r)||(ep(t,e,2,!1),n.add(r))}function Zf(e,t,n){var r=0;t&&(r|=4),ep(n,e,r,t)}var Qf=`_reactListening`+Math.random().toString(36).slice(2);function $f(e){if(!e[Qf]){e[Qf]=!0,Vt.forEach(function(t){t!==`selectionchange`&&(Jf.has(t)||Zf(t,!1,e),Zf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Qf]||(t[Qf]=!0,Zf(`selectionchange`,!1,t))}}function ep(e,t,n,r){switch(Mh(t)){case 2:var i=Eh;break;case 8:i=Dh;break;default:i=Oh}n=i.bind(null,t,n,e),i=void 0,!jn||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 tp(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=Ft(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}On(function(){var r=a,i=Cn(n),s=[];a:{var c=hi.get(e);if(c!==void 0){var l=Hn,u=e;switch(e){case`keypress`:if(Ln(n)===0)break a;case`keydown`:case`keyup`:l=or;break;case`focusin`:u=`focus`,l=Zn;break;case`focusout`:u=`blur`,l=Zn;break;case`beforeblur`:case`afterblur`:l=Zn;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=Yn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Xn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=lr;break;case ci:case li:case ui:l=Qn;break;case mi:l=ur;break;case`scroll`:case`scrollend`:l=Wn;break;case`wheel`:l=dr;break;case`copy`:case`cut`:case`paste`:l=$n;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=sr;break;case`submit`:l=cr;break;case`toggle`:case`beforetoggle`:l=fr}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=kn(m,p),g!=null&&d.push(np(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!==Sn&&(u=n.relatedTarget||n.fromElement)&&(Ft(u)||u[Dt]))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?Ft(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=Yn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=sr,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Lt(c),h=l==null?u:Lt(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Ft(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,ip):null,c!==null&&ap(s,u,c,d,!1),l!==null&&f!==null&&ap(s,f,l,d,!0)))}a:{if(c=r?Lt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Mr;else if(Er(c)){if(Nr)_=L;else{_=Br;var v=zr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&vn(r.elementType)&&(_=Mr):_=Vr;if(_&&=_(e,r)){Dr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Lt(r):window,e){case`focusin`:(Er(v)||v.contentEditable===`true`)&&(Qr=v,$r=r,ei=null);break;case`focusout`:ei=$r=Qr=null;break;case`mousedown`:ti=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:ti=!1,ni(s,n,i);break;case`selectionchange`:if(Zr)break;case`keydown`:case`keyup`:ni(s,n,i)}var y;if(mr)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 Sr?br(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(_r&&n.locale!==`ko`&&(Sr||b!==`onCompositionStart`?b===`onCompositionEnd`&&Sr&&(y=In()):(Nn=i,Pn=`value`in Nn?Nn.value:Nn.textContent,Sr=!0)),v=rp(r,b),0<v.length&&(b=new er(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=xr(n),y!==null&&(b.data=y)))),(y=gr?Cr(e,n):wr(e,n))&&(b=rp(r,`onBeforeInput`),0<b.length&&(v=new er(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Wf(s,e,r,n,i)}Yf(s,t)})}function np(e,t,n){return{instance:e,listener:t,currentTarget:n}}function rp(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=kn(e,n),i!=null&&r.unshift(np(e,i,a)),i=kn(e,t),i!=null&&r.push(np(e,i,a))),e.tag===3)return r;e=e.return}return[]}function ip(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function ap(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=kn(n,a),l!=null&&o.unshift(np(n,l,c))):i||(l=kn(n,a),l!=null&&o.push(np(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var op=/\r\n?/g,sp=/\u0000|\uFFFD/g;function cp(e){return(typeof e==`string`?e:``+e).replace(op,`
9
- `).replace(sp,``)}function lp(e,t){return t=cp(t),cp(e)===t}function up(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||mn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&mn(e,``+r);else return;break;case`className`:Qt(e,`class`,r);break;case`tabIndex`:Qt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Qt(e,n,r);break;case`style`:_n(e,r,o);return;case`data`:if(t!==`object`){Qt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=I(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`&&up(e,t,`name`,a.name,a,null),up(e,t,`formEncType`,a.formEncType,a,null),up(e,t,`formMethod`,a.formMethod,a,null),up(e,t,`formTarget`,a.formTarget,a,null)):(up(e,t,`encType`,a.encType,a,null),up(e,t,`method`,a.method,a,null),up(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=I(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=xn);return;case`onScroll`:r!=null&&Xf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Xf(`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=I(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`:Xf(`beforetoggle`,e),Xf(`toggle`,e),Zt(e,`popover`,r);break;case`xlinkActuate`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:$t(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:$t(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:$t(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Zt(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=yn.get(n)||n,Zt(e,n,r);else return}Yt=!0}function dp(e,t,n,r,a,o){switch(n){case`style`:_n(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`)mn(e,r);else if(typeof r==`number`||typeof r==`bigint`)mn(e,``+r);else return;break;case`onScroll`:r!=null&&Xf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Xf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=xn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Ht.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[Et]||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}Yt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Zt(e,n,r)}return}Yt=!0}function fp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Xf(`error`,e),Xf(`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:up(e,t,o,s,n,null)}}a&&up(e,t,`srcSet`,n.srcSet,n,null),r&&up(e,t,`src`,n.src,n,null);return;case`input`:Xf(`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:up(e,t,r,d,n,null)}}ln(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Xf(`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:up(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&dn(e,!!r,n,!0):dn(e,!!r,t,!1);return;case`textarea`:for(s in Xf(`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:up(e,t,s,c,n,null)}pn(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:up(e,t,l,r,n,null)}return;case`dialog`:Xf(`beforetoggle`,e),Xf(`toggle`,e),Xf(`cancel`,e),Xf(`close`,e);break;case`iframe`:case`object`:Xf(`load`,e);break;case`video`:case`audio`:for(r=0;r<qf.length;r++)Xf(qf[r],e);break;case`image`:Xf(`error`,e),Xf(`load`,e);break;case`details`:Xf(`toggle`,e);break;case`embed`:case`source`:case`link`:Xf(`error`,e),Xf(`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:up(e,t,u,r,n,null)}return;default:if(vn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&dp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&up(e,t,c,r,n,null))}var pp={};function mp(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)||up(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&&(Yt=!0),o=m;break;case`name`:m!==f&&(Yt=!0),a=m;break;case`checked`:m!==f&&(Yt=!0),u=m;break;case`defaultChecked`:m!==f&&(Yt=!0),d=m;break;case`value`:m!==f&&(Yt=!0),s=m;break;case`defaultValue`:m!==f&&(Yt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&up(e,t,p,m,r,f)}}cn(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)||up(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&&(Yt=!0),p=o;break;case`defaultValue`:o!==l&&(Yt=!0),c=o;break;case`multiple`:o!==l&&(Yt=!0),s=o;default:o!==l&&up(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?dn(e,!!n,n?[]:``,!1):dn(e,!!n,t,!0)):dn(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:up(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&&(Yt=!0),p=a;break;case`defaultValue`:a!==o&&(Yt=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&up(e,t,s,a,r,o)}fn(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:up(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&&(Yt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:up(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)&&up(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:up(e,t,u,p,r,m)}return;default:if(vn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&dp(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||dp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&up(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||up(e,t,f,p,r,m)}function hp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function gp(){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&&hp(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&&hp(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 _p=null,vp=null;function yp(e){return e.nodeType===9?e:e.ownerDocument}function bp(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 xp(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 Sp(e,t,n,r){return n=yp(n).createElement(e),n[Tt]=r,n[Et]=t,fp(n,e,t),zt(n),n}function Cp(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 wp=null;function W(){var e=window.event;return e&&e.type===`popstate`?e!==wp&&(wp=e,!0):(wp=null,!1)}var Tp=typeof setTimeout==`function`?setTimeout:void 0,Ep=typeof clearTimeout==`function`?clearTimeout:void 0,Dp=typeof Promise==`function`?Promise:void 0,Op=typeof requestAnimationFrame==`function`?requestAnimationFrame:Tp,kp=typeof queueMicrotask==`function`?queueMicrotask:Dp===void 0?Tp:function(e){return Dp.resolve(null).then(e).catch(Ap)};function Ap(e){setTimeout(function(){throw e})}function jp(e){return e===`head`}function Mp(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),Zh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Em(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Em(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Mt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Em(e.ownerDocument.body)}n=i}while(n);Zh(t)}function Np(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 Pp(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 Fp(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 Ip(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 Lp(e){return Ip(e.getBoundingClientRect(),getComputedStyle(e),e)}function Rp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Ip(t,n,e)}function zp(e){return e.documentElement.clientHeight}function Bp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Vp(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`&&(zp(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+=ah(f),u>ch){s.length=o;break}f=new Promise(Bp.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 Hp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Hp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Hp.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},Hp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Up(e){return{name:e,group:new Hp(`group`,e),imagePair:new Hp(`image-pair`,e),old:new Hp(`old`,e),new:new Hp(`new`,e)}}function Wp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Wp.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(Yp(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=qp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),h(this._fragmentFiber.child,!1,Gp,e,s,r)}this._eventListeners=a}};function Gp(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Wp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Yp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=qp(i.optionsOrUseCapture),h(this._fragmentFiber.child,!1,Kp,e,n,i),r.splice(t,1),a!==null&&a()}};function Kp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function qp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Jp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Yp(e,t,n,r){if(e.length===0)return-1;r=Jp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Jp(a.optionsOrUseCapture)===r)return i}return-1}Wp.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,qp(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,qp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Wp.prototype.focus=function(e){h(this._fragmentFiber.child,!0,Xp,e,void 0,void 0)};function Xp(e,t){return e.tag!==6&&(e=b(e),Sm(e,t))}Wp.prototype.focusLast=function(e){var t=[];h(this._fragmentFiber.child,!0,Zp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Xp(t[n],e);n--);};function Zp(e,t){return t.push(e),!1}Wp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=yp(e).activeElement,e!==null&&h(this._fragmentFiber.child,!1,Qp,e,void 0,void 0))};function Qp(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Wp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),h(this._fragmentFiber.child,!1,$p,e,void 0,void 0)};function $p(e,t){return e.tag!==6&&(e=b(e),t.observe(e),!1)}Wp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),h(this._fragmentFiber.child,!1,em,e,void 0,void 0);for(var n=t=0;n<tm.length;n++){var r=tm[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):tm[t++]=r}tm.length=t}};function em(e,t){return e.tag!==6&&(e=b(e),t.unobserve(e),!1)}var tm=[],nm=!1;function rm(e,t,n){tm.push({fragmentInstance:e,observer:t,instance:n}),nm||(nm=!0,Cm(function(){nm=!1;var e=tm;tm=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Wp.prototype.getClientRects=function(){var e=[];return h(this._fragmentFiber.child,!1,im,e,void 0,void 0),e};function im(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}Wp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Wp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];h(this._fragmentFiber.child,!1,Zp,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||am(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function am(e,t,n,r,i){var a=Ft(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 om(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)}Wp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];h(this._fragmentFiber.child,!1,Zp,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),om(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),om(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function sm(e,t){return e=b(e),cm(e,t),!1}function cm(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function lm(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,qp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<tm.length;i++){var a=tm[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(tm[r++]=a)}tm.length=r,n.observe(e)}),cm(e,t))}function um(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,qp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?rm(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function dm(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`:dm(n),Pt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function fm(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[Mt])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=vm(e.nextSibling),e===null)break}return null}function pm(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=vm(e.nextSibling),e===null))return null;return e}function mm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=vm(e.nextSibling),e===null))return null;return e}function hm(e){return e.data===`$?`||e.data===`$~`}function gm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function _m(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 vm(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 ym=null;function bm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return vm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function xm(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 Sm(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 Cm(e){Op(function(){Op(function(t){return e(t)})})}function wm(e,t,n){switch(t=yp(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 Tm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&up(e,t,r,null,pp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===xn&&(e.onclick=null),Pt(e)}function Em(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Pt(e)}var Dm=new Map,Om=new Set;function km(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 Am=N.d;N.d={f:jm,r:Mm,D:Fm,C:Im,L:Lm,m:Rm,X:Bm,S:zm,M:Vm};function jm(){var e=Am.f(),t=Kd();return e||t}function Mm(e){var t=It(e);t!==null&&t.tag===5&&t.type===`form`?rc(t):Am.r(e)}var Nm=typeof document>`u`?null:document;function Pm(e,t,n){var r=Nm;if(r&&typeof t==`string`&&t){var i=sn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Om.has(i)||(Om.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),fp(t,`link`,e),zt(t),r.head.appendChild(t)))}}function Fm(e){Am.D(e),Pm(`dns-prefetch`,e,null)}function Im(e,t){Am.C(e,t),Pm(`preconnect`,e,t)}function Lm(e,t,n){Am.L(e,t,n);var r=Nm;if(r&&e&&t){var i=`link[rel="preload"][as="`+sn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+sn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+sn(n.imageSizes)+`"]`)):i+=`[href="`+sn(e)+`"]`;var a=i;switch(t){case`style`:a=Um(e);break;case`script`:a=qm(e)}if(!(Dm.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Dm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Wm(a))||t===`script`&&r.querySelector(Jm(a))))){var o=r.createElement(`link`);fp(o,`link`,e),t===`style`&&(o[Nt]=!0,o.onload=o.onerror=function(){Bt(o)}),zt(o),r.head.appendChild(o)}}}function Rm(e,t){Am.m(e,t);var n=Nm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+sn(r)+`"][href="`+sn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=qm(e)}if(!Dm.has(a)&&(e=D({rel:`modulepreload`,href:e},t),Dm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Jm(a)))return}r=n.createElement(`link`),fp(r,`link`,e),zt(r),n.head.appendChild(r)}}}function zm(e,t,n){Am.S(e,t,n);var r=Nm;if(r&&e){var i=Rt(r).hoistableStyles,a=Um(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Wm(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Dm.get(a))&&Zm(e,n);var c=o=r.createElement(`link`);zt(c),fp(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,Xm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Bm(e,t){Am.X(e,t);var n=Nm;if(n&&e){var r=Rt(n).hoistableScripts,i=qm(e),a=r.get(i);a||(a=n.querySelector(Jm(i)),a||(e=D({src:e,async:!0},t),(t=Dm.get(i))&&Qm(e,t),a=n.createElement(`script`),zt(a),fp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Vm(e,t){Am.M(e,t);var n=Nm;if(n&&e){var r=Rt(n).hoistableScripts,i=qm(e),a=r.get(i);a||(a=n.querySelector(Jm(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=Dm.get(i))&&Qm(e,t),a=n.createElement(`script`),zt(a),fp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Hm(e,t,n,r){var a=(a=De.current)?km(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=Um(n.href),t=Rt(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=Um(n.href);var o=Rt(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(Wm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=Dm.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},Dm.set(e,o)),Km(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=qm(n),t=Rt(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 Um(e){return`href="`+sn(e)+`"`}function Wm(e){return`link[rel="stylesheet"][`+e+`]`}function Gm(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Km(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Nt]){r.loading=1;return}}else t=e.createElement(`link`),t[Nt]=!0,t.onload=t.onerror=Bt.bind(null,t),fp(t,`link`,n),zt(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 qm(e){return`[src="`+sn(e)+`"]`}function Jm(e){return`script[async]`+e}function Ym(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+sn(n.href)+`"]`);if(r)return t.instance=r,zt(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`),zt(r),fp(r,`style`,a),Xm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Um(n.href);var o=e.querySelector(Wm(a));if(o)return t.state.loading|=4,t.instance=o,zt(o),o;r=Gm(n),(a=Dm.get(a))&&Zm(r,a),o=(e.ownerDocument||e).createElement(`link`),zt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),fp(o,`link`,r),t.state.loading|=4,Xm(o,n.precedence,e),t.instance=o;case`script`:return o=qm(n.src),(a=e.querySelector(Jm(o)))?(t.instance=a,zt(a),a):(r=n,(a=Dm.get(o))&&(r=D({},n),Qm(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),zt(a),fp(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,Xm(r,n.precedence,e));return t.instance}function Xm(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 Zm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Qm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var $m=null;function eh(e,t,n){if($m===null){var r=new Map,i=$m=new Map;i.set(n,r)}else i=$m,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[Mt]||a[Tt]||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 th(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function nh(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 rh(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function ih(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function ah(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function oh(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=ah(t),e.suspenseyImages.push(t)),e=fh.bind(e),t.decode().then(e,e))}function sh(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=Um(r.href),a=t.querySelector(Wm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=dh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,zt(a);return}a=t.ownerDocument||t,r=Gm(r),(i=Dm.get(i))&&Zm(r,i),a=a.createElement(`link`),zt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),fp(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=dh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var ch=0;function lh(e,t){return e.stylesheets&&e.count===0&&mh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&mh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&ch===0&&(ch=62500*gp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&mh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>ch?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function uh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)mh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function dh(){this.count--,uh(this)}function fh(){this.imgCount--,uh(this)}var ph=null;function mh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ph=new Map,t.forEach(hh,e),ph=null,dh.call(e))}function hh(e,t){if(!(t.state.loading&4)){var n=ph.get(e);if(n)var r=n.get(null);else{n=new Map,ph.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=dh.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 gh={$$typeof:A,Provider:null,Consumer:null,_currentValue:ye,_currentValue2:ye,_threadCount:0};function _h(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=mt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mt(0),this.hiddenUpdates=mt(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 vh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new _h(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Ni(3,null,null,t),e.current=a,a.stateNode=e,t=Na(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},go(a),e}function yh(e){return e?(e=ji,e):ji}function bh(e,t,n,r,i,a){i=yh(i),r.context===null?r.context=i:r.pendingContext=i,r=vo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=yo(e,r,t),n!==null&&(Vd(n,e,t),bo(n,e,t))}function xh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Sh(e,t){xh(e,t),(e=e.alternate)&&xh(e,t)}function Ch(e){if(e.tag===13||e.tag===31){var t=Oi(e,67108864);t!==null&&Vd(t,e,67108864),Sh(e,67108864)}}function wh(e){if(e.tag===13||e.tag===31){var t=Rd();t=bt(t);var n=Oi(e,t);n!==null&&Vd(n,e,t),Sh(e,t)}}var Th=!0;function Eh(e,t,n,r){var i=M.T;M.T=null;var a=N.p;try{N.p=2,Oh(e,t,n,r)}finally{N.p=a,M.T=i}}function Dh(e,t,n,r){var i=M.T;M.T=null;var a=N.p;try{N.p=8,Oh(e,t,n,r)}finally{N.p=a,M.T=i}}function Oh(e,t,n,r){if(Th){var i=kh(r);if(i===null)tp(e,t,r,Ah,n),Vh(e,r);else if(Uh(i,e,t,n,r))r.stopPropagation();else if(Vh(e,r),t&4&&-1<Bh.indexOf(e)){for(;i!==null;){var a=It(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=ct(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-nt(o);s.entanglements[1]|=c,o&=~c}Pf(a),!(nd&6)&&(Cd=Ge()+500,Ff(0,!1))}}break;case 31:case 13:s=Oi(a,2),s!==null&&Vd(s,a,2),Kd(),Sh(a,2)}if(a=kh(r),a===null&&tp(e,t,r,Ah,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else tp(e,t,r,null,n)}}function kh(e){return e=Cn(e),jh(e)}var Ah=null;function jh(e){if(Ah=null,e=Ft(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 Ah=e,null}function Mh(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(Ke()){case qe:return 2;case Je:return 8;case Ye:case Xe:return 32;case Ze:return 268435456;default:return 32}default:return 32}}var Nh=!1,Ph=null,Fh=null,Ih=null,Lh=new Map,Rh=new Map,zh=[],Bh=`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 Vh(e,t){switch(e){case`focusin`:case`focusout`:Ph=null;break;case`dragenter`:case`dragleave`:Fh=null;break;case`mouseover`:case`mouseout`:Ih=null;break;case`pointerover`:case`pointerout`:Lh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Rh.delete(t.pointerId)}}function Hh(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=It(t),t!==null&&Ch(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Uh(e,t,n,r,i){switch(t){case`focusin`:return Ph=Hh(Ph,e,t,n,r,i),!0;case`dragenter`:return Fh=Hh(Fh,e,t,n,r,i),!0;case`mouseover`:return Ih=Hh(Ih,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Lh.set(a,Hh(Lh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Rh.set(a,Hh(Rh.get(a)||null,e,t,n,r,i)),!0}return!1}function Wh(e){var t=Ft(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,Ct(e.priority,function(){wh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,Ct(e.priority,function(){wh(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 Gh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=kh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Sn=r,n.target.dispatchEvent(r),Sn=null}else return t=It(n),t!==null&&Ch(t),e.blockedOn=n,!1;t.shift()}return!0}function Kh(e,t,n){Gh(e)&&n.delete(t)}function qh(){Nh=!1,Ph!==null&&Gh(Ph)&&(Ph=null),Fh!==null&&Gh(Fh)&&(Fh=null),Ih!==null&&Gh(Ih)&&(Ih=null),Lh.forEach(Kh),Rh.forEach(Kh)}function Jh(e,n){e.blockedOn===n&&(e.blockedOn=null,Nh||(Nh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,qh)))}var Yh=null;function Xh(e){Yh!==e&&(Yh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Yh===e&&(Yh=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(jh(r||n)===null)continue;break}var a=It(n);a!==null&&(e.splice(t,3),t-=3,tc(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Zh(e){function t(t){return Jh(t,e)}Ph!==null&&Jh(Ph,e),Fh!==null&&Jh(Fh,e),Ih!==null&&Jh(Ih,e),Lh.forEach(t),Rh.forEach(t);for(var n=0;n<zh.length;n++){var r=zh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<zh.length&&(n=zh[0],n.blockedOn===null);)Wh(n),n.blockedOn===null&&zh.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[Et]||null;if(typeof a==`function`)o||Xh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[Et]||null)s=o.formAction;else if(jh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Xh(n)}}}function Qh(){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 $h(e){this._internalRoot=e}eg.prototype.render=$h.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;bh(n,Rd(),e,t,null,null)},eg.prototype.unmount=$h.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;bh(e.current,2,null,e,null,null),Kd(),t[Dt]=null}};function eg(e){this._internalRoot=e}eg.prototype.unstable_scheduleHydration=function(e){if(e){var t=St();e={blockedOn:null,target:e,priority:t};for(var n=0;n<zh.length&&t!==0&&t<zh[n].priority;n++);zh.splice(n,0,e),n===0&&Wh(e)}};var tg=n.version;if(tg!==`19.3.0`)throw Error(i(527,tg,`19.3.0`));N.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 ng={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:M,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var rg=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!rg.isDisabled&&rg.supportsFiber)try{et=rg.inject(ng),P=rg}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=wc,s=Tc,c=Ec;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=vh(e,1,!1,null,null,n,r,null,o,s,c,Qh),e[Dt]=t.current,$f(e),new $h(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()})),_=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})),v=o(((e,t)=>{t.exports=_()}));function y(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var b=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,x=y(function(e){return b.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91});function S(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function C(e){var t=document.createElement(`style`);return t.setAttribute(`data-emotion`,e.key),e.nonce!==void 0&&t.setAttribute(`nonce`,e.nonce),t.appendChild(document.createTextNode(``)),t.setAttribute(`data-s`,``),t}var w=function(){function e(e){var t=this;this._insertTag=function(e){var n=t.tags.length===0?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling;t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=e.speedy===void 0||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(C(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=S(t);try{n.insertRule(e,n.cssRules.length)}catch{}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach(function(e){return e.parentNode?.removeChild(e)}),this.tags=[],this.ctr=0},e}(),T=`-ms-`,E=`-moz-`,D=`-webkit-`,ee=`comm`,O=`rule`,te=`decl`,k=`@import`,ne=`@keyframes`,re=`@layer`,ie=Math.abs,A=String.fromCharCode,ae=Object.assign;function oe(e,t){return ue(e,0)^45?(((t<<2^ue(e,0))<<2^ue(e,1))<<2^ue(e,2))<<2^ue(e,3):0}function se(e){return e.trim()}function ce(e,t){return(e=t.exec(e))?e[0]:e}function j(e,t,n){return e.replace(t,n)}function le(e,t){return e.indexOf(t)}function ue(e,t){return e.charCodeAt(t)|0}function de(e,t,n){return e.slice(t,n)}function fe(e){return e.length}function pe(e){return e.length}function me(e,t){return t.push(e),e}function he(e,t){return e.map(t).join(``)}var ge=1,_e=1,ve=0,M=0,N=0,ye=``;function be(e,t,n,r,i,a,o){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:ge,column:_e,length:o,return:``}}function xe(e,t){return ae(be(``,null,null,``,null,null,0),e,{length:-e.length},t)}function Se(){return N}function Ce(){return N=M>0?ue(ye,--M):0,_e--,N===10&&(_e=1,ge--),N}function we(){return N=M<ve?ue(ye,M++):0,_e++,N===10&&(_e=1,ge++),N}function Te(){return ue(ye,M)}function Ee(){return M}function De(e,t){return de(ye,e,t)}function Oe(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function ke(e){return ge=_e=1,ve=fe(ye=e),M=0,[]}function Ae(e){return ye=``,e}function je(e){return se(De(M-1,Pe(e===91?e+2:e===40?e+1:e)))}function Me(e){for(;(N=Te())&&N<33;)we();return Oe(e)>2||Oe(N)>3?``:` `}function Ne(e,t){for(;--t&&we()&&!(N<48||N>102||N>57&&N<65||N>70&&N<97););return De(e,Ee()+(t<6&&Te()==32&&we()==32))}function Pe(e){for(;we();)switch(N){case e:return M;case 34:case 39:e!==34&&e!==39&&Pe(N);break;case 40:e===41&&Pe(e);break;case 92:we()}return M}function Fe(e,t){for(;we()&&e+N!==57&&(e+N!==84||Te()!==47););return`/*`+De(t,M-1)+`*`+A(e===47?e:we())}function Ie(e){for(;!Oe(Te());)we();return De(e,M)}function Le(e){return Ae(Re(``,null,null,null,[``],e=ke(e),0,[0],e))}function Re(e,t,n,r,i,a,o,s,c){for(var l=0,u=0,d=o,f=0,p=0,m=0,h=1,g=1,_=1,v=0,y=``,b=i,x=a,S=r,C=y;g;)switch(m=v,v=we()){case 40:if(m!=108&&ue(C,d-1)==58){le(C+=j(je(v),`&`,`&\f`),`&\f`)!=-1&&(_=-1);break}case 34:case 39:case 91:C+=je(v);break;case 9:case 10:case 13:case 32:C+=Me(m);break;case 92:C+=Ne(Ee()-1,7);continue;case 47:switch(Te()){case 42:case 47:me(Be(Fe(we(),Ee()),t,n),c);break;default:C+=`/`}break;case 123*h:s[l++]=fe(C)*_;case 125*h:case 59:case 0:switch(v){case 0:case 125:g=0;case 59+u:_==-1&&(C=j(C,/\f/g,``)),p>0&&fe(C)-d&&me(p>32?Ve(C+`;`,r,n,d-1):Ve(j(C,` `,``)+`;`,r,n,d-2),c);break;case 59:C+=`;`;default:if(me(S=ze(C,t,n,l,u,i,s,y,b=[],x=[],d),a),v===123){if(u===0)Re(C,t,S,S,b,a,d,s,x);else switch(f===99&&ue(C,3)===110?100:f){case 100:case 108:case 109:case 115:Re(e,S,S,r&&me(ze(e,S,S,0,0,i,s,y,i,b=[],d),x),i,x,d,s,r?b:x);break;default:Re(C,S,S,S,[``],x,0,s,x)}}}l=u=p=0,h=_=1,y=C=``,d=o;break;case 58:d=1+fe(C),p=m;default:if(h<1){if(v==123)--h;else if(v==125&&h++==0&&Ce()==125)continue}switch(C+=A(v),v*h){case 38:_=u>0?1:(C+=`\f`,-1);break;case 44:s[l++]=(fe(C)-1)*_,_=1;break;case 64:Te()===45&&(C+=je(we())),f=Te(),u=d=fe(y=C+=Ie(Ee())),v++;break;case 45:m===45&&fe(C)==2&&(h=0)}}return a}function ze(e,t,n,r,i,a,o,s,c,l,u){for(var d=i-1,f=i===0?a:[``],p=pe(f),m=0,h=0,g=0;m<r;++m)for(var _=0,v=de(e,d+1,d=ie(h=o[m])),y=e;_<p;++_)(y=se(h>0?f[_]+` `+v:j(v,/&\f/g,f[_])))&&(c[g++]=y);return be(e,t,n,i===0?O:s,c,l,u)}function Be(e,t,n){return be(e,t,n,ee,A(Se()),de(e,2,-2),0)}function Ve(e,t,n,r){return be(e,t,n,te,de(e,0,r),de(e,r+1,-1),r)}function He(e,t){for(var n=``,r=pe(e),i=0;i<r;i++)n+=t(e[i],i,e,t)||``;return n}function Ue(e,t,n,r){switch(e.type){case re:if(e.children.length)break;case k:case te:return e.return=e.return||e.value;case ee:return``;case ne:return e.return=e.value+`{`+He(e.children,r)+`}`;case O:e.value=e.props.join(`,`)}return fe(n=He(e.children,r))?e.return=e.value+`{`+n+`}`:``}function We(e){var t=pe(e);return function(n,r,i,a){for(var o=``,s=0;s<t;s++)o+=e[s](n,r,i,a)||``;return o}}function Ge(e){return function(t){t.root||(t=t.return)&&e(t)}}var Ke=function(e,t,n){for(var r=0,i=0;r=i,i=Te(),r===38&&i===12&&(t[n]=1),!Oe(i);)we();return De(e,M)},qe=function(e,t){var n=-1,r=44;do switch(Oe(r)){case 0:r===38&&Te()===12&&(t[n]=1),e[n]+=Ke(M-1,t,n);break;case 2:e[n]+=je(r);break;case 4:if(r===44){e[++n]=Te()===58?`&\f`:``,t[n]=e[n].length;break}default:e[n]+=A(r)}while(r=we());return e},Je=function(e,t){return Ae(qe(ke(e),t))},Ye=new WeakMap,Xe=function(e){if(!(e.type!==`rule`||!e.parent||e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;n.type!==`rule`;)if(n=n.parent,!n)return;if((e.props.length!==1||t.charCodeAt(0)===58||Ye.get(n))&&!r){Ye.set(e,!0);for(var i=[],a=Je(t,i),o=n.props,s=0,c=0;s<a.length;s++)for(var l=0;l<o.length;l++,c++)e.props[c]=i[s]?a[s].replace(/&\f/g,o[l]):o[l]+` `+a[s]}}},Ze=function(e){if(e.type===`decl`){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return=``,e.value=``)}};function Qe(e,t){switch(oe(e,t)){case 5103:return D+`print-`+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return D+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return D+e+E+e+T+e+e;case 6828:case 4268:return D+e+T+e+e;case 6165:return D+e+T+`flex-`+e+e;case 5187:return D+e+j(e,/(\w+).+(:[^]+)/,D+`box-$1$2`+T+`flex-$1$2`)+e;case 5443:return D+e+T+`flex-item-`+j(e,/flex-|-self/,``)+e;case 4675:return D+e+T+`flex-line-pack`+j(e,/align-content|flex-|-self/,``)+e;case 5548:return D+e+T+j(e,`shrink`,`negative`)+e;case 5292:return D+e+T+j(e,`basis`,`preferred-size`)+e;case 6060:return D+`box-`+j(e,`-grow`,``)+D+e+T+j(e,`grow`,`positive`)+e;case 4554:return D+j(e,/([^-])(transform)/g,`$1`+D+`$2`)+e;case 6187:return j(j(j(e,/(zoom-|grab)/,D+`$1`),/(image-set)/,D+`$1`),e,``)+e;case 5495:case 3959:return j(e,/(image-set\([^]*)/,D+"$1$`$1");case 4968:return j(j(e,/(.+:)(flex-)?(.*)/,D+`box-pack:$3`+T+`flex-pack:$3`),/s.+-b[^;]+/,`justify`)+D+e+e;case 4095:case 3583:case 4068:case 2532:return j(e,/(.+)-inline(.+)/,D+`$1$2`)+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(fe(e)-1-t>6)switch(ue(e,t+1)){case 109:if(ue(e,t+4)!==45)break;case 102:return j(e,/(.+:)(.+)-([^]+)/,`$1`+D+`$2-$3$1`+E+(ue(e,t+3)==108?`$3`:`$2-$3`))+e;case 115:return~le(e,`stretch`)?Qe(j(e,`stretch`,`fill-available`),t)+e:e}break;case 4949:if(ue(e,t+1)!==115)break;case 6444:switch(ue(e,fe(e)-3-(~le(e,`!important`)&&10))){case 107:return j(e,`:`,`:`+D)+e;case 101:return j(e,/(.+:)([^;!]+)(;|!.+)?/,`$1`+D+(ue(e,14)===45?`inline-`:``)+`box$3$1`+D+`$2$3$1`+T+`$2box$3`)+e}break;case 5936:switch(ue(e,t+11)){case 114:return D+e+T+j(e,/[svh]\w+-[tblr]{2}/,`tb`)+e;case 108:return D+e+T+j(e,/[svh]\w+-[tblr]{2}/,`tb-rl`)+e;case 45:return D+e+T+j(e,/[svh]\w+-[tblr]{2}/,`lr`)+e}return D+e+T+e+e}return e}var $e=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case te:e.return=Qe(e.value,e.length);break;case ne:return He([xe(e,{value:j(e.value,`@`,`@`+D)})],r);case O:if(e.length)return he(e.props,function(t){switch(ce(t,/(::plac\w+|:read-\w+)/)){case`:read-only`:case`:read-write`:return He([xe(e,{props:[j(t,/:(read-\w+)/,`:`+E+`$1`)]})],r);case`::placeholder`:return He([xe(e,{props:[j(t,/:(plac\w+)/,`:`+D+`input-$1`)]}),xe(e,{props:[j(t,/:(plac\w+)/,`:`+E+`$1`)]}),xe(e,{props:[j(t,/:(plac\w+)/,T+`input-$1`)]})],r)}return``})}}],et=function(e){var t=e.key;if(t===`css`){var n=document.querySelectorAll(`style[data-emotion]:not([data-s])`);Array.prototype.forEach.call(n,function(e){e.getAttribute(`data-emotion`).indexOf(` `)!==-1&&(document.head.appendChild(e),e.setAttribute(`data-s`,``))})}var r=e.stylisPlugins||$e,i={},a,o=[];a=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll(`style[data-emotion^="`+t+` "]`),function(e){for(var t=e.getAttribute(`data-emotion`).split(` `),n=1;n<t.length;n++)i[t[n]]=!0;o.push(e)});var s,c=[Xe,Ze],l,u=[Ue,Ge(function(e){l.insert(e)})],d=We(c.concat(r,u)),f=function(e){return He(Le(e),d)};s=function(e,t,n,r){l=n,f(e?e+`{`+t.styles+`}`:t.styles),r&&(p.inserted[t.name]=!0)};var p={key:t,sheet:new w({key:t,container:a,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:i,registered:{},insert:s};return p.sheet.hydrate(o),p},P=c(u()),tt=m(),nt=c(g()),F=v();function rt(){return rt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rt.apply(null,arguments)}var it=o((e=>{var t=typeof Symbol==`function`&&Symbol.for,n=t?Symbol.for(`react.element`):60103,r=t?Symbol.for(`react.portal`):60106,i=t?Symbol.for(`react.fragment`):60107,a=t?Symbol.for(`react.strict_mode`):60108,o=t?Symbol.for(`react.profiler`):60114,s=t?Symbol.for(`react.provider`):60109,c=t?Symbol.for(`react.context`):60110,l=t?Symbol.for(`react.async_mode`):60111,u=t?Symbol.for(`react.concurrent_mode`):60111,d=t?Symbol.for(`react.forward_ref`):60112,f=t?Symbol.for(`react.suspense`):60113,p=t?Symbol.for(`react.suspense_list`):60120,m=t?Symbol.for(`react.memo`):60115,h=t?Symbol.for(`react.lazy`):60116,g=t?Symbol.for(`react.block`):60121,_=t?Symbol.for(`react.fundamental`):60117,v=t?Symbol.for(`react.responder`):60118,y=t?Symbol.for(`react.scope`):60119;function b(e){if(typeof e==`object`&&e){var t=e.$$typeof;switch(t){case n:switch(e=e.type,e){case l:case u:case i:case o:case a:case f:return e;default:switch(e&&=e.$$typeof,e){case c:case d:case h:case m:case s:return e;default:return t}}case r:return t}}}function x(e){return b(e)===u}e.AsyncMode=l,e.ConcurrentMode=u,e.ContextConsumer=c,e.ContextProvider=s,e.Element=n,e.ForwardRef=d,e.Fragment=i,e.Lazy=h,e.Memo=m,e.Portal=r,e.Profiler=o,e.StrictMode=a,e.Suspense=f,e.isAsyncMode=function(e){return x(e)||b(e)===l},e.isConcurrentMode=x,e.isContextConsumer=function(e){return b(e)===c},e.isContextProvider=function(e){return b(e)===s},e.isElement=function(e){return typeof e==`object`&&!!e&&e.$$typeof===n},e.isForwardRef=function(e){return b(e)===d},e.isFragment=function(e){return b(e)===i},e.isLazy=function(e){return b(e)===h},e.isMemo=function(e){return b(e)===m},e.isPortal=function(e){return b(e)===r},e.isProfiler=function(e){return b(e)===o},e.isStrictMode=function(e){return b(e)===a},e.isSuspense=function(e){return b(e)===f},e.isValidElementType=function(e){return typeof e==`string`||typeof e==`function`||e===i||e===u||e===o||e===a||e===f||e===p||typeof e==`object`&&!!e&&(e.$$typeof===h||e.$$typeof===m||e.$$typeof===s||e.$$typeof===c||e.$$typeof===d||e.$$typeof===_||e.$$typeof===v||e.$$typeof===y||e.$$typeof===g)},e.typeOf=b})),at=o(((e,t)=>{t.exports=it()})),ot=o(((e,t)=>{var n=at(),r={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};s[n.ForwardRef]=a,s[n.Memo]=o;function c(e){return n.isMemo(e)?o:s[e.$$typeof]||r}var l=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,m=Object.prototype;function h(e,t,n){if(typeof t!=`string`){if(m){var r=p(t);r&&r!==m&&h(e,r,n)}var a=u(t);d&&(a=a.concat(d(t)));for(var o=c(e),s=c(t),g=0;g<a.length;++g){var _=a[g];if(!i[_]&&!(n&&n[_])&&!(s&&s[_])&&!(o&&o[_])){var v=f(t,_);try{l(e,_,v)}catch{}}}}return e}t.exports=h}));function st(e,t,n){var r=``;return n.split(` `).forEach(function(n){e[n]===void 0?n&&(r+=n+` `):t.push(e[n]+`;`)}),r}var ct=function(e,t,n){var r=e.key+`-`+t.name;n===!1&&e.registered[r]===void 0&&(e.registered[r]=t.styles)},lt=function(e,t,n){ct(e,t,n);var r=e.key+`-`+t.name;if(e.inserted[t.name]===void 0){var i=t;do e.insert(t===i?`.`+r:``,i,e.sheet,!0),i=i.next;while(i!==void 0)}};function ut(e){for(var t=0,n,r=0,i=e.length;i>=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var dt={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},ft=/[A-Z]|^ms/g,pt=/_EMO_([^_]+?)_([^]*?)_EMO_/g,mt=function(e){return e.charCodeAt(1)===45},ht=function(e){return e!=null&&typeof e!=`boolean`},gt=y(function(e){return mt(e)?e:e.replace(ft,`-$&`).toLowerCase()}),_t=function(e,t){switch(e){case`animation`:case`animationName`:if(typeof t==`string`)return t.replace(pt,function(e,t,n){return xt={name:t,styles:n,next:xt},t})}return dt[e]!==1&&!mt(e)&&typeof t==`number`&&t!==0?t+`px`:t};function vt(e,t,n){if(n==null)return``;var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case`boolean`:return``;case`object`:var i=n;if(i.anim===1)return xt={name:i.name,styles:i.styles,next:xt},i.name;var a=n;if(a.styles!==void 0){var o=a.next;if(o!==void 0)for(;o!==void 0;)xt={name:o.name,styles:o.styles,next:xt},o=o.next;return a.styles+`;`}return yt(e,t,n);case`function`:if(e!==void 0){var s=xt,c=n(e);return xt=s,vt(e,t,c)}}var l=n;if(t==null)return l;var u=t[l];return u===void 0?l:u}function yt(e,t,n){var r=``;if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=vt(e,t,n[i])+`;`;else for(var a in n){var o=n[a];if(typeof o!=`object`){var s=o;t!=null&&t[s]!==void 0?r+=a+`{`+t[s]+`}`:ht(s)&&(r+=gt(a)+`:`+_t(a,s)+`;`)}else if(Array.isArray(o)&&typeof o[0]==`string`&&(t==null||t[o[0]]===void 0))for(var c=0;c<o.length;c++)ht(o[c])&&(r+=gt(a)+`:`+_t(a,o[c])+`;`);else{var l=vt(e,t,o);switch(a){case`animation`:case`animationName`:r+=gt(a)+`:`+l+`;`;break;default:r+=a+`{`+l+`}`}}}return r}var bt=/label:\s*([^\s;{]+)\s*(;|$)/g,xt;function St(e,t,n){if(e.length===1&&typeof e[0]==`object`&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,i=``;xt=void 0;var a=e[0];a==null||a.raw===void 0?(r=!1,i+=vt(n,t,a)):i+=a[0];for(var o=1;o<e.length;o++)i+=vt(n,t,e[o]),r&&(i+=a[o]);bt.lastIndex=0;for(var s=``,c;(c=bt.exec(i))!==null;)s+=`-`+c[1];return{name:ut(i)+s,styles:i,next:xt}}var Ct=function(e){return e()},wt=P.useInsertionEffect?P.useInsertionEffect:!1,Tt=wt||Ct,Et=wt||P.useLayoutEffect,Dt=P.createContext(typeof HTMLElement<`u`?et({key:`css`}):null);Dt.Provider;var Ot=function(e){return(0,P.forwardRef)(function(t,n){return e(t,(0,P.useContext)(Dt),n)})},kt=P.createContext({}),At={}.hasOwnProperty,jt=`__EMOTION_TYPE_PLEASE_DO_NOT_USE__`,Mt=function(e,t){var n={};for(var r in t)At.call(t,r)&&(n[r]=t[r]);return n[jt]=e,n},Nt=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return ct(t,n,r),Tt(function(){return lt(t,n,r)}),null},Pt=Ot(function(e,t,n){var r=e.css;typeof r==`string`&&t.registered[r]!==void 0&&(r=t.registered[r]);var i=e[jt],a=[r],o=``;typeof e.className==`string`?o=st(t.registered,a,e.className):e.className!=null&&(o=e.className+` `);var s=St(a,void 0,P.useContext(kt));o+=t.key+`-`+s.name;var c={};for(var l in e)At.call(e,l)&&l!==`css`&&l!==jt&&(c[l]=e[l]);return c.className=o,n&&(c.ref=n),P.createElement(P.Fragment,null,P.createElement(Nt,{cache:t,serialized:s,isStringTag:typeof i==`string`}),P.createElement(i,c))});ot();var Ft=function(e,t){var n=arguments;if(t==null||!At.call(t,`css`))return P.createElement.apply(void 0,n);var r=n.length,i=Array(r);i[0]=Pt,i[1]=Mt(e,t);for(var a=2;a<r;a++)i[a]=n[a];return P.createElement.apply(null,i)};(function(e){var t;t||=e.JSX||={}})(Ft||={});var It=Ot(function(e,t){var n=e.styles,r=St([n],void 0,P.useContext(kt)),i=P.useRef();return Et(function(){var e=t.key+`-global`,n=new t.sheet.constructor({key:e,nonce:t.sheet.nonce,container:t.sheet.container,speedy:t.sheet.isSpeedy}),a=!1,o=document.querySelector(`style[data-emotion="`+e+` `+r.name+`"]`);return t.sheet.tags.length&&(n.before=t.sheet.tags[0]),o!==null&&(a=!0,o.setAttribute(`data-emotion`,e),n.hydrate([o])),i.current=[n,a],function(){n.flush()}},[t]),Et(function(){var e=i.current,n=e[0];if(e[1]){e[1]=!1;return}r.next!==void 0&&lt(t,r.next,!0),n.tags.length&&(n.before=n.tags[n.tags.length-1].nextElementSibling,n.flush()),t.insert(``,r,n,!1)},[t,r.name]),null});function Lt(...e){return function(...t){e.forEach(e=>e?.(...t))}}var Rt=(...e)=>e.map(e=>e?.trim?.()).filter(Boolean).join(` `),zt=/^on[A-Z]/;function Bt(...e){let t={};for(let n of e){for(let e in t){if(zt.test(e)&&typeof t[e]==`function`&&typeof n[e]==`function`){t[e]=Lt(t[e],n[e]);continue}if(e===`className`||e===`class`){t[e]=Rt(t[e],n[e]);continue}if(e===`style`){t[e]=Object.assign({},t[e]??{},n[e]??{});continue}t[e]=n[e]===void 0?t[e]:n[e]}for(let e in n)t[e]===void 0&&(t[e]=n[e])}return t}var Vt=parseInt(`19.3.0`.split(`.`)[0],10)>=19;function Ht(e,t){if(e!=null){if(typeof e==`function`)return e(t);try{e.current=t}catch{throw Error(`Cannot assign value '${t}' to ref '${e}'`)}}}function Ut(...e){let t=e.filter(e=>e!=null);if(Vt){let e=new Map;return n=>(t.forEach(t=>{let r=Ht(t,n);r&&e.set(t,r)}),()=>{t.forEach(t=>{let n=e.get(t);n&&typeof n==`function`?n():Ht(t,null)}),e.clear()})}return e=>{t.forEach(t=>{Ht(t,e)})}}function Wt(e){let t=Object.assign({},e);for(let e in t)t[e]===void 0&&delete t[e];return t}var Gt=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Kt=e=>typeof e==`string`,qt=e=>typeof e==`function`,Jt=(...e)=>{let t=[];for(let n=0;n<e.length;n++){let r=e[n];if(!Kt(r))continue;let i=r.trim();i&&t.push(i)}return t.join(` `)};function Yt(e){return e.default||e}function Xt(e){let t=`19.3.0`;return!Kt(t)||t.startsWith(`18.`)?e?.ref:e?.props?.ref}var Zt=(...e)=>{let t=e.reduce((e,t)=>(t?.forEach(t=>e.add(t)),e),new Set([]));return Array.from(t)};function Qt(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function $t(e={}){let{name:t,strict:n=!0,hookName:r=`useContext`,providerName:i=`Provider`,errorMessage:a,defaultValue:o}=e,s=(0,P.createContext)(o);s.displayName=t;function c(){let e=(0,P.useContext)(s);if(!e&&n){let e=Error(a??Qt(r,i));throw e.name=`ContextError`,Error.captureStackTrace?.(e,c),e}return e}return[s.Provider,c,s]}var[en,tn]=$t({name:`ChakraContext`,strict:!0,providerName:`<ChakraProvider />`});function nn(e){let{value:t,children:n}=e;return(0,F.jsxs)(en,{value:t,children:[!t._config.disableLayers&&(0,F.jsx)(It,{styles:t.layers.atRule}),(0,F.jsx)(It,{styles:t._global}),n]})}var rn=(e,t)=>{let n={},r={},i=Object.keys(e);for(let a of i)t(a)?r[a]=e[a]:n[a]=e[a];return[r,n]},an=(e,t)=>rn(e,qt(t)?t:e=>t.includes(e)),on=new Set([`htmlWidth`,`htmlHeight`,`htmlSize`,`htmlTranslate`]);function sn(e){return typeof e==`string`&&on.has(e)}function cn(e,t,n){let{css:r,isValidProperty:i}=tn(),{children:a,...o}=e,s=(0,P.useMemo)(()=>{let[e,r]=an(o,e=>n(e,t.variantKeys)),[a,s]=an(r,t.variantKeys),[c,l]=an(s,i);return{forwardedProps:e,variantProps:a,styleProps:c,elementProps:l}},[t.variantKeys,n,o,i]),{css:c,...l}=s.styleProps,u=(0,P.useMemo)(()=>{let e={...s.variantProps},n=t.variantKeys.includes(`colorPalette`),r=t.variantKeys.includes(`orientation`);return n||(e.colorPalette=o.colorPalette),r||(e.orientation=o.orientation),t(e)},[t,s.variantProps,o.colorPalette,o.orientation]);return{styles:(0,P.useMemo)(()=>r(u,...ln(c),l),[r,u,c,l]),props:{...s.forwardedProps,...s.elementProps,children:a}}}var ln=e=>(Array.isArray(e)?e:[e]).filter(Boolean).flat(),un=Yt(x),dn=e=>e!==`theme`,fn=(e,t,n)=>{let r;if(t){let n=t.shouldForwardProp;r=e.__emotion_forwardProp&&n?t=>e.__emotion_forwardProp(t)&&n(t):n}return typeof r!=`function`&&n&&(r=e.__emotion_forwardProp),r},pn=typeof document<`u`,mn=({cache:e,serialized:t,isStringTag:n})=>{ct(e,t,n);let r=Tt(()=>lt(e,t,n));if(!pn&&r!==void 0){let n=t.name,i=t.next;for(;i!==void 0;)n=Jt(n,i.name),i=i.next;return(0,F.jsx)(`style`,{"data-emotion":Jt(e.key,n),dangerouslySetInnerHTML:{__html:r},nonce:e.sheet.nonce})}return null},hn={path:[`d`],text:[`x`,`y`],circle:[`cx`,`cy`,`r`],rect:[`width`,`height`,`x`,`y`,`rx`,`ry`],ellipse:[`cx`,`cy`,`rx`,`ry`],g:[`transform`],stop:[`offset`,`stopOpacity`]},gn=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),_n=((e,t={},n={})=>{if(gn(hn,e)){n.forwardProps||=[];let t=hn[e];n.forwardProps=Zt([...n.forwardProps,...t])}let r=e.__emotion_real===e,i=r&&e.__emotion_base||e,a,o;n!==void 0&&(a=n.label,o=n.target);let s=[],c=Ot((a,c,l)=>{let{cva:u,isValidProperty:d}=tn(),f=t.__cva__?t:u(t),p=bn(e.__emotion_cva&&!e.__emotion_cva.__cva__?u(e.__emotion_cva):e.__emotion_cva,f);!n.shouldForwardProp&&n.forwardProps&&(n.shouldForwardProp=(e=>(t,n)=>e.includes(t)?!0:!n?.includes(t)&&!d(t))(n.forwardProps));let m=fn(e,n,r)||((t,n)=>{let r=typeof e==`string`&&e.charCodeAt(0)>96?un:dn,i=!n?.includes(t)&&!d(t);return r(t)&&i}),{props:h,styles:g}=cn(P.useMemo(()=>Object.assign({},n.defaultProps,Wt(a)),[a]),p,m),_=``,v=[g],y=h;if(h.theme==null){y={};for(let e in h)y[e]=h[e];y.theme=P.useContext(kt)}typeof h.className==`string`?_=st(c.registered,v,h.className):h.className!=null&&(_=Jt(_,h.className));let b=St(s.concat(v),c.registered,y);b.styles&&(_=Jt(_,`${c.key}-${b.name}`)),o!==void 0&&(_=Jt(_,o));let x=!m(`as`),S=x&&h.as||i,C={};for(let e in h)if(!(x&&e===`as`)){if(sn(e)){let t=e.replace(`html`,``).toLowerCase();C[t]=h[e];continue}m(e)&&(C[e]=h[e])}let w=_.trim();w?C.className=w:Reflect.deleteProperty(C,`className`),C.ref=l;let T=n.forwardAsChild||n.forwardProps?.includes(`asChild`);if(h.asChild&&!T){let e=P.isValidElement(h.children)?P.Children.only(h.children):P.Children.toArray(h.children).find(P.isValidElement);if(!e)throw Error(`[chakra-ui > factory] No valid child found`);S=e.type,C.children=null,Reflect.deleteProperty(C,`asChild`),C=Bt(C,e.props),C.ref=Ut(l,Xt(e))}return C.as&&T?(C.as=void 0,(0,F.jsxs)(P.Fragment,{children:[(0,F.jsx)(mn,{cache:c,serialized:b,isStringTag:typeof S==`string`}),(0,F.jsx)(S,{asChild:!0,...C,children:(0,F.jsx)(h.as,{children:C.children})})]})):(0,F.jsxs)(P.Fragment,{children:[(0,F.jsx)(mn,{cache:c,serialized:b,isStringTag:typeof S==`string`}),(0,F.jsx)(S,{...C})]})});return c.displayName=a===void 0?`chakra(${typeof i==`string`?i:i.displayName||i.name||`Component`})`:a,c.__emotion_real=c,c.__emotion_base=i,c.__emotion_forwardProp=n.shouldForwardProp,c.__emotion_cva=t,Object.defineProperty(c,"toString",{value(){return`.${o}`}}),c}).bind(),vn=new Map,yn=new Proxy(_n,{apply(e,t,n){return _n(...n)},get(e,t){return vn.has(t)||vn.set(t,_n(t)),vn.get(t)}}),bn=(e,t)=>e&&!t?e:!e&&t?t:e.merge(t),I=yn(`div`);I.displayName=`Box`;function xn(e){if(typeof e!=`string`)return e.displayName||e.name}function Sn(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function Cn(e,t){return e+Sn(t)}function wn(e,t){if(t)return e+Sn(t)}var Tn=Object.freeze({}),En=Object.freeze({});function Dn(e){let{key:t,recipe:n}=e,r=tn();return(0,P.useMemo)(()=>n?r.cva(n):t==null?r.cva({}):r.getRecipeFn(t),[t,n,r])}function On(e){let{key:t,recipe:n}=e,r=Sn(t||n.className||`Component`),[i,a]=$t({strict:!1,name:`${r}PropsContext`,providerName:`${r}PropsContext`});function o(e){let{unstyled:r,...i}=e,a=Dn({key:t,recipe:i.recipe||n}),[o,s]=(0,P.useMemo)(()=>a.splitVariantProps(i),[a,i]);return{styles:r?Tn:a(o),className:a.className,props:s}}let s=(e,t)=>{let{displayName:n,...i}=t??{},s=yn(e,{},i),c=(0,P.forwardRef)((e,t)=>{let n=a(),r=(0,P.useMemo)(()=>Bt(n,e),[e,n]),{styles:i,className:c,props:l}=o(r);return(0,F.jsx)(s,{...l,ref:t,css:[i,r.css],className:Jt(c,r.className)})});return c.displayName=n??r??xn(e),c};function c(){return i}return{withContext:s,PropsProvider:i,withPropsProvider:c,usePropsContext:a,useRecipeResult:o}}var kn=Object.defineProperty,An=e=>{throw TypeError(e)},jn=(e,t,n)=>t in e?kn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mn=(e,t,n)=>jn(e,typeof t==`symbol`?t:t+``,n),Nn=(e,t,n)=>t.has(e)||An(`Cannot `+n),Pn=(e,t,n)=>(Nn(e,t,`read from private field`),n?n.call(e):t.get(e)),Fn=(e,t,n)=>t.has(e)?An(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n);function In(e){return e==null?[]:Array.isArray(e)?e:[e]}var Ln=e=>e[0],Rn=e=>e[e.length-1],zn=(e,t)=>e.indexOf(t)!==-1,Bn=(e,...t)=>e.concat(t),Vn=(e,...t)=>e.filter(e=>!t.includes(e)),Hn=(e,t)=>zn(e,t)?Vn(e,t):Bn(e,t);function Un(e,t,n={}){let{step:r=1,loop:i=!0}=n,a=t+r,o=e.length,s=o-1;return t===-1?r>0?0:s:a<0?i?s:0:a>=o?i?0:t>o?o:t:a}function Wn(e,t,n={}){return e[Un(e,t,n)]}function Gn(e,t,n={}){let{step:r=1,loop:i=!0}=n;return Un(e,t,{step:-r,loop:i})}function Kn(e,t,n={}){return e[Gn(e,t,n)]}var qn=e=>e?.constructor.name===`Array`,Jn=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Yn(e[n],t[n]))return!1;return!0},Yn=(e,t)=>{if(Object.is(e,t))return!0;if(e==null&&t!=null||e!=null&&t==null)return!1;if(typeof e?.isEqual==`function`&&typeof t?.isEqual==`function`)return e.isEqual(t);if(typeof e==`function`&&typeof t==`function`)return e.toString()===t.toString();if(qn(e)&&qn(t))return Jn(Array.from(e),Array.from(t));if(typeof e!=`object`||typeof t!=`object`)return!1;let n=Object.keys(t??Object.create(null)),r=n.length;for(let t=0;t<r;t++)if(!Reflect.has(e,n[t]))return!1;for(let i=0;i<r;i++){let r=n[i];if(!Yn(e[r],t[r]))return!1}return!0},Xn=e=>Array.isArray(e),Zn=e=>typeof e==`object`&&!!e,Qn=e=>Zn(e)&&!Xn(e),$n=e=>typeof e==`string`,er=e=>typeof e==`function`,tr=e=>e==null,nr=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),rr=e=>Object.prototype.toString.call(e),ir=Function.prototype.toString,ar=ir.call(Object),or=e=>{if(!Zn(e)||rr(e)!=`[object Object]`||lr(e))return!1;let t=Object.getPrototypeOf(e);if(t===null)return!0;let n=nr(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&ir.call(n)==ar},sr=e=>typeof e==`object`&&!!e&&`$$typeof`in e&&`props`in e,cr=e=>typeof e==`object`&&!!e&&`__v_isVNode`in e,lr=e=>sr(e)||cr(e),ur=e=>e(),dr=()=>{},fr=(...e)=>(...t)=>{e.forEach(function(e){e?.(...t)})},{floor:pr,abs:mr,round:hr,min:gr,max:_r,pow:vr,sign:yr}=Math,br=e=>typeof e==`number`?`${e}px`:e;function xr(e){if(!or(e)||e===void 0)return e;let t=Reflect.ownKeys(e).filter(e=>typeof e==`string`),n={};for(let r of t){let t=e[r];t!==void 0&&(n[r]=xr(t))}return n}function Sr(e,t){if(!t)return e;let n={...e},r=t;for(let e in r){let t=r[e];t!==void 0&&(n[e]=t)}return n}var Cr=()=>performance.now(),wr,Tr=class{constructor(e){Mn(this,`onTick`,e),Mn(this,`frameId`,null),Mn(this,`pausedAtMs`,null),Mn(this,`context`),Mn(this,`cancelFrame`,()=>{this.frameId!==null&&(cancelAnimationFrame(this.frameId),this.frameId=null)}),Mn(this,`setStartMs`,e=>{this.context.startMs=e}),Mn(this,`start`,()=>{if(this.frameId!==null)return;let e=Cr();this.pausedAtMs===null?this.context.startMs=e:(this.context.startMs+=e-this.pausedAtMs,this.pausedAtMs=null),this.frameId=requestAnimationFrame(Pn(this,wr))}),Mn(this,`pause`,()=>{this.frameId!==null&&(this.cancelFrame(),this.pausedAtMs=Cr())}),Mn(this,`stop`,()=>{this.frameId!==null&&(this.cancelFrame(),this.pausedAtMs=null)}),Fn(this,wr,e=>{if(this.context.now=e,this.context.deltaMs=e-this.context.startMs,this.onTick(this.context)===!1){this.stop();return}this.frameId=requestAnimationFrame(Pn(this,wr))}),this.context={now:0,startMs:Cr(),deltaMs:0}}get elapsedMs(){return this.pausedAtMs===null?Cr()-this.context.startMs:this.pausedAtMs-this.context.startMs}};wr=new WeakMap;function Er(e,t){let n=new Tr(({deltaMs:n})=>{if(n>=t)return e(),!1});return n.start(),()=>n.stop()}function Dr(...e){e.length===1?e[0]:e[1],e.length===2&&e[0]}function Or(...e){e.length===1?e[0]:e[1],e.length===2&&e[0]}function kr(e,t){if(e==null)throw Error(t())}function Ar(e,t,n){let r=[];for(let n of t)e[n]??r.push(n);if(r.length>0)throw Error(`[zag-js${n?` > ${n}`:``}] missing required props: ${r.join(`, `)}`)}function jr(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function Mr(e={}){let{name:t,strict:n=!0,hookName:r=`useContext`,providerName:i=`Provider`,errorMessage:a,defaultValue:o}=e,s=(0,P.createContext)(o);s.displayName=t;function c(){let e=(0,P.useContext)(s);if(!e&&n){let e=Error(a??jr(r,i));throw e.name=`ContextError`,nr(Error,`captureStackTrace`)&&er(Error.captureStackTrace)&&Error.captureStackTrace(e,c),e}return e}return[s.Provider,c,s]}var[Nr,Pr]=Mr({name:`EnvironmentContext`,hookName:`useEnvironmentContext`,providerName:`<EnvironmentProvider />`,strict:!1,defaultValue:{getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window}});function Fr(...e){return t=>{let n=[],r=!1;for(let i of e)if(typeof i==`function`){let e=i(t);typeof e==`function`?(r=!0,n.push(e)):n.push(()=>i(null))}else i&&(i.current=t,n.push(()=>{i.current=null}));if(r)return()=>{for(let e of n)e()}}}function Ir(...e){return(0,P.useCallback)(Fr(...e),e)}var Lr=(...e)=>e.map(e=>e?.trim?.()).filter(Boolean).join(` `),Rr=(...e)=>Array.from(new Set(Lr(...e).split(/\s+/).filter(Boolean))).join(` `),zr=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,Br=e=>{let t={},n;for(;n=zr.exec(e);)t[n[1]]=n[2];return t},Vr=(e,t)=>{if($n(e)){if($n(t))return`${e};${t}`;e=Br(e)}else $n(t)&&(t=Br(t));return Object.assign({},e??{},t??{})};function L(...e){let t={};for(let n of e){if(!n)continue;for(let e in t){if(e.startsWith(`on`)&&typeof t[e]==`function`&&typeof n[e]==`function`){t[e]=fr(n[e],t[e]);continue}if(e===`className`||e===`class`){t[e]=Lr(t[e],n[e]);continue}if(e===`style`){t[e]=Vr(t[e],n[e]);continue}if(e===`data-ownedby`){t[e]=Rr(t[e],n[e]);continue}t[e]=n[e]===void 0?t[e]:n[e]}for(let e in n)t[e]===void 0&&(t[e]=n[e]);let e=Object.getOwnPropertySymbols(n);for(let r of e)t[r]=n[r]}return t}var Hr=`.`,Ur=`#`,Wr=new WeakMap,Gr=new WeakMap;function Kr(e){return e.join(Hr)}function qr(e){return e.includes(Hr)}function Jr(e){return e.startsWith(Ur)}function Yr(e){return e.startsWith(Hr)}function Xr(e){return Jr(e)?e.slice(Ur.length):e}function Zr(e,t){return e?`${e}${Hr}${t}`:t}function Qr(e){let t=new Map,n=new Map,r=(e,i)=>{t.set(e,i);let a=i.id;a&&(n.has(a)&&Or(`[zag-js] Duplicate state id: "${a}"`),n.set(a,e));let o=i.states;if(o){kr(i.initial,()=>`[zag-js] Compound state "${e}" has child states but no "initial" property`),i.initial in o||Or(`[zag-js] Compound state "${e}" has initial "${String(i.initial)}" which is not a child state`);for(let[t,n]of Object.entries(o)){if(!n)continue;let i=Zr(e,t);r(i,n)}}};for(let[t,n]of Object.entries(e.states))n&&r(t,n);return{index:t,idIndex:n}}function $r(e){let t=Wr.get(e);if(t)return t;let{index:n,idIndex:r}=Qr(e);return Wr.set(e,n),Gr.set(e,r),n}function ei(e,t){return $r(e),Gr.get(e)?.get(t)}function ti(e){return e?String(e).split(Hr).filter(Boolean):[]}function ni(e,t){if(!t)return[];let n=$r(e),r=ti(t),i=[],a=[];for(let e of r){a.push(e);let t=Kr(a),r=n.get(t);if(!r)break;i.push({path:t,state:r})}return i}function ri(e,t){let n=$r(e),r=ti(t);if(!r.length)return t;let i=[];for(let e of r){i.push(e);let r=Kr(i);if(!n.has(r))return t}let a=Kr(i),o=n.get(a);for(;o?.initial;){let e=`${a}${Hr}${o.initial}`,t=n.get(e);if(!t)break;a=e,o=t}return a}function ii(e,t){return $r(e).has(t)}function ai(e,t,n){let r=String(t);if(Jr(r)){let t=Xr(r),n=ei(e,t);return kr(n,()=>`[zag-js] Unknown state id: "${t}"`),ri(e,n)}if(Yr(r)&&n)return ri(e,Zr(n,r.slice(1)));if(!qr(r)&&n){let t=ti(n);for(let n=t.length-1;n>=1;n--){let i=Zr(t.slice(0,n).join(Hr),r);if(ii(e,i))return ri(e,i)}if(ii(e,r))return ri(e,r)}return ri(e,r)}function oi(e,t,n){let r=ni(e,t);for(let e=r.length-1;e>=0;e--){let t=r[e]?.state.on?.[n];if(t)return{transitions:t,source:r[e]?.path}}return{transitions:e.on?.[n],source:void 0}}function si(e,t,n,r){let i=t?ni(e,t):[],a=ni(e,n),o=0;for(;o<i.length&&o<a.length&&i[o]?.path===a[o]?.path;)o+=1;let s=i.slice(o).reverse(),c=a.slice(o),l=i[i.length-1]?.path===a[a.length-1]?.path;return r&&l&&(s=i.slice().reverse(),c=a),{exiting:s,entering:c}}function ci(e,t){return e?e===t||e.startsWith(`${t}${Hr}`):!1}function li(e,t,n){return ni(e,t).some(e=>e.state.tags?.includes(n))}function ui(){return{and:(...e)=>function(t){return e.every(e=>t.guard(e))},or:(...e)=>function(t){return e.some(e=>t.guard(e))},not:e=>function(t){return!t.guard(e)}}}function di(e){return $r(e),e}function fi(){return{guards:ui(),createMachine:e=>di(e),choose:e=>function({choose:t}){return t(e)?.actions}}}var pi=(e=>(e.NotStarted=`Not Started`,e.Started=`Started`,e.Stopped=`Stopped`,e))(pi||{}),mi=`__init__`,hi=Object.defineProperty,gi=(e,t,n)=>t in e?hi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_i=(e,t,n)=>gi(e,typeof t==`symbol`?t:t+``,n),vi=(e,t)=>e.map((n,r)=>e[(Math.max(t,0)+r)%e.length]),yi=(...e)=>t=>e.reduce((e,t)=>t(e),t),bi=()=>void 0,xi=e=>typeof e==`object`&&!!e,R=e=>e?``:void 0,Si=e=>e?`true`:void 0,Ci=/\\/g,wi=/"/g,Ti=e=>globalThis.CSS?.escape?.(e)??e.replace(Ci,`\\\\`).replace(wi,`\\"`),Ei=e=>`[data-ownedby~="${Ti(String(e))}"]`,Di=1,Oi=9,ki=11,Ai=e=>xi(e)&&e.nodeType===Di&&typeof e.nodeName==`string`,ji=e=>xi(e)&&e.nodeType===Di&&typeof e.nodeName==`string`,Mi=e=>xi(e)&&e.nodeType===Oi,Ni=e=>xi(e)&&e===e.window,Pi=e=>ji(e)?e.localName||``:`#document`;function Fi(e){return[`html`,`body`,`#document`].includes(Pi(e))}var Ii=e=>xi(e)&&e.nodeType!==void 0,Li=e=>Ii(e)&&e.nodeType===ki&&`host`in e,Ri=e=>ji(e)&&e.localName===`input`,zi=e=>!!e?.matches(`a[href]`),Bi=e=>ji(e)?e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0:!1;function Vi(e){return e?Xi(e.getRootNode())===e:!1}var Hi=/(textarea|select)/;function Ui(e){if(e==null||!ji(e))return!1;try{return Ri(e)&&e.selectionStart!=null||Hi.test(e.localName)||e.isContentEditable||e.getAttribute(`contenteditable`)===`true`||e.getAttribute(`contenteditable`)===``}catch{return!1}}function Wi(e){let t=e.parentNode;return Li(t)?t.host:t}function Gi(e){let t=[];for(;e;)t.push(e),e=Wi(e);return t}function Ki(e,t){if(!e||!t||!ji(e)||!Ii(t))return!1;if(ji(t)&&e===t||e.contains(t))return!0;let n=t.getRootNode?.();if(n&&Li(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function qi(e){return Mi(e)?e:Ni(e)?e.document:e?.ownerDocument??document}function Ji(e){return qi(e).documentElement}function Yi(e){return Li(e)?Yi(e.host):Mi(e)?e.defaultView??window:ji(e)?e.ownerDocument?.defaultView??window:window}function Xi(e){let t=e.activeElement;for(;t?.shadowRoot;){let e=t.shadowRoot.activeElement;if(!e||e===t)break;t=e}return t}function Zi(e){if(Pi(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Li(e)&&e.host||Ji(e);return Li(t)?t.host:t}function Qi(e){let t;try{if(t=e.getRootNode({composed:!0}),Mi(t)||Li(t))return t}catch{}return e.ownerDocument??document}var $i=new WeakMap;function ea(e){return $i.has(e)||$i.set(e,Yi(e).getComputedStyle(e)),$i.get(e)}var ta=new Set([`menu`,`listbox`,`dialog`,`grid`,`tree`,`region`,`application`]),na=e=>ta.has(e),ra=e=>e.getAttribute(`aria-controls`)?.split(` `)||[];function ia(e,t){let n=new Set,r=Qi(e),i=e=>{let a=e.querySelectorAll(`[aria-controls]`);for(let e of a){if(e.getAttribute(`aria-expanded`)!==`true`)continue;let a=ra(e);for(let e of a){if(!e||n.has(e))continue;n.add(e);let a=r.getElementById(e);if(a){let e=a.getAttribute(`role`),n=a.getAttribute(`aria-modal`)===`true`;if(e&&na(e)&&!n&&(a===t||a.contains(t)||i(a)))return!0}}}return!1};return i(e)}function aa(e,t){let n=Qi(e),r=new Set,i=e=>{let a=e.querySelectorAll(`[aria-controls]`);for(let e of a){if(e.getAttribute(`aria-expanded`)!==`true`)continue;let a=ra(e);for(let e of a){if(!e||r.has(e))continue;r.add(e);let a=n.getElementById(e);if(a){let e=a.getAttribute(`role`),n=a.getAttribute(`aria-modal`)===`true`;e&&ta.has(e)&&!n&&(t(a),i(a))}}}};i(e)}function oa(e){let t=new Set;return aa(e,n=>{e.contains(n)||t.add(n)}),Array.from(t)}function sa(e){let t=e.getAttribute(`role`);return!!(t&&ta.has(t))}function ca(e){return e.hasAttribute(`aria-controls`)&&e.getAttribute(`aria-expanded`)===`true`}function la(e){return ca(e)?!0:!!e.querySelector?.(`[aria-controls][aria-expanded="true"]`)}function ua(e){if(!e.id)return!1;let t=Qi(e),n=CSS.escape(e.id),r=`[aria-controls~="${n}"][aria-expanded="true"], [aria-controls="${n}"][aria-expanded="true"]`;return!!(t.querySelector(r)&&sa(e))}var da=()=>typeof document<`u`;function fa(){return navigator.userAgentData?.platform??navigator.platform}function pa(){let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:e,version:t})=>`${e}/${t}`).join(` `):navigator.userAgent}var ma=e=>da()&&e.test(fa()),ha=e=>da()&&e.test(pa()),ga=e=>da()&&e.test(navigator.vendor),_a=/^iPhone/i,va=/^iPad/i,ya=/^Mac/i,ba=/apple/i,xa=/Firefox/i,Sa=/Android/i,Ca=()=>da()&&!!navigator.maxTouchPoints,wa=()=>ma(_a),Ta=()=>ma(va)||Oa()&&navigator.maxTouchPoints>1,Ea=()=>wa()||Ta(),Da=()=>Oa()||Ea(),Oa=()=>ma(ya),ka=()=>Da()&&ga(ba),Aa=()=>ha(xa),ja=()=>ha(Sa);function Ma(e){return e.composedPath?.()??e.nativeEvent?.composedPath?.()}function z(e){return Ma(e)?.[0]??e.target}function Na(e){let t=e.currentTarget;if(!t||!t.matches(`a[href], button[type='submit'], input[type='submit']`))return!1;let n=e.button===1,r=Fa(e);return n||r}function Pa(e){return Ua(e).isComposing||e.keyCode===229}function Fa(e){return Oa()?e.metaKey:e.ctrlKey}function Ia(e){return e.pointerType===``&&e.isTrusted?!0:ja()&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}var La=e=>e.button===0,Ra=e=>e.button===2||Oa()&&e.ctrlKey&&e.button===0,za=e=>`touches`in e&&e.touches.length>0,Ba={Up:`ArrowUp`,Down:`ArrowDown`,Esc:`Escape`," ":`Space`,",":`Comma`,Left:`ArrowLeft`,Right:`ArrowRight`},Va={ArrowLeft:`ArrowRight`,ArrowRight:`ArrowLeft`};function Ha(e,t={}){let{dir:n=`ltr`,orientation:r=`horizontal`}=t,i=e.key;return i=Ba[i]??i,n===`rtl`&&r===`horizontal`&&i in Va&&(i=Va[i]),i}function Ua(e){return e.nativeEvent??e}function Wa(e,t=`client`){let n=za(e)?e.touches[0]||e.changedTouches[0]:e;return{x:n[`${t}X`],y:n[`${t}Y`]}}var Ga=(e,t,n,r)=>{let i=typeof e==`function`?e():e;return i?.addEventListener(t,n,r),()=>{i?.removeEventListener(t,n,r)}};function Ka(e,t){let{type:n=`HTMLInputElement`,property:r=`value`}=t,i=Yi(e)[n].prototype;return Object.getOwnPropertyDescriptor(i,r)??{}}function qa(e,t){e&&(Ka(e,{type:`HTMLInputElement`,property:`checked`}).set?.call(e,t),t?e.setAttribute(`checked`,``):e.removeAttribute(`checked`))}function Ja(e,t){let{checked:n,bubbles:r=!0}=t;if(!e)return;let i=Yi(e);if(!(e instanceof i.HTMLInputElement))return;qa(e,n);let a=new i.Event(`click`,{bubbles:r});e.dispatchEvent(to(a))}function Ya(e){return e.matches(`textarea, input, select, button`)}function Xa(e,t){if(!e)return;let n=Ya(e)?e.form:e.closest(`form`),r=e=>{e.defaultPrevented||t()};return n?.addEventListener(`reset`,r,{passive:!0}),()=>n?.removeEventListener(`reset`,r)}function Za(e,t){let n=e?.closest(`fieldset`);if(!n)return;t(n.disabled);let r=new(Yi(n)).MutationObserver(()=>t(n.disabled));return r.observe(n,{attributes:!0,attributeFilter:[`disabled`]}),()=>r.disconnect()}function Qa(e,t){if(!e)return;let{onFieldsetDisabledChange:n,onFormReset:r}=t,i=[Xa(e,r),Za(e,n)];return()=>i.forEach(e=>e?.())}var $a=Symbol.for(`zag.changeEvent`);function eo(e){return Object.prototype.hasOwnProperty.call(e,$a)}function to(e){return eo(e)||Object.defineProperty(e,$a,{value:!0}),e}var no=e=>ji(e)&&e.tagName===`IFRAME`,ro=/^(audio|video|details)$/;function io(e){let t=e.getAttribute(`tabindex`);return t?parseInt(t,10):NaN}var ao=e=>!Number.isNaN(io(e)),oo=e=>io(e)<0;function so(e){return Ri(e)&&e.type===`radio`}function co(e){if(!so(e)||!e.name||e.checked)return!0;let t=`input[type="radio"][name="${CSS.escape(e.name)}"]`,n=e.form??e.ownerDocument,r=Array.from(n.querySelectorAll(t)).filter(t=>t.form===e.form&&mo(t)),i=r.find(e=>e.checked);return i?i===e:r[0]===e}function lo(e,t){if(!t)return null;if(t===!0)return e.shadowRoot||null;let n=t(e);return(n===!0?e.shadowRoot:n)||null}function uo(e,t,n){let r=[...e],i=[...e],a=new Set,o=new Map;e.forEach((e,t)=>o.set(e,t));let s=0;for(;s<i.length;){let e=i[s++];if(!e||a.has(e))continue;a.add(e);let c=lo(e,t);if(c){let t=Array.from(c.querySelectorAll(fo)).filter(n),a=o.get(e);if(a!==void 0){let e=a+1;r.splice(e,0,...t),t.forEach((t,n)=>{o.set(t,e+n)});for(let n=e+t.length;n<r.length;n++)o.set(r[n],n)}else{let e=r.length;r.push(...t),t.forEach((t,n)=>{o.set(t,e+n)})}i.push(...t)}}return r}var fo=`input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false']), details > summary:first-of-type`,po=(e,t={})=>{if(!e)return[];let{includeContainer:n=!1,getShadowRoot:r}=t,i=Array.from(e.querySelectorAll(fo));(n==1||n==`if-empty`&&i.length===0)&&ji(e)&&mo(e)&&i.unshift(e);let a=[];for(let e of i)if(mo(e)){if(no(e)&&e.contentDocument){let t=e.contentDocument.body;a.push(...po(t,{getShadowRoot:r}));continue}a.push(e)}return r?uo(a,r,mo):a};function mo(e){return!ji(e)||e.closest(`[inert]`)?!1:e.matches(fo)&&Bi(e)}function ho(e,t={}){if(!e)return[];let{includeContainer:n,getShadowRoot:r}=t,i=Array.from(e.querySelectorAll(fo));n&&go(e)&&i.unshift(e);let a=[];for(let e of i)if(go(e)){if(no(e)&&e.contentDocument){let t=e.contentDocument.body;a.push(...ho(t,{getShadowRoot:r}));continue}a.push(e)}if(r){let e=uo(a,r,go);return!e.length&&n?i:e}return!a.length&&n?i:a}function go(e){return ji(e)&&e.tabIndex>0?!0:!mo(e)||oo(e)?!1:co(e)}function _o(e,t={}){let n=ho(e,t);return[n[0]||null,n[n.length-1]||null]}function vo(e){return e.tabIndex<0&&(ro.test(e.localName)||Ui(e))&&!ao(e)?0:e.tabIndex}function yo(e){let{root:t,getInitialEl:n,filter:r,enabled:i=!0}=e;if(!i)return;let a=typeof n==`function`?n():n;return a||=t?.querySelector(`[data-autofocus],[autofocus]`),a||=ho(t).filter(e=>!r||r(e)).find(e=>!e.hasAttribute(`data-no-autofocus`)),a||t||void 0}function bo(e){let t=e.currentTarget;if(!t)return!1;let[n,r]=_o(t);return!(Vi(n)&&e.shiftKey||Vi(r)&&!e.shiftKey||!n&&!r)}var xo=class e{constructor(){_i(this,`id`,null),_i(this,`fn_cleanup`),_i(this,`cleanup`,()=>{this.cancel()})}static create(){return new e}request(e){this.cancel(),this.id=globalThis.requestAnimationFrame(()=>{this.id=null,this.fn_cleanup=e?.()})}cancel(){this.id!==null&&(globalThis.cancelAnimationFrame(this.id),this.id=null),this.fn_cleanup?.(),this.fn_cleanup=void 0}isActive(){return this.id!==null}};function So(e){let t=xo.create();return t.request(e),t.cleanup}function Co(e){let t=new Set;function n(e){let n=globalThis.requestAnimationFrame(e);t.add(()=>globalThis.cancelAnimationFrame(n))}return n(()=>n(e)),function(){t.forEach(e=>e())}}function wo(e,t,n){let r=So(()=>{e.removeEventListener(t,i,!0),n()}),i=()=>{r(),n()};return e.addEventListener(t,i,{once:!0,capture:!0}),r}function To(e,t){if(!e)return;let{attributes:n,callback:r}=t,i=new(e.ownerDocument.defaultView||window).MutationObserver(e=>{for(let t of e)t.type===`attributes`&&t.attributeName&&n.includes(t.attributeName)&&r(t)});return i.observe(e,{attributes:!0,attributeFilter:n}),()=>i.disconnect()}function Eo(e,t){let{defer:n}=t,r=n?So:e=>e(),i=[];return i.push(r(()=>{let n=typeof e==`function`?e():e;i.push(To(n,t))})),()=>{i.forEach(e=>e?.())}}function Do(e,t){let{callback:n}=t;if(!e)return;let r=new(e.ownerDocument.defaultView||window).MutationObserver(n);return r.observe(e,{childList:!0,subtree:!0}),()=>r.disconnect()}function Oo(e,t){let{defer:n}=t,r=n?So:e=>e(),i=[];return i.push(r(()=>{let n=typeof e==`function`?e():e;i.push(Do(n,t))})),()=>{i.forEach(e=>e?.())}}function ko(e){let t=()=>{let t=Yi(e);e.dispatchEvent(new t.MouseEvent(`click`))};Aa()?wo(e,`keyup`,t):queueMicrotask(t)}function Ao(e){let t=Zi(e);return Fi(t)?qi(t).body:ji(t)&&No(t)?t:Ao(t)}var jo=/auto|scroll|overlay|hidden|clip/,Mo=new Set([`inline`,`contents`]);function No(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Yi(e).getComputedStyle(e);return jo.test(t+r+n)&&!Mo.has(i)}var Po=`default`,Fo=``,Io=new WeakMap;function Lo(e={}){let{target:t,doc:n}=e,r=n??document,i=r.documentElement;return Ea()?(Po==="default"&&(Fo=i.style.webkitUserSelect,i.style.webkitUserSelect=`none`),Po=`disabled`):t&&(Io.set(t,t.style.userSelect),t.style.userSelect=`none`),()=>Ro({target:t,doc:r})}function Ro(e={}){let{target:t,doc:n}=e,r=(n??document).documentElement;if(Ea()){if(Po!==`disabled`)return;Po=`restoring`,setTimeout(()=>{Co(()=>{Po===`restoring`&&(r.style.webkitUserSelect===`none`&&(r.style.webkitUserSelect=Fo||``),Fo=``,Po=`default`)})},300)}else if(t&&Io.has(t)){let e=Io.get(t);t.style.userSelect===`none`&&(t.style.userSelect=e??``),t.getAttribute(`style`)===``&&t.removeAttribute(`style`),Io.delete(t)}}function zo(e={}){let{defer:t,target:n,...r}=e,i=t?So:e=>e(),a=[];return a.push(i(()=>{let e=typeof n==`function`?n():n;a.push(Lo({...r,target:e}))})),()=>{a.forEach(e=>e?.())}}function Bo(e,t){let{onPointerMove:n,onPointerUp:r}=t,i=e=>{let t=Wa(e);if(!(Math.sqrt(t.x**2+t.y**2)<(e.pointerType===`touch`?10:5))){if(e.pointerType===`mouse`&&e.buttons===0){a(e);return}n({point:t,event:e})}},a=e=>{let t=Wa(e);r({point:t,event:e})},o=[Ga(e,`pointermove`,i,!1),Ga(e,`pointerup`,a,!1),Ga(e,`pointercancel`,a,!1),Ga(e,`contextmenu`,a,!1),zo({doc:e})];return()=>{o.forEach(e=>e())}}function Vo(e){let{pointerNode:t,keyboardNode:n=t,onPress:r,onPressStart:i,onPressEnd:a,isValidKey:o=e=>e.key===`Enter`}=e;if(!t)return bi;let s=Yi(t),c=bi,l=bi,u=bi,d=e=>({point:Wa(e),event:e});function f(e){i?.(d(e))}function p(e){a?.(d(e))}c=yi(Ga(t,`pointerdown`,e=>{l(),l=yi(Ga(s,`pointerup`,e=>{let n=z(e);Ki(t,n)?r?.(d(e)):a?.(d(e))},{passive:!r,once:!0}),Ga(s,`pointercancel`,p,{passive:!a,once:!0})),Vi(n)&&e.pointerType===`mouse`&&e.preventDefault(),f(e)},{passive:!i}),Ga(n,`focus`,m));function m(){u=yi(Ga(n,`keydown`,e=>{o(e)&&(l(),l=Ga(n,`keyup`,e=>{if(!o(e))return;let t=new s.PointerEvent(`pointerup`),n=d(t);r?.(n),a?.(n)}),f(new s.PointerEvent(`pointerdown`)))}),Ga(n,`blur`,()=>{p(new s.PointerEvent(`pointercancel`))}))}return()=>{c(),l(),u()}}function Ho(e,t){return Array.from(e?.querySelectorAll(t)??[])}var Uo=e=>e.id;function B(e,t,n=Uo){return e.find(e=>n(e)===t)}function Wo(e,t,n=Uo){let r=B(e,t,n);return r?e.indexOf(r):-1}function Go(e,t,n=!0){let r=Wo(e,t);return r=n?(r+1)%e.length:Math.min(r+1,e.length-1),e[r]}function Ko(e,t,n=!0){let r=Wo(e,t);return r===-1?n?e[e.length-1]:null:(r=n?(r-1+e.length)%e.length:Math.max(0,r-1),e[r])}function qo(e){let t=new WeakMap,n,r=new WeakMap,i=e=>n||(n=new e.ResizeObserver(e=>{for(let n of e){r.set(n.target,n);let e=t.get(n.target);if(e)for(let t of e)t(n)}}),n);return{observe:(n,r)=>{let a=t.get(n)||new Set;a.add(r),t.set(n,a);let o=Yi(n);return i(o).observe(n,e),()=>{let e=t.get(n);e&&(e.delete(r),e.size===0&&(t.delete(n),i(o).unobserve(n)))}},unobserve:e=>{t.delete(e),n?.unobserve(e)}}}var Jo=qo({box:`border-box`});function Yo(e){return e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth}function Xo(e,t){let{rootEl:n,...r}=t||{};e&&n&&No(n)&&Yo(n)&&e.scrollIntoView(r)}var Zo=e=>e.split(``).map(e=>{let t=e.charCodeAt(0);return t>0&&t<128?e:t>=128&&t<=255?`/x${t.toString(16)}`.replace(`/`,`\\`):``}).join(``).trim(),Qo=e=>Zo(e.dataset?.valuetext??e.textContent??``),$o=(e,t)=>e.trim().toLowerCase().startsWith(t.toLowerCase());function es(e,t,n,r=Uo){let i=n?Wo(e,n,r):-1,a=n?vi(e,i):e;return t.length===1&&(a=a.filter(e=>r(e)!==n)),a.find(e=>$o(Qo(e),t))}function ts(e,t){if(!e)return bi;let n=Object.keys(t).reduce((t,n)=>(t[n]=e.style.getPropertyValue(n),t),{});return rs(n,t)?bi:(Object.assign(e.style,t),()=>{Object.assign(e.style,n),e.style.length===0&&e.removeAttribute(`style`)})}function ns(e,t,n){if(!e)return bi;let r=e.style.getPropertyValue(t);return r===n?bi:(e.style.setProperty(t,n),()=>{e.style.setProperty(t,r),e.style.length===0&&e.removeAttribute(`style`)})}function rs(e,t){return Object.keys(e).every(n=>e[n]===t[n])}function is(e,t){let{state:n,activeId:r,key:i,timeout:a=350,itemToId:o}=t,s=n.keysSoFar+i,c=s.length>1&&Array.from(s).every(e=>e===s[0])?s[0]:s,l=es(e.slice(),c,r,o);function u(){clearTimeout(n.timer),n.timer=-1}function d(e){n.keysSoFar=e,u(),e!==``&&(n.timer=+setTimeout(()=>{d(``),u()},a))}return d(s),l}var as=Object.assign(is,{defaultOptions:{keysSoFar:``,timer:-1},isValidEvent:os});function os(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey}var ss={border:`0`,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:`0`,position:`absolute`,width:`1px`,whiteSpace:`nowrap`,wordWrap:`normal`};function cs(e,t,n){let{signal:r}=t;return[new Promise((t,i)=>{let a=setTimeout(()=>{i(Error(`Timeout of ${n}ms exceeded`))},n);r.addEventListener(`abort`,()=>{clearTimeout(a),i(new DOMException(`Promise aborted`,`AbortError`))}),e.then(e=>{r.aborted||(clearTimeout(a),t(e))}).catch(e=>{r.aborted||(clearTimeout(a),i(e))})}),()=>t.abort()]}function ls(e,t){let{timeout:n,rootNode:r}=t,i=Yi(r),a=qi(r),o=new i.AbortController;return cs(new Promise(t=>{let n=e();if(n){t(n);return}let r=new i.MutationObserver(()=>{let n=e();n&&n.isConnected&&(r.disconnect(),t(n))});r.observe(a.body,{childList:!0,subtree:!0})}),o,n)}function us(e,t,n={}){let{defer:r,onMissing:i}=n,a=()=>typeof e==`function`?e():e,o=[],s=e=>{if(!e)return i?.();o.push(t(e))},c=a();if(!r||c)s(c);else{let e=!1;o.push(()=>{e=!0}),queueMicrotask(()=>{if(e)return;let t=a();if(t){s(t);return}o.push(So(()=>{e||s(a())}))})}return()=>{o.forEach(e=>e?.())}}function ds(e){let t=()=>e.getRootNode?.()??document,n=()=>qi(t()),r=()=>n().defaultView??window,i=()=>Xi(t()),a=e=>t().getElementById(e);return{...e,getRootNode:t,getDoc:n,getWin:r,getActiveElement:i,isActiveElement:Vi,getById:a}}function fs(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)}var ps=Symbol.for(`react.lazy`);function ms(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===ps}function hs(e){if((0,P.isValidElement)(e))return e;if(ms(e))return P.Children.toArray(e).find(P.isValidElement)}var gs=e=>{let t=(0,P.memo)((0,P.forwardRef)((t,n)=>{let{asChild:r,children:i,...a}=t,o=r?hs(i):void 0,s=o?fs(o):void 0,c=Ir(n,s);return r?o?(0,P.cloneElement)(o,{...L(a,o.props),ref:n?c:s}):null:(0,P.createElement)(e,{...a,ref:n},i)}));return t.displayName=e.displayName||e.name,t},V=(()=>{let e=new Map;return new Proxy(gs,{apply(e,t,n){return gs(n[0])},get(t,n){let r=n;return e.has(r)||e.set(r,gs(r)),e.get(r)}})})(),[_s,vs]=Mr({name:`LocaleContext`,hookName:`useLocaleContext`,providerName:`<LocaleProvider />`,strict:!1,defaultValue:{dir:`ltr`,locale:`en-US`}}),ys=Object.defineProperty,bs=(e,t)=>{let n={};for(var r in e)ys(n,r,{get:e[r],enumerable:!0});return t||ys(n,Symbol.toStringTag,{value:`Module`}),n},xs=()=>(e,t)=>t.reduce((e,t)=>{let[n,r]=e,i=t;return r[i]!==void 0&&(n[i]=r[i]),delete r[i],[n,r]},[{},{...e}]),Ss=e=>xs()(e,[`hideMode`,`immediate`,`lazyMount`,`onEnterComplete`,`onExitComplete`,`present`,`skipAnimationOnMount`,`unmountOnExit`]),Cs=(e=>Reflect.get(e,`Activity`))(P),ws=Cs!==void 0;function Ts(e,t={}){let{sync:n=!1}=t,r=Es(e);return(0,P.useCallback)((...e)=>n?queueMicrotask(()=>r.current?.(...e)):r.current?.(...e),[n,r])}function Es(e){let t=(0,P.useRef)(e);return t.current=e,t}var Ds=globalThis.document===void 0?P.useEffect:P.useLayoutEffect;function Os(e){let t=e().value??e().defaultValue,n=e().isEqual??Object.is,[r]=(0,P.useState)(t),[i,a]=(0,P.useState)(r),o=e().value!==void 0,s=(0,P.useRef)(i);s.current=o?e().value:i;let c=(0,P.useRef)(s.current);Ds(()=>{c.current=s.current},[i,e().value]);let l=t=>{let r=c.current,i=er(t)?t(r):t;e().debug&&console.log(`[bindable > ${e().debug}] setValue`,{next:i,prev:r}),o||a(i),n(i,r)||e().onChange?.(i,r)};function u(){return o?e().value:i}return{initial:r,ref:s,get:u,set(t){(e().sync?tt.flushSync:ur)(()=>l(t))},invoke(t,n){e().onChange?.(t,n)},hash(t){return e().hash?.(t)??String(t)}}}Os.cleanup=e=>{(0,P.useEffect)(()=>e,[])},Os.ref=e=>{let t=(0,P.useRef)(e);return{get:()=>t.current,set:e=>{t.current=e}}};function ks(e){let t=(0,P.useRef)(void 0);return t.current===void 0&&(t.current=e()),t.current}function As(e){let t=(0,P.useRef)(e);return t.current=e,(0,P.useMemo)(()=>((...e)=>t.current(...e)),[])}function js(e){let t=(0,P.useRef)(e);return ks(()=>({get(e){return t.current[e]},set(e,n){t.current[e]=n}}))}var Ms=(e,t)=>{let n=(0,P.useRef)(!1),r=(0,P.useRef)(!1);(0,P.useEffect)(()=>{if(n.current&&r.current)return t();r.current=!0},[...(e??[]).map(e=>typeof e==`function`?e():e)]),(0,P.useEffect)(()=>(n.current=!0,()=>{n.current=!1}),[])};function Ns(e,t={}){let n=(0,P.useMemo)(()=>{let{id:e,ids:n,getRootNode:r}=t;return ds({id:e,ids:n,getRootNode:r})},[t]),r=(...t)=>{e.debug&&console.log(...t)},i=Fs(e.props?.({props:xr(t),scope:n})??t),a=e.context?.({prop:i,bindable:Os,scope:n,flush:Is,getContext(){return s},getComputed(){return g},getRefs(){return m},getEvent(){return f()}}),o=Ps(a),s=ks(()=>({get(e){return o.current?.[e].ref.current},set(e,t){o.current?.[e].set(t)},initial(e){return o.current?.[e].initial},hash(e){let t=o.current?.[e].get();return o.current?.[e].hash(t)}})),c=(0,P.useRef)(new Map),l=(0,P.useRef)(null),u=(0,P.useRef)(null),d=(0,P.useRef)({type:``}),f=()=>({...d.current,current(){return d.current},previous(){return u.current}}),p=()=>({...S,matches(...e){return e.some(e=>ci(S.ref.current,e))},hasTag(t){return li(e,S.ref.current,t)}}),m=js(e.refs?.({prop:i,context:s})??{}),h=As(t=>{queueMicrotask(()=>{if(w.current!==pi.Started)return;u.current=d.current,d.current=t;let n=E(),{transitions:i,source:a}=oi(e,n,t.type),o=x(i);if(!o)return;l.current=o;let s=ai(e,o.target??n,a);r(`transition`,t.type,o.target||n,`(${o.actions})`),s===n?o.reenter?S.invoke(n,n):v(o.actions??[]):(0,tt.flushSync)(()=>S.set(s))})}),g=As(t=>{kr(e.computed,()=>`[zag-js] No computed object found on machine`);let r=e.computed[t];return r({context:s,event:f(),prop:i,refs:m,scope:n,computed:g})}),_=()=>({state:p(),context:s,event:f(),prop:i,send:h,action:v,guard:y,track:Ms,refs:m,computed:g,flush:Is,scope:n,choose:x}),v=t=>{let n=er(t)?t(_()):t;if(!n)return;let r=n.map(t=>{let n=e.implementations?.actions?.[t];return n||Dr(`[zag-js] No implementation found for action "${JSON.stringify(t)}"`),n});for(let e of r)e?.(_())},y=t=>{if(er(t))return t(_());let n=e.implementations?.guards?.[t];return n||Dr(`[zag-js] No implementation found for guard "${JSON.stringify(t)}"`),n?.(_())},b=t=>{let n=er(t)?t(_()):t;if(!n)return;let r=n.map(t=>{let n=e.implementations?.effects?.[t];return n||Dr(`[zag-js] No implementation found for effect "${JSON.stringify(t)}"`),n}),i=[];for(let e of r){let t=e?.(_());t&&i.push(t)}return()=>i.forEach(e=>e?.())},x=e=>In(e).find(e=>{let t=!e.guard;return $n(e.guard)?t=!!y(e.guard):er(e.guard)&&(t=e.guard(_())),t}),S=Os(()=>({defaultValue:ai(e,e.initialState({prop:i})),onChange(t,n){let{exiting:r,entering:i}=si(e,n,t,l.current?.reenter);if(r.forEach(e=>{c.current.get(e.path)?.(),c.current.delete(e.path)}),r.forEach(e=>{v(e.state?.exit)}),v(l.current?.actions),i.forEach(e=>{let t=b(e.state?.effects);if(t){let n=c.current.get(e.path);c.current.set(e.path,n?fr(n,t):t)}}),n===`__init__`){v(e.entry);let t=b(e.effects);if(t){let e=c.current.get(mi);c.current.set(mi,e?fr(e,t):t)}}i.forEach(e=>{v(e.state?.entry)})}})),C=(0,P.useRef)(void 0),w=(0,P.useRef)(pi.NotStarted),T=As(()=>w.current);Ds(()=>{queueMicrotask(()=>{let e=w.current===pi.Started;w.current=pi.Started,r(e?`rehydrating...`:`initializing...`);let t=C.current??S.initial;S.invoke(t,e?S.get():mi)});let t=c.current;return()=>{let n=E();r(`unmounting...`),C.current=n,w.current=pi.Stopped,t.forEach(e=>e?.()),c.current=new Map,l.current=null,queueMicrotask(()=>{v(e.exit),w.current=pi.Stopped})}},[]);let E=()=>`ref`in S?S.ref.current:S.get();return e.watch?.(_()),{state:p(),send:h,context:s,prop:i,scope:n,refs:m,computed:g,event:f(),getStatus:T}}function Ps(e){let t=(0,P.useRef)(e);return t.current=e,t}function Fs(e){let t=Ps(e);return As(function(e){return t.current[e]})}function Is(e){queueMicrotask(()=>{(0,tt.flushSync)(()=>e())})}function Ls(e){return new Proxy({},{get(t,n){return n===`style`?t=>e({style:t}).style:e}})}var Rs=Ls(e=>e);function zs(e,t){let{state:n,send:r,context:i}=e,a=n.matches(`mounted`,`unmountSuspended`);return{skip:!i.get(`initial`),present:a,setNode(e){e&&r({type:`NODE.SET`,node:e})},unmount(){r({type:`UNMOUNT`})}}}var Bs=di({props({props:e}){return{...e,present:!!e.present}},initialState({prop:e}){return e(`present`)?`mounted`:`unmounted`},refs(){return{node:null,styles:null}},context({bindable:e}){return{unmountAnimationName:e(()=>({defaultValue:null})),prevAnimationName:e(()=>({defaultValue:null})),present:e(()=>({defaultValue:!1})),initial:e(()=>({sync:!0,defaultValue:!1}))}},exit:[`cleanupNode`],watch({track:e,prop:t,send:n}){e([()=>t(`present`)],()=>{n({type:`PRESENCE.CHANGED`})})},on:{"NODE.SET":{actions:[`setupNode`]},"PRESENCE.CHANGED":{actions:[`setInitial`,`syncPresence`]}},states:{mounted:{effects:[`trackEnterAnimation`],on:{UNMOUNT:{target:`unmounted`,actions:[`clearPrevAnimationName`,`invokeOnExitComplete`]},"UNMOUNT.SUSPEND":{target:`unmountSuspended`}}},unmountSuspended:{effects:[`trackExitAnimation`],on:{MOUNT:{target:`mounted`,actions:[`setPrevAnimationName`]},UNMOUNT:{target:`unmounted`,actions:[`clearPrevAnimationName`,`invokeOnExitComplete`]}}},unmounted:{on:{MOUNT:{target:`mounted`,actions:[`setPrevAnimationName`]}}}},implementations:{actions:{setInitial:({context:e})=>{e.get(`initial`)||queueMicrotask(()=>{e.set(`initial`,!0)})},invokeOnExitComplete:({prop:e,refs:t})=>{e(`onExitComplete`)?.();let n=t.get(`node`);if(!n)return;let r=new(Yi(n)).CustomEvent(`exitcomplete`,{bubbles:!1});n.dispatchEvent(r)},setupNode:({refs:e,event:t})=>{e.get(`node`)!==t.node&&(e.set(`node`,t.node),e.set(`styles`,ea(t.node)))},cleanupNode:({refs:e})=>{e.set(`node`,null),e.set(`styles`,null)},syncPresence:({context:e,refs:t,send:n,prop:r})=>{let i=r(`present`);if(i)return n({type:`MOUNT`,src:`presence.changed`});let a=t.get(`node`);if(!i&&a?.ownerDocument.visibilityState===`hidden`)return n({type:`UNMOUNT`,src:`visibilitychange`});So(()=>{if(r(`present`))return;let i=Vs(t.get(`styles`));e.set(`unmountAnimationName`,i),i===`none`||i===e.get(`prevAnimationName`)||t.get(`styles`)?.display===`none`||t.get(`styles`)?.animationDuration===`0s`?n({type:`UNMOUNT`,src:`presence.changed`}):n({type:`UNMOUNT.SUSPEND`})})},setPrevAnimationName:({context:e,refs:t})=>{So(()=>{e.set(`prevAnimationName`,Vs(t.get(`styles`)))})},clearPrevAnimationName:({context:e})=>{e.set(`prevAnimationName`,null)}},effects:{trackEnterAnimation:({context:e,refs:t,prop:n})=>{if(!n(`onEnterComplete`)||!e.get(`initial`))return;let r,i=()=>{r=So(()=>{let e=t.get(`node`);if(!e||!e.isConnected){i();return}let r=ea(e);if(Vs(r)===`none`||r.display===`none`||r.animationDuration===`0s`){n(`onEnterComplete`)?.();return}let a=t=>{z(t)===e&&n(`present`)&&(e.removeEventListener(`animationend`,a),n(`onEnterComplete`)?.())};return e.addEventListener(`animationend`,a),()=>{e.removeEventListener(`animationend`,a)}})};return i(),()=>r?.()},trackExitAnimation:({context:e,refs:t,send:n,prop:r})=>{let i=t.get(`node`);if(!i)return;let a=n=>{(n.composedPath?.()?.[0]??n.target)===i&&e.set(`prevAnimationName`,Vs(t.get(`styles`)))},o=a=>{let o=Vs(t.get(`styles`));z(a)===i&&o===e.get(`unmountAnimationName`)&&!r(`present`)&&n({type:`UNMOUNT`,src:`animationend`})},s=e=>{z(e)===i&&!r(`present`)&&n({type:`UNMOUNT`,src:`animationcancel`})};i.addEventListener(`animationstart`,a),i.addEventListener(`animationcancel`,s),i.addEventListener(`animationend`,o);let c=ts(i,{animationFillMode:`forwards`});return()=>{i.removeEventListener(`animationstart`,a),i.removeEventListener(`animationcancel`,s),i.removeEventListener(`animationend`,o),Co(()=>c())}}}}});function Vs(e){return e?.animationName||`none`}var Hs=(e={})=>{let{lazyMount:t,unmountOnExit:n,hideMode:r=`display-none`,present:i,skipAnimationOnMount:a=!1,...o}=e,s=(0,P.useRef)(!1),c=zs(Ns(Bs,{...o,present:i,onEnterComplete:Ts(e.onEnterComplete),onExitComplete:Ts(e.onExitComplete)}),Rs);c.present&&(s.current=!0);let l=!c.present&&!s.current&&t||n&&!c.present&&s.current,u=r===`activity`&&ws?`activity`:`display-none`;return{ref:c.setNode,getPresenceProps:()=>({"data-state":c.skip&&a?void 0:i?`open`:`closed`,hidden:u!==`activity`&&!c.present}),present:c.present,unmounted:l,hideMode:u}},Us=e=>{let{presence:t,children:n}=e;return t.unmounted?null:t.hideMode===`activity`&&Cs?(0,F.jsx)(Cs,{mode:t.present?`visible`:`hidden`,children:n}):n},[Ws,Gs]=Mr({name:`PresenceContext`,hookName:`usePresenceContext`,providerName:`<PresenceProvider />`}),Ks=yn(`span`);Ks.displayName=`Span`;var H=(e,t=[])=>({parts:(...n)=>{if(Js(t))return H(e,n);throw Error(`createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?`)},extendWith:(...n)=>H(e,[...t,...n]),omit:(...n)=>H(e,t.filter(e=>!n.includes(e))),rename:e=>H(e,t),keys:()=>t,build:()=>[...new Set(t)].reduce((t,n)=>Object.assign(t,{[n]:{selector:[`&[data-scope="${qs(e)}"][data-part="${qs(n)}"]`,`& [data-scope="${qs(e)}"][data-part="${qs(n)}"]`].join(`, `),attrs:{"data-scope":qs(e),"data-part":qs(n)}}}),{})}),qs=e=>e.replace(/([A-Z])([A-Z])/g,`$1-$2`).replace(/([a-z])([A-Z])/g,`$1-$2`).replace(/[\s_]+/g,`-`).toLowerCase(),Js=e=>e.length===0,Ys=H(`tabs`).parts(`root`,`list`,`trigger`,`content`,`indicator`).build(),Xs=e=>e.ids?.root??`tabs:${e.id}`,Zs=e=>e.ids?.list??`tabs:${e.id}:list`,Qs=(e,t)=>e.ids?.content?.(t)??`tabs:${e.id}:content-${t}`,$s=(e,t)=>e.ids?.trigger?.(t)??`tabs:${e.id}:trigger-${t}`,ec=e=>e.ids?.indicator??`tabs:${e.id}:indicator`,tc=e=>e.getById(Zs(e)),nc=(e,t)=>e.getById(Qs(e,t)),rc=(e,t)=>t==null?null:e.getById($s(e,t)),ic=e=>e.getById(ec(e)),ac=e=>{let t=`[role=tab]${Ei(Zs(e))}:not([disabled])`;return Ho(tc(e),t)},oc=e=>Ln(ac(e)),sc=e=>Rn(ac(e)),cc=(e,t)=>Go(ac(e),$s(e,t.value),t.loopFocus),lc=(e,t)=>Ko(ac(e),$s(e,t.value),t.loopFocus),uc=e=>({x:e?.offsetLeft??0,y:e?.offsetTop??0,width:e?.offsetWidth??0,height:e?.offsetHeight??0}),dc=(e,t)=>uc(B(ac(e),$s(e,t)));function fc(e,t){let{state:n,send:r,context:i,prop:a,scope:o}=e,s=a(`translations`),c=n.matches(`focused`),l=a(`orientation`)===`vertical`,u=a(`orientation`)===`horizontal`,d=a(`composite`);function f(e){return{selected:i.get(`value`)===e.value,focused:i.get(`focusedValue`)===e.value,disabled:!!e.disabled}}return{value:i.get(`value`),focusedValue:i.get(`focusedValue`),setValue(e){r({type:`SET_VALUE`,value:e})},clearValue(){r({type:`CLEAR_VALUE`})},setIndicatorRect(e){let t=$s(o,e);r({type:`SET_INDICATOR_RECT`,id:t})},syncTabIndex(){r({type:`SYNC_TAB_INDEX`})},selectNext(e){r({type:`TAB_FOCUS`,value:e,src:`selectNext`}),r({type:`ARROW_NEXT`,src:`selectNext`})},selectPrev(e){r({type:`TAB_FOCUS`,value:e,src:`selectPrev`}),r({type:`ARROW_PREV`,src:`selectPrev`})},focus(){let e=i.get(`value`);e&&rc(o,e)?.focus()},getRootProps(){return t.element({...Ys.root.attrs,id:Xs(o),"data-orientation":a(`orientation`),"data-focus":R(c),dir:a(`dir`)})},getListProps(){return t.element({...Ys.list.attrs,id:Zs(o),role:`tablist`,dir:a(`dir`),"data-focus":R(c),"aria-orientation":a(`orientation`),"data-orientation":a(`orientation`),"aria-label":s?.listLabel,onKeyDown(e){if(e.defaultPrevented||Pa(e)||!Ki(e.currentTarget,z(e)))return;let t={ArrowDown(){u||r({type:`ARROW_NEXT`,key:`ArrowDown`})},ArrowUp(){u||r({type:`ARROW_PREV`,key:`ArrowUp`})},ArrowLeft(){l||r({type:`ARROW_PREV`,key:`ArrowLeft`})},ArrowRight(){l||r({type:`ARROW_NEXT`,key:`ArrowRight`})},Home(){r({type:`HOME`})},End(){r({type:`END`})}}[Ha(e,{dir:a(`dir`),orientation:a(`orientation`)})];if(t){e.preventDefault(),t(e);return}}})},getTriggerState:f,getTriggerProps(e){let{value:n,disabled:s}=e,c=f(e);return t.button({...Ys.trigger.attrs,role:`tab`,type:`button`,disabled:s,dir:a(`dir`),"data-orientation":a(`orientation`),"data-disabled":R(s),"aria-disabled":s,"data-value":n,"aria-selected":c.selected,"data-selected":R(c.selected),"data-focus":R(c.focused),"aria-controls":c.selected?Qs(o,n):void 0,"data-ownedby":Zs(o),"data-ssr":R(i.get(`ssr`)),id:$s(o,n),tabIndex:c.selected&&d?0:-1,onFocus(){r({type:`TAB_FOCUS`,value:n})},onBlur(e){e.relatedTarget?.getAttribute(`role`)!==`tab`&&r({type:`TAB_BLUR`})},onClick(e){e.defaultPrevented||Na(e)||s||(ka()&&e.currentTarget.focus(),r({type:`TAB_CLICK`,value:n}))}})},getContentProps(e){let{value:n}=e,r=i.get(`value`)===n;return t.element({...Ys.content.attrs,dir:a(`dir`),id:Qs(o,n),tabIndex:d?0:-1,"aria-labelledby":$s(o,n),role:`tabpanel`,"data-ownedby":Zs(o),"data-selected":R(r),"data-orientation":a(`orientation`),hidden:!r})},getIndicatorProps(){let e=i.get(`indicatorRect`),n=i.get(`animateIndicator`);return t.element({id:ec(o),...Ys.indicator.attrs,dir:a(`dir`),"data-orientation":a(`orientation`),hidden:pc(e),onTransitionEnd(e){z(e)===e.currentTarget&&r({type:`INDICATOR_TRANSITION_END`})},style:{"--transition-property":`left, right, top, bottom, width, height`,"--left":br(e?.x),"--top":br(e?.y),"--width":br(e?.width),"--height":br(e?.height),position:`absolute`,willChange:n?`var(--transition-property)`:`auto`,transitionProperty:n?`var(--transition-property)`:`none`,transitionDuration:n?`var(--transition-duration, 150ms)`:`0ms`,transitionTimingFunction:`var(--transition-timing-function)`,[u?`left`:`top`]:u?`var(--left)`:`var(--top)`}})}}}var pc=e=>e==null||e.width===0&&e.height===0&&e.x===0&&e.y===0,{createMachine:mc}=fi(),hc=mc({props({props:e}){return{dir:`ltr`,orientation:`horizontal`,activationMode:`automatic`,loopFocus:!0,composite:!0,navigate(e){ko(e.node)},defaultValue:null,...e}},initialState(){return`idle`},context({prop:e,bindable:t}){return{value:t(()=>({defaultValue:e(`defaultValue`),value:e(`value`),onChange(t){e(`onValueChange`)?.({value:t})}})),focusedValue:t(()=>({defaultValue:e(`value`)||e(`defaultValue`),sync:!0,onChange(t){e(`onFocusChange`)?.({focusedValue:t})}})),ssr:t(()=>({defaultValue:!0})),indicatorRect:t(()=>({defaultValue:null})),animateIndicator:t(()=>({defaultValue:!1}))}},refs(){return{indicatorCleanup:null,prevValue:null}},watch({context:e,prop:t,track:n,action:r}){n([()=>e.get(`value`)],()=>{r([`syncIndicatorAnimation`,`syncIndicatorRect`,`syncTabIndex`,`navigateIfNeeded`])}),n([()=>t(`dir`),()=>t(`orientation`)],()=>{r([`syncIndicatorRect`])})},on:{SET_VALUE:{actions:[`setValue`]},CLEAR_VALUE:{actions:[`clearValue`]},SET_INDICATOR_RECT:{actions:[`setIndicatorRect`]},SYNC_TAB_INDEX:{actions:[`syncTabIndex`]},INDICATOR_TRANSITION_END:{actions:[`clearIndicatorAnimation`]}},entry:[`syncPrevValue`,`syncIndicatorRect`,`syncTabIndex`,`syncSsr`],exit:[`cleanupObserver`],states:{idle:{on:{TAB_FOCUS:{target:`focused`,actions:[`setFocusedValue`]},TAB_CLICK:{target:`focused`,actions:[`setFocusedValue`,`setValue`]}}},focused:{on:{TAB_CLICK:{actions:[`setFocusedValue`,`setValue`]},ARROW_PREV:[{guard:`selectOnFocus`,actions:[`focusPrevTab`,`selectFocusedTab`]},{actions:[`focusPrevTab`]}],ARROW_NEXT:[{guard:`selectOnFocus`,actions:[`focusNextTab`,`selectFocusedTab`]},{actions:[`focusNextTab`]}],HOME:[{guard:`selectOnFocus`,actions:[`focusFirstTab`,`selectFocusedTab`]},{actions:[`focusFirstTab`]}],END:[{guard:`selectOnFocus`,actions:[`focusLastTab`,`selectFocusedTab`]},{actions:[`focusLastTab`]}],TAB_FOCUS:{actions:[`setFocusedValue`]},TAB_BLUR:{target:`idle`,actions:[`clearFocusedValue`]}}}},implementations:{guards:{selectOnFocus:({prop:e})=>e(`activationMode`)===`automatic`},actions:{selectFocusedTab({context:e,prop:t}){So(()=>{let n=e.get(`focusedValue`);if(!n)return;let r=t(`deselectable`)&&e.get(`value`)===n?null:n;e.set(`value`,r)})},setFocusedValue({context:e,event:t,flush:n}){t.value!=null&&n(()=>{e.set(`focusedValue`,t.value)})},clearFocusedValue({context:e}){e.set(`focusedValue`,null)},setValue({context:e,event:t,prop:n}){let r=n(`deselectable`)&&e.get(`value`)===e.get(`focusedValue`);e.set(`value`,r?null:t.value)},clearValue({context:e}){e.set(`value`,null)},focusFirstTab({scope:e}){So(()=>{oc(e)?.focus()})},focusLastTab({scope:e}){So(()=>{sc(e)?.focus()})},focusNextTab({context:e,prop:t,scope:n,event:r}){let i=r.value??e.get(`focusedValue`);if(!i)return;let a=cc(n,{value:i,loopFocus:t(`loopFocus`)});So(()=>{t(`composite`)?a?.focus():a?.dataset.value!=null&&e.set(`focusedValue`,a.dataset.value)})},focusPrevTab({context:e,prop:t,scope:n,event:r}){let i=r.value??e.get(`focusedValue`);if(!i)return;let a=lc(n,{value:i,loopFocus:t(`loopFocus`)});So(()=>{t(`composite`)?a?.focus():a?.dataset.value!=null&&e.set(`focusedValue`,a.dataset.value)})},syncTabIndex({context:e,scope:t}){So(()=>{let n=e.get(`value`);if(!n)return;let r=nc(t,n);r&&(po(r).length>0?r.removeAttribute(`tabindex`):r.setAttribute(`tabindex`,`0`))})},cleanupObserver({refs:e}){let t=e.get(`indicatorCleanup`);t&&t()},setIndicatorRect({context:e,event:t,scope:n}){let r=t.id??e.get(`value`);ic(n)&&r&&rc(n,r)&&e.set(`indicatorRect`,dc(n,r))},syncSsr({context:e}){e.set(`ssr`,!1)},syncPrevValue({context:e,refs:t}){t.set(`prevValue`,e.get(`value`))},syncIndicatorAnimation({context:e,refs:t}){let n=t.get(`prevValue`),r=e.get(`value`),i=n!=null&&r!=null&&n!==r;e.set(`animateIndicator`,i),t.set(`prevValue`,r)},clearIndicatorAnimation({context:e}){e.set(`animateIndicator`,!1)},syncIndicatorRect({context:e,refs:t,scope:n}){let r=t.get(`indicatorCleanup`);if(r&&r(),!ic(n))return;let i=()=>{let t=rc(n,e.get(`value`));if(!t)return;let r=uc(t);e.set(`indicatorRect`,e=>Yn(e,r)?e:r)};i();let a=ac(n),o=tc(n),s=fr(...a.map(e=>Jo.observe(e,i)),...o?[Jo.observe(o,i)]:[]);t.set(`indicatorCleanup`,s)},navigateIfNeeded({context:e,prop:t,scope:n}){let r=e.get(`value`);if(!r)return;let i=rc(n,r);zi(i)&&t(`navigate`)?.({value:r,node:i,href:i.href})}}}}),[gc,_c]=Mr({name:`TabsContext`,hookName:`useTabsContext`,providerName:`<TabsProvider />`}),[vc,yc]=Mr({name:`RenderStrategyContext`,hookName:`useRenderStrategyContext`,providerName:`<RenderStrategyPropsProvider />`}),bc=e=>xs()(e,[`lazyMount`,`unmountOnExit`,`hideMode`]),xc=xs(),Sc=(0,P.forwardRef)((e,t)=>{let[n,r]=xc(e,[`value`]),i=_c(),a=Hs({...yc(),present:i.value===e.value,immediate:!0}),o=L(i.getContentProps(n),a.getPresenceProps(),r),s=Ir(a.ref,t);return(0,F.jsx)(Ws,{value:a,children:(0,F.jsx)(Us,{presence:a,children:(0,F.jsx)(V.div,{...o,ref:s})})})});Sc.displayName=`TabContent`;var Cc=(0,P.forwardRef)((e,t)=>{let n=L(_c().getIndicatorProps(),e);return(0,F.jsx)(V.div,{...n,ref:t})});Cc.displayName=`TabIndicator`;var wc=(0,P.forwardRef)((e,t)=>{let n=L(_c().getListProps(),e);return(0,F.jsx)(V.div,{...n,ref:t})});wc.displayName=`TabList`;var Tc=xs(),Ec=(0,P.forwardRef)((e,t)=>{let[n,r]=Tc(e,[`disabled`,`value`]),i=L(_c().getTriggerProps(n),r);return(0,F.jsx)(V.button,{...i,ref:t})});Ec.displayName=`TabTrigger`;var Dc=e=>e.children(_c()),Oc=e=>{let t=(0,P.useId)(),{getRootNode:n}=Pr(),{dir:r}=vs();return fc(Ns(hc,{id:t,dir:r,getRootNode:n,...e}),Rs)},kc=xs(),Ac=(0,P.forwardRef)((e,t)=>{let[n,r]=bc(e),[i,a]=kc(r,[`activationMode`,`composite`,`defaultValue`,`deselectable`,`id`,`ids`,`loopFocus`,`navigate`,`onFocusChange`,`onValueChange`,`orientation`,`translations`,`value`]),o=Oc(i),s=L(o.getRootProps(),a);return(0,F.jsx)(gc,{value:o,children:(0,F.jsx)(vc,{value:n,children:(0,F.jsx)(V.div,{...s,ref:t})})})});Ac.displayName=`TabsRoot`;var jc=xs(),Mc=(0,P.forwardRef)((e,t)=>{let[n,r]=bc(e),[{value:i},a]=jc(r,[`value`]),o=L(i.getRootProps(),a);return(0,F.jsx)(gc,{value:i,children:(0,F.jsx)(vc,{value:n,children:(0,F.jsx)(V.div,{...o,ref:t})})})});Mc.displayName=`TabsRootProvider`;var Nc=bs({Content:()=>Sc,Context:()=>Dc,Indicator:()=>Cc,List:()=>wc,Root:()=>Ac,RootProvider:()=>Mc,Trigger:()=>Ec});function Pc(e){let{key:t,recipe:n}=e,r=tn();return(0,P.useMemo)(()=>n?r.sva(n):t==null?r.sva({slots:[]}):r.getSlotRecipeFn(t),[t,n,r])}var Fc=e=>{let{key:t,recipe:n}=e,r=Sn(t||n.className||`Component`),[i,a]=$t({name:`${r}StylesContext`,errorMessage:`use${r}Styles returned is 'undefined'. Seems you forgot to wrap the components in "<${r}.Root />" `}),[o,s]=$t({name:`${r}ClassNameContext`,errorMessage:`use${r}ClassNames returned is 'undefined'. Seems you forgot to wrap the components in "<${r}.Root />" `,strict:!1}),[c,l]=$t({strict:!1,name:`${r}PropsContext`,providerName:`${r}PropsContext`,defaultValue:{}});function u(e){let{unstyled:r,...i}=e,a=Pc({key:t,recipe:i.recipe||n}),[o,s]=(0,P.useMemo)(()=>a.splitVariantProps(i),[i,a]);return{styles:(0,P.useMemo)(()=>r?En:a(o),[r,o,a]),classNames:a.classNameMap,props:s}}function d(e,t={}){let{defaultProps:n,displayName:a}=t,s=xn(e),c=wn(r,s),d=t=>{let r=l(),{styles:a,classNames:s,props:c}=u((0,P.useMemo)(()=>Bt(n,r,t),[r,t]));return(0,F.jsx)(i,{value:a,children:(0,F.jsx)(o,{value:s,children:(0,F.jsx)(e,{...c})})})};return d.displayName=a??c??s,d}return{StylesProvider:i,ClassNamesProvider:o,PropsProvider:c,usePropsContext:l,useRecipeResult:u,withProvider:(e,t,n)=>{let{defaultProps:a,displayName:s,wrapElement:c,...d}=n??{},f=Cn(r,String(t)),p=yn(e,{},d),m=(0,P.forwardRef)((e,n)=>{let r=l(),s=(0,P.useMemo)(()=>Bt(a??{},r,e),[r,e]),{styles:d,props:f,classNames:m}=u(s),h=m[t],g=(0,F.jsx)(i,{value:d,children:(0,F.jsx)(o,{value:m,children:(0,F.jsx)(p,{ref:n,...f,css:[d[t],s.css],className:Jt(s.className,h)})})});return c?.(g,s)??g});return m.displayName=s??f??xn(e),m},withContext:(e,t,n)=>{let{displayName:i,...o}=n??{},c=t!=null&&t!==``?Cn(r,String(t)):r,l=yn(e,{},o),u=(0,P.forwardRef)((e,n)=>{let{unstyled:r,...i}=e,o=a(),c=s()?.[t];return(0,F.jsx)(l,{...i,css:[!r&&t?o[t]:void 0,e.css],ref:n,className:Jt(e.className,c)})});return u.displayName=i??c??xn(e),u},withRootProvider:d,useStyles:a,useClassNames:s}},{withProvider:Ic,withContext:Lc,useStyles:Rc,PropsProvider:zc}=Fc({key:`tabs`});Ic(Nc.RootProvider,`root`,{forwardAsChild:!0});var Bc=Ic(Nc.Root,`root`,{forwardAsChild:!0}),Vc=Lc(Nc.Trigger,`trigger`,{forwardAsChild:!0}),Hc=Lc(Nc.Content,`content`,{forwardAsChild:!0});Lc(`div`,`contentGroup`);var Uc=Lc(Nc.List,`list`,{forwardAsChild:!0});Lc(Nc.Indicator,`indicator`,{forwardAsChild:!0});var{withContext:Wc,PropsProvider:Gc}=On({key:`text`}),U=Wc(`p`),Kc=H(`accordion`).parts(`root`,`item`,`itemTrigger`,`itemContent`,`itemIndicator`);Kc.build();var qc=H(`avatar`).parts(`root`,`image`,`fallback`);qc.build();var Jc=new WeakMap,Yc=new WeakMap,Xc={},Zc=0,Qc=e=>e&&(e.host||Qc(e.parentNode)),$c=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Qc(t);return n&&e.contains(n)?n:(console.error(`[zag-js > ariaHidden] target`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(e=>!!e),el=new Set([`script`,`output`,`status`,`next-route-announcer`]),tl=e=>el.has(e.localName)||e.role===`status`||e.hasAttribute(`aria-live`)?!0:e.matches(`[data-live-announcer]`),nl=(e,t)=>{let{parentNode:n,markerName:r,controlAttribute:i,explicitBooleanValue:a,followControlledElements:o=!0}=t,s=$c(n,Array.isArray(e)?e:[e]);Xc[r]||(Xc[r]=new WeakMap);let c=Xc[r],l=[],u=new Set,d=new Set(s),f=e=>{e&&!u.has(e)&&(u.add(e),f(e.parentNode))};s.forEach(e=>{f(e),o&&ji(e)&&aa(e,e=>{f(e)})});let p=e=>{e&&!d.has(e)&&Array.prototype.forEach.call(e.children,e=>{if(u.has(e))p(e);else try{if(tl(e))return;let t=e.getAttribute(i),n=a?t===`true`:t!==null&&t!==`false`,o=(Jc.get(e)||0)+1,s=(c.get(e)||0)+1;Jc.set(e,o),c.set(e,s),l.push(e),o===1&&n&&Yc.set(e,!0),s===1&&e.setAttribute(r,``),n||e.setAttribute(i,a?`true`:``)}catch(t){console.error(`[zag-js > ariaHidden] cannot operate on `,e,t)}})};return p(n),u.clear(),Zc++,()=>{l.forEach(e=>{let t=Jc.get(e)-1,n=c.get(e)-1;Jc.set(e,t),c.set(e,n),t||(Yc.has(e)||e.removeAttribute(i),Yc.delete(e)),n||e.removeAttribute(r)}),Zc--,Zc||(Jc=new WeakMap,Jc=new WeakMap,Yc=new WeakMap,Xc={})}},rl=e=>(Array.isArray(e)?e[0]:e).ownerDocument.body,il=(e,t=rl(e),n=`data-aria-hidden`,r=!0)=>{if(t)return nl(e,{parentNode:t,markerName:n,controlAttribute:`aria-hidden`,explicitBooleanValue:!0,followControlledElements:r})},al=e=>{let t=requestAnimationFrame(()=>e());return()=>cancelAnimationFrame(t)};function ol(e,t={}){let{defer:n=!0}=t,r=n?al:e=>e(),i=[];return i.push(r(()=>{let t=(typeof e==`function`?e():e).filter(Boolean);t.length!==0&&i.push(il(t))})),()=>{i.forEach(e=>e?.())}}function sl(e){let t={each(t){for(let n=0;n<e.frames?.length;n+=1){let r=e.frames[n];r&&t(r)}},addEventListener(e,n,r){return t.each(t=>{try{t.document.addEventListener(e,n,r)}catch{}}),()=>{try{t.removeEventListener(e,n,r)}catch{}}},removeEventListener(e,n,r){t.each(t=>{try{t.document.removeEventListener(e,n,r)}catch{}})}};return t}function cl(e){let t=e.frameElement==null?null:e.parent;return{addEventListener:(e,n,r)=>{try{t?.addEventListener(e,n,r)}catch{}return()=>{try{t?.removeEventListener(e,n,r)}catch{}}},removeEventListener:(e,n,r)=>{try{t?.removeEventListener(e,n,r)}catch{}}}}var ll=`pointerdown.outside`,ul=`focus.outside`;function dl(e){for(let t of e)if(ji(t)&&mo(t))return!0;return!1}var fl=e=>`clientY`in e;function pl(e,t){if(!fl(t)||!e)return!1;let n=e.getBoundingClientRect();return n.width===0||n.height===0?!1:n.top<=t.clientY&&t.clientY<=n.top+n.height&&n.left<=t.clientX&&t.clientX<=n.left+n.width}function ml(e,t){return e.y<=t.y&&t.y<=e.y+e.height&&e.x<=t.x&&t.x<=e.x+e.width}function hl(e,t){if(!t||!fl(e))return!1;let n=t.scrollHeight>t.clientHeight,r=n&&e.clientX>t.offsetLeft+t.clientWidth,i=t.scrollWidth>t.clientWidth,a=i&&e.clientY>t.offsetTop+t.clientHeight;return ml({x:t.offsetLeft,y:t.offsetTop,width:t.clientWidth+(n?16:0),height:t.clientHeight+(i?16:0)},{x:e.clientX,y:e.clientY})?r||a:!1}function gl(e,t){let{exclude:n,onFocusOutside:r,onPointerDownOutside:i,onInteractOutside:a,defer:o,followControlledElements:s=!0}=t;if(!e)return;let c=qi(e),l=Yi(e),u=sl(l),d=cl(l);function f(t,r){if(!ji(r)||!r.isConnected||Ki(e,r)||pl(e,t)||s&&ia(e,r))return!1;let i=c.querySelector(`[aria-controls="${e.id}"]`);return i&&hl(t,Ao(i))||hl(t,Ao(e))?!1:!n?.(r)}let p=new Set,m=Li(e?.getRootNode()),h=!1;function g(t){h=!0;let n=()=>{h=!1};c.addEventListener(`pointerup`,n,{once:!0}),l.addEventListener(`pointerup`,n,{once:!0});function r(n){let r=o&&!Ca()?So:e=>e(),s=n??t,c=s?.composedPath?.()??[s?.target];r(()=>{let n=m?c[0]:z(t);if(e&&f(t,n)){if(i||a){let t=fr(i,a);e.addEventListener(ll,t,{once:!0})}vl(e,ll,{bubbles:!1,cancelable:!0,detail:{originalEvent:s,contextmenu:Ra(s),focusable:dl(c),target:n}})}})}t.pointerType===`touch`?(p.forEach(e=>e()),p.add(Ga(c,`click`,r,{once:!0})),p.add(d.addEventListener(`click`,r,{once:!0})),p.add(u.addEventListener(`click`,r,{once:!0}))):r()}let _=new Set,v=setTimeout(()=>{_.add(Ga(c,`pointerdown`,g,!0)),_.add(d.addEventListener(`pointerdown`,g,!0)),_.add(u.addEventListener(`pointerdown`,g,!0))},0);function y(t){h||(o?So:e=>e())(()=>{let n=t?.composedPath?.()??[t?.target],i=m?n[0]:z(t);if(e&&f(t,i)){if(r||a){let t=fr(r,a);e.addEventListener(ul,t,{once:!0})}vl(e,ul,{bubbles:!1,cancelable:!0,detail:{originalEvent:t,contextmenu:!1,focusable:mo(i),target:i}})}})}return Ca()||(_.add(Ga(c,`focusin`,y,!0)),_.add(d.addEventListener(`focusin`,y,!0)),_.add(u.addEventListener(`focusin`,y,!0))),()=>{clearTimeout(v),p.forEach(e=>e()),_.forEach(e=>e())}}function _l(e,t){let{defer:n}=t,r=n?So:e=>e(),i=[];return i.push(r(()=>{let n=typeof e==`function`?e():e;i.push(gl(n,t))})),()=>{i.forEach(e=>e?.())}}function vl(e,t,n){let r=new(e.ownerDocument.defaultView||window).CustomEvent(t,n);return e.dispatchEvent(r)}function yl(e,t){return Ga(qi(e),`keydown`,e=>{e.key===`Escape`&&(e.isComposing||t?.(e))},{capture:!0})}var bl=`layer:request-dismiss`,xl={layers:[],branches:[],recentlyRemoved:new Set,count(){return this.layers.length},pointerBlockingLayers(){return this.layers.filter(e=>e.pointerBlocking)},topMostPointerBlockingLayer(){return[...this.pointerBlockingLayers()].slice(-1)[0]},hasPointerBlockingLayer(){return this.pointerBlockingLayers().length>0},isBelowPointerBlockingLayer(e){return this.indexOf(e)<(this.topMostPointerBlockingLayer()?this.indexOf(this.topMostPointerBlockingLayer()?.node):-1)},isTopMost(e){return this.layers[this.count()-1]?.node===e},getNestedLayers(e){return Array.from(this.layers).slice(this.indexOf(e)+1)},getLayersByType(e){return this.layers.filter(t=>t.type===e)},getNestedLayersByType(e,t){let n=this.indexOf(e);return n===-1?[]:this.layers.slice(n+1).filter(e=>e.type===t)},getParentLayerOfType(e,t){let n=this.indexOf(e);if(!(n<=0))return this.layers.slice(0,n).reverse().find(e=>e.type===t)},countNestedLayersOfType(e,t){return this.getNestedLayersByType(e,t).length},isInNestedLayer(e,t){return!!(this.getNestedLayers(e).some(e=>Ki(e.node,t))||this.recentlyRemoved.size>0)},isInBranch(e){return Array.from(this.branches).some(t=>Ki(t,e))},add(e){let t=this.indexOf(e.node);t!==-1&&this.layers.splice(t,1),this.layers.push(e),this.syncLayers()},addBranch(e){this.branches.push(e)},remove(e){let t=this.indexOf(e);t<0||(this.layers[t].styleTargets?.forEach(e=>{let t=e();t&&Cl(t)}),this.recentlyRemoved.add(e),Co(()=>this.recentlyRemoved.delete(e)),t<this.count()-1&&this.getNestedLayers(e).forEach(t=>xl.dismiss(t.node,e)),this.layers.splice(t,1),this.syncLayers())},removeBranch(e){let t=this.branches.indexOf(e);t>=0&&this.branches.splice(t,1)},syncLayers(){this.layers.forEach((e,t)=>{Sl(e,t,e.node),e.styleTargets?.forEach(n=>{let r=n();if(!r||r===e.node)return;Sl(e,t,r);let{zIndex:i}=ea(e.node);r.style.setProperty(`--z-index`,i)})})},indexOf(e){return this.layers.findIndex(t=>t.node===e)},dismiss(e,t){let n=this.indexOf(e);if(n===-1)return;let r=this.layers[n];Tl(e,bl,e=>{r.requestDismiss?.(e),e.defaultPrevented||r?.dismiss()}),wl(e,bl,{originalLayer:e,targetLayer:t,originalIndex:n,targetIndex:t?this.indexOf(t):-1}),this.syncLayers()},clear(){this.remove(this.layers[0].node)}};function Sl(e,t,n){n.style.setProperty(`--layer-index`,`${t}`),n.removeAttribute(`data-nested`),n.removeAttribute(`data-has-nested`),xl.getParentLayerOfType(e.node,e.type)&&n.setAttribute(`data-nested`,e.type);let r=xl.countNestedLayersOfType(e.node,e.type);r>0&&n.setAttribute(`data-has-nested`,e.type),n.style.setProperty(`--nested-layer-count`,`${r}`)}function Cl(e){e.style.removeProperty(`--layer-index`),e.style.removeProperty(`--nested-layer-count`),e.style.removeProperty(`--z-index`),e.removeAttribute(`data-nested`),e.removeAttribute(`data-has-nested`)}function wl(e,t,n){let r=new(e.ownerDocument.defaultView||window).CustomEvent(t,{cancelable:!0,bubbles:!0,detail:n});return e.dispatchEvent(r)}function Tl(e,t,n){e.addEventListener(t,n,{once:!0})}var El=new WeakMap,Dl=new WeakMap;function Ol(e){return xl.isBelowPointerBlockingLayer(e)?`none`:`auto`}function kl(e){let t=Ol(e);e.style.pointerEvents!==t&&(e.style.pointerEvents=t)}function Al(e){if(Dl.has(e))return;let t=Yi(e);if(t.MutationObserver===void 0)return;let n=new t.MutationObserver(()=>{Dl.has(e)&&kl(e)});n.observe(e,{attributes:!0,attributeFilter:[`style`]}),Dl.set(e,n)}function jl(){xl.layers.forEach(({node:e})=>{kl(e),Al(e)})}function Ml(e){let t=Dl.get(e);t&&(t.disconnect(),Dl.delete(e)),e.style.pointerEvents=``}function Nl(e,t){let n=qi(e),r=[];return xl.hasPointerBlockingLayer()&&!n.body.hasAttribute(`data-inert`)&&(El.set(n.body,n.body.style.pointerEvents),queueMicrotask(()=>{let e=n.body;e&&(e.style.pointerEvents=`none`,e.setAttribute(`data-inert`,``))})),t?.forEach(e=>{let[t,n]=ls(()=>{let t=e();return ji(t)?t:null},{timeout:1e3});t.then(e=>r.push(ts(e,{pointerEvents:`auto`}))),r.push(n)}),()=>{xl.hasPointerBlockingLayer()||(queueMicrotask(()=>{let e=n.body;if(!e)return;let t=El.get(e);t!==void 0&&(e.style.pointerEvents=t,El.delete(e)),e.removeAttribute(`data-inert`),e.style.length===0&&e.removeAttribute(`style`)}),r.forEach(e=>e()))}}function Pl(e,t){let{onDismiss:n,onRequestDismiss:r,pointerBlocking:i,exclude:a,debug:o,type:s=`dialog`,layerStyleTargets:c}=t,l={dismiss:n,node:e,type:s,pointerBlocking:i,requestDismiss:r,styleTargets:c};xl.add(l),jl();function u(r){let i=z(r.detail.originalEvent);xl.isBelowPointerBlockingLayer(e)||xl.isInBranch(i)||(t.onPointerDownOutside?.(r),t.onInteractOutside?.(r),!r.defaultPrevented&&(o&&console.log(`onPointerDownOutside:`,r.detail.originalEvent),n?.()))}function d(e){let r=z(e.detail.originalEvent);xl.isInBranch(r)||(t.onFocusOutside?.(e),t.onInteractOutside?.(e),!e.defaultPrevented&&(o&&console.log(`onFocusOutside:`,e.detail.originalEvent),n?.()))}function f(r){xl.isTopMost(e)&&(t.onEscapeKeyDown?.(r),!r.defaultPrevented&&n&&(r.preventDefault(),n()))}function p(n){let r=typeof a==`function`?a():a,i=Array.isArray(r)?r:[r],o=t.persistentElements?.map(e=>e()).filter(ji);return o&&i.push(...o),i.some(e=>Ki(e,n))||xl.isInNestedLayer(e,n)}let m=[i?Nl(e,t.persistentElements):void 0,yl(e,f),_l(e,{exclude:p,onFocusOutside:d,onPointerDownOutside:u,defer:t.defer})];return()=>{xl.remove(e),jl(),Ml(e),m.forEach(e=>e?.())}}function Fl(e,t){let{warnOnMissingNode:n=!0}=t;return us(e,e=>Pl(e,t),{defer:t.defer,onMissing:n?()=>Dr("[@zag-js/dismissable] node is `null` or `undefined`"):void 0})}var Il=Object.defineProperty,Ll=(e,t,n)=>t in e?Il(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Rl=(e,t,n)=>Ll(e,typeof t==`symbol`?t:t+``,n),zl={activateTrap(e,t){if(e.length>0){let n=e[e.length-1];n!==t&&n.pause()}let n=e.indexOf(t);n===-1||e.splice(n,1),e.push(t)},deactivateTrap(e,t){let n=e.indexOf(t);n!==-1&&e.splice(n,1),e.length>0&&e[e.length-1].unpause()}},Bl=[],Vl=class{constructor(e,t){Rl(this,`trapStack`),Rl(this,`config`),Rl(this,`doc`),Rl(this,`state`,{containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0}),Rl(this,`lastInteractionType`,`keyboard`),Rl(this,`portalContainers`,new Set),Rl(this,`listenerCleanups`,[]),Rl(this,`handleFocus`,e=>{let t=z(e),n=this.findContainerIndex(t,e)>=0;if(n||Mi(t))n&&(this.state.mostRecentlyFocusedNode=t);else{e.stopImmediatePropagation();let t,n=!0;if(this.state.mostRecentlyFocusedNode){if(vo(this.state.mostRecentlyFocusedNode)>0){let e=this.findContainerIndex(this.state.mostRecentlyFocusedNode),{tabbableNodes:r}=this.state.containerGroups[e];if(r.length>0){let e=r.findIndex(e=>e===this.state.mostRecentlyFocusedNode);e>=0&&(this.config.isKeyForward(this.state.recentNavEvent)?e+1<r.length&&(t=r[e+1],n=!1):e-1>=0&&(t=r[e-1],n=!1))}}else this.state.containerGroups.some(e=>e.tabbableNodes.some(e=>vo(e)>0))||(n=!1)}else n=!1;n&&(t=this.findNextNavNode({target:this.state.mostRecentlyFocusedNode,isBackward:this.config.isKeyBackward(this.state.recentNavEvent)})),t?this.tryFocus(t):this.tryFocus(this.state.mostRecentlyFocusedNode||this.getInitialFocusNode())}this.state.recentNavEvent=void 0}),Rl(this,`handlePointerDown`,e=>{this.lastInteractionType=`pointer`;let t=z(e);if(!(this.findContainerIndex(t,e)>=0)){if(Kl(this.config.clickOutsideDeactivates,e)){this.deactivate({returnFocus:this.config.returnFocusOnDeactivate});return}Kl(this.config.allowOutsideClick,e)||e.preventDefault()}}),Rl(this,`handleClick`,e=>{let t=z(e);this.findContainerIndex(t,e)>=0||Kl(this.config.clickOutsideDeactivates,e)||Kl(this.config.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())}),Rl(this,`handleTabKey`,e=>{if(this.lastInteractionType=`keyboard`,this.config.isKeyForward(e)||this.config.isKeyBackward(e)){this.state.recentNavEvent=e;let t=this.config.isKeyBackward(e),n=this.findNextNavNode({event:e,isBackward:t});if(!n)return;Ul(e)&&e.preventDefault(),this.tryFocus(n)}}),Rl(this,`handleEscapeKey`,e=>{ql(e)&&Kl(this.config.escapeDeactivates,e)!==!1&&(e.preventDefault(),this.deactivate())}),Rl(this,`_mutationObserver`),Rl(this,`setupMutationObserver`,()=>{let e=this.doc.defaultView||window;this._mutationObserver=new e.MutationObserver(e=>{e.some(e=>Array.from(e.removedNodes).some(e=>e===this.state.mostRecentlyFocusedNode))&&this.tryFocus(this.getInitialFocusNode()),e.some(e=>e.type===`attributes`&&(e.attributeName===`aria-controls`||e.attributeName===`aria-expanded`)||e.type===`childList`&&e.addedNodes.length>0&&Array.from(e.addedNodes).some(e=>{if(e.nodeType!==Node.ELEMENT_NODE)return!1;let t=e;return la(t)?!0:t.id&&!this.state.containers.some(e=>e.contains(t))?ua(t):!1}))&&this.state.active&&!this.state.paused&&(this.updateTabbableNodes(),this.updatePortalContainers())})}),Rl(this,`updateObservedNodes`,()=>{this._mutationObserver?.disconnect(),this.state.active&&!this.state.paused&&(this.state.containers.map(e=>{this._mutationObserver?.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`aria-controls`,`aria-expanded`]})}),this.portalContainers.forEach(e=>{this.observePortalContainer(e)}))}),Rl(this,`getInitialFocusNode`,()=>{let e=this.getNodeForOption(`initialFocus`,{hasFallback:!0});if(e===!1)return!1;if(e===void 0||e&&!mo(e)){let t=Xi(this.doc);if(t&&this.findContainerIndex(t)>=0)e=t;else{let t=this.state.tabbableGroups[0];e=t&&t.firstTabbableNode||this.getNodeForOption(`fallbackFocus`)}}else e===null&&(e=this.getNodeForOption(`fallbackFocus`));if(!e||(e.isConnected||(e=this.getNodeForOption(`fallbackFocus`)),!e||!e.isConnected))throw Error(`Your focus-trap needs to have at least one focusable element`);return e}),Rl(this,`tryFocus`,(e,t)=>{if(e!==!1&&e!==Xi(this.doc)){if(!e||!e.focus){this.tryFocus(this.getInitialFocusNode());return}e.focus({preventScroll:!!this.config.preventScroll,...t}),this.state.mostRecentlyFocusedNode=e,Yl(e)&&e.select()}}),Rl(this,`deactivate`,e=>{if(!this.state.active)return this;let t={onDeactivate:this.config.onDeactivate,onPostDeactivate:this.config.onPostDeactivate,checkCanReturnFocus:this.config.checkCanReturnFocus,...e};clearTimeout(this.state.delayInitialFocusTimer),this.state.delayInitialFocusTimer=void 0,this.removeListeners(),this.state.active=!1,this.state.paused=!1,this.updateObservedNodes(),zl.deactivateTrap(this.trapStack,this),this.portalContainers.clear();let n=this.getOption(t,`onDeactivate`),r=this.getOption(t,`onPostDeactivate`),i=this.getOption(t,`checkCanReturnFocus`),a=this.getOption(t,`returnFocus`,`returnFocusOnDeactivate`);n?.();let o=()=>{Jl(()=>{if(a&&this.isSafeToOverrideFocus()){let e=this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation),t=this.lastInteractionType===`keyboard`?{focusVisible:!0}:void 0;this.tryFocus(e,t)}r?.()})};return a&&i?(i(this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation)).then(o,o),this):(o(),this)}),Rl(this,`pause`,e=>{if(this.state.paused||!this.state.active)return this;let t=this.getOption(e,`onPause`),n=this.getOption(e,`onPostPause`);return this.state.paused=!0,t?.(),this.removeListeners(),this.updateObservedNodes(),n?.(),this}),Rl(this,`unpause`,e=>{if(!this.state.paused||!this.state.active)return this;let t=this.getOption(e,`onUnpause`),n=this.getOption(e,`onPostUnpause`);this.state.paused=!1,t?.();try{this.updateTabbableNodes()}catch{}this.attachListeners();try{this.commitInitialFocus()}catch{}return this.updateObservedNodes(),n?.(),this}),Rl(this,`updateContainerElements`,e=>(this.state.containers=Array.isArray(e)?e.filter(Boolean):[e].filter(Boolean),this.state.active&&this.updateTabbableNodes(),this.updateObservedNodes(),this)),Rl(this,`getReturnFocusNode`,e=>{let t=this.getNodeForOption(`setReturnFocus`,{params:[e]});return t||t!==!1&&e}),Rl(this,`getOption`,(e,t,n)=>e&&e[t]!==void 0?e[t]:this.config[n||t]),Rl(this,`getNodeForOption`,(e,{hasFallback:t=!1,params:n=[]}={})=>{let r=this.config[e];if(typeof r==`function`&&(r=r(...n)),r===!0&&(r=void 0),!r){if(r===void 0||r===!1)return r;throw Error(`\`${e}\` was specified but was not a node, or did not return a node`)}let i=r;if(typeof r==`string`){try{i=this.doc.querySelector(r)}catch(t){throw Error(`\`${e}\` appears to be an invalid selector; error="${t.message}"`)}if(!i&&!t)throw Error(`\`${e}\` as selector refers to no known node`)}return i}),Rl(this,`findNextNavNode`,e=>{let{event:t,isBackward:n=!1}=e,r=e.target||z(t);this.updateTabbableNodes();let i=null;if(this.state.tabbableGroups.length>0){let e=this.findContainerIndex(r,t),a=e>=0?this.state.containerGroups[e]:void 0;if(e<0)i=n?this.state.tabbableGroups[this.state.tabbableGroups.length-1].lastTabbableNode:this.state.tabbableGroups[0].firstTabbableNode;else if(n){let n=this.state.tabbableGroups.findIndex(({firstTabbableNode:e})=>r===e);if(n<0&&(a?.container===r||mo(r)&&!go(r)&&!a?.nextTabbableNode(r,!1))&&(n=e),n>=0){let e=n===0?this.state.tabbableGroups.length-1:n-1,t=this.state.tabbableGroups[e];i=vo(r)>=0?t.lastTabbableNode:t.lastDomTabbableNode}else Ul(t)||(i=a?.nextTabbableNode(r,!1))}else{let n=this.state.tabbableGroups.findIndex(({lastTabbableNode:e})=>r===e);if(n<0&&(a?.container===r||mo(r)&&!go(r)&&!a?.nextTabbableNode(r))&&(n=e),n>=0){let e=n===this.state.tabbableGroups.length-1?0:n+1,t=this.state.tabbableGroups[e];i=vo(r)>=0?t.firstTabbableNode:t.firstDomTabbableNode}else Ul(t)||(i=a?.nextTabbableNode(r))}}else i=this.getNodeForOption(`fallbackFocus`);return i}),this.trapStack=t.trapStack||Bl;let n={returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,followControlledElements:!0,isKeyForward:Wl,isKeyBackward:Gl,...t};this.doc=n.document||qi(Array.isArray(e)?e[0]:e),this.config=n,this.updateContainerElements(e),this.setupMutationObserver()}addPortalContainer(e){let t=e.parentElement;t&&!this.portalContainers.has(t)&&(this.portalContainers.add(t),this.state.active&&!this.state.paused&&this.observePortalContainer(t))}observePortalContainer(e){this._mutationObserver?.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`aria-controls`,`aria-expanded`]})}updatePortalContainers(){this.config.followControlledElements&&this.state.containers.forEach(e=>{oa(e).forEach(e=>{this.addPortalContainer(e)})})}get active(){return this.state.active}get paused(){return this.state.paused}findContainerIndex(e,t){let n=typeof t?.composedPath==`function`?t.composedPath():void 0;return this.state.containerGroups.findIndex(({container:r,tabbableNodes:i})=>r.contains(e)||n?.includes(r)||i.find(t=>t===e)||this.isControlledElement(r,e)||this.isPersistentElement(e,t))}isControlledElement(e,t){return this.config.followControlledElements?ia(e,t):!1}isPersistentElement(e,t){let n=this.config.persistentElements;if(!n||n.length===0)return!1;let r=typeof t?.composedPath==`function`?t.composedPath():void 0;return n.some(t=>{let n=t();return Ki(n,e)||n!=null&&r?.includes(n)})}updateTabbableNodes(){if(this.state.containerGroups=this.state.containers.map(e=>{let t=ho(e,{getShadowRoot:this.config.getShadowRoot}),n=po(e,{getShadowRoot:this.config.getShadowRoot}),r=t[0],i=t[t.length-1],a=r,o=i,s=!1;for(let e=0;e<t.length;e++)if(vo(t[e])>0){s=!0;break}function c(e,r=!0){let i=t.indexOf(e);if(i>=0)return t[i+(r?1:-1)];let a=n.indexOf(e);if(!(a<0)){if(r){for(let e=a+1;e<n.length;e++)if(go(n[e]))return n[e]}else for(let e=a-1;e>=0;e--)if(go(n[e]))return n[e]}}return{container:e,tabbableNodes:t,focusableNodes:n,posTabIndexesFound:s,firstTabbableNode:r,lastTabbableNode:i,firstDomTabbableNode:a,lastDomTabbableNode:o,nextTabbableNode:c}}),this.state.tabbableGroups=this.state.containerGroups.filter(e=>e.tabbableNodes.length>0),this.state.tabbableGroups.length<=0&&!this.getNodeForOption(`fallbackFocus`))throw Error(`Your focus-trap must have at least one container with at least one tabbable node in it at all times`);if(this.state.containerGroups.find(e=>e.posTabIndexesFound)&&this.state.containerGroups.length>1)throw Error(`At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.`)}attachListeners(){if(this.state.active)return zl.activateTrap(this.trapStack,this),this.listenerCleanups.push(Ga(this.doc,`focusin`,this.handleFocus,!0),Ga(this.doc,`mousedown`,this.handlePointerDown,{capture:!0,passive:!1}),Ga(this.doc,`touchstart`,this.handlePointerDown,{capture:!0,passive:!1}),Ga(this.doc,`click`,this.handleClick,{capture:!0,passive:!1}),Ga(this.doc,`keydown`,this.handleTabKey,{capture:!0,passive:!1}),Ga(this.doc,`keydown`,this.handleEscapeKey)),this}commitInitialFocus(){return this.state.delayInitialFocusTimer=this.config.delayInitialFocus?Jl(()=>{this.tryFocus(this.getInitialFocusNode())}):this.tryFocus(this.getInitialFocusNode()),this}addListeners(){if(this.state.active)return this.attachListeners(),this.commitInitialFocus(),this}removeListeners(){if(this.state.active)return this.listenerCleanups.forEach(e=>e()),this.listenerCleanups=[],this}containsElement(e){return this.state.containers.some(t=>Ki(t,e))}isSafeToOverrideFocus(){let e=Xi(this.doc);return!e||e===this.doc.body||this.containsElement(e)?!0:this.trapStack.some(t=>t!==this&&t.containsElement(e))}activate(e){if(this.state.active)return this;let t=this.getOption(e,`onActivate`),n=this.getOption(e,`onPostActivate`),r=this.getOption(e,`checkCanFocusTrap`);r||this.updateTabbableNodes(),this.state.active=!0,this.state.paused=!1,this.state.nodeFocusedBeforeActivation=Xi(this.doc),t?.();let i=()=>{r&&this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),n?.()};return r?(r(this.state.containers.concat()).then(i,i),this):(i(),this)}},Hl=e=>e?.type===`keydown`,Ul=e=>Hl(e)&&e?.key===`Tab`,Wl=e=>Hl(e)&&e.key===`Tab`&&!e?.shiftKey,Gl=e=>Hl(e)&&e.key===`Tab`&&e?.shiftKey,Kl=(e,...t)=>typeof e==`function`?e(...t):e,ql=e=>!e.isComposing&&e.key===`Escape`,Jl=e=>setTimeout(e,0),Yl=e=>e.localName===`input`&&`select`in e&&typeof e.select==`function`;function Xl(e,t={}){let n,r=So(()=>{let r=(Array.isArray(e)?e:[e]).map(e=>typeof e==`function`?e():e).filter(e=>e!=null);if(r.length===0)return;let i=r[0];n=new Vl(r,{escapeDeactivates:!1,allowOutsideClick:!0,preventScroll:!0,returnFocusOnDeactivate:!0,delayInitialFocus:!1,fallbackFocus:i,...t,document:qi(i)});try{n.activate()}catch{}});return function(){n?.deactivate(),r()}}var Zl=`data-scroll-lock`,Ql=new WeakMap;function $l(e){let t=e.getBoundingClientRect().left;return Math.round(t)+e.scrollLeft?`paddingLeft`:`paddingRight`}function eu(e){let t=ea(e)?.scrollbarGutter;return t===`stable`||t?.startsWith(`stable `)===!0}function tu(e){let{documentElement:t,body:n}=e;return No(t)?t:n}function nu(e){let t=e.defaultView??window,{documentElement:n,body:r}=e,i=tu(e),a=eu(n)||eu(r),o=t.innerWidth-n.clientWidth;r.setAttribute(Zl,``);let s=()=>ns(n,`--scrollbar-width`,`${o}px`),c=$l(n),l=[s(),Ea()?(()=>{let{scrollX:e,scrollY:n,visualViewport:i}=t,s=i?.offsetLeft??0,l=i?.offsetTop??0,u={position:`fixed`,overflow:`hidden`,top:`${-(n-Math.floor(l))}px`,left:`${-(e-Math.floor(s))}px`,right:`0`};!a&&o>0&&(u[c]=`${o}px`);let d=ts(r,u);return()=>{d?.(),t.scrollTo({left:e,top:n,behavior:`instant`})}})():(()=>{let e={overflow:`hidden`};return!a&&o>0&&(e[c]=`${o}px`),ts(i,e)})()];return()=>{l.forEach(e=>e?.()),r.removeAttribute(Zl)}}function ru(e){let t=e??document,n=Ql.get(t);n||(n={count:0,cleanup:nu(t)},Ql.set(t,n)),n.count++;let r=n,i=!1;return()=>{i||(i=!0,r.count--,r.count===0&&(r.cleanup(),Ql.delete(t)))}}var iu=H(`carousel`).parts(`root`,`itemGroup`,`item`,`control`,`nextTrigger`,`prevTrigger`,`indicatorGroup`,`indicator`,`autoplayTrigger`,`progressText`);iu.build();var au=iu.extendWith(`progressText`,`autoplayIndicator`),ou=H(`checkbox`).parts(`root`,`label`,`control`,`indicator`),su=ou.build();function cu(e){return!(e.metaKey||!Oa()&&e.altKey||e.ctrlKey||e.key===`Control`||e.key===`Shift`||e.key===`Meta`)}var lu=new Set([`checkbox`,`radio`,`range`,`color`,`file`,`image`,`button`,`submit`,`reset`]),uu=[`a[href]`,`audio[controls]`,`button`,`details`,`embed`,`iframe`,`img[controls]`,`img[usemap]`,`input`,`select`,`textarea`,`video[controls]`].join(`,`);function du(e,t,n){let r=n?z(n):null,i=qi(r),a=Yi(r),o=Xi(i);return e=e||o instanceof a.HTMLInputElement&&!lu.has(o?.type)||o instanceof a.HTMLTextAreaElement||o instanceof a.HTMLElement&&o.isContentEditable,!(e&&t===`keyboard`&&n instanceof a.KeyboardEvent&&!Reflect.has(yu,n.key))}var fu=null,pu=new Set,mu=new Map,hu=!1,gu=null,_u=!1,vu=null,yu={Tab:!0,Escape:!0};function bu(e,t){for(let n of pu)n(e,t)}function xu(e){gu=null,hu=!0,cu(e)&&(fu=`keyboard`,bu(`keyboard`,e))}function Su(e){(e.type!==`pointermove`&&e.type!==`mousemove`||vu?.x!==e.clientX||vu?.y!==e.clientY)&&(vu={x:e.clientX,y:e.clientY},fu=`pointer`,(e.type===`mousedown`||e.type===`pointerdown`)&&(gu=null,hu=!0,bu(`pointer`,e)))}function Cu(e){if(Ia(e)){gu=null,hu=!0,fu=`virtual`;return}gu=null;let t=z(e),n=t?.closest(`label`),r=n?.control;if(!n||!r||r.matches(`:disabled`))return;let i=t?.closest(uu);i&&n.contains(i)&&i!==r||r!==Xi(n.ownerDocument)&&(gu=r)}function wu(e){let t=z(e),n=t===gu;t!==Yi(t)&&t!==qi(t)&&e.isTrusted&&(!hu&&!n&&!_u&&(fu=`virtual`,bu(`virtual`,e)),hu=!1,gu=null,_u=!1)}function Tu(){hu=!1,gu=null,_u=!0}function Eu(e){if(typeof window>`u`||mu.get(Yi(e)))return;let t=Yi(e),n=qi(e),r=t.HTMLElement.prototype.focus;function i(){hu=!0,r.apply(this,arguments)}try{Object.defineProperty(t.HTMLElement.prototype,"focus",{configurable:!0,value:i})}catch{}n.addEventListener(`keydown`,xu,!0),n.addEventListener(`keyup`,xu,!0),n.addEventListener(`click`,Cu,!0),t.addEventListener(`focus`,wu,!0),t.addEventListener(`blur`,Tu,!1),t.PointerEvent===void 0?(n.addEventListener(`mousedown`,Su,!0),n.addEventListener(`mousemove`,Su,!0),n.addEventListener(`mouseup`,Su,!0)):(n.addEventListener(`pointerdown`,Su,!0),n.addEventListener(`pointermove`,Su,!0),n.addEventListener(`pointerup`,Su,!0)),t.addEventListener(`beforeunload`,()=>{Du(e)},{once:!0}),mu.set(t,{focus:r})}var Du=(e,t)=>{let n=Yi(e),r=qi(e);t&&r.removeEventListener(`DOMContentLoaded`,t);let i=mu.get(n);if(i){try{Object.defineProperty(n.HTMLElement.prototype,"focus",{configurable:!0,value:i.focus})}catch{}r.removeEventListener(`keydown`,xu,!0),r.removeEventListener(`keyup`,xu,!0),r.removeEventListener(`click`,Cu,!0),n.removeEventListener(`focus`,wu,!0),n.removeEventListener(`blur`,Tu,!1),n.PointerEvent===void 0?(r.removeEventListener(`mousedown`,Su,!0),r.removeEventListener(`mousemove`,Su,!0),r.removeEventListener(`mouseup`,Su,!0)):(r.removeEventListener(`pointerdown`,Su,!0),r.removeEventListener(`pointermove`,Su,!0),r.removeEventListener(`pointerup`,Su,!0)),mu.delete(n)}};function Ou(){return fu}function ku(e){fu=e,bu(e,null)}function Au(){return fu===`keyboard`||fu===`virtual`}function ju(e={}){let{isTextInput:t,autoFocus:n,onChange:r,root:i}=e;Eu(i),r?.({isFocusVisible:n||Au(),modality:fu});let a=(e,n)=>{du(!!t,e,n)&&r?.({isFocusVisible:Au(),modality:e})};return pu.add(a),()=>{pu.delete(a)}}var Mu=e=>e.ids?.root??`checkbox:${e.id}`,Nu=e=>e.ids?.label??`checkbox:${e.id}:label`,Pu=e=>e.ids?.control??`checkbox:${e.id}:control`,Fu=e=>e.ids?.hiddenInput??`checkbox:${e.id}:input`,Iu=e=>e.getById(Mu(e)),Lu=e=>e.getById(Fu(e));function Ru(e,t){let{send:n,context:r,prop:i,computed:a,scope:o}=e,s=!!i(`disabled`),c=!!i(`readOnly`),l=!!i(`required`),u=!!i(`invalid`),d=!s&&r.get(`focused`),f=!s&&r.get(`focusVisible`),p=a(`checked`),m=a(`indeterminate`),h=r.get(`checked`),g={"data-active":R(r.get(`active`)),"data-focus":R(d),"data-focus-visible":R(f),"data-readonly":R(c),"data-hover":R(r.get(`hovered`)),"data-disabled":R(s),"data-state":m?`indeterminate`:p?`checked`:`unchecked`,"data-invalid":R(u),"data-required":R(l)};return{checked:p,disabled:s,indeterminate:m,focused:d,checkedState:h,setChecked(e){n({type:`CHECKED.SET`,checked:e,isTrusted:!1})},toggleChecked(){n({type:`CHECKED.TOGGLE`,checked:p,isTrusted:!1})},getRootProps(){return t.label({...su.root.attrs,...g,dir:i(`dir`),id:Mu(o),htmlFor:Fu(o),onPointerMove(){s||n({type:`CONTEXT.SET`,context:{hovered:!0}})},onPointerLeave(){s||n({type:`CONTEXT.SET`,context:{hovered:!1}})},onClick(e){z(e)===Lu(o)&&e.stopPropagation()}})},getLabelProps(){return t.element({...su.label.attrs,...g,dir:i(`dir`),id:Nu(o)})},getControlProps(){return t.element({...su.control.attrs,...g,dir:i(`dir`),id:Pu(o),"aria-hidden":!0})},getIndicatorProps(){return t.element({...su.indicator.attrs,...g,dir:i(`dir`),hidden:!m&&!p})},getHiddenInputProps(){return t.input({id:Fu(o),type:`checkbox`,required:i(`required`),defaultChecked:p,disabled:s,"aria-labelledby":Nu(o),"aria-invalid":u,name:i(`name`),form:i(`form`),value:i(`value`),style:ss,onFocus(){let e=Au();n({type:`CONTEXT.SET`,context:{focused:!0,focusVisible:e}})},onBlur(){n({type:`CONTEXT.SET`,context:{focused:!1,focusVisible:!1}})},onClick(e){if(c){e.preventDefault();return}let t=e.currentTarget.checked;n({type:`CHECKED.SET`,checked:t,isTrusted:!0})}})}}}var{not:zu}=ui(),Bu=di({props({props:e}){return{value:`on`,...e,defaultChecked:e.defaultChecked??!1}},initialState(){return`ready`},context({prop:e,bindable:t}){return{checked:t(()=>({defaultValue:e(`defaultChecked`),value:e(`checked`),onChange(t){e(`onCheckedChange`)?.({checked:t})}})),fieldsetDisabled:t(()=>({defaultValue:!1})),focusVisible:t(()=>({defaultValue:!1})),active:t(()=>({defaultValue:!1})),focused:t(()=>({defaultValue:!1})),hovered:t(()=>({defaultValue:!1}))}},watch({track:e,context:t,prop:n,action:r}){e([()=>n(`disabled`)],()=>{r([`removeFocusIfNeeded`])}),e([()=>t.get(`checked`)],()=>{r([`syncInputElement`])})},effects:[`trackFormControlState`,`trackPressEvent`,`trackFocusVisible`],on:{"CHECKED.TOGGLE":[{guard:zu(`isTrusted`),actions:[`toggleChecked`,`dispatchChangeEvent`]},{actions:[`toggleChecked`]}],"CHECKED.SET":[{guard:zu(`isTrusted`),actions:[`setChecked`,`dispatchChangeEvent`]},{actions:[`setChecked`]}],"CONTEXT.SET":{actions:[`setContext`]}},computed:{indeterminate:({context:e})=>Vu(e.get(`checked`)),checked:({context:e})=>Hu(e.get(`checked`)),disabled:({context:e,prop:t})=>!!t(`disabled`)||e.get(`fieldsetDisabled`)},states:{ready:{}},implementations:{guards:{isTrusted:({event:e})=>!!e.isTrusted},effects:{trackPressEvent({context:e,computed:t,scope:n}){if(!t(`disabled`))return Vo({pointerNode:Iu(n),keyboardNode:Lu(n),isValidKey:e=>e.key===` `,onPress:()=>e.set(`active`,!1),onPressStart:()=>e.set(`active`,!0),onPressEnd:()=>e.set(`active`,!1)})},trackFocusVisible({computed:e,scope:t}){if(!e(`disabled`))return ju({root:t.getRootNode?.()})},trackFormControlState({context:e,scope:t}){return Qa(Lu(t),{onFieldsetDisabledChange(t){e.set(`fieldsetDisabled`,t)},onFormReset(){e.set(`checked`,e.initial(`checked`))}})}},actions:{setContext({context:e,event:t}){for(let n in t.context)e.set(n,t.context[n])},syncInputElement({context:e,computed:t,scope:n}){let r=Lu(n);r&&(qa(r,t(`checked`)),r.indeterminate=Vu(e.get(`checked`)))},removeFocusIfNeeded({context:e,prop:t}){t(`disabled`)&&e.get(`focused`)&&(e.set(`focused`,!1),e.set(`focusVisible`,!1))},setChecked({context:e,event:t}){e.set(`checked`,t.checked)},toggleChecked({context:e,computed:t}){let n=Vu(t(`checked`))?!0:!t(`checked`);e.set(`checked`,n)},dispatchChangeEvent({computed:e,scope:t}){queueMicrotask(()=>{Ja(Lu(t),{checked:e(`checked`)})})}}}});function Vu(e){return e===`indeterminate`}function Hu(e){return!Vu(e)&&!!e}var Uu=ou.extendWith(`group`),Wu=H(`clipboard`).parts(`root`,`control`,`trigger`,`indicator`,`input`,`label`);Wu.build();var Gu=H(`collapsible`).parts(`root`,`trigger`,`content`,`indicator`);Gu.build();var Ku=H(`color-picker`,[`root`,`label`,`control`,`trigger`,`positioner`,`content`,`area`,`areaThumb`,`valueText`,`areaBackground`,`channelSlider`,`channelSliderLabel`,`channelSliderTrack`,`channelSliderThumb`,`channelSliderValueText`,`channelInput`,`transparencyGrid`,`swatchGroup`,`swatchTrigger`,`swatchIndicator`,`swatch`,`eyeDropperTrigger`,`formatTrigger`,`formatSelect`]);Ku.build();var qu=[`top`,`right`,`bottom`,`left`],Ju=Math.min,Yu=Math.max,Xu=Math.round,Zu=Math.floor,Qu=e=>({x:e,y:e}),$u={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function ed(e,t,n){return Yu(e,Ju(t,n))}function td(e,t){return typeof e==`function`?e(t):e}function nd(e){return e.split(`-`)[0]}function rd(e){return e.split(`-`)[1]}function id(e){return e===`x`?`y`:`x`}function ad(e){return e===`y`?`height`:`width`}function od(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function sd(e){return id(od(e))}function cd(e,t,n){n===void 0&&(n=!1);let r=rd(e),i=sd(e),a=ad(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=_d(o)),[o,_d(o)]}function ld(e){let t=_d(e);return[ud(e),t,ud(t)]}function ud(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var dd=[`left`,`right`],fd=[`right`,`left`],pd=[`top`,`bottom`],md=[`bottom`,`top`];function hd(e,t,n){switch(e){case`top`:case`bottom`:return n?t?fd:dd:t?dd:fd;case`left`:case`right`:return t?pd:md;default:return[]}}function gd(e,t,n,r){let i=rd(e),a=hd(nd(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(ud)))),a}function _d(e){let t=nd(e);return $u[t]+e.slice(t.length)}function vd(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function yd(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:vd(e)}function bd(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 xd(e,t,n){let{reference:r,floating:i}=e,a=od(t),o=sd(t),s=ad(o),c=nd(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=rd(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Sd(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}=td(t,e),p=yd(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=bd(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=bd(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 Cd=50,wd=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Sd},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=xd(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<Cd&&(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}=xd(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Td=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}=td(e,t)||{};if(l==null)return{};let d=yd(u),f={x:n,y:r},p=sd(i),m=ad(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Ju(d[_],T),D=Ju(d[v],T),ee=C-h[m]-D,O=C/2-h[m]/2+w,te=ed(E,O,ee),k=!c.arrow&&rd(i)!=null&&O!==te&&a.reference[m]/2-(O<E?E:D)-h[m]/2<0,ne=k?O<E?O-E:O-ee:0;return{[p]:f[p]+ne,data:{[p]:te,centerOffset:O-te-ne,...k&&{alignmentOffset:ne}},reset:k}}}),Ed=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}=td(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=nd(r),_=od(o),v=nd(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[_d(o)]:ld(o)),x=p!==`none`;!d&&x&&b.push(...gd(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=cd(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`||_===od(t)||T.every(e=>od(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=od(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function Dd(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Od(e){return qu.some(t=>e[t]>=0)}var kd=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=td(e,t);switch(i){case`referenceHidden`:{let e=Dd(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Od(e)}}}case`escaped`:{let e=Dd(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Od(e)}}}default:return{}}}}},Ad=new Set([`left`,`top`]);async function jd(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=nd(n),s=rd(n),c=od(n)===`y`,l=Ad.has(o)?-1:1,u=a&&c?-1:1,d=td(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 Md=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 jd(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}}}}},Nd=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}=td(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=od(i),p=id(f),m=u[p],h=u[f],g=(e,t)=>ed(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}}}}}},Pd=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}=td(e,t),u={x:n,y:r},d=od(i),f=id(d),p=u[f],m=u[d],h=td(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=Ad.has(nd(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}}}},Fd=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}=td(e,t),c=await i.detectOverflow(t,s),l=nd(n),u=rd(n),d=od(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=Ju(p-c[m],g),y=Ju(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*Yu(c.left,c.right):S=p-2*Yu(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 Id(){return typeof window<`u`}function Ld(e){return Bd(e)?(e.nodeName||``).toLowerCase():`#document`}function Rd(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function zd(e){return((Bd(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Bd(e){return Id()?e instanceof Node||e instanceof Rd(e).Node:!1}function Vd(e){return Id()?e instanceof Element||e instanceof Rd(e).Element:!1}function Hd(e){return Id()?e instanceof HTMLElement||e instanceof Rd(e).HTMLElement:!1}function Ud(e){return!Id()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Rd(e).ShadowRoot}function Wd(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=tf(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Gd(e){return/^(table|td|th)$/.test(Ld(e))}function Kd(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var qd=/transform|translate|scale|rotate|perspective|filter/,Jd=/paint|layout|strict|content/,Yd=e=>!!e&&e!==`none`,Xd;function Zd(e){let t=Vd(e)?tf(e):e;return Yd(t.transform)||Yd(t.translate)||Yd(t.scale)||Yd(t.rotate)||Yd(t.perspective)||!$d()&&(Yd(t.backdropFilter)||Yd(t.filter))||qd.test(t.willChange||``)||Jd.test(t.contain||``)}function Qd(e){let t=rf(e);for(;Hd(t)&&!ef(t);){if(Zd(t))return t;if(Kd(t))return null;t=rf(t)}return null}function $d(){return Xd??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Xd}function ef(e){return/^(html|body|#document)$/.test(Ld(e))}function tf(e){return Rd(e).getComputedStyle(e)}function nf(e){return Vd(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function rf(e){if(Ld(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Ud(e)&&e.host||zd(e);return Ud(t)?t.host:t}function af(e){let t=rf(e);return ef(t)?(e.ownerDocument||e).body:Hd(t)&&Wd(t)?t:af(t)}function of(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=af(e),i=r===e.ownerDocument?.body,a=Rd(r);if(i){let e=sf(a);return t.concat(a,a.visualViewport||[],Wd(r)?r:[],e&&n?of(e):[])}return t.concat(r,of(r,[],n))}function sf(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function cf(e){let t=tf(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Hd(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Xu(n)!==a||Xu(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function lf(e){return Vd(e)?e:e.contextElement}function uf(e){let t=lf(e);if(!Hd(t))return Qu(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=cf(t),o=(a?Xu(n.width):n.width)/r,s=(a?Xu(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var df=Qu(0);function ff(e){let t=Rd(e);return!$d()||!t.visualViewport?df:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function pf(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Rd(e)}function mf(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=lf(e),o=Qu(1);t&&(r?Vd(r)&&(o=uf(r)):o=uf(e));let s=pf(a,n,r)?ff(a):Qu(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=Rd(a),t=Vd(r)?Rd(r):r,n=e,i=sf(n);for(;i&&t!==n;){let e=uf(i),t=i.getBoundingClientRect(),r=tf(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=Rd(i),i=sf(n)}}return bd({width:u,height:d,x:c,y:l})}function hf(e,t){let n=nf(e).scrollLeft;return t?t.left+n:mf(zd(e)).left+n}function gf(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-hf(e,n),y:n.top+t.scrollTop}}function _f(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=zd(r),s=t?Kd(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Qu(1),u=Qu(0),d=Hd(r);if((d||!a)&&((Ld(r)!==`body`||Wd(o))&&(c=nf(r)),d)){let e=mf(r);l=uf(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?gf(o,c):Qu(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 vf(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function yf(e){let t=nf(e),n=e.ownerDocument.body,r=Yu(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Yu(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+hf(e),o=-t.scrollTop;return tf(n).direction===`rtl`&&(a+=Yu(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var bf=25;function xf(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Rd(e),a=zd(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!$d()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(hf(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<=bf&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Sf(e,t){let n=mf(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=uf(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Cf(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=xf(e,n,t);else if(t===`document`)r=yf(zd(e));else if(Vd(t))r=Sf(t,n);else{let n=ff(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return bd(r)}function wf(e,t){let n=t.get(e);if(n)return n;let r=of(e,[],!1).filter(e=>Vd(e)&&Ld(e)!==`body`),i=null,a=tf(e).position===`fixed`,o=a?rf(e):e;for(;Vd(o)&&!ef(o);){let e=tf(o),t=Zd(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=rf(o)}return t.set(e,r),r}function Tf(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Kd(t)?[]:wf(t,this._c):[].concat(n),r],o=Cf(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=Cf(t,a[e],i);s=Yu(n.top,s),c=Ju(n.right,c),l=Ju(n.bottom,l),u=Yu(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Ef(e){let{width:t,height:n}=cf(e);return{width:t,height:n}}function Df(e,t,n){let r=Hd(t),i=zd(t),a=n===`fixed`,o=mf(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Qu(0);if((r||!a)&&((Ld(t)!==`body`||Wd(i))&&(s=nf(t)),r)){let e=mf(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=hf(i));let l=i&&!r&&!a?gf(i,s):Qu(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 Of(e){return tf(e).position===`static`}function kf(e,t){if(!Hd(e)||tf(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return zd(e)===n&&(n=n.ownerDocument.body),n}function Af(e,t){let n=Rd(e);if(Kd(e))return n;if(!Hd(e)){let t=rf(e);for(;t&&!ef(t);){if(Vd(t)&&!Of(t))return t;t=rf(t)}return n}let r=kf(e,t);for(;r&&Gd(r)&&Of(r);)r=kf(r,t);return r&&ef(r)&&Of(r)&&!Zd(r)?n:r||Qd(e)||n}var jf=async function(e){let t=this.getOffsetParent||Af,n=this.getDimensions,r=await n(e.floating);return{reference:Df(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Mf(e){return tf(e).direction===`rtl`}var Nf={convertOffsetParentRelativeRectToViewportRelativeRect:_f,getDocumentElement:zd,getClippingRect:Tf,getOffsetParent:Af,getElementRects:jf,getClientRects:vf,getDimensions:Ef,getScale:uf,isElement:Vd,isRTL:Mf};function Pf(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ff(e,t,n){let r=null,i,a=zd(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=Zu(d),h=Zu(a.clientWidth-(u+f)),g=Zu(a.clientHeight-(d+p)),_=Zu(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Yu(0,Ju(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Pf(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=Rd(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function If(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=lf(e),u=i||a?[...l?of(l):[],...t?of(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Ff(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?mf(e):null;c&&g();function g(){let t=mf(e);h&&!Pf(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 Lf=Md,Rf=Nd,zf=Ed,Bf=Fd,Vf=kd,Hf=Td,Uf=Pd,Wf=(e,t,n)=>{let r=new Map,i=n??{},a={...Nf,...i.platform,_c:r};return wd(e,t,{...i,platform:a})};function Gf(e=0,t=0,n=0,r=0){if(typeof DOMRect==`function`)return new DOMRect(e,t,n,r);let i={x:e,y:t,width:n,height:r,top:t,right:e+n,bottom:t+r,left:e};return{...i,toJSON:()=>i}}function Kf(e){if(!e)return Gf();let{x:t,y:n,width:r,height:i}=e;return Gf(t,n,r,i)}function qf(e,t){return{contextElement:ji(e)?e:e?.contextElement,getBoundingClientRect:()=>{let n=e,r=t?.(n);return r||!n?Kf(r):n.getBoundingClientRect()}}}var Jf=e=>({variable:e,reference:`var(${e})`}),Yf={arrowSize:Jf(`--arrow-size`),arrowSizeHalf:Jf(`--arrow-size-half`),arrowBg:Jf(`--arrow-background`),transformOrigin:Jf(`--transform-origin`),arrowOffset:Jf(`--arrow-offset`)},Xf=e=>e===`top`||e===`bottom`?`y`:`x`;function Zf(e,t){return{name:`transformOrigin`,fn(n){let{elements:r,middlewareData:i,placement:a,rects:o,y:s}=n,c=a.split(`-`)[0],l=Xf(c),u=i.arrow?.x||0,d=i.arrow?.y||0,f=t?.clientWidth||0,p=t?.clientHeight||0,m=u+f/2,h=d+p/2,g=Math.abs(i.shift?.y||0),_=o.reference.height/2,v=p/2,y=e.offset?.mainAxis??e.gutter,b=typeof y==`number`?y+v:y??v,x=g>b,S={top:`${m}px calc(100% + ${b}px)`,bottom:`${m}px ${-b}px`,left:`calc(100% + ${b}px) ${h}px`,right:`${-b}px ${h}px`}[c],C=`${m}px ${o.reference.y+_-s}px`,w=!!e.overlap&&l===`y`&&x;return r.floating.style.setProperty(Yf.transformOrigin.variable,w?C:S),{data:{transformOrigin:w?C:S}}}}}var Qf={name:`rects`,fn({rects:e}){return{data:e}}},$f=e=>{if(e)return{name:`shiftArrow`,fn({placement:t,middlewareData:n}){if(!n.arrow)return{};let{x:r,y:i}=n.arrow,a=t.split(`-`)[0];return Object.assign(e.style,{left:r==null?``:`${r}px`,top:i==null?``:`${i}px`,[a]:`calc(100% + ${Yf.arrowOffset.reference})`}),{}}}};function ep(e){let[t,n]=e.split(`-`);return{side:t,align:n,hasAlign:n!=null}}function tp(e){return e.split(`-`)[0]}var np={strategy:`absolute`,placement:`bottom`,listeners:!0,restoreStyles:!1,applyStyles:!0,gutter:8,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,overflowPadding:8,arrowPadding:4};function rp(e,t){let n=e.devicePixelRatio||1;return Math.round(t*n)/n}function ip(e,t){return e!=null&&Math.abs(e-t)<.5}function ap(e){return typeof e==`function`?e():e===`clipping-ancestors`?`clippingAncestors`:e}function op(e,t,n){return Hf({element:e||t.createElement(`div`),padding:n.arrowPadding})}function sp(e,t){if(!tr(t.offset??t.gutter))return Lf(({placement:n})=>{let r=(e?.clientHeight||0)/2,i=t.offset?.mainAxis??t.gutter,a=typeof i==`number`?i+r:i??r,{hasAlign:o}=ep(n),s=o?void 0:t.shift;return xr({crossAxis:t.offset?.crossAxis??s,mainAxis:a,alignmentAxis:t.shift})})}function cp(e){if(e.flip)return zf(()=>{let t=ap(e.boundary);return{...t?{boundary:t}:void 0,padding:e.overflowPadding,fallbackPlacements:e.flip===!0?void 0:e.flip}})}function lp(e){if(e.slide||e.overlap)return Rf(()=>{let t=ap(e.boundary);return{...t?{boundary:t}:void 0,mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:Uf()}})}function up(e){if(e.sizeMiddleware===!1&&!e.sameWidth&&!e.fitViewport)return;let t,n,r,i;return Bf(()=>{let a=ap(e.boundary);return{padding:e.overflowPadding,...a?{boundary:a}:void 0,apply({elements:e,rects:a,availableHeight:o,availableWidth:s}){let c=e.floating,l=Math.round(a.reference.width),u=Math.round(a.reference.height);s=Math.floor(s),o=Math.floor(o),ip(t,l)||(c.style.setProperty(`--reference-width`,`${l}px`),t=l),ip(n,u)||(c.style.setProperty(`--reference-height`,`${u}px`),n=u),ip(r,s)||(c.style.setProperty(`--available-width`,`${s}px`),r=s),ip(i,o)||(c.style.setProperty(`--available-height`,`${o}px`),i=o)}}})}function dp(e){if(e.hideWhenDetached)return Vf(()=>({strategy:`referenceHidden`,boundary:ap(e.boundary)??`clippingAncestors`}))}function fp(e){return e?e===!0?{ancestorResize:!0,ancestorScroll:!0,elementResize:!0,layoutShift:!0}:e:{}}var pp=[`transform`,`visibility`,`pointer-events`,`--x`,`--y`,`--z-index`,`--reference-width`,`--reference-height`,`--available-width`,`--available-height`,`--transform-origin`],mp=[`top`,`right`,`bottom`,`left`];function hp(e,t){if(!e)return dr;let n=new Map(t.map(t=>[t,e.style.getPropertyValue(t)]));return()=>{n.forEach((t,n)=>{t?e.style.setProperty(n,t):e.style.removeProperty(n)}),e.style.length===0&&e.removeAttribute(`style`)}}function gp(e){return e==null?null:ji(e)?e:typeof e==`object`&&e&&`contextElement`in e&&e.contextElement?e.contextElement:e}function _p(e,t,n={}){let r=()=>(typeof t==`function`?t():t)??null,i=()=>{let t=typeof e==`function`?e():e;return n.getAnchorElement?.()??t},a=()=>{let e=i();return!e&&!n.getAnchorRect?null:qf(e,n.getAnchorRect)},o=Object.assign({},np,n),s=[],c=null,l,u;function d(e){l?.(),u?.(),c=e,l=o.restoreStyles?hp(e,pp):void 0;let t=e.querySelector(`[data-part=arrow]`);u=o.restoreStyles?hp(t,mp):void 0,s=[sp(t,o),cp(o),lp(o),op(t,e.ownerDocument,o),$f(t),Zf({gutter:o.gutter,offset:o.offset,overlap:o.overlap},t),up(o),dp(o),Qf]}let{placement:f,strategy:p,onComplete:m,onPositioned:h}=o,g,_,v=!1,y,b,x=dr,S=fp(o.listeners);function C(){if(!o.listeners)return;let e=i(),t=a(),n=r();t&&n&&(gp(e)!==gp(y)||n!==b)&&(x(),y=e,b=n,x=If(t,n,T,S))}async function w(){C();let e=r();if(!e)return;e!==c&&(d(e),v=!1);let t=a();if(!t)return;let n=await Wf(t,e,{placement:f,middleware:s,strategy:p}),i=Yi(e),l=rp(i,n.x),u=rp(i,n.y);if(m?.({...n,x:l,y:u}),o.applyStyles!==!1&&(ip(g,l)||(e.style.setProperty(`--x`,`${l}px`),g=l),ip(_,u)||(e.style.setProperty(`--y`,`${u}px`),_=u),o.hideWhenDetached&&(n.middlewareData.hide?.referenceHidden?(e.style.setProperty(`visibility`,`hidden`),e.style.setProperty(`pointer-events`,`none`)):(e.style.removeProperty(`visibility`),e.style.removeProperty(`pointer-events`))),!v)){let t=e.firstElementChild;t&&(e.style.setProperty(`--z-index`,ea(t).zIndex),v=!0)}}async function T(){n.updatePosition?(await n.updatePosition({updatePosition:w,floatingElement:r()}),h?.({placed:!0})):await w()}return T(),()=>{x(),u?.(),l?.(),h?.({placed:!1})}}function vp(e,t,n={}){let{defer:r,...i}=n,a=r?So:e=>e(),o=[];return o.push(a(()=>{o.push(_p(e,t,i))})),()=>{o.forEach(e=>e?.())}}var yp={bottom:`rotate(45deg)`,left:`rotate(135deg)`,top:`rotate(225deg)`,right:`rotate(315deg)`};function bp(e={}){let{placement:t,sameWidth:n,fitViewport:r,strategy:i=`absolute`}=e;return{arrow:{position:`absolute`,width:Yf.arrowSize.reference,height:Yf.arrowSize.reference,[Yf.arrowSizeHalf.variable]:`calc(${Yf.arrowSize.reference} / 2)`,[Yf.arrowOffset.variable]:`calc(${Yf.arrowSizeHalf.reference} * -1)`},arrowTip:{transform:t?yp[t.split(`-`)[0]]:void 0,background:Yf.arrowBg.reference,top:`0`,left:`0`,width:`100%`,height:`100%`,position:`absolute`,zIndex:`inherit`},floating:{position:i,isolation:`isolate`,minWidth:n?void 0:`max-content`,width:n?`var(--reference-width)`:void 0,maxWidth:r?`var(--available-width)`:void 0,maxHeight:r?`var(--available-height)`:void 0,pointerEvents:t?void 0:`none`,top:`0px`,left:`0px`,transform:t?`translate3d(var(--x), var(--y), 0)`:`translate3d(0, -100vh, 0)`,zIndex:`var(--z-index)`}}}var xp=Ku.extendWith(`view`),Sp=H(`combobox`).parts(`root`,`clearTrigger`,`content`,`control`,`input`,`item`,`itemGroup`,`itemGroupLabel`,`itemIndicator`,`itemText`,`label`,`list`,`positioner`,`trigger`);Sp.build();var Cp=Object.defineProperty,wp=(e,t,n)=>t in e?Cp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,W=(e,t,n)=>wp(e,typeof t==`symbol`?t:t+``,n),Tp={itemToValue(e){return typeof e==`string`?e:Qn(e)&&nr(e,`value`)?e.value:``},itemToString(e){return typeof e==`string`?e:Qn(e)&&nr(e,`label`)?e.label:Tp.itemToValue(e)},isItemDisabled(e){return Qn(e)&&nr(e,`disabled`)?!!e.disabled:!1}},Ep=class e{constructor(t){W(this,`options`,t),W(this,`items`),W(this,`indexMap`,null),W(this,`copy`,t=>new e({...this.options,items:t??[...this.items]})),W(this,`isEqual`,e=>Yn(this.items,e.items)),W(this,`setItems`,e=>this.copy(e)),W(this,`getValues`,(e=this.items)=>{let t=[];for(let n of e){let e=this.getItemValue(n);e!=null&&t.push(e)}return t}),W(this,`find`,e=>{if(e==null)return null;let t=this.indexOf(e);return t===-1?null:this.at(t)}),W(this,`findMany`,e=>{let t=[];for(let n of e){let e=this.find(n);e!=null&&t.push(e)}return t}),W(this,`at`,e=>{if(!this.options.groupBy&&!this.options.groupSort)return this.items[e]??null;let t=0,n=this.group();for(let[,r]of n)for(let n of r){if(t===e)return n;t++}return null}),W(this,`sortFn`,(e,t)=>{let n=this.indexOf(e),r=this.indexOf(t);return(n??0)-(r??0)}),W(this,`sort`,e=>[...e].sort(this.sortFn.bind(this))),W(this,`getItemValue`,e=>e==null?null:this.options.itemToValue?.(e)??Tp.itemToValue(e)),W(this,`getItemDisabled`,e=>e==null?!1:this.options.isItemDisabled?.(e)??Tp.isItemDisabled(e)),W(this,`stringifyItem`,e=>e==null?null:this.options.itemToString?.(e)??Tp.itemToString(e)),W(this,`stringify`,e=>e==null?null:this.stringifyItem(this.find(e))),W(this,`stringifyItems`,(e,t=`, `)=>{let n=[];for(let t of e){let e=this.stringifyItem(t);e!=null&&n.push(e)}return n.join(t)}),W(this,`stringifyMany`,(e,t)=>this.stringifyItems(this.findMany(e),t)),W(this,`has`,e=>this.indexOf(e)!==-1),W(this,`hasItem`,e=>e!=null&&this.has(this.getItemValue(e))),W(this,`group`,()=>{let{groupBy:e,groupSort:t}=this.options;if(!e)return[[``,[...this.items]]];let n=new Map;this.items.forEach((t,r)=>{let i=e(t,r);n.has(i)||n.set(i,[]),n.get(i).push(t)});let r=Array.from(n.entries());return t&&r.sort(([e],[n])=>{if(typeof t==`function`)return t(e,n);if(Array.isArray(t)){let r=t.indexOf(e),i=t.indexOf(n);return r===-1?1:i===-1?-1:r-i}return t===`asc`?e.localeCompare(n):t===`desc`?n.localeCompare(e):0}),r}),W(this,`getNextValue`,(e,t=1,n=!1)=>{let r=this.indexOf(e);if(r===-1)return null;for(r=n?Math.min(r+t,this.size-1):r+t;r<=this.size&&this.getItemDisabled(this.at(r));)r++;return this.getItemValue(this.at(r))}),W(this,`getPreviousValue`,(e,t=1,n=!1)=>{let r=this.indexOf(e);if(r===-1)return null;for(r=n?Math.max(r-t,0):r-t;r>=0&&this.getItemDisabled(this.at(r));)r--;return this.getItemValue(this.at(r))}),W(this,`indexOf`,e=>{if(e==null)return-1;if(!this.options.groupBy&&!this.options.groupSort)return this.items.findIndex(t=>this.getItemValue(t)===e);if(!this.indexMap){this.indexMap=new Map;let e=0,t=this.group();for(let[,n]of t)for(let t of n){let n=this.getItemValue(t);n!=null&&this.indexMap.set(n,e),e++}}return this.indexMap.get(e)??-1}),W(this,`getByText`,(e,t)=>{let n=t==null?-1:this.indexOf(t),r=e.length===1;for(let i=0;i<this.items.length;i++){let a=this.items[(n+i+1)%this.items.length];if(!(r&&this.getItemValue(a)===t)&&!this.getItemDisabled(a)&&Dp(this.stringifyItem(a),e))return a}}),W(this,`search`,(e,t)=>{let{state:n,currentValue:r,timeout:i=350}=t,a=n.keysSoFar+e,o=a.length>1&&Array.from(a).every(e=>e===a[0])?a[0]:a,s=this.getByText(o,r),c=this.getItemValue(s);function l(){clearTimeout(n.timer),n.timer=-1}function u(e){n.keysSoFar=e,l(),e!==``&&(n.timer=+setTimeout(()=>{u(``),l()},i))}return u(a),c}),W(this,`update`,(e,t)=>{let n=this.indexOf(e);return n===-1?this:this.copy([...this.items.slice(0,n),t,...this.items.slice(n+1)])}),W(this,`upsert`,(e,t,n=`append`)=>{let r=this.indexOf(e);return r===-1?(n===`append`?this.append:this.prepend)(t):this.copy([...this.items.slice(0,r),t,...this.items.slice(r+1)])}),W(this,`insert`,(e,...t)=>this.copy(Op(this.items,e,...t))),W(this,`insertBefore`,(e,...t)=>{let n=this.indexOf(e);if(n===-1){if(this.items.length===0)n=0;else return this}return this.copy(Op(this.items,n,...t))}),W(this,`insertAfter`,(e,...t)=>{let n=this.indexOf(e);if(n===-1){if(this.items.length===0)n=0;else return this}return this.copy(Op(this.items,n+1,...t))}),W(this,`prepend`,(...e)=>this.copy(Op(this.items,0,...e))),W(this,`append`,(...e)=>this.copy(Op(this.items,this.items.length,...e))),W(this,`filter`,e=>{let t=this.items.filter((t,n)=>e(this.stringifyItem(t),n,t));return this.copy(t)}),W(this,`remove`,(...e)=>{let t=e.map(e=>typeof e==`string`?e:this.getItemValue(e));return this.copy(this.items.filter(e=>{let n=this.getItemValue(e);return n!=null&&!t.includes(n)}))}),W(this,`move`,(e,t)=>{let n=this.indexOf(e);return n===-1?this:this.copy(kp(this.items,[n],t))}),W(this,`moveBefore`,(e,...t)=>{let n=this.items.findIndex(t=>this.getItemValue(t)===e);if(n===-1)return this;let r=t.map(e=>this.items.findIndex(t=>this.getItemValue(t)===e)).sort((e,t)=>e-t);return this.copy(kp(this.items,r,n))}),W(this,`moveAfter`,(e,...t)=>{let n=this.items.findIndex(t=>this.getItemValue(t)===e);if(n===-1)return this;let r=t.map(e=>this.items.findIndex(t=>this.getItemValue(t)===e)).sort((e,t)=>e-t);return this.copy(kp(this.items,r,n+1))}),W(this,`reorder`,(e,t)=>this.copy(kp(this.items,[e],t))),W(this,`compareValue`,(e,t)=>{let n=this.indexOf(e),r=this.indexOf(t);return n<r?-1:+(n>r)}),W(this,`range`,(e,t)=>{let n=[],r=e;for(;r!=null;){if(this.find(r)&&n.push(r),r===t)return n;r=this.getNextValue(r)}return[]}),W(this,`getValueRange`,(e,t)=>e&&t?this.compareValue(e,t)<=0?this.range(e,t):this.range(t,e):[]),W(this,`toString`,()=>{let e=``;for(let t of this.items){let n=[this.getItemValue(t),this.stringifyItem(t),this.getItemDisabled(t)].filter(Boolean).join(`:`);e+=n+`,`}return e}),W(this,`toJSON`,()=>({size:this.size,first:this.firstValue,last:this.lastValue})),this.items=[...t.items]}get size(){return this.items.length}get firstValue(){let e=0;for(;this.getItemDisabled(this.at(e));)e++;return this.getItemValue(this.at(e))}get lastValue(){let e=this.size-1;for(;this.getItemDisabled(this.at(e));)e--;return this.getItemValue(this.at(e))}*[Symbol.iterator](){yield*this.items}},Dp=(e,t)=>!!e?.toLowerCase().startsWith(t.toLowerCase());function Op(e,t,...n){return[...e.slice(0,t),...n,...e.slice(t)]}function kp(e,t,n){t=[...t].sort((e,t)=>e-t);let r=t.map(t=>e[t]);for(let n=t.length-1;n>=0;n--)e=[...e.slice(0,t[n]),...e.slice(t[n]+1)];return n=Math.max(0,n-t.filter(e=>e<n).length),[...e.slice(0,n),...r,...e.slice(n)]}function Ap({values:e,collection:t,selectedItemMap:n}){let r=[];for(let i of e){let e=t.find(i)??n.get(i);e!=null&&r.push(e)}return r}function jp({selectedItemMap:e,values:t,selectedItems:n,collection:r}){let i=new Map(e);for(let e of n){let t=r.getItemValue(e);t!=null&&i.set(t,e)}let a=new Set(t);for(let e of i.keys())a.has(e)||i.delete(e);return i}function Mp({values:e,collection:t,selectedItemMap:n}){let r=Ap({values:e,collection:t,selectedItemMap:n});return{selectedItems:r,nextSelectedItemMap:jp({selectedItemMap:n,values:e,selectedItems:r,collection:t})}}function Np({selectedItems:e,collection:t}){return jp({selectedItemMap:new Map,values:e.map(e=>t.getItemValue(e)).filter(Boolean),selectedItems:e,collection:t})}var Pp=Sp.extendWith(`empty`),Fp=H(`date-input`).parts(`root`,`label`,`control`,`segmentGroup`,`segment`,`hiddenInput`);Fp.build();var Ip=H(`date-picker`).parts(`clearTrigger`,`content`,`control`,`input`,`label`,`monthSelect`,`nextTrigger`,`positioner`,`presetTrigger`,`prevTrigger`,`rangeText`,`root`,`table`,`tableBody`,`tableCell`,`tableCellTrigger`,`tableHead`,`tableHeader`,`tableRow`,`trigger`,`view`,`viewControl`,`viewTrigger`,`yearSelect`);Ip.build();var Lp=Ip.extendWith(`view`,`valueText`),Rp=H(`dialog`).parts(`trigger`,`backdrop`,`positioner`,`content`,`title`,`description`,`closeTrigger`),zp=Rp.build(),Bp=e=>e.ids?.positioner??`dialog:${e.id}:positioner`,Vp=e=>e.ids?.backdrop??`dialog:${e.id}:backdrop`,Hp=e=>e.ids?.content??`dialog:${e.id}:content`,Up=(e,t)=>{let n=e.ids?.trigger;return n==null?t?`dialog:${e.id}:trigger:${t}`:`dialog:${e.id}:trigger`:er(n)?n(t):n},Wp=e=>e.ids?.title??`dialog:${e.id}:title`,Gp=e=>e.ids?.description??`dialog:${e.id}:description`,Kp=e=>e.ids?.closeTrigger??`dialog:${e.id}:close`,qp=e=>e.getById(Hp(e)),Jp=e=>e.getById(Bp(e)),Yp=e=>e.getById(Vp(e)),Xp=e=>e.getById(Up(e)),Zp=e=>e.getById(Wp(e)),Qp=e=>e.getById(Gp(e)),$p=e=>e.getById(Kp(e)),em=e=>Ho(e.getRootNode(),`[data-scope="dialog"][data-part="trigger"]${Ei(e.id)}`),tm=(e,t)=>t==null?Xp(e)??em(e)[0]:e.getById(Up(e,t));function nm(e,t){let{state:n,send:r,context:i,prop:a,scope:o}=e,s=a(`aria-label`),c=n.matches(`open`),l=i.get(`triggerValue`);return{open:c,setOpen(e){n.matches(`open`)!==e&&r({type:e?`OPEN`:`CLOSE`})},triggerValue:l,setTriggerValue(e){r({type:`TRIGGER_VALUE.SET`,value:e})},getTriggerProps(e={}){let{value:n}=e,i=n!=null&&l===n;return t.button({...zp.trigger.attrs,dir:a(`dir`),id:Up(o,n),"data-ownedby":o.id,"data-value":n,"aria-haspopup":`dialog`,type:`button`,"aria-expanded":n==null?c:c&&i,"data-state":c?`open`:`closed`,"aria-controls":Hp(o),"data-current":R(i),onClick(e){e.defaultPrevented||r({type:c&&n!=null&&!i?`TRIGGER_VALUE.SET`:`TOGGLE`,value:n})}})},getBackdropProps(){return t.element({...zp.backdrop.attrs,dir:a(`dir`),hidden:!c,id:Vp(o),"data-state":c?`open`:`closed`})},getPositionerProps(){return t.element({...zp.positioner.attrs,dir:a(`dir`),id:Bp(o),style:xr({pointerEvents:!c||!a(`modal`)?`none`:void 0})})},getContentProps(){let e=i.get(`rendered`);return t.element({...zp.content.attrs,dir:a(`dir`),role:a(`role`),hidden:!c,id:Hp(o),tabIndex:-1,"data-state":c?`open`:`closed`,"aria-modal":a(`modal`),"aria-label":s||void 0,"aria-labelledby":s||!e.title?void 0:Wp(o),"aria-describedby":e.description?Gp(o):void 0,style:xr({pointerEvents:a(`modal`)?void 0:`auto`})})},getTitleProps(){return t.element({...zp.title.attrs,dir:a(`dir`),id:Wp(o)})},getDescriptionProps(){return t.element({...zp.description.attrs,dir:a(`dir`),id:Gp(o)})},getCloseTriggerProps(){return t.button({...zp.closeTrigger.attrs,dir:a(`dir`),id:Kp(o),type:`button`,onClick(e){e.defaultPrevented||(e.stopPropagation(),r({type:`CLOSE`}))}})}}}var rm=di({props({props:e,scope:t}){let n=e.role===`alertdialog`,r=n?()=>$p(t):void 0,i=typeof e.modal!=`boolean`||e.modal;return{role:`dialog`,modal:i,trapFocus:i,preventScroll:i,closeOnInteractOutside:i&&!n,closeOnEscape:!0,restoreFocus:!0,initialFocusEl:r,...e}},initialState({prop:e}){return e(`open`)||e(`defaultOpen`)?`open`:`closed`},context({bindable:e,prop:t,scope:n}){return{rendered:e(()=>({defaultValue:{title:!0,description:!0}})),triggerValue:e(()=>({defaultValue:t(`defaultTriggerValue`)??null,value:t(`triggerValue`),onChange(e){let r=t(`onTriggerValueChange`);r&&r({value:e,triggerElement:tm(n,e)})}}))}},watch({track:e,action:t,prop:n}){e([()=>n(`open`)],()=>{t([`toggleVisibility`])})},states:{open:{entry:[`checkRenderedElements`,`setInitialFocus`],effects:[`trackDismissableElement`,`trapFocus`,`preventScroll`,`hideContentBelow`],on:{"CONTROLLED.CLOSE":{target:`closed`},CLOSE:[{guard:`isOpenControlled`,actions:[`invokeOnClose`]},{target:`closed`,actions:[`invokeOnClose`]}],TOGGLE:[{guard:`isOpenControlled`,actions:[`invokeOnClose`]},{target:`closed`,actions:[`invokeOnClose`]}],"TRIGGER_VALUE.SET":{actions:[`setTriggerValue`]}}},closed:{on:{"CONTROLLED.OPEN":{target:`open`},OPEN:[{guard:`isOpenControlled`,actions:[`invokeOnOpen`,`setTriggerValue`]},{target:`open`,actions:[`invokeOnOpen`,`setTriggerValue`]}],TOGGLE:[{guard:`isOpenControlled`,actions:[`invokeOnOpen`,`setTriggerValue`]},{target:`open`,actions:[`invokeOnOpen`,`setTriggerValue`]}],"TRIGGER_VALUE.SET":{actions:[`setTriggerValue`]}}}},implementations:{guards:{isOpenControlled:({prop:e})=>e(`open`)!=null},effects:{trackDismissableElement({scope:e,send:t,prop:n}){return Fl(()=>qp(e),{type:`dialog`,defer:!0,pointerBlocking:n(`modal`),layerStyleTargets:[()=>Yp(e),()=>Jp(e)],exclude:[Xp(e),...em(e)].filter(Boolean),onInteractOutside(e){n(`onInteractOutside`)?.(e),n(`closeOnInteractOutside`)||e.preventDefault()},persistentElements:n(`persistentElements`),onFocusOutside:n(`onFocusOutside`),onPointerDownOutside:n(`onPointerDownOutside`),onRequestDismiss:n(`onRequestDismiss`),onEscapeKeyDown(e){n(`onEscapeKeyDown`)?.(e),n(`closeOnEscape`)||e.preventDefault()},onDismiss(){t({type:`CLOSE`,src:`interact-outside`})}})},preventScroll({scope:e,prop:t}){if(t(`preventScroll`))return ru(e.getDoc())},trapFocus({scope:e,prop:t,context:n}){return t(`trapFocus`)?Xl(()=>qp(e),{preventScroll:!0,returnFocusOnDeactivate:!!t(`restoreFocus`),initialFocus:()=>yo({root:qp(e),getInitialEl:t(`initialFocusEl`)}),setReturnFocus:r=>{let i=t(`finalFocusEl`)?.();if(i)return i;let a=n.get(`triggerValue`);if(a){let t=tm(e,a);if(t)return t}return em(e)[0]||r},getShadowRoot:!0}):void 0},hideContentBelow({scope:e,prop:t}){return t(`modal`)?ol(()=>[qp(e)],{defer:!0}):void 0}},actions:{setInitialFocus({prop:e,scope:t}){e(`trapFocus`)||So(()=>{yo({root:qp(t),getInitialEl:e(`initialFocusEl`)})?.focus({preventScroll:!0})})},checkRenderedElements({context:e,scope:t}){So(()=>{e.set(`rendered`,{title:!!Zp(t),description:!!Qp(t)})})},invokeOnClose({prop:e}){e(`onOpenChange`)?.({open:!1})},invokeOnOpen({prop:e}){e(`onOpenChange`)?.({open:!0})},setTriggerValue({context:e,event:t}){t.value!==void 0&&e.set(`triggerValue`,t.value)},toggleVisibility({prop:e,send:t,event:n}){t({type:e(`open`)?`CONTROLLED.OPEN`:`CONTROLLED.CLOSE`,previousEvent:n})}}}}),im=H(`editable`).parts(`root`,`area`,`label`,`preview`,`input`,`editTrigger`,`submitTrigger`,`cancelTrigger`,`control`);im.build();var am=H(`field`).parts(`root`,`errorText`,`helperText`,`input`,`label`,`select`,`textarea`,`requiredIndicator`),om=am.build(),sm=H(`fieldset`).parts(`root`,`errorText`,`helperText`,`legend`);sm.build();var cm=H(`file-upload`).parts(`root`,`dropzone`,`item`,`itemDeleteTrigger`,`itemGroup`,`itemName`,`itemPreview`,`itemPreviewImage`,`itemSizeText`,`label`,`trigger`,`clearTrigger`);cm.build();var lm=H(`floating-panel`).parts(`trigger`,`positioner`,`content`,`header`,`body`,`title`,`resizeTrigger`,`dragTrigger`,`stageTrigger`,`closeTrigger`,`control`);lm.build();var um=H(`hoverCard`).parts(`arrow`,`arrowTip`,`trigger`,`positioner`,`content`);um.build();var dm=H(`listbox`).parts(`label`,`input`,`item`,`itemText`,`itemIndicator`,`itemGroup`,`itemGroupLabel`,`content`,`root`,`valueText`);dm.build();var fm=dm.extendWith(`empty`),pm=H(`marquee`).parts(`root`,`viewport`,`content`,`edge`,`item`);pm.build();var mm=H(`menu`).parts(`arrow`,`arrowTip`,`content`,`contextTrigger`,`indicator`,`item`,`itemGroup`,`itemGroupLabel`,`itemIndicator`,`itemText`,`positioner`,`separator`,`trigger`,`triggerItem`);mm.build();var hm=H(`numberInput`).parts(`root`,`label`,`input`,`control`,`valueText`,`incrementTrigger`,`decrementTrigger`,`scrubber`);hm.build();var gm=H(`pinInput`).parts(`root`,`label`,`input`,`control`);gm.build();var _m=H(`popover`).parts(`arrow`,`arrowTip`,`anchor`,`trigger`,`indicator`,`positioner`,`content`,`title`,`description`,`closeTrigger`);_m.build();var vm=H(`progress`).parts(`root`,`label`,`track`,`range`,`valueText`,`view`,`circle`,`circleTrack`,`circleRange`);vm.build();var ym=H(`qr-code`).parts(`root`,`frame`,`pattern`,`overlay`,`downloadTrigger`);ym.build();var bm=H(`radio-group`).parts(`root`,`label`,`item`,`itemText`,`itemControl`,`indicator`);bm.build();var xm=H(`rating-group`).parts(`root`,`label`,`item`,`control`);xm.build();var Sm=H(`scroll-area`).parts(`root`,`viewport`,`content`,`scrollbar`,`thumb`,`corner`);Sm.build();var Cm=bm.rename(`segment-group`);Cm.build();var wm=H(`select`).parts(`label`,`positioner`,`trigger`,`indicator`,`clearTrigger`,`item`,`itemText`,`itemIndicator`,`itemGroup`,`itemGroupLabel`,`list`,`content`,`root`,`control`,`valueText`),Tm=wm.build(),Em=e=>new Ep(e);Em.empty=()=>new Ep({items:[]});var Dm=e=>e.ids?.root??`select:${e.id}`,Om=e=>e.ids?.content??`select:${e.id}:content`,km=e=>e.ids?.trigger??`select:${e.id}:trigger`,Am=e=>e.ids?.clearTrigger??`select:${e.id}:clear-trigger`,jm=e=>e.ids?.label??`select:${e.id}:label`,Mm=e=>e.ids?.control??`select:${e.id}:control`,Nm=(e,t)=>e.ids?.item?.(t)??`select:${e.id}:option:${t}`,Pm=e=>e.ids?.hiddenSelect??`select:${e.id}:select`,Fm=e=>e.ids?.positioner??`select:${e.id}:positioner`,Im=(e,t)=>e.ids?.itemGroup?.(t)??`select:${e.id}:optgroup:${t}`,Lm=(e,t)=>e.ids?.itemGroupLabel?.(t)??`select:${e.id}:optgroup-label:${t}`,Rm=e=>e.getById(Pm(e)),zm=e=>e.getById(Om(e)),Bm=e=>e.getById(km(e)),Vm=e=>e.getById(Am(e)),Hm=e=>e.getById(Fm(e)),Um=(e,t)=>t==null?null:e.getById(Nm(e,t)),Wm={clearTriggerLabel:`Clear value`};function Gm(e,t){let{context:n,prop:r,scope:i,state:a,computed:o,send:s}=e,c=Sr(Wm,r(`translations`)),l=r(`disabled`)||n.get(`fieldsetDisabled`),u=!!r(`invalid`),d=!!r(`required`),f=!!r(`readOnly`),p=r(`composite`),m=r(`collection`),h=a.hasTag(`open`),g=a.matches(`focused`),_=n.get(`highlightedValue`),v=n.get(`highlightedItem`),y=o(`selectedItems`),b=n.get(`currentPlacement`),x=b?tp(b):void 0,S=o(`isTypingAhead`),C=o(`isInteractive`),w=_?Nm(i,_):void 0;function T(e){let t=m.getItemDisabled(e.item),r=m.getItemValue(e.item);return kr(r,()=>`[zag-js] No value found for item ${JSON.stringify(e.item)}`),{value:r,disabled:!!(l||t),highlighted:_===r,selected:n.get(`value`).includes(r)}}let E=bp({...r(`positioning`),placement:b});return{open:h,focused:g,empty:n.get(`value`).length===0,highlightedItem:v,highlightedValue:_,selectedItems:y,hasSelectedItems:o(`hasSelectedItems`),value:n.get(`value`),valueAsString:o(`valueAsString`),collection:m,multiple:!!r(`multiple`),disabled:!!l,reposition(e={}){s({type:`POSITIONING.SET`,options:e})},focus(){Bm(i)?.focus({preventScroll:!0})},setOpen(e){a.hasTag(`open`)!==e&&s({type:e?`OPEN`:`CLOSE`})},selectValue(e){s({type:`ITEM.SELECT`,value:e})},setValue(e){s({type:`VALUE.SET`,value:e})},selectAll(){s({type:`VALUE.SET`,value:m.getValues()})},setHighlightValue(e){s({type:`HIGHLIGHTED_VALUE.SET`,value:e})},clearHighlightValue(){s({type:`HIGHLIGHTED_VALUE.CLEAR`})},clearValue(e){s(e?{type:`ITEM.CLEAR`,value:e}:{type:`VALUE.CLEAR`})},getItemState:T,getRootProps(){return t.element({...Tm.root.attrs,dir:r(`dir`),id:Dm(i),"data-invalid":R(u),"data-readonly":R(f)})},getLabelProps(){return t.label({dir:r(`dir`),id:jm(i),...Tm.label.attrs,"data-disabled":R(l),"data-invalid":R(u),"data-readonly":R(f),"data-required":R(d),htmlFor:Pm(i),onClick(e){e.defaultPrevented||l||Bm(i)?.focus({preventScroll:!0})}})},getControlProps(){return t.element({...Tm.control.attrs,dir:r(`dir`),id:Mm(i),"data-state":h?`open`:`closed`,"data-focus":R(g),"data-disabled":R(l),"data-invalid":R(u)})},getValueTextProps(){return t.element({...Tm.valueText.attrs,dir:r(`dir`),"data-disabled":R(l),"data-invalid":R(u),"data-focus":R(g)})},getTriggerProps(){return t.button({id:km(i),disabled:l,dir:r(`dir`),type:`button`,role:`combobox`,"aria-controls":Om(i),"aria-expanded":h,"aria-haspopup":`listbox`,"data-state":h?`open`:`closed`,"aria-invalid":u,"aria-required":d,"aria-labelledby":jm(i),...Tm.trigger.attrs,"data-disabled":R(l),"data-invalid":R(u),"data-readonly":R(f),"data-placement":b,"data-side":x,"data-placeholder-shown":R(!o(`hasSelectedItems`)),onClick(e){C&&(e.defaultPrevented||s({type:`TRIGGER.CLICK`}))},onFocus(){s({type:`TRIGGER.FOCUS`})},onBlur(){s({type:`TRIGGER.BLUR`})},onKeyDown(e){if(e.defaultPrevented||!C)return;let t={ArrowUp(){s({type:`TRIGGER.ARROW_UP`})},ArrowDown(e){s({type:e.altKey?`OPEN`:`TRIGGER.ARROW_DOWN`})},ArrowLeft(){s({type:`TRIGGER.ARROW_LEFT`})},ArrowRight(){s({type:`TRIGGER.ARROW_RIGHT`})},Home(){s({type:`TRIGGER.HOME`})},End(){s({type:`TRIGGER.END`})},Enter(){s({type:`TRIGGER.ENTER`})},Space(e){s(S?{type:`TRIGGER.TYPEAHEAD`,key:e.key}:{type:`TRIGGER.ENTER`})}}[Ha(e,{dir:r(`dir`),orientation:`vertical`})];if(t){t(e),e.preventDefault();return}as.isValidEvent(e)&&(s({type:`TRIGGER.TYPEAHEAD`,key:e.key}),e.preventDefault())}})},getIndicatorProps(){return t.element({...Tm.indicator.attrs,dir:r(`dir`),"aria-hidden":!0,"data-state":h?`open`:`closed`,"data-disabled":R(l),"data-invalid":R(u),"data-readonly":R(f)})},getItemProps(e){let n=T(e);return t.element({id:Nm(i,n.value),role:`option`,...Tm.item.attrs,dir:r(`dir`),"data-value":n.value,"aria-selected":n.selected,"data-state":n.selected?`checked`:`unchecked`,"data-highlighted":R(n.highlighted),"data-disabled":R(n.disabled),"aria-disabled":Si(n.disabled),onPointerMove(e){n.disabled||e.pointerType!==`mouse`||Ou()===`pointer`&&n.value!==_&&s({type:`ITEM.POINTER_MOVE`,value:n.value})},onClick(e){e.defaultPrevented||n.disabled||s({type:`ITEM.CLICK`,src:`pointerup`,value:n.value})},onPointerLeave(t){n.disabled||e.persistFocus||t.pointerType===`mouse`&&Ou()===`pointer`&&s({type:`ITEM.POINTER_LEAVE`})}})},getItemTextProps(e){let n=T(e);return t.element({...Tm.itemText.attrs,"data-state":n.selected?`checked`:`unchecked`,"data-disabled":R(n.disabled),"data-highlighted":R(n.highlighted)})},getItemIndicatorProps(e){let n=T(e);return t.element({"aria-hidden":!0,...Tm.itemIndicator.attrs,"data-state":n.selected?`checked`:`unchecked`,hidden:!n.selected})},getItemGroupLabelProps(e){let{htmlFor:n}=e;return t.element({...Tm.itemGroupLabel.attrs,id:Lm(i,n),dir:r(`dir`),role:`presentation`})},getItemGroupProps(e){let{id:n}=e;return t.element({...Tm.itemGroup.attrs,"data-disabled":R(l),id:Im(i,n),"aria-labelledby":Lm(i,n),role:`group`,dir:r(`dir`)})},getClearTriggerProps(){return t.button({...Tm.clearTrigger.attrs,id:Am(i),type:`button`,"aria-label":c.clearTriggerLabel,"data-invalid":R(u),disabled:l,hidden:!o(`hasSelectedItems`),dir:r(`dir`),onClick(e){e.defaultPrevented||s({type:`CLEAR.CLICK`})}})},getHiddenSelectProps(){let e=n.get(`value`),a=r(`multiple`)?e:e?.[0],o=e=>{eo(Ua(e))||s({type:`VALUE.SET`,value:Km(e.currentTarget)})};return t.select({name:r(`name`),form:r(`form`),disabled:l,multiple:r(`multiple`),required:r(`required`),"aria-hidden":!0,id:Pm(i),defaultValue:a,style:ss,tabIndex:-1,autoComplete:r(`autoComplete`),onChange:o,onInput:o,onFocus(){Bm(i)?.focus({preventScroll:!0})},"aria-labelledby":jm(i)})},getPositionerProps(){return t.element({...Tm.positioner.attrs,dir:r(`dir`),id:Fm(i),style:E.floating})},getContentProps(){return t.element({hidden:!h,dir:r(`dir`),id:Om(i),role:p?`listbox`:`dialog`,...Tm.content.attrs,"data-state":h?`open`:`closed`,"data-placement":b,"data-side":x,"data-activedescendant":w,"aria-activedescendant":p?w:void 0,"aria-multiselectable":r(`multiple`)&&p?!0:void 0,"aria-labelledby":jm(i),tabIndex:0,onKeyDown(e){if(!C||!Ki(e.currentTarget,z(e)))return;if(e.key===`Tab`&&!bo(e)){e.preventDefault();return}let t={ArrowUp(){s({type:`CONTENT.ARROW_UP`})},ArrowDown(){s({type:`CONTENT.ARROW_DOWN`})},Home(){s({type:`CONTENT.HOME`})},End(){s({type:`CONTENT.END`})},Enter(){s({type:`ITEM.CLICK`,src:`keydown.enter`})},Space(e){S?s({type:`CONTENT.TYPEAHEAD`,key:e.key}):t.Enter?.(e)}},n=t[Ha(e)];if(n){n(e),e.preventDefault();return}Ui(z(e))||as.isValidEvent(e)&&(s({type:`CONTENT.TYPEAHEAD`,key:e.key}),e.preventDefault())}})},getListProps(){return t.element({...Tm.list.attrs,tabIndex:0,role:p?void 0:`listbox`,"aria-labelledby":km(i),"aria-activedescendant":p?void 0:w,"aria-multiselectable":!p&&r(`multiple`)?!0:void 0})}}}var Km=e=>e.multiple?Array.from(e.selectedOptions,e=>e.value):e.value?[e.value]:[],{and:qm,not:Jm,or:Ym}=ui(),Xm=di({props({props:e}){return{loopFocus:!1,closeOnSelect:!e.multiple,composite:!0,defaultValue:[],...e,collection:e.collection??Em.empty(),positioning:{placement:`bottom-start`,gutter:8,...e.positioning}}},context({prop:e,bindable:t,getContext:n}){let r=e(`value`)??e(`defaultValue`)??[],i=e(`collection`).findMany(r);return{value:t(()=>({defaultValue:e(`defaultValue`),value:e(`value`),isEqual:Yn,onChange(t){let r=n(),i=e(`collection`),a=Mp({values:t,collection:i,selectedItemMap:r.get(`selectedItemMap`)}),o=e(`value`)??t,s=o===t?a:Mp({values:o,collection:i,selectedItemMap:a.nextSelectedItemMap});return r.set(`selectedItemMap`,s.nextSelectedItemMap),e(`onValueChange`)?.({value:t,items:a.selectedItems})}})),highlightedValue:t(()=>({defaultValue:e(`defaultHighlightedValue`)||null,value:e(`highlightedValue`),onChange(t){e(`onHighlightChange`)?.({highlightedValue:t,highlightedItem:e(`collection`).find(t),highlightedIndex:e(`collection`).indexOf(t)})}})),currentPlacement:t(()=>({defaultValue:void 0})),fieldsetDisabled:t(()=>({defaultValue:!1})),highlightedItem:t(()=>({defaultValue:null})),selectedItemMap:t(()=>({defaultValue:Np({selectedItems:i,collection:e(`collection`)})}))}},refs(){return{typeahead:{...as.defaultOptions}}},computed:{hasSelectedItems:({context:e})=>e.get(`value`).length>0,isTypingAhead:({refs:e})=>e.get(`typeahead`).keysSoFar!==``,isDisabled:({prop:e,context:t})=>!!e(`disabled`)||!!t.get(`fieldsetDisabled`),isInteractive:({prop:e})=>!(e(`disabled`)||e(`readOnly`)),selectedItems:({context:e,prop:t})=>Ap({values:e.get(`value`),collection:t(`collection`),selectedItemMap:e.get(`selectedItemMap`)}),valueAsString:({computed:e,prop:t})=>t(`collection`).stringifyItems(e(`selectedItems`))},initialState({prop:e}){return e(`open`)||e(`defaultOpen`)?`open`:`idle`},entry:[`syncSelectElement`],watch({context:e,prop:t,track:n,action:r}){n([()=>e.get(`value`).toString()],()=>{r([`syncSelectedItems`,`syncSelectElement`,`dispatchChangeEvent`])}),n([()=>t(`open`)],()=>{r([`toggleVisibility`])}),n([()=>e.get(`highlightedValue`)],()=>{r([`syncHighlightedItem`])}),n([()=>t(`collection`).toString()],()=>{r([`syncCollection`])})},on:{"HIGHLIGHTED_VALUE.SET":{actions:[`setHighlightedItem`]},"HIGHLIGHTED_VALUE.CLEAR":{actions:[`clearHighlightedItem`]},"ITEM.SELECT":{actions:[`selectItem`]},"ITEM.CLEAR":{actions:[`clearItem`]},"VALUE.SET":{actions:[`setSelectedItems`]},"VALUE.CLEAR":{actions:[`clearSelectedItems`]},"CLEAR.CLICK":{actions:[`clearSelectedItems`,`focusTriggerEl`]}},effects:[`trackFormControlState`],states:{idle:{tags:[`closed`],on:{"CONTROLLED.OPEN":[{guard:`isTriggerClickEvent`,target:`open`,actions:[`setInitialFocus`,`highlightFirstSelectedItem`]},{target:`open`,actions:[`setInitialFocus`]}],"TRIGGER.CLICK":[{guard:`isOpenControlled`,actions:[`invokeOnOpen`]},{target:`open`,actions:[`invokeOnOpen`,`setInitialFocus`,`highlightFirstSelectedItem`]}],"TRIGGER.FOCUS":{target:`focused`},OPEN:[{guard:`isOpenControlled`,actions:[`invokeOnOpen`]},{target:`open`,actions:[`setInitialFocus`,`invokeOnOpen`]}]}},focused:{tags:[`closed`],on:{"CONTROLLED.OPEN":[{guard:`isTriggerClickEvent`,target:`open`,actions:[`setInitialFocus`,`highlightFirstSelectedItem`]},{guard:`isTriggerArrowUpEvent`,target:`open`,actions:[`setInitialFocus`,`highlightComputedLastItem`]},{guard:Ym(`isTriggerArrowDownEvent`,`isTriggerEnterEvent`),target:`open`,actions:[`setInitialFocus`,`highlightComputedFirstItem`]},{target:`open`,actions:[`setInitialFocus`]}],OPEN:[{guard:`isOpenControlled`,actions:[`invokeOnOpen`]},{target:`open`,actions:[`setInitialFocus`,`invokeOnOpen`]}],"TRIGGER.BLUR":{target:`idle`},"TRIGGER.CLICK":[{guard:`isOpenControlled`,actions:[`invokeOnOpen`]},{target:`open`,actions:[`setInitialFocus`,`invokeOnOpen`,`highlightFirstSelectedItem`]}],"TRIGGER.ENTER":[{guard:`isOpenControlled`,actions:[`invokeOnOpen`]},{target:`open`,actions:[`setInitialFocus`,`invokeOnOpen`,`highlightComputedFirstItem`]}],"TRIGGER.ARROW_UP":[{guard:`isOpenControlled`,actions:[`invokeOnOpen`]},{target:`open`,actions:[`setInitialFocus`,`invokeOnOpen`,`highlightComputedLastItem`]}],"TRIGGER.ARROW_DOWN":[{guard:`isOpenControlled`,actions:[`invokeOnOpen`]},{target:`open`,actions:[`setInitialFocus`,`invokeOnOpen`,`highlightComputedFirstItem`]}],"TRIGGER.ARROW_LEFT":[{guard:qm(Jm(`multiple`),`hasSelectedItems`),actions:[`selectPreviousItem`]},{guard:Jm(`multiple`),actions:[`selectLastItem`]}],"TRIGGER.ARROW_RIGHT":[{guard:qm(Jm(`multiple`),`hasSelectedItems`),actions:[`selectNextItem`]},{guard:Jm(`multiple`),actions:[`selectFirstItem`]}],"TRIGGER.HOME":{guard:Jm(`multiple`),actions:[`selectFirstItem`]},"TRIGGER.END":{guard:Jm(`multiple`),actions:[`selectLastItem`]},"TRIGGER.TYPEAHEAD":{guard:Jm(`multiple`),actions:[`selectMatchingItem`]}}},open:{tags:[`open`],exit:[`scrollContentToTop`],effects:[`trackDismissableElement`,`trackFocusVisible`,`computePlacement`,`scrollToHighlightedItem`],on:{"CONTROLLED.CLOSE":[{guard:`restoreFocus`,target:`focused`,actions:[`focusTriggerEl`,`clearHighlightedItem`]},{target:`idle`,actions:[`clearHighlightedItem`]}],CLOSE:[{guard:`isOpenControlled`,actions:[`invokeOnClose`]},{guard:`restoreFocus`,target:`focused`,actions:[`invokeOnClose`,`focusTriggerEl`,`clearHighlightedItem`]},{target:`idle`,actions:[`invokeOnClose`,`clearHighlightedItem`]}],"TRIGGER.CLICK":[{guard:`isOpenControlled`,actions:[`invokeOnClose`]},{target:`focused`,actions:[`invokeOnClose`,`clearHighlightedItem`]}],"ITEM.CLICK":[{guard:qm(`closeOnSelect`,`isOpenControlled`),actions:[`selectHighlightedItem`,`invokeOnClose`]},{guard:`closeOnSelect`,target:`focused`,actions:[`selectHighlightedItem`,`invokeOnClose`,`focusTriggerEl`,`clearHighlightedItem`]},{actions:[`selectHighlightedItem`]}],"CONTENT.HOME":{actions:[`highlightFirstItem`]},"CONTENT.END":{actions:[`highlightLastItem`]},"CONTENT.ARROW_DOWN":[{guard:qm(`hasHighlightedItem`,`loop`,`isLastItemHighlighted`),actions:[`highlightFirstItem`]},{guard:`hasHighlightedItem`,actions:[`highlightNextItem`]},{actions:[`highlightFirstItem`]}],"CONTENT.ARROW_UP":[{guard:qm(`hasHighlightedItem`,`loop`,`isFirstItemHighlighted`),actions:[`highlightLastItem`]},{guard:`hasHighlightedItem`,actions:[`highlightPreviousItem`]},{actions:[`highlightLastItem`]}],"CONTENT.TYPEAHEAD":{actions:[`highlightMatchingItem`]},"ITEM.POINTER_MOVE":{actions:[`highlightItem`]},"ITEM.POINTER_LEAVE":{actions:[`clearHighlightedItem`]},"POSITIONING.SET":{actions:[`reposition`]}}}},implementations:{guards:{loop:({prop:e})=>!!e(`loopFocus`),multiple:({prop:e})=>!!e(`multiple`),hasSelectedItems:({computed:e})=>!!e(`hasSelectedItems`),hasHighlightedItem:({context:e})=>e.get(`highlightedValue`)!=null,isFirstItemHighlighted:({context:e,prop:t})=>e.get(`highlightedValue`)===t(`collection`).firstValue,isLastItemHighlighted:({context:e,prop:t})=>e.get(`highlightedValue`)===t(`collection`).lastValue,closeOnSelect:({prop:e,event:t})=>!!(t.closeOnSelect??e(`closeOnSelect`)),restoreFocus:({event:e})=>Zm(e),isOpenControlled:({prop:e})=>e(`open`)!==void 0,isTriggerClickEvent:({event:e})=>e.previousEvent?.type===`TRIGGER.CLICK`,isTriggerEnterEvent:({event:e})=>e.previousEvent?.type===`TRIGGER.ENTER`,isTriggerArrowUpEvent:({event:e})=>e.previousEvent?.type===`TRIGGER.ARROW_UP`,isTriggerArrowDownEvent:({event:e})=>e.previousEvent?.type===`TRIGGER.ARROW_DOWN`},effects:{trackFocusVisible({scope:e}){return ju({root:e.getRootNode?.()})},trackFormControlState({context:e,scope:t}){return Qa(Rm(t),{onFieldsetDisabledChange(t){e.set(`fieldsetDisabled`,t)},onFormReset(){let t=e.initial(`value`);e.set(`value`,t)}})},trackDismissableElement({scope:e,send:t,prop:n}){let r=()=>zm(e),i=!0;return Fl(r,{type:`listbox`,defer:!0,exclude:[Bm(e),Vm(e)],onFocusOutside:n(`onFocusOutside`),onPointerDownOutside:n(`onPointerDownOutside`),onInteractOutside(e){n(`onInteractOutside`)?.(e),i=!(e.detail.focusable||e.detail.contextmenu)},onDismiss(){t({type:`CLOSE`,src:`interact-outside`,restoreFocus:i})}})},computePlacement({context:e,prop:t,scope:n}){let r=t(`positioning`);return e.set(`currentPlacement`,r.placement),vp(()=>Bm(n),()=>Hm(n),{defer:!0,...r,onComplete(t){e.set(`currentPlacement`,t.placement)}})},scrollToHighlightedItem({context:e,prop:t,scope:n}){let r=r=>{let i=e.get(`highlightedValue`);if(i==null||Ou()===`pointer`)return;let a=zm(n),o=t(`scrollToIndexFn`);if(o){let e=t(`collection`).indexOf(i);o?.({index:e,immediate:r,getElement:()=>Um(n,i)});return}Xo(Um(n,i),{rootEl:a,block:`nearest`})};return So(()=>{ku(`virtual`),r(!0)}),Eo(()=>zm(n),{defer:!0,attributes:[`data-activedescendant`],callback(){r(!1)}})}},actions:{reposition({context:e,prop:t,scope:n,event:r}){vp(Bm(n),()=>Hm(n),{...t(`positioning`),...r.options,defer:!0,listeners:!1,onComplete(t){e.set(`currentPlacement`,t.placement)}})},toggleVisibility({send:e,prop:t,event:n}){e({type:t(`open`)?`CONTROLLED.OPEN`:`CONTROLLED.CLOSE`,previousEvent:n})},highlightPreviousItem({context:e,prop:t}){let n=e.get(`highlightedValue`);if(n==null)return;let r=t(`collection`).getPreviousValue(n,1,t(`loopFocus`));r!=null&&e.set(`highlightedValue`,r)},highlightNextItem({context:e,prop:t}){let n=e.get(`highlightedValue`);if(n==null)return;let r=t(`collection`).getNextValue(n,1,t(`loopFocus`));r!=null&&e.set(`highlightedValue`,r)},highlightFirstItem({context:e,prop:t}){let n=t(`collection`).firstValue;e.set(`highlightedValue`,n)},highlightLastItem({context:e,prop:t}){let n=t(`collection`).lastValue;e.set(`highlightedValue`,n)},setInitialFocus({scope:e}){So(()=>{yo({root:zm(e)})?.focus({preventScroll:!0})})},focusTriggerEl({event:e,scope:t}){Zm(e)&&So(()=>{Bm(t)?.focus({preventScroll:!0})})},selectHighlightedItem({context:e,prop:t,event:n}){let r=n.value??e.get(`highlightedValue`);r!=null&&t(`collection`).has(r)&&(t(`onSelect`)?.({value:r}),r=t(`deselectable`)&&!t(`multiple`)&&e.get(`value`).includes(r)?null:r,e.set(`value`,e=>r==null?[]:t(`multiple`)?Hn(e,r):[r]))},highlightComputedFirstItem({context:e,prop:t,computed:n}){let r=t(`collection`),i=n(`hasSelectedItems`)?r.sort(e.get(`value`))[0]:r.firstValue;e.set(`highlightedValue`,i)},highlightComputedLastItem({context:e,prop:t,computed:n}){let r=t(`collection`),i=n(`hasSelectedItems`)?r.sort(e.get(`value`))[0]:r.lastValue;e.set(`highlightedValue`,i)},highlightFirstSelectedItem({context:e,prop:t,computed:n}){if(!n(`hasSelectedItems`))return;let r=t(`collection`).sort(e.get(`value`))[0];e.set(`highlightedValue`,r)},highlightItem({context:e,event:t}){e.set(`highlightedValue`,t.value)},highlightMatchingItem({context:e,prop:t,event:n,refs:r}){let i=t(`collection`).search(n.key,{state:r.get(`typeahead`),currentValue:e.get(`highlightedValue`)});i!=null&&e.set(`highlightedValue`,i)},setHighlightedItem({context:e,event:t}){e.set(`highlightedValue`,t.value)},clearHighlightedItem({context:e}){e.set(`highlightedValue`,null)},selectItem({context:e,prop:t,event:n}){t(`onSelect`)?.({value:n.value});let r=t(`deselectable`)&&!t(`multiple`)&&e.get(`value`).includes(n.value)?null:n.value;e.set(`value`,e=>r==null?[]:t(`multiple`)?Hn(e,r):[r])},clearItem({context:e,event:t}){e.set(`value`,e=>e.filter(e=>e!==t.value))},setSelectedItems({context:e,event:t}){e.set(`value`,t.value)},clearSelectedItems({context:e}){e.set(`value`,[])},selectPreviousItem({context:e,prop:t}){let[n]=e.get(`value`),r=t(`collection`).getPreviousValue(n);r&&e.set(`value`,[r])},selectNextItem({context:e,prop:t}){let[n]=e.get(`value`),r=t(`collection`).getNextValue(n);r&&e.set(`value`,[r])},selectFirstItem({context:e,prop:t}){let n=t(`collection`).firstValue;n&&e.set(`value`,[n])},selectLastItem({context:e,prop:t}){let n=t(`collection`).lastValue;n&&e.set(`value`,[n])},selectMatchingItem({context:e,prop:t,event:n,refs:r}){let i=t(`collection`).search(n.key,{state:r.get(`typeahead`),currentValue:e.get(`value`)[0]});i!=null&&e.set(`value`,[i])},scrollContentToTop({prop:e,scope:t}){if(e(`scrollToIndexFn`)){let n=e(`collection`).firstValue;e(`scrollToIndexFn`)?.({index:0,immediate:!0,getElement:()=>Um(t,n)})}else zm(t)?.scrollTo(0,0)},invokeOnOpen({prop:e,context:t}){e(`onOpenChange`)?.({open:!0,value:t.get(`value`)})},invokeOnClose({prop:e,context:t}){e(`onOpenChange`)?.({open:!1,value:t.get(`value`)})},syncSelectElement({context:e,prop:t,scope:n}){let r=Rm(n);if(r){if(e.get(`value`).length===0&&!t(`multiple`)){r.selectedIndex=-1;return}for(let t of r.options)t.selected=e.get(`value`).includes(t.value)}},syncCollection({context:e,prop:t}){let n=t(`collection`),r=n.find(e.get(`highlightedValue`));r&&e.set(`highlightedItem`,r);let i=Mp({values:e.get(`value`),collection:n,selectedItemMap:e.get(`selectedItemMap`)});e.set(`selectedItemMap`,i.nextSelectedItemMap)},syncSelectedItems({context:e,prop:t}){let n=Mp({values:e.get(`value`),collection:t(`collection`),selectedItemMap:e.get(`selectedItemMap`)});e.set(`selectedItemMap`,n.nextSelectedItemMap)},syncHighlightedItem({context:e,prop:t}){let n=t(`collection`),r=e.get(`highlightedValue`),i=r?n.find(r):null;e.set(`highlightedItem`,i)},dispatchChangeEvent({scope:e}){queueMicrotask(()=>{let t=Rm(e);if(!t)return;let n=new(e.getWin()).Event(`change`,{bubbles:!0,composed:!0});t.dispatchEvent(to(n))})}}}});function Zm(e){let t=e.restoreFocus??e.previousEvent?.restoreFocus;return t==null||!!t}var Qm=H(`slider`).parts(`root`,`label`,`thumb`,`valueText`,`track`,`range`,`control`,`markerGroup`,`marker`,`draggingIndicator`);Qm.build();var $m=Object.defineProperty,eh=(e,t,n)=>t in e?$m(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,th=(e,t,n)=>eh(e,typeof t==`symbol`?t:t+``,n),nh=H(`splitter`).parts(`root`,`panel`,`resizeTrigger`,`resizeTriggerIndicator`),rh=nh.build(),ih=e=>e.ids?.root??`splitter:${e.id}`,ah=(e,t)=>e.ids?.resizeTrigger?.(t)??`splitter:${e.id}:splitter:${t}`,oh=(e,t)=>e.ids?.panel?.(t)??`splitter:${e.id}:panel:${t}`,sh=e=>`splitter:${e.id}:global-cursor`,ch=e=>e.getById(ih(e)),lh=(e,t)=>t==null?null:e.getById(ah(e,t)),uh=e=>ji(e)&&e.dataset.part===`panel`?e.dataset.id:void 0,dh=e=>{let t=e?.previousElementSibling??null;for(;t;){let e=uh(t);if(e)return e;t=t.previousElementSibling}},fh=e=>{let t=e?.nextElementSibling??null;for(;t;){let e=uh(t);if(e)return e;t=t.nextElementSibling}},ph=(e,t)=>{let[n,r]=t.split(`:`);if(n&&r)return t;let i=lh(e,t),a=n||dh(i),o=r||fh(i);return a&&o?`${a}:${o}`:null},mh=(e,t)=>{let n=t?`col-resize`:`row-resize`;return e.isAtMin&&(n=t?`e-resize`:`s-resize`),e.isAtMax&&(n=t?`w-resize`:`n-resize`),n},hh=e=>Ho(ch(e),`[role=separator]${Ei(ih(e))}`),gh=e=>e.getDoc().getElementById(sh(e)),_h=(e,t,n,r)=>{let i=gh(e),a=`* { cursor: ${mh(t,n)} !important; }`;if(i)i.textContent=a;else{let t=e.getDoc().createElement(`style`);r&&(t.nonce=r),t.id=sh(e),t.textContent=a,e.getDoc().head.appendChild(t)}},vh=e=>{gh(e)?.remove()};function yh({size:e,panels:t,pivotIndices:n}){let r=0,i=100,a=0,o=0,s=n[0];return kr(s,()=>`No pivot index found`),t.forEach((e,t)=>{let{maxSize:n=100,minSize:c=0}=e;t===s?(r=c,i=n):(a+=c,o+=n)}),{valueMax:Math.min(i,100-a),valueMin:Math.max(r,100-o),valueNow:e[s]}}function bh(e,t,n){let[r,i]=n.split(`:`),a=t.findIndex(e=>e.id===r),o=t.findIndex(e=>e.id===i);if(a===-1||o===-1)return{beforeId:r||void 0,afterId:i||void 0,valueMax:void 0,valueMin:void 0,valueNow:void 0};let{valueMax:s,valueMin:c,valueNow:l}=yh({size:e,panels:t,pivotIndices:[a,o]});return{beforeId:r,afterId:i,valueMax:Math.round(s),valueMin:Math.round(c),valueNow:l==null?void 0:Math.round(l)}}function xh(e,t,n=10){return e.toFixed(n)===t.toFixed(n)?0:e>t?1:-1}function Sh(e,t,n=10){return e==null||t==null?!1:xh(e,t,n)===0}function Ch(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){let i=e[r],a=t[r];if(!Sh(i,a,n))return!1}return!0}var wh=/^(-?\d*\.?\d+)(%|px|em|rem|vw|vh)?$/,Th=/^(-?\d*\.?\d+)%$/;function Eh(e,t){if(!e)return 0;let n=e.getBoundingClientRect();return t===`horizontal`?n.width:n.height}function Dh(e,t){return Eh(e,t)}function Oh(e,t,n){let r=n.ownerDocument.defaultView;if(r)switch(t){case`px`:return e;case`em`:return e*Number.parseFloat(r.getComputedStyle(n).fontSize);case`rem`:return e*Number.parseFloat(r.getComputedStyle(n.ownerDocument.documentElement).fontSize);case`vw`:return e/100*r.innerWidth;case`vh`:return e/100*r.innerHeight;default:return}}function kh(e,t,n){if(e==null)return;if(typeof e==`number`)return e;let r=e.trim().match(wh);if(!r)return;let i=Number.parseFloat(r[1]);if(!Number.isFinite(i))return;let a=r[2];if(a==null||a===`%`)return i;if(!t)return;let o=Eh(t,n);if(o===0)return;let s=Oh(i,a,t);return s==null?void 0:s/o*100}function Ah(e){if(e==null)return;if(typeof e==`number`)return`${e}%`;let t=e.trim();if(Th.test(t))return t;let n=t.match(wh);if(!n)return;let r=Number.parseFloat(n[1]);if(!Number.isFinite(r))return;let i=n[2];return i==null?`${r}%`:`${r}${i}`}function jh({sizes:e,panels:t,rootEl:n,orientation:r}){let i=Array(t.length),a=100,o=0;for(let s=0;s<t.length;s++){let t=kh(e?.[s],n,r);t!=null&&(o++,i[s]=t,a-=t)}for(let e=0;e<t.length;e++){if(i[e]!=null)continue;let n=t.length-o,r=n>0?a/n:0;o++,i[e]=r,a-=r}return i}function Mh(e,t,n){return e.map(e=>({...e,minSize:kh(e.minSize,t,n),maxSize:kh(e.maxSize,t,n),collapsedSize:kh(e.collapsedSize,t,n)}))}function Nh(e,t){let n=e.find(e=>e.id===t);return kr(n,()=>`Panel data not found for id "${t}"`),n}function Ph(e,t){return e.findIndex(e=>e===t||e.id===t.id)}function Fh(e,t){return e.findIndex(e=>e.id===t)}function Ih(e,t,n){let r=Fh(e,t.id),i=r===e.length-1?[r-1,r]:[r,r+1],a=n[r];return{...t,panelSize:a,pivotIndices:i}}function Lh(e){return e.sort((e,t)=>{let n=e.order,r=t.order;return n==null&&r==null?0:n==null?-1:r==null?1:n-r})}function Rh(e){return e.map(e=>e.id).sort().join(`:`)}function zh(e){return e.map(e=>e.id).sort().map(t=>{let n=e.find(e=>e.id===t);return JSON.stringify(n)}).join(`,`)}function Bh({size:e,defaultSize:t,dragState:n,resolvedSizes:r,panels:i,panelIndex:a,horizontal:o,collapsed:s=!1,precision:c=3}){let l=r[a],u=e??t,d=i[a],f,p,m=1,h=o?`Width`:`Height`,g=d?Ah(d.minSize):void 0,_=d?Ah(d.maxSize):void 0,v=s?Ah(d?.collapsedSize??0):g,y=Ah(u);return l==null?y==null?f=`1`:y.endsWith(`%`)?f=Number.parseFloat(y).toPrecision(c):(p=Vh({basis:y,minSize:g,maxSize:_}),f=`0`,m=0):f=i.length===1?`1`:l.toPrecision(c),{flexBasis:p??0,flexGrow:f,flexShrink:m,...v?{[`min${h}`]:v}:{},..._?{[`max${h}`]:_}:{},overflow:`hidden`,pointerEvents:n===null?void 0:`none`}}function Vh({basis:e,minSize:t,maxSize:n}){return`clamp(${t??`0%`}, ${e}, ${n??`100%`})`}function Hh(e,t){let{state:n,send:r,prop:i,computed:a,context:o,scope:s}=e,c=a(`horizontal`),l=n.matches(`dragging`),u=i(`registry`),d=i(`orientation`),f=i(`panels`),p=o.get(`panels`),m=()=>{let e=o.get(`size`);return e.length>0?e:jh({sizes:i(`size`)??i(`defaultSize`),panels:f,rootEl:null,orientation:d})},h=e=>{let t=f.findIndex(t=>t.id===e),n=i(`size`)?.[t],r=i(`defaultSize`)?.[t],a=o.get(`dragState`),s=o.get(`size`),l=p[t],u=s[t],d=!!l?.collapsible&&u!=null&&Sh(u,l.collapsedSize??0);return Bh({size:n,defaultSize:r,dragState:a,resolvedSizes:s,panels:f,panelIndex:t,horizontal:c,collapsed:d})},g=e=>{let[t,n]=e.split(`:`);if(t&&n)return e;if(t){let n=f.findIndex(e=>e.id===t),r=f[n+1];return r?`${t}:${r.id}`:e}if(n){let t=f.findIndex(e=>e.id===n),r=f[t-1];return r?`${r.id}:${n}`:e}return e},_=e=>{let{id:t,disabled:r}=e,i=o.get(`dragState`)?.resizeTriggerId===t;return{dragging:i,focused:i||n.matches(`focused`)&&o.get(`keyboardState`)?.resizeTriggerId===t,disabled:!!r}};return{dragging:l,orientation:d,getPanels(){return f},getPanelById(e){return Nh(f,e)},getItems(){return f.flatMap((e,t,n)=>{let r=n[t+1];return e&&r?[{type:`panel`,id:e.id},{type:`handle`,id:`${e.id}:${r.id}`}]:[{type:`panel`,id:e.id}]})},getSizes(){return m()},setSizes(e){r({type:`SIZE.SET`,size:e})},resetSizes(){r({type:`SIZE.RESET`})},collapsePanel(e){r({type:`PANEL.COLLAPSE`,id:e})},expandPanel(e,t){r({type:`PANEL.EXPAND`,id:e,minSize:t})},resizePanel(e,t){r({type:`PANEL.RESIZE`,id:e,size:t})},getPanelSize(e){let t=o.get(`panels`),n=m(),r=Nh(t,e),{panelSize:i}=Ih(t,r,n);return kr(i!=null,()=>`Panel size not found for panel "${r.id}"`),i},isPanelCollapsed(e){let t=o.get(`panels`),n=m(),r=Nh(t,e),{collapsedSize:i=0,collapsible:a,panelSize:s}=Ih(t,r,n);return kr(s!=null,()=>`Panel size not found for panel "${r.id}"`),a===!0&&Sh(s,i)},isPanelExpanded(e){let t=o.get(`panels`),n=m(),r=Nh(t,e),{collapsedSize:i=0,collapsible:a,panelSize:s}=Ih(t,r,n);return kr(s!=null,()=>`Panel size not found for panel "${r.id}"`),!a||xh(s,i)>0},getLayout(){return Rh(i(`panels`))},getRootProps(){return t.element({...rh.root.attrs,"data-orientation":d,"data-dragging":R(l),id:ih(s),dir:i(`dir`),style:{display:`flex`,flexDirection:c?`row`:`column`,height:`100%`,width:`100%`,overflow:`hidden`}})},getPanelProps(e){let{id:n}=e;return t.element({...rh.panel.attrs,"data-orientation":d,"data-dragging":R(l),dir:i(`dir`),"data-id":n,"data-index":Fh(i(`panels`),n),id:oh(s,n),"data-ownedby":ih(s),style:h(n)})},getResizeTriggerState:_,getResizeTriggerIndicator(e){let n=_(e);return t.element({...rh.resizeTriggerIndicator.attrs,"data-orientation":d,"data-focus":R(n.focused),"data-dragging":R(n.dragging),"data-disabled":R(n.disabled),"data-ownedby":ih(s)})},getResizeTriggerProps(e){let{id:n}=e,a=_(e),o=g(n),l=bh(m(),p,o);return t.element({...rh.resizeTrigger.attrs,dir:i(`dir`),id:ah(s,n),role:`separator`,"data-id":n,"data-ownedby":ih(s),tabIndex:a.disabled?void 0:0,"aria-valuenow":l.valueNow,"aria-valuemin":l.valueMin,"aria-valuemax":l.valueMax,"data-orientation":d,"aria-orientation":d,"aria-controls":l.beforeId&&l.afterId?`${oh(s,l.beforeId)} ${oh(s,l.afterId)}`:void 0,"data-focus":R(a.focused),"data-dragging":R(a.dragging),"data-disabled":R(a.disabled),style:{touchAction:`none`,userSelect:`none`,WebkitUserSelect:`none`,flex:`0 0 auto`,pointerEvents:a.disabled||a.dragging&&!a.focused?`none`:void 0,cursor:a.disabled||u?void 0:c?`col-resize`:`row-resize`,[c?`minHeight`:`minWidth`]:`0`},onPointerDown(e){if(!La(e))return;if(a.disabled){e.preventDefault();return}if(e.currentTarget.focus({preventScroll:!0,focusVisible:!1}),u)return;let t=Wa(e);r({type:`POINTER_DOWN`,id:n,point:t}),e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault(),e.stopPropagation()},onPointerUp(e){a.disabled||e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId)},onPointerOver(){a.disabled||u||r({type:`POINTER_OVER`,id:n})},onPointerLeave(){a.disabled||u||r({type:`POINTER_LEAVE`,id:n})},onBlur(){a.disabled||r({type:`BLUR`})},onFocus(){a.disabled||r({type:`FOCUS`,id:n})},onKeyDown(e){if(e.defaultPrevented||a.disabled)return;let t=i(`keyboardResizeBy`),o=0;o=e.shiftKey?10:t??1;let s={Enter(){r({type:`ENTER`,id:n})},ArrowUp(){r({type:`KEYBOARD_MOVE`,id:n,delta:c?0:-o})},ArrowDown(){r({type:`KEYBOARD_MOVE`,id:n,delta:c?0:o})},ArrowLeft(){r({type:`KEYBOARD_MOVE`,id:n,delta:c?-o:0})},ArrowRight(){r({type:`KEYBOARD_MOVE`,id:n,delta:c?o:0})},Home(){r({type:`KEYBOARD_MOVE`,id:n,delta:-100})},End(){r({type:`KEYBOARD_MOVE`,id:n,delta:100})},F6(){r({type:`FOCUS.CYCLE`,id:n,shiftKey:e.shiftKey})}}[Ha(e,{dir:i(`dir`),orientation:d})];s&&(s(e),e.preventDefault())}})}}}function Uh({panels:e,prevLayout:t,prevGroupSize:n,nextGroupSize:r}){if(n<=0||r<=0)return t;let i=[...t],a=[],o=0,s=0;if(e.forEach((e,c)=>{if(e.resizeBehavior===`preserve-pixel-size`){let e=t[c]/100*n/r*100;i[c]=e,o+=e}else a.push(c),s+=t[c]}),a.length===0){let e=i.reduce((e,t)=>e+t,0);if(Sh(e,100))return i;if(e<=0)return t;let n=100/e;return i.map(e=>e*n)}let c=100-o;if(c<=0){let e=i.reduce((e,t)=>e+t,0);if(Sh(e,100))return i;let t=100/Math.max(e,1);return i.map(e=>e*t)}if(Sh(s,0)){let e=c/a.length;return a.forEach(t=>{i[t]=e}),i}a.forEach(e=>{i[e]=t[e]/s*c});let l=i.reduce((e,t)=>e+t,0);if(Sh(l,100))return i;let u=100/l;return i.map(e=>e*u)}function Wh({panels:e,index:t,size:n}){let r=e[t];kr(r,()=>`Panel data not found for index ${t}`);let{collapsedSize:i=0,collapsible:a,maxSize:o=100,minSize:s=0}=r;if(xh(n,s)<0){if(a){let e=(i+s)/2;n=xh(n,e)<0?i:s}else n=s}return n=Math.min(o,n),n=parseFloat(n.toFixed(10)),n}function Gh(e){let{delta:t,initialSize:n,panels:r,pivotIndices:i,prevSize:a,trigger:o}=e;if(Sh(t,0))return n;let s=[...n],[c,l]=i;kr(c,()=>`Invalid first pivot index`),kr(l,()=>`Invalid second pivot index`);let u=0;if(o===`keyboard`){{let e=t<0?l:c,i=r[e];kr(i,()=>`Panel data not found for index ${e}`);let{collapsedSize:a=0,collapsible:o,minSize:s=0}=i;if(o){let r=n[e];if(kr(r,()=>`Previous size not found for panel index ${e}`),Sh(r,a)){let e=s-r;xh(e,Math.abs(t))>0&&(t=t<0?0-e:e)}}}{let e=t<0?c:l,i=r[e];kr(i,()=>`No panel data found for index ${e}`);let{collapsedSize:a=0,collapsible:o,minSize:s=0}=i;if(o){let r=n[e];if(kr(r,()=>`Previous size not found for panel index ${e}`),Sh(r,s)){let e=r-a;xh(e,Math.abs(t))>0&&(t=t<0?0-e:e)}}}}{let e=t<0?1:-1,i=t<0?l:c,a=0;for(;;){let t=n[i];kr(t,()=>`Previous size not found for panel index ${i}`);let o=Wh({panels:r,index:i,size:100})-t;if(a+=o,i+=e,i<0||i>=r.length)break}let o=Math.min(Math.abs(t),Math.abs(a));t=t<0?0-o:o}{let e=t<0?c:l;for(;e>=0&&e<r.length;){let i=Math.abs(t)-Math.abs(u),a=n[e];kr(a,()=>`Previous size not found for panel index ${e}`);let o=a-i,c=Wh({panels:r,index:e,size:o});if(!Sh(a,c)&&(u+=a-c,s[e]=c,u.toPrecision(3).localeCompare(Math.abs(t).toPrecision(3),void 0,{numeric:!0})>=0))break;t<0?e--:e++}}if(Ch(a,s))return a;{let e=t<0?l:c,i=n[e];kr(i,()=>`Previous size not found for panel index ${e}`);let a=i+u,o=Wh({panels:r,index:e,size:a});if(s[e]=o,!Sh(o,a)){let e=a-o,n=t<0?l:c;for(;n>=0&&n<r.length;){let i=s[n];kr(i,()=>`Previous size not found for panel index ${n}`);let a=i+e,o=Wh({panels:r,index:n,size:a});if(Sh(i,o)||(e-=o-i,s[n]=o),Sh(e,0))break;t>0?n--:n++}}}return Sh(s.reduce((e,t)=>t+e,0),100)?s:a}function Kh({size:e,panels:t}){let n=[...e],r=n.reduce((e,t)=>e+t,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel size: ${n.map(e=>`${e}%`).join(`, `)}`);if(!Sh(r,100)&&n.length>0)for(let e=0;e<t.length;e++){let t=n[e];kr(t,()=>`No size data found for index ${e}`);let i=100/r*t;n[e]=i}let i=0;for(let e=0;e<t.length;e++){let r=n[e];kr(r,()=>`No size data found for index ${e}`);let a=Wh({panels:t,index:e,size:r});r!=a&&(i+=r-a,n[e]=a)}if(!Sh(i,0))for(let e=0;e<t.length;e++){let r=n[e];kr(r,()=>`No size data found for index ${e}`);let a=r+i,o=Wh({panels:t,index:e,size:a});if(r!==o&&(i-=o-r,n[e]=o,Sh(i,0)))break}return n}var qh=di({props({props:e}){return Ar(e,[`panels`]),{orientation:`horizontal`,defaultSize:[],dir:`ltr`,...e,panels:Lh(e.panels)}},initialState(){return`idle`},context({prop:e,bindable:t,getContext:n,getRefs:r}){return{panels:t(()=>({defaultValue:Mh(e(`panels`),null,e(`orientation`))})),size:t(()=>({defaultValue:[],isEqual(e,t){return t!=null&&Ch(e,t)},onChange(t){let i=n(),a=r();if(a.get(`suppressOnResize`))return;let o=a.get(`panelSizeBeforeCollapse`),s=Object.fromEntries(o.entries()),c=i.get(`dragState`)?.resizeTriggerId??null,l=Rh(e(`panels`));e(`onResize`)?.({size:t,layout:l,resizeTriggerId:c,expandToSizes:s})}})),dragState:t(()=>({defaultValue:null})),keyboardState:t(()=>({defaultValue:null}))}},watch({track:e,action:t,prop:n}){e([()=>zh(n(`panels`)),()=>JSON.stringify(n(`size`)??[]),()=>JSON.stringify(n(`defaultSize`)??[])],()=>{t([`syncSize`])})},refs(){return{panelSizeBeforeCollapse:new Map,prevDelta:0,panelIdToLastNotifiedSizeMap:new Map,initialSize:null,prevInitialLayout:null,prevGroupSize:null,lastRequestedSize:null,suppressOnResize:!1}},computed:{horizontal({prop:e}){return e(`orientation`)===`horizontal`}},on:{"SIZE.SET":{actions:[`setSize`]},"SIZE.RESET":{actions:[`resetSize`]},"PANEL.COLLAPSE":{actions:[`collapsePanel`]},"PANEL.EXPAND":{actions:[`expandPanel`]},"PANEL.RESIZE":{actions:[`resizePanel`]},"ROOT.RESIZE":{actions:[`syncSize`]}},entry:[`syncSize`],exit:[`clearGlobalCursor`],effects:[`trackResizeHandles`,`trackRootResize`],states:{idle:{entry:[`clearDraggingState`,`clearKeyboardState`],on:{POINTER_OVER:{target:`hover:temp`,actions:[`setKeyboardState`]},FOCUS:{target:`focused`,actions:[`setKeyboardState`]},POINTER_DOWN:{target:`dragging`,actions:[`setDraggingState`]}}},"hover:temp":{effects:[`waitForHoverDelay`],on:{HOVER_DELAY:{target:`hover`},FOCUS:{target:`focused`,actions:[`setKeyboardState`]},POINTER_DOWN:{target:`dragging`,actions:[`setDraggingState`]},POINTER_LEAVE:{target:`idle`}}},hover:{tags:[`focus`],on:{FOCUS:{target:`focused`,actions:[`setKeyboardState`]},POINTER_DOWN:{target:`dragging`,actions:[`setDraggingState`]},POINTER_LEAVE:{target:`idle`}}},focused:{tags:[`focus`],on:{BLUR:{target:`idle`},ENTER:{actions:[`collapseOrExpandPanel`]},POINTER_DOWN:{target:`dragging`,actions:[`setDraggingState`]},KEYBOARD_MOVE:{actions:[`invokeOnResizeStart`,`setKeyboardValue`,`invokeOnResizeEnd`]},"FOCUS.CYCLE":{actions:[`focusNextResizeTrigger`]}}},dragging:{tags:[`focus`],effects:[`trackPointerMove`],entry:[`invokeOnResizeStart`],on:{POINTER_MOVE:{actions:[`setPointerValue`,`setGlobalCursor`]},POINTER_UP:[{guard:`isResizeTriggerFocused`,target:`focused`,actions:[`invokeOnResizeEnd`,`setKeyboardState`,`clearDraggingState`,`clearGlobalCursor`]},{target:`idle`,actions:[`invokeOnResizeEnd`,`clearGlobalCursor`]}]}}},implementations:{guards:{isResizeTriggerFocused({context:e,scope:t}){let n=e.get(`dragState`);return t.isActiveElement(lh(t,n?.resizeTriggerId))}},effects:{trackResizeHandles:({prop:e,scope:t,send:n})=>{let r=e(`registry`);if(!r)return;let i=[],a=()=>{i.forEach(e=>e()),i=hh(t).map(i=>{let a=i.dataset.id;if(a)return r.register({id:ah(t,a),element:i,orientation:e(`orientation`),onActivate(e){n({type:`POINTER_DOWN`,id:a,point:e})},onDeactivate(){n({type:`POINTER_UP`})}})}).filter(Boolean)};a();let o=Oo(ch(t),{callback:a});return()=>{i.forEach(e=>e()),o?.()}},trackRootResize:({scope:e,send:t})=>{let n=ch(e);if(n)return Jo.observe(n,()=>{t({type:`ROOT.RESIZE`})})},waitForHoverDelay:({send:e})=>Er(()=>{e({type:`HOVER_DELAY`})},250),trackPointerMove:({scope:e,send:t})=>Bo(e.getDoc(),{onPointerMove(e){t({type:`POINTER_MOVE`,point:e.point})},onPointerUp(){t({type:`POINTER_UP`})}})},actions:{setSize(e){let{context:t,event:n,prop:r,scope:i}=e,a=n.size,o=t.get(`size`),s=t.get(`panels`),c=Kh({size:jh({sizes:a,panels:r(`panels`),rootEl:ch(i),orientation:r(`orientation`)}),panels:s});Yn(o,c)||Jh(e,c)},resetSize(e){let{refs:t,context:n,prop:r,scope:i}=e;Jh(e,t.get(`initialSize`)??Kh({size:jh({sizes:r(`size`)??r(`defaultSize`),panels:r(`panels`),rootEl:ch(i),orientation:r(`orientation`)}),panels:n.get(`panels`)}))},syncSize(e){let{context:t,scope:n,prop:r,refs:i}=e,a=ch(n);if(!a)return;let o=r(`orientation`),s=Dh(a,o);if(s<=0)return;let c=Mh(r(`panels`),a,r(`orientation`));t.set(`panels`,c);let l=r(`size`)??r(`defaultSize`),u=`${Rh(r(`panels`))}:${JSON.stringify(r(`size`)??[])}:${JSON.stringify(r(`defaultSize`)??[])}`,d=i.get(`prevGroupSize`),f=t.get(`size`),p=jh({sizes:l,panels:r(`panels`),rootEl:a,orientation:o}),m=Kh({size:d!=null&&d!==s&&f.length===c.length?Uh({panels:c,prevLayout:f,prevGroupSize:d,nextGroupSize:s}):p,panels:c});i.get(`prevInitialLayout`)!==u&&(i.set(`initialSize`,m),i.set(`prevInitialLayout`,u));let h=t.get(`size`);Yn(h,m)||(i.set(`suppressOnResize`,r(`size`)!=null||h.length===0),t.set(`size`,m),i.set(`suppressOnResize`,!1)),i.set(`prevGroupSize`,s)},setDraggingState({context:e,event:t,prop:n,scope:r}){let i=n(`orientation`),a=e.get(`size`),o=t.id,s=ph(r,o);if(!s||!ch(r))return;let c=lh(r,o);kr(c,()=>`Drag handle element not found for id "${o}"`);let l=i===`horizontal`?t.point.x:t.point.y;e.set(`dragState`,{resizeTriggerId:t.id,resolvedResizeTriggerId:s,resizeTriggerRect:c.getBoundingClientRect(),initialCursorPosition:l,initialSize:a})},clearDraggingState({context:e}){e.set(`dragState`,null)},setKeyboardState({context:e,event:t,scope:n}){let r=t.id??e.get(`dragState`)?.resizeTriggerId;r!=null&&e.set(`keyboardState`,{resizeTriggerId:r,resolvedResizeTriggerId:ph(n,r)})},clearKeyboardState({context:e}){e.set(`keyboardState`,null)},collapsePanel(e){let{context:t,event:n,refs:r}=e,i=t.get(`size`),a=t.get(`panels`),o=a.find(e=>e.id===n.id);if(kr(o,()=>`Panel data not found for id "${n.id}"`),o.collapsible){let{collapsedSize:t=0,panelSize:n,pivotIndices:s}=Ih(a,o,i);if(kr(n!=null,()=>`Panel size not found for panel "${o.id}"`),!Sh(n,t)){r.get(`panelSizeBeforeCollapse`).set(o.id,n);let c=Gh({delta:Ph(a,o)===a.length-1?n-t:t-n,initialSize:i,panels:a,pivotIndices:s,prevSize:i,trigger:`imperative-api`});Yn(i,c)||Jh(e,c)}}},expandPanel(e){let{context:t,event:n,refs:r}=e,i=t.get(`panels`),a=t.get(`size`),o=i.find(e=>e.id===n.id);if(kr(o,()=>`Panel data not found for id "${n.id}"`),o.collapsible){let{collapsedSize:t=0,panelSize:s=0,minSize:c=0,pivotIndices:l}=Ih(i,o,a),u=n.minSize??c;if(Sh(s,t)){let t=r.get(`panelSizeBeforeCollapse`).get(o.id),n=t!=null&&t>=u?t:u,c=Gh({delta:Ph(i,o)===i.length-1?s-n:n-s,initialSize:a,panels:i,pivotIndices:l,prevSize:a,trigger:`imperative-api`});Yn(a,c)||Jh(e,c)}}},resizePanel(e){let{context:t,event:n}=e,r=t.get(`size`),i=t.get(`panels`),a=Nh(i,n.id),o=n.size,{panelSize:s,pivotIndices:c}=Ih(i,a,r);kr(s!=null,()=>`Panel size not found for panel "${a.id}"`);let l=Gh({delta:Ph(i,a)===i.length-1?s-o:o-s,initialSize:r,panels:i,pivotIndices:c,prevSize:r,trigger:`imperative-api`});Yn(r,l)||Jh(e,l)},setPointerValue(e){let{context:t,event:n,prop:r,scope:i}=e,a=t.get(`dragState`);if(!a)return;let{resolvedResizeTriggerId:o,initialSize:s,initialCursorPosition:c}=a,l=t.get(`panels`),u=ch(i);kr(u,()=>`Panel group element not found`);let d=o.split(`:`).map(e=>l.findIndex(t=>t.id===e)),f=r(`orientation`)===`horizontal`,p=f?n.point.x:n.point.y,m=u.getBoundingClientRect(),h=f?m.width:m.height,g=(p-c)/h*100,_=t.get(`size`),v=Gh({delta:g,initialSize:s??_,panels:l,pivotIndices:d,prevSize:_,trigger:`mouse-or-touch`});Yn(_,v)||Jh(e,v)},setKeyboardValue(e){let{context:t,event:n}=e,r=t.get(`panels`),i=ph(e.scope,n.id);if(!i)return;let a=n.delta,o=i.split(`:`).map(e=>r.findIndex(t=>t.id===e)),s=t.get(`size`),c=Gh({delta:a,initialSize:s,panels:r,pivotIndices:o,prevSize:s,trigger:`keyboard`});Yn(s,c)||Jh(e,c)},invokeOnResizeEnd({context:e,prop:t,refs:n}){queueMicrotask(()=>{let r=e.get(`dragState`);t(`onResizeEnd`)?.({size:n.get(`lastRequestedSize`)??e.get(`size`),resizeTriggerId:r?.resizeTriggerId??null})})},invokeOnResizeStart({prop:e}){queueMicrotask(()=>{e(`onResizeStart`)?.()})},collapseOrExpandPanel(e){let{context:t,refs:n}=e,r=t.get(`panels`),i=t.get(`size`),[a,o]=(t.get(`keyboardState`)?.resolvedResizeTriggerId)?.split(`:`)??[],s=r.findIndex(e=>e.id===a);if(s===-1)return;let c=r[s];kr(c,()=>`No panel data found for index ${s}`);let l=i[s],{collapsedSize:u=0,collapsible:d,minSize:f=0}=c;if(l!=null&&d){let t=[a,o].map(e=>r.findIndex(t=>t.id===e)),s=Gh({delta:Sh(l,u)?f-u:u-l,initialSize:n.get(`initialSize`)??i,panels:r,pivotIndices:t,prevSize:i,trigger:`keyboard`});Yn(i,s)||Jh(e,s)}},setGlobalCursor(e){let{context:t,scope:n,prop:r}=e;if(r(`registry`))return;let i=t.get(`dragState`);if(!i)return;let a=t.get(`panels`),o=r(`orientation`)===`horizontal`,[s]=i.resolvedResizeTriggerId.split(`:`),c=a[a.findIndex(e=>e.id===s)],l=bh(t.get(`size`),a,i.resolvedResizeTriggerId);_h(n,{isAtMin:Sh(l.valueNow,l.valueMin)||Sh(l.valueNow,c.collapsedSize),isAtMax:Sh(l.valueNow,l.valueMax)},o,r(`nonce`))},clearGlobalCursor({scope:e}){vh(e)},focusNextResizeTrigger({event:e,scope:t}){let n=hh(t),r=n.findIndex(t=>t.dataset.id===e.id);(e.shiftKey?Kn(n,r):Wn(n,r))?.focus()}}}});function Jh(e,t){let{refs:n,prop:r,context:i}=e,a=i.get(`panels`),o=r(`onCollapse`),s=r(`onExpand`),c=r(`onResize`),l=r(`onResizeStart`),u=r(`onResizeEnd`),d=n.get(`panelIdToLastNotifiedSizeMap`),f=i.get(`dragState`),p=i.get(`keyboardState`),m=f===null&&p===null;if(n.set(`lastRequestedSize`,t),m&&l&&queueMicrotask(()=>{l()}),r(`size`)==null)i.set(`size`,t);else if(c){let e=n.get(`panelSizeBeforeCollapse`),i=Object.fromEntries(e.entries()),a=f?.resizeTriggerId??null;c({size:t,layout:Rh(r(`panels`)),resizeTriggerId:a,expandToSizes:i})}t.forEach((e,t)=>{let n=a[t];kr(n,()=>`Panel data not found for index ${t}`);let{collapsedSize:r=0,collapsible:i,id:c}=n,l=d.get(c);(l==null||e!==l)&&(d.set(c,e),i&&l!=null&&(o||s)&&(Sh(l,r)&&!Sh(e,r)&&s?.({panelId:c,size:e}),!Sh(l,r)&&Sh(e,r)&&o?.({panelId:c,size:e})))}),m&&u&&queueMicrotask(()=>{u({size:t,resizeTriggerId:null})})}function Yh(e,t,n=!1){return n?e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y: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 Xh(e){return{x:e.x,y:e.y,width:e.width,height:e.height}}function Zh(e,t){if(e===t)throw Error(`Cannot compare node with itself`);let n={a:Gi(e),b:Gi(t)},r=null;for(;n.a.at(-1)===n.b.at(-1);){let e=n.a.pop();n.b.pop(),r=e}kr(r,()=>`[stacking-order] Stacking order can only be calculated for elements with a common ancestor`);let i={a:ng(tg(n.a)),b:ng(tg(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 Qh=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function $h(e){let t=ea(Wi(e)??e).display;return t===`flex`||t===`inline-flex`}function eg(e){let t=ea(e);return!!(t.position===`fixed`||t.zIndex!==`auto`&&(t.position!==`static`||$h(e))||+t.opacity<1||nr(t,`transform`)&&t.transform!==`none`||nr(t,`webkitTransform`)&&t.webkitTransform!==`none`||nr(t,`mixBlendMode`)&&t.mixBlendMode!==`normal`||nr(t,`filter`)&&t.filter!==`none`||nr(t,`webkitFilter`)&&t.webkitFilter!==`none`||nr(t,`isolation`)&&t.isolation===`isolate`||Qh.test(t.willChange)||t.webkitOverflowScrolling===`touch`)}function tg(e){let t=e.length;for(;t--;){let n=e[t];if(kr(n,()=>`[stacking-order] missing node in findStackingContext`),eg(n))return n}return null}var ng=e=>e&&Number(ea(e).zIndex)||0,rg=class{constructor(e={}){th(this,`handles`,new Map),th(this,`state`,{activeHandleIds:new Set,isPointerDown:!1}),th(this,`listenerAttached`,!1),th(this,`options`),th(this,`handlePointerMove`,e=>{if(this.state.isPointerDown)return;let t=this.getPointerType(e),n=this.findHitHandles(e.clientX,e.clientY,t),r=new Set(n.map(e=>e.id));(r.size!==this.state.activeHandleIds.size||[...r].some(e=>!this.state.activeHandleIds.has(e)))&&(this.state.activeHandleIds=r,this.updateCursor(n))}),th(this,`handlePointerDown`,e=>{let t=this.getPointerType(e),n=this.findIntersectingHandles(e.clientX,e.clientY,t,e.target);if(n.length>0){this.state.isPointerDown=!0,this.state.activeHandleIds=new Set(n.map(e=>e.id));let t={x:e.clientX,y:e.clientY};n.forEach(e=>{e.onActivate(t)}),this.updateCursor(n)}}),th(this,`handlePointerUp`,e=>{this.state.isPointerDown&&(this.state.isPointerDown=!1,this.handles.forEach(e=>{this.state.activeHandleIds.has(e.id)&&e.onDeactivate()}),this.state.activeHandleIds.clear(),this.clearGlobalCursor())}),th(this,`globalCursorId`,`splitter-registry-cursor`),this.options={nonce:e.nonce??``,hitAreaMargins:{coarse:e.hitAreaMargins?.coarse??15,fine:e.hitAreaMargins?.fine??5}}}register(e){return this.handles.set(e.id,e),this.attachGlobalListeners(),()=>{this.handles.delete(e.id),this.state.activeHandleIds.delete(e.id),this.handles.size===0&&this.detachGlobalListeners()}}attachGlobalListeners(){this.listenerAttached||=(this.doc.addEventListener(`pointermove`,this.handlePointerMove,!0),this.doc.addEventListener(`pointerdown`,this.handlePointerDown,!0),this.doc.addEventListener(`pointerup`,this.handlePointerUp,!0),!0)}detachGlobalListeners(){this.listenerAttached&&=(this.doc.removeEventListener(`pointermove`,this.handlePointerMove,!0),this.doc.removeEventListener(`pointerdown`,this.handlePointerDown,!0),this.doc.removeEventListener(`pointerup`,this.handlePointerUp,!0),!1)}getPointerType(e){return e.pointerType===`touch`||e.pointerType===`pen`?`coarse`:`fine`}get doc(){let e=this.handles.values().next().value;return qi(e?.element)}findHitHandles(e,t,n){let r=[],i=this.options.hitAreaMargins[n];return this.handles.forEach(n=>{let a=n.element.getBoundingClientRect();e>=a.left-i&&e<=a.right+i&&t>=a.top-i&&t<=a.bottom+i&&r.push(n)}),r}findIntersectingHandles(e,t,n,r){let i=this.findHitHandles(e,t,n),a=Ai(r)?r:null;return!a||!Ki(this.doc,a)?i:i.filter(e=>{let t=e.element;if(a===t||Ki(t,a)||Ki(a,t))return!0;try{if(Zh(a,t)>0){let e=t.getBoundingClientRect(),n=a;for(;n&&!n.contains(t);){if(Yh(Xh(n.getBoundingClientRect()),Xh(e),!0))return!1;n=Wi(n)}}}catch{}return!0})}updateCursor(e){if(e.length===0){this.clearGlobalCursor();return}let t=e.some(e=>e.orientation===`horizontal`),n=e.some(e=>e.orientation===`vertical`),r=`default`;t&&n?r=`move`:t?r=`ew-resize`:n&&(r=`ns-resize`),this.setGlobalCursor(r)}setGlobalCursor(e){let t=this.doc,n=t.getElementById(this.globalCursorId),r=`* { cursor: ${e} !important; }`;n?n.textContent=r:(n=t.createElement(`style`),n.id=this.globalCursorId,n.textContent=r,this.options.nonce&&(n.nonce=this.options.nonce),t.head.appendChild(n))}clearGlobalCursor(){this.doc.getElementById(this.globalCursorId)?.remove()}},ig=(e={})=>new rg(e),ag=H(`switch`).parts(`root`,`label`,`control`,`thumb`),og=ag.build(),sg=e=>e.ids?.root??`switch:${e.id}`,cg=e=>e.ids?.label??`switch:${e.id}:label`,lg=e=>e.ids?.thumb??`switch:${e.id}:thumb`,ug=e=>e.ids?.control??`switch:${e.id}:control`,dg=e=>e.ids?.hiddenInput??`switch:${e.id}:input`,fg=e=>e.getById(sg(e)),pg=e=>e.getById(dg(e));function mg(e,t){let{context:n,send:r,prop:i,scope:a}=e,o=!!i(`disabled`),s=!!i(`readOnly`),c=!!i(`required`),l=!!n.get(`checked`),u=!o&&n.get(`focused`),d=!o&&n.get(`focusVisible`),f={"data-active":R(!o&&n.get(`active`)),"data-focus":R(u),"data-focus-visible":R(d),"data-readonly":R(s),"data-hover":R(n.get(`hovered`)),"data-disabled":R(o),"data-state":l?`checked`:`unchecked`,"data-invalid":R(i(`invalid`)),"data-required":R(c)};return{checked:l,disabled:o,focused:u,setChecked(e){r({type:`CHECKED.SET`,checked:e,isTrusted:!1})},toggleChecked(){r({type:`CHECKED.TOGGLE`,checked:l,isTrusted:!1})},getRootProps(){return t.label({...og.root.attrs,...f,dir:i(`dir`),id:sg(a),htmlFor:dg(a),onPointerMove(){o||r({type:`CONTEXT.SET`,context:{hovered:!0}})},onPointerLeave(){o||r({type:`CONTEXT.SET`,context:{hovered:!1}})},onClick(e){o||(z(e)===pg(a)&&e.stopPropagation(),ka()&&pg(a)?.focus())}})},getLabelProps(){return t.element({...og.label.attrs,...f,dir:i(`dir`),id:cg(a)})},getThumbProps(){return t.element({...og.thumb.attrs,...f,dir:i(`dir`),id:lg(a),"aria-hidden":!0})},getControlProps(){return t.element({...og.control.attrs,...f,dir:i(`dir`),id:ug(a),"aria-hidden":!0})},getHiddenInputProps(){return t.input({id:dg(a),type:`checkbox`,required:i(`required`),defaultChecked:l,disabled:o,"aria-labelledby":cg(a),"aria-invalid":i(`invalid`),name:i(`name`),form:i(`form`),value:i(`value`),style:ss,onFocus(){let e=Au();r({type:`CONTEXT.SET`,context:{focused:!0,focusVisible:e}})},onBlur(){r({type:`CONTEXT.SET`,context:{focused:!1,focusVisible:!1}})},onClick(e){if(s){e.preventDefault();return}let t=e.currentTarget.checked;r({type:`CHECKED.SET`,checked:t,isTrusted:!0})}})}}}var{not:hg}=ui(),gg=di({props({props:e}){return{defaultChecked:!1,label:`switch`,value:`on`,...e}},initialState(){return`ready`},context({prop:e,bindable:t}){return{checked:t(()=>({defaultValue:e(`defaultChecked`),value:e(`checked`),onChange(t){e(`onCheckedChange`)?.({checked:t})}})),fieldsetDisabled:t(()=>({defaultValue:!1})),focusVisible:t(()=>({defaultValue:!1})),active:t(()=>({defaultValue:!1})),focused:t(()=>({defaultValue:!1})),hovered:t(()=>({defaultValue:!1}))}},computed:{isDisabled:({context:e,prop:t})=>t(`disabled`)||e.get(`fieldsetDisabled`)},watch({track:e,prop:t,context:n,action:r}){e([()=>t(`disabled`)],()=>{r([`removeFocusIfNeeded`])}),e([()=>n.get(`checked`)],()=>{r([`syncInputElement`])})},effects:[`trackFormControlState`,`trackPressEvent`,`trackFocusVisible`],on:{"CHECKED.TOGGLE":[{guard:hg(`isTrusted`),actions:[`toggleChecked`,`dispatchChangeEvent`]},{actions:[`toggleChecked`]}],"CHECKED.SET":[{guard:hg(`isTrusted`),actions:[`setChecked`,`dispatchChangeEvent`]},{actions:[`setChecked`]}],"CONTEXT.SET":{actions:[`setContext`]}},states:{ready:{}},implementations:{guards:{isTrusted:({event:e})=>!!e.isTrusted},effects:{trackPressEvent({computed:e,scope:t,context:n}){if(!e(`isDisabled`))return Vo({pointerNode:fg(t),keyboardNode:pg(t),isValidKey:e=>e.key===` `,onPress:()=>n.set(`active`,!1),onPressStart:()=>n.set(`active`,!0),onPressEnd:()=>n.set(`active`,!1)})},trackFocusVisible({computed:e,scope:t}){if(!e(`isDisabled`))return ju({root:t.getRootNode()})},trackFormControlState({context:e,send:t,scope:n}){return Qa(pg(n),{onFieldsetDisabledChange(t){e.set(`fieldsetDisabled`,t)},onFormReset(){t({type:`CHECKED.SET`,checked:!!e.initial(`checked`),src:`form-reset`})}})}},actions:{setContext({context:e,event:t}){for(let n in t.context)e.set(n,t.context[n])},syncInputElement({context:e,scope:t}){let n=pg(t);n&&qa(n,!!e.get(`checked`))},removeFocusIfNeeded({context:e,prop:t}){t(`disabled`)&&e.set(`focused`,!1)},setChecked({context:e,event:t}){e.set(`checked`,t.checked)},toggleChecked({context:e}){e.set(`checked`,!e.get(`checked`))},dispatchChangeEvent({context:e,scope:t}){queueMicrotask(()=>{Ja(pg(t),{checked:e.get(`checked`)})})}}}}),_g=H(`tagsInput`).parts(`root`,`label`,`control`,`input`,`clearTrigger`,`item`,`itemPreview`,`itemInput`,`itemText`,`itemDeleteTrigger`);_g.build();var vg=e=>{if(!e)return;let t=ea(e),n=Yi(e),r=qi(e),i=()=>{requestAnimationFrame(()=>{e.style.height=`auto`;let n;n=t.boxSizing===`content-box`?e.scrollHeight-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)):e.scrollHeight+parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth),t.maxHeight!==`none`&&n>parseFloat(t.maxHeight)?(t.overflowY===`hidden`&&(e.style.overflowY=`scroll`),n=parseFloat(t.maxHeight)):t.overflowY!==`hidden`&&(e.style.overflowY=`hidden`),e.style.height=`${n}px`})};e.addEventListener(`input`,i),e.form?.addEventListener(`reset`,i);let a=Object.getOwnPropertyDescriptor(e,`value`),o=a?.set?a:Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),`value`);o?.set&&Object.defineProperty(e,"value",{...o,set(e){o.set?.call(this,e),i()}});let s=new n.ResizeObserver(()=>{requestAnimationFrame(()=>i())});s.observe(e);let c=new n.MutationObserver(()=>i());return c.observe(e,{attributes:!0,attributeFilter:[`rows`,`placeholder`]}),r.fonts?.addEventListener(`loadingdone`,i),()=>{e.removeEventListener(`input`,i),e.form?.removeEventListener(`reset`,i),r.fonts?.removeEventListener(`loadingdone`,i),s.disconnect(),c.disconnect()}},yg=H(`tooltip`).parts(`trigger`,`arrow`,`arrowTip`,`positioner`,`content`);yg.build();var bg=H(`tree-view`).parts(`branch`,`branchContent`,`branchControl`,`branchIndentGuide`,`branchIndicator`,`branchText`,`branchTrigger`,`item`,`itemIndicator`,`itemText`,`label`,`nodeCheckbox`,`nodeRenameInput`,`root`,`tree`);bg.build();var xg=typeof window<`u`?P.useLayoutEffect:P.useEffect,[Sg,Cg]=Mr({name:`CheckboxContext`,hookName:`useCheckboxContext`,providerName:`<CheckboxProvider />`}),wg=e=>e.children(Cg()),Tg=(0,P.forwardRef)((e,t)=>{let n=L(Cg().getControlProps(),e);return(0,F.jsx)(V.div,{...n,ref:t})});Tg.displayName=`CheckboxControl`;var[Eg,Dg]=Mr({name:`FieldsetContext`,hookName:`useFieldsetContext`,providerName:`<FieldsetProvider />`,strict:!1});function Og(e){let{value:t,onChange:n,defaultValue:r}=e,[i,a]=(0,P.useState)(r),o=t!==void 0;return[o?t:i,(0,P.useCallback)(e=>(o||a(e),n?.(e)),[o,n])]}function kg(e={}){let t=Dg(),{defaultValue:n,value:r,onValueChange:i,disabled:a=t?.disabled,readOnly:o,name:s,invalid:c=t?.invalid,maxSelectedValues:l}=e,u=!(a||o),d=Ts(i,{sync:!0}),[f,p]=Og({value:r,defaultValue:n||[],onChange:d}),m=e=>f.some(t=>String(t)===String(e)),h=e=>{m(e)?v(e):_(e)},g=l!=null&&f.length>=l,_=e=>{u&&(m(e)||g||p(f.concat(e)))},v=e=>{u&&p(f.filter(t=>String(t)!==String(e)))};return{isChecked:m,value:f,name:s,disabled:!!a,readOnly:!!o,invalid:!!c,setValue:p,addValue:_,toggleValue:h,getItemProps:e=>{let t=e.value==null?void 0:m(e.value);return{checked:t,onCheckedChange(){e.value!=null&&h(e.value)},name:s,disabled:a||g&&!t,readOnly:o,invalid:c}}}}var[Ag,jg]=Mr({name:`CheckboxGroupContext`,hookName:`useCheckboxGroupContext`,providerName:`<CheckboxGroupProvider />`,strict:!1}),Mg=xs(),Ng=(0,P.forwardRef)((e,t)=>{let[n,r]=Mg(e,[`defaultValue`,`value`,`onValueChange`,`disabled`,`invalid`,`readOnly`,`name`,`maxSelectedValues`]),i=kg(n);return(0,F.jsx)(Ag,{value:i,children:(0,F.jsx)(V.div,{ref:t,role:`group`,...r,...Uu.build().group.attrs})})});Ng.displayName=`CheckboxGroup`;var Pg=xs(),Fg=(0,P.forwardRef)((e,t)=>{let[n,r]=Pg(e,[`value`]);return(0,F.jsx)(Ag,{value:n.value,children:(0,F.jsx)(V.div,{ref:t,role:`group`,...r,...Uu.build().group.attrs})})});Fg.displayName=`CheckboxGroupProvider`;var[Ig,Lg]=Mr({name:`FieldContext`,hookName:`useFieldContext`,providerName:`<FieldProvider />`,strict:!1}),Rg=e=>e.children(Lg()),zg=(0,P.forwardRef)((e,t)=>{let n=Lg(),r=L(n.getErrorTextProps(),e);return n?.invalid?(0,F.jsx)(V.span,{...r,ref:t}):null});zg.displayName=`FieldErrorText`;var Bg=(0,P.forwardRef)((e,t)=>{let n=L(Lg()?.getHelperTextProps(),e);return(0,F.jsx)(V.span,{...n,ref:t})});Bg.displayName=`FieldHelperText`;var Vg=(0,P.forwardRef)((e,t)=>{let n=L(Lg()?.getInputProps(),e);return(0,F.jsx)(V.input,{...n,ref:t})});Vg.displayName=`FieldInput`;var Hg=e=>{let{value:t,children:n}=e,r=Lg(),i=(0,P.useMemo)(()=>{if(!r)throw Error(`Field.Item must be used within Field.Root`);let e=`field::${r.ids.control}::item::${t}`,n=`${e}::label`,i=()=>({...r.getInputProps(),id:e});return{...r,ids:{...r.ids,control:e,label:n},getLabelProps:()=>({...r.getLabelProps(),id:n,htmlFor:e}),getInputProps:()=>({...i(),...om.input.attrs}),getSelectProps:()=>({...i(),...om.select.attrs}),getTextareaProps:()=>({...i(),...om.textarea.attrs})}},[r,t]);return(0,F.jsx)(Ig,{value:i,children:n})};Hg.displayName=`FieldItem`;var Ug=(0,P.forwardRef)((e,t)=>{let n=L(Lg()?.getLabelProps(),e);return(0,F.jsx)(V.label,{...n,ref:t})});Ug.displayName=`FieldLabel`;var Wg=(0,P.forwardRef)(({fallback:e,...t},n)=>{let r=Lg();if(!r.required)return e;let i=L(r.getRequiredIndicatorProps(),t);return(0,F.jsx)(V.span,{...i,ref:n,children:t.children??`*`})});Wg.displayName=`FieldRequiredIndicator`;var Gg=(e={})=>{let t=Dg(),n=Pr(),{ids:r,target:i,disabled:a=!!t?.disabled,invalid:o=!1,readOnly:s=!1,required:c=!1}=e,[l,u]=(0,P.useState)(!1),[d,f]=(0,P.useState)(!1),p=(0,P.useId)(),m=e.id??p,h=(0,P.useRef)(null),g=r?.control??`field::${m}`,_=r?.errorText??`field::${m}::error-text`,v=r?.helperText??`field::${m}::helper-text`,y=r?.label??`field::${m}::label`;xg(()=>{let e=h.current;if(!e)return;let t=()=>{let e=n.getRootNode();u(!!e.getElementById(_)),f(!!e.getElementById(v))};t();let r=new(n.getWindow()).MutationObserver(t);return r.observe(e,{childList:!0,subtree:!0}),()=>r.disconnect()},[n,_,v]);let b=(0,P.useMemo)(()=>()=>({...om.root.attrs,id:g,ref:h,role:`group`,"data-disabled":R(a),"data-invalid":R(o),"data-readonly":R(s)}),[a,o,s,g]),x=i?`field::${m}::item::${i}`:void 0,S=(0,P.useMemo)(()=>()=>({...om.label.attrs,id:y,"data-disabled":R(a),"data-invalid":R(o),"data-readonly":R(s),"data-required":R(c),htmlFor:x??m}),[a,o,s,c,m,y,x]),C=l&&o?_:void 0,w=(0,P.useMemo)(()=>()=>({"aria-describedby":d?v:void 0,"aria-errormessage":C,"aria-invalid":Si(o),"data-invalid":R(o),"data-required":R(c),"data-readonly":R(s),id:m,required:c,disabled:a,readOnly:s}),[d,v,o,c,s,m,C,a]),T=(0,P.useMemo)(()=>()=>({...w(),...om.input.attrs}),[w]),E=(0,P.useMemo)(()=>()=>({...w(),...om.textarea.attrs}),[w]),D=(0,P.useMemo)(()=>()=>({...w(),...om.select.attrs}),[w]),ee=(0,P.useMemo)(()=>()=>({id:v,...om.helperText.attrs,"data-disabled":R(a)}),[a,v]),O=(0,P.useMemo)(()=>()=>({id:_,...om.errorText.attrs,"aria-live":`polite`}),[_]),te=(0,P.useMemo)(()=>()=>({"aria-hidden":!0,...om.requiredIndicator.attrs}),[]);return{ariaDescribedby:d?v:void 0,ids:{root:g,control:m,label:y,errorText:_,helperText:v},refs:{rootRef:h},disabled:a,invalid:o,readOnly:s,required:c,getLabelProps:S,getRootProps:b,getInputProps:T,getTextareaProps:E,getSelectProps:D,getHelperTextProps:ee,getErrorTextProps:O,getRequiredIndicatorProps:te}},Kg=xs(),qg=(0,P.forwardRef)((e,t)=>{let[n,r]=Kg(e,[`id`,`ids`,`disabled`,`invalid`,`readOnly`,`required`,`target`]),i=Gg(n),a=L(i.getRootProps(),r),o=Ir(t,i.refs.rootRef);return(0,F.jsx)(Ig,{value:i,children:(0,F.jsx)(V.div,{...a,ref:o})})});qg.displayName=`FieldRoot`;var Jg=xs(),Yg=(0,P.forwardRef)((e,t)=>{let[{value:n},r]=Jg(e,[`value`]),i=L(n.getRootProps(),r);return(0,F.jsx)(Ig,{value:n,children:(0,F.jsx)(V.div,{...i,ref:t})})});Yg.displayName=`FieldRootProvider`;var Xg=(0,P.forwardRef)((e,t)=>{let n=L(Lg()?.getSelectProps(),e);return(0,F.jsx)(V.select,{...n,ref:t})});Xg.displayName=`FieldSelect`;var Zg=(0,P.forwardRef)((e,t)=>{let{autoresize:n,...r}=e,i=(0,P.useRef)(null),a=L(Lg()?.getTextareaProps(),{style:{resize:n?`none`:void 0}},r),o=Ir(t,i);return(0,P.useEffect)(()=>{if(n)return vg(i.current)},[n]),(0,F.jsx)(V.textarea,{...a,ref:o})});Zg.displayName=`FieldTextarea`;var Qg=bs({Context:()=>Rg,ErrorText:()=>zg,HelperText:()=>Bg,Input:()=>Vg,Item:()=>Hg,Label:()=>Ug,RequiredIndicator:()=>Wg,Root:()=>qg,RootProvider:()=>Yg,Select:()=>Xg,Textarea:()=>Zg}),$g=(0,P.forwardRef)((e,t)=>{let n=L(Cg().getHiddenInputProps(),e),r=Lg();return(0,F.jsx)(V.input,{"aria-describedby":r?.ariaDescribedby,...n,ref:t})});$g.displayName=`CheckboxHiddenInput`;var e_=(0,P.forwardRef)((e,t)=>{let{indeterminate:n,...r}=e,i=Cg(),a=L(i.getIndicatorProps(),r),o=n?i.indeterminate:i.checked;return(0,F.jsx)(V.div,{...a,hidden:!o,ref:t})});e_.displayName=`CheckboxIndicator`;var t_=(0,P.forwardRef)((e,t)=>{let n=L(Cg().getLabelProps(),e);return(0,F.jsx)(V.span,{...n,ref:t})});t_.displayName=`CheckboxLabel`;var n_=(e={})=>{let t=jg(),n=Lg(),r=(0,P.useMemo)(()=>L(t?.getItemProps({value:e.value})??{},e),[e,t]),i=(0,P.useId)(),{getRootNode:a}=Pr(),{dir:o}=vs();return Ru(Ns(Bu,{id:i,ids:{label:n?.ids.label,hiddenInput:n?.ids.control},dir:o,disabled:n?.disabled,readOnly:n?.readOnly,invalid:n?.invalid,required:n?.required,getRootNode:a,...r}),Rs)},r_=xs(),i_=(0,P.forwardRef)((e,t)=>{let[n,r]=r_(e,[`checked`,`defaultChecked`,`disabled`,`form`,`id`,`ids`,`invalid`,`name`,`onCheckedChange`,`readOnly`,`required`,`value`]),i=n_(n),a=L(i.getRootProps(),r);return(0,F.jsx)(Sg,{value:i,children:(0,F.jsx)(V.label,{...a,ref:t})})});i_.displayName=`CheckboxRoot`;var a_=xs(),o_=(0,P.forwardRef)((e,t)=>{let[{value:n},r]=a_(e,[`value`]),i=L(n.getRootProps(),r);return(0,F.jsx)(Sg,{value:n,children:(0,F.jsx)(V.label,{...i,ref:t})})});o_.displayName=`CheckboxRootProvider`;var s_=bs({Context:()=>wg,Control:()=>Tg,Group:()=>Ng,GroupProvider:()=>Fg,HiddenInput:()=>$g,Indicator:()=>e_,Label:()=>t_,Root:()=>i_,RootProvider:()=>o_}),c_=e=>new Ep(e),[l_,u_]=Mr({name:`DialogContext`,hookName:`useDialogContext`,providerName:`<DialogProvider />`}),d_=(0,P.forwardRef)((e,t)=>{let n=u_(),r=Hs({...yc(),present:n.open}),i=L(n.getBackdropProps(),r.getPresenceProps(),e),a=Ir(r.ref,t);return(0,F.jsx)(Us,{presence:r,children:(0,F.jsx)(V.div,{...i,ref:a})})});d_.displayName=`DialogBackdrop`;var f_=(0,P.forwardRef)((e,t)=>{let n=L(u_().getCloseTriggerProps(),e);return(0,F.jsx)(V.button,{...n,ref:t})});f_.displayName=`DialogCloseTrigger`;var p_=(0,P.forwardRef)((e,t)=>{let n=u_(),r=Gs(),i=L(n.getContentProps(),r.getPresenceProps(),e),a=Ir(r.ref,t);return(0,F.jsx)(Us,{presence:r,children:(0,F.jsx)(V.div,{...i,ref:a})})});p_.displayName=`DialogContent`;var m_=e=>e.children(u_()),h_=(0,P.forwardRef)((e,t)=>{let n=L(u_().getDescriptionProps(),e);return(0,F.jsx)(V.div,{...n,ref:t})});h_.displayName=`DialogDescription`;var g_=(0,P.forwardRef)((e,t)=>{let n=L(u_().getPositionerProps(),e);return Gs().unmounted?null:(0,F.jsx)(V.div,{...n,ref:t})});g_.displayName=`DialogPositioner`;var __=e=>{let t=(0,P.useId)(),{getRootNode:n}=Pr(),{dir:r}=vs();return nm(Ns(rm,{id:t,getRootNode:n,dir:r,...e}),Rs)},v_=e=>{let[t,{children:n,...r}]=Ss(e),[i]=bc(t),a=__(r),o=Hs(L({present:a.open},t));return(0,F.jsx)(l_,{value:a,children:(0,F.jsx)(vc,{value:i,children:(0,F.jsx)(Ws,{value:o,children:n})})})},y_=e=>{let[t,{value:n,children:r}]=Ss(e),[i]=bc(t),a=Hs(L({present:n.open},t));return(0,F.jsx)(l_,{value:n,children:(0,F.jsx)(vc,{value:i,children:(0,F.jsx)(Ws,{value:a,children:r})})})},b_=(0,P.forwardRef)((e,t)=>{let n=L(u_().getTitleProps(),e);return(0,F.jsx)(V.h2,{...n,ref:t})});b_.displayName=`DialogTitle`;var x_=xs(),S_=(0,P.forwardRef)((e,t)=>{let[n,r]=x_(e,[`value`]),i=u_(),a=Gs(),o=i.getTriggerProps(n),s=L({...o,"aria-controls":a.unmounted?void 0:o[`aria-controls`]},r);return(0,F.jsx)(V.button,{...s,ref:t})});S_.displayName=`DialogTrigger`;var C_=bs({Backdrop:()=>d_,CloseTrigger:()=>f_,Content:()=>p_,Context:()=>m_,Description:()=>h_,Positioner:()=>g_,Root:()=>v_,RootProvider:()=>y_,Title:()=>b_,Trigger:()=>S_}),w_=e=>{let{children:t,disabled:n}=e,[r,i]=(0,P.useState)(e.container?.current),a=(0,P.useSyncExternalStore)(E_,()=>!1,()=>!0),{getRootNode:o}=Pr();if((0,P.useEffect)(()=>{i(()=>e.container?.current)},[e.container]),a||n)return(0,F.jsx)(F.Fragment,{children:t});let s=r??T_(o);return(0,F.jsx)(F.Fragment,{children:P.Children.map(t,e=>(0,tt.createPortal)(e,s))})},T_=e=>{let t=e?.(),n=t.getRootNode();return Li(n)?n:qi(t).body},E_=()=>()=>{},[D_,O_]=Mr({name:`SelectContext`,hookName:`useSelectContext`,providerName:`<SelectProvider />`}),k_=(0,P.forwardRef)((e,t)=>{let n=L(O_().getClearTriggerProps(),e);return(0,F.jsx)(V.button,{...n,ref:t})});k_.displayName=`SelectClearTrigger`;var A_=(0,P.forwardRef)((e,t)=>{let n=O_(),r=Gs(),i=L(n.getContentProps(),r.getPresenceProps(),e),a=Ir(r.ref,t);return(0,F.jsx)(Us,{presence:r,children:(0,F.jsx)(V.div,{...i,ref:a})})});A_.displayName=`SelectContent`;var j_=e=>e.children(O_()),M_=(0,P.forwardRef)((e,t)=>{let n=L(O_().getControlProps(),e);return(0,F.jsx)(V.div,{...n,ref:t})});M_.displayName=`SelectControl`;var N_=(0,P.forwardRef)((e,t)=>{let n=O_(),r=L(n.getHiddenSelectProps(),e),i=n.value.length===0,a=Lg();return(0,F.jsxs)(V.select,{"aria-describedby":a?.ariaDescribedby,...r,ref:t,children:[i&&(0,F.jsx)(`option`,{value:``}),n.collection.items.map((e,t)=>(0,F.jsx)(`option`,{value:n.collection.getItemValue(e)??``,disabled:n.collection.getItemDisabled(e),children:n.collection.stringifyItem(e)},t))]})});N_.displayName=`SelectHiddenSelect`;var P_=(0,P.forwardRef)((e,t)=>{let n=L(O_().getIndicatorProps(),e);return(0,F.jsx)(V.div,{...n,ref:t})});P_.displayName=`SelectIndicator`;var[F_,I_]=Mr({name:`SelectItemContext`,hookName:`useSelectItemContext`,providerName:`<SelectItemProvider />`}),[L_,R_]=Mr({name:`SelectItemPropsContext`,hookName:`useSelectItemPropsContext`,providerName:`<SelectItemPropsProvider />`}),z_=xs(),B_=(0,P.forwardRef)((e,t)=>{let[n,r]=z_(e,[`item`,`persistFocus`]),i=O_(),a=L(i.getItemProps(n),r),o=i.getItemState(n);return(0,F.jsx)(L_,{value:n,children:(0,F.jsx)(F_,{value:o,children:(0,F.jsx)(V.div,{...a,ref:t})})})});B_.displayName=`SelectItem`;var V_=e=>e.children(I_()),[H_,U_]=Mr({name:`SelectItemGroupPropsContext`,hookName:`useSelectItemGroupPropsContext`,providerName:`<SelectItemGroupPropsProvider />`}),W_=xs(),G_=(0,P.forwardRef)((e,t)=>{let n=(0,P.useId)(),[r,i]=W_(e,[`id`]),a={id:n,...r},o=L(O_().getItemGroupProps(a),i);return(0,F.jsx)(H_,{value:a,children:(0,F.jsx)(V.div,{...o,ref:t})})});G_.displayName=`SelectItemGroup`;var K_=(0,P.forwardRef)((e,t)=>{let n=O_(),r=U_(),i=L(n.getItemGroupLabelProps({htmlFor:r.id}),e);return(0,F.jsx)(V.div,{...i,ref:t})});K_.displayName=`SelectItemGroupLabel`;var q_=(0,P.forwardRef)((e,t)=>{let n=O_(),r=R_(),i=L(n.getItemIndicatorProps(r),e);return(0,F.jsx)(V.div,{...i,ref:t})});q_.displayName=`SelectItemIndicator`;var J_=(0,P.forwardRef)((e,t)=>{let n=O_(),r=R_(),i=L(n.getItemTextProps(r),e);return(0,F.jsx)(V.span,{...i,ref:t})});J_.displayName=`SelectItemText`;var Y_=(0,P.forwardRef)((e,t)=>{let n=L(O_().getLabelProps(),e);return(0,F.jsx)(V.label,{...n,ref:t})});Y_.displayName=`SelectLabel`;var X_=(0,P.forwardRef)((e,t)=>{let n=L(O_().getListProps(),e);return(0,F.jsx)(V.div,{...n,ref:t})});X_.displayName=`SelectList`;var Z_=(0,P.forwardRef)((e,t)=>{let n=L(O_().getPositionerProps(),e);return Gs().unmounted?null:(0,F.jsx)(V.div,{...n,ref:t})});Z_.displayName=`SelectPositioner`;var Q_=e=>{let t=(0,P.useId)(),{dir:n}=vs(),{getRootNode:r}=Pr(),i=Lg();return Gm(Ns(Xm,{id:t,ids:{label:i?.ids.label,hiddenSelect:i?.ids.control},disabled:i?.disabled,readOnly:i?.readOnly,invalid:i?.invalid,required:i?.required,dir:n,getRootNode:r,...e}),Rs)},$_=(0,P.forwardRef)((e,t)=>{let[n,r]=Ss(e),[i,a]=xs()(r,`closeOnSelect.collection.composite.defaultHighlightedValue.defaultOpen.defaultValue.deselectable.disabled.form.highlightedValue.id.ids.invalid.loopFocus.multiple.name.onFocusOutside.onHighlightChange.onInteractOutside.onOpenChange.onPointerDownOutside.onSelect.onValueChange.open.positioning.readOnly.required.scrollToIndexFn.translations.autoComplete.value`.split(`.`)),o=Q_(i),s=Hs(L({present:o.open},n)),c=L(o.getRootProps(),a);return(0,F.jsx)(D_,{value:o,children:(0,F.jsx)(Ws,{value:s,children:(0,F.jsx)(V.div,{...c,ref:t})})})}),ev=(0,P.forwardRef)((e,t)=>{let[n,r]=Ss(e),[{value:i},a]=xs()(r,[`value`]),o=Hs(L({present:i.open},n)),s=L(i.getRootProps(),a);return(0,F.jsx)(D_,{value:i,children:(0,F.jsx)(Ws,{value:o,children:(0,F.jsx)(V.div,{...s,ref:t})})})}),tv=(0,P.forwardRef)((e,t)=>{let n=L(O_().getTriggerProps(),e);return(0,F.jsx)(V.button,{...n,ref:t})});tv.displayName=`SelectTrigger`;var nv=(0,P.forwardRef)((e,t)=>{let{children:n,placeholder:r,...i}=e,a=O_(),o=L(a.getValueTextProps(),i);return(0,F.jsx)(V.span,{...o,ref:t,children:n||a.valueAsString||r})});nv.displayName=`SelectValueText`;var rv=bs({ClearTrigger:()=>k_,Content:()=>A_,Context:()=>j_,Control:()=>M_,HiddenSelect:()=>N_,Indicator:()=>P_,Item:()=>B_,ItemContext:()=>V_,ItemGroup:()=>G_,ItemGroupLabel:()=>K_,ItemIndicator:()=>q_,ItemText:()=>J_,Label:()=>Y_,List:()=>X_,Positioner:()=>Z_,Root:()=>$_,RootProvider:()=>ev,Trigger:()=>tv,ValueText:()=>nv}),iv=e=>ig(e),[av,ov]=Mr({name:`SplitterContext`,hookName:`useSplitterContext`,providerName:`<SplitterProvider />`}),sv=e=>e.children(ov()),cv=xs(),lv=(0,P.forwardRef)((e,t)=>{let[n,r]=cv(e,[`id`]),i=L(ov().getPanelProps(n),r);return(0,F.jsx)(V.div,{...i,ref:t})});lv.displayName=`SplitterPanel`;var[uv,dv]=Mr({name:`SplitterResizeTriggerPropsContext`,hookName:`useSplitterResizeTriggerPropsContext`,providerName:`<SplitterResizeTriggerPropsProvider />`}),fv=xs(),pv=(0,P.forwardRef)((e,t)=>{let[n,r]=fv(e,[`disabled`,`id`]),i=L(ov().getResizeTriggerProps(n),r);return(0,F.jsx)(uv,{value:n,children:(0,F.jsx)(V.button,{ref:t,...i})})});pv.displayName=`SplitterResizeTrigger`;var mv=(0,P.forwardRef)((e,t)=>{let n=ov(),r=dv(),i=L(n.getResizeTriggerIndicator(r),e);return(0,F.jsx)(V.div,{ref:t,...i})});mv.displayName=`SplitterResizeTriggerIndicator`;var hv=e=>{let t=(0,P.useId)(),{getRootNode:n}=Pr(),{dir:r}=vs();return Hh(Ns(qh,{id:t,dir:r,getRootNode:n,...e}),Rs)},gv=xs(),_v=(0,P.forwardRef)((e,t)=>{let[n,r]=gv(e,[`defaultSize`,`id`,`ids`,`keyboardResizeBy`,`nonce`,`onCollapse`,`onExpand`,`onResize`,`onResizeEnd`,`onResizeStart`,`orientation`,`panels`,`registry`,`size`]),i=hv(n),a=L(i.getRootProps(),r);return(0,F.jsx)(av,{value:i,children:(0,F.jsx)(V.div,{...a,ref:t})})});_v.displayName=`SplitterRoot`;var vv=xs(),yv=(0,P.forwardRef)((e,t)=>{let[{value:n},r]=vv(e,[`value`]),i=L(n.getRootProps(),r);return(0,F.jsx)(av,{value:n,children:(0,F.jsx)(V.div,{...i,ref:t})})});yv.displayName=`SplitterRootProvider`;var bv=bs({Context:()=>sv,Panel:()=>lv,ResizeTrigger:()=>pv,ResizeTriggerIndicator:()=>mv,Root:()=>_v,RootProvider:()=>yv,createRegistry:()=>iv,getLayout:()=>Rh}),[xv,Sv]=Mr({name:`SwitchContext`,hookName:`useSwitchContext`,providerName:`<SwitchProvider />`}),Cv=e=>e.children(Sv()),wv=(0,P.forwardRef)((e,t)=>{let n=L(Sv().getControlProps(),e);return(0,F.jsx)(V.span,{...n,ref:t})});wv.displayName=`SwitchControl`;var Tv=(0,P.forwardRef)((e,t)=>{let n=L(Sv().getHiddenInputProps(),e),r=Lg();return(0,F.jsx)(V.input,{"aria-describedby":r?.ariaDescribedby,...n,ref:t})});Tv.displayName=`SwitchHiddenInput`;var Ev=(0,P.forwardRef)((e,t)=>{let n=L(Sv().getLabelProps(),e);return(0,F.jsx)(V.span,{...n,ref:t})});Ev.displayName=`SwitchLabel`;var Dv=e=>{let t=(0,P.useId)(),{getRootNode:n}=Pr(),{dir:r}=vs(),i=Lg();return mg(Ns(gg,{id:t,ids:{label:i?.ids.label,hiddenInput:i?.ids.control},dir:r,disabled:i?.disabled,readOnly:i?.readOnly,invalid:i?.invalid,required:i?.required,getRootNode:n,...e}),Rs)},Ov=xs(),kv=(0,P.forwardRef)((e,t)=>{let[n,r]=Ov(e,[`checked`,`defaultChecked`,`disabled`,`form`,`id`,`ids`,`invalid`,`label`,`name`,`onCheckedChange`,`readOnly`,`required`,`value`]),i=Dv(n),a=L(i.getRootProps(),r);return(0,F.jsx)(xv,{value:i,children:(0,F.jsx)(V.label,{...a,ref:t})})});kv.displayName=`SwitchRoot`;var Av=xs(),jv=(0,P.forwardRef)((e,t)=>{let[{value:n},r]=Av(e,[`value`]),i=L(n.getRootProps(),r);return(0,F.jsx)(xv,{value:n,children:(0,F.jsx)(V.label,{...i,ref:t})})});jv.displayName=`SwitchRootProvider`;var Mv=(0,P.forwardRef)((e,t)=>{let n=L(Sv().getThumbProps(),e);return(0,F.jsx)(V.span,{...n,ref:t})});Mv.displayName=`SwitchThumb`;var Nv=bs({Context:()=>Cv,Control:()=>wv,HiddenInput:()=>Tv,Label:()=>Ev,Root:()=>kv,RootProvider:()=>jv,Thumb:()=>Mv});function Pv(e,t=[]){let n=Object.assign({},e);for(let e of t)e in n&&delete n[e];return n}var Fv=(e,t)=>{if(!e||typeof e!=`string`)return{invalid:!0,value:e};let[n,r]=e.split(`/`);if(!n||!r||n===`currentBg`)return{invalid:!0,value:n};let i=t(`colors.${n}`),a=t.raw(`opacity.${r}`)?.value;if(!a&&isNaN(Number(r)))return{invalid:!0,value:n};let o=a?Number(a)*100+`%`:`${r}%`,s=i??n;return{invalid:!1,color:s,value:`color-mix(in srgb, ${s} ${o}, transparent)`}},Iv=e=>(t,n)=>{let r=n.utils.colorMix(t);if(r.invalid)return{[e]:t};let i=`--mix-`+e;return{[i]:r.value,[e]:`var(${i}, ${r.color})`}};function Lv(e){if(typeof e!=`object`||!e)return e;if(Array.isArray(e))return e.map(e=>Lv(e));let t=Object.create(Object.getPrototypeOf(e));for(let n of Object.keys(e))t[n]=Lv(e[n]);return t}function Rv(e,t){if(t==null)return e;for(let n of Object.keys(t))if(t[n]!==void 0&&n!==`__proto__`){if(!Gt(e[n])&&Gt(t[n]))Object.assign(e,{[n]:t[n]});else if(e[n]&&Gt(t[n]))Rv(e[n],t[n]);else if(Array.isArray(t[n])&&Array.isArray(e[n])){let r=0;for(;r<t[n].length;r++)Gt(e[n][r])&&Gt(t[n][r])?Rv(e[n][r],t[n][r]):e[n][r]=t[n][r]}else Object.assign(e,{[n]:t[n]})}return e}function zv(e,...t){for(let n of t)Rv(e,n);return e}var Bv=e=>e!=null;function Vv(e,t,n={}){let{stop:r,getKey:i}=n;function a(e,n=[]){if(Gt(e)||Array.isArray(e)){let o={};for(let[s,c]of Object.entries(e)){let l=i?.(s,c)??s,u=[...n,l];if(r?.(e,u))return t(e,n);let d=a(c,u);Bv(d)&&(o[l]=d)}return o}return t(e,n)}return a(e)}function Hv(e,t){return Array.isArray(e)?e.map(e=>Bv(e)?t(e):e):Gt(e)?Vv(e,e=>t(e)):Bv(e)?t(e):e}var Uv=[`value`,`type`,`description`],Wv=e=>e&&typeof e==`object`&&!Array.isArray(e),Gv=(...e)=>{let t=zv({},...e.map(Lv));return t.theme?.tokens&&Vv(t.theme.tokens,e=>{let t=Object.keys(e).filter(e=>!Uv.includes(e)).length>0,n=Uv.some(t=>e[t]!=null);return t&&n&&(e.DEFAULT||={},Uv.forEach(t=>{var n;e[t]!=null&&((n=e.DEFAULT)[t]||(n[t]=e[t]),delete e[t])})),e},{stop(e){return Wv(e)&&Uv.some(t=>e[t]!=null)}}),t},Kv=e=>e,qv=e=>e,G=e=>e,Jv=e=>e,Yv=e=>e,Xv=e=>e,Zv=e=>e,Qv=e=>e,$v=e=>e;function ey(){let e=e=>e;return new Proxy(e,{get(){return e}})}var ty=ey(),ny=ey(),ry=e=>e,iy=/[^a-zA-Z0-9_\u0081-\uffff-]/g;function ay(e){return`${e}`.replace(iy,e=>`\\${e}`)}var oy=/[A-Z]/g;function sy(e){return e.replace(oy,e=>`-${e.toLowerCase()}`)}function cy(e,t={}){let{fallback:n=``,prefix:r=``}=t,i=sy([`-`,r,ay(e)].filter(Boolean).join(`-`));return{var:i,ref:`var(${i}${n?`, ${n}`:``})`}}var ly=e=>/^var\(--.+\)$/.test(e),uy=(e,t)=>t==null?t:`${e}(${t})`,dy=e=>{if(ly(e)||e==null)return e;let t=typeof e==`string`&&!e.endsWith(`deg`);return typeof e==`number`||t?`${e}deg`:e},fy=e=>({values:[`outside`,`inside`,`mixed`,`none`],transform(t,{token:n}){let r=n(`colors.colorPalette.focusRing`);return{inside:{"--focus-ring-color":r,[e]:{outlineOffset:`0px`,outlineWidth:`var(--focus-ring-width, 1px)`,outlineColor:`var(--focus-ring-color)`,outlineStyle:`var(--focus-ring-style, solid)`,borderColor:`var(--focus-ring-color)`}},outside:{"--focus-ring-color":r,[e]:{outlineWidth:`var(--focus-ring-width, 2px)`,outlineOffset:`var(--focus-ring-offset, 2px)`,outlineStyle:`var(--focus-ring-style, solid)`,outlineColor:`var(--focus-ring-color)`}},mixed:{"--focus-ring-color":r,[e]:{outlineWidth:`var(--focus-ring-width, 3px)`,outlineStyle:`var(--focus-ring-style, solid)`,outlineColor:`color-mix(in srgb, var(--focus-ring-color), transparent 60%)`,borderColor:`var(--focus-ring-color)`}},none:{"--focus-ring-color":r,[e]:{outline:`none`}}}[t]??{}}}),py=Iv(`borderColor`),my=e=>({transition:e,transitionTimingFunction:`cubic-bezier(0.4, 0, 0.2, 1)`,transitionDuration:`150ms`}),hy=Kv({hover:[`@media (hover: hover)`,`&:is(:hover, [data-hover]):not(:disabled, [data-disabled])`],active:`&:is(:active, [data-active]):not(:disabled, [data-disabled], [data-state=open])`,focus:`&:is(:focus, [data-focus])`,focusWithin:`&:is(:focus-within, [data-focus-within])`,focusVisible:`&:is(:focus-visible, [data-focus-visible])`,disabled:`&:is(:disabled, [disabled], [data-disabled], [aria-disabled=true])`,visited:`&:visited`,target:`&:target`,readOnly:`&:is([data-readonly], [aria-readonly=true], [readonly])`,readWrite:`&:read-write`,empty:`&:is(:empty, [data-empty])`,checked:`&:is(:checked, [data-checked], [aria-checked=true], [data-state=checked])`,enabled:`&:enabled`,expanded:`&:is([aria-expanded=true], [data-expanded], [data-state=expanded])`,highlighted:`&[data-highlighted]`,complete:`&[data-complete]`,incomplete:`&[data-incomplete]`,dragging:`&[data-dragging]`,before:`&::before`,after:`&::after`,firstLetter:`&::first-letter`,firstLine:`&::first-line`,marker:`&::marker`,selection:`&::selection`,file:`&::file-selector-button`,backdrop:`&::backdrop`,first:`&:first-of-type`,last:`&:last-of-type`,notFirst:`&:not(:first-of-type)`,notLast:`&:not(:last-of-type)`,only:`&:only-child`,even:`&:nth-of-type(even)`,odd:`&:nth-of-type(odd)`,peerFocus:`.peer:is(:focus, [data-focus]) ~ &`,peerHover:`.peer:is(:hover, [data-hover]):not(:disabled, [data-disabled]) ~ &`,peerActive:`.peer:is(:active, [data-active]):not(:disabled, [data-disabled]) ~ &`,peerFocusWithin:`.peer:focus-within ~ &`,peerFocusVisible:`.peer:is(:focus-visible, [data-focus-visible]) ~ &`,peerDisabled:`.peer:is(:disabled, [disabled], [data-disabled]) ~ &`,peerChecked:`.peer:is(:checked, [data-checked], [aria-checked=true], [data-state=checked]) ~ &`,peerInvalid:`.peer:is(:invalid, [data-invalid], [aria-invalid=true]) ~ &`,peerExpanded:`.peer:is([aria-expanded=true], [data-expanded], [data-state=expanded]) ~ &`,peerPlaceholderShown:`.peer:placeholder-shown ~ &`,groupFocus:`.group:is(:focus, [data-focus]) &`,groupHover:`.group:is(:hover, [data-hover]):not(:disabled, [data-disabled]) &`,groupActive:`.group:is(:active, [data-active]):not(:disabled, [data-disabled]) &`,groupFocusWithin:`.group:focus-within &`,groupFocusVisible:`.group:is(:focus-visible, [data-focus-visible]) &`,groupDisabled:`.group:is(:disabled, [disabled], [data-disabled]) &`,groupChecked:`.group:is(:checked, [data-checked], [aria-checked=true], [data-state=checked]) &`,groupExpanded:`.group:is([aria-expanded=true], [data-expanded], [data-state=expanded]) &`,groupInvalid:`.group:invalid &`,indeterminate:`&:is(:indeterminate, [data-indeterminate], [aria-checked=mixed], [data-state=indeterminate])`,required:`&:is([data-required], [aria-required=true])`,valid:`&:is([data-valid], [data-state=valid])`,invalid:`&:is([data-invalid], [aria-invalid=true], [data-state=invalid])`,autofill:`&:autofill`,inRange:`&:is(:in-range, [data-in-range])`,outOfRange:`&:is(:out-of-range, [data-outside-range])`,placeholder:`&::placeholder, &[data-placeholder]`,placeholderShown:`&:is(:placeholder-shown, [data-placeholder-shown])`,pressed:`&:is([aria-pressed=true], [data-pressed])`,selected:`&:is([aria-selected=true], [data-selected])`,grabbed:`&:is([aria-grabbed=true], [data-grabbed])`,underValue:`&[data-state=under-value]`,overValue:`&[data-state=over-value]`,atValue:`&[data-state=at-value]`,default:`&:default`,optional:`&:optional`,open:`&:is([open], [data-open], [data-state=open])`,closed:`&:is([closed], [data-closed], [data-state=closed])`,fullscreen:`&:is(:fullscreen, [data-fullscreen])`,loading:`&:is([data-loading], [aria-busy=true])`,hidden:`&:is([hidden], [data-hidden])`,current:`&[data-current]`,currentPage:`&[aria-current=page]`,currentStep:`&[aria-current=step]`,today:`&[data-today]`,unavailable:`&[data-unavailable]`,rangeStart:`&[data-range-start]`,rangeEnd:`&[data-range-end]`,now:`&[data-now]`,topmost:`&[data-topmost]`,motionReduce:`@media (prefers-reduced-motion: reduce)`,motionSafe:`@media (prefers-reduced-motion: no-preference)`,print:`@media print`,landscape:`@media (orientation: landscape)`,portrait:`@media (orientation: portrait)`,dark:`.dark &, .dark .chakra-theme:not(.light) &`,light:`:root &, .light &`,osDark:`@media (prefers-color-scheme: dark)`,osLight:`@media (prefers-color-scheme: light)`,highContrast:`@media (forced-colors: active)`,lessContrast:`@media (prefers-contrast: less)`,moreContrast:`@media (prefers-contrast: more)`,ltr:`[dir=ltr] &`,rtl:`[dir=rtl] &`,scrollbar:`&::-webkit-scrollbar`,scrollbarThumb:`&::-webkit-scrollbar-thumb`,scrollbarTrack:`&::-webkit-scrollbar-track`,horizontal:`&[data-orientation=horizontal]`,vertical:`&[data-orientation=vertical]`,icon:`& :where(svg)`,starting:`@starting-style`}),gy=cy(`bg-currentcolor`),_y=e=>e===gy.ref||e===`currentBg`,vy=e=>({...e(`colors`),currentBg:gy}),yy=ry({conditions:hy,utilities:{background:{values:vy,shorthand:[`bg`],transform(e,t){if(_y(t.raw))return{background:gy.ref};let n=Iv(`background`)(e,t);return{...n,[gy.var]:n?.background}}},backgroundColor:{values:vy,shorthand:[`bgColor`],transform(e,t){if(_y(t.raw))return{backgroundColor:gy.ref};let n=Iv(`backgroundColor`)(e,t);return{...n,[gy.var]:n?.backgroundColor}}},backgroundSize:{shorthand:[`bgSize`]},backgroundPosition:{shorthand:[`bgPos`]},backgroundRepeat:{shorthand:[`bgRepeat`]},backgroundAttachment:{shorthand:[`bgAttachment`]},backgroundClip:{shorthand:[`bgClip`],values:[`text`],transform(e){return e===`text`?{color:`transparent`,backgroundClip:`text`}:{backgroundClip:e}}},backgroundGradient:{shorthand:[`bgGradient`],values(e){return{...e(`gradients`),"to-t":`linear-gradient(to top, var(--gradient))`,"to-tr":`linear-gradient(to top right, var(--gradient))`,"to-r":`linear-gradient(to right, var(--gradient))`,"to-br":`linear-gradient(to bottom right, var(--gradient))`,"to-b":`linear-gradient(to bottom, var(--gradient))`,"to-bl":`linear-gradient(to bottom left, var(--gradient))`,"to-l":`linear-gradient(to left, var(--gradient))`,"to-tl":`linear-gradient(to top left, var(--gradient))`}},transform(e){return{"--gradient-stops":`var(--gradient-from), var(--gradient-to)`,"--gradient":`var(--gradient-via-stops, var(--gradient-stops))`,backgroundImage:e}}},gradientFrom:{values:vy,transform:Iv(`--gradient-from`)},gradientTo:{values:vy,transform:Iv(`--gradient-to`)},gradientVia:{values:vy,transform(e,t){return{...Iv(`--gradient-via`)(e,t),"--gradient-via-stops":`var(--gradient-from), var(--gradient-via), var(--gradient-to)`}}},backgroundImage:{values(e){return{...e(`gradients`),...e(`assets`)}},shorthand:[`bgImg`,`bgImage`]},border:{values:`borders`},borderTop:{values:`borders`},borderLeft:{values:`borders`},borderBlockStart:{values:`borders`},borderRight:{values:`borders`},borderBottom:{values:`borders`},borderBlockEnd:{values:`borders`},borderInlineStart:{values:`borders`,shorthand:[`borderStart`]},borderInlineEnd:{values:`borders`,shorthand:[`borderEnd`]},borderInline:{values:`borders`,shorthand:[`borderX`]},borderBlock:{values:`borders`,shorthand:[`borderY`]},borderColor:{values:vy,transform:Iv(`borderColor`)},borderTopColor:{values:vy,transform:Iv(`borderTopColor`)},borderBlockStartColor:{values:vy,transform:Iv(`borderBlockStartColor`)},borderBottomColor:{values:vy,transform:Iv(`borderBottomColor`)},borderBlockEndColor:{values:vy,transform:Iv(`borderBlockEndColor`)},borderLeftColor:{values:vy,transform:Iv(`borderLeftColor`)},borderInlineStartColor:{values:vy,shorthand:[`borderStartColor`],transform:Iv(`borderInlineStartColor`)},borderRightColor:{values:vy,transform:Iv(`borderRightColor`)},borderInlineEndColor:{values:vy,shorthand:[`borderEndColor`],transform:Iv(`borderInlineEndColor`)},borderStyle:{values:`borderStyles`},borderTopStyle:{values:`borderStyles`},borderBlockStartStyle:{values:`borderStyles`},borderBottomStyle:{values:`borderStyles`},borderBlockEndStyle:{values:`borderStyles`},borderInlineStartStyle:{values:`borderStyles`,shorthand:[`borderStartStyle`]},borderInlineEndStyle:{values:`borderStyles`,shorthand:[`borderEndStyle`]},borderLeftStyle:{values:`borderStyles`},borderRightStyle:{values:`borderStyles`},borderRadius:{values:`radii`,shorthand:[`rounded`]},borderTopLeftRadius:{values:`radii`,shorthand:[`roundedTopLeft`]},borderStartStartRadius:{values:`radii`,shorthand:[`roundedStartStart`,`borderTopStartRadius`]},borderEndStartRadius:{values:`radii`,shorthand:[`roundedEndStart`,`borderBottomStartRadius`]},borderTopRightRadius:{values:`radii`,shorthand:[`roundedTopRight`]},borderStartEndRadius:{values:`radii`,shorthand:[`roundedStartEnd`,`borderTopEndRadius`]},borderEndEndRadius:{values:`radii`,shorthand:[`roundedEndEnd`,`borderBottomEndRadius`]},borderBottomLeftRadius:{values:`radii`,shorthand:[`roundedBottomLeft`]},borderBottomRightRadius:{values:`radii`,shorthand:[`roundedBottomRight`]},borderInlineStartRadius:{values:`radii`,property:`borderRadius`,shorthand:[`roundedStart`,`borderStartRadius`],transform:e=>({borderStartStartRadius:e,borderEndStartRadius:e})},borderInlineEndRadius:{values:`radii`,property:`borderRadius`,shorthand:[`roundedEnd`,`borderEndRadius`],transform:e=>({borderStartEndRadius:e,borderEndEndRadius:e})},borderTopRadius:{values:`radii`,property:`borderRadius`,shorthand:[`roundedTop`],transform:e=>({borderTopLeftRadius:e,borderTopRightRadius:e})},borderBottomRadius:{values:`radii`,property:`borderRadius`,shorthand:[`roundedBottom`],transform:e=>({borderBottomLeftRadius:e,borderBottomRightRadius:e})},borderLeftRadius:{values:`radii`,property:`borderRadius`,shorthand:[`roundedLeft`],transform:e=>({borderTopLeftRadius:e,borderBottomLeftRadius:e})},borderRightRadius:{values:`radii`,property:`borderRadius`,shorthand:[`roundedRight`],transform:e=>({borderTopRightRadius:e,borderBottomRightRadius:e})},borderWidth:{values:`borderWidths`},borderBlockStartWidth:{values:`borderWidths`},borderTopWidth:{values:`borderWidths`},borderBottomWidth:{values:`borderWidths`},borderBlockEndWidth:{values:`borderWidths`},borderRightWidth:{values:`borderWidths`},borderInlineWidth:{values:`borderWidths`,shorthand:[`borderXWidth`]},borderInlineStartWidth:{values:`borderWidths`,shorthand:[`borderStartWidth`]},borderInlineEndWidth:{values:`borderWidths`,shorthand:[`borderEndWidth`]},borderLeftWidth:{values:`borderWidths`},borderBlockWidth:{values:`borderWidths`,shorthand:[`borderYWidth`]},color:{values:vy,transform:Iv(`color`)},fill:{values:vy,transform:Iv(`fill`)},stroke:{values:vy,transform:Iv(`stroke`)},accentColor:{values:vy,transform:Iv(`accentColor`)},divideX:{values:{type:`string`},transform(e){return{"& > :not(style, [hidden]) ~ :not(style, [hidden])":{borderInlineStartWidth:e,borderInlineEndWidth:`0px`}}}},divideY:{values:{type:`string`},transform(e){return{"& > :not(style, [hidden]) ~ :not(style, [hidden])":{borderTopWidth:e,borderBottomWidth:`0px`}}}},divideColor:{values:vy,transform(e,t){return{"& > :not(style, [hidden]) ~ :not(style, [hidden])":py(e,t)}}},divideStyle:{property:`borderStyle`,transform(e){return{"& > :not(style, [hidden]) ~ :not(style, [hidden])":{borderStyle:e}}}},boxShadow:{values:`shadows`,shorthand:[`shadow`]},boxShadowColor:{values:vy,transform:Iv(`--shadow-color`),shorthand:[`shadowColor`]},mixBlendMode:{shorthand:[`blendMode`]},backgroundBlendMode:{shorthand:[`bgBlendMode`]},opacity:{values:`opacity`},filter:{transform(e){return e===`auto`?{filter:`var(--blur) var(--brightness) var(--contrast) var(--grayscale) var(--hue-rotate) var(--invert) var(--saturate) var(--sepia) var(--drop-shadow)`}:{filter:e}}},blur:{values:`blurs`,transform:e=>({"--blur":uy(`blur`,e)})},brightness:{transform:e=>({"--brightness":uy(`brightness`,e)})},contrast:{transform:e=>({"--contrast":uy(`contrast`,e)})},grayscale:{transform:e=>({"--grayscale":uy(`grayscale`,e)})},hueRotate:{transform:e=>({"--hue-rotate":uy(`hue-rotate`,dy(e))})},invert:{transform:e=>({"--invert":uy(`invert`,e)})},saturate:{transform:e=>({"--saturate":uy(`saturate`,e)})},sepia:{transform:e=>({"--sepia":uy(`sepia`,e)})},dropShadow:{transform:e=>({"--drop-shadow":uy(`drop-shadow`,e)})},backdropFilter:{transform(e){return e===`auto`?{backdropFilter:`var(--backdrop-blur) var(--backdrop-brightness) var(--backdrop-contrast) var(--backdrop-grayscale) var(--backdrop-hue-rotate) var(--backdrop-invert) var(--backdrop-opacity) var(--backdrop-saturate) var(--backdrop-sepia)`}:{backdropFilter:e}}},backdropBlur:{values:`blurs`,transform:e=>({"--backdrop-blur":uy(`blur`,e)})},backdropBrightness:{transform:e=>({"--backdrop-brightness":uy(`brightness`,e)})},backdropContrast:{transform:e=>({"--backdrop-contrast":uy(`contrast`,e)})},backdropGrayscale:{transform:e=>({"--backdrop-grayscale":uy(`grayscale`,e)})},backdropHueRotate:{transform:e=>({"--backdrop-hue-rotate":uy(`hue-rotate`,dy(e))})},backdropInvert:{transform:e=>({"--backdrop-invert":uy(`invert`,e)})},backdropOpacity:{transform:e=>({"--backdrop-opacity":uy(`opacity`,e)})},backdropSaturate:{transform:e=>({"--backdrop-saturate":uy(`saturate`,e)})},backdropSepia:{transform:e=>({"--backdrop-sepia":uy(`sepia`,e)})},flexBasis:{values:`sizes`},gap:{values:`spacing`},rowGap:{values:`spacing`,shorthand:[`gapY`]},columnGap:{values:`spacing`,shorthand:[`gapX`]},flexDirection:{shorthand:[`flexDir`]},gridGap:{values:`spacing`},gridColumnGap:{values:`spacing`},gridRowGap:{values:`spacing`},outlineColor:{values:vy,transform:Iv(`outlineColor`)},focusRing:fy(`&:is(:focus, [data-focus])`),focusVisibleRing:fy(`&:is(:focus-visible, [data-focus-visible])`),focusRingColor:{values:vy,transform:Iv(`--focus-ring-color`)},focusRingOffset:{values:`spacing`,transform:e=>({"--focus-ring-offset":e})},focusRingWidth:{values:`borderWidths`,property:`outlineWidth`,transform:e=>({"--focus-ring-width":e})},focusRingStyle:{values:`borderStyles`,property:`outlineStyle`,transform:e=>({"--focus-ring-style":e})},aspectRatio:{values:`aspectRatios`},width:{values:`sizes`,shorthand:[`w`]},inlineSize:{values:`sizes`},height:{values:`sizes`,shorthand:[`h`]},blockSize:{values:`sizes`},boxSize:{values:`sizes`,property:`width`,transform:e=>({width:e,height:e})},minWidth:{values:`sizes`,shorthand:[`minW`]},minInlineSize:{values:`sizes`},minHeight:{values:`sizes`,shorthand:[`minH`]},minBlockSize:{values:`sizes`},maxWidth:{values:`sizes`,shorthand:[`maxW`]},maxInlineSize:{values:`sizes`},maxHeight:{values:`sizes`,shorthand:[`maxH`]},maxBlockSize:{values:`sizes`},hideFrom:{values:`breakpoints`,transform:(e,{raw:t,token:n})=>({[n.raw(`breakpoints.${t}`)?`@breakpoint ${t}`:`@media screen and (min-width: ${e})`]:{display:`none`}})},hideBelow:{values:`breakpoints`,transform(e,{raw:t,token:n}){return{[n.raw(`breakpoints.${t}`)?`@breakpoint ${t}Down`:`@media screen and (max-width: ${e})`]:{display:`none`}}}},overscrollBehavior:{shorthand:[`overscroll`]},overscrollBehaviorX:{shorthand:[`overscrollX`]},overscrollBehaviorY:{shorthand:[`overscrollY`]},scrollbar:{values:[`visible`,`hidden`],transform(e){switch(e){case`visible`:return{msOverflowStyle:`auto`,scrollbarWidth:`auto`,"&::-webkit-scrollbar":{display:`block`}};case`hidden`:return{msOverflowStyle:`none`,scrollbarWidth:`none`,"&::-webkit-scrollbar":{display:`none`}};default:return{}}}},scrollbarColor:{values:vy,transform:Iv(`scrollbarColor`)},scrollbarGutter:{values:`spacing`},scrollbarWidth:{values:`sizes`},scrollMargin:{values:`spacing`},scrollMarginTop:{values:`spacing`},scrollMarginBottom:{values:`spacing`},scrollMarginLeft:{values:`spacing`},scrollMarginRight:{values:`spacing`},scrollMarginX:{values:`spacing`,transform:e=>({scrollMarginLeft:e,scrollMarginRight:e})},scrollMarginY:{values:`spacing`,transform:e=>({scrollMarginTop:e,scrollMarginBottom:e})},scrollPadding:{values:`spacing`},scrollPaddingTop:{values:`spacing`},scrollPaddingBottom:{values:`spacing`},scrollPaddingLeft:{values:`spacing`},scrollPaddingRight:{values:`spacing`},scrollPaddingInline:{values:`spacing`,shorthand:[`scrollPaddingX`]},scrollPaddingBlock:{values:`spacing`,shorthand:[`scrollPaddingY`]},scrollSnapType:{values:{none:`none`,x:`x var(--scroll-snap-strictness)`,y:`y var(--scroll-snap-strictness)`,both:`both var(--scroll-snap-strictness)`}},scrollSnapStrictness:{values:[`mandatory`,`proximity`],transform:e=>({"--scroll-snap-strictness":e})},scrollSnapMargin:{values:`spacing`},scrollSnapMarginTop:{values:`spacing`},scrollSnapMarginBottom:{values:`spacing`},scrollSnapMarginLeft:{values:`spacing`},scrollSnapMarginRight:{values:`spacing`},listStylePosition:{shorthand:[`listStylePos`]},listStyleImage:{values:`assets`,shorthand:[`listStyleImg`]},position:{shorthand:[`pos`]},zIndex:{values:`zIndex`},inset:{values:`spacing`},insetInline:{values:`spacing`,shorthand:[`insetX`]},insetBlock:{values:`spacing`,shorthand:[`insetY`]},top:{values:`spacing`},insetBlockStart:{values:`spacing`},bottom:{values:`spacing`},insetBlockEnd:{values:`spacing`},left:{values:`spacing`},right:{values:`spacing`},insetInlineStart:{values:`spacing`,shorthand:[`insetStart`]},insetInlineEnd:{values:`spacing`,shorthand:[`insetEnd`]},ring:{transform(e){return{"--ring-offset-shadow":`var(--ring-inset) 0 0 0 var(--ring-offset-width) var(--ring-offset-color)`,"--ring-shadow":`var(--ring-inset) 0 0 0 calc(var(--ring-width) + var(--ring-offset-width)) var(--ring-color)`,"--ring-width":e,boxShadow:`var(--ring-offset-shadow), var(--ring-shadow), var(--shadow, 0 0 #0000)`}}},ringColor:{values:vy,transform:Iv(`--ring-color`)},ringOffset:{transform:e=>({"--ring-offset-width":e})},ringOffsetColor:{values:vy,transform:Iv(`--ring-offset-color`)},ringInset:{transform:e=>({"--ring-inset":e})},margin:{values:`spacing`,shorthand:[`m`]},marginTop:{values:`spacing`,shorthand:[`mt`]},marginBlockStart:{values:`spacing`},marginRight:{values:`spacing`,shorthand:[`mr`]},marginBottom:{values:`spacing`,shorthand:[`mb`]},marginBlockEnd:{values:`spacing`},marginLeft:{values:`spacing`,shorthand:[`ml`]},marginInlineStart:{values:`spacing`,shorthand:[`ms`,`marginStart`]},marginInlineEnd:{values:`spacing`,shorthand:[`me`,`marginEnd`]},marginInline:{values:`spacing`,shorthand:[`mx`,`marginX`]},marginBlock:{values:`spacing`,shorthand:[`my`,`marginY`]},padding:{values:`spacing`,shorthand:[`p`]},paddingTop:{values:`spacing`,shorthand:[`pt`]},paddingRight:{values:`spacing`,shorthand:[`pr`]},paddingBottom:{values:`spacing`,shorthand:[`pb`]},paddingBlockStart:{values:`spacing`},paddingBlockEnd:{values:`spacing`},paddingLeft:{values:`spacing`,shorthand:[`pl`]},paddingInlineStart:{values:`spacing`,shorthand:[`ps`,`paddingStart`]},paddingInlineEnd:{values:`spacing`,shorthand:[`pe`,`paddingEnd`]},paddingInline:{values:`spacing`,shorthand:[`px`,`paddingX`]},paddingBlock:{values:`spacing`,shorthand:[`py`,`paddingY`]},textDecoration:{shorthand:[`textDecor`]},textDecorationColor:{values:vy,transform:Iv(`textDecorationColor`)},textShadow:{values:`shadows`},transform:{transform:e=>{let t=e;return e===`auto`&&(t=`translateX(var(--translate-x, 0)) translateY(var(--translate-y, 0)) rotate(var(--rotate, 0)) scaleX(var(--scale-x, 1)) scaleY(var(--scale-y, 1)) skewX(var(--skew-x, 0)) skewY(var(--skew-y, 0))`),e===`auto-gpu`&&(t=`translate3d(var(--translate-x, 0), var(--translate-y, 0), 0) rotate(var(--rotate, 0)) scaleX(var(--scale-x, 1)) scaleY(var(--scale-y, 1)) skewX(var(--skew-x, 0)) skewY(var(--skew-y, 0))`),{transform:t}}},skewX:{transform:e=>({"--skew-x":dy(e)})},skewY:{transform:e=>({"--skew-y":dy(e)})},scaleX:{transform:e=>({"--scale-x":e})},scaleY:{transform:e=>({"--scale-y":e})},scale:{transform(e){return e===`auto`?{scale:`var(--scale-x, 1) var(--scale-y, 1)`}:{scale:e}}},spaceXReverse:{values:{type:`boolean`},transform(e){return{"& > :not(style, [hidden]) ~ :not(style, [hidden])":{"--space-x-reverse":e?`1`:void 0}}}},spaceX:{property:`marginInlineStart`,values:`spacing`,transform:e=>({"& > :not(style, [hidden]) ~ :not(style, [hidden])":{"--space-x-reverse":`0`,marginInlineStart:`calc(${e} * calc(1 - var(--space-x-reverse)))`,marginInlineEnd:`calc(${e} * var(--space-x-reverse))`}})},spaceYReverse:{values:{type:`boolean`},transform(e){return{"& > :not(style, [hidden]) ~ :not(style, [hidden])":{"--space-y-reverse":e?`1`:void 0}}}},spaceY:{property:`marginTop`,values:`spacing`,transform:e=>({"& > :not(style, [hidden]) ~ :not(style, [hidden])":{"--space-y-reverse":`0`,marginTop:`calc(${e} * calc(1 - var(--space-y-reverse)))`,marginBottom:`calc(${e} * var(--space-y-reverse))`}})},rotate:{transform(e){return e===`auto`?{rotate:`var(--rotate-x, 0) var(--rotate-y, 0) var(--rotate-z, 0)`}:{rotate:dy(e)}}},rotateX:{transform(e){return{"--rotate-x":dy(e)}}},rotateY:{transform(e){return{"--rotate-y":dy(e)}}},translate:{transform(e){return e===`auto`?{translate:`var(--translate-x) var(--translate-y)`}:{translate:e}}},translateX:{values:`spacing`,transform:e=>({"--translate-x":e})},translateY:{values:`spacing`,transform:e=>({"--translate-y":e})},transition:{values:[`all`,`common`,`colors`,`opacity`,`position`,`backgrounds`,`size`,`shadow`,`transform`],transform(e){switch(e){case`all`:return my(`all`);case`position`:return my(`left, right, top, bottom, inset-inline, inset-block`);case`colors`:return my(`color, background-color, border-color, text-decoration-color, fill, stroke`);case`opacity`:return my(`opacity`);case`shadow`:return my(`box-shadow`);case`transform`:return my(`transform`);case`size`:return my(`width, height`);case`backgrounds`:return my(`background, background-color, background-image, background-position`);case`common`:return my(`color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter`);default:return{transition:e}}}},transitionDuration:{values:`durations`},transitionProperty:{values:{common:`background-color, border-color, color, fill, stroke, opacity, box-shadow, translate, transform`,colors:`background-color, border-color, color, fill, stroke`,size:`width, height`,position:`left, right, top, bottom, inset-inline, inset-block`,background:`background, background-color, background-image, background-position`}},transitionTimingFunction:{values:`easings`},animation:{values:`animations`},animationDuration:{values:`durations`},animationDelay:{values:`durations`},animationTimingFunction:{values:`easings`},fontFamily:{values:`fonts`},fontSize:{values:`fontSizes`},fontWeight:{values:`fontWeights`},lineHeight:{values:`lineHeights`},letterSpacing:{values:`letterSpacings`},textIndent:{values:`spacing`},truncate:{values:{type:`boolean`},transform(e){return e===!0?{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`}:{}}},lineClamp:{transform(e){return e===`none`?{WebkitLineClamp:`unset`}:{overflow:`hidden`,display:`-webkit-box`,WebkitLineClamp:e,WebkitBoxOrient:`vertical`,textWrap:`wrap`}}},borderSpacing:{values:e=>({...e(`spacing`),auto:`var(--border-spacing-x, 0) var(--border-spacing-y, 0)`})},borderSpacingX:{values:`spacing`,transform(e){return{"--border-spacing-x":e}}},borderSpacingY:{values:`spacing`,transform(e){return{"--border-spacing-y":e}}},srOnly:{values:{type:`boolean`},transform(e){return by[e]||{}}},debug:{values:{type:`boolean`},transform(e){return e?{outline:`1px solid blue !important`,"& > *":{outline:`1px solid red !important`}}:{}}},caretColor:{values:vy,transform:Iv(`caretColor`)},cursor:{values:`cursor`}}}),by={true:{position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},false:{position:`static`,width:`auto`,height:`auto`,padding:`0`,margin:`0`,overflow:`visible`,clip:`auto`,whiteSpace:`normal`}},xy=``.split(`,`),Sy=`WebkitAppearance,WebkitBorderBefore,WebkitBorderBeforeColor,WebkitBorderBeforeStyle,WebkitBorderBeforeWidth,WebkitBoxReflect,WebkitLineClamp,WebkitMask,WebkitMaskAttachment,WebkitMaskClip,WebkitMaskComposite,WebkitMaskImage,WebkitMaskOrigin,WebkitMaskPosition,WebkitMaskPositionX,WebkitMaskPositionY,WebkitMaskRepeat,WebkitMaskRepeatX,WebkitMaskRepeatY,WebkitMaskSize,WebkitOverflowScrolling,WebkitTapHighlightColor,WebkitTextFillColor,WebkitTextStroke,WebkitTextStrokeColor,WebkitTextStrokeWidth,WebkitTouchCallout,WebkitUserModify,WebkitUserSelect,accentColor,alignContent,alignItems,alignSelf,alignTracks,all,anchorName,anchorScope,animation,animationComposition,animationDelay,animationDirection,animationDuration,animationFillMode,animationIterationCount,animationName,animationPlayState,animationRange,animationRangeEnd,animationRangeStart,animationTimeline,animationTimingFunction,appearance,aspectRatio,backdropFilter,backfaceVisibility,background,backgroundAttachment,backgroundBlendMode,backgroundClip,backgroundColor,backgroundImage,backgroundOrigin,backgroundPosition,backgroundPositionX,backgroundPositionY,backgroundRepeat,backgroundSize,blockSize,border,borderBlock,borderBlockColor,borderBlockEnd,borderBlockEndColor,borderBlockEndStyle,borderBlockEndWidth,borderBlockStart,borderBlockStartColor,borderBlockStartStyle,borderBlockStartWidth,borderBlockStyle,borderBlockWidth,borderBottom,borderBottomColor,borderBottomLeftRadius,borderBottomRightRadius,borderBottomStyle,borderBottomWidth,borderCollapse,borderColor,borderEndEndRadius,borderEndStartRadius,borderImage,borderImageOutset,borderImageRepeat,borderImageSlice,borderImageSource,borderImageWidth,borderInline,borderInlineColor,borderInlineEnd,borderInlineEndColor,borderInlineEndStyle,borderInlineEndWidth,borderInlineStart,borderInlineStartColor,borderInlineStartStyle,borderInlineStartWidth,borderInlineStyle,borderInlineWidth,borderLeft,borderLeftColor,borderLeftStyle,borderLeftWidth,borderRadius,borderRight,borderRightColor,borderRightStyle,borderRightWidth,borderSpacing,borderStartEndRadius,borderStartStartRadius,borderStyle,borderTop,borderTopColor,borderTopLeftRadius,borderTopRightRadius,borderTopStyle,borderTopWidth,borderWidth,bottom,boxAlign,boxDecorationBreak,boxDirection,boxFlex,boxFlexGroup,boxLines,boxOrdinalGroup,boxOrient,boxPack,boxShadow,boxSizing,breakAfter,breakBefore,breakInside,captionSide,caret,caretColor,caretShape,clear,clip,clipPath,clipRule,color,colorInterpolationFilters,colorScheme,columnCount,columnFill,columnGap,columnRule,columnRuleColor,columnRuleStyle,columnRuleWidth,columnSpan,columnWidth,columns,contain,containIntrinsicBlockSize,containIntrinsicHeight,containIntrinsicInlineSize,containIntrinsicSize,containIntrinsicWidth,container,containerName,containerType,content,contentVisibility,cornerShape,counterIncrement,counterReset,counterSet,cursor,cx,cy,d,direction,display,dominantBaseline,emptyCells,fieldSizing,fill,fillOpacity,fillRule,filter,flex,flexBasis,flexDirection,flexFlow,flexGrow,flexShrink,flexWrap,float,floodColor,floodOpacity,font,fontFamily,fontFeatureSettings,fontKerning,fontLanguageOverride,fontOpticalSizing,fontPalette,fontSize,fontSizeAdjust,fontSmooth,fontStretch,fontStyle,fontSynthesis,fontSynthesisPosition,fontSynthesisSmallCaps,fontSynthesisStyle,fontSynthesisWeight,fontVariant,fontVariantAlternates,fontVariantCaps,fontVariantEastAsian,fontVariantEmoji,fontVariantLigatures,fontVariantNumeric,fontVariantPosition,fontVariationSettings,fontWeight,forcedColorAdjust,gap,grid,gridArea,gridAutoColumns,gridAutoFlow,gridAutoRows,gridColumn,gridColumnEnd,gridColumnGap,gridColumnStart,gridGap,gridRow,gridRowEnd,gridRowGap,gridRowStart,gridTemplate,gridTemplateAreas,gridTemplateColumns,gridTemplateRows,hangingPunctuation,height,hyphenateCharacter,hyphenateLimitChars,hyphens,imageOrientation,imageRendering,imageResolution,imeMode,initialLetter,initialLetterAlign,inlineSize,inset,insetBlock,insetBlockEnd,insetBlockStart,insetInline,insetInlineEnd,insetInlineStart,interpolateSize,isolation,justifyContent,justifyItems,justifySelf,justifyTracks,left,letterSpacing,lightingColor,lineBreak,lineClamp,lineHeight,lineHeightStep,listStyle,listStyleImage,listStylePosition,listStyleType,margin,marginBlock,marginBlockEnd,marginBlockStart,marginBottom,marginInline,marginInlineEnd,marginInlineStart,marginLeft,marginRight,marginTop,marginTrim,marker,markerEnd,markerMid,markerStart,mask,maskBorder,maskBorderMode,maskBorderOutset,maskBorderRepeat,maskBorderSlice,maskBorderSource,maskBorderWidth,maskClip,maskComposite,maskImage,maskMode,maskOrigin,maskPosition,maskRepeat,maskSize,maskType,masonryAutoFlow,mathDepth,mathShift,mathStyle,maxBlockSize,maxHeight,maxInlineSize,maxLines,maxWidth,minBlockSize,minHeight,minInlineSize,minWidth,mixBlendMode,objectFit,objectPosition,offset,offsetAnchor,offsetDistance,offsetPath,offsetPosition,offsetRotate,opacity,order,orphans,outline,outlineColor,outlineOffset,outlineStyle,outlineWidth,overflow,overflowAnchor,overflowBlock,overflowClipBox,overflowClipMargin,overflowInline,overflowWrap,overflowX,overflowY,overlay,overscrollBehavior,overscrollBehaviorBlock,overscrollBehaviorInline,overscrollBehaviorX,overscrollBehaviorY,padding,paddingBlock,paddingBlockEnd,paddingBlockStart,paddingBottom,paddingInline,paddingInlineEnd,paddingInlineStart,paddingLeft,paddingRight,paddingTop,page,pageBreakAfter,pageBreakBefore,pageBreakInside,paintOrder,perspective,perspectiveOrigin,placeContent,placeItems,placeSelf,pointerEvents,position,positionAnchor,positionArea,positionTry,positionTryFallbacks,positionTryOrder,positionVisibility,printColorAdjust,quotes,r,resize,right,rotate,rowGap,rubyAlign,rubyMerge,rubyPosition,rx,ry,scale,scrollBehavior,scrollMargin,scrollMarginBlock,scrollMarginBlockEnd,scrollMarginBlockStart,scrollMarginBottom,scrollMarginInline,scrollMarginInlineEnd,scrollMarginInlineStart,scrollMarginLeft,scrollMarginRight,scrollMarginTop,scrollPadding,scrollPaddingBlock,scrollPaddingBlockEnd,scrollPaddingBlockStart,scrollPaddingBottom,scrollPaddingInline,scrollPaddingInlineEnd,scrollPaddingInlineStart,scrollPaddingLeft,scrollPaddingRight,scrollPaddingTop,scrollSnapAlign,scrollSnapCoordinate,scrollSnapDestination,scrollSnapPointsX,scrollSnapPointsY,scrollSnapStop,scrollSnapType,scrollSnapTypeX,scrollSnapTypeY,scrollTimeline,scrollTimelineAxis,scrollTimelineName,scrollbarColor,scrollbarGutter,scrollbarWidth,shapeImageThreshold,shapeMargin,shapeOutside,shapeRendering,stopColor,stopOpacity,stroke,strokeDasharray,strokeDashoffset,strokeLinecap,strokeLinejoin,strokeMiterlimit,strokeOpacity,strokeWidth,tabSize,tableLayout,textAlign,textAlignLast,textAnchor,textBox,textBoxEdge,textBoxTrim,textCombineUpright,textDecoration,textDecorationColor,textDecorationLine,textDecorationSkip,textDecorationSkipInk,textDecorationStyle,textDecorationThickness,textEmphasis,textEmphasisColor,textEmphasisPosition,textEmphasisStyle,textIndent,textJustify,textOrientation,textOverflow,textRendering,textShadow,textSizeAdjust,textSpacingTrim,textTransform,textUnderlineOffset,textUnderlinePosition,textWrap,textWrapMode,textWrapStyle,timelineScope,top,touchAction,transform,transformBox,transformOrigin,transformStyle,transition,transitionBehavior,transitionDelay,transitionDuration,transitionProperty,transitionTimingFunction,translate,unicodeBidi,userSelect,vectorEffect,verticalAlign,viewTimeline,viewTimelineAxis,viewTimelineInset,viewTimelineName,viewTransitionName,visibility,whiteSpace,whiteSpaceCollapse,widows,width,willChange,wordBreak,wordSpacing,wordWrap,writingMode,x,y,zIndex,zoom,alignmentBaseline,baselineShift,colorInterpolation,colorRendering,glyphOrientationVertical`.split(`,`).concat(xy),Cy=new Map(Sy.map(e=>[e,!0]));function wy(e){let t=Object.create(null);return n=>(t[n]===void 0&&(t[n]=e(n)),t[n])}var Ty=/&|@/,Ey=wy(e=>Cy.has(e)||e.startsWith(`--`)||Ty.test(e));function Dy(e,t){let n={};for(let r in e){let i=t(r,e[r]);n[i[0]]=i[1]}return n}function Oy(e,t){let n={};return Vv(e,(e,t)=>{e&&(n[t.join(`.`)]=e.value)},{stop:t}),n}var ky=Object.defineProperty,Ay=(e,t,n)=>t in e?ky(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,jy=(e,t,n)=>Ay(e,typeof t==`symbol`?t:t+``,n);function My(e){if(e===null)return`null`;if(e===void 0)return`undefined`;let t=typeof e;return t===`string`?`s:${e}`:t===`number`?`n:${e}`:t===`boolean`?`b:${e}`:t===`function`?`f:${e.name||`anonymous`}`:Array.isArray(e)?`a:[${e.map(My).join(`,`)}]`:t===`object`?`o:{${Object.keys(e).sort().map(t=>`${t}:${My(e[t])}`).join(`,`)}}`:String(e)}var Ny=class{constructor(e=500){jy(this,`cache`,new Map),jy(this,`maxSize`),this.maxSize=e}get(e){let t=this.cache.get(e);return t!==void 0&&(this.cache.delete(e),this.cache.set(e,t)),t}set(e,t){if(this.cache.has(e))this.cache.delete(e);else if(this.cache.size>=this.maxSize){let e=this.cache.keys().next().value;e!==void 0&&this.cache.delete(e)}this.cache.set(e,t)}clear(){this.cache.clear()}},Py=e=>{let t=new Ny;function n(...n){let r=n.length===1?My(n[0]):n.map(My).join(`|`),i=t.get(r);return i===void 0&&(i=e.apply(this,n),t.set(r,i)),i}return n},Fy=16,Iy=`px`,Ly=`em`,Ry=`rem`;function zy(e=``){let t=new RegExp(String.raw`-?\d+(?:\.\d+|\d*)`),n=RegExp(`${Iy}|${Ly}|${Ry}`);return e.match(RegExp(`${t.source}(${n.source})`))?.[1]}function By(e=``){if(typeof e==`number`)return`${e}px`;let t=zy(e);if(!t||t===Iy)return e;if(t===Ly||t===Ry)return`${parseFloat(e)*Fy}${Iy}`}function Vy(e=``){let t=zy(e);if(!t||t===Ry)return e;if(t===Ly)return`${parseFloat(e)}${Ry}`;if(t===Iy)return`${parseFloat(e)/Fy}${Ry}`}var Hy=e=>e.charAt(0).toUpperCase()+e.slice(1);function Uy(e){let t=Gy(e),n=Object.fromEntries(t);function r(e){return n[e]}function i(e){return qy(r(e))}function a(){let e=Object.keys(n),t=Ky(e),a=e.flatMap(e=>{let t=r(e),n=[`${e}Down`,qy({max:Wy(t.min)})];return[[e,qy({min:t.min})],[`${e}Only`,i(e)],n]}).filter(([,e])=>e!==``).concat(t.map(([e,t])=>{let n=r(e),i=r(t);return[`${e}To${Hy(t)}`,qy({min:n.min,max:Wy(i.min)})]}));return Object.fromEntries(a)}function o(){let e=a();return Object.fromEntries(Object.entries(e))}let s=o(),c=e=>s[e];function l(){return Zt([`base`,...Object.keys(n)])}function u(e){return qy({min:r(e).min})}function d(e){return qy({max:Wy(r(e).min)})}return{values:Object.values(n),only:i,keys:l,conditions:s,getCondition:c,up:u,down:d}}function Wy(e){return Vy(`${parseFloat(By(e)??``)-.04}px`)}function Gy(e){return Object.entries(e).sort(([,e],[,t])=>parseInt(e,10)<parseInt(t,10)?-1:1).map(([e,t],n,r)=>{let i=null;return n<=r.length-1&&(i=r[n+1]?.[1]),i!=null&&(i=Wy(i)),[e,{name:e,min:Vy(t),max:i}]})}function Ky(e){let t=[];return e.forEach((n,r)=>{let i=r;i++;let a=e[i];for(;a;)t.push([n,a]),i++,a=e[i]}),t}function qy({min:e,max:t}){return e==null&&t==null?``:[`@media screen`,e&&`(min-width: ${e})`,t&&`(max-width: ${t})`].filter(Boolean).join(` and `)}var Jy=/^@|&|&$/,Yy=e=>{let{breakpoints:t,conditions:n={}}=e,r=Dy(n,(e,t)=>[`_${e}`,t]),i=Object.assign({},r,t.conditions);function a(){return Object.keys(i)}function o(e){return a().includes(e)||Jy.test(e)||e.startsWith(`_`)}let s=Py(e=>e.filter(e=>e!==`base`).sort((e,t)=>{let n=o(e),r=o(t);return n&&!r?1:!n&&r?-1:0}));function c(e){return e.startsWith(`@breakpoint`)?t.getCondition(e.replace(`@breakpoint `,``)):e}function l(e){return Reflect.get(i,e)||e}return{keys:a,sort:s,has:o,resolve:l,breakpoints:t.keys(),expandAtRule:c}},Xy=Object.freeze(Object.create(null)),Zy=Object.freeze([]);function Qy(){return Object.create(null)}var $y=e=>({minMax:RegExp(`(!?\\(\\s*min(-device-)?-${e})(.|
10
- )+\\(\\s*max(-device)?-${e}`,`i`),min:RegExp(`\\(\\s*min(-device)?-${e}`,`i`),maxMin:RegExp(`(!?\\(\\s*max(-device)?-${e})(.|
11
- )+\\(\\s*min(-device)?-${e}`,`i`),max:RegExp(`\\(\\s*max(-device)?-${e}`,`i`)}),eb=$y(`width`),tb=$y(`height`),nb=e=>({isMin:mb(e.minMax,e.maxMin,e.min),isMax:mb(e.maxMin,e.minMax,e.max)}),{isMin:rb,isMax:ib}=nb(eb),{isMin:ab,isMax:ob}=nb(tb),sb=/print/i,cb=/^print$/i,lb=/(-?\d*\.?\d+)(ch|em|ex|px|rem)/,ub=/(\d)/,db=Number.MAX_VALUE,fb={ch:8.8984375,em:16,rem:16,ex:8.296875,px:1};function pb(e){let t=lb.exec(e)||(rb(e)||ab(e)?ub.exec(e):null);return t?t[0]===`0`?0:parseFloat(t[1])*(fb[t[2]]||1):db}function mb(e,t,n){return r=>e.test(r)||!t.test(r)&&n.test(r)}function hb(e,t){let n=sb.test(e),r=cb.test(e),i=sb.test(t),a=cb.test(t);return n&&i?!r&&a?1:r&&!a?-1:e.localeCompare(t):n?1:i?-1:null}var gb=Py((e,t)=>{let n=hb(e,t);if(n!==null)return n;let r=rb(e)||ab(e),i=ib(e)||ob(e),a=rb(t)||ab(t),o=ib(t)||ob(t);if(r&&o)return-1;if(i&&a)return 1;let s=pb(e),c=pb(t);return s===db&&c===db?e.localeCompare(t):s===db?1:c===db?-1:s===c?e.localeCompare(t):s>c?i?-1:1:i?1:-1});function _b(e){return e.sort(([e],[t])=>gb(e,t))}function vb(e){let t=[],n=[],r={};for(let[i,a]of Object.entries(e))i.startsWith(`@media`)?t.push([i,a]):i.startsWith(`@container`)?n.push([i,a]):r[i]=Gt(a)?vb(a):a;let i=_b(t),a=_b(n);return{...r,...Object.fromEntries(i),...Object.fromEntries(a)}}var yb=/\s*!(important)?/i,bb=Py(e=>Kt(e)?yb.test(e):!1),xb=Py(e=>Kt(e)?e.replace(yb,``).trim():e);function Sb(e){let{transform:t,conditions:n,normalize:r}=e,i=Tb(e);return Py(function(...e){let a=i(...e),o=r(a),s=Qy();return Vv(o,(e,r)=>{if(e==null)return;let[i,...a]=n.sort(r).map(n.resolve),o=bb(e);o&&(e=xb(e));let c=t(i,e)??Xy;c=Vv(c,e=>Kt(e)&&o?`${e} !important`:e,{getKey:e=>n.expandAtRule(e)}),Cb(s,a.flat(),c)}),vb(s)})}function Cb(e,t,n){let r=e;for(let e of t)e&&(r[e]||(r[e]=Qy()),r=r[e]);zv(r,n)}function wb(...e){return e.filter(e=>{if(!Gt(e))return!1;let t=Wt(e);return Object.keys(t).length>0})}function Tb(e){function t(t){let n=wb(...t);return n.length===1?n:n.map(t=>e.normalize(t))}return Py(function(...e){return zv({},...t(e))})}var Eb=e=>({base:Xy,variants:Xy,defaultVariants:Xy,compoundVariants:[],...e});function Db(e){let{css:t,conditions:n,normalize:r,layers:i}=e;function a(e={}){let s=Eb(e),{base:c,defaultVariants:l,compoundVariants:u}=s,d=Dy(s.variants,(e,t)=>[e,Dy(t,(e,t)=>[e,r(t)])]),f=Sb({conditions:n,normalize:r,transform(e,t){return d[e]?.[t]}}),p=Py(function(e={}){let n=r({...l,...Wt(e)}),a={...r(c)};zv(a,f(n));let s=o(u,n);return i.wrap(`recipes`,t(a,s))}),m=Object.keys(d),h=e=>{let[t,n]=an(Pv(e,[`recipe`]),m),r=m.includes(`colorPalette`),i=m.includes(`orientation`);return r||(t.colorPalette=e.colorPalette||l.colorPalette),i&&(n.orientation=e.orientation),[t,n]},g=Dy(d,(e,t)=>[e,Object.keys(t)]),_=Py(function(e){return t(p(e))});return Object.assign(_,{className:e.className,__cva__:!0,variantMap:g,variantKeys:m,raw:p,config:e,splitVariantProps:h,merge(e){return a(kb(this,e))}})}function o(e,n){let r=Xy;return e.forEach(e=>{Object.entries(e).every(([e,t])=>e===`css`||(Array.isArray(t)?t:[t]).some(t=>n[e]===t))&&(r=t(r,e.css))}),r}return a}var Ob=e=>(e?.__cva__?e.config:e)??Xy;function kb(e,t){let n=Eb(Ob(e)),r=Eb(Ob(t)),i=Zt(Object.keys(n.variants),Object.keys(r.variants)),a=zv({},n.base,r.base),o=Object.fromEntries(i.map(e=>[e,zv({},n.variants[e],r.variants[e])])),s=zv({},n.defaultVariants,r.defaultVariants),c=[...n.compoundVariants,...r.compoundVariants];return{className:Jt(n.className,r.className),base:a,variants:o,defaultVariants:s,compoundVariants:c}}var Ab={reset:`reset`,base:`base`,tokens:`tokens`,recipes:`recipes`},jb={reset:0,base:1,tokens:2,recipes:3};function Mb(e){let t=e.layers??Ab,n=Object.values(t).sort((e,t)=>jb[e]-jb[t]);return{names:n,atRule:`@layer ${n.join(`, `)};`,wrap(n,r){return e.disableLayers?r:{[`@layer ${t[n]}`]:r}}}}function Nb(e){let{utility:t,normalize:n}=e,{hasShorthand:r,resolveShorthand:i}=t;return function(e){return Vv(e,n,{stop:e=>Array.isArray(e),getKey:r?i:void 0})}}function Pb(e){let{preflight:t}=e;if(!t)return{};let{scope:n=``,level:r=`parent`}=Gt(t)?t:{},i=``;n&&r===`parent`?i=`${n} `:n&&r===`element`&&(i=`&${n}`);let a={"*":{margin:`0px`,padding:`0px`,font:`inherit`,wordWrap:`break-word`,WebkitTapHighlightColor:`transparent`},"*, *::before, *::after, *::backdrop":{boxSizing:`border-box`,borderWidth:`0px`,borderStyle:`solid`,borderColor:`var(--global-color-border, currentColor)`},hr:{height:`0px`,color:`inherit`,borderTopWidth:`1px`},body:{minHeight:`100dvh`,position:`relative`},img:{borderStyle:`none`},"img, svg, video, canvas, audio, iframe, embed, object":{display:`block`,verticalAlign:`middle`},iframe:{border:`none`},"img, video":{maxWidth:`100%`,height:`auto`},"p, h1, h2, h3, h4, h5, h6":{overflowWrap:`break-word`},"ol, ul":{listStyle:`none`},"code, kbd, pre, samp":{fontSize:`1em`},"button, [type='button'], [type='reset'], [type='submit']":{WebkitAppearance:`button`,backgroundColor:`transparent`,backgroundImage:`none`},"button, input, optgroup, select, textarea":{color:`inherit`},"button, select":{textTransform:`none`},table:{textIndent:`0px`,borderColor:`inherit`,borderCollapse:`collapse`},"*::placeholder":{opacity:`unset`,color:`#9ca3af`,userSelect:`none`},textarea:{resize:`vertical`},summary:{display:`list-item`},small:{fontSize:`80%`},"sub, sup":{fontSize:`75%`,lineHeight:0,position:`relative`,verticalAlign:`baseline`},sub:{bottom:`-0.25em`},sup:{top:`-0.5em`},dialog:{padding:`0px`},a:{color:`inherit`,textDecoration:`inherit`},"abbr:where([title])":{textDecoration:`underline dotted`},"b, strong":{fontWeight:`bolder`},"i, em":{fontStyle:`italic`},"code, kbd, samp, pre":{fontSize:`1em`,"--font-mono-fallback":`ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New'`,fontFamily:`var(--global-font-mono, var(--font-mono-fallback))`},'input[type="text"], input[type="email"], input[type="search"], input[type="password"]':{WebkitAppearance:`none`,MozAppearance:`none`},"input[type='search']":{WebkitAppearance:`textfield`,outlineOffset:`-2px`},"::-webkit-search-decoration, ::-webkit-search-cancel-button":{WebkitAppearance:`none`},"::-webkit-file-upload-button":{WebkitAppearance:`button`,font:`inherit`},'input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button':{height:`auto`},"input[type='number']":{MozAppearance:`textfield`},":-moz-ui-invalid":{boxShadow:`none`},":-moz-focusring":{outline:`auto`},"[hidden]:where(:not([hidden='until-found']))":{display:`none !important`}},o={[n||`html`]:{lineHeight:1.5,"--font-fallback":`ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'`,WebkitTextSizeAdjust:`100%`,WebkitFontSmoothing:`antialiased`,MozOsxFontSmoothing:`grayscale`,textRendering:`optimizeLegibility`,touchAction:`manipulation`,MozTabSize:`4`,tabSize:`4`,fontFamily:`var(--global-font-body, var(--font-fallback))`}};if(r===`element`){let e=Object.entries(a).reduce((e,[t,n])=>(e[t]={[i]:n},e),{});Object.assign(o,e)}else i?o[i]=a:Object.assign(o,a);return o}function Fb(e){let{conditions:t,isValidProperty:n}=e,r=Py((e,r)=>!n(e)||!r.split(`,`).every(e=>e===`base`||t.has(e)));return function(e){return Vv(e,e=>e,{stop:e=>Array.isArray(e),getKey:(e,n)=>!Gt(n)||t.has(e)?e:r(e,Object.keys(n).join(`,`))?Lb(e).map(e=>{let t=e.startsWith(`&`)?e.slice(1):e;return Ib(t)?`${t} &`:`&${t}`}).join(`, `):e})}}function Ib(e){let t=e.toLowerCase();return t.startsWith(`:host-context`)||t.startsWith(`:host`)||t.startsWith(`::slotted`)}function Lb(e){let t=[],n=0,r=``,i=!1;for(let a=0;a<e.length;a++){let o=e[a];if(o===`\\`&&!i){i=!0,r+=o;continue}if(i){i=!1,r+=o;continue}o===`(`?n++:o===`)`&&n--,o===`,`&&n===0?(t.push(r.trim()),r=``):r+=o}return r&&t.push(r.trim()),t}var Rb=(e=Xy)=>{let t=t=>({base:e.base?.[t]??Xy,variants:Qy(),defaultVariants:e.defaultVariants??Xy,compoundVariants:e.compoundVariants?zb(e.compoundVariants,t):Zy}),n=(e.slots??[]).map(e=>[e,t(e)]);for(let[t,r]of Object.entries(e.variants??{}))for(let[e,i]of Object.entries(r))n.forEach(([n,r])=>{var a;(a=r.variants)[t]??(a[t]={}),r.variants[t][e]=i[n]??Xy});return Object.fromEntries(n)},zb=(e,t)=>e.filter(e=>e.css[t]).map(e=>({...e,css:e.css[t]}));function Bb(e){let{cva:t}=e;return function(e=Xy){let n=Object.entries(Rb(e)).map(([e,n])=>[e,t(n)]),r=Py(function(e){let t=n.map(([t,n])=>[t,n(e)]);return Object.fromEntries(t)}),i=e.variants??Xy,a=Object.keys(i);function o(t){let[n,r]=an(Pv(t,[`recipe`]),a),i=a.includes(`colorPalette`),o=a.includes(`orientation`);return i||(n.colorPalette=t.colorPalette||e.defaultVariants?.colorPalette),o&&(r.orientation=t.orientation),[n,r]}let s=Dy(i,(e,t)=>[e,Object.keys(t)]),c={};return e.className&&(c=Object.fromEntries(e.slots.map(t=>[t,`${e.className}__${t}`]))),Object.assign(r,{variantMap:s,variantKeys:a,splitVariantProps:o,classNameMap:c})}}var Vb=()=>e=>Array.from(new Set(e)),Hb=/([\0-\x1f\x7f]|^-?\d)|^-$|^-|[^\x80-\uFFFF\w-]/g,Ub=function(e,t){return t?e===`\0`?`�`:e===`-`&&e.length===1?`\\-`:e.slice(0,-1)+`\\`+e.charCodeAt(e.length-1).toString(16):`\\`+e},Wb=e=>(e+``).replace(Hb,Ub),Gb=(e,t)=>{let n=``,r=0,i=`char`,a=``,o=``,s=[];for(;r<e.length;){let c=e[r];if(c===`{`){let i=e.indexOf(`}`,r);if(i===-1)break;let a=e.slice(r+1,i),o=t(a);n+=o??a,r=i+1;continue}if(i===`token`&&c===`,`){e[r]===``&&r++,i=`fallback`,s.push(i);let c=t(a);c?.endsWith(`)`)&&(n+=c.slice(0,-1)),a=``,o=``;continue}if(i===`fallback`&&o+c===`, var(`){let t=Kb(e.slice(r+1))+r+1,a=e.slice(r+1,t);if(t===-1)break;n+=`, var(`+a+`)`,r=t+1,i=s.pop()??i,o=``;continue}if(i===`token`||i===`fallback`){if(r++,c===`)`){i=s.pop()??i??`char`,o+=c;let e=a&&(t(a)??Wb(a));if(o){if(o=o.slice(1).trim(),!o.startsWith(`token(`)&&o.endsWith(`)`)&&(o=o.slice(0,-1)),o.includes(`token(`)){let e=Gb(o,t);e&&(o=e.slice(0,-1))}else if(o){let e=t(o);e&&(o=e)}}let r=n.at(-1);o?r?.trim()?n+=e.slice(0,-1)+(`, `+o+`)`):n+=o:n+=e||`)`,a=``,o=``,i=`char`;continue}i===`token`&&(a+=c),i===`fallback`&&(o+=c);continue}let l=e.indexOf(`token(`,r);if(l!==-1){let t=l+6;n+=e.slice(r,l),r=t,i=`token`,s.push(i);continue}n+=c,r++}return n},Kb=e=>{let t=0,n=[`(`];for(;t<e.length;){let r=e[t];if(r===`(`)n.push(r);else if(r===`)`&&(n.pop(),n.length===0))return t;t++}return t};function qb(e){let t={};return e.forEach((e,n)=>{e instanceof Map?t[n]=Object.fromEntries(e):t[n]=e}),t}var Jb=/({([^}]*)})/g,Yb=/[{}]/g,Xb=/\w+\.\w+/,Zb=e=>{if(!Kt(e))return[];let t=e.match(Jb);return t?t.map(e=>e.replace(Yb,``).trim()):[]},Qb=e=>Jb.test(e);function $b(e){if(!e.extensions?.references)return e.extensions?.cssVar?.ref??e.value;let t=e.extensions.references??{},n=e.value,r=Object.keys(t);for(let e=0;e<r.length;e++){let i=r[e],a=t[i];if(a.extensions.conditions)continue;let o=$b(a);n=n.replace(`{${i}}`,o)}return e.value=n,delete e.extensions.references,e.value}function ex(e,t){if(t==null||!Array.isArray(t))return t;switch(e){case`easings`:return`cubic-bezier(${t.join(`, `)})`;case`animations`:case`fonts`:case`gradients`:case`shadows`:return t.join(`, `);default:return t}}function tx(e,t){let n={};for(let r in t)n[r]=ex(e,t[r]);return n}var nx=/calc/g;function rx(e){return Gt(e)&&e.reference?e.reference:String(e)}var ix=(e,...t)=>t.map(rx).join(` ${e} `).replace(nx,``),ax=(...e)=>`calc(${ix(`+`,...e)})`,ox=(...e)=>`calc(${ix(`-`,...e)})`,sx=(...e)=>`calc(${ix(`*`,...e)})`,cx=(...e)=>`calc(${ix(`/`,...e)})`,lx=e=>{let t=rx(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith(`-`)?String(t).slice(1):`-${t}`:sx(t,-1)},ux=Object.assign(e=>({add:(...t)=>ux(ax(e,...t)),subtract:(...t)=>ux(ox(e,...t)),multiply:(...t)=>ux(sx(e,...t)),divide:(...t)=>ux(cx(e,...t)),negate:()=>ux(lx(e)),toString:()=>e.toString()}),{add:ax,subtract:ox,multiply:sx,divide:cx,negate:lx}),dx={enforce:`pre`,transform(e){let{prefix:t,allTokens:n,formatCssVar:r,formatTokenName:i,registerToken:a}=e;n.filter(({extensions:e})=>e.category===`spacing`).forEach(e=>{let n=e.path.slice(),o=r(n,t);if(Kt(e.value)&&e.value===`0rem`)return;let s=[...e.path],c=s[s.length-1];c!=null&&(s[s.length-1]=`-${c}`);let l={...e,value:ux.negate(o.ref),name:i(s),path:s,extensions:{...e.extensions,negative:!0,prop:`-${e.extensions.prop}`,originalPath:n}};a(l)})}},fx=new Set([`spacing`,`sizes`,`borderWidths`,`fontSizes`,`radii`]),px=[dx,{enforce:`post`,transform(e){let{allTokens:t,registerToken:n,formatTokenName:r}=e,i=t.filter(({extensions:e})=>e.category===`colors`),a=new Map,o=new Map;i.forEach(e=>{let{colorPalette:t}=e.extensions;t&&(t.keys.forEach(e=>{a.set(r(e),e)}),t.roots.forEach(n=>{let i=r(n),s=o.get(i)||[];if(s.push(e),o.set(i,s),e.extensions.default&&n.length===1){let e=t.keys[0]?.filter(Boolean);if(!e.length)return;let i=n.concat(e);a.set(r(i),[])}}))}),a.forEach(e=>{let t=[`colors`,`colorPalette`,...e].filter(Boolean),i=r(t),a={name:i,value:i,originalValue:i,path:t,extensions:{condition:`base`,originalPath:t,category:`colors`,prop:r(t.slice(1)),virtual:!0}};n(a,`pre`)})}},{enforce:`post`,transform(e){e.allTokens.filter(e=>fx.has(e.extensions.category)&&!e.extensions.negative).forEach(e=>{Object.assign(e.extensions,{pixelValue:By(e.value)})})}},{enforce:`post`,transform(e){let t=[],n=[];e.allTokens.forEach(e=>{e.value===``?t.push(e):n.push(e)}),e.allTokens.splice(0,e.allTokens.length,...n),t.forEach(t=>{if(e.tokenMap.get(t.name)!==t)return;let n=e.allTokens.find(e=>e.name===t.name);if(!n){e.tokenMap.delete(t.name);return}t.extensions.conditions&&!n.extensions.conditions&&(n.extensions.conditions=t.extensions.conditions),e.tokenMap.set(t.name,n)})}}],mx=[{type:`extensions`,enforce:`pre`,name:`tokens/css-var`,transform(e,t){let{prefix:n,formatCssVar:r}=t,{negative:i,originalPath:a}=e.extensions;return{cssVar:r((i?a:e.path).filter(Boolean),n)}}},{enforce:`post`,type:`value`,name:`tokens/conditionals`,transform(e,t){let{prefix:n,formatCssVar:r,getByName:i}=t,a=Zb(e.value);return a.length&&a.forEach(t=>{if(!i(t))return;let a=r(t.split(`.`),n);e.value=e.value.replaceAll(`{${t}}`,a.ref)}),e.value}},{type:`extensions`,enforce:`pre`,name:`tokens/colors/colorPalette`,match(e){return e.extensions.category===`colors`&&!e.extensions.virtual},transform(e,t){let n=e.path.slice();if(n.pop(),n.shift(),n.length===0){let t=[...e.path];t.shift(),n=t}if(n.length===0)return{};let r=n.reduce((e,t,n,r)=>{let i=r.slice(0,n+1);return e.push(i),e},[]),i=n[0],a=t.formatTokenName(n),o=e.path.slice(e.path.indexOf(i)+1).reduce((e,t,n,r)=>(e.push(r.slice(n)),e),[]);return o.length===0&&o.push([``]),{colorPalette:{value:a,roots:r,keys:o}}}}],hx=e=>Gt(e)&&Object.prototype.hasOwnProperty.call(e,`value`);function gx(e){return e?{breakpoints:Hv(e,e=>({value:e})),sizes:Dy(e,(e,t)=>[`breakpoint-${e}`,{value:t}])}:{breakpoints:{},sizes:{}}}function _x(e){let{prefix:t=``,tokens:n={},semanticTokens:r={},breakpoints:i={}}=e,a=e=>e.join(`.`),o=(e,t)=>cy(e.join(`-`),{prefix:t}),s=[],c=new Map,l=new Map,u=new Map,d=new Map,f=new Map,p=new Map,m=new Map,h=new Map,g=[];function _(e,t){s.push(e),(e.extensions.condition===`base`||!c.has(e.name))&&c.set(e.name,e),t&&h.forEach(n=>{n.enforce===t&&ie(n,e)})}let v=gx(i),y=Wt({...n,breakpoints:v.breakpoints,sizes:{...n.sizes,...v.sizes}});function b(){Vv(y,(e,t)=>{let n=t.includes(`DEFAULT`);t=vx(t);let r=t[0],i=a(t),o=ex(r,(Kt(e)?{value:e}:e).value),s={value:o,originalValue:o,name:i,path:t,extensions:{condition:`base`,originalPath:t,category:r,prop:a(t.slice(1))}};n&&(s.extensions.default=!0),_(s)},{stop:hx}),Vv(r,(e,t)=>{let n=t.includes(`DEFAULT`);t=yx(vx(t));let r=t[0],i=a(t),o=tx(r,(Kt(e.value)||Array.isArray(e.value)?{value:{base:e.value}}:e).value),s={value:o.base??``,originalValue:o.base??``,name:i,path:t,extensions:{originalPath:t,category:r,conditions:o,condition:`base`,prop:a(t.slice(1))}};n&&(s.extensions.default=!0),_(s)},{stop:hx})}function x(e){return c.get(e)}function S(e){let{condition:t}=e.extensions;t&&(l.has(t)||l.set(t,new Set),l.get(t).add(e))}function C(e){let{category:t,prop:n,condition:r,conditions:i}=e.extensions;if(!t)return;m.has(t)||m.set(t,new Map);let a=m.get(t),o=a.get(n);if(r==null||r===`base`){a.set(n,e);return}i&&!o&&a.set(n,e)}function w(e){let{condition:t,negative:n,virtual:r,cssVar:i}=e.extensions;!n&&!r&&t&&i&&e.value!==``&&(u.has(t)||u.set(t,new Map),u.get(t).set(i.var,e.value))}function T(e){let{category:t,prop:n,cssVar:r,negative:i}=e.extensions;if(!t)return;p.has(t)||p.set(t,new Map);let a=i?e.extensions.conditions?e.originalValue:e.value:r.ref;p.get(t).set(n,a),f.set([t,n].join(`.`),a)}function E(e){let{colorPalette:t,virtual:n,default:r}=e.extensions;t&&!n&&t.roots.forEach(n=>{let i=a(n);d.has(i)||d.set(i,new Map);let o=xx([...e.path],[...n]),s=x(a(o));if(!s||!s.extensions.cssVar)return;let{var:c}=s.extensions.cssVar;if(d.get(i).set(c,e.extensions.cssVar.ref),r&&n.length===1){let r=x(a([`colors`,`colorPalette`]));if(!r)return;let i=x(a(e.path));if(!i)return;let o=t.keys[0]?.filter(Boolean);if(!o.length)return;let s=a(n.concat(o));d.has(s)||d.set(s,new Map),d.get(s).set(r.extensions.cssVar.var,i.extensions.cssVar.ref)}})}let D={};function ee(){s.forEach(e=>{S(e),C(e),w(e),T(e),E(e)}),D=qb(p)}let O=(e,t)=>{if(!e||typeof e!=`string`)return{invalid:!0,value:e};let[n,r]=e.split(`/`);if(!n||!r)return{invalid:!0,value:n};let i=t(n),a=x(`opacity.${r}`)?.value;if(!a&&isNaN(Number(r)))return{invalid:!0,value:n};let o=a?Number(a)*100+`%`:`${r}%`,s=i??n;return{invalid:!1,color:s,value:`color-mix(in srgb, ${s} ${o}, transparent)`}},te=Py((e,t)=>f.get(e)??t),k={prefix:t,allTokens:s,tokenMap:c,registerToken:_,getByName:x,formatTokenName:a,formatCssVar:o,flatMap:f,cssVarMap:u,categoryMap:m,colorPaletteMap:d,getVar:te,getCategoryValues:Py(e=>D[e]||null),expandReferenceInValue:Py(e=>Gb(e,e=>{if(e){if(e.includes(`/`)){let t=O(e,e=>te(e));if(t.invalid)throw Error(`Invalid color mix at `+e+`: `+t.value);return t.value}return te(e)||(Xb.test(e)?Wb(e):e)}}))};function ne(...e){e.forEach(e=>{h.set(e.name,e)})}function re(...e){g.push(...e)}function ie(e,t){if(t.extensions.references||qt(e.match)&&!e.match(t))return;let n=(t=>e.transform(t,k))(t);switch(!0){case e.type===`extensions`:Object.assign(t.extensions,n);break;case e.type===`value`:t.value=n;break;default:t[e.type]=n}}function A(e){g.forEach(t=>{t.enforce===e&&t.transform(k)})}function ae(e){h.forEach(t=>{t.enforce===e&&s.forEach(e=>{ie(t,e)})})}function oe(){s.slice().forEach(e=>{let t=bx(e);t&&t.length!==0&&t.forEach(e=>{_(e)})})}function se(e){let t=Zb(e),n=[];for(let e=0;e<t.length;e++){let r=x(t[e]);r&&n.push(r)}return n}function ce(){s.forEach(e=>{if(!Qb(e.value))return;let t=se(e.value);e.extensions.references=t.reduce((e,t)=>(e[t.name]=t,e),{})})}function j(){s.forEach(e=>{$b(e)})}function le(){A(`pre`),ae(`pre`),oe(),ce(),j(),A(`post`),ae(`post`),ee()}return b(),ne(...mx),re(...px),le(),k}function vx(e){return e[0]===`DEFAULT`?e:e.filter(e=>e!==`DEFAULT`)}function yx(e){return e.filter(e=>e!==`base`)}function bx(e){if(!e.extensions.conditions)return;let{conditions:t}=e.extensions,n=[];return Vv(t,(t,r)=>{let i=yx(r);if(!i.length)return;let a={...e,value:t,extensions:{...e.extensions,condition:i.join(`:`)}};n.push(a)}),n}function xx(e,t){let n=e.findIndex((n,r)=>t.every((t,n)=>e[r+n]===t));return n===-1?e:(e.splice(n,t.length),e.splice(n,0,`colorPalette`),e)}Vb()([`aspectRatios`,`zIndex`,`opacity`,`colors`,`fonts`,`fontSizes`,`fontWeights`,`lineHeights`,`letterSpacings`,`sizes`,`shadows`,`spacing`,`radii`,`cursor`,`borders`,`borderWidths`,`borderStyles`,`durations`,`easings`,`animations`,`blurs`,`gradients`,`breakpoints`,`assets`]);function Sx(e){return e}function Cx(e){return Dy(e,(e,t)=>[e,Sx(t)])}function wx(e){let t=Cx(e.config),n=e.tokens,r=new Map,i=new Map;function a(e,n){t[e]=Sx(n),o(e,n)}let o=(e,t)=>{let n=h(t);n&&(i.set(e,n),d(e,t))},s=()=>{for(let[e,n]of Object.entries(t))n&&o(e,n)},c=()=>{for(let[e,n]of Object.entries(t)){let{shorthand:t}=n??{};t&&(Array.isArray(t)?t:[t]).forEach(t=>r.set(t,e))}},l=()=>{let e=qb(n.colorPaletteMap);a(`colorPalette`,{values:Object.keys(e),transform:Py(t=>e[t])})},u=new Map,d=(e,t)=>{if(!t)return;let n=h(t,e=>`type:Tokens["${e}"]`);if(typeof n==`object`&&n.type){u.set(e,new Set([`type:${n.type}`]));return}if(n){let t=new Set(Object.keys(n));u.set(e,t)}let r=u.get(e)??new Set;t.property&&u.set(e,r.add(`CssProperties["${t.property}"]`))},f=()=>{for(let[e,n]of Object.entries(t))n&&d(e,n)},p=(e,t)=>{let n=u.get(e)??new Set;u.set(e,new Set([...n,...t]))},m=()=>{let e=new Map;for(let[t,n]of u.entries()){if(n.size===0){e.set(t,[`string`]);continue}let r=Array.from(n).map(e=>e.startsWith(`CssProperties`)?e:e.startsWith(`type:`)?e.replace(`type:`,``):JSON.stringify(e));e.set(t,r)}return e},h=(e,t)=>{let{values:r}=e,i=e=>{let n=t?.(e);return n?{[n]:n}:void 0};if(Kt(r))return i?.(r)??n.getCategoryValues(r)??Xy;if(Array.isArray(r)){let e={};for(let t=0;t<r.length;t++)e[r[t]]=r[t];return e}return qt(r)?r(t?i:n.getCategoryValues):r},g=Py((e,t)=>({[e]:e.startsWith(`--`)?n.getVar(t,t):t})),_=Object.assign(n.getVar,{raw:e=>n.getByName(e)}),v=Py((e,r)=>{let a=x(e);Kt(r)&&!r.includes(`_EMO_`)&&(r=n.expandReferenceInValue(r));let o=t[a];if(!o)return g(a,r);let s=i.get(a)?.[r];return o.transform?o.transform(s??r,{raw:r,token:_,utils:{colorMix:e=>Fv(e,_)}}):g(e,s??r)});function y(){c(),l(),s(),f()}y();let b=r.size>0,x=Py(e=>r.get(e)??e);return{keys:()=>[...Array.from(r.keys()),...Object.keys(t)],hasShorthand:b,transform:v,shorthands:r,resolveShorthand:x,register:a,getTypes:m,addPropertyType:p}}function Tx(...e){let t=Gv(...e),{theme:n={},utilities:r={},globalCss:i={},cssVarsRoot:a=`:where(:root, :host)`,cssVarsPrefix:o=`chakra`,preflight:s}=t,c=Mb(t),l=_x({breakpoints:n.breakpoints,tokens:n.tokens,semanticTokens:n.semanticTokens,prefix:o}),u=Uy(n.breakpoints??Xy),d=Yy({conditions:t.conditions??Xy,breakpoints:u}),f=wx({config:r,tokens:l});function p(){let{textStyles:e,layerStyles:t,animationStyles:r}=n,i=Wt({textStyle:e,layerStyle:t,animationStyle:r});for(let[e,t]of Object.entries(i)){let n=Oy(t??Xy,Dx);f.register(e,{values:Object.keys(n),transform(e){return y(n[e])}})}}p(),f.addPropertyType(`animationName`,Object.keys(n.keyframes??Xy));let m=new Set([`css`,...f.keys(),...d.keys()]),h=Py(e=>m.has(e)||Ey(e)),g=e=>{if(Array.isArray(e)){let t=Qy();for(let n=0;n<e.length;n++){let r=e[n];if(r!=null){let e=d.breakpoints[n];t[e]=r}}return t}return e},_=Nb({utility:f,normalize:g}),v=Fb({conditions:d,isValidProperty:h}),y=Sb({transform:f.transform,conditions:d,normalize:_}),b=Db({css:y,conditions:d,normalize:_,layers:c}),x=Bb({cva:b});function S(){let e={};for(let[t,n]of l.cssVarMap.entries()){let r=Object.fromEntries(n);if(Object.keys(r).length===0)continue;let i=t===`base`?a:d.resolve(t),o=i.startsWith(`@`);zv(e,y(v({[i]:o?{[a]:r}:r})))}return c.wrap(`tokens`,e)}function C(){let e=Dy(n.keyframes??Xy,(e,t)=>[`@keyframes ${e}`,t]),t=Object.assign({},e,y(v(i)));return c.wrap(`base`,t)}function w(e){return an(e,h)}function T(){let e=Pb({preflight:s});return c.wrap(`reset`,e)}let E=Ex(l),D=(e,t)=>E.get(e)?.value||t;D.var=(e,t)=>E.get(e)?.variable||t;function ee(e,t){return n.recipes?.[e]??t}function O(e,t){return n.slotRecipes?.[e]??t}let te=new Map,k=new Map;function ne(e,t){let n=te.get(e);return n||(n=b(ee(e,t??Xy)),te.set(e,n)),n}function re(e,t){let n=k.get(e);return n||(n=x(O(e,t??Xy)),k.set(e,n)),n}function ie(e){return Object.hasOwnProperty.call(n.recipes??Xy,e)}function A(e){return Object.hasOwnProperty.call(n.slotRecipes??Xy,e)}function ae(e){return ie(e)||A(e)}return{$$chakra:!0,_config:t,_global:[T(),C(),S()],breakpoints:u,tokens:l,conditions:d,utility:f,token:D,properties:m,layers:c,isValidProperty:h,splitCssProps:w,normalizeValue:g,getTokenCss:S,getGlobalCss:C,getPreflightCss:T,css:y,cva:b,sva:x,getRecipe:ee,getSlotRecipe:O,getRecipeFn:ne,getSlotRecipeFn:re,hasRecipe:ae,isRecipe:ie,isSlotRecipe:A,query:{layerStyles:Ox(n.layerStyles??Xy),textStyles:Ox(n.textStyles??Xy),animationStyles:Ox(n.animationStyles??Xy),tokens:kx(l,Object.keys(n.tokens??Xy),(e,t)=>!e.extensions.conditions&&!t.includes(`colorPalette`)),semanticTokens:kx(l,Object.keys(n.semanticTokens??Xy),e=>!!e.extensions.conditions),keyframes:Ax(n.keyframes??Xy),breakpoints:Ax(n.breakpoints??Xy)}}}function Ex(e){let t=new Map,n=new Set(e.allTokens.map(e=>e.name));for(let r of n){let n=e.getByName(r);if(!n?.extensions.cssVar)continue;let{cssVar:i,virtual:a,conditions:o}=n.extensions,s=o||a?i.ref:n.value;t.set(r,{value:s,variable:i.ref})}return t}var Dx=e=>Gt(e)&&`value`in e,Ox=e=>({list(){return Object.keys(Oy(e,Dx))},search(e){return this.list().filter(t=>t.includes(e))}}),kx=(e,t,n)=>({categoryKeys:t,list(t){let r=e.categoryMap.get(t),i=r?[...r.entries()]:[],a=[];for(let e=0;e<i.length;e++){let[t,r]=i[e];n(r,t)&&a.push(t)}return a},search(e,t){return this.list(e).filter(e=>e.includes(t))}}),Ax=e=>({list(){return Object.keys(e)},search(e){return this.list().filter(t=>t.includes(e))}}),jx={sm:`480px`,md:`768px`,lg:`1024px`,xl:`1280px`,"2xl":`1536px`},Mx=`var(--chakra-empty, )`,Nx=Yv({"*":{fontFeatureSettings:`"cv11"`,"--ring-inset":Mx,"--ring-offset-width":`0px`,"--ring-offset-color":`#fff`,"--ring-color":`rgba(66, 153, 225, 0.6)`,"--ring-offset-shadow":`0 0 #0000`,"--ring-shadow":`0 0 #0000`,...Object.fromEntries([`brightness`,`contrast`,`grayscale`,`hue-rotate`,`invert`,`saturate`,`sepia`,`drop-shadow`].map(e=>[`--${e}`,Mx])),...Object.fromEntries([`blur`,`brightness`,`contrast`,`grayscale`,`hue-rotate`,`invert`,`opacity`,`saturate`,`sepia`].map(e=>[`--backdrop-${e}`,Mx])),"--global-font-mono":`fonts.mono`,"--global-font-body":`fonts.body`,"--global-color-border":`colors.border`},html:{color:`fg`,bg:`bg`,lineHeight:`1.5`,colorPalette:`gray`},"*::placeholder, *[data-placeholder]":{color:`fg.muted/80`},"*::selection":{bg:`colorPalette.emphasized/80`}}),Px=$v({"fill.muted":{value:{background:`colorPalette.muted`,color:`colorPalette.fg`}},"fill.subtle":{value:{background:`colorPalette.subtle`,color:`colorPalette.fg`}},"fill.surface":{value:{background:`colorPalette.subtle`,color:`colorPalette.fg`,boxShadow:`0 0 0px 1px var(--shadow-color)`,boxShadowColor:`colorPalette.muted`}},"fill.solid":{value:{background:`colorPalette.solid`,color:`colorPalette.contrast`}},"outline.subtle":{value:{color:`colorPalette.fg`,boxShadow:`inset 0 0 0px 1px var(--shadow-color)`,boxShadowColor:`colorPalette.subtle`}},"outline.solid":{value:{borderWidth:`1px`,borderColor:`colorPalette.solid`,color:`colorPalette.fg`}},"indicator.bottom":{value:{position:`relative`,"--indicator-color-fallback":`colors.colorPalette.solid`,_before:{content:`""`,position:`absolute`,bottom:`var(--indicator-offset-y, 0)`,insetInline:`var(--indicator-offset-x, 0)`,height:`var(--indicator-thickness, 2px)`,background:`var(--indicator-color, var(--indicator-color-fallback))`}}},"indicator.top":{value:{position:`relative`,"--indicator-color-fallback":`colors.colorPalette.solid`,_before:{content:`""`,position:`absolute`,top:`var(--indicator-offset-y, 0)`,insetInline:`var(--indicator-offset-x, 0)`,height:`var(--indicator-thickness, 2px)`,background:`var(--indicator-color, var(--indicator-color-fallback))`}}},"indicator.start":{value:{position:`relative`,"--indicator-color-fallback":`colors.colorPalette.solid`,_before:{content:`""`,position:`absolute`,insetInlineStart:`var(--indicator-offset-x, 0)`,insetBlock:`var(--indicator-offset-y, 0)`,width:`var(--indicator-thickness, 2px)`,background:`var(--indicator-color, var(--indicator-color-fallback))`}}},"indicator.end":{value:{position:`relative`,"--indicator-color-fallback":`colors.colorPalette.solid`,_before:{content:`""`,position:`absolute`,insetInlineEnd:`var(--indicator-offset-x, 0)`,insetBlock:`var(--indicator-offset-y, 0)`,width:`var(--indicator-thickness, 2px)`,background:`var(--indicator-color, var(--indicator-color-fallback))`}}},disabled:{value:{opacity:`0.5`,cursor:`not-allowed`}},none:{value:{}}}),Fx=Qv({"slide-fade-in":{value:{transformOrigin:`var(--transform-origin)`,"&[data-placement^=top]":{animationName:`slide-from-bottom, fade-in`},"&[data-placement^=bottom]":{animationName:`slide-from-top, fade-in`},"&[data-placement^=left]":{animationName:`slide-from-right, fade-in`},"&[data-placement^=right]":{animationName:`slide-from-left, fade-in`}}},"slide-fade-out":{value:{transformOrigin:`var(--transform-origin)`,"&[data-placement^=top]":{animationName:`slide-to-bottom, fade-out`},"&[data-placement^=bottom]":{animationName:`slide-to-top, fade-out`},"&[data-placement^=left]":{animationName:`slide-to-right, fade-out`},"&[data-placement^=right]":{animationName:`slide-to-left, fade-out`}}},"scale-fade-in":{value:{transformOrigin:`var(--transform-origin)`,animationName:`scale-in, fade-in`}},"scale-fade-out":{value:{transformOrigin:`var(--transform-origin)`,animationName:`scale-out, fade-out`}}}),Ix=qv({className:`chakra-badge`,base:{display:`inline-flex`,alignItems:`center`,borderRadius:`l2`,gap:`1`,fontWeight:`medium`,fontVariantNumeric:`tabular-nums`,whiteSpace:`nowrap`,userSelect:`none`},variants:{variant:{solid:{bg:`colorPalette.solid`,color:`colorPalette.contrast`},subtle:{bg:`colorPalette.subtle`,color:`colorPalette.fg`},outline:{color:`colorPalette.fg`,"--outline-shadow-legacy":`colors.colorPalette.muted`,"--outline-shadow":`colors.colorPalette.border`,shadow:`inset 0 0 0px 1px var(--shadow-color)`,shadowColor:`var(--outline-shadow, var(--outline-shadow-legacy))`},surface:{bg:`colorPalette.subtle`,color:`colorPalette.fg`,shadow:`inset 0 0 0px 1px var(--shadow-color)`,shadowColor:`colorPalette.muted`},plain:{color:`colorPalette.fg`}},size:{xs:{textStyle:`2xs`,px:`1`,minH:`4`},sm:{textStyle:`xs`,px:`1.5`,minH:`5`},md:{textStyle:`sm`,px:`2`,minH:`6`},lg:{textStyle:`sm`,px:`2.5`,minH:`7`}}},defaultVariants:{variant:`subtle`,size:`sm`}}),Lx=qv({className:`chakra-button`,base:{display:`inline-flex`,appearance:`none`,alignItems:`center`,justifyContent:`center`,userSelect:`none`,position:`relative`,borderRadius:`l2`,whiteSpace:`nowrap`,verticalAlign:`middle`,borderWidth:`1px`,borderColor:`transparent`,cursor:`button`,flexShrink:`0`,outline:`0`,lineHeight:`1.2`,isolation:`isolate`,fontWeight:`medium`,transitionProperty:`common`,transitionDuration:`moderate`,focusVisibleRing:`outside`,_disabled:{layerStyle:`disabled`},_icon:{flexShrink:`0`}},variants:{size:{"2xs":{h:`6`,minW:`6`,textStyle:`xs`,px:`2`,gap:`1`,_icon:{width:`3.5`,height:`3.5`}},xs:{h:`8`,minW:`8`,textStyle:`xs`,px:`2.5`,gap:`1`,_icon:{width:`4`,height:`4`}},sm:{h:`9`,minW:`9`,px:`3.5`,textStyle:`sm`,gap:`2`,_icon:{width:`4`,height:`4`}},md:{h:`10`,minW:`10`,textStyle:`sm`,px:`4`,gap:`2`,_icon:{width:`5`,height:`5`}},lg:{h:`11`,minW:`11`,textStyle:`md`,px:`5`,gap:`3`,_icon:{width:`5`,height:`5`}},xl:{h:`12`,minW:`12`,textStyle:`md`,px:`5`,gap:`2.5`,_icon:{width:`5`,height:`5`}},"2xl":{h:`16`,minW:`16`,textStyle:`lg`,px:`7`,gap:`3`,_icon:{width:`6`,height:`6`}}},variant:{solid:{bg:`colorPalette.solid`,color:`colorPalette.contrast`,borderColor:`transparent`,_hover:{bg:`colorPalette.solid/90`},_expanded:{bg:`colorPalette.solid/90`}},subtle:{bg:`colorPalette.subtle`,color:`colorPalette.fg`,borderColor:`transparent`,_hover:{bg:`colorPalette.muted`},_expanded:{bg:`colorPalette.muted`}},surface:{bg:`colorPalette.subtle`,color:`colorPalette.fg`,shadow:`0 0 0px 1px var(--shadow-color)`,shadowColor:`colorPalette.muted`,_hover:{bg:`colorPalette.muted`},_expanded:{bg:`colorPalette.muted`}},outline:{borderWidth:`1px`,"--outline-color-legacy":`colors.colorPalette.muted`,"--outline-color":`colors.colorPalette.border`,borderColor:`var(--outline-color, var(--outline-color-legacy))`,color:`colorPalette.fg`,_hover:{bg:`colorPalette.subtle`},_expanded:{bg:`colorPalette.subtle`}},ghost:{bg:`transparent`,color:`colorPalette.fg`,_hover:{bg:`colorPalette.subtle`},_expanded:{bg:`colorPalette.subtle`}},plain:{color:`colorPalette.fg`}}},defaultVariants:{size:`md`,variant:`solid`}}),Rx=qv({className:`chakra-checkmark`,base:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,flexShrink:`0`,color:`white`,borderWidth:`1px`,borderColor:`transparent`,borderRadius:`l1`,cursor:`checkbox`,focusVisibleRing:`outside`,_icon:{boxSize:`full`},_invalid:{colorPalette:`red`,borderColor:`border.error`},_disabled:{opacity:`0.5`,cursor:`disabled`}},variants:{size:{xs:{boxSize:`3`},sm:{boxSize:`4`},md:{boxSize:`5`,p:`0.5`},lg:{boxSize:`6`,p:`0.5`}},variant:{solid:{borderColor:`border.emphasized`,"&:is([data-state=checked], [data-state=indeterminate])":{bg:`colorPalette.solid`,color:`colorPalette.contrast`,borderColor:`colorPalette.solid`}},outline:{borderColor:`border`,"&:is([data-state=checked], [data-state=indeterminate])":{color:`colorPalette.fg`,borderColor:`colorPalette.solid`}},subtle:{bg:`colorPalette.muted`,borderColor:`colorPalette.muted`,"&:is([data-state=checked], [data-state=indeterminate])":{color:`colorPalette.fg`}},plain:{"&:is([data-state=checked], [data-state=indeterminate])":{color:`colorPalette.fg`}},inverted:{borderColor:`border`,color:`colorPalette.fg`,"&:is([data-state=checked], [data-state=indeterminate])":{borderColor:`colorPalette.solid`}}},filled:{true:{bg:`bg`}}},defaultVariants:{variant:`solid`,size:`md`}}),{variants:zx,defaultVariants:Bx}=Ix,Vx=qv({className:`chakra-code`,base:{fontFamily:`mono`,alignItems:`center`,display:`inline-flex`,borderRadius:`l2`},variants:zx,defaultVariants:Bx}),Hx=qv({className:`color-swatch`,base:{boxSize:`var(--swatch-size)`,shadow:`inset 0 0 0 1px rgba(0, 0, 0, 0.1)`,"--checker-size":`8px`,"--checker-bg":`colors.bg`,"--checker-fg":`colors.bg.emphasized`,background:`linear-gradient(var(--color), var(--color)), repeating-conic-gradient(var(--checker-fg) 0%, var(--checker-fg) 25%, var(--checker-bg) 0%, var(--checker-bg) 50%) 0% 50% / var(--checker-size) var(--checker-size) !important`,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,flexShrink:`0`},variants:{size:{"2xs":{"--swatch-size":`sizes.3.5`},xs:{"--swatch-size":`sizes.4`},sm:{"--swatch-size":`sizes.4.5`},md:{"--swatch-size":`sizes.5`},lg:{"--swatch-size":`sizes.6`},xl:{"--swatch-size":`sizes.7`},"2xl":{"--swatch-size":`sizes.8`},inherit:{"--swatch-size":`inherit`},full:{"--swatch-size":`100%`}},shape:{square:{borderRadius:`none`},circle:{borderRadius:`full`},rounded:{borderRadius:`l1`}}},defaultVariants:{size:`md`,shape:`rounded`}}),Ux=qv({className:`chakra-container`,base:{position:`relative`,maxWidth:`8xl`,w:`100%`,mx:`auto`,px:{base:`4`,md:`6`,lg:`8`}},variants:{centerContent:{true:{display:`flex`,flexDirection:`column`,alignItems:`center`}},fluid:{true:{maxWidth:`full`}}}}),Wx=qv({className:`chakra-heading`,base:{fontFamily:`heading`,fontWeight:`semibold`},variants:{size:{xs:{textStyle:`xs`},sm:{textStyle:`sm`},md:{textStyle:`md`},lg:{textStyle:`lg`},xl:{textStyle:`xl`},"2xl":{textStyle:`2xl`},"3xl":{textStyle:`3xl`},"4xl":{textStyle:`4xl`},"5xl":{textStyle:`5xl`},"6xl":{textStyle:`6xl`},"7xl":{textStyle:`7xl`}}},defaultVariants:{size:`xl`}}),Gx=qv({className:`chakra-icon`,base:{display:`inline-block`,lineHeight:`1em`,flexShrink:`0`,color:`currentcolor`,verticalAlign:`middle`},variants:{size:{inherit:{},xs:{boxSize:`3`},sm:{boxSize:`4`},md:{boxSize:`5`},lg:{boxSize:`6`},xl:{boxSize:`7`},"2xl":{boxSize:`8`}}},defaultVariants:{size:`inherit`}}),Kx=qv({className:`chakra-input`,base:{width:`100%`,minWidth:`0`,outline:`0`,position:`relative`,appearance:`none`,textAlign:`start`,borderRadius:`l2`,_disabled:{layerStyle:`disabled`},height:`var(--input-height)`,minW:`var(--input-height)`,"--focus-color":`colors.colorPalette.focusRing`,"--error-color":`colors.border.error`,_invalid:{focusRingColor:`var(--error-color)`,borderColor:`var(--error-color)`}},variants:{size:{"2xs":{textStyle:`xs`,px:`2`,"--input-height":`sizes.7`},xs:{textStyle:`xs`,px:`2`,"--input-height":`sizes.8`},sm:{textStyle:`sm`,px:`2.5`,"--input-height":`sizes.9`},md:{textStyle:`sm`,px:`3`,"--input-height":`sizes.10`},lg:{textStyle:`md`,px:`4`,"--input-height":`sizes.11`},xl:{textStyle:`md`,px:`4.5`,"--input-height":`sizes.12`},"2xl":{textStyle:`lg`,px:`5`,"--input-height":`sizes.16`}},variant:{outline:{bg:`transparent`,borderWidth:`1px`,borderColor:`border`,focusVisibleRing:`inside`,focusRingColor:`var(--focus-color)`},subtle:{borderWidth:`1px`,borderColor:`transparent`,bg:`bg.muted`,focusVisibleRing:`inside`,focusRingColor:`var(--focus-color)`},flushed:{bg:`transparent`,borderBottomWidth:`1px`,borderBottomColor:`border`,borderRadius:`0`,px:`0`,_focusVisible:{borderColor:`var(--focus-color)`,boxShadow:`0px 1px 0px 0px var(--focus-color)`,_invalid:{borderColor:`var(--error-color)`,boxShadow:`0px 1px 0px 0px var(--error-color)`}}}}},defaultVariants:{size:`md`,variant:`outline`}}),qx=qv({className:`chakra-input-addon`,base:{flex:`0 0 auto`,width:`auto`,display:`flex`,alignItems:`center`,whiteSpace:`nowrap`,alignSelf:`stretch`,borderRadius:`l2`},variants:{size:Kx.variants.size,variant:{outline:{borderWidth:`1px`,borderColor:`border`,bg:`bg.muted`},subtle:{borderWidth:`1px`,borderColor:`transparent`,bg:`bg.emphasized`},flushed:{borderBottom:`1px solid`,borderColor:`inherit`,borderRadius:`0`,px:`0`,bg:`transparent`}}},defaultVariants:{size:`md`,variant:`outline`}}),Jx=qv({className:`chakra-kbd`,base:{display:`inline-flex`,alignItems:`center`,fontWeight:`medium`,fontFamily:`mono`,flexShrink:`0`,whiteSpace:`nowrap`,wordSpacing:`-0.5em`,userSelect:`none`,px:`1`,borderRadius:`l2`},variants:{variant:{raised:{bg:`colorPalette.subtle`,color:`colorPalette.fg`,borderWidth:`1px`,borderBottomWidth:`2px`,borderColor:`colorPalette.muted`},outline:{borderWidth:`1px`,color:`colorPalette.fg`},subtle:{bg:`colorPalette.muted`,color:`colorPalette.fg`},plain:{color:`colorPalette.fg`}},size:{sm:{textStyle:`xs`,height:`4.5`},md:{textStyle:`sm`,height:`5`},lg:{textStyle:`md`,height:`6`}}},defaultVariants:{size:`md`,variant:`raised`}}),Yx=qv({className:`chakra-link`,base:{display:`inline-flex`,alignItems:`center`,outline:`none`,gap:`1.5`,cursor:`pointer`,borderRadius:`l1`,focusVisibleRing:`outside`},variants:{variant:{underline:{color:`colorPalette.fg`,textDecoration:`underline`,textUnderlineOffset:`3px`,textDecorationColor:`currentColor/20`},plain:{color:`colorPalette.fg`,_hover:{textDecoration:`underline`,textUnderlineOffset:`3px`,textDecorationColor:`currentColor/20`}}}},defaultVariants:{variant:`plain`}}),Xx=qv({className:`chakra-mark`,base:{bg:`transparent`,color:`inherit`,whiteSpace:`nowrap`},variants:{variant:{subtle:{bg:`colorPalette.subtle`,color:`inherit`},solid:{bg:`colorPalette.solid`,color:`colorPalette.contrast`},text:{fontWeight:`medium`},plain:{}}}}),Zx=qv({className:`chakra-radiomark`,base:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0,verticalAlign:`top`,color:`white`,borderWidth:`1px`,borderColor:`transparent`,borderRadius:`full`,cursor:`radio`,_focusVisible:{outline:`2px solid`,outlineColor:`colorPalette.focusRing`,outlineOffset:`2px`},_invalid:{colorPalette:`red`,borderColor:`red.500`},_disabled:{opacity:`0.5`,cursor:`disabled`},"& .dot":{height:`100%`,width:`100%`,borderRadius:`full`,bg:`currentColor`,scale:`0.4`}},variants:{variant:{solid:{borderWidth:`1px`,borderColor:`border.emphasized`,_checked:{bg:`colorPalette.solid`,color:`colorPalette.contrast`,borderColor:`colorPalette.solid`}},subtle:{borderWidth:`1px`,bg:`colorPalette.muted`,borderColor:`colorPalette.muted`,color:`transparent`,_checked:{color:`colorPalette.fg`}},outline:{borderWidth:`1px`,borderColor:`inherit`,_checked:{color:`colorPalette.fg`,borderColor:`colorPalette.solid`},"& .dot":{scale:`0.6`}},inverted:{bg:`bg`,borderWidth:`1px`,borderColor:`inherit`,_checked:{color:`colorPalette.solid`,borderColor:`currentcolor`}}},size:{xs:{boxSize:`3`},sm:{boxSize:`4`},md:{boxSize:`5`},lg:{boxSize:`6`}},filled:{true:{bg:`bg`}}},defaultVariants:{variant:`solid`,size:`md`}}),Qx={badge:Ix,button:Lx,code:Vx,container:Ux,heading:Wx,input:Kx,inputAddon:qx,kbd:Jx,link:Yx,mark:Xx,separator:qv({className:`chakra-separator`,base:{display:`block`,borderColor:`border`},variants:{variant:{solid:{borderStyle:`solid`},dashed:{borderStyle:`dashed`},dotted:{borderStyle:`dotted`}},orientation:{vertical:{borderInlineStartWidth:`var(--separator-thickness)`},horizontal:{borderTopWidth:`var(--separator-thickness)`}},size:{xs:{"--separator-thickness":`0.5px`},sm:{"--separator-thickness":`1px`},md:{"--separator-thickness":`2px`},lg:{"--separator-thickness":`3px`}}},defaultVariants:{size:`sm`,variant:`solid`,orientation:`horizontal`}}),skeleton:qv({className:`chakra-skeleton`,base:{},variants:{loading:{true:{borderRadius:`l2`,boxShadow:`none`,backgroundClip:`padding-box`,cursor:`default`,color:`transparent`,pointerEvents:`none`,userSelect:`none`,flexShrink:`0`,"&::before, &::after, *":{visibility:`hidden`}},false:{background:`unset`,animation:`fade-in var(--fade-duration, 0.1s) ease-out !important`}},variant:{pulse:{background:`bg.emphasized`,animation:`pulse`,animationDuration:`var(--duration, 1.2s)`},shine:{"--animate-from":`200%`,"--animate-to":`-200%`,"--start-color":`colors.bg.muted`,"--end-color":`colors.bg.emphasized`,backgroundImage:`linear-gradient(270deg,var(--start-color),var(--end-color),var(--end-color),var(--start-color))`,backgroundSize:`400% 100%`,animation:`bg-position var(--duration, 5s) ease-in-out infinite`},none:{animation:`none`}}},defaultVariants:{variant:`pulse`,loading:!0}}),skipNavLink:qv({className:`chakra-skip-nav`,base:{display:`inline-flex`,bg:`bg.panel`,padding:`2.5`,borderRadius:`l2`,fontWeight:`semibold`,focusVisibleRing:`outside`,textStyle:`sm`,userSelect:`none`,border:`0`,height:`1px`,width:`1px`,margin:`-1px`,outline:`0`,overflow:`hidden`,position:`absolute`,clip:`rect(0 0 0 0)`,_focusVisible:{clip:`auto`,width:`auto`,height:`auto`,position:`fixed`,top:`6`,insetStart:`6`}}}),spinner:qv({className:`chakra-spinner`,base:{display:`inline-block`,borderColor:`currentColor`,borderStyle:`solid`,borderWidth:`2px`,borderRadius:`full`,width:`var(--spinner-size)`,height:`var(--spinner-size)`,animation:`spin`,animationDuration:`slowest`,"--spinner-track-color":`transparent`,borderBottomColor:`var(--spinner-track-color)`,borderInlineStartColor:`var(--spinner-track-color)`},variants:{size:{inherit:{"--spinner-size":`1em`},xs:{"--spinner-size":`sizes.3`},sm:{"--spinner-size":`sizes.4`},md:{"--spinner-size":`sizes.5`},lg:{"--spinner-size":`sizes.8`},xl:{"--spinner-size":`sizes.10`}}},defaultVariants:{size:`md`}}),textarea:qv({className:`chakra-textarea`,base:{width:`100%`,minWidth:`0`,outline:`0`,position:`relative`,appearance:`none`,textAlign:`start`,borderRadius:`l2`,_disabled:{layerStyle:`disabled`},"--focus-color":`colors.colorPalette.focusRing`,"--error-color":`colors.border.error`,_invalid:{focusRingColor:`var(--error-color)`,borderColor:`var(--error-color)`}},variants:{size:{xs:{textStyle:`xs`,px:`2`,py:`1.5`,scrollPaddingBottom:`1.5`},sm:{textStyle:`sm`,px:`2.5`,py:`2`,scrollPaddingBottom:`2`},md:{textStyle:`sm`,px:`3`,py:`2`,scrollPaddingBottom:`2`},lg:{textStyle:`md`,px:`4`,py:`3`,scrollPaddingBottom:`3`},xl:{textStyle:`md`,px:`4.5`,py:`3.5`,scrollPaddingBottom:`3.5`}},variant:{outline:{bg:`transparent`,borderWidth:`1px`,borderColor:`border`,focusVisibleRing:`inside`},subtle:{borderWidth:`1px`,borderColor:`transparent`,bg:`bg.muted`,focusVisibleRing:`inside`},flushed:{bg:`transparent`,borderBottomWidth:`1px`,borderBottomColor:`border`,borderRadius:`0`,px:`0`,_focusVisible:{borderColor:`var(--focus-color)`,boxShadow:`0px 1px 0px 0px var(--focus-color)`}}}},defaultVariants:{size:`md`,variant:`outline`}}),icon:Gx,checkmark:Rx,radiomark:Zx,colorSwatch:Hx},$x=ny.colors({bg:{DEFAULT:{value:{_light:`{colors.white}`,_dark:`{colors.black}`}},subtle:{value:{_light:`{colors.gray.50}`,_dark:`{colors.gray.950}`}},muted:{value:{_light:`{colors.gray.100}`,_dark:`{colors.gray.900}`}},emphasized:{value:{_light:`{colors.gray.200}`,_dark:`{colors.gray.800}`}},inverted:{value:{_light:`{colors.black}`,_dark:`{colors.white}`}},panel:{value:{_light:`{colors.white}`,_dark:`{colors.gray.950}`}},error:{value:{_light:`{colors.red.50}`,_dark:`{colors.red.950}`}},warning:{value:{_light:`{colors.orange.50}`,_dark:`{colors.orange.950}`}},success:{value:{_light:`{colors.green.50}`,_dark:`{colors.green.950}`}},info:{value:{_light:`{colors.blue.50}`,_dark:`{colors.blue.950}`}}},fg:{DEFAULT:{value:{_light:`{colors.black}`,_dark:`{colors.gray.50}`}},muted:{value:{_light:`{colors.gray.600}`,_dark:`{colors.gray.400}`}},subtle:{value:{_light:`{colors.gray.400}`,_dark:`{colors.gray.500}`}},inverted:{value:{_light:`{colors.gray.50}`,_dark:`{colors.black}`}},error:{value:{_light:`{colors.red.500}`,_dark:`{colors.red.400}`}},warning:{value:{_light:`{colors.orange.600}`,_dark:`{colors.orange.300}`}},success:{value:{_light:`{colors.green.600}`,_dark:`{colors.green.300}`}},info:{value:{_light:`{colors.blue.600}`,_dark:`{colors.blue.300}`}}},border:{DEFAULT:{value:{_light:`{colors.gray.200}`,_dark:`{colors.gray.800}`}},muted:{value:{_light:`{colors.gray.100}`,_dark:`{colors.gray.900}`}},subtle:{value:{_light:`{colors.gray.50}`,_dark:`{colors.gray.950}`}},emphasized:{value:{_light:`{colors.gray.300}`,_dark:`{colors.gray.700}`}},inverted:{value:{_light:`{colors.gray.800}`,_dark:`{colors.gray.200}`}},error:{value:{_light:`{colors.red.500}`,_dark:`{colors.red.400}`}},warning:{value:{_light:`{colors.orange.500}`,_dark:`{colors.orange.400}`}},success:{value:{_light:`{colors.green.500}`,_dark:`{colors.green.400}`}},info:{value:{_light:`{colors.blue.500}`,_dark:`{colors.blue.400}`}}},gray:{contrast:{value:{_light:`{colors.white}`,_dark:`{colors.black}`}},fg:{value:{_light:`{colors.gray.800}`,_dark:`{colors.gray.200}`}},subtle:{value:{_light:`{colors.gray.100}`,_dark:`{colors.gray.900}`}},muted:{value:{_light:`{colors.gray.200}`,_dark:`{colors.gray.800}`}},emphasized:{value:{_light:`{colors.gray.300}`,_dark:`{colors.gray.700}`}},solid:{value:{_light:`{colors.gray.900}`,_dark:`{colors.white}`}},focusRing:{value:{_light:`{colors.gray.400}`,_dark:`{colors.gray.400}`}},border:{value:{_light:`{colors.gray.200}`,_dark:`{colors.gray.800}`}}},red:{contrast:{value:{_light:`white`,_dark:`white`}},fg:{value:{_light:`{colors.red.700}`,_dark:`{colors.red.300}`}},subtle:{value:{_light:`{colors.red.100}`,_dark:`{colors.red.900}`}},muted:{value:{_light:`{colors.red.200}`,_dark:`{colors.red.800}`}},emphasized:{value:{_light:`{colors.red.300}`,_dark:`{colors.red.700}`}},solid:{value:{_light:`{colors.red.600}`,_dark:`{colors.red.600}`}},focusRing:{value:{_light:`{colors.red.500}`,_dark:`{colors.red.500}`}},border:{value:{_light:`{colors.red.500}`,_dark:`{colors.red.400}`}}},orange:{contrast:{value:{_light:`white`,_dark:`black`}},fg:{value:{_light:`{colors.orange.700}`,_dark:`{colors.orange.300}`}},subtle:{value:{_light:`{colors.orange.100}`,_dark:`{colors.orange.900}`}},muted:{value:{_light:`{colors.orange.200}`,_dark:`{colors.orange.800}`}},emphasized:{value:{_light:`{colors.orange.300}`,_dark:`{colors.orange.700}`}},solid:{value:{_light:`{colors.orange.600}`,_dark:`{colors.orange.500}`}},focusRing:{value:{_light:`{colors.orange.500}`,_dark:`{colors.orange.500}`}},border:{value:{_light:`{colors.orange.500}`,_dark:`{colors.orange.400}`}}},green:{contrast:{value:{_light:`white`,_dark:`white`}},fg:{value:{_light:`{colors.green.700}`,_dark:`{colors.green.300}`}},subtle:{value:{_light:`{colors.green.100}`,_dark:`{colors.green.900}`}},muted:{value:{_light:`{colors.green.200}`,_dark:`{colors.green.800}`}},emphasized:{value:{_light:`{colors.green.300}`,_dark:`{colors.green.700}`}},solid:{value:{_light:`{colors.green.600}`,_dark:`{colors.green.600}`}},focusRing:{value:{_light:`{colors.green.500}`,_dark:`{colors.green.500}`}},border:{value:{_light:`{colors.green.500}`,_dark:`{colors.green.400}`}}},blue:{contrast:{value:{_light:`white`,_dark:`white`}},fg:{value:{_light:`{colors.blue.700}`,_dark:`{colors.blue.300}`}},subtle:{value:{_light:`{colors.blue.100}`,_dark:`{colors.blue.900}`}},muted:{value:{_light:`{colors.blue.200}`,_dark:`{colors.blue.800}`}},emphasized:{value:{_light:`{colors.blue.300}`,_dark:`{colors.blue.700}`}},solid:{value:{_light:`{colors.blue.600}`,_dark:`{colors.blue.600}`}},focusRing:{value:{_light:`{colors.blue.500}`,_dark:`{colors.blue.500}`}},border:{value:{_light:`{colors.blue.500}`,_dark:`{colors.blue.400}`}}},yellow:{contrast:{value:{_light:`black`,_dark:`black`}},fg:{value:{_light:`{colors.yellow.800}`,_dark:`{colors.yellow.300}`}},subtle:{value:{_light:`{colors.yellow.100}`,_dark:`{colors.yellow.900}`}},muted:{value:{_light:`{colors.yellow.200}`,_dark:`{colors.yellow.800}`}},emphasized:{value:{_light:`{colors.yellow.300}`,_dark:`{colors.yellow.700}`}},solid:{value:{_light:`{colors.yellow.300}`,_dark:`{colors.yellow.300}`}},focusRing:{value:{_light:`{colors.yellow.500}`,_dark:`{colors.yellow.500}`}},border:{value:{_light:`{colors.yellow.500}`,_dark:`{colors.yellow.500}`}}},teal:{contrast:{value:{_light:`white`,_dark:`white`}},fg:{value:{_light:`{colors.teal.700}`,_dark:`{colors.teal.300}`}},subtle:{value:{_light:`{colors.teal.100}`,_dark:`{colors.teal.900}`}},muted:{value:{_light:`{colors.teal.200}`,_dark:`{colors.teal.800}`}},emphasized:{value:{_light:`{colors.teal.300}`,_dark:`{colors.teal.700}`}},solid:{value:{_light:`{colors.teal.600}`,_dark:`{colors.teal.600}`}},focusRing:{value:{_light:`{colors.teal.500}`,_dark:`{colors.teal.500}`}},border:{value:{_light:`{colors.teal.500}`,_dark:`{colors.teal.400}`}}},purple:{contrast:{value:{_light:`white`,_dark:`white`}},fg:{value:{_light:`{colors.purple.700}`,_dark:`{colors.purple.300}`}},subtle:{value:{_light:`{colors.purple.100}`,_dark:`{colors.purple.900}`}},muted:{value:{_light:`{colors.purple.200}`,_dark:`{colors.purple.800}`}},emphasized:{value:{_light:`{colors.purple.300}`,_dark:`{colors.purple.700}`}},solid:{value:{_light:`{colors.purple.600}`,_dark:`{colors.purple.600}`}},focusRing:{value:{_light:`{colors.purple.500}`,_dark:`{colors.purple.500}`}},border:{value:{_light:`{colors.purple.500}`,_dark:`{colors.purple.400}`}}},pink:{contrast:{value:{_light:`white`,_dark:`white`}},fg:{value:{_light:`{colors.pink.700}`,_dark:`{colors.pink.300}`}},subtle:{value:{_light:`{colors.pink.100}`,_dark:`{colors.pink.900}`}},muted:{value:{_light:`{colors.pink.200}`,_dark:`{colors.pink.800}`}},emphasized:{value:{_light:`{colors.pink.300}`,_dark:`{colors.pink.700}`}},solid:{value:{_light:`{colors.pink.600}`,_dark:`{colors.pink.600}`}},focusRing:{value:{_light:`{colors.pink.500}`,_dark:`{colors.pink.500}`}},border:{value:{_light:`{colors.pink.500}`,_dark:`{colors.pink.400}`}}},cyan:{contrast:{value:{_light:`white`,_dark:`white`}},fg:{value:{_light:`{colors.cyan.700}`,_dark:`{colors.cyan.300}`}},subtle:{value:{_light:`{colors.cyan.100}`,_dark:`{colors.cyan.900}`}},muted:{value:{_light:`{colors.cyan.200}`,_dark:`{colors.cyan.800}`}},emphasized:{value:{_light:`{colors.cyan.300}`,_dark:`{colors.cyan.700}`}},solid:{value:{_light:`{colors.cyan.600}`,_dark:`{colors.cyan.600}`}},focusRing:{value:{_light:`{colors.cyan.500}`,_dark:`{colors.cyan.500}`}},border:{value:{_light:`{colors.cyan.500}`,_dark:`{colors.cyan.400}`}}}}),eS=ny.radii({l1:{value:`{radii.xs}`},l2:{value:`{radii.sm}`},l3:{value:`{radii.md}`}}),tS=ny.shadows({xs:{value:{_light:`0px 1px 2px {colors.gray.900/10}, 0px 0px 1px {colors.gray.900/20}`,_dark:`0px 1px 1px {black/64}, 0px 0px 1px inset {colors.gray.300/20}`}},sm:{value:{_light:`0px 2px 4px {colors.gray.900/10}, 0px 0px 1px {colors.gray.900/30}`,_dark:`0px 2px 4px {black/64}, 0px 0px 1px inset {colors.gray.300/30}`}},md:{value:{_light:`0px 4px 8px {colors.gray.900/10}, 0px 0px 1px {colors.gray.900/30}`,_dark:`0px 4px 8px {black/64}, 0px 0px 1px inset {colors.gray.300/30}`}},lg:{value:{_light:`0px 8px 16px {colors.gray.900/10}, 0px 0px 1px {colors.gray.900/30}`,_dark:`0px 8px 16px {black/64}, 0px 0px 1px inset {colors.gray.300/30}`}},xl:{value:{_light:`0px 16px 24px {colors.gray.900/10}, 0px 0px 1px {colors.gray.900/30}`,_dark:`0px 16px 24px {black/64}, 0px 0px 1px inset {colors.gray.300/30}`}},"2xl":{value:{_light:`0px 24px 40px {colors.gray.900/16}, 0px 0px 1px {colors.gray.900/30}`,_dark:`0px 24px 40px {black/64}, 0px 0px 1px inset {colors.gray.300/30}`}},inner:{value:{_light:`inset 0 2px 4px 0 {black/5}`,_dark:`inset 0 2px 4px 0 black`}},inset:{value:{_light:`inset 0 0 0 1px {black/5}`,_dark:`inset 0 0 0 1px {colors.gray.300/5}`}}}),nS=Kc.extendWith(`itemBody`),rS=H(`action-bar`).parts(`positioner`,`content`,`separator`,`selectionTrigger`,`closeTrigger`),iS=H(`alert`).parts(`title`,`description`,`root`,`indicator`,`content`),aS=H(`breadcrumb`).parts(`link`,`currentLink`,`item`,`list`,`root`,`ellipsis`,`separator`),oS=H(`blockquote`).parts(`root`,`icon`,`content`,`caption`),sS=H(`card`).parts(`root`,`header`,`body`,`footer`,`title`,`description`),cS=H(`checkbox-card`,[`root`,`control`,`label`,`description`,`addon`,`indicator`,`content`]),lS=H(`data-list`).parts(`root`,`item`,`itemLabel`,`itemValue`),uS=Lp.extendWith(`indicatorGroup`),dS=Rp.extendWith(`header`,`body`,`footer`,`backdrop`),fS=Rp.extendWith(`header`,`body`,`footer`,`backdrop`),pS=im.extendWith(`textarea`),mS=H(`empty-state`,[`root`,`content`,`indicator`,`title`,`description`]),hS=am.extendWith(`requiredIndicator`),gS=sm.extendWith(`content`),_S=cm.extendWith(`itemContent`,`dropzoneContent`,`fileText`),vS=H(`list`).parts(`root`,`item`,`indicator`),yS=mm.extendWith(`itemCommand`),bS=H(`select`).parts(`root`,`field`,`indicator`),xS=_m.extendWith(`header`,`body`,`footer`),SS=bm.extendWith(`itemAddon`,`itemIndicator`),CS=SS.extendWith(`itemContent`,`itemDescription`),wS=xm.extendWith(`itemIndicator`),TS=wm.extendWith(`indicatorGroup`),ES=Pp.extendWith(`indicatorGroup`,`empty`),DS=Qm.extendWith(`markerIndicator`,`markerLabel`),OS=H(`stat`).parts(`root`,`label`,`helpText`,`valueText`,`valueUnit`,`indicator`),kS=H(`status`).parts(`root`,`indicator`),AS=H(`steps`,[`root`,`list`,`item`,`trigger`,`indicator`,`separator`,`content`,`title`,`description`,`nextTrigger`,`prevTrigger`,`progress`]),jS=ag.extendWith(`indicator`),MS=H(`table`).parts(`root`,`header`,`body`,`row`,`columnHeader`,`cell`,`footer`,`caption`),NS=H(`toast`).parts(`root`,`title`,`description`,`indicator`,`closeTrigger`,`actionTrigger`),PS=H(`tabs`).parts(`root`,`trigger`,`list`,`content`,`contentGroup`,`indicator`),FS=H(`tag`).parts(`root`,`label`,`closeTrigger`,`startElement`,`endElement`),IS=H(`timeline`).parts(`root`,`item`,`content`,`separator`,`indicator`,`connector`,`title`,`description`),LS=xp.extendWith(`channelText`),RS=H(`code-block`,[`root`,`content`,`title`,`header`,`footer`,`control`,`overlay`,`code`,`codeText`,`copyTrigger`,`copyIndicator`,`collapseTrigger`,`collapseIndicator`,`collapseText`]),zS=nh.extendWith(`resizeTriggerSeparator`,`resizeTriggerIndicator`);Wu.extendWith(`valueText`);var BS=fm,VS=G({className:`chakra-accordion`,slots:nS.keys(),base:{root:{width:`full`,"--accordion-radius":`radii.l2`},item:{overflowAnchor:`none`},itemTrigger:{display:`flex`,alignItems:`center`,textAlign:`start`,width:`full`,outline:`0`,gap:`3`,fontWeight:`medium`,borderRadius:`var(--accordion-radius)`,_focusVisible:{outline:`2px solid`,outlineColor:`colorPalette.focusRing`},_disabled:{layerStyle:`disabled`}},itemBody:{pt:`var(--accordion-padding-y)`,pb:`calc(var(--accordion-padding-y) * 2)`},itemContent:{overflow:`hidden`,borderRadius:`var(--accordion-radius)`,_open:{animationName:`expand-height, fade-in`,animationDuration:`moderate`},_closed:{animationName:`collapse-height, fade-out`,animationDuration:`moderate`}},itemIndicator:{transition:`rotate 0.2s`,transformOrigin:`center`,color:`fg.subtle`,_open:{rotate:`180deg`},_icon:{width:`1.2em`,height:`1.2em`}}},variants:{variant:{outline:{item:{borderBottomWidth:`1px`}},subtle:{itemTrigger:{px:`var(--accordion-padding-x)`},itemContent:{px:`var(--accordion-padding-x)`},item:{borderRadius:`var(--accordion-radius)`,_open:{bg:`colorPalette.subtle`}}},enclosed:{root:{borderWidth:`1px`,borderRadius:`var(--accordion-radius)`,divideY:`1px`,overflow:`hidden`},itemTrigger:{px:`var(--accordion-padding-x)`},itemContent:{px:`var(--accordion-padding-x)`},item:{_open:{bg:`bg.subtle`}}},plain:{}},size:{sm:{root:{"--accordion-padding-x":`spacing.3`,"--accordion-padding-y":`spacing.2`},itemTrigger:{textStyle:`sm`,py:`var(--accordion-padding-y)`}},md:{root:{"--accordion-padding-x":`spacing.4`,"--accordion-padding-y":`spacing.2`},itemTrigger:{textStyle:`md`,py:`var(--accordion-padding-y)`}},lg:{root:{"--accordion-padding-x":`spacing.4.5`,"--accordion-padding-y":`spacing.2.5`},itemTrigger:{textStyle:`lg`,py:`var(--accordion-padding-y)`}}}},defaultVariants:{size:`md`,variant:`outline`}}),HS=G({className:`chakra-action-bar`,slots:rS.keys(),base:{positioner:{position:`fixed`,display:`flex`,pointerEvents:`none`,insetInline:`0`,"--action-bar-offset":`spacing.4`},content:{bg:`bg.panel`,shadow:`md`,display:`flex`,alignItems:`center`,gap:`3`,borderRadius:`l3`,py:`2.5`,px:`3`,pointerEvents:`auto`,translate:`calc(-1 * var(--scrollbar-width) / 2) 0px`,_open:{animationName:`slide-from-bottom, fade-in`,animationDuration:`moderate`},_closed:{animationName:`slide-to-bottom, fade-out`,animationDuration:`faster`}},separator:{width:`1px`,height:`5`,bg:`border`},selectionTrigger:{display:`inline-flex`,alignItems:`center`,gap:`2`,alignSelf:`stretch`,textStyle:`sm`,px:`4`,py:`1`,borderRadius:`l2`,borderWidth:`1px`,borderStyle:`dashed`}},variants:{placement:{bottom:{positioner:{bottom:`calc(env(safe-area-inset-bottom) + var(--action-bar-offset))`,justifyContent:`center`}},"bottom-start":{positioner:{bottom:`calc(env(safe-area-inset-bottom) + var(--action-bar-offset))`,justifyContent:`flex-start`,ps:`var(--action-bar-offset)`}},"bottom-end":{positioner:{bottom:`calc(env(safe-area-inset-bottom) + var(--action-bar-offset))`,justifyContent:`flex-end`,pe:`var(--action-bar-offset)`}}}},defaultVariants:{placement:`bottom`}}),US=G({slots:iS.keys(),className:`chakra-alert`,base:{root:{width:`full`,display:`flex`,alignItems:`flex-start`,position:`relative`,borderRadius:`l3`},title:{fontWeight:`medium`},description:{display:`inline`},indicator:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,flexShrink:`0`,width:`1em`,height:`1em`,_icon:{boxSize:`full`}},content:{display:`flex`,flex:`1`,gap:`1`}},variants:{status:{info:{root:{colorPalette:`blue`}},warning:{root:{colorPalette:`orange`}},success:{root:{colorPalette:`green`}},error:{root:{colorPalette:`red`}},neutral:{root:{colorPalette:`gray`}}},inline:{true:{content:{display:`inline-flex`,flexDirection:`row`,alignItems:`center`}},false:{content:{display:`flex`,flexDirection:`column`}}},variant:{subtle:{root:{bg:`colorPalette.subtle`,color:`colorPalette.fg`}},surface:{root:{bg:`colorPalette.subtle`,color:`colorPalette.fg`,shadow:`inset 0 0 0px 1px var(--shadow-color)`,shadowColor:`colorPalette.muted`},indicator:{color:`colorPalette.fg`}},outline:{root:{color:`colorPalette.fg`,shadow:`inset 0 0 0px 1px var(--shadow-color)`,"--outline-shadow-legacy":`colors.colorPalette.muted`,"--outline-shadow":`colors.colorPalette.border`,shadowColor:`var(--outline-shadow, var(--outline-shadow-legacy))`},indicator:{color:`colorPalette.fg`}},solid:{root:{bg:`colorPalette.solid`,color:`colorPalette.contrast`},indicator:{color:`colorPalette.contrast`}}},size:{sm:{root:{gap:`2`,px:`3`,py:`3`,textStyle:`xs`},indicator:{textStyle:`lg`}},md:{root:{gap:`3`,px:`4`,py:`4`,textStyle:`sm`},indicator:{textStyle:`xl`}},lg:{root:{gap:`3`,px:`4`,py:`4`,textStyle:`md`},indicator:{textStyle:`2xl`}}}},defaultVariants:{status:`info`,variant:`subtle`,size:`md`,inline:!1}}),WS=G({slots:qc.keys(),className:`chakra-avatar`,base:{root:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,fontWeight:`medium`,position:`relative`,verticalAlign:`top`,flexShrink:`0`,userSelect:`none`,width:`var(--avatar-size)`,height:`var(--avatar-size)`,fontSize:`var(--avatar-font-size)`,borderRadius:`var(--avatar-radius)`,"&[data-group-item]":{borderWidth:`2px`,borderColor:`bg`}},image:{width:`100%`,height:`100%`,objectFit:`cover`,borderRadius:`var(--avatar-radius)`},fallback:{lineHeight:`1`,textTransform:`uppercase`,fontWeight:`medium`,fontSize:`var(--avatar-font-size)`,borderRadius:`var(--avatar-radius)`}},variants:{size:{full:{root:{"--avatar-size":`100%`,"--avatar-font-size":`100%`}},"2xs":{root:{"--avatar-font-size":`fontSizes.2xs`,"--avatar-size":`sizes.6`}},xs:{root:{"--avatar-font-size":`fontSizes.xs`,"--avatar-size":`sizes.8`}},sm:{root:{"--avatar-font-size":`fontSizes.sm`,"--avatar-size":`sizes.9`}},md:{root:{"--avatar-font-size":`fontSizes.md`,"--avatar-size":`sizes.10`}},lg:{root:{"--avatar-font-size":`fontSizes.md`,"--avatar-size":`sizes.11`}},xl:{root:{"--avatar-font-size":`fontSizes.lg`,"--avatar-size":`sizes.12`}},"2xl":{root:{"--avatar-font-size":`fontSizes.xl`,"--avatar-size":`sizes.16`}}},variant:{solid:{root:{bg:`colorPalette.solid`,color:`colorPalette.contrast`}},subtle:{root:{bg:`colorPalette.muted`,color:`colorPalette.fg`}},outline:{root:{color:`colorPalette.fg`,borderWidth:`1px`,"--outline-shadow-legacy":`colors.colorPalette.muted`,"--outline-shadow":`colors.colorPalette.border`,borderColor:`var(--outline-shadow, var(--outline-shadow-legacy))`}}},shape:{square:{},rounded:{root:{"--avatar-radius":`radii.l3`}},full:{root:{"--avatar-radius":`radii.full`}}},borderless:{true:{root:{"&[data-group-item]":{borderWidth:`0px`}}}}},defaultVariants:{size:`md`,shape:`full`,variant:`subtle`}}),GS=G({className:`chakra-blockquote`,slots:oS.keys(),base:{root:{position:`relative`,display:`flex`,flexDirection:`column`,gap:`2`},caption:{textStyle:`sm`,color:`fg.muted`},icon:{boxSize:`5`}},variants:{justify:{start:{root:{alignItems:`flex-start`,textAlign:`start`}},center:{root:{alignItems:`center`,textAlign:`center`}},end:{root:{alignItems:`flex-end`,textAlign:`end`}}},variant:{subtle:{root:{paddingX:`5`,borderStartWidth:`4px`,borderStartColor:`colorPalette.muted`},icon:{color:`colorPalette.fg`}},solid:{root:{paddingX:`5`,borderStartWidth:`4px`,borderStartColor:`colorPalette.solid`},icon:{color:`colorPalette.solid`}},plain:{root:{paddingX:`5`},icon:{color:`colorPalette.solid`}}}},defaultVariants:{variant:`subtle`,justify:`start`}}),KS=G({className:`chakra-breadcrumb`,slots:aS.keys(),base:{list:{display:`flex`,alignItems:`center`,wordBreak:`break-word`,color:`fg.muted`,listStyle:`none`},link:{outline:`0`,textDecoration:`none`,borderRadius:`l1`,focusRing:`outside`,display:`inline-flex`,alignItems:`center`,gap:`2`},item:{display:`inline-flex`,alignItems:`center`},separator:{color:`fg.muted`,opacity:`0.8`,_icon:{boxSize:`1em`},_rtl:{rotate:`180deg`}},ellipsis:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,_icon:{boxSize:`1em`}}},variants:{variant:{underline:{link:{color:`colorPalette.fg`,textDecoration:`underline`,textUnderlineOffset:`0.2em`,textDecorationColor:`colorPalette.muted`},currentLink:{color:`colorPalette.fg`}},plain:{link:{color:`fg.muted`,_hover:{color:`fg`}},currentLink:{color:`fg`}}},size:{sm:{list:{gap:`1`,textStyle:`xs`}},md:{list:{gap:`1.5`,textStyle:`sm`}},lg:{list:{gap:`2`,textStyle:`md`}}}},defaultVariants:{variant:`plain`,size:`md`}}),qS=G({className:`chakra-card`,slots:sS.keys(),base:{root:{display:`flex`,flexDirection:`column`,position:`relative`,minWidth:`0`,wordWrap:`break-word`,borderRadius:`l3`,color:`fg`,textAlign:`start`},title:{fontWeight:`semibold`},description:{color:`fg.muted`,fontSize:`sm`},header:{paddingInline:`var(--card-padding)`,paddingTop:`var(--card-padding)`,display:`flex`,flexDirection:`column`,gap:`1.5`},body:{padding:`var(--card-padding)`,flex:`1`,display:`flex`,flexDirection:`column`},footer:{display:`flex`,alignItems:`center`,gap:`2`,paddingInline:`var(--card-padding)`,paddingBottom:`var(--card-padding)`}},variants:{size:{sm:{root:{"--card-padding":`spacing.4`},title:{textStyle:`md`}},md:{root:{"--card-padding":`spacing.6`},title:{textStyle:`lg`}},lg:{root:{"--card-padding":`spacing.7`},title:{textStyle:`xl`}}},variant:{elevated:{root:{bg:`bg.panel`,boxShadow:`md`}},outline:{root:{bg:`bg.panel`,borderWidth:`1px`,borderColor:`border`}},subtle:{root:{bg:`bg.muted`}}}},defaultVariants:{variant:`outline`,size:`md`}}),JS=G({className:`carousel`,slots:au.keys(),base:{root:{position:`relative`,display:`flex`,gap:`2`,_horizontal:{flexDirection:`column`},_vertical:{flexDirection:`row`}},item:{_horizontal:{width:`100%`},_vertical:{height:`100%`}},control:{display:`flex`,alignItems:`center`,_horizontal:{flexDirection:`row`,width:`100%`},_vertical:{flexDirection:`column`,height:`100%`}},indicatorGroup:{display:`flex`,justifyContent:`center`,gap:`3`,_horizontal:{flexDirection:`row`},_vertical:{flexDirection:`column`}},indicator:{width:`2.5`,height:`2.5`,borderRadius:`full`,bg:`colorPalette.subtle`,cursor:`button`,_current:{bg:`colorPalette.solid`}}},defaultVariants:{}}),YS=G({slots:Uu.keys(),className:`chakra-checkbox`,base:{root:{display:`inline-flex`,gap:`2`,alignItems:`center`,verticalAlign:`top`,position:`relative`},control:Rx.base,label:{fontWeight:`medium`,userSelect:`none`,_disabled:{opacity:`0.5`}}},variants:{size:{xs:{root:{gap:`1.5`},label:{textStyle:`xs`},control:Rx.variants?.size?.xs},sm:{root:{gap:`2`},label:{textStyle:`sm`},control:Rx.variants?.size?.sm},md:{root:{gap:`2.5`},label:{textStyle:`sm`},control:Rx.variants?.size?.md},lg:{root:{gap:`3`},label:{textStyle:`md`},control:Rx.variants?.size?.lg}},variant:{outline:{control:Rx.variants?.variant?.outline},solid:{control:Rx.variants?.variant?.solid},subtle:{control:Rx.variants?.variant?.subtle}}},defaultVariants:{variant:`solid`,size:`md`}}),XS=G({slots:cS.keys(),className:`chakra-checkbox-card`,base:{root:{display:`flex`,flexDirection:`column`,userSelect:`none`,position:`relative`,borderRadius:`l2`,flex:`1`,focusVisibleRing:`outside`,_disabled:{opacity:`0.8`},_invalid:{outline:`2px solid`,outlineColor:`border.error`}},control:{display:`inline-flex`,flex:`1`,position:`relative`,borderRadius:`inherit`,justifyContent:`var(--checkbox-card-justify)`,alignItems:`var(--checkbox-card-align)`},label:{fontWeight:`medium`,display:`flex`,alignItems:`center`,gap:`2`,flex:`1`,_disabled:{opacity:`0.5`}},description:{opacity:`0.64`,textStyle:`sm`,_disabled:{opacity:`0.5`}},addon:{_disabled:{opacity:`0.5`}},indicator:Rx.base,content:{display:`flex`,flexDirection:`column`,flex:`1`,gap:`1`,justifyContent:`var(--checkbox-card-justify)`,alignItems:`var(--checkbox-card-align)`}},variants:{size:{sm:{root:{textStyle:`sm`},control:{padding:`3`,gap:`1.5`},addon:{px:`3`,py:`1.5`,borderTopWidth:`1px`},indicator:Rx.variants?.size.sm},md:{root:{textStyle:`sm`},control:{padding:`4`,gap:`2.5`},addon:{px:`4`,py:`2`,borderTopWidth:`1px`},indicator:Rx.variants?.size.md},lg:{root:{textStyle:`md`},control:{padding:`4`,gap:`3.5`},addon:{px:`4`,py:`2`,borderTopWidth:`1px`},indicator:Rx.variants?.size.lg}},variant:{surface:{root:{borderWidth:`1px`,borderColor:`border`,_checked:{bg:`colorPalette.subtle`,color:`colorPalette.fg`,borderColor:`colorPalette.muted`},_disabled:{bg:`bg.muted`}},indicator:Rx.variants?.variant.solid},subtle:{root:{bg:`bg.muted`},control:{_checked:{bg:`colorPalette.muted`,color:`colorPalette.fg`}},indicator:Rx.variants?.variant.plain},outline:{root:{borderWidth:`1px`,borderColor:`border`,_checked:{boxShadow:`inset 0 0 0 1px var(--shadow-color)`,boxShadowColor:`colorPalette.solid`,borderColor:`colorPalette.solid`}},indicator:Rx.variants?.variant.solid},solid:{root:{borderWidth:`1px`,_checked:{bg:`colorPalette.solid`,color:`colorPalette.contrast`,borderColor:`colorPalette.solid`}},indicator:Rx.variants?.variant.inverted}},justify:{start:{root:{"--checkbox-card-justify":`flex-start`}},end:{root:{"--checkbox-card-justify":`flex-end`}},center:{root:{"--checkbox-card-justify":`center`}}},align:{start:{root:{"--checkbox-card-align":`flex-start`},content:{textAlign:`start`}},end:{root:{"--checkbox-card-align":`flex-end`},content:{textAlign:`end`}},center:{root:{"--checkbox-card-align":`center`},content:{textAlign:`center`}}},orientation:{vertical:{control:{flexDirection:`column`}},horizontal:{control:{flexDirection:`row`}}}},defaultVariants:{size:`md`,variant:`outline`,align:`start`,orientation:`horizontal`}}),ZS=G({slots:RS.keys(),className:`code-block`,base:{root:{colorPalette:`gray`,rounded:`var(--code-block-radius)`,overflow:`hidden`,bg:`bg`,color:`fg`,borderWidth:`1px`,"--code-block-max-height":`320px`,"--code-block-bg":`colors.bg`,"--code-block-fg":`colors.fg`,"--code-block-obscured-opacity":`0.5`,"--code-block-obscured-blur":`1px`,"--code-block-line-number-width":`sizes.3`,"--code-block-line-number-margin":`spacing.4`,"--code-block-highlight-bg":`{colors.teal.focusRing/20}`,"--code-block-highlight-border":`colors.teal.focusRing`,"--code-block-highlight-added-bg":`{colors.green.focusRing/20}`,"--code-block-highlight-added-border":`colors.green.focusRing`,"--code-block-highlight-removed-bg":`{colors.red.focusRing/20}`,"--code-block-highlight-removed-border":`colors.red.focusRing`},header:{display:`flex`,alignItems:`center`,gap:`2`,position:`relative`,px:`var(--code-block-padding)`,minH:`var(--code-block-header-height)`,mb:`calc(var(--code-block-padding) / 2 * -1)`},title:{display:`inline-flex`,alignItems:`center`,gap:`1.5`,flex:`1`,color:`fg.muted`},control:{gap:`1.5`,display:`inline-flex`,alignItems:`center`},footer:{display:`flex`,alignItems:`center`,justifyContent:`center`,gap:`2`,px:`var(--code-block-padding)`,minH:`var(--code-block-header-height)`},content:{position:`relative`,colorScheme:`dark`,borderBottomRadius:`var(--code-block-radius)`,maxHeight:`var(--code-block-max-height)`,"& ::selection":{bg:`blue.500/40`},_expanded:{maxHeight:`unset`}},overlay:{"--bg":`{colors.black/50}`,display:`flex`,alignItems:`flex-end`,justifyContent:`center`,padding:`4`,bgImage:`linear-gradient(0deg,var(--bg) 25%,transparent 100%)`,color:`white`,minH:`5rem`,pos:`absolute`,bottom:`0`,insetInline:`0`,zIndex:`1`,fontWeight:`medium`,_expanded:{display:`none`}},code:{fontFamily:`mono`,lineHeight:`tall`,whiteSpace:`pre`,counterReset:`line 0`,overflowX:`auto`,overflowY:`hidden`},codeText:{px:`var(--code-block-padding)`,py:`var(--code-block-padding)`,position:`relative`,display:`block`,width:`100%`,"&[data-has-focused]":{"& [data-line]:not([data-focused])":{transitionProperty:`opacity, filter`,transitionDuration:`moderate`,transitionTimingFunction:`ease-in-out`,opacity:`var(--code-block-obscured-opacity)`,filter:`blur(var(--code-block-obscured-blur))`},"&:hover":{"--code-block-obscured-opacity":`1`,"--code-block-obscured-blur":`0px`}},"&[data-has-line-numbers][data-plaintext]":{paddingInlineStart:`calc(var(--code-block-line-number-width) + var(--code-block-line-number-margin) + var(--code-block-padding))`},"& [data-line]":{position:`relative`,paddingInlineEnd:`var(--code-block-padding)`,"--highlight-bg":`var(--code-block-highlight-bg)`,"--highlight-border":`var(--code-block-highlight-border)`,"&[data-highlight], &[data-diff]":{display:`inline-block`,width:`full`,"&:after":{content:`''`,display:`block`,position:`absolute`,top:`0`,insetStart:`calc(var(--code-block-padding) * -1)`,insetEnd:`0px`,width:`calc(100% + var(--code-block-padding) * 2)`,height:`100%`,bg:`var(--highlight-bg)`,borderStartWidth:`2px`,borderStartColor:`var(--highlight-border)`}},"&[data-diff='added']":{"--highlight-bg":`var(--code-block-highlight-added-bg)`,"--highlight-border":`var(--code-block-highlight-added-border)`},"&[data-diff='removed']":{"--highlight-bg":`var(--code-block-highlight-removed-bg)`,"--highlight-border":`var(--code-block-highlight-removed-border)`}},"&[data-word-wrap]":{"&[data-plaintext], & [data-line]":{whiteSpace:`pre-wrap`,wordBreak:`break-all`}},"&[data-has-line-numbers]":{"--content":`counter(line)`,"& [data-line]:before":{content:`var(--content)`,counterIncrement:`line`,width:`var(--code-block-line-number-width)`,marginRight:`var(--code-block-line-number-margin)`,display:`inline-block`,textAlign:`end`,userSelect:`none`,whiteSpace:`nowrap`,opacity:.4},"& [data-diff='added']:before":{content:`'+'`},"& [data-diff='removed']:before":{content:`'-'`}}}},variants:{size:{sm:{root:{"--code-block-padding":`spacing.4`,"--code-block-radius":`radii.md`,"--code-block-header-height":`sizes.8`},title:{textStyle:`xs`},code:{fontSize:`xs`}},md:{root:{"--code-block-padding":`spacing.4`,"--code-block-radius":`radii.lg`,"--code-block-header-height":`sizes.10`},title:{textStyle:`xs`},code:{fontSize:`sm`}},lg:{root:{"--code-block-padding":`spacing.5`,"--code-block-radius":`radii.xl`,"--code-block-header-height":`sizes.12`},title:{textStyle:`sm`},code:{fontSize:`sm`}}}},defaultVariants:{size:`md`}}),QS=G({slots:Gu.keys(),className:`chakra-collapsible`,base:{content:{overflow:`hidden`,_open:{animationName:`expand-height, fade-in`,animationDuration:`moderate`,"&[data-has-collapsed-size]":{animationName:`expand-height`}},_closed:{animationName:`collapse-height, fade-out`,animationDuration:`moderate`,"&[data-has-collapsed-size]":{animationName:`collapse-height`}}}}}),$S=G({className:`colorPicker`,slots:LS.keys(),base:{root:{display:`flex`,flexDirection:`column`,gap:`1.5`},label:{color:`fg`,fontWeight:`medium`,textStyle:`sm`,_disabled:{opacity:`0.5`}},valueText:{textAlign:`start`},control:{display:`flex`,alignItems:`center`,flexDirection:`row`,gap:`2`,position:`relative`},swatchTrigger:{display:`flex`,alignItems:`center`,justifyContent:`center`},trigger:{display:`flex`,alignItems:`center`,justifyContent:`center`,flexDirection:`row`,flexShrink:`0`,gap:`2`,textStyle:`sm`,minH:`var(--input-height)`,minW:`var(--input-height)`,px:`1`,rounded:`l2`,_disabled:{opacity:`0.5`},"--focus-color":`colors.colorPalette.focusRing`,"&:focus-visible":{borderColor:`var(--focus-color)`,outline:`1px solid var(--focus-color)`},"&[data-fit-content]":{"--input-height":`unset`,px:`0`,border:`0`}},content:{display:`flex`,flexDirection:`column`,bg:`bg.panel`,borderRadius:`l3`,boxShadow:`lg`,width:`64`,p:`4`,gap:`3`,"--color-picker-z-index":`zIndex.popover`,zIndex:`calc(var(--color-picker-z-index) + var(--layer-index, 0))`,_open:{animationStyle:`slide-fade-in`,animationDuration:`fast`},_closed:{animationStyle:`slide-fade-out`,animationDuration:`faster`}},area:{height:`180px`,borderRadius:`l2`,overflow:`hidden`},areaThumb:{borderRadius:`full`,height:`var(--thumb-size)`,width:`var(--thumb-size)`,borderWidth:`2px`,borderColor:`white`,shadow:`sm`,focusVisibleRing:`mixed`,focusRingColor:`white`},areaBackground:{height:`full`},channelSlider:{borderRadius:`l2`,flex:`1`},channelSliderTrack:{height:`var(--slider-height)`,borderRadius:`inherit`,boxShadow:`inset 0 0 0 1px rgba(0,0,0,0.1)`},channelText:{textStyle:`xs`,color:`fg.muted`,fontWeight:`medium`,textTransform:`capitalize`},swatchGroup:{display:`flex`,flexDirection:`row`,flexWrap:`wrap`,gap:`2`},swatch:{...Hx.base,borderRadius:`l1`},swatchIndicator:{color:`white`,rounded:`full`},channelSliderThumb:{borderRadius:`full`,height:`var(--thumb-size)`,width:`var(--thumb-size)`,borderWidth:`2px`,borderColor:`white`,shadow:`sm`,transform:`translate(-50%, -50%)`,focusVisibleRing:`outside`,focusRingOffset:`1px`},channelInput:{...Kx.base,"&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{WebkitAppearance:`none`,margin:0}},formatSelect:{textStyle:`xs`,textTransform:`uppercase`,borderWidth:`1px`,minH:`6`,focusRing:`inside`,rounded:`l2`},transparencyGrid:{borderRadius:`l2`},view:{display:`flex`,flexDirection:`column`,gap:`2`}},variants:{size:{"2xs":{channelInput:Kx.variants?.size?.[`2xs`],swatch:{"--swatch-size":`sizes.4.5`},trigger:{"--input-height":`sizes.7`},area:{"--thumb-size":`sizes.3`},channelSlider:{"--slider-height":`sizes.3`,"--thumb-size":`sizes.3`}},xs:{channelInput:Kx.variants?.size?.xs,swatch:{"--swatch-size":`sizes.5`},trigger:{"--input-height":`sizes.8`},area:{"--thumb-size":`sizes.3.5`},channelSlider:{"--slider-height":`sizes.3.5`,"--thumb-size":`sizes.3.5`}},sm:{channelInput:Kx.variants?.size?.sm,swatch:{"--swatch-size":`sizes.6`},trigger:{"--input-height":`sizes.9`},area:{"--thumb-size":`sizes.3.5`},channelSlider:{"--slider-height":`sizes.3.5`,"--thumb-size":`sizes.3.5`}},md:{channelInput:Kx.variants?.size?.md,swatch:{"--swatch-size":`sizes.7`},trigger:{"--input-height":`sizes.10`},area:{"--thumb-size":`sizes.3.5`},channelSlider:{"--slider-height":`sizes.3.5`,"--thumb-size":`sizes.3.5`}},lg:{channelInput:Kx.variants?.size?.lg,swatch:{"--swatch-size":`sizes.7`},trigger:{"--input-height":`sizes.11`},area:{"--thumb-size":`sizes.3.5`},channelSlider:{"--slider-height":`sizes.3.5`,"--thumb-size":`sizes.3.5`}},xl:{channelInput:Kx.variants?.size?.xl,swatch:{"--swatch-size":`sizes.8`},trigger:{"--input-height":`sizes.12`},area:{"--thumb-size":`sizes.3.5`},channelSlider:{"--slider-height":`sizes.3.5`,"--thumb-size":`sizes.3.5`}},"2xl":{channelInput:Kx.variants?.size?.[`2xl`],swatch:{"--swatch-size":`sizes.10`},trigger:{"--input-height":`sizes.16`},area:{"--thumb-size":`sizes.3.5`},channelSlider:{"--slider-height":`sizes.3.5`,"--thumb-size":`sizes.3.5`}}},variant:{outline:{channelInput:Kx.variants?.variant?.outline,trigger:{borderWidth:`1px`}},subtle:{channelInput:Kx.variants?.variant?.subtle,trigger:{borderWidth:`1px`,borderColor:`transparent`,bg:`bg.muted`}}}},defaultVariants:{size:`md`,variant:`outline`}}),eC=G({className:`chakra-combobox`,slots:ES.keys(),base:{root:{display:`flex`,flexDirection:`column`,gap:`1.5`,width:`full`},label:{fontWeight:`medium`,userSelect:`none`,textStyle:`sm`,_disabled:{layerStyle:`disabled`}},control:{pos:`relative`,"--padding-factor":`1`,"--combobox-input-padding-end":`var(--combobox-input-padding-x)`,"&:has([data-part=trigger]), &:has([data-part=clear-trigger])":{"--combobox-input-padding-end":`calc(var(--combobox-input-height) * var(--padding-factor))`},"&:has([data-part=trigger]):has([data-part=clear-trigger]:not([hidden]))":{"--padding-factor":`1.5`}},input:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,background:`bg.panel`,width:`full`,minH:`var(--combobox-input-height)`,ps:`var(--combobox-input-padding-x)`,pe:`var(--combobox-input-padding-end)`,"--input-height":`var(--combobox-input-height)`,borderRadius:`l2`,outline:0,userSelect:`none`,textAlign:`start`,_placeholderShown:{color:`fg.muted`},_disabled:{layerStyle:`disabled`},"--focus-color":`colors.colorPalette.focusRing`,"--error-color":`colors.border.error`,_invalid:{focusRingColor:`var(--error-color)`,borderColor:`var(--error-color)`}},trigger:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,"--input-height":`var(--combobox-input-height)`},clearTrigger:{color:`fg.muted`,pointerEvents:`auto`,focusVisibleRing:`inside`,focusRingWidth:`2px`,rounded:`l1`},indicatorGroup:{display:`flex`,alignItems:`center`,justifyContent:`center`,gap:`1`,pos:`absolute`,insetEnd:`0`,top:`0`,bottom:`0`,px:`var(--combobox-input-padding-x)`,_icon:{boxSize:`var(--combobox-indicator-size)`},"[data-disabled] &":{opacity:.5}},content:{background:`bg.panel`,display:`flex`,flexDirection:`column`,"--combobox-z-index":`zIndex.popover`,zIndex:`calc(var(--combobox-z-index) + var(--layer-index, 0))`,borderRadius:`l2`,outline:0,maxH:`96`,overflowY:`auto`,boxShadow:`md`,_open:{animationStyle:`slide-fade-in`,animationDuration:`fast`},_closed:{animationStyle:`slide-fade-out`,animationDuration:`0s`},"&[data-empty]:not(:has([data-scope=combobox][data-part=empty]))":{opacity:0}},item:{position:`relative`,userSelect:`none`,display:`flex`,alignItems:`center`,gap:`2`,py:`var(--combobox-item-padding-y)`,px:`var(--combobox-item-padding-x)`,cursor:`option`,justifyContent:`space-between`,flex:`1`,textAlign:`start`,borderRadius:`l1`,_highlighted:{bg:`bg.emphasized/60`},_disabled:{pointerEvents:`none`,opacity:`0.5`},_icon:{boxSize:`var(--combobox-indicator-size)`}},empty:{py:`var(--combobox-item-padding-y)`,px:`var(--combobox-item-padding-x)`},itemText:{flex:`1`},itemGroup:{pb:`var(--combobox-item-padding-y)`,_last:{pb:`0`}},itemGroupLabel:{fontWeight:`medium`,py:`var(--combobox-item-padding-y)`,px:`var(--combobox-item-padding-x)`}},variants:{variant:{outline:{input:{bg:`transparent`,borderWidth:`1px`,borderColor:`border`,focusVisibleRing:`inside`}},subtle:{input:{borderWidth:`1px`,borderColor:`transparent`,bg:`bg.muted`,focusVisibleRing:`inside`}},flushed:{input:{bg:`transparent`,borderBottomWidth:`1px`,borderBottomColor:`border`,borderRadius:`0`,px:`0`,_focusVisible:{borderColor:`var(--focus-color)`,boxShadow:`0px 1px 0px 0px var(--focus-color)`}},indicatorGroup:{px:`0`}}},size:{xs:{root:{"--combobox-input-height":`sizes.8`,"--combobox-input-padding-x":`spacing.2`,"--combobox-indicator-size":`sizes.3.5`},input:{textStyle:`xs`},content:{"--combobox-item-padding-x":`spacing.1.5`,"--combobox-item-padding-y":`spacing.1`,"--combobox-indicator-size":`sizes.3.5`,p:`1`,textStyle:`xs`},trigger:{textStyle:`xs`,gap:`1`}},sm:{root:{"--combobox-input-height":`sizes.9`,"--combobox-input-padding-x":`spacing.2.5`,"--combobox-indicator-size":`sizes.4`},input:{textStyle:`sm`},content:{"--combobox-item-padding-x":`spacing.2`,"--combobox-item-padding-y":`spacing.1.5`,"--combobox-indicator-size":`sizes.4`,p:`1`,textStyle:`sm`},trigger:{textStyle:`sm`,gap:`1`}},md:{root:{"--combobox-input-height":`sizes.10`,"--combobox-input-padding-x":`spacing.3`,"--combobox-indicator-size":`sizes.4`},input:{textStyle:`sm`},content:{"--combobox-item-padding-x":`spacing.2`,"--combobox-item-padding-y":`spacing.1.5`,"--combobox-indicator-size":`sizes.4`,p:`1`,textStyle:`sm`},itemIndicator:{display:`flex`,alignItems:`center`,justifyContent:`center`},trigger:{textStyle:`sm`,gap:`2`}},lg:{root:{"--combobox-input-height":`sizes.12`,"--combobox-input-padding-x":`spacing.4`,"--combobox-indicator-size":`sizes.5`},input:{textStyle:`md`},content:{"--combobox-item-padding-y":`spacing.2`,"--combobox-item-padding-x":`spacing.3`,"--combobox-indicator-size":`sizes.5`,p:`1.5`,textStyle:`md`},trigger:{textStyle:`md`,py:`3`,gap:`2`}}}},defaultVariants:{size:`md`,variant:`outline`}}),tC=G({slots:lS.keys(),className:`chakra-data-list`,base:{itemLabel:{display:`flex`,alignItems:`center`,gap:`1`},itemValue:{display:`flex`,minWidth:`0`,flex:`1`}},variants:{orientation:{horizontal:{root:{display:`flex`,flexDirection:`column`},item:{display:`inline-flex`,alignItems:`center`,gap:`4`},itemLabel:{minWidth:`120px`}},vertical:{root:{display:`flex`,flexDirection:`column`},item:{display:`flex`,flexDirection:`column`,gap:`1`}}},size:{sm:{root:{gap:`3`},item:{textStyle:`xs`}},md:{root:{gap:`4`},item:{textStyle:`sm`}},lg:{root:{gap:`5`},item:{textStyle:`md`}}},variant:{subtle:{itemLabel:{color:`fg.muted`}},bold:{itemLabel:{fontWeight:`medium`},itemValue:{color:`fg.muted`}}}},defaultVariants:{size:`md`,orientation:`vertical`,variant:`subtle`}}),nC=G({className:`chakra-date-input`,slots:Fp.keys(),base:{root:{display:`flex`,flexDirection:`column`,gap:`1.5`,width:`full`,_disabled:{opacity:`0.5`}},label:{textStyle:`label`},control:{display:`flex`,alignItems:`center`,width:`full`},segmentGroup:{flex:`1`,outline:`0`,position:`relative`,appearance:`none`,textAlign:`start`,borderRadius:`l2`,height:`var(--input-height)`,minW:`var(--input-height)`,"--focus-color":`colors.colorPalette.focusRing`,"--error-color":`colors.border.error`,_invalid:{focusRingColor:`var(--error-color)`,borderColor:`var(--error-color)`},display:`flex`,alignItems:`center`,gap:`1`,cursor:`text`},segment:{borderRadius:`l1`,px:`0.5`,outline:`none`,_placeholderShown:{color:`fg.subtle`},"&[data-type=literal]":{px:`0`,color:`fg.subtle`}}},variants:{size:{"2xs":{segmentGroup:{textStyle:`xs`,px:`1.5`,"--input-height":`sizes.7`}},xs:{segmentGroup:{textStyle:`xs`,px:`1.5`,"--input-height":`sizes.8`}},sm:{segmentGroup:{textStyle:`sm`,px:`2`,"--input-height":`sizes.9`}},md:{segmentGroup:{textStyle:`sm`,px:`2.5`,"--input-height":`sizes.10`}},lg:{segmentGroup:{textStyle:`md`,px:`3.5`,"--input-height":`sizes.11`}},xl:{segmentGroup:{textStyle:`md`,px:`4`,"--input-height":`sizes.12`}},"2xl":{segmentGroup:{textStyle:`lg`,px:`4.5`,"--input-height":`sizes.16`}}},variant:{outline:{segmentGroup:{bg:`transparent`,borderWidth:`1px`,borderColor:`border`,focusRing:`inside`,focusRingColor:`var(--focus-color)`},segment:{_focus:{bg:`colorPalette.emphasized`,color:`fg`}}},subtle:{segmentGroup:{borderWidth:`1px`,borderColor:`transparent`,bg:`bg.muted`,focusRing:`inside`,focusRingColor:`var(--focus-color)`},segment:{_focus:{bg:`colorPalette.subtle`,color:`colorPalette.fg`}}},flushed:{segmentGroup:{bg:`transparent`,borderBottomWidth:`1px`,borderBottomColor:`border`,borderRadius:`0`,px:`0`,_focus:{borderColor:`var(--focus-color)`,boxShadow:`0px 1px 0px 0px var(--focus-color)`,_invalid:{borderColor:`var(--error-color)`,boxShadow:`0px 1px 0px 0px var(--error-color)`}}},segment:{_focus:{bg:`colorPalette.subtle`,color:`colorPalette.fg`}}}}},defaultVariants:{size:`md`,variant:`outline`}}),rC=Xv({display:`inline-flex`,alignItems:`center`,justifyContent:`center`,boxSize:`var(--datepicker-nav-trigger-size)`,borderRadius:`l2`,color:`fg`,focusVisibleRing:`inside`,focusRingWidth:`2px`,_hover:{bg:`colorPalette.subtle`},_focusVisible:{boxShadow:`0 0 0 2px var(--colors-color-palette-focus-ring)`},_disabled:{opacity:.5},_icon:{boxSize:`4`}}),iC=Xv({height:`var(--datepicker-select-height)`,ps:`2`,pe:`8`,textStyle:`sm`,borderWidth:`1px`,borderRadius:`l2`,outline:`none`,focusVisibleRing:`inside`,appearance:`none`,fieldSizing:`content`,backgroundImage:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")`,backgroundRepeat:`no-repeat`,backgroundPosition:`right 0.375rem center`,backgroundSize:`1.25em`}),aC=G({className:`date-picker`,slots:uS.keys(),base:{root:{display:`flex`,flexDirection:`column`,gap:`1.5`,width:`full`,"--datepicker-indicators-offset":`sizes.3`,_disabled:{opacity:.5}},label:{textStyle:`sm`,fontWeight:`medium`},indicatorGroup:{position:`absolute`,insetEnd:`var(--datepicker-indicators-offset)`,top:`50%`,transform:`translateY(-50%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,gap:`1`},control:{display:`flex`,alignItems:`center`,gap:`2`,width:`full`,position:`relative`},input:{flex:`1`,minWidth:`0`,height:`var(--datepicker-input-height)`,"--input-height":`var(--datepicker-input-height)`,px:`var(--datepicker-input-px)`,textStyle:`sm`,bg:`transparent`,borderRadius:`l2`,outline:`0`,appearance:`none`,color:`fg`,"--focus-color":`colors.colorPalette.focusRing`,"--error-color":`colors.border.error`,_invalid:{focusRingColor:`var(--error-color)`,borderColor:`var(--error-color)`}},trigger:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:`6`,height:`6`,borderRadius:`l1`,color:`fg.muted`,outline:`none`,_hover:{color:`fg`},focusVisibleRing:`inside`,focusRingWidth:`2px`,_icon:{boxSize:`4`}},content:{display:`flex`,flexDirection:`column`,gap:`3`,p:`3`,minW:`18rem`,bg:`bg.panel`,borderRadius:`l2`,boxShadow:`lg`,color:`fg`,"--date-picker-z-index":`zIndex.popover`,zIndex:`calc(var(--date-picker-z-index) + var(--layer-index, 0))`,outline:`none`,_open:{animationStyle:`scale-fade-in`,animationDuration:`fast`},_closed:{animationStyle:`scale-fade-out`,animationDuration:`faster`}},view:{display:`flex`,flexDirection:`column`,gap:`3`},viewControl:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:`2`,height:`var(--datepicker-nav-trigger-size)`},viewTrigger:{display:`inline-flex`,flex:`1`,alignItems:`center`,justifyContent:`center`,gap:`1`,py:`1.5`,px:`2`,textStyle:`sm`,fontWeight:`semibold`,borderRadius:`l2`,focusVisibleRing:`inside`,focusRingWidth:`2px`,_hover:{bg:`colorPalette.subtle`}},prevTrigger:rC,nextTrigger:rC,rangeText:{textStyle:`sm`,fontWeight:`semibold`},table:{borderCollapse:`separate`,borderSpacing:`0`},tableHeader:{width:`var(--table-cell-size)`,py:`2`,textStyle:`xs`,fontWeight:`medium`,color:`fg.muted`,textAlign:`center`,textTransform:`uppercase`,"&[data-type='week-number']":{color:`fg.subtle`}},tableCell:{py:`0.5`,"&[data-type='week-number']":{color:`fg.subtle`}},tableCellTrigger:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,minWidth:`var(--table-cell-size)`,minHeight:`var(--table-cell-size)`,textStyle:`sm`,borderRadius:`l2`,focusVisibleRing:`inside`,focusRingWidth:`2px`,focusRingOffset:`0px`,cursor:`default`,position:`relative`,_hover:{bg:`colorPalette.subtle`},"[data-view=month] &, [data-view=year] &":{width:`calc(var(--table-cell-size) * 1.75)`},_today:{color:`colorPalette.fg`,fontWeight:`semibold`,textDecoration:`underline`,textUnderlineOffset:`3px`,textDecorationThickness:`2px`},"&[data-selected]":{bg:`colorPalette.solid`,color:`colorPalette.contrast`,_hover:{bg:`colorPalette.solid`}},"&[data-in-range]":{bg:`colorPalette.subtle`,color:`colorPalette.fg`,borderRadius:`0`,_hover:{bg:`colorPalette.subtle`}},"&[data-in-range][data-selected]":{bg:`colorPalette.solid`,color:`colorPalette.contrast`,borderRadius:`0`,_hover:{bg:`colorPalette.solid`},"&[data-range-start][data-range-end]":{borderRadius:`l2`},"&[data-range-start]:not([data-range-end])":{borderStartRadius:`l2`,borderEndRadius:`0`},"&[data-range-end]:not([data-range-start])":{borderEndRadius:`l2`,borderStartRadius:`0`}},_disabled:{opacity:.4}},monthSelect:iC,yearSelect:iC,clearTrigger:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:`6`,height:`6`,flexShrink:0,textStyle:`xs`,borderRadius:`l2`,color:`fg.muted`,_hover:{color:`fg`},focusVisibleRing:`inside`,_icon:{width:`4`,height:`4`}}},variants:{size:{xs:{root:{"--datepicker-input-height":`sizes.8`,"--datepicker-input-px":`sizes.2`,"--datepicker-indicators-offset":`sizes.2`},view:{"--table-cell-size":`sizes.8`,"--datepicker-nav-trigger-size":`sizes.7`,"--datepicker-select-height":`sizes.8`}},sm:{root:{"--datepicker-input-height":`sizes.9`,"--datepicker-input-px":`sizes.2.5`,"--datepicker-indicators-offset":`sizes.2.5`},view:{"--table-cell-size":`sizes.9`,"--datepicker-nav-trigger-size":`sizes.8`,"--datepicker-select-height":`sizes.9`}},md:{root:{"--datepicker-input-height":`sizes.10`,"--datepicker-input-px":`sizes.3`},view:{"--table-cell-size":`sizes.10`,"--datepicker-nav-trigger-size":`sizes.8`,"--datepicker-select-height":`sizes.10`}},lg:{root:{"--datepicker-input-height":`sizes.11`,"--datepicker-input-px":`sizes.4`},view:{"--table-cell-size":`sizes.10`,"--datepicker-nav-trigger-size":`sizes.9`,"--datepicker-select-height":`sizes.10`}},xl:{root:{"--datepicker-input-height":`sizes.12`,"--datepicker-input-px":`sizes.4.5`},view:{"--table-cell-size":`sizes.10`,"--datepicker-nav-trigger-size":`sizes.9`,"--datepicker-select-height":`sizes.10`}}},hideOutsideDays:{true:{tableCellTrigger:{"&[data-outside-range]":{visibility:`hidden`}}}},variant:{outline:{input:{bg:`transparent`,borderWidth:`1px`,borderColor:`border`,focusVisibleRing:`inside`,focusRingColor:`var(--focus-color)`}},subtle:{input:{borderWidth:`1px`,borderColor:`transparent`,bg:`bg.muted`,focusVisibleRing:`inside`,focusRingColor:`var(--focus-color)`}},flushed:{input:{bg:`transparent`,borderBottomWidth:`1px`,borderBottomColor:`border`,borderRadius:`0`,px:`0`,_focusVisible:{borderColor:`var(--focus-color)`,boxShadow:`0px 1px 0px 0px var(--focus-color)`,_invalid:{borderColor:`var(--error-color)`,boxShadow:`0px 1px 0px 0px var(--error-color)`}}},indicatorGroup:{insetEnd:`0`}}}},defaultVariants:{size:`md`,variant:`outline`}}),oC=G({slots:dS.keys(),className:`chakra-dialog`,base:{backdrop:{bg:`blackAlpha.500`,pos:`fixed`,left:0,top:0,w:`100dvw`,h:`100dvh`,"--dialog-z-index":`zIndex.popover`,zIndex:`calc(var(--dialog-z-index) + var(--layer-index, 0) - 1)`,_open:{animationName:`fade-in`,animationDuration:`slow`},_closed:{animationName:`fade-out`,animationDuration:`moderate`}},positioner:{display:`flex`,width:`100dvw`,height:`100dvh`,position:`fixed`,left:0,top:0,"--dialog-z-index":`zIndex.popover`,zIndex:`calc(var(--dialog-z-index) + var(--layer-index, 0))`,justifyContent:`center`,overscrollBehaviorY:`none`},content:{display:`flex`,flexDirection:`column`,position:`relative`,width:`100%`,outline:0,borderRadius:`l3`,textStyle:`sm`,my:`var(--dialog-margin, var(--dialog-base-margin))`,"--dialog-z-index":`zIndex.popover`,zIndex:`calc(var(--dialog-z-index) + var(--layer-index, 0))`,bg:`bg.panel`,boxShadow:`lg`,_open:{animationDuration:`moderate`},_closed:{animationDuration:`faster`}},header:{display:`flex`,gap:`2`,flex:0,px:`6`,pt:`6`,pb:`4`},body:{flex:`1`,px:`6`,pt:`2`,pb:`6`},footer:{display:`flex`,alignItems:`center`,justifyContent:`flex-end`,gap:`3`,px:`6`,pt:`2`,pb:`4`},title:{textStyle:`lg`,fontWeight:`semibold`},description:{color:`fg.muted`},closeTrigger:{pos:`absolute`,top:`2`,insetEnd:`2`}},variants:{placement:{center:{positioner:{alignItems:`center`},content:{"--dialog-base-margin":`auto`,mx:`auto`}},top:{positioner:{alignItems:`flex-start`},content:{"--dialog-base-margin":`spacing.16`,mx:`auto`}},bottom:{positioner:{alignItems:`flex-end`},content:{"--dialog-base-margin":`spacing.16`,mx:`auto`}}},scrollBehavior:{inside:{positioner:{overflow:`hidden`},content:{maxH:`calc(100% - 7.5rem)`},body:{overflow:`auto`}},outside:{positioner:{overflow:`auto`,pointerEvents:`auto`}}},size:{xs:{content:{maxW:`sm`}},sm:{content:{maxW:`md`}},md:{content:{maxW:`lg`}},lg:{content:{maxW:`2xl`}},xl:{content:{maxW:`4xl`}},cover:{positioner:{padding:`10`},content:{width:`100%`,height:`100%`,"--dialog-margin":`0`}},full:{content:{maxW:`100dvw`,minH:`100dvh`,"--dialog-margin":`0`,borderRadius:`0`}}},motionPreset:{scale:{content:{_open:{animationName:`scale-in, fade-in`},_closed:{animationName:`scale-out, fade-out`}}},"slide-in-bottom":{content:{_open:{animationName:`slide-from-bottom, fade-in`},_closed:{animationName:`slide-to-bottom, fade-out`}}},"slide-in-top":{content:{_open:{animationName:`slide-from-top, fade-in`},_closed:{animationName:`slide-to-top, fade-out`}}},"slide-in-left":{content:{_open:{animationName:`slide-from-left, fade-in`},_closed:{animationName:`slide-to-left, fade-out`}}},"slide-in-right":{content:{_open:{animationName:`slide-from-right, fade-in`},_closed:{animationName:`slide-to-right, fade-out`}}},none:{}}},defaultVariants:{size:`md`,scrollBehavior:`outside`,placement:`top`,motionPreset:`scale`}}),sC=G({slots:fS.keys(),className:`chakra-drawer`,base:{backdrop:{bg:`blackAlpha.500`,pos:`fixed`,insetInlineStart:0,top:0,w:`100vw`,h:`100dvh`,"--drawer-z-index":`zIndex.popover`,zIndex:`calc(var(--drawer-z-index) + var(--layer-index, 0) - 1)`,_open:{animationName:`fade-in`,animationDuration:`slow`},_closed:{animationName:`fade-out`,animationDuration:`moderate`}},positioner:{display:`flex`,width:`100vw`,height:`100dvh`,position:`fixed`,insetInlineStart:0,top:0,"--drawer-z-index":`zIndex.popover`,zIndex:`calc(var(--drawer-z-index) + var(--layer-index, 0))`,overscrollBehaviorY:`none`},content:{display:`flex`,flexDirection:`column`,position:`relative`,width:`100%`,outline:0,"--drawer-z-index":`zIndex.popover`,zIndex:`calc(var(--drawer-z-index) + var(--layer-index, 0))`,textStyle:`sm`,maxH:`100dvh`,color:`inherit`,bg:`bg.panel`,boxShadow:`lg`,_open:{animationDuration:`slowest`,animationTimingFunction:`ease-in-smooth`},_closed:{animationDuration:`slower`,animationTimingFunction:`ease-in-smooth`}},header:{display:`flex`,alignItems:`center`,gap:`2`,flex:0,px:`6`,pt:`6`,pb:`4`},body:{px:`6`,py:`2`,flex:`1`,overflow:`auto`},footer:{display:`flex`,alignItems:`center`,justifyContent:`flex-end`,gap:`3`,px:`6`,pt:`2`,pb:`4`},title:{flex:`1`,textStyle:`lg`,fontWeight:`semibold`},description:{color:`fg.muted`},closeTrigger:{pos:`absolute`,top:`3`,insetEnd:`2`}},variants:{size:{xs:{content:{maxW:`xs`}},sm:{content:{maxW:`md`}},md:{content:{maxW:`lg`}},lg:{content:{maxW:`2xl`}},xl:{content:{maxW:`4xl`}},full:{content:{maxW:`100vw`,h:`100dvh`}}},placement:{start:{positioner:{justifyContent:`flex-start`,alignItems:`stretch`},content:{_open:{animationName:{base:`slide-from-left-full, fade-in`,_rtl:`slide-from-right-full, fade-in`}},_closed:{animationName:{base:`slide-to-left-full, fade-out`,_rtl:`slide-to-right-full, fade-out`}}}},end:{positioner:{justifyContent:`flex-end`,alignItems:`stretch`},content:{_open:{animationName:{base:`slide-from-right-full, fade-in`,_rtl:`slide-from-left-full, fade-in`}},_closed:{animationName:{base:`slide-to-right-full, fade-out`,_rtl:`slide-to-left-full, fade-out`}}}},top:{positioner:{justifyContent:`stretch`,alignItems:`flex-start`},content:{maxW:`100%`,_open:{animationName:`slide-from-top-full, fade-in`},_closed:{animationName:`slide-to-top-full, fade-out`}}},bottom:{positioner:{justifyContent:`stretch`,alignItems:`flex-end`},content:{maxW:`100%`,_open:{animationName:`slide-from-bottom-full, fade-in`},_closed:{animationName:`slide-to-bottom-full, fade-out`}}}},contained:{true:{positioner:{padding:`4`},content:{borderRadius:`l3`}}}},defaultVariants:{size:`xs`,placement:`end`}}),cC=Xv({fontSize:`inherit`,fontWeight:`inherit`,textAlign:`inherit`,bg:`transparent`,borderRadius:`l2`}),lC=G({slots:pS.keys(),className:`chakra-editable`,base:{root:{display:`inline-flex`,alignItems:`center`,position:`relative`,gap:`1.5`,width:`full`},preview:{...cC,py:`1`,px:`1`,display:`inline-flex`,alignItems:`center`,transitionProperty:`common`,transitionDuration:`moderate`,cursor:`text`,_hover:{bg:`bg.muted`},_disabled:{userSelect:`none`}},input:{...cC,outline:`0`,py:`1`,px:`1`,transitionProperty:`common`,transitionDuration:`normal`,width:`full`,focusVisibleRing:`inside`,focusRingWidth:`2px`,_placeholder:{opacity:.6}},control:{display:`inline-flex`,alignItems:`center`,gap:`1.5`}},variants:{size:{sm:{root:{textStyle:`sm`},preview:{minH:`8`},input:{minH:`8`}},md:{root:{textStyle:`sm`},preview:{minH:`9`},input:{minH:`9`}},lg:{root:{textStyle:`md`},preview:{minH:`10`},input:{minH:`10`}}}},defaultVariants:{size:`md`}}),uC=G({slots:mS.keys(),className:`chakra-empty-state`,base:{root:{width:`full`},content:{display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`},indicator:{display:`flex`,alignItems:`center`,justifyContent:`center`,color:`fg.subtle`,_icon:{boxSize:`1em`}},title:{fontWeight:`semibold`},description:{textStyle:`sm`,color:`fg.muted`}},variants:{size:{sm:{root:{px:`4`,py:`6`},title:{textStyle:`md`},content:{gap:`4`},indicator:{textStyle:`2xl`}},md:{root:{px:`8`,py:`12`},title:{textStyle:`lg`},content:{gap:`6`},indicator:{textStyle:`4xl`}},lg:{root:{px:`12`,py:`16`},title:{textStyle:`xl`},content:{gap:`8`},indicator:{textStyle:`6xl`}}}},defaultVariants:{size:`md`}}),dC=G({className:`chakra-field`,slots:hS.keys(),base:{requiredIndicator:{color:`fg.error`,lineHeight:`1`},root:{display:`flex`,width:`100%`,position:`relative`,gap:`1.5`},label:{display:`flex`,alignItems:`center`,textAlign:`start`,textStyle:`sm`,fontWeight:`medium`,gap:`1`,userSelect:`none`,_disabled:{opacity:`0.5`}},errorText:{display:`inline-flex`,alignItems:`center`,fontWeight:`medium`,gap:`1`,color:`fg.error`,textStyle:`xs`},helperText:{color:`fg.muted`,textStyle:`xs`}},variants:{orientation:{vertical:{root:{flexDirection:`column`,alignItems:`flex-start`}},horizontal:{root:{flexDirection:`row`,alignItems:`center`,justifyContent:`space-between`},label:{flex:`0 0 var(--field-label-width, 80px)`}}}},defaultVariants:{orientation:`vertical`}}),fC=G({className:`fieldset`,slots:gS.keys(),base:{root:{display:`flex`,flexDirection:`column`,width:`full`},content:{display:`flex`,flexDirection:`column`,width:`full`},legend:{color:`fg`,fontWeight:`medium`,_disabled:{opacity:`0.5`}},helperText:{color:`fg.muted`,textStyle:`sm`},errorText:{display:`inline-flex`,alignItems:`center`,color:`fg.error`,gap:`2`,fontWeight:`medium`,textStyle:`sm`}},variants:{size:{sm:{root:{spaceY:`2`},content:{gap:`1.5`},legend:{textStyle:`sm`}},md:{root:{spaceY:`4`},content:{gap:`4`},legend:{textStyle:`sm`}},lg:{root:{spaceY:`6`},content:{gap:`4`},legend:{textStyle:`md`}}}},defaultVariants:{size:`md`}}),pC=G({className:`chakra-file-upload`,slots:_S.keys(),base:{root:{display:`flex`,flexDirection:`column`,gap:`4`,width:`100%`,alignItems:`flex-start`},label:{fontWeight:`medium`,textStyle:`sm`},dropzone:{background:`bg`,borderRadius:`l3`,borderWidth:`2px`,borderStyle:`dashed`,display:`flex`,alignItems:`center`,flexDirection:`column`,gap:`4`,justifyContent:`center`,minHeight:`2xs`,px:`3`,py:`2`,transition:`backgrounds`,focusVisibleRing:`outside`,_hover:{bg:`bg.subtle`},_dragging:{bg:`colorPalette.subtle`,borderStyle:`solid`,borderColor:`colorPalette.solid`}},dropzoneContent:{display:`flex`,flexDirection:`column`,alignItems:`center`,textAlign:`center`,gap:`1`,textStyle:`sm`},item:{pos:`relative`,textStyle:`sm`,animationName:`fade-in`,animationDuration:`moderate`,background:`bg`,borderRadius:`l2`,borderWidth:`1px`,width:`100%`,display:`flex`,alignItems:`center`,gap:`3`,p:`4`},itemGroup:{width:`100%`,display:`flex`,flexDirection:`column`,gap:`3`,_empty:{display:`none`}},itemName:{color:`fg`,fontWeight:`medium`,lineClamp:`1`},itemContent:{display:`flex`,flexDirection:`column`,gap:`0.5`,flex:`1`},itemSizeText:{color:`fg.muted`,textStyle:`xs`},itemDeleteTrigger:{display:`flex`,alignItems:`center`,justifyContent:`center`,alignSelf:`flex-start`,boxSize:`5`,p:`2px`,color:`fg.muted`,cursor:`button`},itemPreview:{color:`fg.muted`,_icon:{boxSize:`4.5`}}},defaultVariants:{}}),mC=G({slots:lm.keys(),className:`chakra-floating-panel`,base:{positioner:{"--floating-panel-z-index":`zIndex.popover`,zIndex:`calc(var(--floating-panel-z-index) + var(--layer-index, 0))`,"&:has([data-topmost])":{"--layer-index":`100`},"&:has([data-behind])":{"--layer-index":`-100`}},content:{display:`flex`,flexDirection:`column`,bg:`bg.panel`,borderRadius:`l2`,boxShadow:`lg`,overflow:`hidden`,outline:0,position:`relative`,_open:{animationName:`scale-in, fade-in`,animationDuration:`moderate`}},dragTrigger:{flex:`1`,display:`flex`,alignItems:`center`,gap:`2`,minW:`0`},header:{display:`flex`,alignItems:`center`,gap:`2`,px:`3`,py:`2`,borderBottomWidth:`1px`,bg:`bg.subtle`,flex:`none`},title:{fontWeight:`semibold`,textStyle:`sm`,flex:`1`,truncate:!0},body:{flex:`1`,overflow:`auto`,p:`3`,textStyle:`sm`},resizeTrigger:{zIndex:`1`,"--size":`sizes.2.5`,'&[data-axis="n"], &[data-axis="s"]':{h:`var(--size)`},'&[data-axis="e"], &[data-axis="w"]':{w:`var(--size)`},'&[data-axis]:is([data-axis="ne"], [data-axis="nw"], [data-axis="se"], [data-axis="sw"])':{w:`var(--size)`,h:`var(--size)`}}}}),hC=G({className:`chakra-hover-card`,slots:um.keys(),base:{content:{position:`relative`,display:`flex`,flexDirection:`column`,textStyle:`sm`,"--hovercard-bg":`colors.bg.panel`,bg:`var(--hovercard-bg)`,boxShadow:`lg`,maxWidth:`80`,borderRadius:`l3`,"--hover-card-z-index":`zIndex.popover`,zIndex:`calc(var(--hover-card-z-index) + var(--layer-index, 0))`,transformOrigin:`var(--transform-origin)`,outline:`0`,_open:{animationStyle:`slide-fade-in`,animationDuration:`fast`},_closed:{animationStyle:`slide-fade-out`,animationDuration:`faster`}},arrow:{"--arrow-size":`sizes.3`,"--arrow-background":`var(--hovercard-bg)`},arrowTip:{borderTopWidth:`0.5px`,borderLeftWidth:`0.5px`}},variants:{size:{xs:{content:{padding:`3`}},sm:{content:{padding:`4`}},md:{content:{padding:`5`}},lg:{content:{padding:`6`}}}},defaultVariants:{size:`md`}}),gC=G({className:`chakra-list`,slots:vS.keys(),base:{root:{display:`flex`,flexDirection:`column`,gap:`var(--list-gap)`,"& :where(ul, ol)":{marginTop:`var(--list-gap)`}},item:{whiteSpace:`normal`,display:`list-item`},indicator:{marginEnd:`2`,minHeight:`1lh`,flexShrink:0,display:`inline-block`,verticalAlign:`middle`}},variants:{variant:{marker:{root:{listStyle:`revert`},item:{_marker:{color:`fg.subtle`}}},plain:{item:{alignItems:`flex-start`,display:`inline-flex`}}},align:{center:{item:{alignItems:`center`}},start:{item:{alignItems:`flex-start`}},end:{item:{alignItems:`flex-end`}}}},defaultVariants:{variant:`marker`}}),_C=G({className:`chakra-listbox`,slots:BS.keys(),base:{root:{display:`flex`,flexDirection:`column`,gap:`1.5`,width:`full`},content:{display:`flex`,maxH:`96`,p:`1`,gap:`1`,textStyle:`sm`,outline:`none`,scrollPadding:`1`,_horizontal:{flexDirection:`row`,overflowX:`auto`},_vertical:{flexDirection:`column`,overflowY:`auto`},"--listbox-item-padding-x":`spacing.2`,"--listbox-item-padding-y":`spacing.1.5`},item:{position:`relative`,userSelect:`none`,display:`flex`,alignItems:`center`,gap:`2`,cursor:`pointer`,justifyContent:`space-between`,flex:`1`,textAlign:`start`,borderRadius:`l1`,py:`var(--listbox-item-padding-y)`,px:`var(--listbox-item-padding-x)`,_highlighted:{outline:`2px solid`,outlineColor:`border.emphasized`},_disabled:{pointerEvents:`none`,opacity:`0.5`}},empty:{py:`var(--listbox-item-padding-y)`,px:`var(--listbox-item-padding-x)`},itemText:{flex:`1`},itemGroup:{mt:`1.5`,_first:{mt:`0`}},itemGroupLabel:{py:`1.5`,px:`2`,fontWeight:`medium`},label:{fontWeight:`medium`,userSelect:`none`,textStyle:`sm`,_disabled:{layerStyle:`disabled`}},valueText:{lineClamp:`1`,maxW:`80%`},itemIndicator:{display:`flex`,alignItems:`center`,justifyContent:`center`,_icon:{boxSize:`4`}}},variants:{variant:{subtle:{content:{bg:`bg.panel`,borderWidth:`1px`,borderRadius:`l2`},item:{_hover:{bg:`bg.emphasized/60`},_selected:{bg:`bg.muted`}}},solid:{content:{bg:`bg.panel`,borderWidth:`1px`,borderRadius:`l2`},item:{_selected:{bg:`colorPalette.solid`,color:`colorPalette.contrast`}}},plain:{}}},defaultVariants:{variant:`subtle`}}),vC=G({className:`chakra-marquee`,slots:pm.keys(),base:{root:{position:`relative`,width:`100%`,"--marquee-edge-color":`colors.bg`,"--marquee-edge-size":`20%`,"&[data-paused]":{animationPlayState:`paused !important`,"& *":{animationPlayState:`paused !important`}}},viewport:{overflow:`hidden`,display:`flex`,width:`100%`,height:`100%`},content:{display:`flex`,minWidth:`max-content`,animationTimingFunction:`linear`,animationFillMode:`forwards`,animationDuration:`var(--marquee-duration)`,animationDelay:`var(--marquee-delay)`,animationIterationCount:`var(--marquee-loop-count)`,_motionReduce:{animation:`none !important`},"&[data-side='start'], &[data-side='end']":{animationName:`marqueeX`},"&[data-side='top'], &[data-side='bottom']":{animationName:`marqueeY`},"&[data-reverse]":{animationDirection:`reverse`},"&[data-orientation='horizontal']":{flexDirection:`row`},"&[data-orientation='vertical']":{flexDirection:`column`}},edge:{position:`absolute`,zIndex:`1`,pointerEvents:`none`,"&[data-side='start']":{width:`var(--marquee-edge-size)`,insetY:`0`,insetInlineStart:`0`,background:`linear-gradient(to right, var(--marquee-edge-color, white), transparent)`,_rtl:{background:`linear-gradient(to left, var(--marquee-edge-color, white), transparent)`}},"&[data-side='end']":{width:`var(--marquee-edge-size)`,insetY:`0`,insetInlineEnd:`0`,background:`linear-gradient(to left, var(--marquee-edge-color, white), transparent)`,_rtl:{background:`linear-gradient(to right, var(--marquee-edge-color, white), transparent)`}},"&[data-side='top']":{height:`var(--marquee-edge-size)`,insetX:`0`,top:`0`,background:`linear-gradient(to bottom, var(--marquee-edge-color, white), transparent)`},"&[data-side='bottom']":{height:`var(--marquee-edge-size)`,insetX:`0`,bottom:`0`,background:`linear-gradient(to top, var(--marquee-edge-color, white), transparent)`}}}}),yC=G({className:`chakra-menu`,slots:yS.keys(),base:{content:{outline:0,"--menu-bg":`colors.bg.panel`,bg:`var(--menu-bg)`,boxShadow:`lg`,color:`fg`,maxHeight:`var(--available-height)`,"--menu-z-index":`zIndex.popover`,zIndex:`calc(var(--menu-z-index) + var(--layer-index, 0))`,borderRadius:`l2`,overflow:`hidden`,overflowY:`auto`,_open:{animationStyle:`slide-fade-in`,animationDuration:`fast`},_closed:{animationStyle:`slide-fade-out`,animationDuration:`faster`}},item:{textDecoration:`none`,color:`fg`,userSelect:`none`,borderRadius:`l1`,width:`100%`,display:`flex`,cursor:`menuitem`,alignItems:`center`,textAlign:`start`,position:`relative`,flex:`0 0 auto`,outline:0,_disabled:{layerStyle:`disabled`},"&[data-type]":{ps:`8`}},itemText:{flex:`1`},itemIndicator:{position:`absolute`,insetStart:`2`,transform:`translateY(-50%)`,top:`50%`},itemGroupLabel:{px:`2`,py:`1.5`,fontWeight:`semibold`,textStyle:`sm`},indicator:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,flexShrink:`0`},itemCommand:{opacity:`0.6`,textStyle:`xs`,ms:`auto`,ps:`4`,letterSpacing:`widest`,fontFamily:`inherit`},separator:{height:`1px`,bg:`bg.muted`,my:`1`,mx:`-1`},arrow:{"--arrow-size":`sizes.3`,"--arrow-background":`var(--menu-bg)`},arrowTip:{borderTopWidth:`1px`,borderLeftWidth:`1px`}},variants:{variant:{subtle:{item:{_highlighted:{bg:`bg.emphasized/60`}}},solid:{item:{_highlighted:{bg:`colorPalette.solid`,color:`colorPalette.contrast`}}}},size:{sm:{content:{minW:`8rem`,padding:`1`,scrollPadding:`1`},item:{gap:`1`,textStyle:`xs`,py:`1`,px:`1.5`}},md:{content:{minW:`8rem`,padding:`1.5`,scrollPadding:`1.5`},item:{gap:`2`,textStyle:`sm`,py:`1.5`,px:`2`}}}},defaultVariants:{size:`md`,variant:`subtle`}}),bC=G({className:`chakra-select`,slots:TS.keys(),base:{root:{display:`flex`,flexDirection:`column`,gap:`1.5`,width:`full`},trigger:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,width:`full`,minH:`var(--select-trigger-height)`,"--input-height":`var(--select-trigger-height)`,px:`var(--select-trigger-padding-x)`,borderRadius:`l2`,userSelect:`none`,textAlign:`start`,focusVisibleRing:`inside`,_placeholderShown:{color:`fg.muted/80`},_disabled:{layerStyle:`disabled`},_invalid:{borderColor:`border.error`}},indicatorGroup:{display:`flex`,alignItems:`center`,gap:`1`,pos:`absolute`,insetEnd:`0`,top:`0`,bottom:`0`,px:`var(--select-trigger-padding-x)`,pointerEvents:`none`},indicator:{display:`flex`,alignItems:`center`,justifyContent:`center`,color:{base:`fg.muted`,_disabled:`fg.subtle`,_invalid:`fg.error`}},content:{background:`bg.panel`,display:`flex`,flexDirection:`column`,"--select-z-index":`zIndex.popover`,zIndex:`calc(var(--select-z-index) + var(--layer-index, 0))`,borderRadius:`l2`,outline:0,maxH:`96`,overflowY:`auto`,boxShadow:`md`,_open:{animationStyle:`slide-fade-in`,animationDuration:`fast`},_closed:{animationStyle:`slide-fade-out`,animationDuration:`fastest`}},item:{position:`relative`,userSelect:`none`,display:`flex`,alignItems:`center`,gap:`2`,cursor:`option`,justifyContent:`space-between`,flex:`1`,textAlign:`start`,borderRadius:`l1`,_highlighted:{bg:`bg.emphasized/60`},_disabled:{pointerEvents:`none`,opacity:`0.5`},_icon:{width:`4`,height:`4`}},control:{pos:`relative`},itemText:{flex:`1`},itemGroup:{_first:{mt:`0`}},itemGroupLabel:{py:`1`,fontWeight:`medium`},label:{fontWeight:`medium`,userSelect:`none`,textStyle:`sm`,_disabled:{layerStyle:`disabled`}},valueText:{lineClamp:`1`,maxW:`80%`},clearTrigger:{color:`fg.muted`,pointerEvents:`auto`,focusVisibleRing:`inside`,focusRingWidth:`2px`,rounded:`l1`}},variants:{variant:{outline:{trigger:{bg:`transparent`,borderWidth:`1px`,borderColor:`border`,_expanded:{borderColor:`border.emphasized`}}},subtle:{trigger:{borderWidth:`1px`,borderColor:`transparent`,bg:`bg.muted`}},ghost:{trigger:{bg:`transparent`,_expanded:{bg:`bg.muted`}}}},size:{xs:{root:{"--select-trigger-height":`sizes.8`,"--select-trigger-padding-x":`spacing.2`},content:{p:`1`,gap:`1`,textStyle:`xs`},trigger:{textStyle:`xs`,gap:`1`},item:{py:`1`,px:`2`},itemGroupLabel:{py:`1`,px:`2`},indicator:{_icon:{width:`3.5`,height:`3.5`}}},sm:{root:{"--select-trigger-height":`sizes.9`,"--select-trigger-padding-x":`spacing.2.5`},content:{p:`1`,textStyle:`sm`},trigger:{textStyle:`sm`,gap:`1`},indicator:{_icon:{width:`4`,height:`4`}},item:{py:`1`,px:`1.5`},itemGroup:{mt:`1`},itemGroupLabel:{py:`1`,px:`1.5`}},md:{root:{"--select-trigger-height":`sizes.10`,"--select-trigger-padding-x":`spacing.3`},content:{p:`1`,textStyle:`sm`},itemGroup:{mt:`1.5`},item:{py:`1.5`,px:`2`},itemIndicator:{display:`flex`,alignItems:`center`,justifyContent:`center`},itemGroupLabel:{py:`1.5`,px:`2`},trigger:{textStyle:`sm`,gap:`2`},indicator:{_icon:{width:`4`,height:`4`}}},lg:{root:{"--select-trigger-height":`sizes.12`,"--select-trigger-padding-x":`spacing.4`},content:{p:`1.5`,textStyle:`md`},itemGroup:{mt:`2`},item:{py:`2`,px:`3`},itemGroupLabel:{py:`2`,px:`3`},trigger:{textStyle:`md`,py:`3`,gap:`2`},indicator:{_icon:{width:`5`,height:`5`}}}}},defaultVariants:{size:`md`,variant:`outline`}}),xC=G({className:`chakra-native-select`,slots:bS.keys(),base:{root:{height:`fit-content`,display:`flex`,width:`100%`,position:`relative`},field:{width:`100%`,minWidth:`0`,outline:`0`,appearance:`none`,borderRadius:`l2`,"--error-color":`colors.border.error`,"--input-height":`var(--select-field-height)`,height:`var(--select-field-height)`,_disabled:{layerStyle:`disabled`},_invalid:{focusRingColor:`var(--error-color)`,borderColor:`var(--error-color)`},focusVisibleRing:`inside`,lineHeight:`normal`,"& > option, & > optgroup":{bg:`bg`}},indicator:{position:`absolute`,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,pointerEvents:`none`,top:`50%`,transform:`translateY(-50%)`,height:`100%`,color:`fg.muted`,_disabled:{opacity:`0.5`},_invalid:{color:`fg.error`},_icon:{width:`1em`,height:`1em`}}},variants:{variant:{outline:{field:bC.variants?.variant.outline.trigger},subtle:{field:bC.variants?.variant.subtle.trigger},plain:{field:{bg:`transparent`,color:`fg`,focusRingWidth:`2px`}},ghost:{field:bC.variants?.variant.ghost.trigger}},size:{xs:{root:{"--select-field-height":`sizes.8`},field:{textStyle:`xs`,ps:`2`,pe:`6`},indicator:{textStyle:`sm`,insetEnd:`1.5`}},sm:{root:{"--select-field-height":`sizes.9`},field:{textStyle:`sm`,ps:`2.5`,pe:`8`},indicator:{textStyle:`md`,insetEnd:`2`}},md:{root:{"--select-field-height":`sizes.10`},field:{textStyle:`sm`,ps:`3`,pe:`8`},indicator:{textStyle:`lg`,insetEnd:`2`}},lg:{root:{"--select-field-height":`sizes.11`},field:{textStyle:`md`,ps:`4`,pe:`8`},indicator:{textStyle:`xl`,insetEnd:`3`}},xl:{root:{"--select-field-height":`sizes.12`},field:{textStyle:`md`,ps:`4.5`,pe:`10`},indicator:{textStyle:`xl`,insetEnd:`3`}}}},defaultVariants:bC.defaultVariants}),SC=Xv({display:`flex`,justifyContent:`center`,alignItems:`center`,flex:`1`,userSelect:`none`,cursor:`button`,lineHeight:`1`,color:`fg.muted`,"--stepper-base-radius":`radii.l1`,"--stepper-radius":`calc(var(--stepper-base-radius) + 1px)`,_icon:{boxSize:`1em`},_disabled:{opacity:`0.5`},_hover:{bg:`bg.muted`},_active:{bg:`bg.emphasized`}}),CC=G({className:`chakra-number-input`,slots:hm.keys(),base:{root:{position:`relative`,zIndex:`0`,isolation:`isolate`},input:{...Kx.base,verticalAlign:`top`,pe:`calc(var(--stepper-width) + 0.5rem)`},control:{display:`flex`,flexDirection:`column`,position:`absolute`,top:`0`,insetEnd:`0px`,margin:`1px`,width:`var(--stepper-width)`,height:`calc(100% - 2px)`,zIndex:`1`,borderStartWidth:`1px`,divideY:`1px`},incrementTrigger:{...SC,borderTopEndRadius:`var(--stepper-radius)`},decrementTrigger:{...SC,borderBottomEndRadius:`var(--stepper-radius)`},valueText:{fontWeight:`medium`,fontFeatureSettings:`pnum`,fontVariantNumeric:`proportional-nums`}},variants:{size:{xs:{input:Kx.variants.size.xs,control:{fontSize:`2xs`,"--stepper-width":`sizes.4`}},sm:{input:Kx.variants.size.sm,control:{fontSize:`xs`,"--stepper-width":`sizes.5`}},md:{input:Kx.variants.size.md,control:{fontSize:`sm`,"--stepper-width":`sizes.6`}},lg:{input:Kx.variants.size.lg,control:{fontSize:`sm`,"--stepper-width":`sizes.6`}}},variant:Dy(Kx.variants.variant,(e,t)=>[e,{input:t}])},defaultVariants:{size:`md`,variant:`outline`}}),{variants:wC,defaultVariants:TC}=Kx,EC=G({className:`chakra-pin-input`,slots:gm.keys(),base:{input:{...Kx.base,textAlign:`center`,width:`var(--input-height)`},control:{display:`inline-flex`,gap:`2`,isolation:`isolate`}},variants:{size:Dy(wC.size,(e,t)=>[e,{input:{...t,px:`1`}}]),variant:Dy(wC.variant,(e,t)=>[e,{input:t}]),attached:{true:{control:{gap:`0`,spaceX:`-1px`},input:{_notFirst:{borderStartRadius:`0`},_notLast:{borderEndRadius:`0`},_focusVisible:{zIndex:`1`}}}}},defaultVariants:TC}),DC=G({className:`chakra-popover`,slots:xS.keys(),base:{content:{position:`relative`,display:`flex`,flexDirection:`column`,textStyle:`sm`,"--popover-bg":`colors.bg.panel`,bg:`var(--popover-bg)`,boxShadow:`lg`,"--popover-size":`sizes.xs`,"--popover-mobile-size":`calc(100dvw - 1rem)`,width:{base:`min(var(--popover-mobile-size), var(--popover-size))`,sm:`var(--popover-size)`},borderRadius:`l3`,"--popover-z-index":`zIndex.popover`,zIndex:`calc(var(--popover-z-index) + var(--layer-index, 0))`,outline:`0`,transformOrigin:`var(--transform-origin)`,maxHeight:`var(--available-height)`,_open:{animationStyle:`scale-fade-in`,animationDuration:`fast`},_closed:{animationStyle:`scale-fade-out`,animationDuration:`faster`}},header:{paddingInline:`var(--popover-padding)`,paddingTop:`var(--popover-padding)`},body:{padding:`var(--popover-padding)`,flex:`1`},footer:{display:`flex`,alignItems:`center`,paddingInline:`var(--popover-padding)`,paddingBottom:`var(--popover-padding)`},arrow:{"--arrow-size":`sizes.3`,"--arrow-background":`var(--popover-bg)`},arrowTip:{borderTopWidth:`1px`,borderLeftWidth:`1px`}},variants:{size:{xs:{content:{"--popover-padding":`spacing.3`}},sm:{content:{"--popover-padding":`spacing.4`}},md:{content:{"--popover-padding":`spacing.5`}},lg:{content:{"--popover-padding":`spacing.6`}}}},defaultVariants:{size:`md`}}),OC=G({slots:vm.keys(),className:`chakra-progress`,base:{root:{textStyle:`sm`,position:`relative`},track:{overflow:`hidden`,position:`relative`},range:{display:`flex`,alignItems:`center`,justifyContent:`center`,transitionProperty:`width, height`,transitionDuration:`slow`,height:`100%`,bgColor:`var(--track-color)`,_indeterminate:{"--animate-from-x":`-40%`,"--animate-to-x":`100%`,position:`absolute`,willChange:`left`,minWidth:`50%`,animation:`position 1s ease infinite normal none running`,backgroundImage:`linear-gradient(to right, transparent 0%, var(--track-color) 50%, transparent 100%)`}},label:{display:`inline-flex`,fontWeight:`medium`,alignItems:`center`,gap:`1`},valueText:{textStyle:`xs`,lineHeight:`1`,fontWeight:`medium`}},variants:{variant:{outline:{track:{shadow:`inset`,bgColor:`bg.muted`},range:{bgColor:`colorPalette.solid`}},subtle:{track:{bgColor:`colorPalette.muted`},range:{bgColor:`colorPalette.solid/72`}}},shape:{square:{},rounded:{track:{borderRadius:`l1`}},full:{track:{borderRadius:`full`}}},striped:{true:{range:{backgroundImage:`linear-gradient(45deg, var(--stripe-color) 25%, transparent 25%, transparent 50%, var(--stripe-color) 50%, var(--stripe-color) 75%, transparent 75%, transparent)`,backgroundSize:`var(--stripe-size) var(--stripe-size)`,"--stripe-size":`1rem`,"--stripe-color":{_light:`rgba(255, 255, 255, 0.3)`,_dark:`rgba(0, 0, 0, 0.3)`}}}},animated:{true:{range:{"--animate-from":`var(--stripe-size)`,animation:`bg-position 1s linear infinite`}}},size:{xs:{track:{h:`1.5`}},sm:{track:{h:`2`}},md:{track:{h:`2.5`}},lg:{track:{h:`3`}},xl:{track:{h:`4`}}}},defaultVariants:{variant:`outline`,size:`md`,shape:`rounded`}}),kC=G({className:`chakra-progress-circle`,slots:vm.keys(),base:{root:{display:`inline-flex`,textStyle:`sm`,position:`relative`},circle:{_indeterminate:{animation:`spin 2s linear infinite`}},circleTrack:{"--track-color":`colors.colorPalette.muted`,stroke:`var(--track-color)`},circleRange:{stroke:`colorPalette.solid`,transitionProperty:`stroke-dashoffset, stroke-dasharray`,transitionDuration:`0.6s`,_indeterminate:{animation:`circular-progress 1.5s linear infinite`}},label:{display:`inline-flex`},valueText:{lineHeight:`1`,fontWeight:`medium`,letterSpacing:`tight`,fontVariantNumeric:`tabular-nums`}},variants:{size:{xs:{circle:{"--size":`24px`,"--thickness":`4px`},valueText:{textStyle:`2xs`}},sm:{circle:{"--size":`32px`,"--thickness":`5px`},valueText:{textStyle:`2xs`}},md:{circle:{"--size":`40px`,"--thickness":`6px`},valueText:{textStyle:`xs`}},lg:{circle:{"--size":`48px`,"--thickness":`7px`},valueText:{textStyle:`sm`}},xl:{circle:{"--size":`64px`,"--thickness":`8px`},valueText:{textStyle:`sm`}}}},defaultVariants:{size:`md`}}),AC=G({slots:ym.keys(),className:`chakra-qr-code`,base:{root:{position:`relative`,width:`fit-content`,"--qr-code-overlay-size":`calc(var(--qr-code-size) / 3)`},frame:{width:`var(--qr-code-size)`,height:`var(--qr-code-size)`,fill:`currentColor`},overlay:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:`var(--qr-code-overlay-size)`,height:`var(--qr-code-overlay-size)`,padding:`1`,bg:`bg`,rounded:`l1`}},variants:{size:{"2xs":{root:{"--qr-code-size":`40px`}},xs:{root:{"--qr-code-size":`64px`}},sm:{root:{"--qr-code-size":`80px`}},md:{root:{"--qr-code-size":`120px`}},lg:{root:{"--qr-code-size":`160px`}},xl:{root:{"--qr-code-size":`200px`}},"2xl":{root:{"--qr-code-size":`240px`}},full:{root:{"--qr-code-size":`100%`}}}},defaultVariants:{size:`md`}}),jC=G({className:`chakra-radio-card`,slots:CS.keys(),base:{root:{display:`flex`,flexDirection:`column`,gap:`1.5`,isolation:`isolate`},item:{flex:`1`,display:`flex`,flexDirection:`column`,userSelect:`none`,position:`relative`,borderRadius:`l2`,_focus:{bg:`colorPalette.muted/20`},_disabled:{opacity:`0.5`},_checked:{zIndex:`1`}},label:{display:`inline-flex`,fontWeight:`medium`,textStyle:`sm`,_disabled:{opacity:`0.5`}},itemText:{fontWeight:`medium`,flex:`1`},itemDescription:{opacity:`0.64`,textStyle:`sm`},itemControl:{display:`inline-flex`,flex:`1`,pos:`relative`,rounded:`inherit`,justifyContent:`var(--radio-card-justify)`,alignItems:`var(--radio-card-align)`,_disabled:{bg:`bg.muted`}},itemIndicator:Zx.base,itemAddon:{roundedBottom:`inherit`,_disabled:{color:`fg.muted`}},itemContent:{display:`flex`,flexDirection:`column`,flex:`1`,gap:`1`,justifyContent:`var(--radio-card-justify)`,alignItems:`var(--radio-card-align)`}},variants:{size:{sm:{item:{textStyle:`sm`},itemControl:{padding:`3`,gap:`1.5`},itemAddon:{px:`3`,py:`1.5`,borderTopWidth:`1px`},itemIndicator:Zx.variants?.size.sm},md:{item:{textStyle:`sm`},itemControl:{padding:`4`,gap:`2.5`},itemAddon:{px:`4`,py:`2`,borderTopWidth:`1px`},itemIndicator:Zx.variants?.size.md},lg:{item:{textStyle:`md`},itemControl:{padding:`4`,gap:`3.5`},itemAddon:{px:`4`,py:`2`,borderTopWidth:`1px`},itemIndicator:Zx.variants?.size.lg}},variant:{surface:{item:{borderWidth:`1px`,_checked:{bg:`colorPalette.subtle`,color:`colorPalette.fg`,borderColor:`colorPalette.muted`}},itemIndicator:Zx.variants?.variant.solid},subtle:{item:{bg:`bg.muted`},itemControl:{_checked:{bg:`colorPalette.muted`,color:`colorPalette.fg`}},itemIndicator:Zx.variants?.variant.outline},outline:{item:{borderWidth:`1px`,_checked:{boxShadow:`inset 0 0 0 1px var(--shadow-color)`,boxShadowColor:`colorPalette.solid`,borderColor:`colorPalette.solid`}},itemControl:{_disabled:{bg:`unset`}},itemIndicator:Zx.variants?.variant.solid},solid:{item:{borderWidth:`1px`,_checked:{bg:`colorPalette.solid`,color:`colorPalette.contrast`,borderColor:`colorPalette.solid`}},itemControl:{_disabled:{bg:`unset`}},itemIndicator:Zx.variants?.variant.inverted}},justify:{start:{item:{"--radio-card-justify":`flex-start`}},end:{item:{"--radio-card-justify":`flex-end`}},center:{item:{"--radio-card-justify":`center`}}},align:{start:{item:{"--radio-card-align":`flex-start`},itemControl:{textAlign:`start`}},end:{item:{"--radio-card-align":`flex-end`},itemControl:{textAlign:`end`}},center:{item:{"--radio-card-align":`center`},itemControl:{textAlign:`center`}}},orientation:{vertical:{itemControl:{flexDirection:`column`}},horizontal:{itemControl:{flexDirection:`row`}}}},defaultVariants:{size:`md`,variant:`outline`,align:`start`,orientation:`horizontal`}}),MC=G({className:`chakra-radio-group`,slots:SS.keys(),base:{item:{display:`inline-flex`,alignItems:`center`,position:`relative`,fontWeight:`medium`,_disabled:{cursor:`disabled`}},itemControl:Zx.base,label:{userSelect:`none`,textStyle:`sm`,_disabled:{opacity:`0.5`}}},variants:{variant:{outline:{itemControl:Zx.variants?.variant?.outline},subtle:{itemControl:Zx.variants?.variant?.subtle},solid:{itemControl:Zx.variants?.variant?.solid}},size:{xs:{item:{textStyle:`xs`,gap:`1.5`},itemControl:Zx.variants?.size?.xs},sm:{item:{textStyle:`sm`,gap:`2`},itemControl:Zx.variants?.size?.sm},md:{item:{textStyle:`sm`,gap:`2.5`},itemControl:Zx.variants?.size?.md},lg:{item:{textStyle:`md`,gap:`3`},itemControl:Zx.variants?.size?.lg}}},defaultVariants:{size:`md`,variant:`solid`}}),NC=G({className:`chakra-rating-group`,slots:wS.keys(),base:{root:{display:`inline-flex`},control:{display:`inline-flex`,alignItems:`center`},item:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,userSelect:`none`},itemIndicator:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:`1em`,height:`1em`,position:`relative`,"--clip-path":{base:`inset(0 50% 0 0)`,_rtl:`inset(0 0 0 50%)`},_icon:{stroke:`currentColor`,width:`100%`,height:`100%`,display:`inline-block`,flexShrink:0,position:`absolute`,left:0,top:0},"& [data-bg]":{color:`bg.emphasized`},"& [data-fg]":{color:`transparent`},"&[data-highlighted]:not([data-half])":{"& [data-fg]":{color:`colorPalette.solid`}},"&[data-half]":{"& [data-fg]":{color:`colorPalette.solid`,clipPath:`var(--clip-path)`}}}},variants:{size:{xs:{item:{textStyle:`sm`}},sm:{item:{textStyle:`md`}},md:{item:{textStyle:`xl`}},lg:{item:{textStyle:`2xl`}}}},defaultVariants:{size:`md`}}),PC=G({className:`chakra-scroll-area`,slots:Sm.keys(),base:{root:{display:`flex`,flexDirection:`column`,width:`100%`,height:`100%`,position:`relative`,overflow:`hidden`,"--scrollbar-margin":`2px`,"--scrollbar-click-area":`calc(var(--scrollbar-size) + calc(var(--scrollbar-margin) * 2))`},viewport:{display:`flex`,flexDirection:`column`,height:`100%`,width:`100%`,borderRadius:`inherit`,WebkitOverflowScrolling:`touch`,scrollbarWidth:`none`,"&::-webkit-scrollbar":{display:`none`}},content:{minWidth:`100%`},scrollbar:{display:`flex`,userSelect:`none`,touchAction:`none`,borderRadius:`full`,colorPalette:`gray`,transition:`opacity 150ms 300ms`,position:`relative`,margin:`var(--scrollbar-margin)`,"&:not([data-overflow-x], [data-overflow-y])":{display:`none`},bg:`{colors.colorPalette.solid/10}`,"--thumb-bg":`{colors.colorPalette.solid/25}`,"&:is(:hover, :active)":{"--thumb-bg":`{colors.colorPalette.solid/50}`},_before:{content:`""`,position:`absolute`},_vertical:{width:`var(--scrollbar-size)`,flexDirection:`column`,"&::before":{width:`var(--scrollbar-click-area)`,height:`100%`,insetInlineStart:`calc(var(--scrollbar-margin) * -1)`}},_horizontal:{height:`var(--scrollbar-size)`,flexDirection:`row`,"&::before":{height:`var(--scrollbar-click-area)`,width:`100%`,top:`calc(var(--scrollbar-margin) * -1)`}}},thumb:{borderRadius:`inherit`,bg:`var(--thumb-bg)`,transition:`backgrounds`,_vertical:{width:`full`},_horizontal:{height:`full`}},corner:{bg:`bg.muted`,margin:`var(--scrollbar-margin)`,opacity:0,transition:`opacity 150ms 300ms`,"&[data-hover]":{transitionDelay:`0ms`,opacity:1}}},variants:{variant:{hover:{scrollbar:{opacity:`0`,"&[data-hover], &[data-scrolling]":{opacity:`1`,transitionDuration:`faster`,transitionDelay:`0ms`}}},always:{scrollbar:{opacity:`1`}}},size:{xs:{root:{"--scrollbar-size":`sizes.1`}},sm:{root:{"--scrollbar-size":`sizes.1.5`}},md:{root:{"--scrollbar-size":`sizes.2`}},lg:{root:{"--scrollbar-size":`sizes.3`}}}},defaultVariants:{size:`md`,variant:`hover`}}),FC=G({className:`chakra-segment-group`,slots:Cm.keys(),base:{root:{"--segment-radius":`radii.l2`,"--segment-indicator-bg":{_light:`colors.bg`,_dark:`colors.bg.emphasized`},"--segment-indicator-shadow":`shadows.sm`,borderRadius:`var(--segment-radius)`,display:`inline-flex`,boxShadow:`inset`,minW:`max-content`,textAlign:`center`,position:`relative`,isolation:`isolate`,bg:`bg.muted`,_vertical:{flexDirection:`column`}},item:{display:`flex`,alignItems:`center`,justifyContent:`center`,userSelect:`none`,fontSize:`sm`,position:`relative`,color:`fg`,borderRadius:`var(--segment-radius)`,_disabled:{opacity:`0.5`},"&:has(input:focus-visible)":{focusRing:`outside`},_before:{content:`""`,position:`absolute`,bg:`border`,transition:`opacity 0.2s`},_horizontal:{_before:{insetInlineStart:0,insetBlock:`1.5`,width:`1px`}},_vertical:{_before:{insetBlockStart:0,insetInline:`1.5`,height:`1px`}},"& + &[data-state=checked], &[data-state=checked] + &, &:first-of-type":{_before:{opacity:`0`}},"&[data-state=checked][data-ssr]":{shadow:`sm`,bg:`bg`,borderRadius:`var(--segment-radius)`}},indicator:{shadow:`var(--segment-indicator-shadow)`,pos:`absolute`,bg:`var(--segment-indicator-bg)`,width:`var(--width)`,height:`var(--height)`,top:`var(--top)`,left:`var(--left)`,zIndex:-1,borderRadius:`var(--segment-radius)`}},variants:{size:{xs:{item:{textStyle:`xs`,px:`3`,gap:`1`,height:`6`}},sm:{item:{textStyle:`sm`,px:`4`,gap:`2`,height:`8`}},md:{item:{textStyle:`sm`,px:`4`,gap:`2`,height:`10`}},lg:{item:{textStyle:`md`,px:`4.5`,gap:`3`,height:`11`}}}},defaultVariants:{size:`md`}}),IC=G({className:`chakra-slider`,slots:DS.keys(),base:{root:{display:`flex`,flexDirection:`column`,gap:`1`,textStyle:`sm`,position:`relative`,isolation:`isolate`,touchAction:`none`},label:{fontWeight:`medium`,textStyle:`sm`},control:{display:`inline-flex`,alignItems:`center`,position:`relative`},track:{overflow:`hidden`,borderRadius:`full`,flex:`1`},range:{width:`inherit`,height:`inherit`,_disabled:{bg:`border.emphasized!`}},markerGroup:{position:`absolute!`,zIndex:`1`},marker:{"--marker-bg":{base:`white`,_underValue:`colors.bg`},display:`flex`,alignItems:`center`,gap:`calc(var(--slider-thumb-size) / 2)`,color:`fg.muted`,textStyle:`xs`},markerIndicator:{width:`var(--slider-marker-size)`,height:`var(--slider-marker-size)`,borderRadius:`full`,bg:`var(--marker-bg)`},thumb:{width:`var(--slider-thumb-size)`,height:`var(--slider-thumb-size)`,display:`flex`,alignItems:`center`,justifyContent:`center`,outline:0,zIndex:`2`,borderRadius:`full`,transition:`shadow`,_focusVisible:{ring:`3px`,ringColor:`colorPalette.focusRing/50`}}},variants:{size:{sm:{root:{"--slider-thumb-size":`sizes.4`,"--slider-track-size":`sizes.1.5`,"--slider-marker-center":`6px`,"--slider-marker-size":`sizes.1`,"--slider-marker-inset":`3px`}},md:{root:{"--slider-thumb-size":`sizes.5`,"--slider-track-size":`sizes.2`,"--slider-marker-center":`8px`,"--slider-marker-size":`sizes.1`,"--slider-marker-inset":`4px`}},lg:{root:{"--slider-thumb-size":`sizes.6`,"--slider-track-size":`sizes.2.5`,"--slider-marker-center":`9px`,"--slider-marker-size":`sizes.1.5`,"--slider-marker-inset":`5px`}}},variant:{outline:{track:{shadow:`inset`,bg:`bg.emphasized/72`},range:{bg:`colorPalette.solid`},thumb:{borderWidth:`2px`,borderColor:`colorPalette.solid`,bg:`bg`,_disabled:{bg:`border.emphasized`,borderColor:`border.emphasized`}}},solid:{track:{bg:`colorPalette.subtle`,_disabled:{bg:`bg.muted`}},range:{bg:`colorPalette.solid`},thumb:{bg:`colorPalette.solid`,_disabled:{bg:`border.emphasized`}}}},orientation:{vertical:{root:{display:`inline-flex`},control:{flexDirection:`column`,height:`100%`,minWidth:`var(--slider-thumb-size)`,"&:has(.chakra-slider__markerLabel)":{marginEnd:`4`}},track:{width:`var(--slider-track-size)`},thumb:{left:`50%`,translate:`-50% 0`},markerGroup:{insetStart:`var(--slider-marker-center)`,insetBlock:`var(--slider-marker-inset)`},marker:{flexDirection:`row`}},horizontal:{control:{flexDirection:`row`,width:`100%`,minHeight:`var(--slider-thumb-size)`,"&:has(.chakra-slider__markerLabel)":{marginBottom:`4`}},track:{height:`var(--slider-track-size)`},thumb:{top:`50%`,translate:`0 -50%`},markerGroup:{top:`var(--slider-marker-center)`,insetInline:`var(--slider-marker-inset)`},marker:{flexDirection:`column`}}}},defaultVariants:{size:`md`,variant:`outline`,orientation:`horizontal`}}),LC=G({slots:zS.keys(),className:`splitter`,base:{resizeTrigger:{"--splitter-border-color":`colors.border`,"--splitter-thumb-color":`colors.bg`,"--splitter-thumb-size":`sizes.2`,"--splitter-thumb-inset":`calc(var(--splitter-thumb-size) * -0.5)`,"--splitter-border-size":`1px`,"--splitter-handle-size":`sizes.6`,outline:`0`,display:`grid`,placeItems:`center`,position:`relative`,_focus:{"--splitter-border-color":`colors.border.emphasized`,"--splitter-thumb-color":`colors.colorPalette.subtle`},_dragging:{"--splitter-thumb-color":`colors.colorPalette.focusRing`},_horizontal:{minWidth:`var(--splitter-thumb-size)`,marginInline:`var(--splitter-thumb-inset)`},_vertical:{minHeight:`var(--splitter-thumb-size)`,marginBlock:`var(--splitter-thumb-inset)`}},resizeTriggerSeparator:{position:`absolute`,bg:`var(--splitter-border-color)`,"[data-part='resize-trigger'][data-orientation=horizontal] &":{insetInlineEnd:`calc(var(--splitter-thumb-size) * 0.5)`,insetBlock:`0`,insetInlineStart:`auto`,w:`var(--splitter-border-size)`},"[data-part='resize-trigger'][data-orientation=vertical] &":{insetBlockEnd:`calc(var(--splitter-thumb-size) * 0.5)`,insetInline:`0`,insetBlockStart:`auto`,h:`var(--splitter-border-size)`}},resizeTriggerIndicator:{position:`relative`,rounded:`full`,bg:`var(--splitter-thumb-color)`,shadow:`xs`,borderWidth:`1px`,zIndex:`1`,"[data-part='resize-trigger'][data-orientation=horizontal] &":{w:`full`,h:`var(--splitter-handle-size)`},"[data-part='resize-trigger'][data-orientation=vertical] &":{w:`var(--splitter-handle-size)`,h:`full`},"[data-part='resize-trigger'][data-focus]:focus-visible &":{outlineWidth:`2px`,outlineColor:`colorPalette.focusRing`,outlineStyle:`solid`},"[data-part='resize-trigger'][data-disabled] &":{visibility:`hidden`}}}}),RC=G({className:`chakra-stat`,slots:OS.keys(),base:{root:{display:`flex`,flexDirection:`column`,gap:`1`,position:`relative`,flex:`1`},label:{display:`inline-flex`,gap:`1.5`,alignItems:`center`,color:`fg.muted`,textStyle:`sm`},helpText:{color:`fg.muted`,textStyle:`xs`},valueUnit:{color:`fg.muted`,textStyle:`xs`,fontWeight:`initial`,letterSpacing:`initial`},valueText:{verticalAlign:`baseline`,fontWeight:`semibold`,letterSpacing:`tight`,fontFeatureSettings:`pnum`,fontVariantNumeric:`proportional-nums`,display:`inline-flex`,gap:`1`},indicator:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,marginEnd:1,"& :where(svg)":{w:`1em`,h:`1em`},"&[data-type=up]":{color:`fg.success`},"&[data-type=down]":{color:`fg.error`}}},variants:{size:{sm:{valueText:{textStyle:`xl`}},md:{valueText:{textStyle:`2xl`}},lg:{valueText:{textStyle:`3xl`}}}},defaultVariants:{size:`md`}}),zC=G({className:`chakra-status`,slots:kS.keys(),base:{root:{display:`inline-flex`,alignItems:`center`,gap:`2`},indicator:{width:`0.64em`,height:`0.64em`,flexShrink:0,borderRadius:`full`,forcedColorAdjust:`none`,bg:`colorPalette.solid`}},variants:{size:{sm:{root:{textStyle:`xs`}},md:{root:{textStyle:`sm`}},lg:{root:{textStyle:`md`}}}},defaultVariants:{size:`md`}}),BC=G({className:`chakra-steps`,slots:AS.keys(),base:{root:{display:`flex`,width:`full`},list:{display:`flex`,justifyContent:`space-between`,"--steps-gutter":`spacing.3`,"--steps-thickness":`2px`},title:{fontWeight:`medium`,color:`fg`},description:{color:`fg.muted`},separator:{bg:`border`,flex:`1`},indicator:{display:`flex`,justifyContent:`center`,alignItems:`center`,flexShrink:`0`,borderRadius:`full`,fontWeight:`medium`,width:`var(--steps-size)`,height:`var(--steps-size)`,_icon:{flexShrink:`0`,width:`var(--steps-icon-size)`,height:`var(--steps-icon-size)`}},item:{position:`relative`,display:`flex`,gap:`3`,flex:`1 0 0`,"&:last-of-type":{flex:`initial`,"& [data-part=separator]":{display:`none`}}},trigger:{display:`flex`,alignItems:`center`,gap:`3`,textAlign:`start`,focusVisibleRing:`outside`,borderRadius:`l2`},content:{focusVisibleRing:`outside`}},variants:{orientation:{vertical:{root:{flexDirection:`row`,height:`100%`},list:{flexDirection:`column`,alignItems:`flex-start`},separator:{position:`absolute`,width:`var(--steps-thickness)`,height:`100%`,maxHeight:`calc(100% - var(--steps-size) - var(--steps-gutter) * 2)`,top:`calc(var(--steps-size) + var(--steps-gutter))`,insetStart:`calc(var(--steps-size) / 2 - 1px)`},item:{alignItems:`flex-start`}},horizontal:{root:{flexDirection:`column`,width:`100%`},list:{flexDirection:`row`,alignItems:`center`},separator:{width:`100%`,height:`var(--steps-thickness)`,marginX:`var(--steps-gutter)`},item:{alignItems:`center`}}},variant:{solid:{indicator:{_incomplete:{borderWidth:`var(--steps-thickness)`},_current:{bg:`colorPalette.muted`,borderWidth:`var(--steps-thickness)`,borderColor:`colorPalette.solid`,color:`colorPalette.fg`},_complete:{bg:`colorPalette.solid`,borderColor:`colorPalette.solid`,color:`colorPalette.contrast`}},separator:{_complete:{bg:`colorPalette.solid`}}},subtle:{indicator:{_incomplete:{bg:`bg.muted`},_current:{bg:`colorPalette.muted`,color:`colorPalette.fg`},_complete:{bg:`colorPalette.emphasized`,color:`colorPalette.fg`}},separator:{_complete:{bg:`colorPalette.emphasized`}}}},size:{xs:{root:{gap:`2.5`},list:{"--steps-size":`sizes.6`,"--steps-icon-size":`sizes.3.5`,textStyle:`xs`},title:{textStyle:`sm`}},sm:{root:{gap:`3`},list:{"--steps-size":`sizes.8`,"--steps-icon-size":`sizes.4`,textStyle:`xs`},title:{textStyle:`sm`}},md:{root:{gap:`4`},list:{"--steps-size":`sizes.10`,"--steps-icon-size":`sizes.4`,textStyle:`sm`},title:{textStyle:`sm`}},lg:{root:{gap:`6`},list:{"--steps-size":`sizes.11`,"--steps-icon-size":`sizes.5`,textStyle:`md`},title:{textStyle:`md`}}}},defaultVariants:{size:`md`,variant:`solid`,orientation:`horizontal`}}),VC=G({slots:jS.keys(),className:`chakra-switch`,base:{root:{display:`inline-flex`,gap:`2.5`,alignItems:`center`,position:`relative`,verticalAlign:`middle`,"--switch-diff":`calc(var(--switch-width) - var(--switch-height))`,"--switch-x":{base:`var(--switch-diff)`,_rtl:`calc(var(--switch-diff) * -1)`}},label:{lineHeight:`1`,userSelect:`none`,fontSize:`sm`,fontWeight:`medium`,_disabled:{opacity:`0.5`}},indicator:{position:`absolute`,height:`var(--switch-height)`,width:`var(--switch-height)`,fontSize:`var(--switch-indicator-font-size)`,fontWeight:`medium`,flexShrink:0,userSelect:`none`,display:`grid`,placeContent:`center`,transition:`inset-inline-start 0.12s ease`,insetInlineStart:`calc(var(--switch-x) - 2px)`,_checked:{insetInlineStart:`2px`}},control:{display:`inline-flex`,gap:`0.5rem`,flexShrink:0,justifyContent:`flex-start`,cursor:`switch`,borderRadius:`full`,position:`relative`,width:`var(--switch-width)`,height:`var(--switch-height)`,transition:`backgrounds`,_disabled:{opacity:`0.5`,cursor:`not-allowed`},_invalid:{outline:`2px solid`,outlineColor:`border.error`,outlineOffset:`2px`}},thumb:{display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0,transitionProperty:`translate`,transitionDuration:`fast`,borderRadius:`inherit`,_checked:{translate:`var(--switch-x) 0`}}},variants:{variant:{solid:{control:{borderRadius:`full`,bg:`bg.emphasized`,focusVisibleRing:`outside`,_checked:{bg:`colorPalette.solid`}},thumb:{bg:`white`,width:`var(--switch-height)`,height:`var(--switch-height)`,scale:`0.8`,boxShadow:`sm`,_checked:{bg:`colorPalette.contrast`}}},raised:{control:{borderRadius:`full`,height:`calc(var(--switch-height) / 2)`,bg:`bg.muted`,boxShadow:`inset`,_checked:{bg:`colorPalette.solid/60`}},thumb:{width:`var(--switch-height)`,height:`var(--switch-height)`,position:`relative`,top:`calc(var(--switch-height) * -0.25)`,bg:`white`,boxShadow:`xs`,focusVisibleRing:`outside`,_checked:{bg:`colorPalette.solid`}}}},size:{xs:{root:{"--switch-width":`sizes.6`,"--switch-height":`sizes.3`,"--switch-indicator-font-size":`fontSizes.xs`}},sm:{root:{"--switch-width":`sizes.8`,"--switch-height":`sizes.4`,"--switch-indicator-font-size":`fontSizes.xs`}},md:{root:{"--switch-width":`sizes.10`,"--switch-height":`sizes.5`,"--switch-indicator-font-size":`fontSizes.sm`}},lg:{root:{"--switch-width":`sizes.12`,"--switch-height":`sizes.6`,"--switch-indicator-font-size":`fontSizes.md`}}}},defaultVariants:{variant:`solid`,size:`md`}}),HC=G({className:`chakra-table`,slots:MS.keys(),base:{root:{fontVariantNumeric:`lining-nums tabular-nums`,borderCollapse:`collapse`,width:`full`,textAlign:`start`,verticalAlign:`top`},row:{_selected:{bg:`colorPalette.subtle`}},cell:{textAlign:`start`,alignItems:`center`},columnHeader:{fontWeight:`medium`,textAlign:`start`,color:`fg`},caption:{fontWeight:`medium`,textStyle:`xs`},footer:{fontWeight:`medium`}},variants:{interactive:{true:{body:{"& tr":{_hover:{bg:`colorPalette.subtle`}}}}},stickyHeader:{true:{header:{"& :where(tr)":{top:`var(--table-sticky-offset, 0)`,position:`sticky`,zIndex:1}}}},striped:{true:{row:{"&:nth-of-type(odd) td":{bg:`bg.muted`}}}},showColumnBorder:{true:{columnHeader:{"&:not(:last-of-type)":{borderInlineEndWidth:`1px`}},cell:{"&:not(:last-of-type)":{borderInlineEndWidth:`1px`}}}},variant:{line:{columnHeader:{borderBottomWidth:`1px`},cell:{borderBottomWidth:`1px`},row:{bg:`bg`}},outline:{root:{boxShadow:`0 0 0 1px {colors.border}`},columnHeader:{borderBottomWidth:`1px`},header:{bg:`bg.muted`},row:{"&:not(:last-of-type)":{borderBottomWidth:`1px`}},footer:{borderTopWidth:`1px`}}},size:{sm:{root:{textStyle:`sm`},columnHeader:{px:`2`,py:`2`},cell:{px:`2`,py:`2`}},md:{root:{textStyle:`sm`},columnHeader:{px:`3`,py:`3`},cell:{px:`3`,py:`3`}},lg:{root:{textStyle:`md`},columnHeader:{px:`4`,py:`3`},cell:{px:`4`,py:`3`}}}},defaultVariants:{variant:`line`,size:`md`}}),UC=G({slots:PS.keys(),className:`chakra-tabs`,base:{root:{"--tabs-trigger-radius":`radii.l2`,"--tabs-indicator-shadow":`shadows.xs`,"--tabs-indicator-bg":`colors.bg`,position:`relative`,_horizontal:{display:`block`},_vertical:{display:`flex`}},list:{display:`inline-flex`,position:`relative`,isolation:`isolate`,minH:`var(--tabs-height)`,_horizontal:{flexDirection:`row`},_vertical:{flexDirection:`column`}},trigger:{outline:`0`,minW:`var(--tabs-height)`,height:`var(--tabs-height)`,display:`flex`,alignItems:`center`,fontWeight:`medium`,position:`relative`,cursor:`button`,gap:`2`,_focusVisible:{zIndex:1,outline:`2px solid`,outlineColor:`colorPalette.focusRing`},_disabled:{cursor:`not-allowed`,opacity:.5}},content:{focusVisibleRing:`inside`,_horizontal:{width:`100%`,pt:`var(--tabs-content-padding)`},_vertical:{height:`100%`,ps:`var(--tabs-content-padding)`}},indicator:{width:`var(--width)`,height:`var(--height)`,borderRadius:`var(--tabs-trigger-radius)`,bg:`var(--tabs-indicator-bg)`,shadow:`var(--tabs-indicator-shadow)`,zIndex:-1}},variants:{fitted:{true:{list:{display:`flex`},trigger:{flex:1,textAlign:`center`,justifyContent:`center`}}},justify:{start:{list:{justifyContent:`flex-start`}},center:{list:{justifyContent:`center`}},end:{list:{justifyContent:`flex-end`}}},size:{sm:{root:{"--tabs-height":`sizes.9`,"--tabs-content-padding":`spacing.3`},trigger:{py:`1`,px:`3`,textStyle:`sm`}},md:{root:{"--tabs-height":`sizes.10`,"--tabs-content-padding":`spacing.4`},trigger:{py:`2`,px:`4`,textStyle:`sm`}},lg:{root:{"--tabs-height":`sizes.11`,"--tabs-content-padding":`spacing.4.5`},trigger:{py:`2`,px:`4.5`,textStyle:`md`}}},variant:{line:{list:{display:`flex`,borderColor:`border`,_horizontal:{borderBottomWidth:`1px`},_vertical:{borderEndWidth:`1px`}},trigger:{color:`fg.muted`,_disabled:{_active:{bg:`initial`}},_selected:{color:`fg`,_horizontal:{layerStyle:`indicator.bottom`,"--indicator-offset-y":`-1px`,"--indicator-color":`colors.colorPalette.solid`},_vertical:{layerStyle:`indicator.end`,"--indicator-offset-x":`-1px`}}}},subtle:{trigger:{borderRadius:`var(--tabs-trigger-radius)`,color:`fg.muted`,_selected:{bg:`colorPalette.subtle`,color:`colorPalette.fg`}}},enclosed:{list:{bg:`bg.muted`,padding:`1`,borderRadius:`l3`,minH:`calc(var(--tabs-height) - 4px)`},trigger:{justifyContent:`center`,color:`fg.muted`,borderRadius:`var(--tabs-trigger-radius)`,_selected:{bg:`bg`,color:`colorPalette.fg`,shadow:`xs`}}},outline:{list:{"--line-thickness":`1px`,"--line-offset":`calc(var(--line-thickness) * -1)`,borderColor:`border`,display:`flex`,_horizontal:{_before:{content:`""`,position:`absolute`,bottom:`0px`,width:`100%`,borderBottomWidth:`var(--line-thickness)`,borderBottomColor:`border`}},_vertical:{_before:{content:`""`,position:`absolute`,insetInline:`var(--line-offset)`,height:`calc(100% - calc(var(--line-thickness) * 2))`,borderEndWidth:`var(--line-thickness)`,borderEndColor:`border`}}},trigger:{color:`fg.muted`,borderWidth:`1px`,borderColor:`transparent`,_selected:{bg:`currentBg`,color:`colorPalette.fg`},_horizontal:{borderTopRadius:`var(--tabs-trigger-radius)`,marginBottom:`var(--line-offset)`,marginEnd:{_notLast:`var(--line-offset)`},_selected:{borderColor:`border`,borderBottomColor:`transparent`}},_vertical:{borderStartRadius:`var(--tabs-trigger-radius)`,marginEnd:`var(--line-offset)`,marginBottom:{_notLast:`var(--line-offset)`},_selected:{borderColor:`border`,borderEndColor:`transparent`}}}},plain:{trigger:{color:`fg.muted`,_selected:{color:`colorPalette.fg`},borderRadius:`var(--tabs-trigger-radius)`,"&[data-selected][data-ssr]":{bg:`var(--tabs-indicator-bg)`,shadow:`var(--tabs-indicator-shadow)`,borderRadius:`var(--tabs-trigger-radius)`}}}}},defaultVariants:{size:`md`,variant:`line`}}),WC=Ix.variants?.variant,GC=G({slots:FS.keys(),className:`chakra-tag`,base:{root:{display:`inline-flex`,alignItems:`center`,verticalAlign:`top`,maxWidth:`100%`,userSelect:`none`,borderRadius:`l2`,focusVisibleRing:`outside`},label:{lineClamp:`1`},closeTrigger:{display:`flex`,alignItems:`center`,justifyContent:`center`,outline:`0`,borderRadius:`l1`,color:`currentColor`,focusVisibleRing:`inside`,focusRingWidth:`2px`},startElement:{flexShrink:0,boxSize:`var(--tag-element-size)`,ms:`var(--tag-element-offset)`,"&:has([data-scope=avatar])":{boxSize:`var(--tag-avatar-size)`,ms:`calc(var(--tag-element-offset) * 1.5)`},_icon:{boxSize:`100%`}},endElement:{flexShrink:0,boxSize:`var(--tag-element-size)`,me:`var(--tag-element-offset)`,_icon:{boxSize:`100%`},"&:has(button)":{ms:`calc(var(--tag-element-offset) * -1)`}}},variants:{size:{sm:{root:{px:`1.5`,minH:`4.5`,gap:`1`,"--tag-avatar-size":`spacing.3`,"--tag-element-size":`spacing.3`,"--tag-element-offset":`-2px`},label:{textStyle:`xs`}},md:{root:{px:`1.5`,minH:`5`,gap:`1`,"--tag-avatar-size":`spacing.3.5`,"--tag-element-size":`spacing.3.5`,"--tag-element-offset":`-2px`},label:{textStyle:`xs`}},lg:{root:{px:`2`,minH:`6`,gap:`1.5`,"--tag-avatar-size":`spacing.4.5`,"--tag-element-size":`spacing.4`,"--tag-element-offset":`-3px`},label:{textStyle:`sm`}},xl:{root:{px:`2.5`,minH:`8`,gap:`1.5`,"--tag-avatar-size":`spacing.6`,"--tag-element-size":`spacing.4.5`,"--tag-element-offset":`-4px`},label:{textStyle:`sm`}}},variant:{subtle:{root:WC?.subtle},solid:{root:WC?.solid},outline:{root:WC?.outline},surface:{root:WC?.surface}}},defaultVariants:{size:`md`,variant:`surface`}}),KC=G({slots:_g.keys(),className:`tags-input`,base:{root:{display:`flex`,flexDirection:`column`,gap:`1.5`,width:`full`},label:{fontWeight:`medium`,textStyle:`sm`,_disabled:{opacity:`0.5`}},control:{"--focus-color":`colors.colorPalette.focusRing`,"--error-color":`colors.border.error`,minH:`var(--tags-input-height)`,"--input-height":`var(--tags-input-height)`,px:`var(--tags-input-px)`,py:`var(--tags-input-py)`,gap:`var(--tags-input-gap)`,display:`flex`,flexWrap:`wrap`,alignItems:`center`,borderRadius:`l2`,pos:`relative`,transitionProperty:`border-color, box-shadow`,transitionDuration:`normal`,_disabled:{opacity:`0.5`},_invalid:{borderColor:`var(--error-color)`}},input:{flex:`1`,minWidth:`20`,outline:`none`,bg:`transparent`,color:`fg`,px:`calc(var(--tags-input-item-px) / 1.25)`,height:`var(--tags-input-item-height)`,_readOnly:{display:`none`}},item:{maxWidth:`100%`,minWidth:`0`},itemText:{lineClamp:`1`,minWidth:`0`},itemInput:{outline:`none`,bg:`transparent`,minWidth:`2ch`,color:`inherit`,px:`var(--tags-input-item-px)`,height:`var(--tags-input-item-height)`},itemPreview:{height:`var(--tags-input-item-height)`,userSelect:`none`,display:`inline-flex`,alignItems:`center`,gap:`1`,rounded:`l1`,px:`var(--tags-input-item-px)`,maxWidth:`100%`},itemDeleteTrigger:{display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:`0`,boxSize:`calc(var(--tags-input-item-height) / 1.5)`,cursor:{base:`button`,_disabled:`initial`},me:`-1`,opacity:`0.4`,_hover:{opacity:`1`},"[data-highlighted] &":{opacity:`1`},_icon:{boxSize:`80%`}},clearTrigger:{display:`flex`,alignItems:`center`,justifyContent:`center`,boxSize:`calc(var(--tags-input-item-height) / 1.5)`,cursor:{base:`button`,_disabled:`initial`},color:`fg.muted`,focusVisibleRing:`inside`,focusRingWidth:`2px`,rounded:`l1`,_icon:{boxSize:`5`}}},variants:{size:{xs:{root:{"--tags-input-height":`sizes.8`,"--tags-input-px":`spacing.1.5`,"--tags-input-py":`spacing.1`,"--tags-input-gap":`spacing.1`,"--tags-input-item-height":`sizes.6`,"--tags-input-item-px":`spacing.2`,textStyle:`xs`}},sm:{root:{"--tags-input-height":`sizes.9`,"--tags-input-px":`spacing.1.5`,"--tags-input-py":`spacing.1`,"--tags-input-gap":`spacing.1`,"--tags-input-item-height":`sizes.6`,"--tags-input-item-px":`spacing.2`,textStyle:`sm`}},md:{root:{"--tags-input-height":`sizes.10`,"--tags-input-px":`spacing.1.5`,"--tags-input-py":`spacing.1`,"--tags-input-gap":`spacing.1`,"--tags-input-item-height":`sizes.7`,"--tags-input-item-px":`spacing.2`,textStyle:`sm`}},lg:{root:{"--tags-input-height":`sizes.11`,"--tags-input-px":`spacing.1.5`,"--tags-input-py":`spacing.1`,"--tags-input-gap":`spacing.1`,"--tags-input-item-height":`sizes.8`,"--tags-input-item-px":`spacing.2`,textStyle:`md`}}},variant:{outline:{control:{borderWidth:`1px`,bg:`bg`,_focus:{outlineWidth:`1px`,outlineStyle:`solid`,outlineColor:`var(--focus-color)`,borderColor:`var(--focus-color)`,_invalid:{outlineColor:`var(--error-color)`,borderColor:`var(--error-color)`}}},itemPreview:{bg:`colorPalette.subtle`,_highlighted:{bg:`colorPalette.muted`}}},subtle:{control:{bg:`bg.muted`,borderWidth:`1px`,borderColor:`transparent`,_focus:{outlineWidth:`1px`,outlineStyle:`solid`,outlineColor:`var(--focus-color)`,borderColor:`var(--focus-color)`,_invalid:{outlineColor:`var(--error-color)`,borderColor:`var(--error-color)`}}},itemPreview:{bg:`bg`,borderWidth:`1px`,_highlighted:{bg:`colorPalette.subtle`,borderColor:`colorPalette.emphasized`}}},flushed:{control:{borderRadius:`0`,px:`0`,bg:`transparent`,borderBottomWidth:`1px`,borderBottomColor:`border`,_focus:{borderColor:`var(--focus-color)`,boxShadow:`0px 1px 0px 0px var(--focus-color)`}},itemPreview:{bg:`colorPalette.subtle`,_highlighted:{bg:`colorPalette.muted`}}}}},defaultVariants:{size:`md`,variant:`outline`}}),qC=G({slots:IS.keys(),className:`chakra-timeline`,base:{root:{display:`flex`,flexDirection:`column`,width:`full`,"--timeline-thickness":`1px`,"--timeline-gutter":`4px`},item:{"--timeline-content-gap":`spacing.6`,display:`flex`,position:`relative`,alignItems:`flex-start`,flexShrink:0,gap:`4`,_last:{"--timeline-content-gap":`0`}},separator:{display:`var(--timeline-separator-display)`,position:`absolute`,borderStartWidth:`var(--timeline-thickness)`,ms:`calc(-1 * var(--timeline-thickness) / 2)`,insetInlineStart:`calc(var(--timeline-indicator-size) / 2)`,insetBlock:`0`,borderColor:`border`},indicator:{outline:`2px solid {colors.bg}`,position:`relative`,flexShrink:`0`,boxSize:`var(--timeline-indicator-size)`,fontSize:`var(--timeline-font-size)`,display:`flex`,alignItems:`center`,justifyContent:`center`,borderRadius:`full`,fontWeight:`medium`},connector:{alignSelf:`stretch`,position:`relative`},content:{pb:`var(--timeline-content-gap)`,display:`flex`,flexDirection:`column`,width:`full`,gap:`2`},title:{display:`flex`,fontWeight:`medium`,flexWrap:`wrap`,gap:`1.5`,alignItems:`center`,mt:`var(--timeline-margin)`},description:{color:`fg.muted`,textStyle:`xs`}},variants:{variant:{subtle:{indicator:{bg:`colorPalette.muted`}},solid:{indicator:{bg:`colorPalette.solid`,color:`colorPalette.contrast`}},outline:{indicator:{bg:`currentBg`,borderWidth:`1px`,borderColor:`colorPalette.muted`}},plain:{}},showLastSeparator:{true:{item:{_last:{"--timeline-separator-display":`initial`}}},false:{item:{_last:{"--timeline-separator-display":`none`}}}},size:{sm:{root:{"--timeline-indicator-size":`sizes.4`,"--timeline-font-size":`fontSizes.2xs`},title:{textStyle:`xs`}},md:{root:{"--timeline-indicator-size":`sizes.5`,"--timeline-font-size":`fontSizes.xs`},title:{textStyle:`sm`}},lg:{root:{"--timeline-indicator-size":`sizes.6`,"--timeline-font-size":`fontSizes.xs`},title:{mt:`0.5`,textStyle:`sm`}},xl:{root:{"--timeline-indicator-size":`sizes.8`,"--timeline-font-size":`fontSizes.sm`},title:{mt:`1.5`,textStyle:`sm`}}}},defaultVariants:{size:`md`,variant:`solid`,showLastSeparator:!1}}),JC=G({slots:NS.keys(),className:`chakra-toast`,base:{root:{width:`full`,display:`flex`,alignItems:`flex-start`,position:`relative`,gap:`3`,py:`4`,ps:`4`,pe:`6`,borderRadius:`l2`,translate:`var(--x) var(--y)`,scale:`var(--scale)`,zIndex:`var(--z-index)`,height:`var(--height)`,opacity:`var(--opacity)`,willChange:`translate, opacity, scale`,transition:`translate 400ms, scale 400ms, opacity 400ms, height 400ms, box-shadow 200ms`,transitionTimingFunction:`cubic-bezier(0.21, 1.02, 0.73, 1)`,_closed:{transition:`translate 400ms, scale 400ms, opacity 200ms`,transitionTimingFunction:`cubic-bezier(0.06, 0.71, 0.55, 1)`},bg:`bg.panel`,color:`fg`,boxShadow:`xl`,"--toast-trigger-bg":`colors.bg.muted`,"&[data-type=warning]":{bg:`orange.solid`,color:`orange.contrast`,"--toast-trigger-bg":`{white/10}`,"--toast-border-color":`{white/40}`},"&[data-type=success]":{bg:`green.solid`,color:`green.contrast`,"--toast-trigger-bg":`{white/10}`,"--toast-border-color":`{white/40}`},"&[data-type=error]":{bg:`red.solid`,color:`red.contrast`,"--toast-trigger-bg":`{white/10}`,"--toast-border-color":`{white/40}`}},title:{fontWeight:`medium`,textStyle:`sm`,marginEnd:`2`},description:{display:`inline`,textStyle:`sm`,opacity:`0.8`},indicator:{flexShrink:`0`,boxSize:`5`},actionTrigger:{textStyle:`sm`,fontWeight:`medium`,height:`8`,px:`3`,borderRadius:`l2`,alignSelf:`center`,borderWidth:`1px`,borderColor:`var(--toast-border-color, inherit)`,transition:`background 200ms`,_hover:{bg:`var(--toast-trigger-bg)`}},closeTrigger:{position:`absolute`,top:`1`,insetEnd:`1`,padding:`1`,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,color:`{currentColor/60}`,borderRadius:`l2`,textStyle:`md`,transition:`background 200ms`,_icon:{boxSize:`1em`}}}}),YC=G({slots:yg.keys(),className:`chakra-tooltip`,base:{content:{"--tooltip-bg":`colors.bg.inverted`,bg:`var(--tooltip-bg)`,color:`fg.inverted`,px:`2.5`,py:`1`,borderRadius:`l2`,fontWeight:`medium`,textStyle:`xs`,boxShadow:`md`,maxW:`xs`,zIndex:`tooltip`,transformOrigin:`var(--transform-origin)`,_open:{animationStyle:`scale-fade-in`,animationDuration:`fast`},_closed:{animationStyle:`scale-fade-out`,animationDuration:`fast`}},arrow:{"--arrow-size":`sizes.2`,"--arrow-background":`var(--tooltip-bg)`},arrowTip:{borderTopWidth:`1px`,borderLeftWidth:`1px`,borderColor:`var(--tooltip-bg)`}}}),XC=Xv({display:`flex`,alignItems:`center`,gap:`var(--tree-item-gap)`,rounded:`l2`,userSelect:`none`,position:`relative`,"--tree-depth":`calc(var(--depth) - 1)`,"--tree-indentation-offset":`calc(var(--tree-indentation) * var(--tree-depth))`,"--tree-offset":`calc(var(--tree-padding-inline) + var(--tree-indentation-offset))`,ps:`var(--tree-offset)`,pe:`var(--tree-padding-inline)`,py:`var(--tree-padding-block)`,focusVisibleRing:`inside`,focusRingColor:`border.emphasized`,focusRingWidth:`2px`,"&:hover, &:focus-visible":{bg:`bg.muted`},_disabled:{layerStyle:`disabled`}}),ZC=Xv({flex:`1`}),QC=Xv({_selected:{bg:`colorPalette.subtle`,color:`colorPalette.fg`}}),$C=Xv({_selected:{layerStyle:`fill.solid`}}),ew={accordion:VS,actionBar:HS,alert:US,avatar:WS,blockquote:GS,breadcrumb:KS,card:qS,carousel:JS,checkbox:YS,checkboxCard:XS,codeBlock:ZS,collapsible:QS,dataList:tC,dateInput:nC,datePicker:aC,dialog:oC,drawer:sC,editable:lC,emptyState:uC,field:dC,fieldset:fC,fileUpload:pC,hoverCard:hC,list:gC,listbox:_C,menu:yC,nativeSelect:xC,numberInput:CC,pinInput:EC,popover:DC,progress:OC,progressCircle:kC,radioCard:jC,radioGroup:MC,ratingGroup:NC,scrollArea:PC,segmentGroup:FC,select:bC,combobox:eC,slider:IC,splitter:LC,stat:RC,steps:BC,switch:VC,table:HC,tabs:UC,tag:GC,tagsInput:KC,toast:JC,tooltip:YC,status:zC,timeline:qC,colorPicker:$S,qrCode:AC,treeView:G({slots:bg.keys(),className:`chakra-tree-view`,base:{root:{width:`full`,display:`flex`,flexDirection:`column`,gap:`2`},tree:{display:`flex`,flexDirection:`column`,"--tree-item-gap":`spacing.2`,"--tree-indentation":`calc(var(--tree-indent-size) + var(--tree-icon-size) * 0.5)`,_icon:{boxSize:`var(--tree-icon-size)`}},label:{fontWeight:`medium`,textStyle:`sm`},branch:{position:`relative`},branchContent:{position:`relative`},branchIndentGuide:{height:`100%`,width:`1px`,bg:`border`,position:`absolute`,"--tree-depth":`calc(var(--depth) - 1)`,"--tree-indentation-offset":`calc(var(--tree-indentation) * var(--tree-depth))`,"--tree-offset":`calc(var(--tree-padding-inline) + var(--tree-indentation-offset))`,insetInlineStart:`calc(var(--tree-offset) + var(--tree-icon-size) * 0.5)`,zIndex:`1`},branchIndicator:{color:`fg.muted`,transformOrigin:`center`,transitionDuration:`normal`,transitionProperty:`transform`,transitionTimingFunction:`default`,_open:{transform:`rotate(90deg)`}},branchTrigger:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`},branchControl:XC,item:XC,itemText:ZC,branchText:ZC,nodeCheckbox:{display:`inline-flex`}},variants:{size:{md:{tree:{textStyle:`sm`,"--tree-indent-size":`spacing.4`,"--tree-icon-size":`spacing.4`,"--tree-padding-inline":`spacing.3`,"--tree-padding-block":`spacing.1.5`}},sm:{tree:{textStyle:`sm`,"--tree-indent-size":`spacing.4`,"--tree-icon-size":`spacing.3`,"--tree-padding-inline":`spacing.3`,"--tree-padding-block":`spacing.1`}},xs:{tree:{textStyle:`xs`,"--tree-indent-size":`spacing.4`,"--tree-icon-size":`spacing.3`,"--tree-padding-inline":`spacing.2`,"--tree-padding-block":`spacing.1`}}},variant:{subtle:{branchControl:QC,item:QC},solid:{branchControl:$C,item:$C}},animateContent:{true:{branchContent:{_open:{animationName:`expand-height, fade-in`,animationDuration:`moderate`},_closed:{animationName:`collapse-height, fade-out`,animationDuration:`moderate`}}}}},defaultVariants:{size:`md`,variant:`subtle`}}),marquee:vC,floatingPanel:mC},tw=Zv({"2xs":{value:{fontSize:`2xs`,lineHeight:`0.75rem`}},xs:{value:{fontSize:`xs`,lineHeight:`1rem`}},sm:{value:{fontSize:`sm`,lineHeight:`1.25rem`}},md:{value:{fontSize:`md`,lineHeight:`1.5rem`}},lg:{value:{fontSize:`lg`,lineHeight:`1.75rem`}},xl:{value:{fontSize:`xl`,lineHeight:`1.875rem`}},"2xl":{value:{fontSize:`2xl`,lineHeight:`2rem`}},"3xl":{value:{fontSize:`3xl`,lineHeight:`2.375rem`}},"4xl":{value:{fontSize:`4xl`,lineHeight:`2.75rem`,letterSpacing:`-0.025em`}},"5xl":{value:{fontSize:`5xl`,lineHeight:`3.75rem`,letterSpacing:`-0.025em`}},"6xl":{value:{fontSize:`6xl`,lineHeight:`4.5rem`,letterSpacing:`-0.025em`}},"7xl":{value:{fontSize:`7xl`,lineHeight:`5.75rem`,letterSpacing:`-0.025em`}},none:{value:{}},label:{value:{fontSize:`sm`,lineHeight:`1.25rem`,fontWeight:`medium`}}}),nw=ty.animations({spin:{value:`spin 1s linear infinite`},ping:{value:`ping 1s cubic-bezier(0, 0, 0.2, 1) infinite`},pulse:{value:`pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite`},bounce:{value:`bounce 1s infinite`}}),rw=ty.aspectRatios({square:{value:`1 / 1`},landscape:{value:`4 / 3`},portrait:{value:`3 / 4`},wide:{value:`16 / 9`},ultrawide:{value:`18 / 5`},golden:{value:`1.618 / 1`}}),iw=ty.blurs({none:{value:` `},sm:{value:`4px`},md:{value:`8px`},lg:{value:`12px`},xl:{value:`16px`},"2xl":{value:`24px`},"3xl":{value:`40px`},"4xl":{value:`64px`}}),aw=ty.borders({xs:{value:`0.5px solid`},sm:{value:`1px solid`},md:{value:`2px solid`},lg:{value:`4px solid`},xl:{value:`8px solid`}}),ow=ty.colors({transparent:{value:`transparent`},current:{value:`currentColor`},black:{value:`#09090B`},white:{value:`#FFFFFF`},whiteAlpha:{50:{value:`rgba(255, 255, 255, 0.04)`},100:{value:`rgba(255, 255, 255, 0.06)`},200:{value:`rgba(255, 255, 255, 0.08)`},300:{value:`rgba(255, 255, 255, 0.16)`},400:{value:`rgba(255, 255, 255, 0.24)`},500:{value:`rgba(255, 255, 255, 0.36)`},600:{value:`rgba(255, 255, 255, 0.48)`},700:{value:`rgba(255, 255, 255, 0.64)`},800:{value:`rgba(255, 255, 255, 0.80)`},900:{value:`rgba(255, 255, 255, 0.92)`},950:{value:`rgba(255, 255, 255, 0.95)`}},blackAlpha:{50:{value:`rgba(0, 0, 0, 0.04)`},100:{value:`rgba(0, 0, 0, 0.06)`},200:{value:`rgba(0, 0, 0, 0.08)`},300:{value:`rgba(0, 0, 0, 0.16)`},400:{value:`rgba(0, 0, 0, 0.24)`},500:{value:`rgba(0, 0, 0, 0.36)`},600:{value:`rgba(0, 0, 0, 0.48)`},700:{value:`rgba(0, 0, 0, 0.64)`},800:{value:`rgba(0, 0, 0, 0.80)`},900:{value:`rgba(0, 0, 0, 0.92)`},950:{value:`rgba(0, 0, 0, 0.95)`}},gray:{50:{value:`#fafafa`},100:{value:`#f4f4f5`},200:{value:`#e4e4e7`},300:{value:`#d4d4d8`},400:{value:`#a1a1aa`},500:{value:`#71717a`},600:{value:`#52525b`},700:{value:`#3f3f46`},800:{value:`#27272a`},900:{value:`#18181b`},950:{value:`#111111`}},red:{50:{value:`#fef2f2`},100:{value:`#fee2e2`},200:{value:`#fecaca`},300:{value:`#fca5a5`},400:{value:`#f87171`},500:{value:`#ef4444`},600:{value:`#dc2626`},700:{value:`#991919`},800:{value:`#511111`},900:{value:`#300c0c`},950:{value:`#1f0808`}},orange:{50:{value:`#fff7ed`},100:{value:`#ffedd5`},200:{value:`#fed7aa`},300:{value:`#fdba74`},400:{value:`#fb923c`},500:{value:`#f97316`},600:{value:`#ea580c`},700:{value:`#92310a`},800:{value:`#6c2710`},900:{value:`#3b1106`},950:{value:`#220a04`}},yellow:{50:{value:`#fefce8`},100:{value:`#fef9c3`},200:{value:`#fef08a`},300:{value:`#fde047`},400:{value:`#facc15`},500:{value:`#eab308`},600:{value:`#ca8a04`},700:{value:`#845209`},800:{value:`#713f12`},900:{value:`#422006`},950:{value:`#281304`}},green:{50:{value:`#f0fdf4`},100:{value:`#dcfce7`},200:{value:`#bbf7d0`},300:{value:`#86efac`},400:{value:`#4ade80`},500:{value:`#22c55e`},600:{value:`#16a34a`},700:{value:`#116932`},800:{value:`#124a28`},900:{value:`#042713`},950:{value:`#03190c`}},teal:{50:{value:`#f0fdfa`},100:{value:`#ccfbf1`},200:{value:`#99f6e4`},300:{value:`#5eead4`},400:{value:`#2dd4bf`},500:{value:`#14b8a6`},600:{value:`#0d9488`},700:{value:`#0c5d56`},800:{value:`#114240`},900:{value:`#032726`},950:{value:`#021716`}},blue:{50:{value:`#eff6ff`},100:{value:`#dbeafe`},200:{value:`#bfdbfe`},300:{value:`#a3cfff`},400:{value:`#60a5fa`},500:{value:`#3b82f6`},600:{value:`#2563eb`},700:{value:`#173da6`},800:{value:`#1a3478`},900:{value:`#14204a`},950:{value:`#0c142e`}},cyan:{50:{value:`#ecfeff`},100:{value:`#cffafe`},200:{value:`#a5f3fc`},300:{value:`#67e8f9`},400:{value:`#22d3ee`},500:{value:`#06b6d4`},600:{value:`#0891b2`},700:{value:`#0c5c72`},800:{value:`#134152`},900:{value:`#072a38`},950:{value:`#051b24`}},purple:{50:{value:`#faf5ff`},100:{value:`#f3e8ff`},200:{value:`#e9d5ff`},300:{value:`#d8b4fe`},400:{value:`#c084fc`},500:{value:`#a855f7`},600:{value:`#9333ea`},700:{value:`#641ba3`},800:{value:`#4a1772`},900:{value:`#2f0553`},950:{value:`#1a032e`}},pink:{50:{value:`#fdf2f8`},100:{value:`#fce7f3`},200:{value:`#fbcfe8`},300:{value:`#f9a8d4`},400:{value:`#f472b6`},500:{value:`#ec4899`},600:{value:`#db2777`},700:{value:`#a41752`},800:{value:`#6d0e34`},900:{value:`#45061f`},950:{value:`#2c0514`}}}),sw=ty.cursor({button:{value:`pointer`},checkbox:{value:`default`},disabled:{value:`not-allowed`},menuitem:{value:`default`},option:{value:`default`},radio:{value:`default`},slider:{value:`default`},switch:{value:`pointer`}}),cw=ty.durations({fastest:{value:`50ms`},faster:{value:`100ms`},fast:{value:`150ms`},moderate:{value:`200ms`},slow:{value:`300ms`},slower:{value:`400ms`},slowest:{value:`500ms`}}),lw=ty.easings({"ease-in":{value:`cubic-bezier(0.42, 0, 1, 1)`},"ease-out":{value:`cubic-bezier(0, 0, 0.58, 1)`},"ease-in-out":{value:`cubic-bezier(0.42, 0, 0.58, 1)`},"ease-in-smooth":{value:`cubic-bezier(0.32, 0.72, 0, 1)`}}),uw=ty.fontSizes({"2xs":{value:`0.625rem`},xs:{value:`0.75rem`},sm:{value:`0.875rem`},md:{value:`1rem`},lg:{value:`1.125rem`},xl:{value:`1.25rem`},"2xl":{value:`1.5rem`},"3xl":{value:`1.875rem`},"4xl":{value:`2.25rem`},"5xl":{value:`3rem`},"6xl":{value:`3.75rem`},"7xl":{value:`4.5rem`},"8xl":{value:`6rem`},"9xl":{value:`8rem`}}),dw=ty.fontWeights({thin:{value:`100`},extralight:{value:`200`},light:{value:`300`},normal:{value:`400`},medium:{value:`500`},semibold:{value:`600`},bold:{value:`700`},extrabold:{value:`800`},black:{value:`900`}}),fw=`-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"`,pw=ty.fonts({heading:{value:`Inter, ${fw}`},body:{value:`Inter, ${fw}`},mono:{value:`SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace`}}),mw=Jv({spin:{"0%":{transform:`rotate(0deg)`},"100%":{transform:`rotate(360deg)`}},pulse:{"50%":{opacity:`0.5`}},ping:{"75%, 100%":{transform:`scale(2)`,opacity:`0`}},bounce:{"0%, 100%":{transform:`translateY(-25%)`,animationTimingFunction:`cubic-bezier(0.8,0,1,1)`},"50%":{transform:`none`,animationTimingFunction:`cubic-bezier(0,0,0.2,1)`}},"bg-position":{from:{backgroundPosition:`var(--animate-from, 1rem) 0`},to:{backgroundPosition:`var(--animate-to, 0) 0`}},position:{from:{insetInlineStart:`var(--animate-from-x)`,insetBlockStart:`var(--animate-from-y)`},to:{insetInlineStart:`var(--animate-to-x)`,insetBlockStart:`var(--animate-to-y)`}},"circular-progress":{"0%":{strokeDasharray:`1, 400`,strokeDashoffset:`0`},"50%":{strokeDasharray:`400, 400`,strokeDashoffset:`-100%`},"100%":{strokeDasharray:`400, 400`,strokeDashoffset:`-260%`}},"expand-height":{from:{height:`var(--collapsed-height, 0)`},to:{height:`var(--height)`}},"collapse-height":{from:{height:`var(--height)`},to:{height:`var(--collapsed-height, 0)`}},"expand-width":{from:{width:`var(--collapsed-width, 0)`},to:{width:`var(--width)`}},"collapse-width":{from:{width:`var(--width)`},to:{width:`var(--collapsed-width, 0)`}},"fade-in":{from:{opacity:0},to:{opacity:1}},"fade-out":{from:{opacity:1},to:{opacity:0}},"slide-from-left-full":{from:{translate:`-100% 0`},to:{translate:`0 0`}},"slide-from-right-full":{from:{translate:`100% 0`},to:{translate:`0 0`}},"slide-from-top-full":{from:{translate:`0 -100%`},to:{translate:`0 0`}},"slide-from-bottom-full":{from:{translate:`0 100%`},to:{translate:`0 0`}},"slide-to-left-full":{from:{translate:`0 0`},to:{translate:`-100% 0`}},"slide-to-right-full":{from:{translate:`0 0`},to:{translate:`100% 0`}},"slide-to-top-full":{from:{translate:`0 0`},to:{translate:`0 -100%`}},"slide-to-bottom-full":{from:{translate:`0 0`},to:{translate:`0 100%`}},"slide-from-top":{"0%":{translate:`0 calc(var(--slide-from-top-distance, 0.5rem) * -1)`},to:{translate:`0`}},"slide-from-bottom":{"0%":{translate:`0 var(--slide-from-bottom-distance, 0.5rem)`},to:{translate:`0`}},"slide-from-left":{"0%":{translate:`calc(var(--slide-from-left-distance, 0.5rem) * -1) 0`},to:{translate:`0`}},"slide-from-right":{"0%":{translate:`var(--slide-from-right-distance, 0.5rem) 0`},to:{translate:`0`}},"slide-to-top":{"0%":{translate:`0`},to:{translate:`0 calc(var(--slide-to-top-distance, 0.5rem) * -1)`}},"slide-to-bottom":{"0%":{translate:`0`},to:{translate:`0 var(--slide-to-bottom-distance, 0.5rem)`}},"slide-to-left":{"0%":{translate:`0`},to:{translate:`calc(var(--slide-to-left-distance, 0.5rem) * -1) 0`}},"slide-to-right":{"0%":{translate:`0`},to:{translate:`var(--slide-to-right-distance, 0.5rem) 0`}},"scale-in":{from:{scale:`0.95`},to:{scale:`1`}},"scale-out":{from:{scale:`1`},to:{scale:`0.95`}},marqueeX:{from:{transform:`translateX(0%)`},to:{transform:`translateX(var(--marquee-translate))`}},marqueeY:{from:{transform:`translateY(0%)`},to:{transform:`translateY(var(--marquee-translate))`}}}),hw=ty.letterSpacings({tighter:{value:`-0.05em`},tight:{value:`-0.025em`},wide:{value:`0.025em`},wider:{value:`0.05em`},widest:{value:`0.1em`}}),gw=ty.lineHeights({shorter:{value:1.25},short:{value:1.375},moderate:{value:1.5},tall:{value:1.625},taller:{value:2}}),_w=ty.radii({none:{value:`0`},"2xs":{value:`0.0625rem`},xs:{value:`0.125rem`},sm:{value:`0.25rem`},md:{value:`0.375rem`},lg:{value:`0.5rem`},xl:{value:`0.75rem`},"2xl":{value:`1rem`},"3xl":{value:`1.5rem`},"4xl":{value:`2rem`},full:{value:`9999px`}}),vw=ty.spacing({.5:{value:`0.125rem`},1:{value:`0.25rem`},1.5:{value:`0.375rem`},2:{value:`0.5rem`},2.5:{value:`0.625rem`},3:{value:`0.75rem`},3.5:{value:`0.875rem`},4:{value:`1rem`},4.5:{value:`1.125rem`},5:{value:`1.25rem`},6:{value:`1.5rem`},7:{value:`1.75rem`},8:{value:`2rem`},9:{value:`2.25rem`},10:{value:`2.5rem`},11:{value:`2.75rem`},12:{value:`3rem`},14:{value:`3.5rem`},16:{value:`4rem`},20:{value:`5rem`},24:{value:`6rem`},28:{value:`7rem`},32:{value:`8rem`},36:{value:`9rem`},40:{value:`10rem`},44:{value:`11rem`},48:{value:`12rem`},52:{value:`13rem`},56:{value:`14rem`},60:{value:`15rem`},64:{value:`16rem`},72:{value:`18rem`},80:{value:`20rem`},96:{value:`24rem`}}),yw=ty.sizes({"3xs":{value:`14rem`},"2xs":{value:`16rem`},xs:{value:`20rem`},sm:{value:`24rem`},md:{value:`28rem`},lg:{value:`32rem`},xl:{value:`36rem`},"2xl":{value:`42rem`},"3xl":{value:`48rem`},"4xl":{value:`56rem`},"5xl":{value:`64rem`},"6xl":{value:`72rem`},"7xl":{value:`80rem`},"8xl":{value:`90rem`}}),bw=ty.sizes({max:{value:`max-content`},min:{value:`min-content`},fit:{value:`fit-content`},prose:{value:`60ch`},full:{value:`100%`},dvh:{value:`100dvh`},svh:{value:`100svh`},lvh:{value:`100lvh`},dvw:{value:`100dvw`},svw:{value:`100svw`},lvw:{value:`100lvw`},vw:{value:`100vw`},vh:{value:`100vh`}}),xw=ty.sizes({"1/2":{value:`50%`},"1/3":{value:`33.333333%`},"2/3":{value:`66.666667%`},"1/4":{value:`25%`},"3/4":{value:`75%`},"1/5":{value:`20%`},"2/5":{value:`40%`},"3/5":{value:`60%`},"4/5":{value:`80%`},"1/6":{value:`16.666667%`},"2/6":{value:`33.333333%`},"3/6":{value:`50%`},"4/6":{value:`66.666667%`},"5/6":{value:`83.333333%`},"1/12":{value:`8.333333%`},"2/12":{value:`16.666667%`},"3/12":{value:`25%`},"4/12":{value:`33.333333%`},"5/12":{value:`41.666667%`},"6/12":{value:`50%`},"7/12":{value:`58.333333%`},"8/12":{value:`66.666667%`},"9/12":{value:`75%`},"10/12":{value:`83.333333%`},"11/12":{value:`91.666667%`}}),Sw=Tx(Gv(yy,ry({preflight:!0,cssVarsPrefix:`chakra`,cssVarsRoot:`:where(html, .chakra-theme)`,globalCss:Nx,theme:{breakpoints:jx,keyframes:mw,tokens:{aspectRatios:rw,animations:nw,blurs:iw,borders:aw,colors:ow,durations:cw,easings:lw,fonts:pw,fontSizes:uw,fontWeights:dw,letterSpacings:hw,lineHeights:gw,radii:_w,spacing:vw,sizes:ty.sizes({...yw,...vw,...xw,...bw}),zIndex:ty.zIndex({hide:{value:-1},base:{value:0},docked:{value:10},dropdown:{value:1e3},sticky:{value:1100},banner:{value:1200},overlay:{value:1300},modal:{value:1400},popover:{value:1500},skipNav:{value:1600},toast:{value:1700},tooltip:{value:1800},max:{value:2147483647}}),cursor:sw},semanticTokens:{colors:$x,shadows:tS,radii:eS},recipes:Qx,slotRecipes:ew,textStyles:tw,layerStyles:Px,animationStyles:Fx}}))),Cw=yn(`div`,{base:{position:`absolute`,display:`flex`,alignItems:`center`,justifyContent:`center`},variants:{axis:{horizontal:{insetStart:`50%`,translate:`-50%`,_rtl:{translate:`50%`}},vertical:{top:`50%`,translate:`0 -50%`},both:{insetStart:`50%`,top:`50%`,translate:`-50% -50%`,_rtl:{translate:`50% -50%`}}}},defaultVariants:{axis:`both`}});Cw.displayName=`AbsoluteCenter`;var ww=e=>(0,F.jsx)(yn.svg,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,...e,children:(0,F.jsx)(`path`,{d:`M20 6 9 17l-5-5`})}),Tw=e=>(0,F.jsx)(yn.svg,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,...e,children:(0,F.jsx)(`path`,{d:`m6 9 6 6 6-6`})}),Ew=e=>(0,F.jsx)(yn.svg,{viewBox:`0 0 24 24`,fill:`currentColor`,...e,children:(0,F.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M18.7071 6.70711C19.0976 6.31658 19.0976 5.68342 18.7071 5.29289C18.3166 4.90237 17.6834 4.90237 17.2929 5.29289L12 10.5858L6.70711 5.29289C6.31658 4.90237 5.68342 4.90237 5.29289 5.29289C4.90237 5.68342 4.90237 6.31658 5.29289 6.70711L10.5858 12L5.29289 17.2929C4.90237 17.6834 4.90237 18.3166 5.29289 18.7071C5.68342 19.0976 6.31658 19.0976 6.70711 18.7071L12 13.4142L17.2929 18.7071C17.6834 19.0976 18.3166 19.0976 18.7071 18.7071C19.0976 18.3166 19.0976 17.6834 18.7071 17.2929L13.4142 12L18.7071 6.70711Z`})}),{PropsProvider:Dw,withContext:Ow}=On({key:`badge`}),kw=Ow(`span`),{withContext:Aw,PropsProvider:jw}=On({key:`spinner`}),Mw=Aw(`span`),Nw=P.forwardRef(function(e,t){let{spinner:n=(0,F.jsx)(Mw,{size:`inherit`,borderWidth:`0.125em`,color:`inherit`}),spinnerPlacement:r=`start`,children:i,text:a,visible:o=!0,...s}=e;return o?a?(0,F.jsxs)(Ks,{ref:t,display:`contents`,...s,children:[r===`start`&&n,a,r===`end`&&n]}):n?(0,F.jsxs)(Ks,{ref:t,display:`contents`,...s,children:[(0,F.jsx)(Cw,{display:`inline-flex`,children:n}),(0,F.jsx)(Ks,{visibility:`hidden`,display:`contents`,children:i})]}):(0,F.jsx)(Ks,{ref:t,display:`contents`,...s,children:i}):i});Nw.displayName=`Loader`;var{useRecipeResult:Pw,PropsProvider:Fw,usePropsContext:Iw}=On({key:`button`}),Lw=(0,P.forwardRef)(function(e,t){let n=Iw(),r=(0,P.useMemo)(()=>Bt(n,e),[n,e]),i=Pw(r),{loading:a,loadingText:o,children:s,spinner:c,spinnerPlacement:l,...u}=i.props;return(0,F.jsx)(yn.button,{type:`button`,ref:t,...u,"data-loading":R(a),disabled:a||u.disabled,className:Jt(i.className,r.className),css:[i.styles,r.css],children:!r.asChild&&a?(0,F.jsx)(Nw,{spinner:c,text:o,spinnerPlacement:l,children:s}):s})});Lw.displayName=`Button`;var Rw=(0,P.forwardRef)(function(e,t){let n=Dn({key:`checkmark`,recipe:e.recipe}),[r,i]=n.splitVariantProps(e),{checked:a,indeterminate:o,disabled:s,unstyled:c,children:l,css:u,...d}=i,f=c?Tn:n(r);return(0,F.jsx)(yn.svg,{ref:t,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`3px`,strokeLinecap:`round`,strokeLinejoin:`round`,"data-state":o?`indeterminate`:a?`checked`:`unchecked`,"data-disabled":R(s),css:[f,u],...d,children:o?(0,F.jsx)(`path`,{d:`M5 12h14`}):a?(0,F.jsx)(`polyline`,{points:`20 6 9 17 4 12`}):null})});Rw.displayName=`Checkmark`;var{withProvider:zw,withContext:Bw,useStyles:Vw,PropsProvider:Hw}=Fc({key:`checkbox`});zw(s_.RootProvider,`root`,{forwardAsChild:!0});var Uw=zw(s_.Root,`root`,{forwardAsChild:!0}),Ww=Bw(s_.Label,`label`,{forwardAsChild:!0}),Gw=(0,P.forwardRef)(function(e,t){let{checked:n,indeterminate:r,...i}=e,a=Cg(),o=Vw();return n&&a.checked?(0,F.jsx)(yn.svg,{ref:t,asChild:!0,...i,css:[o.indicator,e.css],children:n}):r&&a.indeterminate?(0,F.jsx)(yn.svg,{ref:t,asChild:!0,...i,css:[o.indicator,e.css],children:r}):(0,F.jsx)(Rw,{ref:t,checked:a.checked,indeterminate:a.indeterminate,disabled:a.disabled,unstyled:!0,...i,css:[o.indicator,e.css]})}),Kw=Bw(s_.Control,`control`,{forwardAsChild:!0,defaultProps:{children:(0,F.jsx)(Gw,{})}});yn(s_.Group,{base:{display:`flex`,flexDirection:`column`,gap:`1.5`}},{forwardAsChild:!0}),s_.Context;var qw=s_.HiddenInput,Jw=(0,P.forwardRef)(function(e,t){return(0,F.jsx)(Lw,{px:`0`,py:`0`,_icon:{fontSize:`1.2em`},ref:t,...e})});Jw.displayName=`IconButton`;var Yw=P.forwardRef(function(e,t){return(0,F.jsx)(Jw,{variant:`ghost`,"aria-label":`Close`,ref:t,...e,children:e.children??(0,F.jsx)(Ew,{})})});Yw.displayName=`CloseButton`;function Xw(e){let{gap:t,direction:n}=e,r={column:{marginY:t,marginX:0,borderInlineStartWidth:0,borderTopWidth:`1px`},"column-reverse":{marginY:t,marginX:0,borderInlineStartWidth:0,borderTopWidth:`1px`},row:{marginX:t,marginY:0,borderInlineStartWidth:`1px`,borderTopWidth:0},"row-reverse":{marginX:t,marginY:0,borderInlineStartWidth:`1px`,borderTopWidth:0}};return{"&":Hv(n,e=>r[e])}}function Zw(e){return P.Children.toArray(e).filter(e=>(0,P.isValidElement)(e))}var Qw=(0,P.forwardRef)(function(e,t){let{direction:n=`column`,align:r,justify:i,gap:a=`0.5rem`,wrap:o,children:s,separator:c,className:l,...u}=e,d=(0,P.useMemo)(()=>Xw({gap:a,direction:n}),[a,n]),f=(0,P.useMemo)(()=>(0,P.isValidElement)(c)?Zw(s).map((e,t,n)=>{let r=e.key===void 0?t:e.key,i=c,a=(0,P.cloneElement)(i,{css:[d,i.props.css]});return(0,F.jsxs)(P.Fragment,{children:[e,t===n.length-1?null:a]},r)}):s,[s,c,d]);return(0,F.jsx)(yn.div,{ref:t,display:`flex`,alignItems:r,justifyContent:i,flexDirection:n,flexWrap:o,gap:c?void 0:a,className:Jt(`chakra-stack`,l),...u,children:f})});Qw.displayName=`Stack`;var{withRootProvider:$w,withContext:eT,useStyles:tT,PropsProvider:nT}=Fc({key:`dialog`});$w(C_.RootProvider,{defaultProps:{unmountOnExit:!0,lazyMount:!0}});var rT=$w(C_.Root,{defaultProps:{unmountOnExit:!0,lazyMount:!0}}),iT=eT(C_.Trigger,`trigger`,{forwardAsChild:!0}),aT=eT(C_.Positioner,`positioner`,{forwardAsChild:!0}),oT=eT(C_.Content,`content`,{forwardAsChild:!0});eT(C_.Description,`description`,{forwardAsChild:!0});var sT=eT(C_.Title,`title`,{forwardAsChild:!0}),cT=eT(C_.CloseTrigger,`closeTrigger`,{forwardAsChild:!0});(0,P.forwardRef)(function(e,t){let n=u_();return(0,F.jsx)(yn.button,{type:`button`,...e,ref:t,onClick:t=>{e.onClick?.(t),n.setOpen(!1)}})});var lT=eT(C_.Backdrop,`backdrop`,{forwardAsChild:!0}),uT=eT(`div`,`body`);eT(`div`,`footer`);var dT=eT(`div`,`header`);C_.Context;var{useRecipeResult:fT,PropsProvider:pT}=On({key:`icon`}),mT=P.forwardRef(function(e,t){let{styles:n,className:r,props:i}=fT({asChild:!e.as,...e});return(0,F.jsx)(yn.svg,{ref:t,focusable:!1,"aria-hidden":`true`,...i,css:[n,e.css],className:Jt(r,e.className)})});function hT(e){let{viewBox:t=`0 0 24 24`,d:n,displayName:r,defaultProps:i={}}=e,a=P.Children.toArray(e.path),o=(0,P.forwardRef)((e,r)=>(0,F.jsx)(mT,{ref:r,asChild:!1,viewBox:t,...i,...e,children:a.length?a:(0,F.jsx)(`path`,{fill:`currentColor`,d:n})}));return o.displayName=r,o}var{withProvider:gT,withContext:_T,useStyles:vT,useClassNames:yT,PropsProvider:bT}=Fc({key:`field`}),xT=gT(Qg.Root,`root`,{forwardAsChild:!0}),ST=_T(Qg.Label,`label`,{forwardAsChild:!0});_T(Qg.HelperText,`helperText`,{forwardAsChild:!0});var CT=_T(Qg.ErrorText,`errorText`,{forwardAsChild:!0});hT({d:`M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z`,defaultProps:{boxSize:`1em`}}),(0,P.forwardRef)(function(e,t){let{fallback:n,children:r=`*`,...i}=e,a=Lg(),o=yT(),s=vT();return a?.required?(0,F.jsx)(yn.span,{ref:t,"aria-hidden":`true`,...i,className:Jt(o.requiredIndicator,e.className),css:[s.requiredIndicator,e.css],children:r}):n});var K=(0,P.forwardRef)(function(e,t){return(0,F.jsx)(Qw,{align:`center`,...e,direction:`row`,ref:t})});K.displayName=`HStack`;var{withContext:wT,PropsProvider:TT}=On({key:`input`}),ET=wT(Qg.Input),[DT,OT]=$t({name:`NativeSelectBasePropsContext`,hookName:`useNativeSelectBaseProps`,providerName:`<NativeSelectRoot />`,strict:!1}),{withProvider:kT,useClassNames:AT,useStyles:jT,PropsProvider:MT}=Fc({key:`nativeSelect`}),NT=kT(`div`,`root`,{wrapElement(e,t){let n=Lg(),r=!!(n?.disabled??t.disabled),i=!!(n?.invalid??t.invalid);return(0,F.jsx)(DT,{value:{disabled:r,invalid:i},children:e})}}),PT=yn(Qg.Select,{},{forwardAsChild:!0}),FT=(0,P.forwardRef)(function(e,t){let{children:n,placeholder:r,unstyled:i,...a}=e,{disabled:o,invalid:s}=OT(),c=jT(),l=AT();return(0,F.jsxs)(PT,{disabled:o,"data-invalid":R(s),...a,ref:t,className:Jt(l.field,e.className),css:[i?void 0:c.field,e.css],children:[r&&(0,F.jsx)(`option`,{value:``,children:r}),n]})}),{withProvider:IT,withContext:LT,useStyles:RT,PropsProvider:zT}=Fc({key:`select`});IT(rv.RootProvider,`root`,{forwardAsChild:!0});var BT=IT(rv.Root,`root`,{forwardAsChild:!0,defaultProps:{positioning:{sameWidth:!0}}}),VT=LT(rv.Trigger,`trigger`,{forwardAsChild:!0}),HT=LT(rv.Positioner,`positioner`,{forwardAsChild:!0}),UT=LT(rv.Content,`content`,{forwardAsChild:!0});LT(rv.List,`list`,{forwardAsChild:!0});var WT=LT(rv.ValueText,`valueText`,{forwardAsChild:!0});LT(rv.ClearTrigger,`clearTrigger`,{forwardAsChild:!0,defaultProps:{children:(0,F.jsx)(Ew,{boxSize:`1em`})}}),LT(rv.ItemGroup,`itemGroup`,{forwardAsChild:!0}),LT(rv.ItemGroupLabel,`itemGroupLabel`,{forwardAsChild:!0});var GT=LT(rv.Item,`item`,{forwardAsChild:!0});LT(rv.ItemText,`itemText`,{forwardAsChild:!0}),LT(rv.ItemIndicator,`itemIndicator`,{forwardAsChild:!0,defaultProps:{children:(0,F.jsx)(ww,{})}}),LT(`div`,`indicatorGroup`),LT(rv.Indicator,`indicator`,{forwardAsChild:!0,defaultProps:{children:(0,F.jsx)(Tw,{})}});var KT=LT(rv.Control,`control`,{forwardAsChild:!0});LT(rv.Label,`label`,{forwardAsChild:!0}),rv.Context;var qT=rv.HiddenSelect;rv.ItemContext;var{withProvider:JT,withContext:YT,useStyles:XT,PropsProvider:ZT}=Fc({key:`splitter`});JT(bv.RootProvider,`root`,{forwardAsChild:!0});var QT=JT(bv.Root,`root`,{forwardAsChild:!0}),$T=YT(bv.Panel,`panel`,{forwardAsChild:!0}),eE=YT(`div`,`resizeTriggerSeparator`),tE=YT(bv.ResizeTriggerIndicator,`resizeTriggerIndicator`),nE=YT(bv.ResizeTrigger,`resizeTrigger`,{forwardAsChild:!0,defaultProps:{"aria-label":`Resize`,children:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(eE,{}),(0,F.jsx)(tE,{})]})}});bv.Context;var{withProvider:rE,withContext:iE,useStyles:aE,PropsProvider:oE}=Fc({key:`switch`});rE(Nv.RootProvider,`root`,{forwardAsChild:!0});var sE=rE(Nv.Root,`root`,{forwardAsChild:!0}),cE=iE(Nv.Label,`label`,{forwardAsChild:!0}),lE=iE(Nv.Thumb,`thumb`,{forwardAsChild:!0}),uE=iE(Nv.Control,`control`,{forwardAsChild:!0,defaultProps:{children:(0,F.jsx)(lE,{})}});(0,P.forwardRef)(function(e,t){let n=Sv(),r=aE(),{fallback:i,children:a,unstyled:o,...s}=e;return(0,F.jsx)(yn.span,{ref:t,"data-checked":R(n.checked),...s,css:[o?void 0:r.indicator,e.css],children:n.checked?a:i})}),(0,P.forwardRef)(function(e,t){let n=Sv(),{fallback:r,children:i,...a}=e;return(0,F.jsx)(yn.span,{ref:t,"data-checked":R(n.checked),...a,children:n.checked?i:r})}),Nv.Context;var dE=Nv.HiddenInput,{StylesProvider:fE,ClassNamesProvider:pE,useRecipeResult:mE,withContext:hE,useStyles:gE,PropsProvider:_E}=Fc({key:`table`}),vE=(0,P.forwardRef)(function({native:e,...t},n){let{styles:r,props:i,classNames:a}=mE(t),o=(0,P.useMemo)(()=>e?{...r.root,"& thead":r.header,"& tbody":r.body,"& tfoot":r.footer,"& thead th":r.columnHeader,"& tr":r.row,"& td":r.cell,"& caption":r.caption}:r.root,[r,e]);return(0,F.jsx)(pE,{value:a,children:(0,F.jsx)(fE,{value:r,children:(0,F.jsx)(yn.table,{ref:n,...i,css:[o,t.css],className:Jt(a?.root,t.className)})})})}),yE=hE(`tr`,`row`),bE=yn(`div`,{base:{display:`block`,whiteSpace:`nowrap`,WebkitOverflowScrolling:`touch`,overflow:`auto`,maxWidth:`100%`}}),xE=hE(`thead`,`header`);hE(`tfoot`,`footer`);var SE=hE(`th`,`columnHeader`),CE=hE(`td`,`cell`);hE(`caption`,`caption`,{defaultProps:{captionSide:`bottom`}});var wE=hE(`tbody`,`body`);hE(`colgroup`),hE(`col`);var{withContext:TE,PropsProvider:EE}=On({key:`textarea`}),DE=TE(Qg.Textarea),OE=(0,P.forwardRef)(function(e,t){return(0,F.jsx)(Qw,{align:`center`,...e,direction:`column`,ref:t})});OE.displayName=`VStack`;var kE=P.createContext(void 0),AE=e=>{let t=P.useContext(kE);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},jE=({client:e,children:t})=>(P.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,F.jsx)(kE.Provider,{value:e,children:t})),ME={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},NE=new class{#e=ME;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function PE(e){setTimeout(e,0)}var FE=typeof window>`u`||`Deno`in globalThis;function IE(){}function LE(e,t){return typeof e==`function`?e(t):e}function RE(e){return typeof e==`number`&&e>=0&&e!==1/0}function zE(e,t){return Math.max(e+(t||0)-Date.now(),0)}function BE(e,t){return typeof e==`function`?e(t):e}function VE(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==UE(o,t.options))return!1}else if(!GE(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function HE(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(WE(t.options.mutationKey)!==WE(a))return!1}else if(!GE(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function UE(e,t){return(t?.queryKeyHashFn||WE)(e)}function WE(e){return JSON.stringify(e,(e,t)=>XE(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function GE(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(!GE(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!GE(e[r],t[r]))return!1;return!0}return!1}var KE=Object.prototype.hasOwnProperty;function qE(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=YE(e)&&YE(t);if(!r&&!(XE(e)&&XE(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:KE.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=qE(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function JE(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function YE(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function XE(e){if(!ZE(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!ZE(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function ZE(e){return Object.prototype.toString.call(e)===`[object Object]`}function QE(e){return new Promise(t=>{NE.setTimeout(t,e)})}function $E(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:qE(e,t)}function eD(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function tD(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var nD=Symbol();function rD(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===nD?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function iD(e,t){return typeof e==`function`?e(...t):!!e}function aD(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var oD=()=>FE,sD=()=>oD(),cD=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},lD=new class extends cD{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},uD=PE;function dD(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=uD,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var fD=dD(),pD=new class extends cD{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function mD(e){return Math.min(1e3*2**e,3e4)}function hD(e){return(e??`online`)!==`online`||pD.isOnline()}var gD=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function _D(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(IE);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new gD(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>lD.isFocused()&&(e.networkMode===`always`||pD.isOnline())&&e.canRun(),p=()=>hD(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(sD()?0:3),a=e.retryDelay??mD,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!s){h(r);return}n++,e.onFail?.(n,r),QE(o).then(()=>f()?void 0:g()).then(()=>{t?h(r):_()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g().then(_),s)}}var vD=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),RE(this.gcTime)&&(this.#e=NE.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(sD()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(NE.clearTimeout(this.#e),this.#e=void 0)}};function yD(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{aD(e,()=>t.signal,()=>n=!0)},u=rD(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?tD:eD;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?xD:bD,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:bD(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function bD(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function xD(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var SD=class extends vD{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=TD(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=TD(this.options);e.data!==void 0&&(this.setState(wD(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=$E(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(IE).catch(IE):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>BE(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===nD||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>BE(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!zE(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=rD(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?yD(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=_D({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof gD&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof gD){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...CD(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...wD(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),fD.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function CD(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:hD(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function wD(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function TD(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var ED=class extends cD{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),OD(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return kD(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return kD(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof BE(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!JE(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&AD(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||BE(this.options.enabled,this.#t)!==BE(t.enabled,this.#t)||BE(this.options.staleTime,this.#t)!==BE(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||BE(this.options.enabled,this.#t)!==BE(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return JE(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(IE)),t}#h(e){return!sD()&&BE(this.options.enabled,this.#t)!==!1&&RE(e)}#g(){this.#b();let e=BE(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=zE(this.#r.dataUpdatedAt,e)+1;this.#u=NE.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return BE(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=NE.setInterval(()=>{(this.options.refetchIntervalInBackground||lD.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(NE.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(NE.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&OD(e,t),o=i&&AD(e,n,t,r);(a||o)&&(l={...l,...CD(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=$E(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=$E(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:jD(e,t),refetch:this.refetch,isEnabled:BE(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),JE(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();fD.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function DD(e,t){return BE(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||BE(t.retryOnMount,e)!==!1)}function OD(e,t){return DD(e,t)||e.state.data!==void 0&&kD(e,t,t.refetchOnMount)}function kD(e,t,n){if(BE(t.enabled,e)!==!1&&BE(t.staleTime,e)!==`static`){let r=BE(n,e);return r===`always`||r!==!1&&jD(e,t)}return!1}function AD(e,t,n,r){return(e!==t||BE(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&jD(e,n)}function jD(e,t){return BE(t.enabled,e)!==!1&&e.isStaleByTime(BE(t.staleTime,e))}var MD=class extends vD{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||ND(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=_D({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),fD.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function ND(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var PD=class extends cD{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new MD({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=FD(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=FD(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=FD(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=FD(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){fD.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>HE(t,e))}findAll(e={}){return this.getAll().filter(t=>HE(e,t))}notify(e){fD.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return fD.batch(()=>Promise.all(e.map(e=>e.continue().catch(IE))))}};function FD(e){return e.options.scope?.id}var ID=class extends cD{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),JE(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&WE(t.mutationKey)!==WE(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??ND();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){fD.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},LD=class extends cD{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??UE(r,t),a=this.get(i);return a||(a=new SD({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){fD.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>VE(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>VE(e,t)):t}notify(e){fD.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){fD.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){fD.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},RD=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new LD,this.#t=e.mutationCache||new PD,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=lD.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=pD.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(BE(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=LE(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return fD.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;fD.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return fD.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=fD.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(IE).catch(IE)}invalidateQueries(e,t={}){return fD.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=fD.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(IE)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(IE)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(BE(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(BE(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(IE).catch(IE)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(IE).catch(IE)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return pD.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(WE(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{GE(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(WE(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{GE(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=UE(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===nD&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},zD=P.createContext(!1),BD=()=>P.useContext(zD);zD.Provider;function VD(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var HD=P.createContext(VD()),UD=()=>P.useContext(HD),WD=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?iD(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},GD=e=>{P.useEffect(()=>{e.clearReset()},[e])},KD=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||iD(n,[e.error,r])),qD=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},JD=(e,t)=>e?.suspense&&t.isPending,YD=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function XD(e,t,n){let r=BD(),i=UD(),a=AE(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,qD(o),WD(o,i,s),GD(i);let[l]=P.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(P.useSyncExternalStore(P.useCallback(e=>{let t=d?l.subscribe(fD.batchCalls(e)):IE;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),P.useEffect(()=>{l.setOptions(o)},[o,l]),JD(o,u))throw YD(o,l,i);if(KD({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function ZD(e,t){return XD(e,ED,t)}function QD(e,t){let n=AE(t),[r]=P.useState(()=>new ID(n,e));P.useEffect(()=>{r.setOptions(e)},[r,e]);let i=P.useSyncExternalStore(P.useCallback(e=>r.subscribe(fD.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=P.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(IE)},[r]);if(i.error&&iD(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function $D(e,t){let n=new Set;for(let t of e)eO(t,n);let r=new Map;return t.map(e=>{let t=new Set;eO(e,t);let i=new Map;for(let e of t){if(!n.has(e))continue;let r=2;for(;n.has(`${e}_${r}`)||t.has(`${e}_${r}`);)r++;i.set(e,`${e}_${r}`)}for(let[e,t]of i)r.set(e,t);let a=i.size===0&&r.size===0?e:tO(e,i,r);return eO(a,n),a})}function eO(e,t){for(let n of[`id`,`as`]){let r=e.step[n];typeof r==`string`&&t.add(r)}if(e.kind===`bracket`){for(let n of e.children)eO(n,t);let n=e.elseChildren??[];for(let e of n)eO(e,t)}}function tO(e,t,n){let r={...e.step};for(let e of[`id`,`as`]){let n=r[e];typeof n==`string`&&t.has(n)&&(r[e]=t.get(n))}for(let e of[`over`,`from`]){let t=r[e];typeof t==`string`&&n.has(t)&&(r[e]=n.get(t))}return e.kind===`card`?{...e,step:r}:{...e,step:r,children:e.children.map(e=>tO(e,t,n)),...e.elseChildren!==void 0&&{elseChildren:e.elseChildren.map(e=>tO(e,t,n))}}}var nO=`value`,rO=`items`,iO=`item`;function aO(e,t,n=nO){return{kind:`card`,path:t,stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:n,selector:e.selector,kind:`css`,...e.take!==`text`&&{take:e.take}}}}function oO(e,t,n={}){let r=n.id??nO,i=e.jsonpath===void 0?`xpath`:`jsonpath`,a=e.jsonpath??e.xpath;if(a===void 0)throw Error(`documentReadCardNode: the node has neither a jsonpath nor an xpath`);if(n.generalize===!0&&e.listPath===void 0)throw Error(`documentReadCardNode: this node has no list to generalise to (it is not part of an array or a repeated sibling group)`);let o=n.generalize===!0?e.listPath:a,s=i===`xpath`&&n.namespaces!==void 0&&Object.keys(n.namespaces).length>0?n.namespaces:void 0;return{kind:`card`,path:t,stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:r,selector:o,kind:i,...n.generalize===!0&&{many:!0},...s!==void 0&&{namespaces:s}}}}function sO(e,t){if(e.jsonpath===void 0)throw Error(`paginateFromNextNode: pagination reads a JSON/YAML "next" value (node.jsonpath)`);return{kind:`bracket`,path:t,stepType:`paginate`,sentence:[],children:[],step:{type:`paginate`,next:{jsonpath:e.jsonpath},steps:[]}}}function cO(e,t,n={}){let r=n.itemsId??rO,i=n.itemAlias??iO,a=n.fieldId??nO,o=_O(t);return[{kind:`card`,path:t,stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:r,selector:e.item.selector,kind:`css`,take:`html`,many:!0}},{kind:`bracket`,path:o,stepType:`forEach`,sentence:[],children:[{kind:`card`,path:`${o}.steps.0`,stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:a,from:i,selector:e.field.selector,kind:`css`,...e.field.take!==`text`&&{take:e.field.take}}}],step:{type:`forEach`,over:r,as:i,emit:!0,steps:[]}}]}function lO(e){if(e.jsonpath===void 0||e.listPath===void 0)return;let t=e.listPath.lastIndexOf(`[*]`);if(t===-1)return;let n=e.listPath.slice(t+3);return{items:e.listPath.slice(0,t+3),field:n===``?`$`:`$${n}`}}function uO(e,t,n,r){return{kind:`card`,path:t,stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:r,from:n,selector:e,kind:`jsonpath`,take:`json`}}}function dO(e,t){let n=lO(e);if(n===void 0)return;let r=_O(t);return[{kind:`card`,path:t,stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:rO,selector:n.items,kind:`jsonpath`,take:`json`,many:!0}},{kind:`bracket`,path:r,stepType:`forEach`,sentence:[],children:[uO(n.field,`${r}.steps.0`,iO,nO)],step:{type:`forEach`,over:rO,as:iO,emit:!0,steps:[]}}]}function fO(e,t){let n=lO(t);if(n===void 0)return;let r=e.find(e=>e.kind===`card`&&e.step.type===`extract`&&e.step.kind===`jsonpath`&&e.step.selector===n.items&&e.step.many===!0),i=e.findIndex(e=>e.kind===`bracket`&&e.stepType===`forEach`&&e.step.over===r?.step.id),a=e[i];if(r===void 0||a?.kind!==`bracket`)return;let[o]=$D(e,[uO(n.field,`${a.path}.steps.${a.children.length}`,String(a.step.as),nO)]);return e.map((e,t)=>t===i?{...a,children:[...a.children,o]}:e).map((e,t)=>gO(e,`steps.${t}`))}function pO(e){let t=e[e.length-1];return t?.kind===`card`&&t.stepType===`emit`?e.length-1:e.length}function mO(e,t,n){let r=$D(t===void 0?e:e.filter((e,n)=>n!==t),n),i=pO(e),a=t===void 0?[...e.slice(0,i),...r,...e.slice(i)]:[...e.slice(0,t),...r,...e.slice(t+1)];return(r.some(e=>e.kind===`bracket`&&e.stepType===`forEach`&&e.step.emit===!0)&&hO(a[a.length-1])?a.slice(0,-1):a).map((e,t)=>gO(e,`steps.${t}`))}function hO(e){return e?.kind===`card`&&e.stepType===`emit`}function gO(e,t){return e.kind===`card`?{...e,path:t}:{...e,path:t,children:e.children.map((e,n)=>gO(e,`${t}.steps.${n}`))}}function _O(e){let t=e.split(`.`),n=Number(t[t.length-1]);return[...t.slice(0,-1),String(n+1)].join(`.`)}function vO(e){let t=0;for(let n of e)t=Math.trunc(t*31+(n.codePointAt(0)??0));return`hsl(${Math.abs(t)%360}, 65%, 42%)`}function yO(e){return e.kind===`bracket`}function bO(e,t){if(t===``)return e.steps;let[n,r]=t.split(`::`,2),i=TO(e.steps,n);return i===void 0?[]:r===`else`?i.elseChildren??[]:i.children}function xO(e,t,n){if(t===``)return{...e,steps:n};let[r,i]=t.split(`::`,2);return{...e,steps:CO(e.steps,r,i,n)}}function SO(e,t,n){return{...e,steps:wO(e.steps,t,n)}}function CO(e,t,n,r){return e.map(e=>yO(e)?e.path===t?n===`else`?{...e,elseChildren:r}:{...e,children:r}:{...e,children:CO(e.children,t,n,r),elseChildren:e.elseChildren===void 0?void 0:CO(e.elseChildren,t,n,r)}:e)}function wO(e,t,n){return e.map(e=>e.path===t?n(e):yO(e)?{...e,children:wO(e.children,t,n),elseChildren:e.elseChildren===void 0?void 0:wO(e.elseChildren,t,n)}:e)}function TO(e,t){for(let n of e){if(!yO(n))continue;if(n.path===t)return n;let e=TO(n.children,t);if(e!==void 0)return e;if(n.elseChildren!==void 0){let e=TO(n.elseChildren,t);if(e!==void 0)return e}}}function EO(e){if(e===``)return`steps`;let[t,n]=e.split(`::`,2);return`${t}.${n===`else`?`else`:`steps`}`}function DO(e,t){if(e!==void 0&&t!==void 0)return OO(e.steps,t)}function OO(e,t){for(let n of e){if(n.step.id===t)return n;if(!yO(n))continue;let e=OO(n.children,t);if(e!==void 0)return e;if(n.elseChildren!==void 0){let e=OO(n.elseChildren,t);if(e!==void 0)return e}}}function kO(e){return e===void 0?[]:AO(e.steps)}function AO(e){return e.flatMap(e=>yO(e)?[e,...AO(e.children),...AO(e.elseChildren??[])]:[e])}function jO(e,t){return e.filter(e=>{if(e.path===t)return!0;if(!e.path.startsWith(`${t}.`))return!1;let n=e.path.slice(t.length+1);return!n.startsWith(`steps.`)&&!n.startsWith(`else.`)})}function MO(e){return new URLSearchParams(globalThis.location.search).get(e)??void 0}async function NO(e,t){let n=await fetch(`/api/command?token=${encodeURIComponent(e)}`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t)}),r=await n.json();if(!n.ok)throw Error(PO(r,n.status));return r}function PO(e,t){return typeof e==`object`&&e&&`error`in e?String(e.error):`request failed: ${t}`}function FO(){let e=MO(`token`)??``;return{token:e,initialFolder:MO(`folder`),initialOpen:MO(`open`),openPath:(t,n)=>NO(e,{type:`open-path`,path:t,...n!==void 0&&{workspace:n}}),openWorkspace:t=>NO(e,{type:`open-workspace`,folder:t}),chooseFolder:async()=>(await NO(e,{type:`choose-folder`})).folder,importDocument:(t,n,r)=>NO(e,{type:`import-document`,folder:t,name:n,bytes:r}),runSample:async(t,n,r)=>{await NO(e,{type:`run-sample`,recipeId:t,budget:n,...r!==void 0&&{stubs:r}})},stopRun:async()=>{await NO(e,{type:`stop-run`})},saveRecipe:async(t,n)=>{await NO(e,{type:`save-recipe`,path:t,recipe:n})},saveOutline:async(t,n)=>{await NO(e,{type:`save-outline`,path:t,outline:n})},fetchStartPage:async t=>(await NO(e,{type:`fetch-start-page`,recipeId:t})).html,takeSnapshot:(t,n)=>NO(e,{type:`take-snapshot`,recipeId:t,path:n}),verifySelector:(t,n,r)=>NO(e,{type:`verify-selector`,recipeId:t,path:n,selector:r}),inferSelector:(t,n,r)=>NO(e,{type:`infer-selector`,recipeId:t,path:n,nodeIds:r}),explainWhy:t=>NO(e,{type:`explain-why`,target:t}),inspectPage:(t,n)=>NO(e,{type:`inspect-page`,recipeId:t,path:n}),responsesSeen:(t,n)=>NO(e,{type:`responses-seen`,recipeId:t,path:n}),documentTree:(t,n)=>NO(e,{type:`document-tree`,recipeId:t,path:n}),pdfView:(t,n)=>NO(e,{type:`pdf-view`,recipeId:t,path:n}),tablePreview:(t,n,r)=>NO(e,{type:`table-preview`,recipeId:t,path:n,options:r}),regionPreview:(t,n,r)=>NO(e,{type:`region-preview`,recipeId:t,path:n,selector:r}),pdfBytesUrl:(t,n)=>`/api/pdf-bytes?token=${encodeURIComponent(e)}&recipeId=${encodeURIComponent(t)}&path=${encodeURIComponent(n)}`,gridView:(t,n,r)=>NO(e,{type:`grid-view`,recipeId:t,path:n,delimiter:r?.delimiter,encoding:r?.encoding}),gridPreview:(t,n,r)=>NO(e,{type:`grid-preview`,recipeId:t,path:n,options:r}),deckView:(t,n)=>NO(e,{type:`deck-view`,recipeId:t,path:n}),deckPreview:(t,n,r)=>NO(e,{type:`deck-preview`,recipeId:t,path:n,options:r}),startRecording:t=>NO(e,{type:`start-recording`,recipeId:t}),stopRecording:()=>NO(e,{type:`stop-recording`}),subscribe:t=>{let n=globalThis.location.protocol===`https:`?`wss`:`ws`,r=new WebSocket(`${n}://${globalThis.location.host}/ws?token=${encodeURIComponent(e)}`);return r.addEventListener(`message`,e=>{t(JSON.parse(String(e.data)))}),()=>{r.close()}}}}function IO(){return(0,P.useMemo)(()=>FO(),[])}function LO(){return new RD({defaultOptions:{queries:{retry:!1},mutations:{retry:!1}}})}function RO(e){return[`workspace`,e]}function zO(e){let t=IO();return ZD({queryKey:RO(e),queryFn:()=>t.openWorkspace(e),enabled:e!==void 0})}var BO=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},VO=(e=>e?BO(e):BO),HO=e=>e;function UO(e,t=HO){let n=P.useSyncExternalStore(e.subscribe,P.useCallback(()=>t(e.getState()),[e,t]),P.useCallback(()=>t(e.getInitialState()),[e,t]));return P.useDebugValue(n),n}var WO=e=>{let t=VO(e),n=e=>UO(t,e);return Object.assign(n,t),n},GO=(e=>e?WO(e):WO),KO={folder:``,editorTab:`steps`,showHidden:!1},qO=GO((e,t)=>({...KO,setFolder:t=>{e({folder:t})},commitFolder:t=>{e({folder:t,openFolder:t})},selectRecipe:t=>{e({selectedRecipeId:t})},setEditorTab:t=>{e({editorTab:t})},startPicking:(t,n)=>{e({pickTarget:{recipeId:t,stepPath:n}})},stopPicking:()=>{e({pickTarget:void 0})},registerPick:n=>{let r=t().pickTarget;if(r?.firstNodeId===void 0)return e({pickTarget:{...r??{recipeId:``,stepPath:``},firstNodeId:n}}),{kind:`first`};let i=r.firstNodeId;return e({pickTarget:void 0}),{kind:`second`,firstNodeId:i}},setShowHidden:t=>{e({showHidden:t})},setHoveredNodeId:t=>{e({hoveredNodeId:t})},setHoveredStepId:t=>{e({hoveredStepId:t})}}));qO.getState();var JO={running:!1,records:[],rejected:[],traceLines:[]},YO=GO(e=>({...JO,startRun:()=>{e({running:!0,records:[],rejected:[],traceLines:[],error:void 0})},appendTraceLine:t=>{e(e=>({traceLines:[...e.traceLines,t]}))},appendRecord:t=>{e(e=>({records:[...e.records,t]}))},appendRejected:t=>{e(e=>({rejected:[...e.rejected,t]}))},finishRun:t=>{e(t===void 0?{running:!1}:{running:!1,error:t})},setError:t=>{e({error:t})}}));YO.getState();var XO={active:!1,cards:[],notes:[]},ZO=GO(e=>({...XO,startRecording:(t,n)=>{e({active:!0,recipeId:t,startUrl:n,cards:[],notes:[],stoppedSteps:void 0,error:void 0})},addCard:t=>{e(e=>({cards:[...e.cards,t]}))},addNote:t=>{e(e=>({notes:[...e.notes,t]}))},recordingStopped:t=>{e({active:!1,stoppedSteps:t})},dismissStopped:()=>{e({stoppedSteps:void 0,cards:[],notes:[]})},failStart:t=>{e({active:!1,error:t})},setError:t=>{e({error:t})}}));ZO.getState();function QO(){let e=qO(e=>e.openFolder),t=qO(e=>e.selectedRecipeId);return zO(e).data?.recipes.find(e=>e.id===t)}function $O(){return zO(qO(e=>e.openFolder)).data?.recipes.filter(e=>e.kind===`input`)??[]}function ek(){let e=IO(),t=AE();return QD({mutationFn:({path:t,recipe:n})=>e.saveRecipe(t,n),onSuccess:()=>{t.invalidateQueries({queryKey:[`workspace`]})}})}function tk(){let e=IO();return QD({mutationFn:({folder:t,name:n,bytes:r})=>e.importDocument(t,n,r)})}function nk(){let e=IO(),t=AE();return QD({mutationFn:({path:t,outline:n})=>e.saveOutline(t,n),onSuccess:()=>{t.invalidateQueries({queryKey:[`workspace`]})}})}function rk(){let e=IO(),t=YO(e=>e.startRun),n=YO(e=>e.finishRun),r=YO(e=>e.setError);return QD({mutationFn:({recipeId:t,budget:n,stubs:r})=>e.runSample(t,n,r),onMutate:()=>{t()},onError:e=>{n(),r(e instanceof Error?e.message:String(e))}})}function ik(){let e=IO();return QD({mutationFn:()=>e.stopRun()})}function ak(){let e=IO(),t=AE(),n=YO(e=>e.appendTraceLine),r=YO(e=>e.appendRecord),i=YO(e=>e.appendRejected),a=YO(e=>e.finishRun),o=ZO(e=>e.addCard),s=ZO(e=>e.addNote),c=ZO(e=>e.recordingStopped);(0,P.useEffect)(()=>e.subscribe(e=>{switch(e.type){case`trace-line`:n(e.line);break;case`record`:r({key:e.key,data:e.data,scope:e.scope,mapping:e.mapping});break;case`record-rejected`:i({field:e.field,reason:e.reason,scope:e.scope});break;case`run-finished`:a(e.error);break;case`recording-card`:o({node:e.node,secret:e.secret});break;case`recording-note`:s({kind:e.kind,message:e.message,selector:e.kind===`next-link`?ok():void 0});break;case`recording-stopped`:c(e.steps),t.invalidateQueries({queryKey:[`snapshot`]});break;case`workspace-changed`:t.invalidateQueries({queryKey:[`workspace`]}),t.invalidateQueries({queryKey:[`snapshot`]})}}),[e,t,n,r,i,a,o,s,c])}function ok(){let e=ZO.getState().cards,t=e[e.length-1];if(t===void 0||t.node.kind!==`card`||t.node.stepType!==`click`)return;let n=t.node.step.selector;return typeof n==`string`?n:void 0}function sk(e,t){let n=IO();return ZD({queryKey:[`snapshot`,e,t],queryFn:()=>n.takeSnapshot(e,t),enabled:e!==void 0&&t!==void 0})}function ck(){let e=IO();return QD({mutationFn:({recipeId:t,path:n,nodeIds:r})=>e.inferSelector(t,n,r)})}function lk(){let e=IO();return QD({mutationFn:t=>e.explainWhy(t)})}function uk(e,t,n=!0){let r=IO();return ZD({queryKey:[`inspect-page`,e,t],queryFn:()=>r.inspectPage(e,t),enabled:n&&e!==void 0&&t!==void 0})}function dk(){let e=IO();return QD({mutationFn:({recipeId:t,path:n})=>e.responsesSeen(t,n)})}function fk(e,t,n=!0){let r=IO();return ZD({queryKey:[`document-tree`,e,t],queryFn:()=>r.documentTree(e,t),enabled:n&&e!==void 0&&t!==void 0})}function pk(e,t,n=!0){let r=IO();return ZD({queryKey:[`pdf-view`,e,t],queryFn:()=>r.pdfView(e,t),enabled:n&&e!==void 0&&t!==void 0})}function mk(e,t,n){let r=IO();return ZD({queryKey:[`table-preview`,e,t,n],queryFn:()=>r.tablePreview(e,t,n),enabled:e!==void 0&&t!==void 0&&n!==void 0})}function hk(e,t,n){let r=IO();return ZD({queryKey:[`region-preview`,e,t,n],queryFn:()=>r.regionPreview(e,t,n),enabled:e!==void 0&&t!==void 0&&n!==void 0,placeholderData:e=>e})}function gk(e,t,n=!0,r){let i=IO();return ZD({queryKey:[`grid-view`,e,t,r],queryFn:()=>i.gridView(e,t,r),enabled:n&&e!==void 0&&t!==void 0})}function _k(e,t,n){let r=IO();return ZD({queryKey:[`grid-preview`,e,t,n],queryFn:()=>r.gridPreview(e,t,n),enabled:e!==void 0&&t!==void 0&&n!==void 0})}function vk(e,t,n=!0){let r=IO();return ZD({queryKey:[`deck-view`,e,t],queryFn:()=>r.deckView(e,t),enabled:n&&e!==void 0&&t!==void 0})}function yk(e,t,n){let r=IO();return ZD({queryKey:[`deck-preview`,e,t,n],queryFn:()=>r.deckPreview(e,t,n),enabled:e!==void 0&&t!==void 0&&n!==void 0})}function bk(){let e=IO(),t=ZO(e=>e.startRecording),n=ZO(e=>e.failStart);return QD({mutationFn:async({recipeId:t})=>{await e.startRecording(t)},onMutate:({recipeId:e,startUrl:n})=>{t(e,n)},onError:e=>{n(e instanceof Error?e.message:String(e))}})}function xk(){let e=IO();return QD({mutationFn:async()=>{await e.stopRecording()}})}function Sk(e){return typeof e==`object`?e.key:e}function Ck(e,t){let n=e.length;return new Proxy(e,{get(e,r,i){if(typeof r==`string`){let i=r.charCodeAt(0);if(i>=48&&i<=57){let i=+r;if(Number.isInteger(i)&&i>=0&&i<n){let n=e[i];if(typeof n!=`object`){let r=t[i*2];n=e[i]={index:i,key:n,start:r,size:t[i*2+1],end:r+t[i*2+1],lane:0}}return n}}if(r===`length`)return n}return Reflect.get(e,r,i)}})}function wk(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o=e();return o.length!==r.length||o.some((e,t)=>r[t]!==e)?(r=o,i=t(...o),n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1,i):i}return o.updateDeps=e=>{r=e},o}function Tk(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var Ek=(e,t)=>Math.abs(e-t)<1.01,Dk=(e,t,n)=>{let r;return Object.assign(function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)},{cancel:()=>{e.clearTimeout(r)}})},Ok,kk=()=>{if(Ok!==void 0)return Ok;if(typeof navigator>`u`)return Ok=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Ok=!0;let e=navigator.maxTouchPoints;return Ok=navigator.platform===`MacIntel`&&e!==void 0&&e>0},Ak=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},jk=e=>e,Mk=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,r=Array(n);for(let e=0;e<n;e++)r[e]=t+e;return r},Nk=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(Ak(n)),!r.ResizeObserver)return()=>{};let a=new r.ResizeObserver(t=>{let r=()=>{let e=t[0];if(e?.borderBoxSize){let t=e.borderBoxSize[0];if(t){i({width:t.inlineSize,height:t.blockSize});return}}i(Ak(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},Pk={passive:!0},Fk=typeof window>`u`||`onscrollend`in window,Ik=(e,t,n)=>{let r=e.scrollElement;if(!r)return;let i=e.targetWindow;if(!i)return;let a=e.options.useScrollendEvent&&Fk,o=0,s=a?null:Dk(i,()=>t(n(r),!1),e.options.isScrollingResetDelay),c=e=>()=>{o=n(r),s?.(),t(o,e)},l=c(!0),u=c(!1);return r.addEventListener(`scroll`,l,Pk),a&&r.addEventListener(`scrollend`,u,Pk),()=>{r.removeEventListener(`scroll`,l),a&&r.removeEventListener(`scrollend`,u),s?.cancel()}},Lk=(e,t)=>Ik(e,t,t=>{let{horizontal:n,isRtl:r}=e.options;return n?t.scrollLeft*(r&&-1||1):t.scrollTop}),Rk=(e,t,n)=>{if(n.options.useCachedMeasurements){let t=n.indexFromElement(e),r=n.options.getItemKey(t);return n.itemSizeCache.get(r)??n.options.estimateSize(t)}if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}if(!t){let t=n.indexFromElement(e),r=n.options.getItemKey(t),i=n.itemSizeCache.get(r);if(i!==void 0)return i}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},zk=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:e+t,behavior:n})};function Bk(e,t,n,r){if(t===0)return!1;let i=r(0),a=new Set,o=0;for(;o<e;){let e=n(o);if(e===i)break;a.add(e),o++}let s=e-o;if(s===0||s>=t)return!1;for(let e=0;e<s;e++)if(r(e)!==n(o+e))return!1;for(let e=s;e<t;e++)if(a.has(r(e)))return!1;return!0}var Vk=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this._clampedAdjustment=null,this.elementsCache=new Map,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,n=this.indexFromElement(t);if(!t.isConnected){this.observer.unobserve(t);for(let[e,n]of this.elementsCache)if(n===t){this.elementsCache.delete(e);break}return}this.isIndexInRange(n)&&this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}));return{disconnect:()=>{var n;(n=t())==null||n.disconnect(),e=null},observe:e=>t()?.observe(e,{box:`border-box`}),unobserve:e=>t()?.unobserve(e)}})(),this.range=null,this.setOptions=e=>{let t={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:jk,rangeExtractor:Mk,onChange:()=>{},measureElement:Rk,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,anchorTo:`start`,followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:`estimate`,useCachedMeasurements:!1};for(let n in e){let r=e[n];r!==void 0&&(t[n]=r)}let n=this.options,r=null,i=null,a=!1;if(n!==void 0&&n.enabled&&t.enabled&&t.anchorTo===`end`&&this.scrollElement!==null){let e=n.count,o=t.count,s=this.getMeasurements(),c=this._singleLaneMeasurements?.items??s,l=e=>Sk(c[e]),u=e>0?l(0):null,d=e>0?l(e-1):null;if(o!==e||e>0&&o>0&&(t.getItemKey(0)!==u||t.getItemKey(o-1)!==d)){a=!0;let c=e>0?this.getVirtualItemForOffset(this.getScrollOffset())??s[0]:null;c&&(r=[c.key,this.getScrollOffset()-c.start]);let u=t.followOnAppend===!0?`auto`:t.followOnAppend||null;u&&o>0&&this.isAtEnd(n.scrollEndThreshold)&&(e===0||t.getItemKey(o-1)!==d)&&(o>e||Bk(e,o,l,t.getItemKey))&&(i=u)}}this.options=t,a&&(this.pendingMin=0,this.itemSizeCacheVersion++);let o=!1,s=0;if(r&&this.scrollOffset!==null){let[e,t]=r,n=this.getMeasurements(),{count:a,getItemKey:c}=this.options,l=0;for(;l<a&&c(l)!==e;)l++;if(l<a){let e=n[l];if(e){let n=Math.max(0,e.start+t);!i&&n!==this.scrollOffset&&(s=n-this.scrollOffset,this.scrollOffset=n,o=!0)}}}(o||i)&&(this.pendingScrollAnchor=[o?r[0]:null,o?r[1]:0,i,s])},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=wk(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.isScrolling=!1,this.scrollDirection=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._clampedAdjustment=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}if(this.scrollElement=e,this.targetWindow=this.scrollElement&&`ownerDocument`in this.scrollElement?this.scrollElement.ownerDocument.defaultView:this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{if(t&&this._intendedScrollOffset===null&&e===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(e-this._intendedScrollOffset)<1.5&&(e=this._intendedScrollOffset),this._intendedScrollOffset=null,this._clampedAdjustment!==null&&Math.abs(e-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null),this.scrollAdjustments=0;let n=this.getScrollOffset();this.scrollDirection=t?n===e?this.scrollDirection:n<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),`addEventListener`in this.scrollElement){let e=this.scrollElement,t=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},n=()=>{this._iosTouching=!1,kk()&&this.targetWindow!=null&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};e.addEventListener(`touchstart`,t,Pk),e.addEventListener(`touchend`,n,Pk),this.unsubs.push(()=>{e.removeEventListener(`touchstart`,t),e.removeEventListener(`touchend`,n),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}let t=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,t&&this.scrollElement&&this.options.enabled){let[e,n,r,i]=t;e!==null&&!r&&(kk()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?i!==0&&(this._iosDeferredAdjustment+=i):this.scrollState?.behavior===`smooth`&&!Ek(this.getScrollOffset()-i,this.scrollState.lastTargetOffset)||this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),r&&this.scrollToEnd({behavior:r})}this._retryClampedAdjustment()},this._retryClampedAdjustment=()=>{if(this._clampedAdjustment===null||!this.scrollElement||!this.options.enabled)return;let{target:e,maxAtWrite:t}=this._clampedAdjustment,n=this.getMaxScrollOffset();n>t+.5&&(this._clampedAdjustment=e>n+.5?{target:e,maxAtWrite:n}:null,this._scrollToOffset(e,{adjustments:void 0,behavior:void 0}))},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;let e=this.getScrollOffset(),t=this.getMaxScrollOffset();if(e<0||e>t)return;if(this._iosDeferredAdjustment<0&&e>=t-1){this._iosDeferredAdjustment=0;return}let n=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(e,{adjustments:this.scrollAdjustments+=n,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=wk(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(e,t,n,r,i,a,o,s)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s}),{key:!1}),this.isIndexInRange=e=>e>=0&&e<this.options.count,this.getMeasurements=wk(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s},c)=>{let l=this.itemSizeCache;if(!i)return this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let u=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),a===1){let i=e*2,a=this._singleLaneMeasurements?.flat;if(!a||a.length<i){let e=new Float64Array(i);a&&u>0&&e.set(a.subarray(0,u*2)),a=e}let o=u===0?Array(e):this._singleLaneMeasurements.items.slice(),c;if(u===0)c=t+n;else{let e=u-1;c=a[e*2]+a[e*2+1]+s}for(let t=u;t<e;t++){let e=r(t);o[t]=e;let n=l.get(e),i=typeof n==`number`?n:this.options.estimateSize(t);a[t*2]=c,a[t*2+1]=i,c+=i+s}this._singleLaneMeasurements={flat:a,items:o};let d=Ck(o,a);return this.measurementsCache=d,d}let d=this.measurementsCache.slice(0,u),f=Array(a).fill(void 0),p=new Float64Array(a),m=0;for(let e=0;e<u;e++){let t=d[e];t&&(f[t.lane]===void 0&&m++,f[t.lane]=e,p[t.lane]=t.end)}for(let i=u;i<e;i++){let e=r(i),c=this.laneAssignments.get(i),u,h,g=o===`estimate`||l.has(e);if(c!==void 0&&this.options.lanes>1){u=c;let e=f[u],r=e===void 0?void 0:d[e];h=r?r.end+s:t+n}else if(m===a){let e=0,t=p[0],n=f[0];for(let r=1;r<a;r++){let i=p[r];(i<t||i===t&&f[r]<n)&&(e=r,t=i,n=f[r])}u=e,h=t+s,g&&this.laneAssignments.set(i,u)}else u=i%this.options.lanes,h=t+n,g&&this.laneAssignments.set(i,u);let _=l.get(e),v=typeof _==`number`?_:this.options.estimateSize(i),y=h+v;d[i]={index:i,start:h,size:v,end:y,key:e,lane:u},f[u]===void 0&&m++,f[u]=i,p[u]=y}return this.measurementsCache=d,d},{key:!1,debug:()=>this.options.debug}),this.calculateRange=wk(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>e.length===0||t===0?(this.range=null,null):(this.range=Wk(e,t,n,r,r===1&&this._singleLaneMeasurements!==null?this._singleLaneMeasurements.flat:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=wk(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,i)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!this.scrollState||this.scrollState.behavior!==`smooth`)return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e);if(!this.isIndexInRange(t))return;let n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{if(!this.isIndexInRange(e))return;let n,r,i,a=this._singleLaneMeasurements?.flat;if(this.options.lanes===1&&a!=null)i=this.options.getItemKey(e),r=a[e*2],n=a[e*2+1];else{let t=this.measurementsCache[e];if(!t)return;i=t.key,r=t.start,n=t.size}let o=this.itemSizeCache.get(i)??n,s=t-o;if(s!==0){let a=this.options.anchorTo===`end`&&this.scrollState?.behavior!==`smooth`&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,c=a?this.getTotalSize():0,l=this.getScrollOffset()+this.scrollAdjustments,u=this.itemSizeCache.has(i)?r+o<=l&&this.scrollDirection!==`backward`:r<l,d=this.scrollState?.behavior!==`smooth`&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?u:this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:i,start:r,size:n,end:r+n,lane:0},s,this));(this.pendingMin===null||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(i,t),this.itemSizeCacheVersion++;let f=!1;a?f=this.applyScrollAdjustment(this.getTotalSize()-c):d&&(f=this.applyScrollAdjustment(s)),this.notify(f),this._retryClampedAdjustment()}},this.getVirtualItems=wk(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let r=0,i=e.length;r<i;r++){let i=t[e[r]];n.push(i)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length===0)return;let n=this._singleLaneMeasurements?.flat,r=this.options.lanes===1&&n!=null;return Tk(t[Hk(0,t.length-1,r?e=>n[e*2]:e=>Tk(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if(`scrollHeight`in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[e];if(!i)return;if(t===`auto`){if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t]}if(t===`end`&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{this._iosDeferredAdjustment=0;let r=this.getOffsetForAlignment(e,t),i=this.now();this.scrollState={index:null,align:t,behavior:n,startedAt:i,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{this._iosDeferredAdjustment=0,e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r,o=this.now();this.scrollState={index:e,align:a,behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getScrollOffset()+e,r=this.now();this.scrollState={index:null,align:`start`,behavior:t,startedAt:r,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:e=`auto`}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:`end`,behavior:e});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.getTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1){let n=e.length-1,r=this._singleLaneMeasurements?.flat;t=r==null?e[n]?.end??0:r[n*2]+r[n*2+1]}else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let e=[];if(this.itemSizeCache.size===0)return e;let t=this.getMeasurements();for(let n of t)n&&this.itemSizeCache.has(n.key)&&e.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this._intendedScrollOffset=e+(t??0),this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}applyScrollAdjustment(e,t){if(e===0)return!1;if(kk()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded))return this._iosDeferredAdjustment+=e,!1;{let n=this.getScrollOffset()+this.scrollAdjustments+e,r=this.scrollElement,i=r!==null&&(`scrollHeight`in r||`document`in r)?this.getMaxScrollOffset():null;return this._clampedAdjustment=i!==null&&n>i+.5?{target:n,maxAtWrite:i}:null,this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=e,behavior:t}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0}}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()})}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=this.scrollState.index==null?void 0:this.getOffsetForIndex(this.scrollState.index,this.scrollState.align),t=e?e[0]:this.scrollState.lastTargetOffset,n=t!==this.scrollState.lastTargetOffset;if(!n&&Ek(t,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.getScrollOffset()!==t&&this._scrollToOffset(t,{adjustments:void 0,behavior:`auto`}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,n){let e=this.getSize()||600,n=Math.abs(t-this.getScrollOffset()),r=this.scrollState.behavior===`smooth`&&n>e;this.scrollState.lastTargetOffset=t,r||(this.scrollState.behavior=`auto`),this._scrollToOffset(t,{adjustments:void 0,behavior:r?`smooth`:`auto`})}this.scheduleScrollReconcile()}},Hk=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function Uk(e,t,n){let r=0;for(;r<=t;){let i=(r+t)/2|0,a=e[i*2];if(a<n)r=i+1;else if(a>n)t=i-1;else return i}return r>0?r-1:0}function Wk(e,t,n,r,i){let a=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:a};if(r===1&&i!==null){let e=Uk(i,a,n),r=e,o=n+t;for(;r<a&&i[r*2]+i[r*2+1]<o;)r++;return{startIndex:e,endIndex:r}}let o=Hk(0,a,t=>e[t].start,n),s=o;if(r===1)for(;s<a&&e[s].end<n+t;)s++;else if(r>1){let i=Array(r).fill(0);for(;s<a&&i.some(e=>e<n+t);){let t=e[s];i[t.lane]=t.end,s++}let c=Array(r).fill(n+t);for(;o>=0&&c.some(e=>e>=n);){let t=e[o];c[t.lane]=t.start,o--}o=Math.max(0,o-o%r),s=Math.min(a,s+(r-1-s%r))}return{startIndex:o,endIndex:s}}var Gk=typeof document<`u`?P.useLayoutEffect:P.useEffect;function Kk({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n=`transform`,...r}){let i=P.useReducer(e=>e+1,0)[1],a=P.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});a.current.enabled=t,a.current.mode=n;let o=P.useRef(!1),s=e=>{let t=a.current;if(!t.enabled||!t.container)return;let n=e.getTotalSize();if(n!==t.lastSize){t.lastSize=n;let r=e.options.horizontal?`width`:`height`;t.container.style[r]=`${n}px`}},c=e=>{let t=a.current;if(!t.enabled||!t.container)return;s(e);let n=!!e.options.horizontal,r=t.mode===`transform`,i=n?`left`:`top`,o=e.options.scrollMargin,c=e.getVirtualItems();for(let a of c){let s=a.start-o,c=e.elementsCache.get(a.key);c&&t.lastPositions.get(c)!==s&&(t.lastPositions.set(c,s),r?c.style.transform=n?`translate3d(${s}px, 0, 0)`:`translate3d(0, ${s}px, 0)`:c.style[i]=`${s}px`)}},l={...r,onChange:(t,n)=>{var s;let l=a.current,u=!0;if(l.enabled){c(t);let e=t.range,n=l.prevRange;u=!n||n.isScrolling!==t.isScrolling||n.startIndex!==e?.startIndex||n.endIndex!==e?.endIndex,u&&(l.prevRange=e?{startIndex:e.startIndex,endIndex:e.endIndex,isScrolling:t.isScrolling}:null)}u&&(e&&n&&!o.current?(0,tt.flushSync)(i):i()),(s=r.onChange)==null||s.call(r,t,n)}},[u]=P.useState(()=>{let e=new Vk(l),t=e.measureElement;return e.measureElement=e=>{o.current=!0;try{t(e)}finally{o.current=!1}},Object.assign(e,{containerRef:t=>{let n=a.current;if(n.container=t,n.lastSize=null,t&&n.enabled){let r=e.getTotalSize();n.lastSize=r;let i=e.options.horizontal?`width`:`height`;t.style[i]=`${r}px`}}})});return u.setOptions(l),Gk(()=>u._didMount(),[]),Gk(()=>(s(u),u._willUpdate())),Gk(()=>{c(u)}),u}function qk(e){return Kk({observeElementRect:Nk,observeElementOffset:Lk,scrollToFn:zk,...e})}function Jk(e,t,n=``,r=!1){let i=n.trim().toLowerCase();return i===``?Yk(e,t,0,r):Xk(e,i,0,r).rows}function Yk(e,t,n,r){if(!r&&e.hidden)return[];let i=t.has(e.nodeId),a={key:e.nodeId,node:e,depth:n,hasChildren:e.children.length>0,expanded:i};return i?[a,...e.children.flatMap(e=>Yk(e,t,n+1,r))]:[a]}function Xk(e,t,n,r){if(!r&&e.hidden)return{rows:[],matched:!1};let i=e.children.map(e=>Xk(e,t,n+1,r));return!i.some(e=>e.matched)&&!Zk(e,t)?{rows:[],matched:!1}:{rows:[{key:e.nodeId,node:e,depth:n,hasChildren:e.children.length>0,expanded:!0},...i.flatMap(e=>e.rows)],matched:!0}}function Zk(e,t){return e.tag.toLowerCase().includes(t)||e.id?.toLowerCase().includes(t)===!0||e.classes?.some(e=>e.toLowerCase().includes(t))===!0||e.text?.toLowerCase().includes(t)===!0?!0:Object.values(e.attributes).some(e=>e.toLowerCase().includes(t))}var Qk=3;function $k({row:e,highlightColor:t,hovered:n,onToggle:r,onHover:i,onClick:a,onContextMenu:o}){let{node:s,depth:c,hasChildren:l,expanded:u}=e,d=Object.entries(s.attributes).slice(0,Qk),f=Object.keys(s.attributes).length-d.length;return(0,F.jsxs)(K,{gap:1,pl:`${c*14+4}px`,pr:2,h:`22px`,fontSize:`xs`,fontFamily:`mono`,opacity:s.hidden?.5:1,bg:n?`bg.emphasized`:void 0,style:t===void 0?void 0:{boxShadow:`inset 3px 0 0 ${t}`},cursor:`pointer`,whiteSpace:`nowrap`,overflow:`hidden`,onMouseEnter:()=>{i(!0)},onMouseLeave:()=>{i(!1)},onClick:a,onContextMenu:o,children:[l?(0,F.jsx)(U,{as:`button`,w:`12px`,flexShrink:0,color:`fg.muted`,onClick:e=>{e.stopPropagation(),r()},children:u?`▾`:`▸`}):(0,F.jsx)(I,{w:`12px`,flexShrink:0}),(0,F.jsx)(U,{as:`span`,color:`purple.fg`,children:`<${s.tag}`}),s.id!==void 0&&(0,F.jsx)(U,{as:`span`,color:`blue.fg`,children:`#${s.id}`}),s.classes?.map(e=>(0,F.jsx)(U,{as:`span`,color:`teal.fg`,children:`.${e}`},e)),d.map(([e,t])=>(0,F.jsx)(U,{as:`span`,color:`fg.muted`,children:`${e}="${t}"`},e)),f>0&&(0,F.jsx)(U,{as:`span`,color:`fg.muted`,children:`…+${f}`}),(0,F.jsx)(U,{as:`span`,color:`purple.fg`,children:`>`}),s.text!==void 0&&s.text!==``&&(0,F.jsx)(U,{as:`span`,color:`fg.muted`,truncate:!0,children:s.text}),s.repeatCount!==void 0&&(0,F.jsx)(kw,{size:`xs`,colorPalette:`gray`,children:`×${s.repeatCount}`})]})}var eA=22,tA=20;function nA({tree:e,showHidden:t,query:n,expanded:r,onToggle:i,nodeColors:a,hoveredNodeId:o,onHoverNode:s,onPickNode:c,onContextMenuNode:l}){let u=(0,P.useRef)(null),d=Jk(e,r,n,t),f=qk({count:d.length,getScrollElement:()=>u.current,estimateSize:()=>eA,overscan:tA});return(0,F.jsx)(I,{ref:u,h:`full`,overflow:`auto`,children:(0,F.jsx)(I,{h:`${f.getTotalSize()}px`,position:`relative`,children:f.getVirtualItems().map(e=>{let t=d[e.index];return t===void 0?null:(0,F.jsx)(I,{position:`absolute`,top:0,left:0,w:`full`,style:{transform:`translateY(${e.start}px)`},children:(0,F.jsx)($k,{row:t,highlightColor:a.get(t.node.nodeId),hovered:o===t.node.nodeId,onToggle:()=>{i(t.node.nodeId)},onHover:e=>{s(e?t.node.nodeId:void 0)},onClick:()=>{c(t.node.nodeId)},onContextMenu:e=>{e.preventDefault(),l(t.node,e.clientX,e.clientY)}})},t.key)})})})}function rA({node:e,x:t,y:n,onClose:r,onChoose:i}){let a=(0,P.useRef)(null);(0,P.useEffect)(()=>{let e=e=>{a.current!==null&&!a.current.contains(e.target)&&r()},t=e=>{e.key===`Escape`&&r()};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[r]);let o=Object.keys(e.attributes);return(0,F.jsxs)(I,{ref:a,position:`fixed`,top:`${n}px`,left:`${t}px`,zIndex:1e3,bg:`bg.panel`,borderWidth:`1px`,borderRadius:`md`,boxShadow:`lg`,py:1,minW:`190px`,fontSize:`sm`,children:[(0,F.jsx)(iA,{label:`Read as text`,onClick:()=>{i({kind:`take`,take:`text`})}}),(0,F.jsx)(iA,{label:`Read as html`,onClick:()=>{i({kind:`take`,take:`html`})}}),(0,F.jsx)(iA,{label:`Read as json`,onClick:()=>{i({kind:`take`,take:`json`})}}),o.length>0&&(0,F.jsxs)(I,{borderTopWidth:`1px`,mt:1,pt:1,children:[(0,F.jsx)(U,{px:3,py:`2px`,fontSize:`xs`,color:`fg.muted`,children:`As an attribute`}),o.map(e=>(0,F.jsx)(iA,{label:e,onClick:()=>{i({kind:`take`,take:`attr:${e}`})}},e))]}),(0,F.jsx)(I,{borderTopWidth:`1px`,mt:1,pt:1,children:(0,F.jsx)(iA,{label:`Regex on its text…`,onClick:()=>{i({kind:`regex`})}})})]})}function iA({label:e,onClick:t}){return(0,F.jsx)(U,{as:`button`,display:`block`,w:`full`,textAlign:`left`,px:3,py:`4px`,_hover:{bg:`bg.emphasized`},onClick:t,children:e})}var aA=`data-oc-node`;function oA(e,t){if(t.trim()===``)return new Set;try{let n=new DOMParser().parseFromString(e,`text/html`).querySelectorAll(t);return new Set(Array.from(n,e=>e.getAttribute(aA)).filter(e=>e!==null))}catch{return new Set}}function sA({findings:e,onPick:t}){return e.length===0?(0,F.jsx)(I,{p:3,color:`fg.muted`,fontSize:`sm`,children:`No JSON-LD, inline state, meta or link data found in this page.`}):(0,F.jsx)(OE,{align:`stretch`,gap:0,fontSize:`sm`,overflow:`auto`,h:`full`,children:e.map(e=>(0,F.jsxs)(I,{borderBottomWidth:`1px`,px:3,py:2,children:[(0,F.jsxs)(K,{justify:`space-between`,gap:2,children:[(0,F.jsx)(U,{fontWeight:`medium`,truncate:!0,children:e.label}),(0,F.jsx)(U,{as:`button`,flexShrink:0,fontSize:`xs`,color:`blue.fg`,onClick:()=>{t(e,void 0)},children:e.keys===void 0?`Read`:`Read whole value`})]}),e.keys!==void 0&&e.keys.length>0&&(0,F.jsx)(K,{wrap:`wrap`,gap:1,mt:1,children:e.keys.map(n=>(0,F.jsx)(U,{as:`button`,fontSize:`xs`,px:2,py:`1px`,borderRadius:`full`,borderWidth:`1px`,onClick:()=>{t(e,n)},children:n},n))})]},`${e.kind}-${e.selector}`))})}var cA=`data`;function lA(e,t,n,r=cA){if(e.kind===`meta`||e.kind===`link`)return[{kind:`card`,path:t,stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:r,selector:e.selector,kind:`css`,take:`attr:${e.attribute??`content`}`}}];let i={kind:`card`,path:t,stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:r,selector:e.selector,kind:`css`}};return n===void 0?[i]:[i,{kind:`card`,path:uA(t),stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:`${r}_${n}`,from:r,selector:`$.${n}`,kind:`jsonpath`}}]}function uA(e){let t=e.split(`.`),n=Number(t[t.length-1]);return[...t.slice(0,-1),String(n+1)].join(`.`)}function dA({responses:e,loading:t,error:n,onCheck:r,onPick:i}){return(0,F.jsxs)(OE,{align:`stretch`,gap:2,p:3,fontSize:`sm`,overflow:`auto`,h:`full`,children:[(0,F.jsx)(U,{as:`button`,alignSelf:`flex-start`,colorPalette:`blue`,color:`colorPalette.fg`,fontWeight:`medium`,opacity:t?.6:1,pointerEvents:t?`none`:void 0,onClick:r,children:t?`Checking…`:`Check for JSON responses`}),n!==void 0&&(0,F.jsx)(U,{color:`red.fg`,children:n}),e!==void 0&&e.length===0&&(0,F.jsx)(U,{color:`fg.muted`,children:`No JSON responses seen while the page rendered.`}),e?.map(e=>(0,F.jsxs)(I,{borderWidth:`1px`,borderRadius:`md`,p:2,children:[(0,F.jsx)(U,{fontWeight:`medium`,truncate:!0,title:e.url,children:e.url}),(0,F.jsx)(U,{color:`fg.muted`,fontSize:`xs`,children:`${e.status} · ${e.size} bytes · ${e.shape}`}),(0,F.jsx)(U,{as:`button`,fontSize:`xs`,color:`blue.fg`,mt:1,onClick:()=>{i(e)},children:`Switch to api mode on this endpoint`})]},e.url))]})}var fA=`response`;function pA(e,t){return{mode:`api`,start:[{url:mA(e.url,t)}],steps:[{type:`request`,id:fA,url:`{{start.url}}`,as:`json`}]}}function mA(e,t){let n=new URL(e),r=new Map(Object.entries(t??{}).map(([e,t])=>[String(t),e])),i=[...n.searchParams].map(([e,t])=>{let n=r.get(t);return`${e}=${n===void 0?encodeURIComponent(t):`{{vars.${n}}}`}`});return`${n.origin}${n.pathname}${i.length===0?``:`?${i.join(`&`)}`}`}var hA=`start`,gA=`#dd6b20`;function _A({recipeId:e,recipe:t,snapshot:n,onSaveOutline:r,onSaveRecipe:i}){let[a,o]=(0,P.useState)(`tree`),[s,c]=(0,P.useState)(``),[l,u]=(0,P.useState)(!1),[d,f]=(0,P.useState)(()=>new Set),[p,m]=(0,P.useState)(void 0),[h,g]=(0,P.useState)(void 0),_=qO(e=>e.hoveredStepId),v=qO(e=>e.hoveredNodeId),y=qO(e=>e.setHoveredNodeId),b=(0,P.useMemo)(()=>{let e=DO(t?.outline,_)?.step.selector;return typeof e==`string`?e:void 0},[t?.outline,_]),x=uk(e,hA,n!==void 0),S=ck(),C=dk(),w=(0,P.useMemo)(()=>{let e=new Map;if(n===void 0)return e;let r=t?.outline?.steps??[];for(let t of r){if(t.kind!==`card`)continue;let r=t.step;if(r.type===`extract`&&r.kind===`css`&&typeof r.id==`string`&&typeof r.selector==`string`)for(let t of oA(n.html,r.selector))e.set(t,vO(r.id))}if(b!==void 0&&b!==``)for(let t of oA(n.html,b))e.set(t,gA);return e},[n,t,b]);(0,P.useEffect)(()=>{f(new Set)},[e]),(0,P.useEffect)(()=>{x.data!==void 0&&f(e=>{if(e.size>0)return e;let t=x.data.tree,n=new Set([t.nodeId]),[r]=t.children;return r!==void 0&&t.children.length===1&&n.add(r.nodeId),n})},[x.data]);function T(e){f(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}async function E(e){if(r===void 0||t?.outline===void 0)return;let n=mO(t.outline.steps,void 0,e);await r(t.file,{...t.outline,steps:n})}async function D(t,n){if(e===void 0)return;let r=await S.mutateAsync({recipeId:e,path:hA,nodeIds:[t]});if(r.kind!==`field`){g(r.kind===`unsupported`?r.reason:void 0);return}let i=n===void 0?r.field:{...r.field,take:n};await E([aO(i,`steps.0`)]),g(`Read card: ${i.selector}`)}async function ee(t){if(e===void 0)return;let n=await S.mutateAsync({recipeId:e,path:hA,nodeIds:[t]});if(n.kind!==`field`)return;let r=`text`;await E([aO({...n.field,take:`text`},`steps.0`,r),{kind:`card`,path:`steps.1`,stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:`${r}_match`,from:r,selector:``,kind:`regex`}}]),g(`Read card: ${n.field.selector} → regex (fill the pattern in its form)`)}async function O(e,t){await E(lA(e,`steps.0`,t)),g(`Read card: ${e.selector}${t===void 0?``:` → $.${t}`}`)}async function te(e){if(i===void 0||t===void 0)return;let n;try{n=JSON.parse(t.text)}catch{g(`The recipe's JSON does not parse; fix it in the JSON tab first`);return}let r=pA(e,vA(n.vars)?n.vars:void 0);await i(t.file,{...n,...r}),g(`Switched to api mode: ${r.start[0].url}`)}function k(e){if(p===void 0)return;let t=p.node.nodeId;m(void 0),e.kind===`regex`?ee(t):D(t,e.take)}return(0,F.jsxs)(I,{h:`full`,display:`flex`,flexDirection:`column`,children:[(0,F.jsxs)(K,{px:2,py:1,borderBottomWidth:`1px`,gap:2,flexShrink:0,children:[(0,F.jsx)(yA,{label:`Tree`,active:a===`tree`,onClick:()=>{o(`tree`)}}),(0,F.jsx)(yA,{label:`Data in page`,active:a===`data`,count:x.data?.pageData.length,onClick:()=>{o(`data`)}}),(0,F.jsx)(yA,{label:`Responses`,active:a===`responses`,count:C.data?.responses.length,onClick:()=>{o(`responses`)}})]}),a===`tree`&&(0,F.jsxs)(K,{px:2,py:1,borderBottomWidth:`1px`,gap:2,flexShrink:0,children:[(0,F.jsx)(ET,{size:`xs`,placeholder:`Search by tag, class or text…`,value:s,onChange:e=>{c(e.target.value)}}),(0,F.jsx)(U,{as:`button`,fontSize:`xs`,color:l?`colorPalette.fg`:`fg.muted`,colorPalette:`orange`,whiteSpace:`nowrap`,onClick:()=>{u(e=>!e)},children:l?`Hide hidden`:`Show hidden`})]}),h!==void 0&&(0,F.jsx)(I,{px:2,py:`2px`,fontSize:`xs`,color:`fg.muted`,borderBottomWidth:`1px`,flexShrink:0,children:h}),(0,F.jsxs)(I,{flex:`1`,minH:`0`,position:`relative`,children:[a===`tree`&&x.data!==void 0&&(0,F.jsx)(nA,{tree:x.data.tree,showHidden:l,query:s,expanded:d,onToggle:T,nodeColors:w,hoveredNodeId:v,onHoverNode:y,onPickNode:e=>{D(e)},onContextMenuNode:(e,t,n)=>{m({node:e,x:t,y:n})}}),a===`tree`&&x.isFetching&&(0,F.jsx)(I,{p:3,color:`fg.muted`,fontSize:`sm`,children:`Inspecting…`}),a===`data`&&(0,F.jsx)(sA,{findings:x.data?.pageData??[],onPick:(e,t)=>{O(e,t)}}),a===`responses`&&(0,F.jsx)(dA,{responses:C.data?.responses,loading:C.isPending,error:C.error?.message,onCheck:()=>{e!==void 0&&C.mutate({recipeId:e,path:hA})},onPick:e=>{te(e)}}),p!==void 0&&(0,F.jsx)(rA,{node:p.node,x:p.x,y:p.y,onClose:()=>{m(void 0)},onChoose:k})]})]})}function vA(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function yA({label:e,active:t,count:n,onClick:r}){return(0,F.jsxs)(K,{as:`button`,gap:1,px:2,py:`2px`,borderRadius:`sm`,fontSize:`xs`,fontWeight:t?`semibold`:`normal`,color:t?`fg`:`fg.muted`,bg:t?`bg.emphasized`:void 0,onClick:r,children:[(0,F.jsx)(U,{as:`span`,children:e}),n!==void 0&&(0,F.jsx)(kw,{size:`xs`,children:n})]})}var bA=`application/x-opencraw-card`;function xA(e){return JSON.stringify(e)}function SA(e){let t=e.getData(bA);if(t!==``)try{let e=JSON.parse(t);return e.kind===`card`||e.kind===`bracket`?e:void 0}catch{return}}function CA(e){return[...e.types].includes(bA)}var wA=(0,P.createContext)(void 0),TA=`myHook`;function EA(){return(0,P.useContext)(wA)}function DA({value:e,onChange:t,onCommit:n,size:r=`sm`,ariaLabel:i}){let a=EA(),o=()=>{n?.()};if(a===void 0||a.length===0)return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(ET,{size:r,"aria-label":i,value:e,onChange:e=>{t(e.target.value)},onBlur:o}),(0,F.jsx)(U,{fontSize:`xs`,color:`fg.muted`,children:a===void 0?"Studio has no hooks loaded: restart it with `opencraw studio --hooks <file>` to pick from a list.":`The hooks file exports no hooks.`})]});let s=e!==``&&!a.includes(e);return(0,F.jsx)(NT,{size:r,children:(0,F.jsxs)(FT,{"aria-label":i,value:e,onChange:e=>{t(e.target.value),o()},children:[(0,F.jsx)(`option`,{value:``,disabled:!0,children:`(choose a hook)`}),s&&(0,F.jsx)(`option`,{value:e,children:`${e} (not in the loaded hooks)`}),a.map(e=>(0,F.jsx)(`option`,{value:e,children:e},e))]})})}var OA=[{label:`Go to`,stepType:`goto`,bracket:!1},{label:`Read`,stepType:`extract`,bracket:!1},{label:`Loop`,stepType:`forEach`,bracket:!0},{label:`Next page`,stepType:`paginate`,bracket:!0},{label:`If`,stepType:`if`,bracket:!0},{label:`Fill form`,stepType:`fill`,bracket:!1},{label:`Click`,stepType:`click`,bracket:!1},{label:`Set`,stepType:`set`,bracket:!1},{label:`Collect`,stepType:`collect`,bracket:!1},{label:`Hook`,stepType:`hook`,bracket:!1},{label:`Emit`,stepType:`emit`,bracket:!1}];function kA(e,t=TA){switch(e){case`goto`:return{type:`goto`,url:``};case`extract`:return{type:`extract`,id:`value`,selector:``,kind:`css`};case`forEach`:return{type:`forEach`,as:`item`,over:``,steps:[]};case`paginate`:return{type:`paginate`,next:{selector:``},steps:[]};case`if`:return{type:`if`,test:``,steps:[]};case`fill`:return{type:`fill`,selector:``,value:``};case`click`:return{type:`click`,selector:``};case`set`:return{type:`set`,id:`value`,value:``};case`collect`:return{type:`collect`,into:``,value:``};case`hook`:return{type:`hook`,name:t};case`emit`:return{type:`emit`};default:return{type:e}}}var AA=[`forEach`,`paginate`,`if`];function jA(e,t,n=TA){let r=kA(e,n),i=[{kind:`word`,text:OA.find(t=>t.stepType===e)?.label??e}],a=AA.find(t=>t===e);return a===void 0?{kind:`card`,path:t,stepType:e,sentence:i,step:r,custom:!1}:{kind:`bracket`,path:t,stepType:a,sentence:i,step:r,children:[]}}function MA({onAdd:e,ariaLabel:t}){return(0,F.jsx)(NT,{size:`xs`,width:`9em`,variant:`outline`,children:(0,F.jsxs)(FT,{"aria-label":t,value:``,onChange:t=>{let n=t.target.value;n!==``&&e(n),t.target.value=``},children:[(0,F.jsx)(`option`,{value:``,disabled:!0,children:`+ Add step`}),OA.map(e=>(0,F.jsx)(`option`,{value:e.stepType,children:e.label},e.stepType))]})})}var NA=`application/x-opencraw-pill`;function PA({name:e,draggable:t=!0}){let n=t?t=>{t.dataTransfer.setData(NA,e),t.dataTransfer.setData(`text/plain`,e),t.dataTransfer.effectAllowed=`copy`}:void 0;return(0,F.jsx)(U,{as:`span`,display:`inline-block`,px:2,py:`1px`,borderRadius:`full`,fontSize:`xs`,fontWeight:`medium`,color:`white`,bg:vO(e),draggable:t,cursor:t?`grab`:void 0,onDragStart:n,children:e})}var FA=/^\{\{env\.[A-Za-z_]\w*\}\}$/;function IA({parts:e}){return(0,F.jsx)(K,{gap:1,wrap:`wrap`,fontSize:`sm`,children:e.map((e,t)=>{let n=`${t}:${e.kind}:${e.text}`;return e.kind===`pill`?(0,F.jsx)(PA,{name:e.text},n):e.kind===`code`&&FA.test(e.text)?(0,F.jsx)(LA,{placeholder:e.text},n):e.kind===`code`?(0,F.jsx)(U,{as:`code`,fontFamily:`mono`,fontSize:`xs`,bg:`bg.muted`,px:1,borderRadius:`sm`,children:e.text},n):(0,F.jsx)(U,{color:`fg.muted`,children:e.text},n)})})}function LA({placeholder:e}){let t=e.slice(6,-2);return(0,F.jsx)(U,{as:`span`,display:`inline-block`,px:2,py:`1px`,borderRadius:`full`,fontSize:`xs`,fontFamily:`mono`,fontWeight:`medium`,color:`red.fg`,bg:`red.subtle`,borderWidth:`1px`,borderColor:`red.muted`,title:`Never the real value — set the ${t} environment variable before running this recipe.`,children:e})}function RA({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(1)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(1)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function zA(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var BA=[],VA=0,{link:HA,unlink:UA,propagate:WA,checkDirty:GA,shallowPropagate:KA}=RA({update(e){return e._update()},notify(e){BA[JA++]=e,e.flags&=-3},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,QA(e))}}),qA=0,JA=0,YA,XA=0;function ZA(e){try{++XA,e()}finally{--XA||$A()}}function QA(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=UA(n,e)}function $A(){if(!(XA>0)){for(;qA<JA;){let e=BA[qA];BA[qA++]=void 0,e.notify()}qA=0,JA=0}}function ej(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:+!n,get(){return YA!==void 0&&HA(i,YA,VA),i._snapshot},subscribe(e){let t=zA(e),n={current:!1},r=tj(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=YA,o=t?.compare??Object.is;if(n)YA=i,++VA,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=5);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{YA=a,n&&(i.flags&=-5),QA(i)}}};return n?(i.flags=17,i.get=function(){let e=i.flags;if(e&16||e&32&&GA(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&KA(e)}}else e&32&&(i.flags=e&-33);return YA!==void 0&&HA(i,YA,VA),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(WA(e),KA(e),$A())}},i}function tj(e){let t=()=>{let t=YA;YA=n,++VA,n.depsTail=void 0,n.flags=6;try{return e()}finally{YA=t,n.flags&=-5,QA(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:6,notify(){let e=this.flags;e&16||e&32&&GA(this.deps,this)?t():this.flags=2},stop(){this.flags=0,this.depsTail=void 0,QA(this)}};return t(),n}var nj=class{constructor(e,t){this.atom=ej(e),this.get=this.get.bind(this),this.setState=this.setState.bind(this),this.subscribe=this.subscribe.bind(this),t&&(this.actions=t(this))}setState(e){this.atom.set(e)}get state(){return this.atom.get()}get(){return this.state}subscribe(e){return this.atom.subscribe(zA(e))}},rj=class{constructor(e){this.atom=ej(e)}get state(){return this.atom.get()}get(){return this.state}subscribe(e){return this.atom.subscribe(zA(e))}};function ij(e,t){return typeof e==`function`?new rj(e):t?new nj(e,t):new nj(e)}var aj=class{constructor(e,t){this.fn=e,this.options=t,this.lastExecutionTime=0,this.isPending=!1,this.maybeExecute=(...e)=>{let t=Date.now()-this.lastExecutionTime;if(this.options.leading&&t>=this.options.wait)this.execute(...e);else if(this.lastArgs=e,!this.timeoutId&&this.options.trailing){let e=this.options.wait-t;this.isPending=!0,this.timeoutId=setTimeout(()=>{this.lastArgs!==void 0&&this.execute(...this.lastArgs)},e)}},this.execute=(...e)=>{this.fn(...e),this.options.onExecute?.(e,this),this.lastExecutionTime=Date.now(),this.clearTimeout(),this.lastArgs=void 0,this.isPending=!1},this.flush=()=>{this.isPending&&this.lastArgs&&this.execute(...this.lastArgs)},this.cancel=()=>{this.clearTimeout(),this.lastArgs=void 0,this.isPending=!1},this.clearTimeout=()=>{this.timeoutId&&=(clearTimeout(this.timeoutId),void 0)},this.options.leading===void 0&&this.options.trailing===void 0&&(this.options.leading=!0,this.options.trailing=!0)}};function oj(e,t){return new aj(e,t).maybeExecute}var sj=class{#e=!0;#t;#n;#r;#i;#a;#o;#s;#c=0;#l=5;#u=!1;#d=!1;#f=null;#p=()=>{this.debugLog(`Connected to event bus`),this.#a=!0,this.#u=!1,this.debugLog(`Emitting queued events`,this.#i),this.#i.forEach(e=>this.emitEventToBus(e)),this.#i=[],this.stopConnectLoop(),this.#n().removeEventListener(`tanstack-connect-success`,this.#p)};#m=()=>{if(this.#c<this.#l){this.#c++,this.dispatchCustomEvent(`tanstack-connect`,{});return}this.#n().removeEventListener(`tanstack-connect`,this.#m),this.#d=!0,this.debugLog(`Max retries reached, giving up on connection`),this.stopConnectLoop()};#h=()=>{this.#u||(this.#u=!0,this.#n().addEventListener(`tanstack-connect-success`,this.#p),this.#m())};constructor({pluginId:e,debug:t=!1,enabled:n=!0,reconnectEveryMs:r=300}){this.#t=e,this.#e=n,this.#n=this.getGlobalTarget,this.#r=t,this.debugLog(` Initializing event subscription for plugin`,this.#t),this.#i=[],this.#a=!1,this.#d=!1,this.#o=null,this.#s=r}startConnectLoop(){this.#o!==null||this.#a||(this.debugLog(`Starting connect loop (every ${this.#s}ms)`),this.#o=setInterval(this.#m,this.#s))}stopConnectLoop(){this.#u=!1,this.#o!==null&&(clearInterval(this.#o),this.#o=null,this.#i=[],this.debugLog(`Stopped connect loop`))}debugLog(...e){this.#r&&console.log(`🌴 [tanstack-devtools:${this.#t}-plugin]`,...e)}getGlobalTarget(){if(typeof globalThis<`u`&&globalThis.__TANSTACK_EVENT_TARGET__)return this.debugLog(`Using global event target`),globalThis.__TANSTACK_EVENT_TARGET__;if(typeof window<`u`&&window.addEventListener!==void 0)return this.debugLog(`Using window as event target`),window;let e=typeof EventTarget<`u`?new EventTarget:void 0;return e===void 0||e.addEventListener===void 0?(this.debugLog(`No event mechanism available, running in non-web environment`),{addEventListener:()=>{},removeEventListener:()=>{},dispatchEvent:()=>!1}):(this.debugLog(`Using new EventTarget as fallback`),e)}getPluginId(){return this.#t}dispatchCustomEventShim(e,t){try{let n=new Event(e,{detail:t});this.#n().dispatchEvent(n)}catch{this.debugLog(`Failed to dispatch shim event`)}}dispatchCustomEvent(e,t){try{this.#n().dispatchEvent(new CustomEvent(e,{detail:t}))}catch{this.dispatchCustomEventShim(e,t)}}emitEventToBus(e){this.debugLog(`Emitting event to client bus`,e),this.dispatchCustomEvent(`tanstack-dispatch-event`,e)}createEventPayload(e,t){return{type:`${this.#t}:${e}`,payload:t,pluginId:this.#t}}emit(e,t){if(!this.#e){this.debugLog(`Event bus client is disabled, not emitting event`,e,t);return}if(this.#f&&(this.debugLog(`Emitting event to internal event target`,e,t),this.#f.dispatchEvent(new CustomEvent(`${this.#t}:${e}`,{detail:this.createEventPayload(e,t)}))),this.#d){this.debugLog(`Previously failed to connect, not emitting to bus`);return}if(!this.#a){this.debugLog(`Bus not available, will be pushed as soon as connected`),this.#i.push(this.createEventPayload(e,t)),typeof CustomEvent<`u`&&!this.#u&&(this.#h(),this.startConnectLoop());return}return this.emitEventToBus(this.createEventPayload(e,t))}on(e,t,n){let r=n?.withEventTarget??!1,i=`${this.#t}:${e}`;if(r&&(this.#f||=new EventTarget,this.#f.addEventListener(i,e=>{t(e.detail)})),!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`,i),()=>{};let a=e=>{this.debugLog(`Received event from bus`,e.detail),t(e.detail)};return this.#n().addEventListener(i,a),this.debugLog(`Registered event to bus`,i),()=>{r&&this.#f?.removeEventListener(i,a),this.#n().removeEventListener(i,a)}}onAll(e){if(!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`),()=>{};let t=t=>{let n=t.detail;e(n)};return this.#n().addEventListener(`tanstack-devtools-global`,t),()=>this.#n().removeEventListener(`tanstack-devtools-global`,t)}onAllPluginEvents(e){if(!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`),()=>{};let t=t=>{let n=t.detail;this.#t&&n.pluginId!==this.#t||e(n)};return this.#n().addEventListener(`tanstack-devtools-global`,t),()=>this.#n().removeEventListener(`tanstack-devtools-global`,t)}},cj=new class extends sj{constructor(){super({pluginId:`form-devtools`,reconnectEveryMs:1e3})}};function lj(e,t){return typeof e==`function`?e(t):e}function uj(e,t){return vj(t).reduce((e,t)=>{if(e===null)return null;if(e!==void 0)return e[t]},e)}function dj(e,t,n){let r=vj(t);function i(e){if(!r.length)return lj(n,e);let t=r.shift();if(typeof t==`string`||typeof t==`number`&&!Array.isArray(e))return typeof e==`object`?(e===null&&(e={}),{...e,[t]:i(e[t])}):{[t]:i()};if(Array.isArray(e)&&typeof t==`number`){let n=e.slice(0,t);return[...n.length?n:Array(t),i(e[t]),...e.slice(t+1)]}return[...Array(t),i()]}return i(e)}function fj(e,t){let n=vj(t);function r(e){if(!e)return;if(n.length===1){let t=n[0];if(Array.isArray(e)&&typeof t==`number`)return e.filter((e,n)=>n!==t);let{[t]:r,...i}=e;return i}let t=n.shift();if((typeof t==`string`||typeof t==`number`&&!Array.isArray(e))&&typeof e==`object`)return{...e,[t]:r(e[t])};if(typeof t==`number`&&Array.isArray(e)){if(t>=e.length)return e;let n=e.slice(0,t);return[...n.length?n:Array(t),r(e[t]),...e.slice(t+1)]}throw Error(`It seems we have created an infinite loop in deleteBy. `)}return r(e)}var pj=46,mj=91,hj=93,gj=48,_j=57;function vj(e){if(Array.isArray(e))return[...e];if(typeof e!=`string`)throw Error(`Path must be a string.`);let t=e.length,n=[],r=+(t>0&&e.charCodeAt(0)===mj),i=!0,a=-1;for(let o=r;o<=t;o++){let s=o<t?e.charCodeAt(o):-1;if(o===t||s===pj||s===mj||s===hj){let t=o-r;if(t>0){let a=i&&(t===1||e.charCodeAt(r)!==gj),s=e.slice(r,o);if(a){let e=parseInt(s,10);t<=15||String(e)===s?n.push(e):n.push(s)}else n.push(s)}else a!==hj&&(a!==-1||s!==hj)&&(a!==s||s!==pj&&s!==mj)&&n.push(``);r=o+1,i=!0}else(s<gj||s>_j)&&(i=!1);a=s}return n.length||n.push(``),n}function yj(e){return!(Array.isArray(e)&&e.length===0)}function bj(e,t){return t.validationLogic({form:t.form,group:t.group,validators:t.validators,event:{type:e,fieldName:t.fieldName,async:!1},runValidation:e=>e.validators.filter(Boolean).map(e=>({cause:e.cause,validate:e.fn}))})}function xj(e,t){let{asyncDebounceMs:n}=t,{onBlurAsyncDebounceMs:r,onChangeAsyncDebounceMs:i,onDynamicAsyncDebounceMs:a}=t.validators||{},o=n??0;return t.validationLogic({form:t.form,group:t.group,validators:t.validators,event:{type:e,fieldName:t.fieldName,async:!0},runValidation:t=>t.validators.filter(Boolean).map(t=>{let n=t?.cause||e,s=o;switch(n){case`change`:s=i??o;break;case`blur`:s=r??o;break;case`dynamic`:s=a??o;break;case`submit`:s=0}return e===`submit`&&(s=0),{cause:n,validate:t.fn,debounceMs:s}})})}var Sj=e=>!!e&&typeof e==`object`&&`fields`in e;function Cj(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!t.has(n)||!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length||n.length===0&&!Array.isArray(e)&&!Array.isArray(t)&&(Object.getPrototypeOf(e)!==Object.prototype||Object.getPrototypeOf(t)!==Object.prototype))return!1;for(let i of n)if(!r.includes(i)||!Cj(e[i],t[i]))return!1;return!0}var wj=({newFormValidatorError:e,isPreviousErrorFromFormValidator:t,previousErrorValue:n})=>e?{newErrorValue:e,newSource:`form`}:t?{newErrorValue:void 0,newSource:void 0}:n?{newErrorValue:n,newSource:`field`}:{newErrorValue:void 0,newSource:void 0},Tj=({formLevelError:e,fieldLevelError:t})=>t?{newErrorValue:t,newSource:`field`}:e?{newErrorValue:e,newSource:`form`}:{newErrorValue:void 0,newSource:void 0};function Ej(e,t){return e==null?t:{...e,...t}}for(var Dj=256,Oj=[],kj;Dj--;)Oj[Dj]=(Dj+256).toString(16).substring(1);function Aj(){let e=0,t,n=``;if(!kj||Dj+16>256){for(kj=Array(256),e=256;e--;)kj[e]=256*Math.random()|0;e=0,Dj=0}for(;e<16;e++)t=kj[Dj+e],n+=e===6?Oj[t&15|64]:e===8?Oj[t&63|128]:Oj[t],e&1&&e>1&&e<11&&(n+=`-`);return Dj++,n}var jj=oj(e=>cj.emit(`form-state`,{id:e.formId,state:e.store.state}),{wait:300});function Mj(e){if(typeof e!=`object`||!e)return e;if(e instanceof Date)return new Date(e.getTime());if(Array.isArray(e)){let t=[];for(let n=0;n<e.length;n++)t[n]=Mj(e[n]);return t}if(e instanceof Map){let t=new Map;return e.forEach((e,n)=>{t.set(n,Mj(e))}),t}if(e instanceof Set){let t=new Set;return e.forEach(e=>{t.add(Mj(e))}),t}let t={};for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=Mj(e[n]));return t}function Nj(e,t){return t===e||t.startsWith(`${e}.`)||t.startsWith(`${e}[`)}var Pj=e=>{if(!e.validators)return e.runValidation({validators:[],form:e.form});let t=e.event.async,n=t?void 0:{fn:e.validators.onMount,cause:`mount`},r={fn:t?e.validators.onChangeAsync:e.validators.onChange,cause:`change`},i={fn:t?e.validators.onBlurAsync:e.validators.onBlur,cause:`blur`},a={fn:t?e.validators.onSubmitAsync:e.validators.onSubmit,cause:`submit`},o=t?void 0:{fn:()=>void 0,cause:`server`};switch(e.event.type){case`mount`:return e.runValidation({validators:[n],form:e.form});case`submit`:return e.runValidation({validators:[r,i,a,o],form:e.form});case`server`:return e.runValidation({validators:[],form:e.form});case`blur`:return e.runValidation({validators:[i,o],form:e.form});case`change`:return e.runValidation({validators:[r,o],form:e.form});default:throw Error(`Unknown validation event type: ${e.event.type}`)}};function Fj(e,t){let n=new Map;for(let r of e){let e=r.path??[],i=t,a=``;for(let t=0;t<e.length;t++){let n=e[t];if(n===void 0)continue;let r=typeof n==`object`?n.key:n,o=Number(r);a+=Array.isArray(i)&&!Number.isNaN(o)?`[${o}]`:(t>0?`.`:``)+String(r),i=typeof i==`object`&&i?i[r]:void 0}n.set(a,(n.get(a)??[]).concat(r))}return Object.fromEntries(n)}var Ij=(e,t)=>{let n=Fj(e,t);return{form:n,fields:n}},Lj={validate({value:e,validationSource:t},n){let r=n[`~standard`].validate(e);if(r instanceof Promise)throw Error(`async function passed to sync validator`);if(r.issues)return t===`field`?r.issues:Ij(r.issues,e)},async validateAsync({value:e,validationSource:t},n){let r=await n[`~standard`].validate(e);if(r.issues)return t===`field`?r.issues:Ij(r.issues,e)}},Rj=e=>!!e&&`~standard`in e,zj={isValidating:!1,isTouched:!1,isBlurred:!1,isDirty:!1,isPristine:!0,isValid:!0,isDefaultValue:!0,errors:[],errorMap:{},errorSourceMap:{},_arrayVersion:0,_pendingValidationsCount:0};function Bj(e){function t(t){let n=e.getFieldMeta(t)??zj;e.setFieldMeta(t,{...n,_arrayVersion:(n._arrayVersion||0)+1})}function n(n,r,i){t(n);let a=s(n,r,`move`,i),c=Math.min(r,i),u=Math.max(r,i);for(let e=c;e<=u;e++)a.push(o(n,e));let d=Object.keys(e.fieldInfo).reduce((t,i)=>(i.startsWith(o(n,r))&&t.set(i,e.getFieldMeta(i)),t),new Map);l(a,r<i?`up`:`down`),Object.keys(e.fieldInfo).filter(e=>e.startsWith(o(n,i))).forEach(t=>{let a=t.replace(o(n,i),o(n,r)),s=d.get(a);s&&e.setFieldMeta(t,s)})}function r(e,n){t(e),l(s(e,n,`remove`),`up`)}function i(n,r,i){t(n),s(n,r,`swap`,i).forEach(t=>{if(!t.toString().startsWith(o(n,r)))return;let a=t.toString().replace(o(n,r),o(n,i)),[s,c]=[e.getFieldMeta(t),e.getFieldMeta(a)];s&&e.setFieldMeta(a,s),c&&e.setFieldMeta(t,c)})}function a(n,r){t(n);let i=s(n,r,`insert`);l(i,`down`),i.forEach(t=>{t.toString().startsWith(o(n,r))&&e.setFieldMeta(t,u())})}function o(e,t){return`${e}[${t}]`}function s(t,n,r,i){let a=[o(t,n)];switch(r){case`swap`:a.push(o(t,i));break;case`move`:{let[e,r]=[Math.min(n,i),Math.max(n,i)];for(let n=e;n<=r;n++)a.push(o(t,n));break}default:{let r=e.getFieldValue(t),i=Array.isArray(r)?r.length:0;for(let e=n+1;e<i;e++)a.push(o(t,e));break}}return Object.keys(e.fieldInfo).filter(e=>a.some(t=>e.startsWith(t)))}function c(e,t){return e.replace(/\[(\d+)\]/,(e,n)=>{let r=parseInt(n,10);return`[${t===`up`?r+1:Math.max(0,r-1)}]`})}function l(t,n){(n===`up`?t:[...t].reverse()).forEach(t=>{let r=c(t.toString(),n),i=e.getFieldMeta(r);i?e.setFieldMeta(t,i):e.setFieldMeta(t,u())})}let u=()=>zj;return{bumpArrayVersion:t,handleArrayMove:n,handleArrayRemove:r,handleArraySwap:i,handleArrayInsert:a}}function Vj(e){return{values:e.values??{},errorMap:e.errorMap??{},fieldMetaBase:e.fieldMetaBase??{},formGroupStateBase:e.formGroupStateBase??{},isSubmitted:e.isSubmitted??!1,isSubmitting:e.isSubmitting??!1,isValidating:e.isValidating??!1,submissionAttempts:e.submissionAttempts??0,isSubmitSuccessful:e.isSubmitSuccessful??!1,validationMetaMap:e.validationMetaMap??{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}}}var Hj=class{constructor(e){this.options={},this.fieldInfo={},this.formGroupApis=new Set,this.mount=()=>{let e=this.store.subscribe(()=>{jj(this)}),t=cj.on(`request-form-state`,e=>{e.payload.id===this._formId&&cj.emit(`form-api`,{id:this._formId,state:this.store.state,options:this.options})}),n=cj.on(`request-form-reset`,e=>{e.payload.id===this._formId&&this.reset()}),r=cj.on(`request-form-force-submit`,e=>{e.payload.id===this._formId&&(this._devtoolsSubmissionOverride=!0,this.handleSubmit(),this._devtoolsSubmissionOverride=!1)}),i=()=>{r(),n(),t(),e.unsubscribe(),cj.emit(`form-unmounted`,{id:this._formId})};this.options.listeners?.onMount?.({formApi:this});let{onMount:a}=this.options.validators||{};return cj.emit(`form-api`,{id:this._formId,state:this.store.state,options:this.options}),a&&this.validateSync(`mount`),i},this.update=e=>{if(!e)return;let t=this.options;this.options=e;let n=e.defaultValues&&!Cj(e.defaultValues,t.defaultValues)&&!this.state.isTouched,r=!Cj(e.defaultState,t.defaultState)&&!this.state.isTouched;if(n||r){if(ZA(()=>{this.baseStore.setState(()=>Vj(Object.assign({},this.state,r?e.defaultState:{},n?{values:e.defaultValues}:{})))}),n){let e=Bj(this);for(let t of Object.keys(this.fieldInfo))Array.isArray(this.getFieldValue(t))&&e.bumpArrayVersion(t)}cj.emit(`form-api`,{id:this._formId,state:this.store.state,options:this.options})}},this.reset=(e,t)=>{let{fieldMeta:n}=this.state,r=this.resetFieldMeta(n);e&&!t?.keepDefaultValues&&(this.options={...this.options,defaultValues:e}),this.baseStore.setState(()=>{let t=e??this.options.defaultValues??this.options.defaultState?.values;return e||Object.values(this.fieldInfo).forEach(e=>{e.instance&&e.instance.options.defaultValue!==void 0&&(t=dj(t,e.instance.name,e.instance.options.defaultValue))}),Vj({...this.options.defaultState,values:t,fieldMetaBase:r})})},this.validateAllFields=async e=>{let t=[];return ZA(()=>{Object.values(this.fieldInfo).forEach(n=>{if(!n.instance)return;let r=n.instance;t.push(Promise.resolve().then(()=>r.validate(e,{skipFormValidation:!0,skipGroupValidation:!0}))),n.instance.store.state.meta.isTouched||n.instance.setMeta(e=>({...e,isTouched:!0}))})}),(await Promise.all(t)).flat()},this.validateArrayFieldsStartingFrom=async(e,t,n)=>{let r=this.getFieldValue(e),i=Array.isArray(r)?Math.max(r.length-1,0):null,a=[`${e}[${t}]`];for(let n=t+1;n<=(i??0);n++)a.push(`${e}[${n}]`);let o=Object.keys(this.fieldInfo).filter(e=>a.some(t=>e.startsWith(t))),s=[];return ZA(()=>{o.forEach(e=>{s.push(Promise.resolve().then(()=>this.validateField(e,n)))})}),(await Promise.all(s)).flat()},this.validateField=(e,t)=>{let n=this.fieldInfo[e]?.instance;if(!n){let{hasErrored:n}=this.validateSync(t);return n&&!this.options.asyncAlways?this.getFieldMeta(e)?.errors??[]:this.validateAsync(t).then(()=>this.getFieldMeta(e)?.errors??[])}return n.store.state.meta.isTouched||n.setMeta(e=>({...e,isTouched:!0})),n.validate(t)},this.validateSync=(e,t)=>{let n=bj(e,{...this.options,form:this,group:t?.group,validationLogic:this.options.validationLogic||Pj}),r=!1,i={};return ZA(()=>{for(let e of n){if(!e.validate)continue;let{formError:n,fieldErrors:a}=Uj(this.runValidator({validate:e.validate,value:{value:this.state.values,formApi:this,validationSource:`form`},type:`validate`})),o=Wj(e.cause),s=new Set([...Object.keys(this.state.fieldMeta),...Object.keys(a||{})]);t?.filterFieldNames&&(s=new Set([...s].filter(t.filterFieldNames)));for(let e of s){if(this.baseStore.state.fieldMetaBase[e]===void 0&&!a?.[e])continue;let{errorMap:t,errorSourceMap:n}=this.getFieldMeta(e)??zj,r=a?.[e],{newErrorValue:s,newSource:c}=wj({newFormValidatorError:r,isPreviousErrorFromFormValidator:n?.[o]===`form`,previousErrorValue:t?.[o]});c===`form`&&(i[e]={...i[e],[o]:r}),t?.[o]!==s&&this.setFieldMeta(e,(e=zj)=>({...e,errorMap:{...e.errorMap,[o]:s},errorSourceMap:{...e.errorSourceMap,[o]:c}}))}t?.dontUpdateFormErrorMap||this.state.errorMap?.[o]!==n&&this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[o]:n}})),(n||a)&&(r=!0)}if(t?.dontUpdateFormErrorMap)return;let a=Wj(`submit`);this.state.errorMap?.[a]&&e!==`submit`&&!r&&this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[a]:void 0}}));let o=Wj(`server`);this.state.errorMap?.[o]&&e!==`server`&&!r&&this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[o]:void 0}}))}),{hasErrored:r,fieldsErrorMap:i}},this.validateAsync=async(e,t)=>{let n=xj(e,{...this.options,form:this,group:t?.group,validationLogic:this.options.validationLogic||Pj});this.state.isFormValidating||this.baseStore.setState(e=>({...e,isFormValidating:!0}));let r=[],i;for(let e of n){if(!e.validate)continue;let n=Wj(e.cause);this.state.validationMetaMap[n]?.lastAbortController.abort();let a=new AbortController;this.state.validationMetaMap[n]={lastAbortController:a},r.push(new Promise(async n=>{let r;try{r=await new Promise((t,n)=>{setTimeout(async()=>{if(a.signal.aborted)return t(void 0);try{t(await this.runValidator({validate:e.validate,value:{value:this.state.values,formApi:this,validationSource:`form`,signal:a.signal},type:`validateAsync`}))}catch(e){n(e)}},e.debounceMs)})}catch(e){r=e}let{formError:o,fieldErrors:s}=Uj(r);s&&(i=i?{...i,...s}:s);let c=Wj(e.cause),l=new Set([...Object.keys(this.state.fieldMeta),...Object.keys(i||{})]),u=Array.from(l);t?.filterFieldNames&&(u=u.filter(t.filterFieldNames));for(let e of u){if(this.baseStore.state.fieldMetaBase[e]===void 0&&!i?.[e])continue;let{errorMap:t,errorSourceMap:n}=this.getFieldMeta(e)??zj,r=i?.[e],{newErrorValue:a,newSource:o}=wj({newFormValidatorError:r,isPreviousErrorFromFormValidator:n?.[c]===`form`,previousErrorValue:t?.[c]});t?.[c]!==a&&this.setFieldMeta(e,(e=zj)=>({...e,errorMap:{...e.errorMap,[c]:a},errorSourceMap:{...e.errorSourceMap,[c]:o}}))}t?.dontUpdateFormErrorMap||this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[c]:o}})),n(i?{fieldErrors:i,errorMapKey:c}:void 0)}))}let a=[],o={};if(r.length){a=await Promise.all(r);for(let e of a)if(e?.fieldErrors){let{errorMapKey:t}=e;for(let[n,r]of Object.entries(e.fieldErrors))o[n]={...o[n]||{},[t]:r}}}return this.baseStore.setState(e=>({...e,isFormValidating:!1})),o},this.validate=(e,t)=>{let{hasErrored:n,fieldsErrorMap:r}=this.validateSync(e,t);return n&&!this.options.asyncAlways?r:this.validateAsync(e,t)},this._handleSubmit=async e=>{this.baseStore.setState(e=>({...e,isSubmitted:!1,submissionAttempts:e.submissionAttempts+1,isSubmitSuccessful:!1})),ZA(()=>{Object.values(this.fieldInfo).forEach(e=>{e.instance&&(e.instance.store.state.meta.isTouched||e.instance.setMeta(e=>({...e,isTouched:!0})))})});let t=e??this.options.onSubmitMeta;if(!this.state.canSubmit&&!this._devtoolsSubmissionOverride&&this.baseStore.state.submissionAttempts<=1){this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:t});return}this.baseStore.setState(e=>({...e,isSubmitting:!0}));let n=()=>{this.baseStore.setState(e=>({...e,isSubmitting:!1}))};if(await this.validateAllFields(`submit`),!this.state.isFieldsValid){n(),this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:t}),cj.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:`validateAllFields`,errors:Object.values(this.state.fieldMeta).map(e=>e.errors).flat()});return}if(await this.validate(`submit`),!this.state.isValid){n(),this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:t}),cj.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:`validate`,errors:this.state.errors});return}ZA(()=>{Object.values(this.fieldInfo).forEach(e=>{e.instance?.triggerOnSubmitListener()})}),this.options.listeners?.onSubmit?.({formApi:this,meta:t});try{await this.options.onSubmit?.({value:this.state.values,formApi:this,meta:t}),ZA(()=>{this.baseStore.setState(e=>({...e,isSubmitted:!0,isSubmitSuccessful:!0})),cj.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!0}),n()})}catch(e){throw this.baseStore.setState(e=>({...e,isSubmitSuccessful:!1})),cj.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:`inflight`,onError:e}),n(),e}},this.getFieldValue=e=>uj(this.state.values,e),this.getFieldMeta=e=>this.state.fieldMeta[e],this.getFormGroupMeta=e=>this.formGroupMetaDerived.state[e],this.getFieldInfo=e=>this.fieldInfo[e]||={instance:null,validationMetaMap:{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}},this.setFieldMeta=(e,t)=>{this.baseStore.setState(n=>({...n,fieldMetaBase:{...n.fieldMetaBase,[e]:lj(t,n.fieldMetaBase[e])}}))},this.resetFieldMeta=e=>Object.keys(e).reduce((e,t)=>{let n=t;return e[n]=zj,e},{}),this.setFieldValue=(e,t,n)=>{let r=n?.dontUpdateMeta??!1,i=n?.dontRunListeners??!1,a=n?.dontValidate??!1;ZA(()=>{r||this.setFieldMeta(e,e=>({...e,isTouched:!0,isDirty:!0,errorMap:{...e?.errorMap,onMount:void 0}})),this.baseStore.setState(n=>({...n,values:dj(n.values,e,t)}))}),i||this.getFieldInfo(e).instance?.triggerOnChangeListener(),a||this.validateField(e,`change`)},this.deleteField=e=>{let t=[...Object.keys(this.fieldInfo).filter(t=>{let n=e.toString();return t.startsWith(`${n}.`)||t.startsWith(`${n}[`)}),e];this.baseStore.setState(e=>{let n={...e};return t.forEach(e=>{n.values=fj(n.values,e),delete this.fieldInfo[e],delete n.fieldMetaBase[e]}),n})},this.pushFieldValue=(e,t,n)=>{this.setFieldValue(e,e=>[...Array.isArray(e)?e:[],t],n),Bj(this).bumpArrayVersion(e)},this.insertFieldValue=async(e,t,n,r)=>{this.setFieldValue(e,e=>[...e.slice(0,t),n,...e.slice(t)],Ej(r,{dontValidate:!0}));let i=r?.dontValidate??!1;i||await this.validateField(e,`change`),Bj(this).handleArrayInsert(e,t),i||await this.validateArrayFieldsStartingFrom(e,t,`change`)},this.replaceFieldValue=async(e,t,n,r)=>{this.setFieldValue(e,e=>e.map((e,r)=>r===t?n:e),Ej(r,{dontValidate:!0})),Bj(this).bumpArrayVersion(e),(r?.dontValidate??!1)||(await this.validateField(e,`change`),await this.validateArrayFieldsStartingFrom(e,t,`change`))},this.removeFieldValue=async(e,t,n)=>{let r=this.getFieldValue(e),i=Array.isArray(r)?Math.max(r.length-1,0):null;if(this.setFieldValue(e,e=>e.filter((e,n)=>n!==t),Ej(n,{dontValidate:!0})),Bj(this).handleArrayRemove(e,t),i!==null){let t=`${e}[${i}]`;this.deleteField(t)}(n?.dontValidate??!1)||(await this.validateField(e,`change`),await this.validateArrayFieldsStartingFrom(e,t,`change`))},this.swapFieldValues=(e,t,n,r)=>{this.setFieldValue(e,e=>{let r=e[t],i=e[n];return dj(dj(e,`${t}`,i),`${n}`,r)},Ej(r,{dontValidate:!0})),Bj(this).handleArraySwap(e,t,n),(r?.dontValidate??!1)||(this.validateField(e,`change`),this.validateField(`${e}[${t}]`,`change`),this.validateField(`${e}[${n}]`,`change`))},this.moveFieldValues=(e,t,n,r)=>{this.setFieldValue(e,e=>{let r=[...e];return r.splice(n,0,r.splice(t,1)[0]),r},Ej(r,{dontValidate:!0})),Bj(this).handleArrayMove(e,t,n),(r?.dontValidate??!1)||(this.validateField(e,`change`),this.validateField(`${e}[${t}]`,`change`),this.validateField(`${e}[${n}]`,`change`))},this.clearFieldValues=(e,t)=>{let n=this.getFieldValue(e),r=Array.isArray(n)?Math.max(n.length-1,0):null;if(this.setFieldValue(e,[],Ej(t,{dontValidate:!0})),Bj(this).bumpArrayVersion(e),r!==null)for(let t=0;t<=r;t++){let n=`${e}[${t}]`;this.deleteField(n)}(t?.dontValidate??!1)||this.validateField(e,`change`)},this.resetField=e=>{this.baseStore.setState(t=>{let n=this.getFieldInfo(e).instance?.options.defaultValue,r=uj(this.options.defaultValues,e),i=n??r;return{...t,fieldMetaBase:{...t.fieldMetaBase,[e]:zj},values:i===void 0?t.values:dj(t.values,e,i)}})},this.setErrorMap=e=>{ZA(()=>{Object.entries(e).forEach(([e,t])=>{let n=e;if(Sj(t)){let{formError:e,fieldErrors:r}=Uj(t);for(let e of Object.keys(this.fieldInfo))this.getFieldMeta(e)&&this.setFieldMeta(e,t=>({...t,errorMap:{...t.errorMap,[n]:r?.[e]},errorSourceMap:{...t.errorSourceMap,[n]:`form`}}));this.baseStore.setState(t=>({...t,errorMap:{...t.errorMap,[n]:e}}))}else this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[n]:t}}))})})},this.getAllErrors=()=>({form:{errors:this.state.errors,errorMap:this.state.errorMap},fields:Object.entries(this.state.fieldMeta).reduce((e,[t,n])=>(Object.keys(n).length&&n.errors.length&&(e[t]={errors:n.errors,errorMap:n.errorMap}),e),{})}),this.parseValuesWithSchema=e=>Lj.validate({value:this.state.values,validationSource:`form`},e),this.parseValuesWithSchemaAsync=e=>Lj.validateAsync({value:this.state.values,validationSource:`form`},e),this.timeoutIds={validations:{},listeners:{},formListeners:{}},this._formId=e?.formId??Aj(),this._devtoolsSubmissionOverride=!1;let t=Vj({...e?.defaultState,values:e?.defaultValues??e?.defaultState?.values});if(e?.transform){t=e.transform({state:t}).state;for(let e of Object.keys(t.errorMap)){let n=t.errorMap[e];if(n!==void 0&&Sj(n))for(let r of Object.keys(n.fields)){let i=n.fields[r];if(i===void 0)continue;let a=t.fieldMetaBase[r];t.fieldMetaBase[r]={isTouched:!1,isValidating:!1,isBlurred:!1,isDirty:!1,_arrayVersion:0,_pendingValidationsCount:0,...a??{},errorSourceMap:{...a?.errorSourceMap??{},onChange:`form`},errorMap:{...a?.errorMap??{},[e]:i}}}}}this.baseStore=ij(t);let n;this.fieldMetaDerived=ij(e=>{let t=this.baseStore.get(),r=0,i={};for(let a of Object.keys(t.fieldMetaBase)){let o=t.fieldMetaBase[a],s=n?.fieldMetaBase[a],c=e?.[a],l=uj(t.values,a),u=c?.errors;if(!s||o.errorMap!==s.errorMap){u=Object.values(o.errorMap??{}).filter(e=>e!==void 0);let e=this.getFieldInfo(a)?.instance;(!e||!e.options.disableErrorFlat)&&(u=u.flat(1))}let d=!yj(u),f=!o.isDirty,p=Cj(l,this.getFieldInfo(a)?.instance?.options.defaultValue??uj(this.options.defaultValues,a));if(c&&c.isPristine===f&&c.isValid===d&&c.isDefaultValue===p&&c.errors===u&&o===s){i[a]=c,r++;continue}i[a]={...o,errors:u??[],isPristine:f,isValid:d,isDefaultValue:p}}return Object.keys(t.fieldMetaBase).length?e&&r===Object.keys(t.fieldMetaBase).length?e:(n=this.baseStore.get(),i):i}),this.formGroupMetaDerived=ij(e=>{let t=this.baseStore.get(),n=this.fieldMetaDerived.get(),r={};for(let i of this.formGroupApis){let a=i.name,o=t.formGroupStateBase[a]??{isSubmitted:!1,isSubmitting:!1,isValidating:!1,submissionAttempts:0,isSubmitSuccessful:!1},s=n[a],c=!1,l=!0,u=!1,d=!1,f=!0,p=!1;for(let e in n){if(e===a||!Nj(a,e))continue;let t=n[e];t&&(t.isValidating&&(c=!0),t.isValid||(l=!1),t.isTouched&&(u=!0),t.isBlurred&&(d=!0),t.isDefaultValue||(f=!1),t.isDirty&&(p=!0))}let m=!p,h=!!c||o.isValidating,g=s?.errorMap??{},_=s?.errorSourceMap??{},v=!!(g.onMount||Object.entries(n).some(([e,t])=>t&&e!==a&&Nj(a,e)&&t.errorMap.onMount)),y=e?.[a],b=y?.errors??[];(!y||y.__srcErrorMap!==g)&&(b=Object.values(g).reduce((e,t)=>{if(t===void 0)return e;if(t&&typeof t==`object`&&`fields`in t){let n=t.group;return n!==void 0&&e.push(n),e}return e.push(t),e},[]));let x=b.length===0,S=l&&x,C=i.options.canSubmitWhenInvalid??!1,w=o.submissionAttempts===0&&!u&&!v||!h&&!o.isSubmitting&&S||C;if(y&&y.errorMap===g&&y.errorSourceMap===_&&y.errors===b&&y.isFieldsValidating===c&&y.isFieldsValid===l&&y.isGroupValid===x&&y.isValid===S&&y.canSubmit===w&&y.isTouched===u&&y.isBlurred===d&&y.isPristine===m&&y.isDefaultValue===f&&y.isDirty===p&&y.isValidating===h&&y.isSubmitting===o.isSubmitting&&y.isSubmitted===o.isSubmitted&&y.submissionAttempts===o.submissionAttempts&&y.isSubmitSuccessful===o.isSubmitSuccessful){r[a]=y;continue}let T={...o,errorMap:g,errorSourceMap:_,_arrayVersion:s?._arrayVersion??0,isTouched:u,isBlurred:d,isDirty:p,isPristine:m,isDefaultValue:f,isValid:S,errors:b,isValidating:h,isFieldsValidating:c,isFieldsValid:l,isGroupValid:x,canSubmit:w};Object.defineProperty(T,"__srcErrorMap",{value:g,enumerable:!1,configurable:!0}),r[a]=T}return r});let r;this.store=ij(e=>{let t=this.baseStore.get(),n=this.fieldMetaDerived.get(),i=Object.values(n).filter(Boolean),a=i.some(e=>e.isValidating),o=i.every(e=>e.isValid),s=i.some(e=>e.isTouched),c=i.some(e=>e.isBlurred),l=i.every(e=>e.isDefaultValue),u=s&&t.errorMap?.onMount,d=i.some(e=>e.isDirty),f=!d,p=!!(t.errorMap?.onMount||i.some(e=>e?.errorMap?.onMount)),m=!!a,h=e?.errors??[];(!r||t.errorMap!==r.errorMap)&&(h=Object.values(t.errorMap).reduce((e,t)=>t===void 0?e:t&&Sj(t)?(e.push(t.form),e):(e.push(t),e),[]));let g=h.length===0,_=o&&g,v=this.options.canSubmitWhenInvalid??!1,y=t.submissionAttempts===0&&!s&&!p||!m&&!t.isSubmitting&&_||v,b=t.errorMap;if(u&&(h=h.filter(e=>e!==t.errorMap.onMount),b=Object.assign(b,{onMount:void 0})),e&&r&&e.errorMap===b&&e.fieldMeta===this.fieldMetaDerived.state&&e.errors===h&&e.isFieldsValidating===a&&e.isFieldsValid===o&&e.isFormValid===g&&e.isValid===_&&e.canSubmit===y&&e.isTouched===s&&e.isBlurred===c&&e.isPristine===f&&e.isDefaultValue===l&&e.isDirty===d&&Cj(r,t))return e;let x={...t,errorMap:b,fieldMeta:this.fieldMetaDerived.state,errors:h,isFieldsValidating:a,isFieldsValid:o,isFormValid:g,isValid:_,canSubmit:y,isTouched:s,isBlurred:c,isPristine:f,isDefaultValue:l,isDirty:d};return r=this.baseStore.get(),x}),this.handleSubmit=this.handleSubmit.bind(this),this.update(e||{})}get state(){return this.store.state}get formId(){return this._formId}runValidator(e){return Rj(e.validate)?Lj[e.type](e.value,e.validate):e.validate(e.value)}handleSubmit(e){return this._handleSubmit(e)}};function Uj(e){return e?Sj(e)?{formError:Uj(e.form).formError,fieldErrors:e.fields}:{formError:e}:{formError:void 0}}function Wj(e){switch(e){case`submit`:return`onSubmit`;case`blur`:return`onBlur`;case`mount`:return`onMount`;case`server`:return`onServer`;case`dynamic`:return`onDynamic`;default:return`onChange`}}var Gj=class e{constructor(t){this.options={},this.mount=()=>{this.options.defaultValue!==void 0&&!this.getMeta().isTouched&&this.form.setFieldValue(this.name,this.options.defaultValue,{dontUpdateMeta:!0});let e=this.getInfo();e.instance=this,this.update(this.options);let{onMount:t}=this.options.validators||{};if(t){let e=this.runValidator({validate:t,value:{value:this.state.value,fieldApi:this,validationSource:`field`},type:`validate`});e&&this.setMeta(t=>({...t,errorMap:{...t?.errorMap,onMount:e},errorSourceMap:{...t?.errorSourceMap,onMount:`field`}}))}return this.options.listeners?.onMount?.({value:this.state.value,fieldApi:this}),()=>{for(let[e,t]of Object.entries(this.timeoutIds.validations))t&&(clearTimeout(t),this.timeoutIds.validations[e]=null);for(let[e,t]of Object.entries(this.timeoutIds.listeners))t&&(clearTimeout(t),this.timeoutIds.listeners[e]=null);for(let[e,t]of Object.entries(this.timeoutIds.formListeners))t&&(clearTimeout(t),this.timeoutIds.formListeners[e]=null);let e=this.form.fieldInfo[this.name];if(e&&e.instance===this){for(let[t,n]of Object.entries(e.validationMetaMap))n?.lastAbortController.abort(),e.validationMetaMap[t]=void 0;this.form.baseStore.setState(e=>({...e,fieldMetaBase:{...e.fieldMetaBase,[this.name]:{...zj,isTouched:e.fieldMetaBase[this.name]?.isTouched??zj.isTouched,isBlurred:e.fieldMetaBase[this.name]?.isBlurred??zj.isBlurred,isDirty:e.fieldMetaBase[this.name]?.isDirty??zj.isDirty}}})),e.instance=null,this.options.listeners?.onUnmount?.({value:this.state.value,fieldApi:this}),this.form.options.listeners?.onFieldUnmount?.({formApi:this.form,fieldApi:this})}}},this.update=e=>{this.options=e,this.name=e.name,!this.state.meta.isTouched&&this.options.defaultValue!==void 0&&(Cj(this.form.getFieldValue(this.name),e.defaultValue)||this.form.setFieldValue(this.name,e.defaultValue,{dontUpdateMeta:!0,dontValidate:!0,dontRunListeners:!0})),this.form.getFieldMeta(this.name)||this.form.setFieldMeta(this.name,this.state.meta)},this.getValue=()=>this.form.getFieldValue(this.name),this.setValue=(e,t)=>{this.form.setFieldValue(this.name,e,Ej(t,{dontRunListeners:!0,dontValidate:!0})),t?.dontRunListeners||this.triggerOnChangeListener(),t?.dontValidate||this.validate(`change`)},this.getMeta=()=>this.store.state.meta,this.setMeta=e=>this.form.setFieldMeta(this.name,e),this.getInfo=()=>this.form.getFieldInfo(this.name),this.pushValue=(e,t)=>{this.form.pushFieldValue(this.name,e,Ej(t,{dontRunListeners:!0})),t?.dontRunListeners||this.triggerOnChangeListener()},this.insertValue=(e,t,n)=>{this.form.insertFieldValue(this.name,e,t,Ej(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.replaceValue=(e,t,n)=>{this.form.replaceFieldValue(this.name,e,t,Ej(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.removeValue=(e,t)=>{this.form.removeFieldValue(this.name,e,Ej(t,{dontRunListeners:!0})),t?.dontRunListeners||this.triggerOnChangeListener()},this.swapValues=(e,t,n)=>{this.form.swapFieldValues(this.name,e,t,Ej(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.moveValue=(e,t,n)=>{this.form.moveFieldValues(this.name,e,t,Ej(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.clearValues=e=>{this.form.clearFieldValues(this.name,Ej(e,{dontRunListeners:!0})),e?.dontRunListeners||this.triggerOnChangeListener()},this.getLinkedFields=t=>{let n=Object.values(this.form.fieldInfo),r=[];for(let i of n){if(!i.instance||!(i.instance instanceof e))continue;let{onChangeListenTo:n,onBlurListenTo:a}=i.instance.options.validators||{};t===`change`&&n?.includes(this.name)&&r.push(i.instance),t===`blur`&&a?.includes(this.name)&&r.push(i.instance)}return r},this.validateSync=(e,t)=>{let n=bj(e,{...this.options,form:this.form,fieldName:this.name,validationLogic:this.form.options.validationLogic||Pj}),r=this.getLinkedFields(e).reduce((t,n)=>{let r=bj(e,{...n.options,form:n.form,fieldName:n.name,validationLogic:n.form.options.validationLogic||Pj});return r.forEach(e=>{e.field=n}),t.concat(r)},[]),i=!1;ZA(()=>{let e=(e,n)=>{let r=qj(n.cause),a=n.validate?Kj(e.runValidator({validate:n.validate,value:{value:e.store.state.value,validationSource:`field`,fieldApi:e},type:`validate`})):void 0,o=t[r],{newErrorValue:s,newSource:c}=Tj({formLevelError:o,fieldLevelError:a});e.state.meta.errorMap?.[r]!==s&&e.setMeta(e=>({...e,errorMap:{...e.errorMap,[r]:s},errorSourceMap:{...e.errorSourceMap,[r]:c}})),s&&(i=!0)};for(let t of n)e(this,t);for(let t of r)t.validate&&e(t.field,t)});let a=qj(`submit`);return this.state.meta.errorMap?.[a]&&e!==`submit`&&!i&&this.setMeta(e=>({...e,errorMap:{...e.errorMap,[a]:void 0},errorSourceMap:{...e.errorSourceMap,[a]:void 0}})),{hasErrored:i}},this.validateAsync=async(e,t)=>{let n=xj(e,{...this.options,form:this.form,fieldName:this.name,validationLogic:this.form.options.validationLogic||Pj}),r=await t,i=this.getLinkedFields(e).reduce((t,n)=>{let r=xj(e,{...n.options,form:n.form,fieldName:n.name,validationLogic:n.form.options.validationLogic||Pj});return r.forEach(e=>{e.field=n}),t.concat(r)},[]),a=[],o=[],s=n.some(e=>e.validate),c=Array.from(new Set(i.filter(e=>e.validate).map(e=>e.field)));ZA(()=>{s&&this.startValidation();for(let e of c)e.startValidation()});let l=(e,t,n)=>{let i=qj(t.cause),a=e.getInfo();a.validationMetaMap[i]?.lastAbortController.abort();let o=new AbortController;a.validationMetaMap[i]={lastAbortController:o},n.push(new Promise(async n=>{let a;try{a=await new Promise((n,r)=>{e.timeoutIds.validations[t.cause]&&(clearTimeout(e.timeoutIds.validations[t.cause]),e.endValidation()),e.timeoutIds.validations[t.cause]=setTimeout(async()=>{if(o.signal.aborted)return n(void 0);try{n(await this.runValidator({validate:t.validate,value:{value:e.store.state.value,fieldApi:e,signal:o.signal,validationSource:`field`},type:`validateAsync`}))}catch(e){r(e)}},t.debounceMs)})}catch(e){a=e}if(o.signal.aborted)return n(void 0);let s=Kj(a),c=r[e.name]?.[i],{newErrorValue:l,newSource:u}=Tj({formLevelError:c,fieldLevelError:s});if(e.getInfo().instance!==e)return n(void 0);e.setMeta(e=>({...e,errorMap:{...e?.errorMap,[i]:l},errorSourceMap:{...e.errorSourceMap,[i]:u}})),n(l)}))};for(let e of n)e.validate&&l(this,e,a);for(let e of i)e.validate&&l(e.field,e,o);let u=[];return(a.length||o.length)&&(u=await Promise.all(a),await Promise.all(o)),ZA(()=>{s&&this.endValidation();for(let e of c)e.endValidation()}),u.filter(Boolean)},this.validate=(e,t)=>{if(!this.state.meta.isTouched)return[];let n=t?.skipGroupValidation?[]:Array.from(this.form.formGroupApis).filter(e=>this.name.startsWith(e.name)),r=(t?.skipFormValidation?{fieldsErrorMap:{}}:this.form.validateSync(e)).fieldsErrorMap[this.name]??{};if(!t?.skipFormValidation)for(let t of n){if(t.state.meta.submissionAttempts===0)continue;let{fieldsErrorMap:n}=this.form.validateSync(e,{group:t,dontUpdateFormErrorMap:!0,filterFieldNames:e=>Nj(t.name,e)});r={...r,...n[this.name]??{}}}let{hasErrored:i}=this.validateSync(e,r),a=new WeakMap;for(let t of n){let{hasErrored:n}=t.validateSync(e,{},{skipRelatedFieldValidation:!0});a.set(t,n)}if(i&&!this.options.asyncAlways){this.getInfo().validationMetaMap[qj(e)]?.lastAbortController.abort();let t=[];for(let r of n)r.getInfo().validationMetaMap[qj(e)]?.lastAbortController.abort(),t.push(r.state.meta.errors);return[...this.state.meta.errors,...t.flat()]}let o=t?.skipFormValidation?Promise.resolve({}):this.form.validateAsync(e),s=this.validateAsync(e,o),c=[];for(let t of n)(!a.get(t)||t.options.asyncAlways)&&c.push(t.validateAsync(e,o,{skipRelatedFieldValidation:!0}));return c.length===0?s:Promise.all([s,...c]).then(e=>e.flat())},this.handleChange=e=>{this.setValue(e)},this.handleBlur=()=>{this.state.meta.isTouched||this.setMeta(e=>({...e,isTouched:!0})),this.state.meta.isBlurred||this.setMeta(e=>({...e,isBlurred:!0})),this.validate(`blur`),this.triggerOnBlurListener()},this.setErrorMap=e=>{this.setMeta(t=>({...t,errorMap:{...t.errorMap,...e}}))},this.parseValueWithSchema=e=>Lj.validate({value:this.state.value,validationSource:`field`},e),this.parseValueWithSchemaAsync=e=>Lj.validateAsync({value:this.state.value,validationSource:`field`},e),this.triggerOnBlurListener=()=>{let e=this.form.options.listeners?.onBlurDebounceMs;e&&e>0?(this.timeoutIds.formListeners.blur&&clearTimeout(this.timeoutIds.formListeners.blur),this.timeoutIds.formListeners.blur=setTimeout(()=>{this.form.options.listeners?.onBlur?.({formApi:this.form,fieldApi:this})},e)):this.form.options.listeners?.onBlur?.({formApi:this.form,fieldApi:this});let t=this.options.listeners?.onBlurDebounceMs;t&&t>0?(this.timeoutIds.listeners.blur&&clearTimeout(this.timeoutIds.listeners.blur),this.timeoutIds.listeners.blur=setTimeout(()=>{this.options.listeners?.onBlur?.({value:this.state.value,fieldApi:this})},t)):this.options.listeners?.onBlur?.({value:this.state.value,fieldApi:this})},this.triggerOnChangeListener=()=>{let e=this.form.options.listeners?.onChangeDebounceMs;e&&e>0?(this.timeoutIds.formListeners.change&&clearTimeout(this.timeoutIds.formListeners.change),this.timeoutIds.formListeners.change=setTimeout(()=>{this.form.options.listeners?.onChange?.({formApi:this.form,fieldApi:this})},e)):this.form.options.listeners?.onChange?.({formApi:this.form,fieldApi:this});let t=this.options.listeners?.onChangeDebounceMs;t&&t>0?(this.timeoutIds.listeners.change&&clearTimeout(this.timeoutIds.listeners.change),this.timeoutIds.listeners.change=setTimeout(()=>{this.options.listeners?.onChange?.({value:this.state.value,fieldApi:this})},t)):this.options.listeners?.onChange?.({value:this.state.value,fieldApi:this});for(let e of this.form.formGroupApis)Nj(e.name,this.name)&&e.triggerOnChangeListener()},this.triggerOnSubmitListener=()=>{this.options.listeners?.onSubmit?.({value:this.state.value,fieldApi:this})},this.form=t.form,this.name=t.name,this.options=t,this.timeoutIds={validations:{},listeners:{},formListeners:{}},this.store=ij(e=>{this.form.store.get();let n=this.form.getFieldMeta(this.name)??{...zj,...t.defaultMeta},r=this.form.getFieldValue(this.name);return!n.isTouched&&r===void 0&&this.options.defaultValue!==void 0&&!Cj(r,this.options.defaultValue)&&(r=this.options.defaultValue),e&&e.value===r&&e.meta===n?e:{value:r,meta:n}})}get state(){return this.store.state}runValidator(e){return Rj(e.validate)?Lj[e.type](e.value,e.validate):e.validate(e.value)}startValidation(){this.setMeta(e=>{let t=e._pendingValidationsCount+1;return{...e,_pendingValidationsCount:t,isValidating:t>0&&!e.isValidating||e.isValidating}})}endValidation(){this.setMeta(e=>{let t=Math.max(0,e._pendingValidationsCount-1);return{...e,_pendingValidationsCount:t,isValidating:t===0&&e.isValidating?!1:e.isValidating}})}};function Kj(e){if(e)return e}function qj(e){switch(e){case`submit`:return`onSubmit`;case`blur`:return`onBlur`;case`mount`:return`onMount`;case`server`:return`onServer`;case`dynamic`:return`onDynamic`;default:return`onChange`}}function Jj(e){return{isSubmitted:e.isSubmitted??!1,isSubmitting:e.isSubmitting??!1,isValidating:e.isValidating??!1,submissionAttempts:e.submissionAttempts??0,isSubmitSuccessful:e.isSubmitSuccessful??!1}}function Yj(e){return{...zj,...e,errors:[],isPristine:!0,isValid:!0,isDefaultValue:!0,isFieldsValidating:!1,isFieldsValid:!0,isGroupValid:!0,canSubmit:!0,isSubmitting:!1,isSubmitted:!1,isValidating:!1,submissionAttempts:0,isSubmitSuccessful:!1}}var Xj=class e{constructor(t){this.options={},this.setFormGroupState=e=>{this.form.baseStore.setState(t=>{let n=t.formGroupStateBase[this.name]??Jj({});return{...t,formGroupStateBase:{...t.formGroupStateBase,[this.name]:e(n)}}})},this._lastDistributedFieldNames={},this.update=e=>{this.options=e,this.name=e.name,!this.state.meta.isTouched&&this.options.defaultValue!==void 0&&(Cj(this.form.getFieldValue(this.name),e.defaultValue)||this.form.setFieldValue(this.name,e.defaultValue,{dontUpdateMeta:!0,dontValidate:!0,dontRunListeners:!0})),this.form.getFieldMeta(this.name)||this.form.setFieldMeta(this.name,{...zj,...this.options.defaultMeta})},this.mount=()=>{this.update(this.options),this.form.formGroupApis.add(this),this.fieldInfo.instance=this,this.form.baseStore.setState(e=>({...e,formGroupStateBase:{...e.formGroupStateBase,[this.name]:e.formGroupStateBase[this.name]??Jj({...this.options.defaultState})}}));let{onMount:e}=this.options.validators||{};if(e){let t=this.runValidator({validate:e,value:{value:this.state.value,groupApi:this,validationSource:`form`},type:`validate`}),n=t,r;Qj(t)&&(n=t.group,r=t.fields);let i=Zj(n);i&&this.setMeta(e=>({...e,errorMap:{...e.errorMap,onMount:i},errorSourceMap:{...e.errorSourceMap,onMount:`field`}})),this.distributeFieldErrors(`onMount`,r)}return this.options.listeners?.onMount?.({value:this.state.value,groupApi:this}),()=>{for(let[e,t]of Object.entries(this.timeoutIds.validations))t&&(clearTimeout(t),this.timeoutIds.validations[e]=null);for(let[e,t]of Object.entries(this.timeoutIds.listeners))t&&(clearTimeout(t),this.timeoutIds.listeners[e]=null);for(let[e,t]of Object.entries(this.timeoutIds.formListeners))t&&(clearTimeout(t),this.timeoutIds.formListeners[e]=null);if(this.fieldInfo.instance===this){for(let[e,t]of Object.entries(this.fieldInfo.validationMetaMap))t?.lastAbortController.abort(),this.fieldInfo.validationMetaMap[e]=void 0;this.form.formGroupApis.delete(this),this.form.baseStore.setState(e=>({...e,formGroupStateBase:{...e.formGroupStateBase,[this.name]:Jj({})}})),this.fieldInfo.instance=null,this.options.listeners?.onUnmount?.({value:this.state.value,groupApi:this})}}},this.setValue=(e,t)=>{this.form.setFieldValue(this.name,e,Ej(t,{dontRunListeners:!0,dontValidate:!0})),t?.dontRunListeners||this.triggerOnChangeListener(),t?.dontValidate||this.validate(`change`)},this.getMeta=()=>this.store.state.meta,this.setMeta=e=>this.form.setFieldMeta(this.name,e),this.getInfo=()=>this.fieldInfo,this.getRelatedFields=()=>{let e=Object.values(this.form.fieldInfo),t=[];for(let n of e)n.instance&&n.instance instanceof Gj&&n.instance.name.startsWith(this.name)&&t.push(n.instance);return t},this.getRelatedFieldMetasDerived=()=>{let e=Object.entries(this.form.fieldMetaDerived.state),t=[];for(let[n,r]of e)n!==this.name&&Nj(this.name,n)&&t.push({...r,name:n});return t},this.buildChildFieldName=e=>e===``?this.name:e.startsWith(`[`)?`${this.name}${e}`:`${this.name}.${e}`,this.distributeFieldErrors=(e,t)=>{let n=this._lastDistributedFieldNames[e]??new Set,r=new Set;if(t)for(let[e,n]of Object.entries(t))n!=null&&n!==!1&&r.add(this.buildChildFieldName(e));let i=new Set([...n,...r]),a=!1;for(let n of i){let r=n.startsWith(this.name+`[`)?n.slice(this.name.length):n.slice(this.name.length+1),i=t?.[r],o=this.form.getFieldMeta(n);if(!o&&!i)continue;let s=o?.errorMap[e],{newErrorValue:c,newSource:l}=wj({newFormValidatorError:i,isPreviousErrorFromFormValidator:o?.errorSourceMap[e]===`form`,previousErrorValue:s});c&&(a=!0),(s!==c||o?.errorSourceMap[e]!==l)&&this.form.setFieldMeta(n,(t=zj)=>({...t,errorMap:{...t.errorMap,[e]:c},errorSourceMap:{...t.errorSourceMap,[e]:l}}))}return this._lastDistributedFieldNames[e]=r,a},this.validateSync=(t,n,r={})=>{let i=bj(t,{...this.options,form:this.form,group:this,validationLogic:this.options.validationLogic||this.form.options.validationLogic||Pj}),a=(r.skipRelatedFieldValidation?[]:this.getRelatedFields()).reduce((e,n)=>{let r=bj(t,{...n.options,form:n.form,validationLogic:n.form.options.validationLogic||Pj});return r.forEach(e=>{e.field=n}),e.concat(r)},[]),o=!1;ZA(()=>{let t=(t,r)=>{let i=eM(r.cause),a=t===this,s;r.validate&&(s=t.runValidator({validate:r.validate,value:{value:t.store.state.value,validationSource:a?`form`:`field`,...t instanceof e?{groupApi:t}:{fieldApi:t}},type:`validate`}));let c=s,l;a&&Qj(s)&&(c=s.group,l=s.fields);let u=Zj(c),d=n[i],{newErrorValue:f,newSource:p}=Tj({formLevelError:d,fieldLevelError:u});t.state.meta.errorMap?.[i]!==f&&t.setMeta(e=>({...e,errorMap:{...e.errorMap,[i]:f},errorSourceMap:{...e.errorSourceMap,[i]:p}})),f&&(o=!0),a&&this.distributeFieldErrors(i,l)&&(o=!0)};for(let e of i)t(this,e);for(let e of a)e.validate&&t(e.field,e)});let s=eM(`submit`);return this.state.meta.errorMap?.[s]&&t!==`submit`&&!o&&this.setMeta(e=>({...e,errorMap:{...e.errorMap,[s]:void 0},errorSourceMap:{...e.errorSourceMap,[s]:void 0}})),{hasErrored:o}},this.validateAsync=async(t,n,r={})=>{let i=xj(t,{...this.options,form:this.form,group:this,validationLogic:this.options.validationLogic||this.form.options.validationLogic||Pj}),a=await n,o=r.skipRelatedFieldValidation?[]:this.getRelatedFields(),s=o.reduce((e,n)=>{let r=xj(t,{...n.options,form:n.form,validationLogic:n.form.options.validationLogic||Pj});return r.forEach(e=>{e.field=n}),e.concat(r)},[]),c=[],l=[],u=i.some(e=>e.validate)||s.some(e=>e.validate);if(u){this.state.meta.isValidating||this.setMeta(e=>({...e,isValidating:!0}));for(let e of o)e.setMeta(e=>({...e,isValidating:!0}))}let d=(t,n,r)=>{let i=eM(n.cause),o=t.getInfo();o.validationMetaMap[i]?.lastAbortController.abort();let s=new AbortController;o.validationMetaMap[i]={lastAbortController:s};let c=t===this;r.push(new Promise(async r=>{let o;try{o=await new Promise((r,i)=>{t.timeoutIds.validations[n.cause]&&clearTimeout(t.timeoutIds.validations[n.cause]),t.timeoutIds.validations[n.cause]=setTimeout(async()=>{if(s.signal.aborted)return r(void 0);try{r(await this.runValidator({validate:n.validate,value:{value:t.store.state.value,signal:s.signal,validationSource:c?`form`:`field`,...t instanceof e?{groupApi:t}:{fieldApi:t}},type:`validateAsync`}))}catch(e){i(e)}},n.debounceMs)})}catch(e){o=e}if(s.signal.aborted)return r(void 0);let l=o,u;c&&Qj(o)&&(l=o.group,u=o.fields);let d=Zj(l),f=a[t.name]?.[i],{newErrorValue:p,newSource:m}=Tj({formLevelError:f,fieldLevelError:d});if(t.getInfo().instance!==t)return r(void 0);t.setMeta(e=>({...e,errorMap:{...e?.errorMap,[i]:p},errorSourceMap:{...e.errorSourceMap,[i]:m}})),c&&this.distributeFieldErrors(i,u),r(p)}))};for(let e of i)e.validate&&d(this,e,c);for(let e of s)e.validate&&d(e.field,e,l);let f=[];if((c.length||l.length)&&(f=await Promise.all(c),await Promise.all(l)),u){this.setMeta(e=>({...e,isValidating:!1}));for(let e of o)e.setMeta(e=>({...e,isValidating:!1}))}return f.filter(Boolean)},this.validateAllFields=async e=>{let t=[];return ZA(()=>{Object.values(this.getRelatedFields()).forEach(n=>{t.push(Promise.resolve().then(()=>n.validate(e,{skipFormValidation:!0,skipGroupValidation:!0}))),n.store.state.meta.isTouched||n.setMeta(e=>({...e,isTouched:!0}))})}),(await Promise.all(t)).flat()},this.validateArrayFieldsStartingFrom=(e,t,n)=>this.form.validateArrayFieldsStartingFrom(e,t,n),this.validateField=(e,t)=>this.form.validateField(e,t),this.getFieldValue=e=>this.form.getFieldValue(e),this.getFieldMeta=e=>this.form.getFieldMeta(e),this.setFieldMeta=(e,t)=>this.form.setFieldMeta(e,t),this.setFieldValue=(e,t)=>this.form.setFieldValue(e,t),this.deleteField=e=>this.form.deleteField(e),this.pushFieldValue=(e,t)=>this.form.pushFieldValue(e,t),this.insertFieldValue=(e,t,n)=>this.form.insertFieldValue(e,t,n),this.replaceFieldValue=(e,t,n)=>this.form.replaceFieldValue(e,t,n),this.swapFieldValues=(e,t,n)=>this.form.swapFieldValues(e,t,n),this.moveFieldValues=(e,t,n)=>this.form.moveFieldValues(e,t,n),this.clearFieldValues=e=>this.form.clearFieldValues(e),this.resetField=e=>this.form.resetField(e),this.removeFieldValue=(e,t)=>this.form.removeFieldValue(e,t),this.areRelatedFieldsValid=()=>Object.values(this.getRelatedFields()).every(e=>e.state.meta.isValid),this.validate=(e,t)=>{let{fieldsErrorMap:n}=t?.skipFormValidation?{fieldsErrorMap:{}}:this.form.validateSync(e,{dontUpdateFormErrorMap:!0,filterFieldNames:e=>Nj(this.name,e)}),{hasErrored:r}=this.validateSync(e,n[this.name]??{},{skipRelatedFieldValidation:t?.skipRelatedFieldValidation});if(r&&!this.options.asyncAlways)return this.getInfo().validationMetaMap[eM(e)]?.lastAbortController.abort(),this.state.meta.errors;let i=t?.skipFormValidation?Promise.resolve({}):this.form.validateAsync(e,{dontUpdateFormErrorMap:!0,filterFieldNames:e=>Nj(this.name,e)});return this.validateAsync(e,i,{skipRelatedFieldValidation:t?.skipRelatedFieldValidation})},this.triggerOnChangeListener=()=>{let e=this.form.options.listeners?.onChangeGroupDebounceMs;e&&e>0?(this.timeoutIds.formListeners.change&&clearTimeout(this.timeoutIds.formListeners.change),this.timeoutIds.formListeners.change=setTimeout(()=>{this.form.options.listeners?.onChangeGroup?.({formApi:this.form,groupApi:this})},e)):this.form.options.listeners?.onChangeGroup?.({formApi:this.form,groupApi:this});let t=this.options.listeners?.onChangeDebounceMs;t&&t>0?(this.timeoutIds.listeners.change&&clearTimeout(this.timeoutIds.listeners.change),this.timeoutIds.listeners.change=setTimeout(()=>{this.options.listeners?.onChange?.({value:this.state.value,groupApi:this})},t)):this.options.listeners?.onChange?.({value:this.state.value,groupApi:this})},this.triggerOnSubmitListener=()=>{this.options.listeners?.onSubmit?.({value:this.state.value,groupApi:this})},this._handleSubmit=async e=>{this.setFormGroupState(e=>({...e,isSubmitted:!1,submissionAttempts:e.submissionAttempts+1,isSubmitSuccessful:!1})),ZA(()=>{Object.values(this.getRelatedFields()).forEach(e=>{e.state.meta.isTouched||e.setMeta(e=>({...e,isTouched:!0}))})});let t=e??this.options.onSubmitMeta;this.setFormGroupState(e=>({...e,isSubmitting:!0}));let n=()=>{this.setFormGroupState(e=>({...e,isSubmitting:!1}))};if(await this.validateAllFields(`submit`),!this.areRelatedFieldsValid()){n(),this.options.onGroupSubmitInvalid?.({value:this.state.value,groupApi:this,meta:t});return}if(await this.validate(`submit`,{skipRelatedFieldValidation:!0}),!this.areRelatedFieldsValid()||!this.state.meta.isValid){n(),this.options.onGroupSubmitInvalid?.({value:this.state.value,groupApi:this,meta:t});return}ZA(()=>{Object.values(this.getRelatedFields()).forEach(e=>{e.options.listeners?.onGroupSubmit?.({value:e.state.value,fieldApi:e})})}),this.options.listeners?.onSubmit?.({groupApi:this,value:this.state.value});try{await this.options.onGroupSubmit?.({value:this.state.value,groupApi:this,meta:t}),ZA(()=>{this.setFormGroupState(e=>({...e,isSubmitted:!0,isSubmitSuccessful:!0})),n()})}catch(e){throw this.setFormGroupState(e=>({...e,isSubmitSuccessful:!1})),n(),e}},this.form=t.form,this.name=t.name,this.options=t,this.timeoutIds={validations:{},listeners:{},formListeners:{}},this.fieldInfo={instance:null,validationMetaMap:{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}},this.store=ij(e=>{this.form.formGroupMetaDerived.get(),this.form.baseStore.get();let n=this.form.getFormGroupMeta(this.name)??Yj(t.defaultMeta),r=this.form.getFieldValue(this.name);return!n.isTouched&&r===void 0&&this.options.defaultValue!==void 0&&!Cj(r,this.options.defaultValue)&&(r=this.options.defaultValue),e&&e.value===r&&e.meta===n?e:{value:r,meta:n}}),this.handleSubmit=this.handleSubmit.bind(this)}get state(){return this.store.state}runValidator(e){if(Rj(e.validate)){let t=Lj[e.type](e.value,e.validate);return e.type===`validate`?$j(t):t.then($j)}return e.validate(e.value)}handleSubmit(e){return this._handleSubmit(e)}};function Zj(e){if(e)return e}function Qj(e){return!!e&&typeof e==`object`&&`fields`in e}function $j(e){if(!e||typeof e!=`object`||!(`form`in e)&&!(`fields`in e))return e;let{form:t,fields:n,...r}=e;return{...r,group:t,fields:n}}function eM(e){switch(e){case`submit`:return`onSubmit`;case`blur`:return`onBlur`;case`mount`:return`onMount`;case`server`:return`onServer`;case`dynamic`:return`onDynamic`;default:return`onChange`}}function tM(e,t){if(!t)return;let n=Object.assign({},e,{state:Mj(e.state)});t(n),n.fieldInfo!==e.fieldInfo&&(e.fieldInfo=n.fieldInfo),n.options!==e.options&&(e.options=n.options);let r=Object.keys({values:null,validationMetaMap:null,fieldMetaBase:null,formGroupStateBase:null,isSubmitting:null,isSubmitted:null,isValidating:null,submissionAttempts:null,isSubmitSuccessful:null,_force_re_eval:null}).reduce((t,r)=>(e.state[r]!==n.state[r]&&(t[r]=n.state[r]),t),{});return ZA(()=>{Object.keys(r).length&&e.baseStore.setState(e=>({...e,...r})),n.state.errorMap!==e.state.errorMap&&e.setErrorMap(n.state.errorMap)}),n}var nM=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})),rM=o(((e,t)=>{t.exports=nM()})),iM=o((e=>{var t=u(),n=rM();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}})),aM=o(((e,t)=>{t.exports=iM()}))();function oM(e,t){return e===t}function sM(e,t=e=>e,n){let r=n?.compare??oM,i=(0,P.useCallback)(t=>{let{unsubscribe:n}=e.subscribe(t);return n},[e]),a=(0,P.useCallback)(()=>e.get(),[e]);return(0,aM.useSyncExternalStoreWithSelector)(i,a,a,t,r)}var cM=typeof window<`u`?P.useLayoutEffect:P.useEffect;function lM(e){let[t,n]=(0,P.useState)(()=>({form:e.form,name:e.name})),[r,i]=(0,P.useState)(()=>new Gj({...e})),a=r;(t.form!==e.form||t.name!==e.name)&&(a=new Gj({...e}),i(a),n({form:e.form,name:e.name}));let o=sM(a.store,e.mode===`array`?e=>e.meta._arrayVersion||0:e=>e.value),s=sM(a.store,e=>e.meta.isTouched),c=sM(a.store,e=>e.meta.isBlurred),l=sM(a.store,e=>e.meta.isDirty),u=sM(a.store,e=>e.meta.errorMap),d=sM(a.store,e=>e.meta.errorSourceMap),f=sM(a.store,e=>e.meta.isValidating),p=(0,P.useMemo)(()=>({...a,get state(){return{value:e.mode===`array`?a.state.value:o,get meta(){return{...a.state.meta,isTouched:s,isBlurred:c,isDirty:l,errorMap:u,errorSourceMap:d,isValidating:f}}}}}),[a,e.mode,o,s,c,l,u,d,f]);return cM(a.mount,[a]),cM(()=>{a.update(e)}),p}var uM=(({children:e,...t})=>{let n=lM(t),r=(0,P.useMemo)(()=>lj(e,n),[e,n]);return(0,F.jsx)(F.Fragment,{children:r})});function dM(){return(0,P.useState)(()=>Aj())[0]}var fM=P,pM=`19.3.0`.split(`.`)[0]===`17`?dM:fM.useId;function mM(e){let[t,n]=(0,P.useState)(()=>({form:e.form,name:e.name})),[r,i]=(0,P.useState)(()=>new Xj({...e}));(t.form!==e.form||t.name!==e.name)&&(i(new Xj({...e})),n({form:e.form,name:e.name}));let a=sM(r.store,e=>e.value),o=sM(r.store,e=>e.meta.isTouched),s=sM(r.store,e=>e.meta.isBlurred),c=sM(r.store,e=>e.meta.isDirty),l=sM(r.store,e=>e.meta.errorMap),u=sM(r.store,e=>e.meta.errorSourceMap),d=sM(r.store,e=>e.meta.isValidating),f=sM(r.store,e=>e.meta.isSubmitting),p=sM(r.store,e=>e.meta.isSubmitted),m=sM(r.store,e=>e.meta.submissionAttempts),h=sM(r.store,e=>e.meta.isSubmitSuccessful),g=sM(r.store,e=>e.meta.canSubmit),_=sM(r.store,e=>e.meta.isValid),v=sM(r.store,e=>e.meta.isFieldsValid),y=sM(r.store,e=>e.meta.isFieldsValidating),b=sM(r.store,e=>e.meta.isGroupValid),x=(0,P.useMemo)(()=>({...r,handleSubmit:((...e)=>r._handleSubmit(...e)),get state(){return{...r.state,value:a,get meta(){return{...r.state.meta,isTouched:o,isBlurred:s,isDirty:c,errorMap:l,errorSourceMap:u,isValidating:d,isSubmitting:f,isSubmitted:p,submissionAttempts:m,isSubmitSuccessful:h,canSubmit:g,isValid:_,isFieldsValid:v,isFieldsValidating:y,isGroupValid:b}}}}}),[r,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b]);return cM(r.mount,[r]),cM(()=>{r.update(e)}),x}var hM=(({children:e,...t})=>{let n=mM(t),r=(0,P.useMemo)(()=>lj(e,n),[e,n]);return(0,F.jsx)(F.Fragment,{children:r})});function gM({form:e,selector:t=e=>e,children:n}){let r=sM(e.store,t);return(0,F.jsx)(F.Fragment,{children:lj(n,r)})}function _M(e){let t=pM(),[n,r]=(0,P.useState)(e?.formId),[i,a]=(0,P.useState)(()=>new Hj({...e,formId:e?.formId??t}));if(n!==e?.formId){let n=e?.formId??t;a(new Hj({...e,formId:n})),r(n)}let o=(0,P.useMemo)(()=>{let e={...i,handleSubmit:((...e)=>i._handleSubmit(...e)),get formId(){return i._formId},get state(){return i.store.state}};return e.Field=function(e){return(0,F.jsx)(uM,{...e,form:i})},e.FormGroup=function(e){return(0,F.jsx)(hM,{...e,form:i})},e.Subscribe=function(e){return(0,F.jsx)(gM,{form:i,selector:e.selector,children:e.children})},e},[i]);cM(i.mount,[]),cM(()=>{i.update(e)});let s=(0,P.useRef)(!1);return cM(()=>{s.current&&e?.transform&&tM(i,e.transform)},[i,e?.transform]),cM(()=>{s.current=!0}),o}var vM={key:`id`,label:`id`,kind:`string`},yM={key:`when`,label:`when (template)`,kind:`string`},bM={goto:[{key:`url`,label:`url`,kind:`string`},{key:`waitUntil`,label:`wait until`,kind:`enum`,options:[`load`,`domcontentloaded`,`networkidle`,`commit`]},yM],click:[{key:`selector`,label:`selector`,kind:`string`},{key:`optional`,label:`optional`,kind:`boolean`},vM,yM],fill:[{key:`selector`,label:`selector`,kind:`string`},{key:`value`,label:`value (template)`,kind:`string`},vM,yM],press:[{key:`selector`,label:`selector`,kind:`string`},{key:`key`,label:`key`,kind:`string`},vM,yM],select:[{key:`selector`,label:`selector`,kind:`string`},{key:`value`,label:`value`,kind:`string`},vM,yM],scroll:[{key:`to`,label:`to`,kind:`string`},{key:`untilStable`,label:`until stable`,kind:`boolean`},yM],wait:[{key:`selector`,label:`selector`,kind:`string`},{key:`ms`,label:`ms`,kind:`number`},yM],screenshot:[{key:`path`,label:`path`,kind:`string`},vM,yM],request:[{key:`url`,label:`url`,kind:`string`},{key:`method`,label:`method`,kind:`enum`,options:[`GET`,`POST`,`PUT`,`PATCH`,`DELETE`,`HEAD`]},{key:`as`,label:`read as`,kind:`enum`,options:[`text`,`json`,`html`,`xml`,`csv`,`yaml`,`pdf`,`workbook`,`deck`]},vM,yM],extract:[{key:`selector`,label:`selector`,kind:`string`},{key:`kind`,label:`kind`,kind:`enum`,options:[`css`,`xpath`,`jsonpath`,`table`]},{key:`take`,label:`take`,kind:`string`},{key:`many`,label:`many`,kind:`boolean`},{key:`from`,label:`from (id)`,kind:`string`},vM,yM],set:[{key:`value`,label:`value (JSON)`,kind:`json`},vM,yM],collect:[{key:`into`,label:`into (id)`,kind:`string`},{key:`value`,label:`value (JSON)`,kind:`json`},yM],forEach:[{key:`as`,label:`as`,kind:`string`},{key:`over`,label:`over (id)`,kind:`string`},{key:`selector`,label:`selector (live elements)`,kind:`string`},{key:`emit`,label:`emits a record`,kind:`boolean`},vM,yM],paginate:[{key:`until`,label:`until (template)`,kind:`string`},{key:`maxPages`,label:`max pages`,kind:`number`},vM,yM],if:[{key:`test`,label:`test (template)`,kind:`string`},vM],hook:[{key:`name`,label:`hook`,kind:`hook`},{key:`args`,label:`args (JSON)`,kind:`json`},vM,yM],emit:[{key:`output`,label:`output recipe id`,kind:`string`},yM]};function xM({stepType:e,step:t,onChange:n,onCommit:r}){let[i,a]=(0,P.useState)(!1),o=bM[e]??[],s=_M({defaultValues:t});return(0,F.jsxs)(Qw,{gap:2,p:2,borderWidth:`1px`,borderRadius:`md`,bg:`bg.subtle`,children:[o.map(e=>(0,F.jsx)(s.Field,{name:e.key,validators:{onMount:({value:t})=>SM(e,t),onChange:({value:t})=>SM(e,t)},children:i=>(0,F.jsxs)(Qw,{gap:0,children:[(0,F.jsx)(CM,{field:e,value:i.state.value,onChange:r=>{i.handleChange(r),n({...t,[e.key]:r})},onCommit:()=>{i.handleBlur(),r()}}),i.state.meta.errors.length>0&&(0,F.jsx)(U,{fontSize:`xs`,color:`fg.error`,children:String(i.state.meta.errors[0])})]})},e.key)),o.length===0&&(0,F.jsx)(U,{fontSize:`xs`,color:`fg.muted`,children:`No common fields for this step type; edit its JSON below.`}),(0,F.jsxs)(I,{children:[(0,F.jsxs)(U,{as:`button`,fontSize:`xs`,color:`fg.muted`,cursor:`pointer`,onClick:()=>{a(e=>!e)},children:[i?`▾`:`▸`,` Advanced (JSON)`]}),i&&(0,F.jsx)(TM,{step:t,onChange:n,onCommit:r})]})]})}function SM(e,t){return t!==void 0&&typeof t!=`number`&&e.kind===`number`?`must be a number`:void 0}function CM({field:e,value:t,onChange:n,onCommit:r}){return e.kind===`boolean`?(0,F.jsxs)(Uw,{checked:t===!0,onCheckedChange:e=>{n(e.checked===!0),r()},children:[(0,F.jsx)(qw,{}),(0,F.jsx)(Kw,{}),(0,F.jsx)(Ww,{fontSize:`sm`,children:e.label})]}):e.kind===`enum`?(0,F.jsxs)(xT,{children:[(0,F.jsx)(ST,{fontSize:`xs`,children:e.label}),(0,F.jsx)(NT,{size:`sm`,children:(0,F.jsxs)(FT,{value:typeof t==`string`?t:``,onChange:e=>{n(e.target.value===``?void 0:e.target.value),r()},children:[(0,F.jsx)(`option`,{value:``,children:`(default)`}),e.options?.map(e=>(0,F.jsx)(`option`,{value:e,children:e},e))]})})]}):e.kind===`hook`?(0,F.jsxs)(xT,{children:[(0,F.jsx)(ST,{fontSize:`xs`,children:e.label}),(0,F.jsx)(DA,{ariaLabel:e.label,value:typeof t==`string`?t:``,onChange:n,onCommit:r})]}):e.kind===`json`?(0,F.jsx)(wM,{field:e,value:t,onChange:n,onCommit:r}):(0,F.jsxs)(xT,{children:[(0,F.jsx)(ST,{fontSize:`xs`,children:e.label}),(0,F.jsx)(ET,{size:`sm`,type:e.kind===`number`?`number`:`text`,value:t===void 0?``:String(t),onChange:t=>{n(e.kind===`number`?EM(t.target.value):t.target.value)},onBlur:r})]})}function wM({field:e,value:t,onChange:n,onCommit:r}){let[i,a]=(0,P.useState)(()=>DM(t));return(0,F.jsxs)(xT,{children:[(0,F.jsx)(ST,{fontSize:`xs`,children:e.label}),(0,F.jsx)(ET,{size:`sm`,fontFamily:`mono`,value:i,onChange:e=>{a(e.target.value)},onBlur:()=>{n(OM(i)),r()}})]})}function TM({step:e,onChange:t,onCommit:n}){let[r,i]=(0,P.useState)(()=>JSON.stringify(e,null,2)),[a,o]=(0,P.useState)();return(0,F.jsxs)(Qw,{gap:1,mt:1,children:[(0,F.jsx)(DE,{size:`sm`,fontFamily:`mono`,fontSize:`xs`,rows:6,"aria-label":`Advanced step JSON`,value:r,onChange:e=>{i(e.target.value)},onBlur:()=>{try{let e=JSON.parse(r);if(typeof e!=`object`||!e||Array.isArray(e))throw Error(`a step is a JSON object`);o(void 0),t(e),n()}catch(e){o(e instanceof Error?e.message:String(e))}}}),a!==void 0&&(0,F.jsx)(U,{fontSize:`xs`,color:`fg.error`,children:a})]})}function EM(e){if(e===``)return;let t=Number(e);return Number.isNaN(t)?void 0:t}function DM(e){return typeof e==`string`?e:e===void 0?``:JSON.stringify(e)}function OM(e){try{return JSON.parse(e)}catch{return e}}function kM({listId:e,nodes:t,allIssues:n,actions:r,menuLabel:i}){return(0,F.jsxs)(Qw,{gap:1,children:[(0,F.jsx)(MA,{ariaLabel:`${i} at the start`,onAdd:t=>{r.insert(e,0,t)}}),t.map((a,o)=>(0,F.jsxs)(Qw,{gap:1,children:[(0,F.jsx)(AM,{node:a,listId:e,index:o,lastIndex:t.length-1,allIssues:n,actions:r}),(0,F.jsx)(MA,{ariaLabel:`${i} after this step`,onAdd:t=>{r.insert(e,o+1,t)}})]},a.path))]})}function AM({node:e,listId:t,index:n,lastIndex:r,allIssues:i,actions:a,readOnly:o=!1}){let[s,c]=(0,P.useState)(!1),l=e.kind===`bracket`,u=e.kind===`card`&&e.custom,d=jO(i,e.path),f=typeof e.step.id==`string`?e.step.id:void 0,p=qO(e=>e.hoveredStepId),m=qO(e=>e.setHoveredStepId),h=f!==void 0&&f===p;return(0,F.jsxs)(Qw,{gap:1,"data-testid":`outline-card-${e.path}`,children:[(0,F.jsxs)(K,{gap:2,p:2,borderWidth:`1px`,borderRadius:`md`,"data-highlighted":h,borderColor:h?`orange.solid`:void 0,bg:h?`orange.subtle`:u?`bg.muted`:`bg.panel`,cursor:o?`default`:`pointer`,onClick:o?void 0:()=>{c(e=>!e)},onMouseEnter:o||f===void 0?void 0:()=>{m(f)},onMouseLeave:o||f===void 0?void 0:()=>{m(void 0)},children:[!o&&(0,F.jsxs)(Qw,{gap:0,flexShrink:0,children:[(0,F.jsx)(Jw,{"aria-label":`Move up`,size:`2xs`,variant:`ghost`,disabled:n===0,onClick:e=>{e.stopPropagation(),a.move(t,n,-1)},children:`↑`}),(0,F.jsx)(Jw,{"aria-label":`Move down`,size:`2xs`,variant:`ghost`,disabled:n===r,onClick:e=>{e.stopPropagation(),a.move(t,n,1)},children:`↓`})]}),(0,F.jsxs)(I,{flex:`1`,children:[(0,F.jsx)(IA,{parts:e.sentence}),d.length>0&&(0,F.jsx)(Qw,{gap:0,mt:1,children:d.map(e=>(0,F.jsx)(U,{fontSize:`xs`,color:`fg.error`,children:e.message},e.message))})]}),!o&&(0,F.jsx)(Jw,{"aria-label":`Remove step`,size:`2xs`,variant:`ghost`,onClick:e=>{e.stopPropagation(),a.remove(t,n)},children:`✕`})]}),s&&!u&&!o&&(0,F.jsx)(I,{pl:8,children:(0,F.jsx)(xM,{stepType:e.stepType,step:e.step,onChange:t=>{a.edit(e.path,e=>({...e,step:t}))},onCommit:a.commit})}),s&&u&&!o&&(0,F.jsxs)(I,{pl:8,children:[(0,F.jsx)(U,{fontSize:`xs`,color:`fg.muted`,mb:1,children:`This step doesn't read as a sentence yet: edit its JSON directly.`}),(0,F.jsx)(xM,{stepType:e.stepType,step:e.step,onChange:t=>{a.edit(e.path,e=>({...e,step:t}))},onCommit:a.commit})]}),l&&(0,F.jsxs)(I,{pl:8,borderLeftWidth:`2px`,borderColor:`border.muted`,children:[(0,F.jsx)(kM,{listId:`${e.path}::then`,nodes:e.children,allIssues:i,actions:a,menuLabel:`Add step`}),e.stepType===`if`&&e.elseChildren!==void 0&&(0,F.jsxs)(Qw,{gap:1,mt:2,children:[(0,F.jsx)(U,{fontSize:`xs`,fontWeight:`medium`,color:`fg.muted`,children:`Else`}),(0,F.jsx)(kM,{listId:`${e.path}::else`,nodes:e.elseChildren,allIssues:i,actions:a,menuLabel:`Add step`})]}),e.stepType===`if`&&e.elseChildren===void 0&&(0,F.jsx)(Lw,{size:`xs`,variant:`outline`,mt:2,onClick:()=>{a.insert(`${e.path}::else`,0,`emit`)},children:`+ Add an else branch`})]})]})}var jM={edit:()=>{},commit:()=>{},move:()=>{},remove:()=>{},insert:()=>{}};function MM({recipe:e,onSaveOutline:t}){let[n,r]=(0,P.useState)(e?.outline);(0,P.useEffect)(()=>{r(e?.outline)},[e?.file,e?.text]);let[i,a]=(0,P.useState)(new Set),[o,s]=(0,P.useState)(!1),c=EA(),l=ZO(e=>e.recipeId),u=ZO(e=>e.active),d=ZO(e=>e.stoppedSteps!==void 0),f=ZO(e=>e.cards),p=ZO(e=>e.notes);if(e===void 0)return(0,F.jsx)(I,{p:4,color:`fg.muted`,children:(0,F.jsx)(U,{children:`Select a recipe to see its steps.`})});if(n===void 0)return(0,F.jsx)(I,{p:4,color:`fg.muted`,children:(0,F.jsx)(U,{children:`This recipe has no steps to show (not an input recipe, or its JSON is not an object).`})});let m=n=>{r(n),t(e.file,n)},h={edit:(e,t)=>{r(n=>n===void 0?n:SO(n,e,t))},commit:()=>{r(n=>(n!==void 0&&t(e.file,n),n))},move:(e,t,r)=>{if(n===void 0)return;let i=bO(n,e),a=t+r;if(a<0||a>=i.length)return;let o=[...i],[s]=o.splice(t,1);o.splice(a,0,s),m(xO(n,e,o))},remove:(e,t)=>{if(n===void 0)return;let r=bO(n,e);m(xO(n,e,r.filter((e,n)=>n!==t)))},insert:(e,t,r)=>{if(n===void 0)return;let i=bO(n,e),a=jA(r,`${EO(e)}.${t}`,c?.[0]);m(xO(n,e,[...i.slice(0,t),a,...i.slice(t)]))}};function g(e,t){if(n===void 0||e.selector===void 0)return;let r={kind:`bracket`,path:`steps.${n.steps.length}`,stepType:`paginate`,sentence:[{kind:`word`,text:`For every page — click`},{kind:`code`,text:e.selector}],step:{type:`paginate`,next:{selector:e.selector},steps:[]},children:[]};m({...n,steps:[...n.steps,r]}),a(e=>new Set(e).add(t))}let _=l===e.id&&(u||d);function v(e){if(!CA(e.dataTransfer))return;e.preventDefault(),s(!1);let t=SA(e.dataTransfer);t!==void 0&&n!==void 0&&m({...n,steps:[...n.steps,{...t,path:`steps.${String(n.steps.length)}`}]})}function y(e){CA(e.dataTransfer)&&(e.preventDefault(),e.dataTransfer.dropEffect=`copy`,s(!0))}return(0,F.jsxs)(I,{h:`full`,overflow:`auto`,p:2,"data-testid":`steps-outline`,"data-card-over":o,outline:o?`2px dashed`:void 0,outlineColor:`blue.solid`,outlineOffset:`-4px`,onDragOver:y,onDragLeave:()=>{s(!1)},onDrop:v,children:[(0,F.jsx)(kM,{listId:``,nodes:n.steps,allIssues:e.issues,actions:h,menuLabel:`Add step`},e.file),_&&(0,F.jsxs)(I,{mt:3,pt:2,borderTopWidth:`1px`,borderColor:`border.muted`,"data-testid":`recording-cards`,children:[(0,F.jsxs)(K,{gap:2,mb:1,children:[(0,F.jsx)(U,{fontSize:`xs`,fontWeight:`semibold`,color:`fg.muted`,children:u?`Recording…`:`Recording stopped`}),(0,F.jsxs)(kw,{size:`sm`,colorPalette:u?`red`:`gray`,children:[f.length,` step`,f.length===1?``:`s`]})]}),(0,F.jsx)(Qw,{gap:1,children:f.map((e,t)=>(0,F.jsx)(AM,{node:e.node,listId:`recording`,index:t,lastIndex:f.length-1,allIssues:[],actions:jM,readOnly:!0},`recording:${t}:${e.node.path}`))}),p.length>0&&(0,F.jsx)(Qw,{gap:1,mt:2,children:p.map((e,t)=>(0,F.jsxs)(K,{gap:2,p:2,borderWidth:`1px`,borderRadius:`md`,borderColor:e.kind===`unsupported`?`orange.muted`:`border.muted`,bg:`bg.muted`,children:[(0,F.jsx)(U,{fontSize:`xs`,flex:`1`,children:e.message}),e.kind===`next-link`&&e.selector!==void 0&&!i.has(t)&&(0,F.jsx)(Lw,{size:`2xs`,colorPalette:`blue`,onClick:()=>{g(e,t)},children:`Turn into pagination`}),e.kind===`next-link`&&i.has(t)&&(0,F.jsx)(kw,{size:`sm`,colorPalette:`green`,children:`Added`})]},`note:${t}:${e.message}`))})]})]})}function NM(){return(0,F.jsx)(I,{px:3,py:2,bg:`orange.subtle`,borderBottomWidth:`1px`,flexShrink:0,role:`status`,children:(0,F.jsx)(U,{fontSize:`sm`,children:`This page shows almost nothing. If it should have content, it builds it with JavaScript and the engine fetched it without a browser. Use Inspect to see the data it loads.`})})}var PM=`table`,FM=`text`,IM=4,LM=1;function RM(e){return`^${qM(e.trim())}`}function zM(e){let t=e.trim().toLowerCase().replace(/[^\d a-z]/gi,` `).trim().split(/\s+/).filter(e=>e!==``);if(t.length===0)return`column`;let[n,...r]=t;return n+r.map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)}function BM(e,t,n=PM){if(e.header===void 0)throw Error(`tableCardNode: pick the header row first`);let r=e.columns,i=r!==void 0&&Object.keys(r).length>0;return{kind:`card`,path:t,stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:n,kind:`table`,selector:e.header,...e.until!==void 0&&{until:e.until},...i&&{columns:r}}}}function VM(e,t,n){let[r,i]=KM(n.x1,n.x2),[a,o]=KM(n.y1,n.y2);return`${e}=${String(t)} x=${String(Math.round(r))}..${String(Math.round(i))} y=${String(Math.round(a))}..${String(Math.round(o))}`}function HM(e){return{x1:e.x-LM,y1:e.y-LM,x2:e.x+Math.max(e.width,1)+LM,y2:e.y+e.height+LM}}function UM(e,t){return{x1:Math.min(e.x1,t.x1),y1:Math.min(e.y1,t.y1),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}}function WM(e){let[t=``]=e.split(`
12
- `,1),n=t.trim().toLowerCase().replace(/[^\d a-z]/gi,` `).trim().split(/\s+/).filter(e=>e!==``).slice(0,IM);if(n.length===0)return FM;let[r,...i]=n;return r+i.map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)}function GM(e,t,n){return{kind:`card`,path:t,stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:n,kind:`region`,selector:e}}}function KM(e,t){return e<=t?[e,t]:[t,e]}function qM(e){return e.replace(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)}var JM=`table`;function YM(e){return`${RM(e)}$`}function XM(e){return e.map(e=>String(e.value).trim()).filter(e=>e!==``).join(` `)}function ZM(e){let t=e.rows.map(e=>e.map(e=>e.value));for(let n of e.merges){let e=t[n.top]?.[n.left]??``;for(let r=n.top;r<=n.bottom;r+=1){t[r]??=[];for(let i=n.left;i<=n.right;i+=1)t[r][i]=e}}return t}function QM(e,t,n){let r=[];for(let i of t){let t=String(e[i]?.[n]??``).trim();t!==``&&!r.includes(t)&&r.push(t)}return r.join(` `)}function $M(e,t){let n=RM(t);return Object.entries(e.columns??{}).find(([,e])=>e===n)?.[0]??t}function eN(e,t,n=JM){if(e.header===void 0)throw Error(`gridTableCardNode: pick the header row first`);let r=e.columns,i=r!==void 0&&Object.keys(r).length>0,a=e.fillDown!==void 0&&e.fillDown.length>0;return{kind:`card`,path:t,stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:n,kind:`table`,selector:e.header,...e.sheet!==void 0&&{sheet:e.sheet},...e.until!==void 0&&{until:e.until},...i&&{columns:r},...e.headerRows!==void 0&&e.headerRows>1&&{headerRows:e.headerRows},...a&&{fillDown:e.fillDown},...e.includeHidden===!0&&{includeHidden:!0}}}}function tN(e,t){let n=t.top===t.bottom?`[${String(t.top)}]`:`[${String(t.top)}:${String(t.bottom+1)}]`,r=t.left===t.right?`[${String(t.left)}]`:`[${String(t.left)}:${String(t.right+1)}]`;return`$.sheets[?(@.name==${oN(e)})].rows${n}${r}`}function nN(e,t){return{top:Math.min(e.top,t.top),left:Math.min(e.left,t.left),bottom:Math.max(e.bottom,t.bottom),right:Math.max(e.right,t.right)}}function rN(e){return e.top===e.bottom&&e.left===e.right}function iN(e,t){let n=[];for(let r=t.top;r<=t.bottom;r+=1){let i=e.rows[r]?.slice(t.left,t.right+1)??[];n.push(i.map(e=>String(e.value)).join(` `))}return n.join(`
13
- `)}function aN(e,t,n,r){return{kind:`card`,path:t,stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:n,kind:`jsonpath`,selector:e,take:`json`,...r&&{many:!0}}}}function oN(e){return e.includes(`'`)?`"${e.replace(/["\\]/g,String.raw`\$&`)}"`:`'${e}'`}var sN=`table`,cN=`value`,lN=1;function uN(e){return`${RM(e)}$`}function dN(e,t,n=sN){if(e.header===void 0)throw Error(`deckTableCardNode: pick the header row first`);let r=e.columns,i=r!==void 0&&Object.keys(r).length>0,a=e.fillDown!==void 0&&e.fillDown.length>0;return{kind:`card`,path:t,stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:n,kind:`table`,selector:e.header,...e.slide!==void 0&&{slide:e.slide},...e.shapes===!0&&{shapes:!0},...e.until!==void 0&&{until:e.until},...i&&{columns:r},...e.headerRows!==void 0&&e.headerRows>1&&{headerRows:e.headerRows},...a&&{fillDown:e.fillDown},...e.includeHidden===!0&&{includeHidden:!0}}}}function fN(e,t,n,r=cN){return{kind:`card`,path:n,stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:r,selector:`$.slides[${String(e)}].charts[${String(t)}].series`,kind:`jsonpath`,take:`json`}}}function pN(e){return{x1:e.x-lN,y1:e.y-lN,x2:e.x+Math.max(e.width,1)+lN,y2:e.y+Math.max(e.height,1)+lN}}var mN=`#9b5de5`;function hN({left:e,top:t,text:n,loading:r,onAdd:i,onClear:a,onDragStart:o}){let s=n===void 0&&!r,[c=``]=(n??``).split(`
14
- `,1);return(0,F.jsxs)(K,{"data-testid":`region-chip`,position:`absolute`,style:{left:`${String(e)}px`,top:`${String(t)}px`},zIndex:`docked`,gap:2,px:2,py:1,bg:`bg.panel`,borderWidth:`1px`,borderColor:mN,borderRadius:`md`,shadow:`md`,maxW:`420px`,draggable:n!==void 0,onDragStart:o,onMouseDown:e=>{e.stopPropagation()},onMouseUp:e=>{e.stopPropagation()},cursor:n===void 0?`default`:`grab`,title:n===void 0?void 0:`Drag onto the Steps tab to add it there`,children:[(0,F.jsx)(U,{fontSize:`xs`,fontFamily:`mono`,truncate:!0,flex:`1`,color:s?`fg.muted`:`fg`,children:r&&n===void 0?`reading…`:s?`nothing to read here`:c}),(0,F.jsx)(Lw,{size:`2xs`,colorPalette:`blue`,onClick:i,disabled:n===void 0,children:`Add to recipe`}),(0,F.jsx)(Yw,{size:`2xs`,"aria-label":`Clear selection`,onClick:a})]})}var gN=/^\s*(page|slide)=(\*|\d+)\s+x=(-?\d+(?:\.\d+)?)\.\.(-?\d+(?:\.\d+)?)\s+y=(-?\d+(?:\.\d+)?)\.\.(-?\d+(?:\.\d+)?)\s*$/,_N=/^\$\.sheets\[\?\(@\.name==(?:'([^']*)'|"((?:[^"\\]|\\.)*)")\)\]\.rows\[(\d+)(?::(\d+))?\]\[(\d+)(?::(\d+))?\]$/,vN=/^\$\.slides\[(\d+)\]\.charts\[(\d+)\]\.series$/;function yN(e){let t=[];for(let n of kO(e)){let{id:e,kind:r,selector:i}=n.step;typeof e==`string`&&typeof r==`string`&&typeof i==`string`&&n.step.type===`extract`&&t.push({id:e,kind:r,selector:i})}return t}function bN(e,t){let n=new Set([e.jsonpath,e.xpath,e.listPath].filter(e=>e!==void 0));return t.filter(e=>n.has(e.selector)&&(e.kind===`jsonpath`||e.kind===`xpath`)).map(e=>e.id)}function xN(e){let t=gN.exec(e);if(t===null)return;let[,n,r,i,a,o,s]=t;return{on:n,at:r===`*`?`*`:Number(r),box:{x1:Number(i),y1:Number(o),x2:Number(a),y2:Number(s)}}}function SN(e,t,n){let r=[];for(let i of e){if(i.kind!==`region`)continue;let e=xN(i.selector);e===void 0||e.on!==t||e.at!==`*`&&e.at!==n||r.push({id:i.id,box:e.box})}return r}function CN(e,t){let[n,r]=kN(e.x1,e.x2),[i,a]=kN(e.y1,e.y2),[o,s]=kN(t.x1,t.x2),[c,l]=kN(t.y1,t.y2),u=(r-n)*(a-i);return u===0?n>=o&&n<=s&&i>=c&&i<=l:Math.max(0,Math.min(r,s)-Math.max(n,o))*Math.max(0,Math.min(a,l)-Math.max(i,c))>=u/2}function wN(e,t){return t.filter(t=>CN(e,t.box)).map(e=>e.id)}function TN(e){let t=_N.exec(e);if(t===null)return;let[,n,r,i,a,o,s]=t;return{sheet:n??(r??``).replace(/\\(.)/g,`$1`),range:{top:Number(i),left:Number(o),bottom:a===void 0?Number(i):Number(a)-1,right:s===void 0?Number(o):Number(s)-1}}}function EN(e,t){let n=[];for(let r of e){if(r.kind!==`jsonpath`)continue;let e=TN(r.selector);e!==void 0&&e.sheet===t&&n.push({id:r.id,range:e.range})}return n}function DN(e,t,n){return n.filter(({range:n})=>e>=n.top&&e<=n.bottom&&t>=n.left&&t<=n.right).map(e=>e.id)}function ON(e,t,n){for(let r of e){if(r.kind!==`jsonpath`)continue;let e=vN.exec(r.selector);if(e!==null&&Number(e[1])===t&&Number(e[2])===n)return r.id}}function kN(e,t){return e<=t?[e,t]:[t,e]}var AN=[],jN=5,MN=24,NN=4,PN=`#1d4ed8`,FN=`#ea580c`;function IN({recipeId:e,stepPath:t,view:n,onTablePick:r,onChartPick:i,onRegionPick:a,steps:o=AN,hoveredStepId:s,onHoverStepId:c}){let[l,u]=(0,P.useState)(0),[d,f]=(0,P.useState)(`table`),[p,m]=(0,P.useState)(0),[h,g]=(0,P.useState)(`text`),[_,v]=(0,P.useState)({}),[y,b]=(0,P.useState)(void 0),[x,S]=(0,P.useState)(void 0),[C,w]=(0,P.useState)(void 0),T=(0,P.useRef)(void 0),E=n.slides[l],D=(0,P.useMemo)(()=>SN(o,`slide`,E?.number??-1),[o,E?.number]),ee=(0,P.useMemo)(()=>(E?.charts??[]).map((e,t)=>ON(o,l,t)),[o,E?.charts,l]),O=d===`table`?E?.tables[p]:void 0,te=_.headerRowIndex===void 0?void 0:Array.from({length:_.headerRows??1},(e,t)=>_.headerRowIndex+t),k=yk(e,t,_.header===void 0?void 0:{slide:_.slide,shapes:_.shapes,header:_.header,until:_.until,columns:_.columns,headerRows:_.headerRows,fillDown:_.fillDown,includeHidden:_.includeHidden}),ne=(0,P.useMemo)(()=>k.data?.matches.find(e=>e.slide===E?.number),[k.data,E?.number]),re=x===void 0?void 0:VM(`slide`,x.slide,x.box),ie=hk(e,t,re),A=ie.data?.matches.find(e=>e.page===x?.slide),ae=A?.text;if((0,P.useEffect)(()=>{_.header!==void 0&&r(dN(_,t))},[_]),(0,P.useEffect)(()=>{m(0),v({}),f(E!==void 0&&E.tables.length===0&&E.shapes.length>0?`shapes`:`table`)},[l]),E===void 0)return(0,F.jsx)(I,{p:4,color:`fg.muted`,children:(0,F.jsx)(U,{children:`This deck has no slides.`})});function oe(e){e!==d&&(f(e),v({}))}function se(e){if(O===void 0)return;let t=XM(O.rows[e]);if(t!==``){if(h===`header`){v(n=>n.headerRowIndex!==void 0&&e===n.headerRowIndex+(n.headerRows??1)?{...n,headerRows:(n.headerRows??1)+1}:{slide:uN(E.title??``),includeHidden:n.includeHidden,header:RM(t),headerRowIndex:e,headerRows:1});return}h===`until`&&_.header!==void 0&&v(e=>({...e,until:RM(t)}))}}function ce(e,t){if(O===void 0||te===void 0)return;let n=ZM(O);if(h===`column`){let e=QM(n,te,t);if(e===``)return;v(t=>({...t,columns:{...t.columns,[zM(e)]:RM(e)}}));return}if(h===`fillDown`&&LN(O,e,t)){let e=QM(n,te,t);if(e===``)return;let r=$M(_,e);v(e=>{let t=e.fillDown??[];return t.includes(r)?e:{...e,fillDown:[...t,r]}})}}function j(e){let t=E.shapeRows.findIndex(t=>t.includes(e));if(t===-1)return;let n=E.shapeRows[t];if(h===`header`){let e=E.shapes[n[0]]?.text??``;if(e.trim()===``)return;v({slide:uN(E.title??``),shapes:!0,header:RM(e),headerRowIndex:t,headerRows:1});return}if(h===`until`){if(_.header===void 0)return;let e=E.shapes[n[0]]?.text??``;if(e.trim()===``)return;v(t=>({...t,until:RM(e)}));return}if(h===`column`){if(_.headerRowIndex!==t)return;let n=E.shapes[e]?.text??``;if(n.trim()===``)return;v(e=>({...e,columns:{...e.columns,[zM(n)]:RM(n)}}))}}function le(e){f(`table`),m(e),v({})}function ue(e){i(fN(l,e,t))}function de(e,t){let n=x;S(t&&n!==void 0&&n.slide===E.number?{slide:E.number,box:UM(n.box,e)}:{slide:E.number,box:e})}function fe(e){c!==void 0&&T.current!==e&&(T.current=e,c(e))}function pe(e){let t=RN(e);if(C!==void 0){w({...C,currentX:t.x,currentY:t.y});return}let n=HN(E,t);b(n),fe(n===void 0?void 0:wN(pN(n),D)[0])}function me(e){if(e.button!==0)return;let t=RN(e);w({startX:t.x,startY:t.y,currentX:t.x,currentY:t.y})}function he(e){if(C===void 0)return;let t=RN(e);if(w(void 0),Math.abs(t.x-C.startX)+Math.abs(t.y-C.startY)>NN){de({x1:C.startX,y1:C.startY,x2:t.x,y2:t.y},e.shiftKey);return}let n=HN(E,t);if(n===void 0){e.shiftKey||S(void 0);return}de(pN(n),e.shiftKey)}function ge(){if(re!==void 0&&ae!==void 0)return GM(re,t,WM(ae))}function _e(){let e=ge();e!==void 0&&(a(e),S(void 0))}function ve(e){let t=ge();t!==void 0&&ae!==void 0&&(e.dataTransfer.setData(bA,xA(t)),e.dataTransfer.setData(`text/plain`,ae),e.dataTransfer.effectAllowed=`copy`)}let M=h===`text`,N=x!==void 0&&x.slide===E.number?x:void 0;return(0,F.jsxs)(I,{h:`full`,display:`flex`,flexDirection:`column`,children:[(0,F.jsxs)(K,{px:3,py:2,borderBottomWidth:`1px`,gap:3,flexShrink:0,flexWrap:`wrap`,children:[n.slides.length>1&&(0,F.jsx)(WN,{slides:n.slides,value:l,onChange:u}),(0,F.jsx)(UN,{label:`Text`,active:M,onClick:()=>{g(`text`)}}),!M&&(0,F.jsx)(UN,{label:`Native table`,active:d===`table`,onClick:()=>{oe(`table`)}}),!M&&(0,F.jsx)(UN,{label:`Text-box grid`,active:d===`shapes`,onClick:()=>{oe(`shapes`)}}),(0,F.jsx)(UN,{label:`Header row(s)`,active:h===`header`,onClick:()=>{g(`header`)}}),(0,F.jsx)(UN,{label:`Last row (until)`,active:h===`until`,onClick:()=>{g(`until`)}}),(0,F.jsx)(UN,{label:`Column`,active:h===`column`,onClick:()=>{g(`column`)}}),!M&&d===`table`&&(0,F.jsx)(UN,{label:`Fill down`,active:h===`fillDown`,onClick:()=>{g(`fillDown`)}}),M&&(0,F.jsx)(U,{fontSize:`xs`,color:`fg.muted`,visibility:x===void 0?`visible`:`hidden`,children:`Click a text box (shift+click to extend) or drag a box, then add it to the recipe or drag it onto the Steps tab.`}),_.header!==void 0&&(0,F.jsx)(kw,{size:`sm`,colorPalette:`green`,children:`table: ${_.header}${_.until===void 0?``:` until ${_.until}`}`}),k.data?.error!==void 0&&(0,F.jsx)(kw,{size:`sm`,colorPalette:`orange`,children:k.data.error}),ie.data?.error!==void 0&&(0,F.jsx)(kw,{size:`sm`,colorPalette:`orange`,children:ie.data.error})]}),(0,F.jsxs)(I,{flex:`1`,minH:`0`,display:`flex`,overflow:`hidden`,children:[(0,F.jsxs)(I,{flex:`2`,minW:`0`,overflow:`auto`,p:3,children:[M&&(0,F.jsxs)(I,{position:`relative`,width:`${String(n.width)}px`,height:`${String(n.height)}px`,children:[(0,F.jsx)(GN,{slide:E,width:n.width,height:n.height}),(0,F.jsxs)(`svg`,{"data-testid":`deck-overlay`,width:n.width,height:n.height,style:{position:`absolute`,top:0,left:0,cursor:`crosshair`},onMouseMove:pe,onMouseDown:me,onMouseUp:he,onMouseLeave:()=>{b(void 0),fe(void 0)},children:[D.map(e=>(0,F.jsx)(`rect`,{"data-testid":`recipe-region`,"data-step-id":e.id,"data-highlighted":e.id===s,...VN(e.box),fill:e.id===s?`rgba(234, 88, 12, 0.22)`:`rgba(234, 88, 12, 0.05)`,stroke:FN,strokeWidth:e.id===s?2:1,strokeDasharray:e.id===s?void 0:`4 3`,pointerEvents:`none`,children:(0,F.jsx)(`title`,{children:`In the recipe: ${e.id}`})},`recipe:${e.id}`)),y!==void 0&&C===void 0&&(0,F.jsx)(`rect`,{"data-testid":`snap-target`,...BN(y),fill:`rgba(29, 78, 216, 0.08)`,stroke:PN,strokeWidth:1.5,strokeDasharray:`3 2`,pointerEvents:`none`}),N!==void 0&&(0,F.jsx)(`rect`,{"data-testid":`staged-region`,...VN(N.box),fill:`rgba(155, 93, 229, 0.12)`,stroke:`#9b5de5`,strokeWidth:1.5,pointerEvents:`none`}),N!==void 0&&A?.shapes.map(e=>(0,F.jsx)(`rect`,{"data-testid":`staged-shape`,...BN(e),fill:`rgba(155, 93, 229, 0.28)`,pointerEvents:`none`},zN(e))),C!==void 0&&(0,F.jsx)(`rect`,{...VN({x1:C.startX,y1:C.startY,x2:C.currentX,y2:C.currentY}),fill:`rgba(155, 93, 229, 0.2)`,stroke:`#9b5de5`,strokeDasharray:`4 2`,pointerEvents:`none`})]}),N!==void 0&&(0,F.jsx)(hN,{left:Math.min(N.box.x1,N.box.x2),top:Math.max(N.box.y1,N.box.y2)+6,text:ae,loading:ie.isPending,onAdd:_e,onClear:()=>{S(void 0)},onDragStart:ve})]}),!M&&d===`shapes`&&(0,F.jsx)(GN,{slide:E,width:n.width,height:n.height,headerRowIndex:_.headerRowIndex,onPick:j}),!M&&d===`table`&&O!==void 0&&(0,F.jsx)(KN,{table:O,headerRowIndexes:te,mode:h,onRowPick:se,onCellPick:ce}),!M&&d===`table`&&O===void 0&&(0,F.jsx)(U,{color:`fg.muted`,fontSize:`sm`,children:`This slide has no native tables.`}),!M&&ne!==void 0&&(0,F.jsx)(JN,{match:ne})]}),(0,F.jsx)(I,{flex:`1`,minW:`220px`,maxW:`320px`,borderLeftWidth:`1px`,overflow:`auto`,p:3,children:(0,F.jsx)(qN,{slide:E,activeSource:d,activeTableIndex:p,onTablePick:le,onChartPick:ue,chartStepIds:ee,hoveredStepId:s,onHoverStepId:fe})})]})]})}function LN(e,t,n){let r=e.merges.find(e=>e.top===t&&e.left===n);return r!==void 0&&r.bottom>r.top&&r.left===r.right}function RN(e){let t=e.currentTarget.getBoundingClientRect();return{x:e.clientX-t.left,y:e.clientY-t.top}}function zN(e){return`staged:${String(e.x)}:${String(e.y)}`}function BN(e){return{x:e.x,y:e.y,width:Math.max(e.width,1),height:Math.max(e.height,1)}}function VN(e){let[t,n]=[Math.min(e.x1,e.x2),Math.max(e.x1,e.x2)],[r,i]=[Math.min(e.y1,e.y2),Math.max(e.y1,e.y2)];return{x:t,y:r,width:n-t,height:i-r}}function HN(e,t){let n;for(let r of e.shapes){let e=BN(r),i=Math.max(e.x-t.x,0,t.x-(e.x+e.width)),a=Math.max(e.y-t.y,0,t.y-(e.y+e.height)),o=Math.hypot(i,a);o<=MN&&(n===void 0||o<n.distance)&&(n={shape:r,distance:o})}return n?.shape}function UN({label:e,active:t,onClick:n}){return(0,F.jsx)(U,{as:`button`,fontSize:`sm`,fontWeight:t?`semibold`:`normal`,color:t?`colorPalette.fg`:`fg`,colorPalette:`blue`,cursor:`pointer`,onClick:n,children:e})}function WN({slides:e,value:t,onChange:n}){let r=c_({items:e.map((e,t)=>({label:`Slide ${String(e.number)}${e.title===void 0||e.title===``?``:` — ${e.title}`}${e.hidden?` (hidden)`:``}`,value:String(t)}))});return(0,F.jsxs)(BT,{collection:r,size:`sm`,width:`220px`,value:[String(t)],onValueChange:e=>{n(Number(e.value[0]))},children:[(0,F.jsx)(qT,{}),(0,F.jsx)(KT,{children:(0,F.jsx)(VT,{children:(0,F.jsx)(WT,{})})}),(0,F.jsx)(HT,{children:(0,F.jsx)(UT,{children:r.items.map(e=>(0,F.jsx)(GT,{item:e,children:e.label},e.value))})})]})}function GN({slide:e,width:t,height:n,headerRowIndex:r,onPick:i}){let a=r===void 0?void 0:new Set(e.shapeRows[r]);return(0,F.jsx)(I,{position:`relative`,width:`${String(t)}px`,height:`${String(n)}px`,borderWidth:`1px`,bg:`bg.panel`,children:e.shapes.map((e,t)=>(0,F.jsx)(I,{position:`absolute`,style:{left:`${String(e.x)}px`,top:`${String(e.y)}px`,width:`${String(Math.max(e.width,1))}px`,height:`${String(Math.max(e.height,1))}px`},borderWidth:`1px`,borderColor:a?.has(t)===!0?`orange.fg`:`border.muted`,bg:a?.has(t)===!0?`orange.subtle`:`bg`,overflow:`hidden`,px:1,fontSize:`xs`,cursor:i===void 0?`default`:`pointer`,_hover:i===void 0?void 0:{bg:`bg.emphasized`},onClick:i===void 0?void 0:()=>{i(t)},title:e.placeholder,children:e.text},`${String(e.x)}:${String(e.y)}:${String(t)}`))})}function KN({table:e,headerRowIndexes:t,mode:n,onRowPick:r,onCellPick:i}){return(0,F.jsx)(vE,{size:`sm`,variant:`outline`,children:(0,F.jsx)(wE,{children:e.rows.map((e,a)=>(0,F.jsx)(yE,{bg:t?.includes(a)===!0?`yellow.subtle`:void 0,children:e.map((e,t)=>(0,F.jsx)(CE,{fontSize:`xs`,cursor:`pointer`,_hover:{bg:`bg.emphasized`},onClick:()=>{n===`header`||n===`until`?r(a):i(a,t)},children:String(e.value)},t))},a))})})}function qN({slide:e,activeSource:t,activeTableIndex:n,onTablePick:r,onChartPick:i,chartStepIds:a,hoveredStepId:o,onHoverStepId:s}){return(0,F.jsxs)(OE,{align:`stretch`,gap:4,children:[(0,F.jsxs)(I,{children:[(0,F.jsx)(U,{fontSize:`xs`,fontWeight:`semibold`,color:`fg.muted`,mb:1,children:`Native tables (${String(e.tables.length)})`}),e.tables.length===0&&(0,F.jsx)(U,{fontSize:`xs`,color:`fg.muted`,children:`None on this slide.`}),(0,F.jsx)(OE,{align:`stretch`,gap:1,children:e.tables.map((e,i)=>(0,F.jsxs)(I,{as:`button`,textAlign:`left`,p:2,borderWidth:`1px`,borderRadius:`sm`,bg:t===`table`&&n===i?`bg.emphasized`:void 0,onClick:()=>{r(i)},children:[(0,F.jsx)(U,{fontSize:`xs`,fontWeight:`medium`,children:e.name}),(0,F.jsx)(U,{fontSize:`2xs`,color:`fg.muted`,children:`${String(e.rows.length)} rows`})]},e.name))})]}),(0,F.jsxs)(I,{children:[(0,F.jsx)(U,{fontSize:`xs`,fontWeight:`semibold`,color:`fg.muted`,mb:1,children:`Charts (${String(e.charts.length)})`}),e.charts.length===0&&(0,F.jsx)(U,{fontSize:`xs`,color:`fg.muted`,children:`None on this slide.`}),(0,F.jsx)(OE,{align:`stretch`,gap:1,children:e.charts.map((e,t)=>(0,F.jsxs)(I,{as:`button`,"data-testid":`deck-chart`,"data-step-ids":a[t],"data-highlighted":a[t]!==void 0&&a[t]===o,textAlign:`left`,p:2,borderWidth:`1px`,borderRadius:`sm`,borderColor:a[t]===void 0?void 0:`orange.solid`,borderStyle:a[t]===void 0||a[t]===o?`solid`:`dashed`,bg:a[t]!==void 0&&a[t]===o?`orange.subtle`:void 0,onClick:()=>{i(t)},onMouseEnter:()=>{s(a[t])},onMouseLeave:()=>{s(void 0)},children:[(0,F.jsxs)(K,{gap:1,children:[(0,F.jsx)(U,{fontSize:`xs`,fontWeight:`medium`,children:e.title??e.type}),a[t]!==void 0&&(0,F.jsx)(kw,{size:`xs`,colorPalette:`orange`,title:`Already in the recipe: the step reading this`,children:a[t]})]}),(0,F.jsx)(U,{fontSize:`2xs`,color:`fg.muted`,children:`${e.type} · ${String(e.series.length)} series`})]},t))})]}),(0,F.jsxs)(I,{children:[(0,F.jsx)(U,{fontSize:`xs`,fontWeight:`semibold`,color:`fg.muted`,mb:1,children:`Notes`}),(0,F.jsx)(U,{fontSize:`xs`,color:e.notes===``?`fg.muted`:`fg`,whiteSpace:`pre-wrap`,children:e.notes===``?`None.`:e.notes})]})]})}function JN({match:e}){let t=e.rows.slice(0,jN);return(0,F.jsxs)(I,{borderTopWidth:`1px`,mt:3,maxH:`160px`,overflow:`auto`,children:[(0,F.jsx)(K,{px:0,py:1,gap:2,children:(0,F.jsx)(U,{fontSize:`xs`,color:`fg.muted`,children:`Live preview: ${String(e.rows.length)} row${e.rows.length===1?``:`s`} matched${e.title===``?``:` ("${e.title}")`}`})}),(0,F.jsxs)(vE,{size:`sm`,variant:`outline`,children:[(0,F.jsx)(xE,{children:(0,F.jsx)(yE,{children:e.header.map(e=>(0,F.jsx)(SE,{fontSize:`2xs`,children:e},e))})}),(0,F.jsx)(wE,{children:t.map((t,n)=>(0,F.jsx)(yE,{children:e.header.map(e=>(0,F.jsx)(CE,{fontSize:`2xs`,children:String(t[e]??``)},e))},n))})]})]})}var YN=7,XN=4/3,ZN=24,QN=64,$N=4;function eP(e,t,n){let r=e.defaultColumnWidth===void 0?QN:nP(e.defaultColumnWidth),i=e.defaultRowHeight===void 0?ZN:rP(e.defaultRowHeight),a=[0];for(let n=0;n<t;n+=1){let t=e.columnWidths?.[String(n)];a.push(a[n]+(t===void 0?r:nP(t)))}let o=[0];for(let t=0;t<n;t+=1){let n=e.rowHeights?.[String(t)];o.push(o[t]+(n===void 0?i:rP(n)))}return{columnLefts:a,rowTops:o,width:a[t],height:o[n]}}function tP(e){let t=``;for(let n=e+1;n>0;n=Math.floor((n-1)/26))t=String.fromCodePoint(65+(n-1)%26)+t;return t}function nP(e){return Math.max($N,Math.round(e*YN))}function rP(e){return Math.max($N,Math.round(e*XN))}var iP=[],aP=24,oP=44,sP=30,cP=5;function lP({recipeId:e,stepPath:t,view:n,onTablePick:r,onCellPick:i,steps:a=iP,hoveredStepId:o,onHoverStepId:s,csvOverride:c,onCsvOverrideChange:l}){let[u,d]=(0,P.useState)(0),[f,p]=(0,P.useState)(`cell`),[m,h]=(0,P.useState)({}),[g,_]=(0,P.useState)(void 0),[v,y]=(0,P.useState)(void 0),[b,x]=(0,P.useState)(void 0),S=(0,P.useRef)(null),C=(0,P.useRef)(void 0),w=n.sheets[u],T=(0,P.useMemo)(()=>EN(a,w?.name??``),[a,w?.name]),E=(0,P.useMemo)(()=>w===void 0?[]:ZM(w),[w]),D=(0,P.useMemo)(()=>w===void 0?[]:mP(w),[w]),ee=m.headerRowIndex===void 0?void 0:Array.from({length:m.headerRows??1},(e,t)=>m.headerRowIndex+t),O=_k(e,t,m.header===void 0?void 0:{sheet:m.sheet,header:m.header,until:m.until,columns:m.columns,headerRows:m.headerRows,fillDown:m.fillDown,includeHidden:m.includeHidden}),te=(0,P.useMemo)(()=>O.data?.matches.find(e=>e.sheet===w?.name),[O.data,w?.name]),k=(0,P.useMemo)(()=>eP(w??{},w?.columnCount??0,w?.rows.length??0),[w]),ne=(0,P.useCallback)(e=>`${String(u)}:${String(e)}`,[u]),re=qk({count:w?.rows.length??0,getScrollElement:()=>S.current,estimateSize:e=>k.rowTops[e+1]-k.rowTops[e],getItemKey:ne,overscan:sP});(0,P.useEffect)(()=>{m.header!==void 0&&r(eN(m,t))},[m]);let ie=f===`cell`,A=b!==void 0&&w!==void 0&&b.sheet===w.name?b:void 0,ae=A===void 0?void 0:tN(A.sheet,A.range),oe=A===void 0||w===void 0?void 0:iN(w,A.range);if(w===void 0)return(0,F.jsx)(I,{p:4,color:`fg.muted`,children:(0,F.jsx)(U,{children:`This workbook has no sheets.`})});function se(e){s!==void 0&&C.current!==e&&(C.current=e,s(e))}function ce(e,t){let n=A;x(t&&n!==void 0?{sheet:w.name,range:nN(n.range,e)}:{sheet:w.name,range:e})}function j(e,t){ie&&t.button===0&&(t.stopPropagation(),y(e))}function le(e,t){if(!ie)return;t.stopPropagation();let n=v??e;y(void 0),ce({top:Math.min(n.row,e.row),left:Math.min(n.column,e.column),bottom:Math.max(n.row,e.row),right:Math.max(n.column,e.column)},t.shiftKey)}function ue(e){ie&&(y(void 0),e.shiftKey||x(void 0))}function de(){if(A!==void 0&&ae!==void 0&&oe!==void 0)return aN(ae,t,WM(oe),!rN(A.range))}function fe(){let e=de();e!==void 0&&(i(e),x(void 0))}function pe(e){let t=de();t!==void 0&&oe!==void 0&&(e.dataTransfer.setData(bA,xA(t)),e.dataTransfer.setData(`text/plain`,oe),e.dataTransfer.effectAllowed=`copy`)}function me(e){if(d(e),f!==`sheet`)return;let t=n.sheets[e].name;h(e=>({...e,sheet:YM(t)}))}function he(e){let t=XM(w.rows[e]);t!==``&&h(n=>n.headerRowIndex!==void 0&&e===n.headerRowIndex+(n.headerRows??1)?{...n,headerRows:(n.headerRows??1)+1}:{sheet:n.sheet,includeHidden:n.includeHidden,header:RM(t),headerRowIndex:e,headerRows:1})}function ge(e){if(m.header===void 0)return;let t=XM(w.rows[e]);t!==``&&h(e=>({...e,until:RM(t)}))}function _e(e){if(ee===void 0)return;let t=QM(E,ee,e);if(t===``)return;let n=zM(t);h(e=>({...e,columns:{...e.columns,[n]:RM(t)}}))}function ve(e){if(ee===void 0)return;let t=QM(E,ee,e);if(t===``)return;let n=$M(m,t);h(e=>{let t=e.fillDown??[];return t.includes(n)?e:{...e,fillDown:[...t,n]}})}function M(e,t,n){if(f===`header`){he(e);return}if(f===`until`){ge(e);return}if(f===`column`){_e(t);return}f===`fillDown`&&n&&ve(t)}return(0,F.jsxs)(I,{h:`full`,display:`flex`,flexDirection:`column`,children:[(0,F.jsx)(K,{px:3,py:2,borderBottomWidth:`1px`,gap:1,flexShrink:0,flexWrap:`wrap`,children:n.sheets.map((e,t)=>(0,F.jsx)(vP,{sheet:e,active:t===u,onClick:()=>{me(t)}},e.name))}),(0,F.jsxs)(K,{px:3,py:2,borderBottomWidth:`1px`,gap:3,flexShrink:0,flexWrap:`wrap`,children:[(0,F.jsx)(_P,{label:`Cell`,active:ie,onClick:()=>{p(`cell`)}}),(0,F.jsx)(_P,{label:`Sheet`,active:f===`sheet`,onClick:()=>{p(`sheet`)}}),(0,F.jsx)(_P,{label:`Header row(s)`,active:f===`header`,onClick:()=>{p(`header`)}}),(0,F.jsx)(_P,{label:`First non-data row (until)`,active:f===`until`,onClick:()=>{p(`until`)}}),(0,F.jsx)(_P,{label:`Column`,active:f===`column`,onClick:()=>{p(`column`)}}),(0,F.jsx)(_P,{label:`Fill down`,active:f===`fillDown`,onClick:()=>{p(`fillDown`)}}),n.csv!==void 0&&(0,F.jsx)(wP,{format:n.csv,override:c,onChange:l}),ie&&(0,F.jsx)(U,{fontSize:`xs`,color:`fg.muted`,visibility:b===void 0?`visible`:`hidden`,children:`Click a cell (shift+click, or press and release, for a range), then add it to the recipe or drag it onto the Steps tab.`}),m.header!==void 0&&(0,F.jsx)(kw,{size:`sm`,colorPalette:`green`,children:`table: ${m.header}${m.until===void 0?``:` until ${m.until}`}`}),O.data?.error!==void 0&&(0,F.jsx)(kw,{size:`sm`,colorPalette:`orange`,children:O.data.error})]}),(0,F.jsxs)(I,{flex:`1`,minH:`0`,display:`flex`,flexDirection:`column`,children:[(0,F.jsx)(I,{ref:S,flex:`1`,minH:`0`,overflow:`auto`,position:`relative`,onMouseUp:ue,onMouseLeave:()=>{_(void 0),se(void 0)},children:(0,F.jsxs)(I,{position:`relative`,style:{height:`${String(aP+k.height)}px`,width:`${String(oP+k.width)}px`},children:[(0,F.jsx)(fP,{geometry:k}),(0,F.jsx)(pP,{geometry:k,rowIndexes:re.getVirtualItems().map(e=>e.index),hiddenRows:w.hiddenRows}),re.getVirtualItems().map(e=>D[e.index]?.map(t=>t===void 0?null:(0,F.jsx)(SP,{cell:t,box:uP(k,e.index,t),isHeader:ee?.includes(e.index)??!1,isHidden:w.hiddenRows.includes(e.index),isSnapped:ie&&g?.row===e.index&&g.column===t.columnIndex,isStaged:A!==void 0&&gP(A.range,e.index,t.columnIndex),stepIds:DN(e.index,t.columnIndex,T),hoveredStepId:o,onClick:ie?void 0:()=>{M(e.index,t.columnIndex,t.isMergeLabel)},onMouseEnter:n=>{ie&&_({row:e.index,column:t.columnIndex}),se(n[0])},onMouseDown:ie?n=>{j({row:e.index,column:t.columnIndex},n)}:void 0,onMouseUp:ie?n=>{le({row:e.index,column:t.columnIndex},n)}:void 0},`${String(e.index)}:${String(t.columnIndex)}`))),A!==void 0&&(0,F.jsx)(hN,{left:oP+k.columnLefts[A.range.left],top:aP+k.rowTops[A.range.bottom+1]+4,text:oe,loading:!1,onAdd:fe,onClear:()=>{x(void 0)},onDragStart:pe})]})}),te!==void 0&&(0,F.jsx)(CP,{match:te})]})]})}function uP(e,t,n){let r=e.columnLefts.length-1,i=e.rowTops.length-1,a=e.columnLefts[n.columnIndex],o=e.rowTops[t];return{top:aP+o,left:oP+a,width:e.columnLefts[Math.min(n.columnIndex+n.colSpan,r)]-a,height:e.rowTops[Math.min(t+n.rowSpan,i)]-o}}var dP={fontSize:`11px`,fontWeight:600};function fP({geometry:e}){let t=e.columnLefts.length-1;return(0,F.jsxs)(I,{position:`sticky`,top:0,zIndex:3,bg:`bg.muted`,borderBottomWidth:`1px`,style:{height:`${String(aP)}px`,width:`${String(oP+e.columnLefts[t])}px`},children:[(0,F.jsx)(I,{position:`sticky`,left:0,zIndex:4,bg:`bg.muted`,borderRightWidth:`1px`,style:{width:`${String(oP)}px`,height:`${String(aP)}px`}}),Array.from({length:t},(t,n)=>(0,F.jsx)(I,{"data-testid":`column-header`,position:`absolute`,top:0,display:`flex`,alignItems:`center`,justifyContent:`center`,borderRightWidth:`1px`,color:`fg.muted`,overflow:`hidden`,style:{...dP,left:`${String(oP+e.columnLefts[n])}px`,width:`${String(e.columnLefts[n+1]-e.columnLefts[n])}px`,height:`${String(aP)}px`},children:tP(n)},tP(n)))]})}function pP({geometry:e,rowIndexes:t,hiddenRows:n}){return(0,F.jsx)(I,{position:`sticky`,left:0,zIndex:2,bg:`bg.muted`,borderRightWidth:`1px`,style:{width:`${String(oP)}px`,height:`${String(e.height)}px`},children:t.map(t=>(0,F.jsx)(I,{"data-testid":`row-header`,position:`absolute`,left:0,display:`flex`,alignItems:`center`,justifyContent:`center`,borderBottomWidth:`1px`,color:`fg.muted`,overflow:`hidden`,opacity:n.includes(t)?.4:1,style:{...dP,top:`${String(e.rowTops[t])}px`,width:`${String(oP)}px`,height:`${String(e.rowTops[t+1]-e.rowTops[t])}px`},children:t+1},t))})}function mP(e){let t=hP(e.merges),n=new Map(e.merges.map(e=>[`${String(e.top)}:${String(e.left)}`,{rowSpan:e.bottom-e.top+1,colSpan:e.right-e.left+1}]));return e.rows.map((e,r)=>e.map((e,i)=>{let a=`${String(r)}:${String(i)}`;if(t.has(a))return;let o=n.get(a);return{columnIndex:i,rowSpan:o?.rowSpan??1,colSpan:o?.colSpan??1,value:e.value,type:e.type,isMergeLabel:o!==void 0&&o.rowSpan>1&&o.colSpan===1}}))}function hP(e){let t=new Set;for(let n of e)for(let e=n.top;e<=n.bottom;e+=1)for(let r=n.left;r<=n.right;r+=1)(e!==n.top||r!==n.left)&&t.add(`${String(e)}:${String(r)}`);return t}function gP(e,t,n){return t>=e.top&&t<=e.bottom&&n>=e.left&&n<=e.right}function _P({label:e,active:t,onClick:n}){return(0,F.jsx)(U,{as:`button`,fontSize:`sm`,fontWeight:t?`semibold`:`normal`,color:t?`colorPalette.fg`:`fg`,colorPalette:`blue`,cursor:`pointer`,onClick:n,children:e})}function vP({sheet:e,active:t,onClick:n}){return(0,F.jsxs)(K,{as:`button`,gap:1,px:2,py:1,borderRadius:`sm`,bg:t?`bg.emphasized`:void 0,opacity:e.hidden?.55:1,onClick:n,children:[(0,F.jsx)(U,{fontSize:`sm`,fontWeight:t?`semibold`:`normal`,children:e.name}),e.hidden&&(0,F.jsx)(kw,{size:`xs`,colorPalette:`gray`,children:`hidden`})]})}var yP={string:`fg`,number:`orange.fg`,boolean:`blue.fg`,date:`purple.fg`};function bP(e,t,n){return e?`purple.fg`:t?`blue.fg`:n?`orange.solid`:`border.muted`}function xP(e,t,n,r){return n?`purple.muted`:r?`orange.subtle`:t?`yellow.subtle`:e.isMergeLabel?`purple.subtle`:`bg`}function SP({cell:e,box:t,isHeader:n,isHidden:r,isSnapped:i,isStaged:a,stepIds:o,hoveredStepId:s,onClick:c,onMouseEnter:l,onMouseDown:u,onMouseUp:d}){let f=o.length>0,p=s!==void 0&&o.includes(s);return(0,F.jsx)(I,{"data-testid":i?`snap-target`:a?`staged-cell`:`grid-cell`,"data-step-ids":f?o.join(` `):void 0,"data-highlighted":p,position:`absolute`,style:{top:`${String(t.top)}px`,left:`${String(t.left)}px`,width:`${String(t.width)}px`,height:`${String(t.height)}px`},borderWidth:f?`2px`:`1px`,borderStyle:f&&!p?`dashed`:`solid`,borderColor:bP(a,i,f),bg:xP(e,n,a,p),opacity:r?.4:1,overflow:`hidden`,px:1,fontSize:`xs`,color:yP[e.type],cursor:c===void 0?`cell`:`pointer`,_hover:{bg:a?`purple.muted`:`bg.emphasized`},onClick:c,onMouseEnter:l===void 0?void 0:()=>{l(o)},onMouseDown:u,onMouseUp:d,title:f?`In the recipe: ${o.join(`, `)}`:r?`Hidden row`:void 0,truncate:!0,children:String(e.value)})}function CP({match:e}){let t=e.rows.slice(0,cP);return(0,F.jsxs)(I,{borderTopWidth:`1px`,maxH:`160px`,overflow:`auto`,flexShrink:0,children:[(0,F.jsx)(K,{px:2,py:1,gap:2,children:(0,F.jsx)(U,{fontSize:`xs`,color:`fg.muted`,children:`Live preview: ${String(e.rows.length)} row${e.rows.length===1?``:`s`} matched${e.title===``?``:` ("${e.title}")`}`})}),(0,F.jsxs)(vE,{size:`sm`,variant:`outline`,children:[(0,F.jsx)(xE,{children:(0,F.jsx)(yE,{children:e.header.map(e=>(0,F.jsx)(SE,{fontSize:`2xs`,children:e},e))})}),(0,F.jsx)(wE,{children:t.map((t,n)=>(0,F.jsx)(yE,{children:e.header.map(e=>(0,F.jsx)(CE,{fontSize:`2xs`,children:String(t[e]??``)},e))},n))})]})]})}function wP({format:e,override:t,onChange:n}){let r=t?.delimiter??e.delimiter,i=t?.encoding??e.encoding;return(0,F.jsxs)(K,{gap:2,children:[(0,F.jsx)(U,{fontSize:`xs`,color:`fg.muted`,children:`Delimiter`}),(0,F.jsx)(ET,{size:`xs`,width:`40px`,defaultValue:r,onBlur:e=>{let i=e.target.value;i!==``&&i!==r&&n({delimiter:i,encoding:t?.encoding})}},r),(0,F.jsx)(U,{fontSize:`xs`,color:`fg.muted`,children:`Encoding`}),(0,F.jsx)(ET,{size:`xs`,width:`110px`,defaultValue:i,onBlur:e=>{let r=e.target.value;r!==``&&r!==i&&n({delimiter:t?.delimiter,encoding:r})}},i)]})}var TP=`modulepreload`,EP=function(e){return`/`+e},DP={},OP=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=EP(t,n),t=s(t),t in DP)return;DP[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:TP,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},kP=[],AP=1.5,jP=1.2,MP=24,NP=4,PP=[`#2e86ab`,`#3bb273`],FP=`#e4572e`,IP=`rgba(59, 178, 115, 0.18)`,LP=`#1d4ed8`,RP=`#ea580c`;function zP({recipeId:e,stepPath:t,view:n,bytesUrl:r,onTablePick:i,onRegionPick:a,steps:o=kP,hoveredStepId:s,onHoverStepId:c}){let[l,u]=(0,P.useState)(0),[d,f]=(0,P.useState)(`text`),[p,m]=(0,P.useState)({}),[h,g]=(0,P.useState)(void 0),[_,v]=(0,P.useState)(void 0),[y,b]=(0,P.useState)(void 0),x=(0,P.useRef)(null),S=(0,P.useRef)(void 0),C=n.pages[l],w=(0,P.useMemo)(()=>SN(o,`page`,C?.number??-1),[o,C?.number]),T=C===void 0?0:Math.ceil(C.width*AP),E=C===void 0?0:Math.ceil(C.height*AP),D=mk(e,t,p.header===void 0?void 0:{header:p.header,until:p.until,columns:p.columns}),ee=(0,P.useMemo)(()=>D.data?.matches.find(e=>e.page===C?.number),[D.data,C?.number]),O=_===void 0?void 0:VM(`page`,_.page,_.box),te=hk(e,t,O),k=te.data?.matches.find(e=>e.page===_?.page),ne=k?.text;if((0,P.useEffect)(()=>{p.header!==void 0&&i(BM(p,t))},[p]),(0,P.useEffect)(()=>{let e=x.current;if(e===null||C===void 0)return;let t=new AbortController;return XP(e,r,C.number,AP,t.signal).catch(e=>{t.signal.aborted||console.error(`PDF canvas: could not render the page`,e)}),()=>{t.abort()}},[r,C?.number]),C===void 0)return(0,F.jsx)(I,{p:4,color:`fg.muted`,children:(0,F.jsx)(U,{children:`This PDF has no pages.`})});function re(e){let t=e.cells[0]?.text??``;if(d===`header`){m({header:RM(t)});return}d===`until`&&p.header!==void 0&&m(e=>({...e,until:RM(t)}))}function ie(e){p.header!==void 0&&m(t=>({...t,columns:{...t.columns,[zM(e)]:RM(e)}}))}function A(e,t){let n=_;v(t&&n!==void 0&&n.page===C.number?{page:C.number,box:UM(n.box,e)}:{page:C.number,box:e})}function ae(e){c!==void 0&&S.current!==e&&(S.current=e,c(e))}function oe(e){if(d!==`text`)return;let t=BP(e);if(y!==void 0){b({...y,currentX:t.x,currentY:t.y});return}let n=GP(C,t);g(n),ae(n===void 0?void 0:wN(HM(n),w)[0])}function se(e){if(d!==`text`||e.button!==0)return;let t=BP(e);b({startX:t.x,startY:t.y,currentX:t.x,currentY:t.y})}function ce(e){if(d!==`text`||y===void 0)return;let t=BP(e);if(b(void 0),Math.abs(t.x-y.startX)+Math.abs(t.y-y.startY)>NP){A(WP(C,y.startX,y.startY,t.x,t.y),e.shiftKey);return}let n=GP(C,t);if(n===void 0){e.shiftKey||v(void 0);return}A(HM(n),e.shiftKey)}function j(){if(O!==void 0&&ne!==void 0)return GM(O,t,WM(ne))}function le(){let e=j();e!==void 0&&(a(e),v(void 0))}function ue(e){let t=j();t!==void 0&&ne!==void 0&&(e.dataTransfer.setData(bA,xA(t)),e.dataTransfer.setData(`text/plain`,ne),e.dataTransfer.effectAllowed=`copy`)}let de=d===`text`,fe=_!==void 0&&_.page===C.number?_:void 0;return(0,F.jsxs)(I,{h:`full`,display:`flex`,flexDirection:`column`,children:[(0,F.jsxs)(K,{px:3,py:2,borderBottomWidth:`1px`,gap:3,flexShrink:0,flexWrap:`wrap`,children:[n.pages.length>1&&(0,F.jsx)(qP,{pages:n.pages.length,value:l,onChange:u}),(0,F.jsx)(KP,{label:`Text`,active:de,onClick:()=>{f(`text`)}}),(0,F.jsx)(KP,{label:`Header row`,active:d===`header`,onClick:()=>{f(`header`)}}),(0,F.jsx)(KP,{label:`Last row (until)`,active:d===`until`,onClick:()=>{f(`until`)}}),(0,F.jsx)(KP,{label:`Column`,active:d===`column`,onClick:()=>{f(`column`)}}),(0,F.jsx)(U,{fontSize:`xs`,color:`fg.muted`,children:`${String(C.rowCount)} rows, ${String(C.cellCount)} cells${C.hasTextLayer?``:` — no text layer (a scan?)`}`}),de&&(0,F.jsx)(U,{fontSize:`xs`,color:`fg.muted`,visibility:_===void 0?`visible`:`hidden`,children:`Click a line (shift+click to extend) or drag a box, then add it to the recipe or drag it onto the Steps tab.`}),p.header!==void 0&&(0,F.jsx)(kw,{size:`sm`,colorPalette:`green`,children:`table: ${p.header}${p.until===void 0?``:` until ${p.until}`}`}),D.data?.error!==void 0&&(0,F.jsx)(kw,{size:`sm`,colorPalette:`orange`,children:D.data.error}),te.data?.error!==void 0&&(0,F.jsx)(kw,{size:`sm`,colorPalette:`orange`,children:te.data.error})]}),(0,F.jsx)(I,{flex:`1`,minH:`0`,overflow:`auto`,position:`relative`,children:(0,F.jsxs)(I,{position:`relative`,width:`${String(T)}px`,height:`${String(E)}px`,children:[(0,F.jsx)(`canvas`,{ref:x,width:T,height:E,style:{position:`absolute`,top:0,left:0}}),(0,F.jsxs)(`svg`,{"data-testid":`pdf-overlay`,width:T,height:E,style:{position:`absolute`,top:0,left:0,cursor:de?`crosshair`:`pointer`},onMouseMove:oe,onMouseDown:se,onMouseUp:ce,onMouseLeave:()=>{g(void 0),ae(void 0)},children:[w.map(e=>(0,F.jsx)(`rect`,{"data-testid":`recipe-region`,"data-step-id":e.id,"data-highlighted":e.id===s,...UP(e.box,C.height),fill:e.id===s?`rgba(234, 88, 12, 0.22)`:`rgba(234, 88, 12, 0.05)`,stroke:RP,strokeWidth:e.id===s?2:1,strokeDasharray:e.id===s?void 0:`4 3`,pointerEvents:`none`,children:(0,F.jsx)(`title`,{children:`In the recipe: ${e.id}`})},`recipe:${e.id}`)),C.rows.map((e,t)=>(0,F.jsx)(JP,{row:e,colour:e.cells[0]?.text!==void 0&&ee?.headerRowIndex===t?FP:PP[t%2],highlighted:ee?.matchedRowIndices.includes(t)??!1,scale:AP,pageHeight:C.height,cursor:de?`crosshair`:`pointer`,onClick:de?void 0:()=>{re(e)}},`${String(e.top)}:${String(e.bottom)}`)),d===`column`&&ee!==void 0&&ee.bands.map(e=>(0,F.jsx)(YP,{band:e,scale:AP,pageHeight:C.height,onClick:()=>{ie(e.name)}},e.column)),de&&h!==void 0&&y===void 0&&(0,F.jsx)(`rect`,{"data-testid":`snap-target`,...HP(h,C.height),fill:`rgba(29, 78, 216, 0.08)`,stroke:LP,strokeWidth:1.5,strokeDasharray:`3 2`,pointerEvents:`none`}),fe!==void 0&&(0,F.jsx)(`rect`,{"data-testid":`staged-region`,...UP(fe.box,C.height),fill:`rgba(155, 93, 229, 0.12)`,stroke:`#9b5de5`,strokeWidth:1.5,pointerEvents:`none`}),fe!==void 0&&k?.cells.map(e=>(0,F.jsx)(`rect`,{"data-testid":`staged-cell`,...HP(e,C.height),fill:`rgba(155, 93, 229, 0.28)`,pointerEvents:`none`},VP(e))),y!==void 0&&(0,F.jsx)(`rect`,{x:Math.min(y.startX,y.currentX),y:Math.min(y.startY,y.currentY),width:Math.abs(y.currentX-y.startX),height:Math.abs(y.currentY-y.startY),fill:`rgba(155, 93, 229, 0.2)`,stroke:`#9b5de5`,strokeDasharray:`4 2`,pointerEvents:`none`})]}),fe!==void 0&&(0,F.jsx)(hN,{left:Math.min(fe.box.x1,fe.box.x2)*AP,top:(C.height-Math.min(fe.box.y1,fe.box.y2))*AP+6,text:ne,loading:te.isPending,onAdd:le,onClear:()=>{v(void 0)},onDragStart:ue})]})})]})}function BP(e){let t=e.currentTarget.getBoundingClientRect();return{x:e.clientX-t.left,y:e.clientY-t.top}}function VP(e){return`staged:${String(e.x)}:${String(e.y)}`}function HP(e,t){return{x:e.x*AP,y:(t-e.y-e.height)*AP,width:Math.max(e.width,1)*AP,height:e.height*AP*jP}}function UP(e,t){let[n,r]=[Math.min(e.x1,e.x2),Math.max(e.x1,e.x2)],[i,a]=[Math.min(e.y1,e.y2),Math.max(e.y1,e.y2)];return{x:n*AP,y:(t-a)*AP,width:(r-n)*AP,height:(a-i)*AP}}function WP(e,t,n,r,i){return{x1:t/AP,y1:e.height-n/AP,x2:r/AP,y2:e.height-i/AP}}function GP(e,t){let n;for(let r of e.rows)for(let i of r.cells){let r=HP(i,e.height),a=Math.max(r.x-t.x,0,t.x-(r.x+r.width)),o=Math.max(r.y-t.y,0,t.y-(r.y+r.height)),s=Math.hypot(a,o);s<=MP&&(n===void 0||s<n.distance)&&(n={cell:i,distance:s})}return n?.cell}function KP({label:e,active:t,onClick:n}){return(0,F.jsx)(U,{as:`button`,fontSize:`sm`,fontWeight:t?`semibold`:`normal`,color:t?`colorPalette.fg`:`fg`,colorPalette:`blue`,cursor:`pointer`,onClick:n,children:e})}function qP({pages:e,value:t,onChange:n}){let r=c_({items:Array.from({length:e},(e,t)=>({label:`Page ${String(t+1)}`,value:String(t)}))});return(0,F.jsxs)(BT,{collection:r,size:`sm`,width:`140px`,value:[String(t)],onValueChange:e=>{n(Number(e.value[0]))},children:[(0,F.jsx)(qT,{}),(0,F.jsx)(KT,{children:(0,F.jsx)(VT,{children:(0,F.jsx)(WT,{})})}),(0,F.jsx)(HT,{children:(0,F.jsx)(UT,{children:r.items.map(e=>(0,F.jsx)(GT,{item:e,children:e.label},e.value))})})]})}function JP({row:e,colour:t,highlighted:n,scale:r,pageHeight:i,cursor:a,onClick:o}){return(0,F.jsxs)(`g`,{onClick:o,style:{cursor:a},children:[n&&e.cells.length>0&&(0,F.jsx)(`rect`,{x:Math.min(...e.cells.map(e=>e.x))*r,y:(i-e.top)*r,width:(Math.max(...e.cells.map(e=>e.x+e.width))-Math.min(...e.cells.map(e=>e.x)))*r,height:(e.top-e.bottom)*r,fill:IP}),e.cells.map(e=>(0,F.jsx)(`rect`,{x:e.x*r,y:(i-e.y-e.height)*r,width:Math.max(e.width,1)*r,height:e.height*r*jP,fill:`transparent`,stroke:t,strokeWidth:1.5},`${String(e.x)}:${String(e.y)}`))]})}function YP({band:e,scale:t,pageHeight:n,onClick:r}){return(0,F.jsx)(`rect`,{x:e.start*t,y:0,width:Math.max(e.end-e.start,1)*t,height:n*t,fill:`rgba(46, 134, 171, 0.08)`,stroke:`#2e86ab`,strokeDasharray:`4 2`,onClick:r,style:{cursor:`pointer`},children:(0,F.jsx)(`title`,{children:e.name})})}async function XP(e,t,n,r,i){let a=await OP(()=>import(`./pdf-BReC8938.js`),[]),o=await OP(()=>import(`./pdf.worker.min-D7i8o3wR.js`),[]);a.GlobalWorkerOptions.workerSrc=o.default;let s=a.getDocument({url:t}),c=await s.promise;try{let t=await c.getPage(n);if(i.aborted)return;let a=t.getViewport({scale:r});e.width=Math.ceil(a.width),e.height=Math.ceil(a.height);let o=e.getContext(`2d`);if(o===null)return;let s=t.render({canvas:e,canvasContext:o,viewport:a});i.addEventListener(`abort`,()=>{s.cancel()}),await s.promise}finally{await s.destroy()}}function ZP(e,t){return{kind:`card`,path:t,stepType:`goto`,sentence:[{kind:`word`,text:`Go to`},{kind:`code`,text:e}],custom:!1,step:{type:`goto`,url:e}}}function QP(e,t){return[{type:`goto`,url:e},...t]}function $P(e,t,n,r){return{...n,steps:QP(e,t),keep:[`cookies`],saveTo:r}}function eF(e){let t=e.start;if(!Array.isArray(t))return;let n=t[0];if(typeof n!=`object`||!n)return;let r=n.url;return typeof r==`string`?r:void 0}function tF(e,t){let n=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`)),r=n===-1?`.`:e.slice(0,n),i=n===-1||e[n]===void 0?`/`:e[n];return`${r}${i}storage${i}${t}-session.json`}function nF(e,t,n){let r=[`[data-oc-node] { cursor: ${e?`crosshair`:`inherit`}; }`,`[data-oc-node]:hover { outline: 2px solid #3182ce !important; outline-offset: -2px; }`];return n!==void 0&&n!==``&&r.push(`${n} { outline: 2px solid #dd6b20 !important; outline-offset: -2px; background: rgba(221,107,32,0.08) !important; }`),t&&r.push(`[data-oc-hidden] { display: revert !important; visibility: visible !important; opacity: 0.5 !important; outline: 1px dashed #ed8936 !important; }`),r.join(`
15
- `)}var rF=`data-oc-node`,iF=`opencraw-picker-style`;function aF({html:e,pickMode:t,showHidden:n,hoveredSelector:r,onHoverNode:i,onPickNode:a}){let o=(0,P.useRef)(null),s=(0,P.useRef)({pickMode:t,onHoverNode:i,onPickNode:a});return s.current={pickMode:t,onHoverNode:i,onPickNode:a},(0,P.useEffect)(()=>{let e=o.current;if(e===null)return;let t,n=e=>{s.current.onHoverNode(oF(e.target))},r=()=>{s.current.onHoverNode(void 0)},i=e=>{if(!s.current.pickMode)return;let t=oF(e.target);t!==void 0&&(e.preventDefault(),e.stopPropagation(),s.current.onPickNode(t))},a=()=>{let a=e.contentDocument;a!==null&&(a.addEventListener(`mouseover`,n),a.addEventListener(`mouseout`,r),a.addEventListener(`click`,i,{capture:!0}),t=()=>{a.removeEventListener(`mouseover`,n),a.removeEventListener(`mouseout`,r),a.removeEventListener(`click`,i,{capture:!0})})};return e.addEventListener(`load`,a),()=>{e.removeEventListener(`load`,a),t?.()}},[e]),(0,P.useEffect)(()=>{let e=o.current?.contentDocument;if(e==null)return;let i=e.getElementById(iF);i===null&&(i=e.createElement(`style`),i.id=iF,e.head?.append(i)),i.textContent=nF(t,n,r)}),(0,F.jsx)(`iframe`,{ref:o,title:`Snapshot`,sandbox:`allow-same-origin`,srcDoc:e,style:{width:`100%`,height:`100%`,border:`none`,background:`white`}})}function oF(e){return(e?.nodeType===Node.ELEMENT_NODE?e.closest(`[${CSS.escape(rF)}]`):null)?.getAttribute(rF)??void 0}var sF=[],cF={object:`purple.fg`,array:`purple.fg`,element:`purple.fg`,string:`green.fg`,number:`orange.fg`,boolean:`blue.fg`,null:`fg.muted`};function lF({tree:e,onPick:t,steps:n=sF,hoveredStepId:r,onHoverStepId:i}){let[a,o]=(0,P.useState)(()=>new Set);function s(e){o(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}return(0,F.jsxs)(I,{h:`full`,overflow:`auto`,fontFamily:`mono`,fontSize:`xs`,py:2,children:[e.namespaces!==void 0&&Object.keys(e.namespaces).length>0&&(0,F.jsxs)(K,{px:2,pb:2,gap:2,flexWrap:`wrap`,children:[(0,F.jsx)(U,{color:`fg.muted`,children:`Namespaces:`}),Object.entries(e.namespaces).map(([e,t])=>(0,F.jsx)(kw,{size:`xs`,colorPalette:`gray`,children:`${e}: ${t}`},e))]}),(0,F.jsx)(uF,{node:e.root,depth:0,collapsed:a,onToggle:s,onPick:t,steps:n,hoveredStepId:r,onHoverStepId:i})]})}function uF({node:e,depth:t,collapsed:n,onToggle:r,onPick:i,steps:a,hoveredStepId:o,onHoverStepId:s}){let c=e.children.length>0,l=n.has(e.id),u=e.valueType!==`object`&&e.valueType!==`array`&&e.valueType!==`element`,d=bN(e,a),f=o!==void 0&&d.includes(o);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(K,{"data-testid":`tree-node`,"data-highlighted":f,"data-step-ids":d.length===0?void 0:d.join(` `),gap:1,pl:`${t*14+4}px`,pr:2,minH:`20px`,cursor:`pointer`,bg:f?`orange.subtle`:void 0,_hover:{bg:f?`orange.subtle`:`bg.emphasized`},onClick:()=>{i(e,`value`)},onMouseEnter:s===void 0?void 0:()=>{s(d[0])},onMouseLeave:s===void 0?void 0:()=>{s(void 0)},children:[c?(0,F.jsx)(U,{as:`button`,w:`12px`,flexShrink:0,color:`fg.muted`,onClick:t=>{t.stopPropagation(),r(e.id)},children:l?`▸`:`▾`}):(0,F.jsx)(I,{w:`12px`,flexShrink:0}),(0,F.jsx)(U,{as:`span`,color:cF[e.valueType],fontWeight:`medium`,children:e.label}),u&&e.preview!==void 0&&(0,F.jsx)(U,{as:`span`,color:`fg.muted`,truncate:!0,children:e.preview}),d.map(e=>(0,F.jsx)(kw,{size:`xs`,colorPalette:`orange`,variant:f?`solid`:`subtle`,title:`Already in the recipe: the step reading this`,flexShrink:0,children:e},e)),e.listPath!==void 0&&(0,F.jsx)(kw,{as:`button`,size:`xs`,colorPalette:`blue`,onClick:t=>{t.stopPropagation(),i(e,`list`)},title:`Read every one of the ${String(e.listCount??0)} items in this list`,children:`[*] ×${String(e.listCount??0)}`}),u&&e.jsonpath!==void 0&&(0,F.jsx)(U,{as:`button`,fontSize:`2xs`,color:`fg.muted`,_hover:{color:`fg`,textDecoration:`underline`},onClick:t=>{t.stopPropagation(),i(e,`next`)},title:`Use as the pagination "next" cursor/URL`,children:`next →`})]}),c&&!l&&e.children.map(e=>(0,F.jsx)(uF,{node:e,depth:t+1,collapsed:n,onToggle:r,onPick:i,steps:a,hoveredStepId:o,onHoverStepId:s},e.id))]})}var dF=100,fF=`img, picture, video, canvas, svg, iframe, object, embed, input, select, textarea, table`,pF=`h1, h2, h3, h4, h5, h6, li, a[href]`;function mF(e){let t=new DOMParser().parseFromString(e,`text/html`).body;for(let e of t.querySelectorAll(`script, style, noscript, template`))e.remove();return(t.textContent??``).trim().length>=dF||t.querySelector(`${fF}, ${pF}`)!==null}function hF(e,t){let n=DO(e,t)?.step.selector;return typeof n==`string`?n:void 0}function gF(e,t,n){if(e!==void 0&&t!==void 0)for(let r of kO(e)){let e=r.step.selector,i=r.step.id;if(typeof e==`string`&&typeof i==`string`&&oA(t,e).has(n))return i}}var _F=`start`,vF=new Set([`json`,`yaml`,`jsonl`,`xml`]),yF=new Set([`csv`,`xlsx`]),bF=new Set([`pptx`]);function xF({recipe:e,onSaveOutline:t,onSaveRecipe:n}){let r=e?.id,i=sk(r,r===void 0?void 0:_F),a=ck(),[o,s]=(0,P.useState)(!1),c=IO(),l=i.data?.format,u=l!==void 0&&vF.has(l),d=l===`pdf`,f=l!==void 0&&yF.has(l),p=l!==void 0&&bF.has(l),m=!u&&!d&&!f&&!p,h=i.data?.html,g=(0,P.useMemo)(()=>h===void 0||mF(h),[h]),_=fk(r,r===void 0?void 0:_F,u),v=pk(r,r===void 0?void 0:_F,d),[y,b]=(0,P.useState)(void 0),x=gk(r,r===void 0?void 0:_F,f,y),S=vk(r,r===void 0?void 0:_F,p),C=qO(e=>e.pickTarget),w=qO(e=>e.showHidden),T=qO(e=>e.hoveredStepId),E=qO(e=>e.startPicking),D=qO(e=>e.stopPicking),ee=qO(e=>e.registerPick),O=qO(e=>e.setShowHidden),te=qO(e=>e.setHoveredNodeId),k=qO(e=>e.setHoveredStepId),ne=(0,P.useMemo)(()=>hF(e?.outline,T),[e?.outline,T]),re=(0,P.useMemo)(()=>yN(e?.outline),[e?.outline]),ie=t=>{te(t),k(t===void 0?void 0:gF(e?.outline,i.data?.html,t))},A=ZO(e=>e.recipeId),ae=ZO(e=>e.active),oe=ZO(e=>e.cards.length),se=ZO(e=>e.stoppedSteps),ce=ZO(e=>e.error),j=ZO(e=>e.dismissStopped),le=bk(),ue=xk(),de=A===r&&ae,fe=A===r?se:void 0,[pe,me]=(0,P.useState)(void 0),he=e=>{me(e===void 0?void 0:{text:e,ok:!0})},ge=e=>{me(e===void 0?void 0:{text:e,ok:!1})},_e=(0,P.useRef)(void 0),ve=(0,P.useRef)(void 0),M=C!==void 0&&C.recipeId===r;(0,P.useEffect)(()=>{ve.current=void 0,b(void 0)},[r]);async function N(e){if(r===void 0)return;let t=ee(e);if(t.kind===`first`){let t=await a.mutateAsync({recipeId:r,path:_F,nodeIds:[e]});if(t.kind!==`field`){ge(t.kind===`unsupported`?t.reason:void 0);return}await Ce(e=>(_e.current=pO(e),he(`Read card: ${t.field.selector} (${t.field.matches} match${t.field.matches===1?``:`es`})`),mO(e,void 0,[aO(t.field,`steps.${e.length}`)])));return}let n=await a.mutateAsync({recipeId:r,path:_F,nodeIds:[t.firstNodeId,e]});if(n.kind!==`list`){ge(n.kind===`unsupported`?n.reason:void 0);return}await Ce(e=>{let t=_e.current;_e.current=void 0;let r=t??pO(e);return he(`List: ${n.item.selector} (${n.item.matches} items) → ${n.field.selector}`),mO(e,t,cO(n,`steps.${r}`))})}async function ye(e,t){if(r!==void 0)try{if(t===`next`){await Ce(t=>{let n=sO(e,`steps.${t.length}`);return he(`Paginate: next from ${e.jsonpath}`),mO(t,void 0,[n])});return}await Ce(n=>{if(t===`list`){let t=fO(n,e);if(t!==void 0)return he(`Added to the list: ${String(e.listPath)}`),t;let r=dO(e,`steps.${pO(n)}`);if(r!==void 0)return he(`List: ${String(e.listPath)} (${String(e.listCount??0)} items)`),mO(n,void 0,r)}let r=oO(e,`steps.${n.length}`,{generalize:t===`list`,namespaces:_.data?.namespaces});return he(`Read card: ${r.step.selector}${t===`list`?` (${String(e.listCount??0)} items)`:``}`),mO(n,void 0,[r])})}catch(e){ge(e instanceof Error?e.message:String(e))}}async function be(e){await Ce(t=>{let n=ve.current,r=n??pO(t);return ve.current=r,he(`table: ${String(e.step.selector)}`),mO(t,n,[{...e,path:`steps.${r}`}])})}async function xe(e){await Ce(t=>(he(`${String(e.step.kind)}: ${String(e.step.id)} ← ${String(e.step.selector)}`),mO(t,void 0,[{...e,path:`steps.${t.length}`}])))}async function Se(e){await Ce(t=>(he(`jsonpath: ${String(e.step.selector)}`),mO(t,void 0,[{...e,path:`steps.${t.length}`}])))}async function Ce(n){if(t===void 0||e?.outline===void 0)return;let r=n(e.outline.steps);await t(e.file,{...e.outline,steps:r})}function we(){if(r===void 0||e?.outline===void 0)return;let t=eF(e.outline.recipe);if(t===void 0){ge(`this recipe has no start point to record from`);return}le.mutate({recipeId:r,startUrl:t})}async function Te(){if(fe===void 0||e?.outline===void 0)return;let n=ZO.getState().startUrl;if(n===void 0)return;let i=e.outline.recipe.session,a=SF(i)?i:{},o=a.bootstrap,s=SF(o)?o:void 0,c=tF(e.file,r??`recipe`),l={...a,bootstrap:$P(n,fe,s,c)};await t?.(e.file,{...e.outline,recipe:{...e.outline.recipe,session:l}}),he(`Made the login: session.bootstrap, ${fe.length} step${fe.length===1?``:`s`}`),j()}async function Ee(){if(fe===void 0||e?.outline===void 0)return;let t=ZO.getState().startUrl;if(t===void 0)return;let n=ZO.getState().cards;await Ce(e=>mO(e,void 0,[ZP(t,`steps.${e.length}`),...n.map(e=>e.node)])),he(`Kept as steps: ${fe.length} step${fe.length===1?``:`s`}`),j()}if(r===void 0)return(0,F.jsx)(I,{p:4,color:`fg.muted`,children:(0,F.jsx)(U,{children:`Pick a recipe to see its snapshot here.`})});function De(){if(M){D();return}_e.current=void 0,E(r,_F)}return(0,F.jsxs)(I,{h:`full`,display:`flex`,flexDirection:`column`,children:[(0,F.jsxs)(K,{px:3,py:2,borderBottomWidth:`1px`,gap:3,flexShrink:0,minH:`38px`,children:[!u&&!d&&!f&&!p&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(U,{as:`button`,fontSize:`sm`,fontWeight:M?`semibold`:`normal`,color:M?`colorPalette.fg`:`fg`,colorPalette:`blue`,cursor:`pointer`,onClick:De,children:M?`Cancel pick`:`Read`}),(0,F.jsxs)(sE,{checked:w,onCheckedChange:e=>{O(e.checked)},size:`sm`,children:[(0,F.jsx)(dE,{}),(0,F.jsx)(uE,{}),(0,F.jsx)(cE,{fontSize:`sm`,children:`Show hidden`})]}),(0,F.jsx)(U,{as:`button`,fontSize:`sm`,fontWeight:o?`semibold`:`normal`,color:o?`colorPalette.fg`:`fg`,colorPalette:`purple`,cursor:`pointer`,onClick:()=>{s(e=>!e)},children:o?`Hide inspector`:`Inspect`}),(0,F.jsx)(U,{as:`button`,fontSize:`sm`,fontWeight:de?`semibold`:`normal`,color:de?`red.fg`:`fg`,colorPalette:`red`,cursor:`pointer`,onClick:()=>{de?ue.mutate():we()},children:de?`Stop recording`:`Record`})]}),u&&(0,F.jsx)(U,{fontSize:`sm`,color:`fg.muted`,children:`Click a value to read it; [*] reads every item of a list.`}),(i.isFetching||u&&_.isFetching||d&&v.isFetching||f&&x.isFetching||p&&S.isFetching)&&(0,F.jsx)(Mw,{size:`xs`}),pe!==void 0&&(0,F.jsx)(kw,{size:`sm`,colorPalette:pe.ok?`green`:`orange`,children:pe.text})]}),de&&(0,F.jsxs)(K,{px:3,py:2,bg:`red.subtle`,color:`red.fg`,fontSize:`sm`,gap:3,flexShrink:0,"data-testid":`recording-banner`,children:[(0,F.jsx)(I,{w:`8px`,h:`8px`,borderRadius:`full`,bg:`red.solid`,flexShrink:0}),(0,F.jsx)(U,{children:`Recording — a browser window opened for you to drive; interact with it, not with the snapshot below.`}),(0,F.jsxs)(kw,{size:`sm`,colorPalette:`red`,children:[oe,` step`,oe===1?``:`s`]})]}),ce!==void 0&&A===r&&(0,F.jsx)(I,{px:3,py:1,bg:`red.subtle`,color:`red.fg`,fontSize:`sm`,flexShrink:0,children:ce}),fe!==void 0&&(0,F.jsxs)(K,{px:3,py:2,borderBottomWidth:`1px`,gap:3,flexShrink:0,"data-testid":`recording-stopped-bar`,children:[(0,F.jsxs)(U,{fontSize:`sm`,children:[`Recording stopped: `,fe.length,` step`,fe.length===1?``:`s`,` recorded.`]}),(0,F.jsx)(Lw,{size:`xs`,colorPalette:`blue`,onClick:()=>{Te()},disabled:fe.length===0,children:`Make this the login`}),(0,F.jsx)(Lw,{size:`xs`,variant:`outline`,onClick:()=>{Ee()},disabled:fe.length===0,children:`Keep as steps`}),(0,F.jsx)(Lw,{size:`xs`,variant:`ghost`,onClick:j,children:`Discard`})]}),m&&i.data!==void 0&&!g&&(0,F.jsx)(NM,{}),(0,F.jsxs)(I,{flex:`1`,minH:`0`,children:[u&&_.data!==void 0&&(0,F.jsx)(lF,{tree:_.data,onPick:(e,t)=>{ye(e,t)},steps:re,hoveredStepId:T,onHoverStepId:k}),u&&_.isError&&(0,F.jsx)(I,{p:4,color:`fg.error`,children:(0,F.jsx)(U,{children:_.error.message})}),d&&v.data!==void 0&&(0,F.jsx)(zP,{recipeId:r,stepPath:_F,view:v.data,bytesUrl:c.pdfBytesUrl(r,_F),onTablePick:e=>{be(e)},onRegionPick:e=>{xe(e)},steps:re,hoveredStepId:T,onHoverStepId:k}),d&&v.isError&&(0,F.jsx)(I,{p:4,color:`fg.error`,children:(0,F.jsx)(U,{children:v.error.message})}),f&&x.data!==void 0&&(0,F.jsx)(lP,{recipeId:r,stepPath:_F,view:x.data,onTablePick:e=>{be(e)},onCellPick:e=>{xe(e)},steps:re,hoveredStepId:T,onHoverStepId:k,csvOverride:y,onCsvOverrideChange:b}),f&&x.isError&&(0,F.jsx)(I,{p:4,color:`fg.error`,children:(0,F.jsx)(U,{children:x.error.message})}),p&&S.data!==void 0&&(0,F.jsx)(IN,{recipeId:r,stepPath:_F,view:S.data,onTablePick:e=>{be(e)},onChartPick:e=>{Se(e)},onRegionPick:e=>{xe(e)},steps:re,hoveredStepId:T,onHoverStepId:k}),p&&S.isError&&(0,F.jsx)(I,{p:4,color:`fg.error`,children:(0,F.jsx)(U,{children:S.error.message})}),!u&&!d&&!f&&!p&&i.data!==void 0&&!o&&(0,F.jsx)(aF,{html:i.data.html,pickMode:M,showHidden:w,hoveredSelector:ne,onHoverNode:ie,onPickNode:e=>{N(e)}}),!u&&!d&&!f&&!p&&i.data!==void 0&&o&&(0,F.jsxs)(QT,{panels:[{id:`snapshot`,minSize:15},{id:`inspect`,minSize:20}],h:`full`,children:[(0,F.jsx)($T,{id:`snapshot`,overflow:`hidden`,children:(0,F.jsx)(aF,{html:i.data.html,pickMode:M,showHidden:w,hoveredSelector:ne,onHoverNode:ie,onPickNode:e=>{N(e)}})}),(0,F.jsx)(nE,{id:`snapshot:inspect`}),(0,F.jsx)($T,{id:`inspect`,overflow:`hidden`,children:(0,F.jsx)(_A,{recipeId:r,recipe:e,snapshot:i.data,onSaveOutline:t,onSaveRecipe:n})})]}),i.isError&&(0,F.jsxs)(I,{p:4,color:`fg.error`,role:`alert`,children:[(0,F.jsx)(U,{fontWeight:`semibold`,children:`Could not take a snapshot of this recipe's page.`}),(0,F.jsx)(U,{children:i.error.message})]}),!i.isFetching&&!i.isError&&i.data===void 0&&(0,F.jsx)(I,{p:4,color:`fg.muted`,children:(0,F.jsx)(U,{children:`Run a sample, or open a recipe, to see its snapshot here.`})})]})]})}function SF(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var CF=1024,wF=0,TF=class{constructor(e,t){this.from=e,this.to=t}},EF=class{constructor(e={}){this.id=wF++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw Error(`This node type doesn't define a deserialize function`)}),this.combine=e.combine||null}add(e){if(this.perNode)throw RangeError(`Can't add per-node props to node types`);return typeof e!=`function`&&(e=kF.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}};EF.closedBy=new EF({deserialize:e=>e.split(` `)}),EF.openedBy=new EF({deserialize:e=>e.split(` `)}),EF.group=new EF({deserialize:e=>e.split(` `)}),EF.isolate=new EF({deserialize:e=>{if(e&&e!=`rtl`&&e!=`ltr`&&e!=`auto`)throw RangeError(`Invalid value for isolate: `+e);return e||`auto`}}),EF.contextHash=new EF({perNode:!0}),EF.lookAhead=new EF({perNode:!0}),EF.mounted=new EF({perNode:!0});var DF=class{constructor(e,t,n,r=!1){this.tree=e,this.overlay=t,this.parser=n,this.bracketed=r}static get(e){return e&&e.props&&e.props[EF.mounted.id]}},OF=Object.create(null),kF=class e{constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(t){let n=t.props&&t.props.length?Object.create(null):OF,r=+!!t.top|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),i=new e(t.name||``,n,t.id,r);if(t.props){for(let e of t.props)if(Array.isArray(e)||(e=e(i)),e){if(e[0].perNode)throw RangeError(`Can't store a per-node prop on a node type`);n[e[0].id]=e[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e==`string`){if(this.name==e)return!0;let t=this.prop(EF.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let r of n.split(` `))t[r]=e[n];return e=>{for(let n=e.prop(EF.group),r=-1;r<(n?n.length:0);r++){let i=t[r<0?e.name:n[r]];if(i)return i}}}};kF.none=new kF(``,Object.create(null),0,8);var AF=class e{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw RangeError(`Node type ids should correspond to array positions when creating a node set`)}extend(...t){let n=[];for(let e of this.types){let r=null;for(let n of t){let t=n(e);if(t){r||=Object.assign({},e.props);let n=t[1],i=t[0];i.combine&&i.id in r&&(n=i.combine(r[i.id],n)),r[i.id]=n}}n.push(r?new kF(e.name,r,e.id,e.flags):e)}return new e(n)}},jF=new WeakMap,MF=new WeakMap,NF;(function(e){e[e.ExcludeBuffers=1]=`ExcludeBuffers`,e[e.IncludeAnonymous=2]=`IncludeAnonymous`,e[e.IgnoreMounts=4]=`IgnoreMounts`,e[e.IgnoreOverlays=8]=`IgnoreOverlays`,e[e.EnterBracketed=16]=`EnterBracketed`})(NF||={});var PF=class e{constructor(e,t,n,r,i){if(this.type=e,this.children=t,this.positions=n,this.length=r,this.props=null,i&&i.length){this.props=Object.create(null);for(let[e,t]of i)this.props[typeof e==`number`?e:e.id]=t}}toString(){let e=DF.get(this);if(e&&!e.overlay)return e.tree.toString();let t=``;for(let e of this.children){let n=e.toString();n&&(t&&(t+=`,`),t+=n)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?`(`+t+`)`:``):t}cursor(e=0){return new JF(this.topNode,e)}cursorAt(e,t=0,n=0){let r=new JF(jF.get(this)||this.topNode);return r.moveTo(e,t),jF.set(this,r._tree),r}get topNode(){return new BF(this,0,0,null)}resolve(e,t=0){let n=RF(jF.get(this)||this.topNode,e,t,!1);return jF.set(this,n),n}resolveInner(e,t=0){let n=RF(MF.get(this)||this.topNode,e,t,!0);return MF.set(this,n),n}resolveStack(e,t=0){return qF(this,e,t)}iterate(e){let{enter:t,leave:n,from:r=0,to:i=this.length}=e,a=e.mode||0,o=(a&NF.IncludeAnonymous)>0;for(let e=this.cursor(a|NF.IncludeAnonymous);;){let a=!1;if(e.from<=i&&e.to>=r&&(!o&&e.type.isAnonymous||t(e)!==!1)){if(e.firstChild())continue;a=!0}for(;a&&n&&(o||!e.type.isAnonymous)&&n(e),!e.nextSibling();){if(!e.parent())return;a=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(t={}){return this.children.length<=8?this:$F(kF.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,r)=>new e(this.type,t,n,r,this.propValues),t.makeTree||((t,n,r)=>new e(kF.none,t,n,r)))}static build(e){return XF(e)}};PF.empty=new PF(kF.none,[],[],0);var FF=class e{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new e(this.buffer,this.index)}},IF=class e{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return kF.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(`,`)}childString(e){let t=this.buffer[e],n=this.buffer[e+3],r=this.set.types[t],i=r.name;if(/\W/.test(i)&&!r.isError&&(i=JSON.stringify(i)),e+=4,n==e)return i;let a=[];for(;e<n;)a.push(this.childString(e)),e=this.buffer[e+3];return i+`(`+a.join(`,`)+`)`}findChild(e,t,n,r,i){let{buffer:a}=this,o=-1;for(let s=e;s!=t&&!(LF(i,r,a[s+1],a[s+2])&&(o=s,n>0));s=a[s+3]);return o}slice(t,n,r){let i=this.buffer,a=new Uint16Array(n-t),o=0;for(let e=t,s=0;e<n;){a[s++]=i[e++],a[s++]=i[e++]-r;let n=a[s++]=i[e++]-r;a[s++]=i[e++]-t,o=Math.max(o,n)}return new e(a,o,this.set)}};function LF(e,t,n,r){switch(e){case-2:return n<t;case-1:return r>=t&&n<t;case 0:return n<t&&r>t;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function RF(e,t,n,r){for(;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){let t=!r&&e instanceof BF&&e.index<0?null:e.parent;if(!t)return e;e=t}let i=r?0:NF.IgnoreOverlays;if(r)for(let r=e,a=r.parent;a;r=a,a=r.parent)r instanceof BF&&r.index<0&&a.enter(t,n,i)?.from!=r.from&&(e=a);for(;;){let r=e.enter(t,n,i);if(!r)return e;e=r}}var zF=class{cursor(e=0){return new JF(this,e)}getChild(e,t=null,n=null){let r=VF(this,e,t,n);return r.length?r[0]:null}getChildren(e,t=null,n=null){return VF(this,e,t,n)}resolve(e,t=0){return RF(this,e,t,!1)}resolveInner(e,t=0){return RF(this,e,t,!0)}matchContext(e){return HF(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),n=this;for(;t;){let e=t.lastChild;if(!e||e.to!=t.to)break;e.type.isError&&e.from==e.to?(n=t,t=e.prevSibling):t=e}return n}get node(){return this}get next(){return this.parent}},BF=class e extends zF{constructor(e,t,n,r){super(),this._tree=e,this.from=t,this.index=n,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(t,n,r,i,a=0){for(let o=this;;){for(let{children:s,positions:c}=o._tree,l=n>0?s.length:-1;t!=l;t+=n){let l=s[t],u=c[t]+o.from,d;if(a&NF.EnterBracketed&&l instanceof PF&&(d=DF.get(l))&&!d.overlay&&d.bracketed&&r>=u&&r<=u+l.length||LF(i,r,u,u+l.length)){if(l instanceof IF){if(a&NF.ExcludeBuffers)continue;let e=l.findChild(0,l.buffer.length,n,r-u,i);if(e>-1)return new WF(new UF(o,l,t,u),null,e)}else if(a&NF.IncludeAnonymous||!l.type.isAnonymous||YF(l)){let s;if(!(a&NF.IgnoreMounts)&&(s=DF.get(l))&&!s.overlay)return new e(s.tree,u,t,o);let c=new e(l,u,t,o);return a&NF.IncludeAnonymous||!c.type.isAnonymous?c:c.nextChild(n<0?l.children.length-1:0,n,r,i,a)}}}if(a&NF.IncludeAnonymous||!o.type.isAnonymous||(t=o.index>=0?o.index+n:n<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(t,n,r=0){let i;if(!(r&NF.IgnoreOverlays)&&(i=DF.get(this._tree))&&i.overlay){let a=t-this.from,o=r&NF.EnterBracketed&&i.bracketed;for(let{from:t,to:r}of i.overlay)if((n>0||o?t<=a:t<a)&&(n<0||o?r>=a:r>a))return new e(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}};function VF(e,t,n,r){let i=e.cursor(),a=[];if(!i.firstChild())return a;if(n!=null){for(let e=!1;!e;)if(e=i.type.is(n),!i.nextSibling())return a}for(;;){if(r!=null&&i.type.is(r))return a;if(i.type.is(t)&&a.push(i.node),!i.nextSibling())return r==null?a:[]}}function HF(e,t,n=t.length-1){for(let r=e;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(t[n]&&t[n]!=r.name)return!1;n--}}return!0}var UF=class{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}},WF=class e extends zF{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(t,n,r){let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],t,n-this.context.start,r);return a<0?null:new e(this.context,this,a)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(t,n,r=0){if(r&NF.ExcludeBuffers)return null;let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,t-this.context.start,n);return a<0?null:new e(this.context,this,a)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:t}=this.context,n=t.buffer[this.index+3];return n<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new e(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new e(this.context,this._parent,t.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,i=n.buffer[this.index+3];if(i>r){let a=n.buffer[this.index+1];e.push(n.slice(r,i,a)),t.push(0)}return new PF(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};function GF(e){if(!e.length)return null;let t=0,n=e[0];for(let r=1;r<e.length;r++){let i=e[r];(i.from>n.from||i.to<n.to)&&(n=i,t=r)}let r=n instanceof BF&&n.index<0?null:n.parent,i=e.slice();return r?i[t]=r:i.splice(t,1),new KF(i,n)}var KF=class{constructor(e,t){this.heads=e,this.node=t}get next(){return GF(this.heads)}};function qF(e,t,n){let r=e.resolveInner(t,n),i=null;for(let e=r instanceof BF?r:r.context.parent;e;e=e.parent)if(e.index<0){let a=e.parent;(i||=[r]).push(a.resolve(t,n)),e=a}else{let a=DF.get(e.tree);if(a&&a.overlay&&a.overlay[0].from<=t&&a.overlay[a.overlay.length-1].to>=t){let o=new BF(a.tree,a.overlay[0].from+e.from,-1,e);(i||=[r]).push(RF(o,t,n,!1))}}return i?GF(i):r}var JF=class{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~NF.EnterBracketed,e instanceof BF)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let t=e._parent;t;t=t._parent)this.stack.unshift(t.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:n,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return e?e instanceof BF?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:r}=this.buffer,i=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return i<0?!1:(this.stack.push(this.index),this.yieldBuf(i))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?n&NF.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&NF.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&NF.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let e=n<0?0:this.stack[n]+4;if(this.index!=e)return this.yieldBuf(t.findChild(e,this.index,-1,0,4))}else{let e=t.buffer[this.index+3];if(e<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(e)}return n<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode))}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let e=0;e<this.index;e++)if(r.buffer.buffer[e+3]<this.index)return!1;({index:t,parent:n}=r)}else({index:t,_parent:n}=this._tree);for(;n;{index:t,_parent:n}=n)if(t>-1)for(let r=t+e,i=e<0?-1:n._tree.children.length;r!=i;r+=e){let e=n._tree.children[r];if(this.mode&NF.IncludeAnonymous||e instanceof IF||!e.type.isAnonymous||YF(e))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,n=0;if(e&&e.context==this.buffer)scan:for(let r=this.index,i=this.stack.length;i>=0;){for(let a=e;a;a=a._parent)if(a.index==r){if(r==this.index)return a;t=a,n=i+1;break scan}r=this.stack[--i]}for(let e=n;e<this.stack.length;e++)t=new WF(this.buffer,t,this.stack[e]);return this.bufferNode=new WF(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let n=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){n++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&t&&t(this),r=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,r=!0}}}matchContext(e){if(!this.buffer)return HF(this.node.parent,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let r=e.length-1,i=this.stack.length-1;r>=0;i--){if(i<0)return HF(this._tree,e,r);let a=n[t.buffer[this.stack[i]]];if(!a.isAnonymous){if(e[r]&&e[r]!=a.name)return!1;r--}}return!0}};function YF(e){return e.children.some(e=>e instanceof IF||!e.type.isAnonymous||YF(e))}function XF(e){let{buffer:t,nodeSet:n,maxBufferLength:r=CF,reused:i=[],minRepeatType:a=n.types.length}=e,o=Array.isArray(t)?new FF(t,t.length):t,s=n.types,c=0,l=0;function u(e,t,_,v,y,b){let{id:x,start:S,end:C,size:w}=o,T=l,E=c;if(w<0){if(o.next(),w==-1){let t=i[x];_.push(t),v.push(S-e);return}if(w==-3){c=x;return}if(w==-4){l=x;return}throw RangeError(`Unrecognized record size: ${w}`)}let D=s[x],ee,O,te=S-e;if(C-S<=r&&(O=h(o.pos-t,y))){let t=new Uint16Array(O.size-O.skip),r=o.pos-O.size,i=t.length;for(;o.pos>r;)i=g(O.start,t,i);ee=new IF(t,C-O.start,n),te=O.start-e}else{let e=o.pos-w;o.next();let t=[],n=[],i=x>=a?x:-1,s=0,c=C;for(;o.pos>e;)i>=0&&o.id==i&&o.size>=0?(o.end<=c-r&&(p(t,n,S,s,o.end,c,i,T,E),s=t.length,c=o.end),o.next()):b>2500?d(S,e,t,n):u(S,e,t,n,i,b+1);if(i>=0&&s>0&&s<t.length&&p(t,n,S,s,S,c,i,T,E),t.reverse(),n.reverse(),i>-1&&s>0){let e=f(D,E);ee=$F(D,t,n,0,t.length,0,C-S,e,e)}else ee=m(D,t,n,C-S,T-C,E)}_.push(ee),v.push(te)}function d(e,t,i,a){let s=[],c=0,l=-1;for(;o.pos>t;){let{id:e,start:t,end:n,size:i}=o;if(i>4)o.next();else if(l>-1&&t<l)break;else l<0&&(l=n-r),s.push(e,t,n),c++,o.next()}if(c){let t=new Uint16Array(c*4),r=s[s.length-2];for(let e=s.length-3,n=0;e>=0;e-=3)t[n++]=s[e],t[n++]=s[e+1]-r,t[n++]=s[e+2]-r,t[n++]=n;i.push(new IF(t,s[2]-r,n)),a.push(r-e)}}function f(e,t){return(n,r,i)=>{let a=0,o=n.length-1,s,c;if(o>=0&&(s=n[o])instanceof PF){if(!o&&s.type==e&&s.length==i)return s;(c=s.prop(EF.lookAhead))&&(a=r[o]+s.length+c)}return m(e,n,r,i,a,t)}}function p(e,t,r,i,a,o,s,c,l){let u=[],d=[];for(;e.length>i;)u.push(e.pop()),d.push(t.pop()+r-a);e.push(m(n.types[s],u,d,o-a,c-o,l)),t.push(a-r)}function m(e,t,n,r,i,a,o){if(a){let e=[EF.contextHash,a];o=o?[e].concat(o):[e]}if(i>25){let e=[EF.lookAhead,i];o=o?[e].concat(o):[e]}return new PF(e,t,n,r,o)}function h(e,t){let n=o.fork(),i=0,s=0,c=0,l=n.end-r,u={size:0,start:0,skip:0};scan:for(let r=n.pos-e;n.pos>r;){let e=n.size;if(n.id==t&&e>=0){u.size=i,u.start=s,u.skip=c,c+=4,i+=4,n.next();continue}let o=n.pos-e;if(e<0||o<r||n.start<l)break;let d=n.id>=a?4:0,f=n.start;for(n.next();n.pos>o;){if(n.size<0){if(n.size==-3||n.size==-4)d+=4;else break scan}else n.id>=a&&(d+=4);n.next()}s=f,i+=e,c+=d}return(t<0||i==e)&&(u.size=i,u.start=s,u.skip=c),u.size>4?u:void 0}function g(e,t,n){let{id:r,start:i,end:s,size:u}=o;if(o.next(),u>=0&&r<a){let a=n;if(u>4){let r=o.pos-(u-4);for(;o.pos>r;)n=g(e,t,n)}t[--n]=a,t[--n]=s-e,t[--n]=i-e,t[--n]=r}else u==-3?c=r:u==-4&&(l=r);return n}let _=[],v=[];for(;o.pos>0;)u(e.start||0,e.bufferStart||0,_,v,-1,0);let y=e.length??(_.length?v[0]+_[0].length:0);return new PF(s[e.topID],_.reverse(),v.reverse(),y)}var ZF=new WeakMap;function QF(e,t){if(!e.isAnonymous||t instanceof IF||t.type!=e)return 1;let n=ZF.get(t);if(n==null){n=1;for(let r of t.children){if(r.type!=e||!(r instanceof PF)){n=1;break}n+=QF(e,r)}ZF.set(t,n)}return n}function $F(e,t,n,r,i,a,o,s,c){let l=0;for(let n=r;n<i;n++)l+=QF(e,t[n]);let u=Math.ceil(l*1.5/8),d=[],f=[];function p(t,n,r,i,o){for(let s=r;s<i;){let r=s,l=n[s],m=QF(e,t[s]);for(s++;s<i;s++){let n=QF(e,t[s]);if(m+n>=u)break;m+=n}if(s==r+1){if(m>u){let e=t[r];p(e.children,e.positions,0,e.children.length,n[r]+o);continue}d.push(t[r])}else{let i=n[s-1]+t[s-1].length-l;d.push($F(e,t,n,r,s,l,i,null,c))}f.push(l+o-a)}}return p(t,n,r,i,0),(s||c)(d,f,o)}var eI=class e{constructor(e,t,n,r,i=!1,a=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,this.open=!!i|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,n=[],r=!1){let i=[new e(0,t.length,t,0,!1,r)];for(let e of n)e.to>t.length&&i.push(e);return i}static applyChanges(t,n,r=128){if(!n.length)return t;let i=[],a=1,o=t.length?t[0]:null;for(let s=0,c=0,l=0;;s++){let u=s<n.length?n[s]:null,d=u?u.fromA:1e9;if(d-c>=r)for(;o&&o.from<d;){let n=o;if(c>=n.from||d<=n.to||l){let t=Math.max(n.from,c)-l,r=Math.min(n.to,d)-l;n=t>=r?null:new e(t,r,n.tree,n.offset+l,s>0,!!u)}if(n&&i.push(n),o.to>d)break;o=a<t.length?t[a++]:null}if(!u)break;c=u.toA,l=u.toA-u.toB}return i}},tI=class{startParse(e,t,n){return typeof e==`string`&&(e=new nI(e)),n=n?n.length?n.map(e=>new TF(e.from,e.to)):[new TF(0,0)]:[new TF(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let e=r.advance();if(e)return e}}},nI=class{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}};new EF({perNode:!0});var rI=class e{constructor(e,t,n,r,i,a,o,s,c,l=0,u){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=i,this.score=a,this.buffer=o,this.bufferBase=s,this.curContext=c,this.lookAhead=l,this.parent=u}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?`!`+this.score:``}`}static start(t,n,r=0){let i=t.parser.context;return new e(t,[],n,r,r,0,[],0,i?new iI(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){let t=e>>19,n=e&65535,{parser:r}=this.p,i=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),a=r.dynamicPrecedence(n);if(a&&(this.score+=a),t==0){n<r.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(r.getGoto(this.state,n,!0),this.reducePos),n<r.minRepeatTerm&&this.storeNode(n,this.reducePos,this.reducePos,i?8:4,!0),this.reduceContext(n,this.reducePos);return}let o=this.stack.length-(t-1)*3-(e&262144?6:0),s=o?this.stack[o-2]:this.p.ranges[0].from;n<r.minRepeatTerm&&s==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let c=this.reducePos-s;c>=2e3&&!this.p.parser.nodeSet.types[n]?.isAnonymous&&(s==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSize<c&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=s,this.p.lastBigReductionSize=c));let l=o?this.stack[o-1]:0,u=this.bufferBase+this.buffer.length-l;if(n<r.minRepeatTerm||e&131072){let e=r.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(n,s,e,u+4,!0)}if(e&262144)this.state=this.stack[o];else{let e=this.stack[o-3];this.state=r.getGoto(e,n,!0)}for(;this.stack.length>o;)this.stack.pop();this.reduceContext(n,s)}storeNode(e,t,n,r=4,i=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let e=this.buffer.length;if(e>0&&this.buffer[e-4]==0&&this.buffer[e-1]>-1){if(t==n)return;if(this.buffer[e-2]>=t){this.buffer[e-2]=n;return}}}if(!i||this.pos==n)this.buffer.push(e,t,n,r);else{let i=this.buffer.length;if(i>0&&(this.buffer[i-4]!=0||this.buffer[i-1]<0)){let e=!1;for(let t=i;t>0&&this.buffer[t-2]>n;t-=4)if(this.buffer[t-1]>=0){e=!0;break}if(e)for(;i>0&&this.buffer[i-2]>n;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4)}this.buffer[i]=e,this.buffer[i+1]=t,this.buffer[i+2]=n,this.buffer[i+3]=r}}shift(e,t,n,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,r,4);else{let i=e,{parser:a}=this.p;this.pos=r;let o=a.stateFlag(i,1);!o&&(r>n||t<=a.maxNode)&&(this.reducePos=r),this.pushState(i,o?n:Math.min(n,this.reducePos)),this.shiftContext(t,n),t<=a.maxNode&&this.buffer.push(t,n,r,4)}}apply(e,t,n,r){e&65536?this.reduce(e):this.shift(e,t,n,r)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(n,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let t=this,n=t.buffer.length;for(n&&t.buffer[n-4]==0&&(n-=4);n>0&&t.buffer[n-2]>t.reducePos;)n-=4;let r=t.buffer.slice(n),i=t.bufferBase+n;for(;t&&i==t.bufferBase;)t=t.parent;return new e(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,t)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new aI(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(n==0)return!1;if(!(n&65536))return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let n=[];for(let r=0,i;r<t.length;r+=2)(i=t[r+1])!=this.state&&this.p.parser.hasAction(i,e)&&n.push(t[r],i);if(this.stack.length<120)for(let e=0;n.length<8&&e<t.length;e+=2){let r=t[e+1];n.some((e,t)=>t&1&&e==r)||n.push(t[e],r)}t=n}let n=[];for(let e=0;e<t.length&&n.length<4;e+=2){let r=t[e+1];if(r==this.state)continue;let i=this.split();i.pushState(r,this.pos),i.storeNode(0,i.pos,i.pos,4,!0),i.shiftContext(t[e],this.pos),i.reducePos=this.pos,i.score-=200,n.push(i)}return n}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if(!(t&65536))return!1;if(!e.validAction(this.state,t)){let n=t>>19,r=t&65535,i=this.stack.length-n*3;if(i<0||e.getGoto(this.stack[i],r,!1)<0){let e=this.findForcedReduction();if(e==null)return!1;t=e}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(r,i)=>{if(!t.includes(r))return t.push(r),e.allActions(r,t=>{if(!(t&393216)){if(t&65536){let n=(t>>19)-i;if(n>1){let r=t&65535,i=this.stack.length-n*3;if(i>=0&&e.getGoto(this.stack[i],r,!1)>=0)return n<<19|65536|r}}else{let e=n(t,i+1);if(e!=null)return e}}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new iI(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}},iI=class{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}},aI=class{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}},oI=class e{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(t,n=t.bufferBase+t.buffer.length){return new e(t,n,n-t.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new e(this.stack,this.pos,this.index)}};function sI(e,t=Uint16Array){if(typeof e!=`string`)return e;let n=null;for(let r=0,i=0;r<e.length;){let a=0;for(;;){let t=e.charCodeAt(r++),n=!1;if(t==126){a=65535;break}t>=92&&t--,t>=34&&t--;let i=t-32;if(i>=46&&(i-=46,n=!0),a+=i,n)break;a*=46}n?n[i++]=a:n=new t(a)}return n}var cI=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}},lI=new cI,uI=class{constructor(e,t){this.input=e,this.ranges=t,this.chunk=``,this.chunkOff=0,this.chunk2=``,this.chunk2Pos=0,this.next=-1,this.token=lI,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,r=this.rangeIndex,i=this.pos+e;for(;i<n.from;){if(!r)return null;let e=this.ranges[--r];i-=n.from-e.to,n=e}for(;t<0?i>n.to:i>=n.to;){if(r==this.ranges.length-1)return null;let e=this.ranges[++r];i+=e.from-n.to,n=e}return i}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,r;if(t>=0&&t<this.chunk.length)n=this.pos+e,r=this.chunk.charCodeAt(t);else{let t=this.resolveOffset(e,1);if(t==null)return-1;if(n=t,n>=this.chunk2Pos&&n<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(n-this.chunk2Pos);else{let e=this.rangeIndex,t=this.range;for(;t.to<=n;)t=this.ranges[++e];this.chunk2=this.input.chunk(this.chunk2Pos=n),n+this.chunk2.length>t.to&&(this.chunk2=this.chunk2.slice(0,t.to-n)),r=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),r}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n<this.token.start)throw RangeError(`Token end out of bounds`);this.token.value=e,this.token.end=n}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.next=this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?-1:this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk=``,this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=lI,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk=``,this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n=``;for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return n}},dI=class{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;pI(this.data,e,t,this.id,n.data,n.tokenPrecTable)}};dI.prototype.contextual=dI.prototype.fallback=dI.prototype.extend=!1;var fI=class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e==`string`?sI(e):e}token(e,t){let n=e.pos,r=0;for(;;){let n=e.next<0,i=e.resolveOffset(1,1);if(pI(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(n||r++,i==null)break;e.reset(i,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}};fI.prototype.contextual=dI.prototype.fallback=dI.prototype.extend=!1;function pI(e,t,n,r,i,a){let o=0,s=1<<r,{dialect:c}=n.p.parser;scan:for(;(s&e[o])!=0;){let n=e[o+1];for(let r=o+3;r<n;r+=2)if((e[r+1]&s)>0){let n=e[r];if(c.allows(n)&&(t.token.value==-1||t.token.value==n||hI(n,t.token.value,i,a))){t.acceptToken(n);break}}let r=t.next,l=0,u=e[o+2];if(t.next<0&&u>l&&e[n+u*3-3]==65535){o=e[n+u*3-1];continue scan}for(;l<u;){let i=l+u>>1,a=n+i+(i<<1),s=e[a],c=e[a+1]||65536;if(r<s)u=i;else if(r>=c)l=i+1;else{o=e[a+2],t.advance();continue scan}}break}}function mI(e,t,n){for(let r=t,i;(i=e[r])!=65535;r++)if(i==n)return r-t;return-1}function hI(e,t,n,r){let i=mI(n,r,t);return i<0||mI(n,r,e)<i}var gI=typeof process<`u`&&/\bparse\b/.test({}.LOG),_I=null;function vI(e,t,n){let r=e.cursor(NF.IncludeAnonymous);for(r.moveTo(t);;)if(!(n<0?r.childBefore(t):r.childAfter(t)))for(;;){if((n<0?r.to<t:r.from>t)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,t-25)):Math.min(e.length,Math.max(r.from+1,t+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:e.length}}var yI=class{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?vI(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?vI(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let n=this.trees[t],r=this.index[t];if(r==n.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let i=n.children[r],a=this.start[t]+n.positions[r];if(a>e)return this.nextStart=a,null;if(i instanceof PF){if(a==e){if(a<this.safeFrom)return null;let e=a+i.length;if(e<=this.safeTo){let t=i.prop(EF.lookAhead);if(!t||e+t<this.fragment.to)return i}}this.index[t]++,a+i.length>=Math.max(this.safeFrom,e)&&(this.trees.push(i),this.start.push(a),this.index.push(0))}else this.index[t]++,this.nextStart=a+i.length}}},bI=class{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(e=>new cI)}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:i}=r,a=r.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,s=0;for(let r=0;r<i.length;r++){if(!(1<<r&a))continue;let c=i[r],l=this.tokens[r];if((!n||c.fallback)&&((c.contextual||l.start!=e.pos||l.mask!=a||l.context!=o)&&(this.updateCachedToken(l,c,e),l.mask=a,l.context=o),l.lookAhead>l.end+25&&(s=Math.max(l.lookAhead,s)),l.value!=0)){let r=t;if(l.extended>-1&&(t=this.addActions(e,l.extended,l.end,t)),t=this.addActions(e,l.value,l.end,t),!c.extend&&(n=l,t>r))break}}for(;this.actions.length>t;)this.actions.pop();return s&&e.setLookAhead(s),!n&&e.pos==this.stream.end&&(n=new cI,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new cI,{pos:n,p:r}=e;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,n){let r=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(r,e),n),e.value>-1){let{parser:t}=n.p;for(let r=0;r<t.specialized.length;r++)if(t.specialized[r]==e.value){let i=t.specializers[r](this.stream.read(e.start,e.end),n);if(i>=0&&n.p.parser.dialect.allows(i>>1)){i&1?e.extended=i>>1:e.value=i>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,n,r){for(let t=0;t<r;t+=3)if(this.actions[t]==e)return r;return this.actions[r++]=e,this.actions[r++]=t,this.actions[r++]=n,r}addActions(e,t,n,r){let{state:i}=e,{parser:a}=e.p,{data:o}=a;for(let e=0;e<2;e++)for(let s=a.stateSlot(i,e?2:1);;s+=3){if(o[s]==65535){if(o[s+1]==1)s=TI(o,s+2);else{r==0&&o[s+1]==2&&(r=this.putAction(TI(o,s+2),t,n,r));break}}o[s]==t&&(r=this.putAction(TI(o,s+1),t,n,r))}return r}},xI=class{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new uI(t,r),this.tokens=new bI(e,this.stream),this.topTerm=e.top[1];let{from:i}=r[0];this.stacks=[rI.start(this,e.top[0],i)],this.fragments=n.length&&this.stream.end-i>e.bufferLength*4?new yI(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],r,i;if(this.bigReductionCount>300&&e.length==1){let[t]=e;for(;t.forceReduce()&&t.stack.length&&t.stack[t.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;a<e.length;a++){let o=e[a];for(;;){if(this.tokens.mainToken=null,o.pos>t)n.push(o);else if(this.advanceStack(o,n,e))continue;else{r||(r=[],i=[]),r.push(o);let e=this.tokens.getMainToken(o);i.push(e.value,e.end)}break}}if(!n.length){let e=r&&EI(r);if(e)return gI&&console.log(`Finish with `+this.stackID(e)),this.stackToTree(e);if(this.parser.strict)throw gI&&r&&console.log(`Stuck with token `+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):`none`)),SyntaxError(`No parse at `+t);this.recovering||=5}if(this.recovering&&r){let e=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,i,n);if(e)return gI&&console.log(`Force-finish `+this.stackID(e)),this.stackToTree(e.forceAll())}if(this.recovering){let e=this.recovering==1?1:this.recovering*3;if(n.length>e)for(n.sort((e,t)=>t.score-e.score);n.length>e;)n.pop();n.some(e=>e.reducePos>t)&&this.recovering--}else if(n.length>1){outer:for(let e=0;e<n.length-1;e++){let t=n[e];for(let r=e+1;r<n.length;r++){let i=n[r];if(t.sameState(i)||t.buffer.length>500&&i.buffer.length>500){if((t.score-i.score||t.buffer.length-i.buffer.length)>0)n.splice(r--,1);else{n.splice(e--,1);continue outer}}}}n.length>12&&(n.sort((e,t)=>t.score-e.score),n.splice(12,n.length-12))}this.minStackPos=n[0].pos;for(let e=1;e<n.length;e++)n[e].pos<this.minStackPos&&(this.minStackPos=n[e].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw RangeError(`Can't move stoppedAt forward`);this.stoppedAt=e}advanceStack(e,t,n){let r=e.pos,{parser:i}=this,a=gI?this.stackID(e)+` -> `:``;if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.curContext&&e.curContext.tracker.strict,n=t?e.curContext.hash:0;for(let o=this.fragments.nodeAt(r);o;){let r=this.parser.nodeSet.types[o.type.id]==o.type?i.getGoto(e.state,o.type.id):-1;if(r>-1&&o.length&&(!t||(o.prop(EF.contextHash)||0)==n))return e.useNode(o,r),gI&&console.log(a+this.stackID(e)+` (via reuse of ${i.getName(o.type.id)})`),!0;if(!(o instanceof PF)||o.children.length==0||o.positions[0]>0)break;let s=o.children[0];if(s instanceof PF&&o.positions[0]==0)o=s;else break}}let o=i.stateSlot(e.state,4);if(o>0)return e.reduce(o),gI&&console.log(a+this.stackID(e)+` (via always-reduce ${i.getName(o&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let s=this.tokens.getActions(e);for(let o=0;o<s.length;){let c=s[o++],l=s[o++],u=s[o++],d=o==s.length||!n,f=d?e:e.split(),p=this.tokens.mainToken;if(f.apply(c,l,p?p.start:f.pos,u),gI&&console.log(a+this.stackID(f)+` (via ${c&65536?`reduce of ${i.getName(c&65535)}`:`shift`} for ${i.getName(l)} @ ${r}${f==e?``:`, split`})`),d)return!0;f.pos>r?t.push(f):n.push(f)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return SI(e,t),!0}}runRecovery(e,t,n){let r=null,i=!1;for(let a=0;a<e.length;a++){let o=e[a],s=t[a<<1],c=t[(a<<1)+1],l=gI?this.stackID(o)+` -> `:``;if(o.deadEnd&&(i||(i=!0,o.restart(),gI&&console.log(l+this.stackID(o)+` (restarted)`),this.advanceFully(o,n))))continue;let u=o.split(),d=l;for(let e=0;e<10&&u.forceReduce()&&(gI&&console.log(d+this.stackID(u)+` (via force-reduce)`),!this.advanceFully(u,n));e++)gI&&(d=this.stackID(u)+` -> `);for(let e of o.recoverByInsert(s))gI&&console.log(l+this.stackID(e)+` (via recover-insert)`),this.advanceFully(e,n);this.stream.end>o.pos?(c==o.pos&&(c++,s=0),o.recoverByDelete(s,c),gI&&console.log(l+this.stackID(o)+` (via recover-delete ${this.parser.getName(s)})`),SI(o,n)):(!r||r.score<u.score)&&(r=u)}return r}stackToTree(e){return e.close(),PF.build({buffer:oI.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(_I||=new WeakMap).get(e);return t||_I.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}};function SI(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(r.pos==e.pos&&r.sameState(e)){t[n].score<e.score&&(t[n]=e);return}}t.push(e)}var CI=class{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||this.disabled[e]==0}},wI=class e extends tI{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(` `);this.minRepeatTerm=t.length;for(let n=0;n<e.repeatNodeCount;n++)t.push(``);let n=Object.keys(e.topRules).map(t=>e.topRules[t][1]),r=[];for(let e=0;e<t.length;e++)r.push([]);function i(e,t,n){r[e].push([t,t.deserialize(String(n))])}if(e.nodeProps)for(let t of e.nodeProps){let e=t[0];typeof e==`string`&&(e=EF[e]);for(let n=1;n<t.length;){let r=t[n++];if(r>=0)i(r,e,t[n++]);else{let a=t[n+-r];for(let o=-r;o>0;o--)i(t[n++],e,a);n++}}}this.nodeSet=new AF(t.map((t,i)=>kF.define({name:i>=this.minRepeatTerm?void 0:t,id:i,props:r[i],top:n.indexOf(i)>-1,error:i==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(i)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=CF;let a=sI(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let e=0;e<this.specializerSpecs.length;e++)this.specialized[e]=this.specializerSpecs[e].term;this.specializers=this.specializerSpecs.map(DI),this.states=sI(e.states,Uint32Array),this.data=sI(e.stateData),this.goto=sI(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(e=>typeof e==`number`?new dI(a,e):e),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let r=new xI(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return-1;for(let i=r[t+1];;){let t=r[i++],a=t&1,o=r[i++];if(a&&n)return o;for(let n=i+(t>>1);i<n;i++)if(r[i]==e)return o;if(a)return-1}}hasAction(e,t){let n=this.data;for(let r=0;r<2;r++)for(let i=this.stateSlot(e,r?2:1),a;;i+=3){if((a=n[i])==65535){if(n[i+1]==1)a=n[i=TI(n,i+2)];else if(n[i+1]==2)return TI(n,i+2);else break}if(a==t||a==0)return TI(n,i+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,e=>e==t||null)}allActions(e,t){let n=this.stateSlot(e,4),r=n?t(n):void 0;for(let n=this.stateSlot(e,1);r==null;n+=3){if(this.data[n]==65535){if(this.data[n+1]==1)n=TI(this.data,n+2);else break}r=t(TI(this.data,n+1))}return r}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535){if(this.data[n+1]==1)n=TI(this.data,n+2);else break}if(!(this.data[n+2]&1)){let e=this.data[n+1];t.some((t,n)=>n&1&&t==e)||t.push(this.data[n],e)}}return t}configure(t){let n=Object.assign(Object.create(e.prototype),this);if(t.props&&(n.nodeSet=this.nodeSet.extend(...t.props)),t.top){let e=this.topRules[t.top];if(!e)throw RangeError(`Invalid top rule name ${t.top}`);n.top=e}return t.tokenizers&&(n.tokenizers=this.tokenizers.map(e=>{let n=t.tokenizers.find(t=>t.from==e);return n?n.to:e})),t.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((e,r)=>{let i=t.specializers.find(t=>t.from==e.external);if(!i)return e;let a=Object.assign(Object.assign({},e),{external:i.to});return n.specializers[r]=DI(a),a})),t.contextTracker&&(n.context=t.contextTracker),t.dialect&&(n.dialect=this.parseDialect(t.dialect)),t.strict!=null&&(n.strict=t.strict),t.wrap&&(n.wrappers=n.wrappers.concat(t.wrap)),t.bufferLength!=null&&(n.bufferLength=t.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let r of e.split(` `)){let e=t.indexOf(r);e>=0&&(n[e]=!0)}let r=null;for(let e=0;e<t.length;e++)if(!n[e])for(let n=this.dialects[t[e]],i;(i=this.data[n++])!=65535;)(r||=new Uint8Array(this.maxTerm+1))[i]=1;return new CI(e,n,r)}static deserialize(t){return new e(t)}};function TI(e,t){return e[t]|e[t+1]<<16}function EI(e){let t=null;for(let n of e){let e=n.p.stoppedAt;(n.pos==n.p.stream.end||e!=null&&n.pos>e)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.score<n.score)&&(t=n)}return t}function DI(e){if(e.external){let t=+!!e.extend;return(n,r)=>e.external(n,r)<<1|t}return e.get}var OI=0,kI=class e{constructor(e,t,n,r){this.name=e,this.set=t,this.base=n,this.modified=r,this.id=OI++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(t,n){let r=typeof t==`string`?t:`?`;if(t instanceof e&&(n=t),n?.base)throw Error(`Can not derive from a modified tag`);let i=new e(r,[],null,[]);if(i.set.push(i),n)for(let e of n.set)i.set.push(e);return i}static defineModifier(e){let t=new jI(e);return e=>e.modified.indexOf(t)>-1?e:jI.get(e.base||e,e.modified.concat(t).sort((e,t)=>e.id-t.id))}},AI=0,jI=class e{constructor(e){this.name=e,this.instances=[],this.id=AI++}static get(t,n){if(!n.length)return t;let r=n[0].instances.find(e=>e.base==t&&MI(n,e.modified));if(r)return r;let i=[],a=new kI(t.name,i,t,n);for(let e of n)e.instances.push(a);let o=NI(n);for(let n of t.set)if(!n.modified.length)for(let t of o)i.push(e.get(n,t));return a}};function MI(e,t){return e.length==t.length&&e.every((e,n)=>e==t[n])}function NI(e){let t=[[]];for(let n=0;n<e.length;n++)for(let r=0,i=t.length;r<i;r++)t.push(t[r].concat(e[n]));return t.sort((e,t)=>t.length-e.length)}function PI(e){let t=Object.create(null);for(let n in e){let r=e[n];Array.isArray(r)||(r=[r]);for(let e of n.split(` `))if(e){let n=[],i=2,a=e;for(let t=0;;){if(a==`...`&&t>0&&t+3==e.length){i=1;break}let r=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!r)throw RangeError(`Invalid path: `+e);if(n.push(r[0]==`*`?``:r[0][0]==`"`?JSON.parse(r[0]):r[0]),t+=r[0].length,t==e.length)break;let o=e[t++];if(t==e.length&&o==`!`){i=0;break}if(o!=`/`)throw RangeError(`Invalid path: `+e);a=e.slice(t)}let o=n.length-1,s=n[o];if(!s)throw RangeError(`Invalid path: `+e);t[s]=new II(r,i,o>0?n.slice(0,o):null).sort(t[s])}}return FI.add(t)}var FI=new EF({combine(e,t){let n,r,i;for(;e||t;){if(!e||t&&e.depth<=t.depth?(i=t,t=t.next):(i=e,e=e.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let a=new II(i.tags,i.mode,i.context);n?n.next=a:r=a,n=a}return r}}),II=class{constructor(e,t,n,r){this.tags=e,this.mode=t,this.context=n,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}};II.empty=new II([],2,null);function LI(e,t){let n=Object.create(null);for(let t of e)if(!Array.isArray(t.tag))n[t.tag.id]=t.class;else for(let e of t.tag)n[e.id]=t.class;let{scope:r,all:i=null}=t||{};return{style:e=>{let t=i;for(let r of e)for(let e of r.set){let r=n[e.id];if(r){t=t?t+` `+r:r;break}}return t},scope:r}}function RI(e,t){let n=null;for(let r of e){let e=r.style(t);e&&(n=n?n+` `+e:e)}return n}function zI(e,t,n,r=0,i=e.length){let a=new BI(r,Array.isArray(t)?t:[t],n);a.highlightRange(e.cursor(),r,i,``,a.highlighters),a.flush(i)}var BI=class{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=``}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,r,i){let{type:a,from:o,to:s}=e;if(o>=n||s<=t)return;a.isTop&&(i=this.highlighters.filter(e=>!e.scope||e.scope(a)));let c=r,l=VI(e)||II.empty,u=RI(i,l.tags);if(u&&(c&&(c+=` `),c+=u,l.mode==1&&(r+=(r?` `:``)+u)),this.startSpan(Math.max(t,o),c),l.opaque)return;let d=e.tree&&e.tree.prop(EF.mounted);if(d&&d.overlay){let a=e.node.enter(d.overlay[0].from+o,1),l=this.highlighters.filter(e=>!e.scope||e.scope(d.tree.type)),u=e.firstChild();for(let f=0,p=o;;f++){let m=f<d.overlay.length?d.overlay[f]:null,h=m?m.from+o:s,g=Math.max(t,p),_=Math.min(n,h);if(g<_&&u)for(;e.from<_&&(this.highlightRange(e,g,_,r,i),this.startSpan(Math.min(_,e.to),c),!(e.to>=h||!e.nextSibling())););if(!m||h>n)break;p=m.to+o,p>t&&(this.highlightRange(a.cursor(),Math.max(t,m.from+o),Math.min(n,p),``,l),this.startSpan(Math.min(n,p),c))}u&&e.parent()}else if(e.firstChild()){d&&(r=``);do if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,r,i),this.startSpan(Math.min(n,e.to),c)}while(e.nextSibling());e.parent()}}};function VI(e){let t=e.type.prop(FI);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}var q=kI.define,HI=q(),UI=q(),WI=q(UI),GI=q(UI),KI=q(),qI=q(KI),JI=q(KI),YI=q(),XI=q(YI),ZI=q(),QI=q(),$I=q(),eL=q($I),tL=q(),J={comment:HI,lineComment:q(HI),blockComment:q(HI),docComment:q(HI),name:UI,variableName:q(UI),typeName:WI,tagName:q(WI),propertyName:GI,attributeName:q(GI),className:q(UI),labelName:q(UI),namespace:q(UI),macroName:q(UI),literal:KI,string:qI,docString:q(qI),character:q(qI),attributeValue:q(qI),number:JI,integer:q(JI),float:q(JI),bool:q(KI),regexp:q(KI),escape:q(KI),color:q(KI),url:q(KI),keyword:ZI,self:q(ZI),null:q(ZI),atom:q(ZI),unit:q(ZI),modifier:q(ZI),operatorKeyword:q(ZI),controlKeyword:q(ZI),definitionKeyword:q(ZI),moduleKeyword:q(ZI),operator:QI,derefOperator:q(QI),arithmeticOperator:q(QI),logicOperator:q(QI),bitwiseOperator:q(QI),compareOperator:q(QI),updateOperator:q(QI),definitionOperator:q(QI),typeOperator:q(QI),controlOperator:q(QI),punctuation:$I,separator:q($I),bracket:eL,angleBracket:q(eL),squareBracket:q(eL),paren:q(eL),brace:q(eL),content:YI,heading:XI,heading1:q(XI),heading2:q(XI),heading3:q(XI),heading4:q(XI),heading5:q(XI),heading6:q(XI),contentSeparator:q(YI),list:q(YI),quote:q(YI),emphasis:q(YI),strong:q(YI),link:q(YI),monospace:q(YI),strikethrough:q(YI),inserted:q(),deleted:q(),changed:q(),invalid:q(),meta:tL,documentMeta:q(tL),annotation:q(tL),processingInstruction:q(tL),definition:kI.defineModifier(`definition`),constant:kI.defineModifier(`constant`),function:kI.defineModifier(`function`),standard:kI.defineModifier(`standard`),local:kI.defineModifier(`local`),special:kI.defineModifier(`special`)};for(let e in J){let t=J[e];t instanceof kI&&(t.name=e)}LI([{tag:J.link,class:`tok-link`},{tag:J.heading,class:`tok-heading`},{tag:J.emphasis,class:`tok-emphasis`},{tag:J.strong,class:`tok-strong`},{tag:J.keyword,class:`tok-keyword`},{tag:J.atom,class:`tok-atom`},{tag:J.bool,class:`tok-bool`},{tag:J.url,class:`tok-url`},{tag:J.labelName,class:`tok-labelName`},{tag:J.inserted,class:`tok-inserted`},{tag:J.deleted,class:`tok-deleted`},{tag:J.literal,class:`tok-literal`},{tag:J.string,class:`tok-string`},{tag:J.number,class:`tok-number`},{tag:[J.regexp,J.escape,J.special(J.string)],class:`tok-string2`},{tag:J.variableName,class:`tok-variableName`},{tag:J.local(J.variableName),class:`tok-variableName tok-local`},{tag:J.definition(J.variableName),class:`tok-variableName tok-definition`},{tag:J.special(J.variableName),class:`tok-variableName2`},{tag:J.definition(J.propertyName),class:`tok-propertyName tok-definition`},{tag:J.typeName,class:`tok-typeName`},{tag:J.namespace,class:`tok-namespace`},{tag:J.className,class:`tok-className`},{tag:J.macroName,class:`tok-macroName`},{tag:J.propertyName,class:`tok-propertyName`},{tag:J.operator,class:`tok-operator`},{tag:J.comment,class:`tok-comment`},{tag:J.meta,class:`tok-meta`},{tag:J.invalid,class:`tok-invalid`},{tag:J.punctuation,class:`tok-punctuation`}]);var nL=PI({String:J.string,Number:J.number,"True False":J.bool,PropertyName:J.propertyName,Null:J.null,", :":J.separator,"[ ]":J.squareBracket,"{ }":J.brace}),rL=wI.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:`#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O`,goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:`⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array`,maxTerm:25,nodeProps:[[`isolate`,-2,6,11,``],[`openedBy`,7,`{`,14,`[`],[`closedBy`,8,`}`,15,`]`]],propSources:[nL],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),iL=[],aL=[];(()=>{let e=`lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,1n,9,16,o,,x,1i,3,,i,,7,a,2,t,3,1k,,,7,2,2,2,3,9,,a,2,q,,2,3,1k,,,5,4,2,2,3,3,,u,2,3,,b,3,1k,,,8,,3,,3,k,2,m,6,,3,1k,,,7,2,2,2,3,7,3,a,2,u,,1n,5,3,3,,4,9,,14,5,1j,,,7,,3,,4,7,2,b,2,t,3,1k,,,7,,3,,4,7,2,b,2,f,,c,4,1j,2,,7,,3,,4,9,,a,2,t,3,1y,,4,6,,,,8,i,2,1p,,,8,c,8,2q,,,a,b,7,21,2,r,,,,,,4,2,1d,k,,2,5,b,,10,9,,2u,b,,6,n,4,4,3,g,4,d,,,3,6,,f,,jj,3,qa,4,s,3,t,2,u,2,1s,w,9,,19,3,,,39,2,y,,3a,c,4,c,63,5,1l,a,,,,,2,o,2,,1c,1a,2,c,k,5,1b,h,12,9,c,3,u,d,1k,e,1c,k,48,3,,l,4,,6,,2,3,5i,1s,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,n,5,4,,2b,2,1e,i,q,i,d,,12,8,p,d,18,4,1b,e,10,,1v,e,c,,8,2,1a,,1f,,,3,2,2,5,2,,,15,5,5,2,6k,8,,2,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,1t,5,8t,2,25,6,1y,b,1d,4,3e,3,1h,f,15,,2,2,a,4,19,b,7,,1p,3,10,e,g,2,18,,c,3,1c,e,8,4,,2,2k,c,6,,2,,4d,c,l,4,1j,2,,7,2,2,2,3,9,,a,2,2,7,3,5,1v,9,,,2,,,4,,5,,,e,2,2a,i,n,,29,k,6j,7,2,9,r,2,2a,h,2y,d,2t,3,2,a,74,f,6t,6,,2,2,4,,,,2,3x,7,2,7,3,,s,a,14,7,,4,8,,9,b,1a,g,5i,8,5j,8,,8,2a,m,,e,3e,6,3,,,2,,7,,,1u,5,,2,,5,9n,4,9,2,,,1c,7,3,5,n,,44l,,6,f,8ug,i,1xc,5,1n,7,t4,,,1j,7,4,29,,b,2,f57,2,3mp,1a,2,n,f2,5,3,6,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,2s,,4g,7,af,,1p,4,e4,4,72,2,6r,,2,,7,2,5,,d6,7,31,7,240,5`.split(`,`).map(e=>e?parseInt(e,36):1);for(let t=0,n=0;t<e.length;t++)(t%2?aL:iL).push(n+=e[t])})();function oL(e){if(e<768)return!1;for(let t=0,n=iL.length;;){let r=t+n>>1;if(e<iL[r])n=r;else if(e>=aL[r])t=r+1;else return!0;if(t==n)return!1}}function sL(e){return e>=127462&&e<=127487}var cL=8205;function lL(e,t,n=!0,r=!0){return(n?uL:dL)(e,t,r)}function uL(e,t,n){if(t==e.length)return t;t&&pL(e.charCodeAt(t))&&mL(e.charCodeAt(t-1))&&t--;let r=fL(e,t);for(t+=hL(r);t<e.length;){let i=fL(e,t);if(r==cL||i==cL||n&&oL(i))t+=hL(i),r=i;else if(sL(i)){let n=0,r=t-2;for(;r>=0&&sL(fL(e,r));)n++,r-=2;if(n%2==0)break;t+=2}else break}return t}function dL(e,t,n){for(;t>1;){let r=uL(e,t-2,n);if(r<t)return r;t--}return 0}function fL(e,t){let n=e.charCodeAt(t);if(!mL(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return pL(r)?(n-55296<<10)+(r-56320)+65536:n}function pL(e){return e>=56320&&e<57344}function mL(e){return e>=55296&&e<56320}function hL(e){return e<65536?1:2}var gL=class e{lineAt(e){if(e<0||e>this.length)throw RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=EL(this,e,t);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),vL.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=EL(this,e,t);let n=[];return this.decompose(e,t,n,0),vL.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new SL(this),i=new SL(e);for(let e=t,a=t;;){if(r.next(e),i.next(e),e=0,r.lineBreak!=i.lineBreak||r.done!=i.done||r.value!=i.value)return!1;if(a+=r.value.length,r.done||a>=n)return!0}}iter(e=1){return new SL(this,e)}iterRange(e,t=this.length){return new CL(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t??=this.lines+1;let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new wL(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(t){if(t.length==0)throw RangeError(`A document must have at least one line`);return t.length==1&&!t[0]?e.empty:t.length<=32?new _L(t):vL.from(_L.split(t,[]))}},_L=class e extends gL{constructor(e,t=yL(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.text[i],o=r+a.length;if((t?n:o)>=e)return new TL(r,o,n,a);r=o+1,n++}}decompose(t,n,r,i){let a=t<=0&&n>=this.length?this:new e(xL(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(i&1){let t=r.pop(),n=bL(a.text,t.text.slice(),0,a.length);if(n.length<=32)r.push(new e(n,t.length+a.length));else{let t=n.length>>1;r.push(new e(n.slice(0,t)),new e(n.slice(t)))}}else r.push(a)}replace(t,n,r){if(!(r instanceof e))return super.replace(t,n,r);[t,n]=EL(this,t,n);let i=bL(this.text,bL(r.text,xL(this.text,0,t)),n),a=this.length+r.length-(n-t);return i.length<=32?new e(i,a):vL.from(e.split(i,[]),a)}sliceString(e,t=this.length,n=`
16
- `){[e,t]=EL(this,e,t);let r=``;for(let i=0,a=0;i<=t&&a<this.text.length;a++){let o=this.text[a],s=i+o.length;i>e&&a&&(r+=n),e<s&&t>i&&(r+=o.slice(Math.max(0,e-i),t-i)),i=s+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(t,n){let r=[],i=-1;for(let a of t)r.push(a),i+=a.length+1,r.length==32&&(n.push(new e(r,i)),r=[],i=-1);return i>-1&&n.push(new e(r,i)),n}},vL=class e extends gL{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let t of e)this.lines+=t.lines}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.children[i],o=r+a.length,s=n+a.lines-1;if((t?s:o)>=e)return a.lineInner(e,t,n,r);r=o+1,n=s+1}}decompose(e,t,n,r){for(let i=0,a=0;a<=t&&i<this.children.length;i++){let o=this.children[i],s=a+o.length;if(e<=s&&t>=a){let i=r&(a<=e|(s>=t?2:0));a>=e&&s<=t&&!i?n.push(o):o.decompose(e-a,t-a,n,i)}a=s+1}}replace(t,n,r){if([t,n]=EL(this,t,n),r.lines<this.lines)for(let i=0,a=0;i<this.children.length;i++){let o=this.children[i],s=a+o.length;if(t>=a&&n<=s){let c=o.replace(t-a,n-a,r),l=this.lines-o.lines+c.lines;if(c.lines<l>>4&&c.lines>l>>6){let a=this.children.slice();return a[i]=c,new e(a,this.length-(n-t)+r.length)}return super.replace(a,s,c)}a=s+1}return super.replace(t,n,r)}sliceString(e,t=this.length,n=`
17
- `){[e,t]=EL(this,e,t);let r=``;for(let i=0,a=0;i<this.children.length&&a<=t;i++){let o=this.children[i],s=a+o.length;a>e&&i&&(r+=n),e<s&&t>a&&(r+=o.sliceString(e-a,t-a,n)),a=s+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(t,n){if(!(t instanceof e))return 0;let r=0,[i,a,o,s]=n>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;i+=n,a+=n){if(i==o||a==s)return r;let e=this.children[i],c=t.children[a];if(e!=c)return r+e.scanIdentical(c,n);r+=e.length+1}}static from(t,n=t.reduce((e,t)=>e+t.length+1,-1)){let r=0;for(let e of t)r+=e.lines;if(r<32){let e=[];for(let n of t)n.flatten(e);return new _L(e,n)}let i=Math.max(32,r>>5),a=i<<1,o=i>>1,s=[],c=0,l=-1,u=[];function d(t){let n;if(t.lines>a&&t instanceof e)for(let e of t.children)d(e);else t.lines>o&&(c>o||!c)?(f(),s.push(t)):t instanceof _L&&c&&(n=u[u.length-1])instanceof _L&&t.lines+n.lines<=32?(c+=t.lines,l+=t.length+1,u[u.length-1]=new _L(n.text.concat(t.text),n.length+1+t.length)):(c+t.lines>i&&f(),c+=t.lines,l+=t.length+1,u.push(t))}function f(){c!=0&&(s.push(u.length==1?u[0]:e.from(u,l)),l=-1,c=u.length=0)}for(let e of t)d(e);return f(),s.length==1?s[0]:new e(s,n)}};gL.empty=new _L([``],0);function yL(e){let t=-1;for(let n of e)t+=n.length+1;return t}function bL(e,t,n=0,r=1e9){for(let i=0,a=0,o=!0;a<e.length&&i<=r;a++){let s=e[a],c=i+s.length;c>=n&&(c>r&&(s=s.slice(0,r-i)),i<n&&(s=s.slice(n-i)),o?(t[t.length-1]+=s,o=!1):t.push(s)),i=c+1}return t}function xL(e,t,n){return bL(e,[``],t,n)}var SL=class{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value=``,this.nodes=[e],this.offsets=[t>0?1:(e instanceof _L?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],i=this.offsets[n],a=i>>1,o=r instanceof _L?r.text.length:r.children.length;if(a==(t>0?o:0)){if(n==0)return this.done=!0,this.value=``,this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((i&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=`
18
- `,this;e--}else if(r instanceof _L){let i=r.text[a+(t<0?-1:0)];if(this.offsets[n]+=t,i.length>Math.max(0,e))return this.value=e==0?i:t>0?i.slice(e):i.slice(0,i.length-e),this;e-=i.length}else{let i=r.children[a+(t<0?-1:0)];e>i.length?(e-=i.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(i),this.offsets.push(t>0?1:(i instanceof _L?i.text.length:i.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}},CL=class{constructor(e,t,n){this.value=``,this.done=!1,this.cursor=new SL(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value=``,this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=``}},wL=class{constructor(e){this.inner=e,this.afterBreak=!0,this.value=``,this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value=``,this.afterBreak=!1):t?(this.done=!0,this.value=``):n?this.afterBreak?this.value=``:(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}};typeof Symbol<`u`&&(gL.prototype[Symbol.iterator]=function(){return this.iter()},SL.prototype[Symbol.iterator]=CL.prototype[Symbol.iterator]=wL.prototype[Symbol.iterator]=function(){return this});var TL=class{constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}};function EL(e,t,n){return t=Math.max(0,Math.min(e.length,t)),[t,Math.max(t,Math.min(e.length,n))]}function DL(e,t,n=!0,r=!0){return lL(e,t,n,r)}function OL(e){return e>=56320&&e<57344}function kL(e){return e>=55296&&e<56320}function AL(e,t){let n=e.charCodeAt(t);if(!kL(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return OL(r)?(n-55296<<10)+(r-56320)+65536:n}function jL(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}function ML(e){return e<65536?1:2}var NL=/\r\n?|\n/,PL=(function(e){return e[e.Simple=0]=`Simple`,e[e.TrackDel=1]=`TrackDel`,e[e.TrackBefore=2]=`TrackBefore`,e[e.TrackAfter=3]=`TrackAfter`,e})(PL||={}),FL=class e{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,r=0;t<this.sections.length;){let i=this.sections[t++],a=this.sections[t++];a<0?(e(n,r,i),r+=i):r+=a,n+=i}}iterChangedRanges(e,t=!1){zL(this,e,t)}get invertedDesc(){let t=[];for(let e=0;e<this.sections.length;){let n=this.sections[e++],r=this.sections[e++];r<0?t.push(n,r):t.push(r,n)}return new e(t)}composeDesc(e){return this.empty?e:e.empty?this:VL(this,e)}mapDesc(e,t=!1){return e.empty?this:BL(this,e,t)}mapPos(e,t=-1,n=PL.Simple){let r=0,i=0;for(let a=0;a<this.sections.length;){let o=this.sections[a++],s=this.sections[a++],c=r+o;if(s<0){if(c>e)return i+(e-r);i+=o}else{if(n!=PL.Simple&&c>=e&&(n==PL.TrackDel&&r<e&&c>e||n==PL.TrackBefore&&r<e||n==PL.TrackAfter&&c>e))return null;if(c>e||c==e&&t<0&&!o)return e==r||t<0?i:i+s;i+=s}r=c}if(e>r)throw RangeError(`Position ${e} is out of range for changeset of length ${r}`);return i}touchesRange(e,t=e){for(let n=0,r=0;n<this.sections.length&&r<=t;){let i=this.sections[n++],a=this.sections[n++],o=r+i;if(a>=0&&r<=t&&o>=e)return r<e&&o>t?`cover`:!0;r=o}return!1}toString(){let e=``;for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];e+=(e?` `:``)+n+(r>=0?`:`+r:``)}return e}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(e=>typeof e!=`number`))throw RangeError(`Invalid JSON representation of ChangeDesc`);return new e(t)}static create(t){return new e(t)}},IL=class e extends FL{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw RangeError(`Applying change set to a document with the wrong length`);return zL(this,(t,n,r,i,a)=>e=e.replace(r,r+(n-t),a),!1),e}mapDesc(e,t=!1){return BL(this,e,t,!0)}invert(t){let n=this.sections.slice(),r=[];for(let e=0,i=0;e<n.length;e+=2){let a=n[e],o=n[e+1];if(o>=0){n[e]=o,n[e+1]=a;let s=e>>1;for(;r.length<s;)r.push(gL.empty);r.push(a?t.slice(i,i+a):gL.empty)}i+=a}return new e(n,r)}compose(e){return this.empty?e:e.empty?this:VL(this,e,!0)}map(e,t=!1){return e.empty?this:BL(this,e,t,!0)}iterChanges(e,t=!1){zL(this,e,t)}get desc(){return FL.create(this.sections)}filter(t){let n=[],r=[],i=[],a=new HL(this);done:for(let e=0,o=0;;){let s=e==t.length?1e9:t[e++];for(;o<s||o==s&&a.len==0;){if(a.done)break done;let e=Math.min(a.len,s-o);LL(i,e,-1);let t=a.ins==-1?-1:a.off==0?a.ins:0;LL(n,e,t),t>0&&RL(r,n,a.text),a.forward(e),o+=e}let c=t[e++];for(;o<c;){if(a.done)break done;let e=Math.min(a.len,c-o);LL(n,e,-1),LL(i,e,a.ins==-1?-1:a.off==0?a.ins:0),a.forward(e),o+=e}}return{changes:new e(n,r),filtered:FL.create(i)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t],r=this.sections[t+1];r<0?e.push(n):r==0?e.push([n]):e.push([n].concat(this.inserted[t>>1].toJSON()))}return e}static of(t,n,r){let i=[],a=[],o=0,s=null;function c(t=!1){if(!t&&!i.length)return;o<n&&LL(i,n-o,-1);let r=new e(i,a);s=s?s.compose(r.map(s)):r,i=[],a=[],o=0}function l(t){if(Array.isArray(t))for(let e of t)l(e);else if(t instanceof e){if(t.length!=n)throw RangeError(`Mismatched change set length (got ${t.length}, expected ${n})`);c(),s=s?s.compose(t.map(s)):t}else{let{from:e,to:s=e,insert:l}=t;if(e>s||e<0||s>n)throw RangeError(`Invalid change range ${e} to ${s} (in doc of length ${n})`);let u=l?typeof l==`string`?gL.of(l.split(r||NL)):l:gL.empty,d=u.length;if(e==s&&d==0)return;e<o&&c(),e>o&&LL(i,e-o,-1),LL(i,s-e,d),RL(a,i,u),o=s}}return l(t),c(!s),s}static empty(t){return new e(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw RangeError(`Invalid JSON representation of ChangeSet`);let n=[],r=[];for(let e=0;e<t.length;e++){let i=t[e];if(typeof i==`number`)n.push(i,-1);else if(!Array.isArray(i)||typeof i[0]!=`number`||i.some((e,t)=>t&&typeof e!=`string`))throw RangeError(`Invalid JSON representation of ChangeSet`);else if(i.length==1)n.push(i[0],0);else{for(;r.length<e;)r.push(gL.empty);r[e]=gL.of(i.slice(1)),n.push(i[0],r[e].length)}}return new e(n,r)}static createSet(t,n){return new e(t,n)}};function LL(e,t,n,r=!1){if(t==0&&n<=0)return;let i=e.length-2;i>=0&&n<=0&&n==e[i+1]?e[i]+=t:i>=0&&t==0&&e[i]==0?e[i+1]+=n:r?(e[i]+=t,e[i+1]+=n):e.push(t,n)}function RL(e,t,n){if(n.length==0)return;let r=t.length-2>>1;if(r<e.length)e[e.length-1]=e[e.length-1].append(n);else{for(;e.length<r;)e.push(gL.empty);e.push(n)}}function zL(e,t,n){let r=e.inserted;for(let i=0,a=0,o=0;o<e.sections.length;){let s=e.sections[o++],c=e.sections[o++];if(c<0)i+=s,a+=s;else{let l=i,u=a,d=gL.empty;for(;l+=s,u+=c,c&&r&&(d=d.append(r[o-2>>1])),!(n||o==e.sections.length||e.sections[o+1]<0);)s=e.sections[o++],c=e.sections[o++];t(i,l,a,u,d),i=l,a=u}}}function BL(e,t,n,r=!1){let i=[],a=r?[]:null,o=new HL(e),s=new HL(t);for(let e=-1;;)if(o.done&&s.len||s.done&&o.len)throw Error(`Mismatched change set lengths`);else if(o.ins==-1&&s.ins==-1){let e=Math.min(o.len,s.len);LL(i,e,-1),o.forward(e),s.forward(e)}else if(s.ins>=0&&(o.ins<0||e==o.i||o.off==0&&(s.len<o.len||s.len==o.len&&!n))){let t=s.len;for(LL(i,s.ins,-1);t;){let n=Math.min(o.len,t);o.ins>=0&&e<o.i&&o.len<=n&&(LL(i,0,o.ins),a&&RL(a,i,o.text),e=o.i),o.forward(n),t-=n}s.next()}else if(o.ins>=0){let t=0,n=o.len;for(;n;)if(s.ins==-1){let e=Math.min(n,s.len);t+=e,n-=e,s.forward(e)}else if(s.ins==0&&s.len<n)n-=s.len,s.next();else break;LL(i,t,e<o.i?o.ins:0),a&&e<o.i&&RL(a,i,o.text),e=o.i,o.forward(o.len-n)}else if(o.done&&s.done)return a?IL.createSet(i,a):FL.create(i);else throw Error(`Mismatched change set lengths`)}function VL(e,t,n=!1){let r=[],i=n?[]:null,a=new HL(e),o=new HL(t);for(let e=!1;;)if(a.done&&o.done)return i?IL.createSet(r,i):FL.create(r);else if(a.ins==0)LL(r,a.len,0,e),a.next();else if(o.len==0&&!o.done)LL(r,0,o.ins,e),i&&RL(i,r,o.text),o.next();else if(a.done||o.done)throw Error(`Mismatched change set lengths`);else{let t=Math.min(a.len2,o.len),n=r.length;if(a.ins==-1){let n=o.ins==-1?-1:o.off?0:o.ins;LL(r,t,n,e),i&&n&&RL(i,r,o.text)}else o.ins==-1?(LL(r,a.off?0:a.len,t,e),i&&RL(i,r,a.textBit(t))):(LL(r,a.off?0:a.len,o.off?0:o.ins,e),i&&!o.off&&RL(i,r,o.text));e=(a.ins>t||o.ins>=0&&o.len>t)&&(e||r.length>n),a.forward2(t),o.forward(t)}}var HL=class{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?gL.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?gL.empty:t[n].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}},UL=class e{constructor(e,t,n,r){this.from=e,this.to=t,this.flags=n,this.goalColumn=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get undirectional(){return(this.flags&64)>0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}map(t,n=-1){let r,i;return this.empty?r=i=t.mapPos(this.from,n):(r=t.mapPos(this.from,1),i=t.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new e(r,i,this.flags,this.goalColumn)}extend(e,t=e,n=0){if(e<=this.anchor&&t>=this.anchor)return Y.range(e,t,void 0,void 0,n);let r=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return Y.range(this.anchor,r,void 0,void 0,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!=`number`||typeof e.head!=`number`)throw RangeError(`Invalid JSON representation for SelectionRange`);return Y.range(e.anchor,e.head)}static create(t,n,r,i){return new e(t,n,r,i)}},Y=class e{constructor(e,t){this.ranges=e,this.mainIndex=t}map(t,n=-1){return t.empty?this:e.create(this.ranges.map(e=>e.map(t,n)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new e([this.main],0)}addRange(t,n=!0){return e.create([t].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(t,n=this.mainIndex){let r=this.ranges.slice();return r[n]=t,e.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!=`number`||t.main>=t.ranges.length)throw RangeError(`Invalid JSON representation for EditorSelection`);return new e(t.ranges.map(e=>UL.fromJSON(e)),t.main)}static single(t,n=t){return new e([e.range(t,n)],0)}static create(t,n=0){if(t.length==0)throw RangeError(`A selection needs at least one range`);for(let r=0,i=0;i<t.length;i++){let a=t[i];if(a.empty?a.from<=r:a.from<r)return e.normalized(t.slice(),n);r=a.to}return new e(t,n)}static cursor(e,t=0,n,r){return UL.create(e,e,(t==0?0:t<0?8:16)|(n==null?7:Math.min(6,n)),r)}static range(e,t,n,r,i){let a=r==null?7:Math.min(6,r);return!i&&e!=t&&(i=t<e?1:-1),i&&(a|=i<0?8:16),t<e?UL.create(t,e,a|32,n):UL.create(e,t,a,n)}static undirectionalRange(e,t){return UL.create(e,t,64,void 0)}static normalized(t,n=0){let r=t[n];t.sort((e,t)=>e.from-t.from),n=t.indexOf(r);for(let r=1;r<t.length;r++){let i=t[r],a=t[r-1];if(i.empty?i.from<=a.to:i.from<a.to){let o=a.from,s=Math.max(i.to,a.to);r<=n&&n--,t.splice(--r,2,i.anchor>i.head?e.range(s,o):e.range(o,s))}}return new e(t,n)}};function WL(e,t){for(let n of e.ranges)if(n.to>t)throw RangeError(`Selection points outside of document`)}var GL=0,X=class e{constructor(e,t,n,r,i){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=r,this.id=GL++,this.default=e([]),this.extensions=typeof i==`function`?i(this):i}get reader(){return this}static define(t={}){return new e(t.combine||(e=>e),t.compareInput||((e,t)=>e===t),t.compare||(t.combine?(e,t)=>e===t:KL),!!t.static,t.enables)}of(e){return new qL([],this,0,e)}compute(e,t){if(this.isStatic)throw Error(`Can't compute a static facet`);return new qL(e,this,1,t)}computeN(e,t){if(this.isStatic)throw Error(`Can't compute a static facet`);return new qL(e,this,2,t)}from(e,t){return t||=e=>e,this.compute([e],n=>t(n.field(e)))}};function KL(e,t){return e==t||e.length==t.length&&e.every((e,n)=>e===t[n])}var qL=class{constructor(e,t,n,r){this.dependencies=e,this.facet=t,this.type=n,this.value=r,this.id=GL++}dynamicSlot(e){let t=this.value,n=this.facet.compareInput,r=this.id,i=e[r]>>1,a=this.type==2,o=!1,s=!1,c=[];for(let t of this.dependencies)t==`doc`?o=!0:t==`selection`?s=!0:(e[t.id]??1)&1||c.push(e[t.id]);return{create(e){return e.values[i]=t(e),1},update(e,r){if(o&&r.docChanged||s&&(r.docChanged||r.selection)||YL(e,c)){let r=t(e);if(a?!JL(r,e.values[i],n):!n(r,e.values[i]))return e.values[i]=r,1}return 0},reconfigure:(e,o)=>{let s,c=o.config.address[r];if(c!=null){let r=cR(o,c);if(this.dependencies.every(t=>t instanceof X?o.facet(t)===e.facet(t):t instanceof QL?o.field(t,!1)==e.field(t,!1):!0)||(a?JL(s=t(e),r,n):n(s=t(e),r)))return e.values[i]=r,0}else s=t(e);return e.values[i]=s,1}}}get extension(){return this}};function JL(e,t,n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1;return!0}function YL(e,t){let n=!1;for(let r of t)sR(e,r)&1&&(n=!0);return n}function XL(e,t,n){let r=n.map(t=>e[t.id]),i=n.map(e=>e.type),a=r.filter(e=>!(e&1)),o=e[t.id]>>1;function s(e){let n=[];for(let t=0;t<r.length;t++){let a=cR(e,r[t]);if(i[t]==2)for(let e of a)n.push(e);else n.push(a)}return t.combine(n)}return{create(e){for(let t of r)sR(e,t);return e.values[o]=s(e),1},update(e,n){if(!YL(e,a))return 0;let r=s(e);return t.compare(r,e.values[o])?0:(e.values[o]=r,1)},reconfigure(e,i){let a=YL(e,r),c=i.config.facets[t.id],l=i.facet(t);if(c&&!a&&KL(n,c))return e.values[o]=l,0;let u=s(e);return t.compare(u,l)?(e.values[o]=l,0):(e.values[o]=u,1)}}}var ZL=X.define({static:!0}),QL=class e{constructor(e,t,n,r,i){this.id=e,this.createF=t,this.updateF=n,this.compareF=r,this.spec=i,this.provides=void 0}static define(t){let n=new e(GL++,t.create,t.update,t.compare||((e,t)=>e===t),t);return t.provide&&(n.provides=t.provide(n)),n}create(e){return(e.facet(ZL).find(e=>e.field==this)?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:e=>(e.values[t]=this.create(e),1),update:(e,n)=>{let r=e.values[t],i=this.updateF(r,n);return this.compareF(r,i)?0:(e.values[t]=i,1)},reconfigure:(e,n)=>{let r=e.facet(ZL),i=n.facet(ZL),a;return(a=r.find(e=>e.field==this))&&a!=i.find(e=>e.field==this)?(e.values[t]=a.create(e),1):n.config.address[this.id]==null?(e.values[t]=this.create(e),1):(e.values[t]=n.field(this),0)}}}init(e){return[this,ZL.of({field:this,create:e})]}get extension(){return this}},$L={lowest:4,low:3,default:2,high:1,highest:0};function eR(e){return t=>new nR(t,e)}var tR={highest:eR($L.highest),high:eR($L.high),default:eR($L.default),low:eR($L.low),lowest:eR($L.lowest)},nR=class{constructor(e,t){this.inner=e,this.prec=t}get extension(){return this}},rR=class e{of(e){return new iR(this,e)}reconfigure(t){return e.reconfigure.of({compartment:this,extension:t})}get(e){return e.config.compartments.get(this)}},iR=class{constructor(e,t){this.compartment=e,this.inner=t}get extension(){return this}},aR=class e{constructor(e,t,n,r,i,a){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=r,this.staticValues=i,this.facets=a,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(t,n,r){let i=[],a=Object.create(null),o=new Map;for(let e of oR(t,n,o))e instanceof QL?i.push(e):(a[e.facet.id]||(a[e.facet.id]=[])).push(e);let s=Object.create(null),c=[],l=[];for(let e of i)s[e.id]=l.length<<1,l.push(t=>e.slot(t));let u=r?.config.facets;for(let e in a){let t=a[e],n=t[0].facet,i=u&&u[e]||[];if(t.every(e=>e.type==0)){if(s[n.id]=c.length<<1|1,KL(i,t))c.push(r.facet(n));else{let e=n.combine(t.map(e=>e.value));c.push(r&&n.compare(e,r.facet(n))?r.facet(n):e)}}else{for(let e of t)e.type==0?(s[e.id]=c.length<<1|1,c.push(e.value)):(s[e.id]=l.length<<1,l.push(t=>e.dynamicSlot(t)));s[n.id]=l.length<<1,l.push(e=>XL(e,n,t))}}let d=l.map(e=>e(s));return new e(t,o,d,s,c,a)}};function oR(e,t,n){let r=[[],[],[],[],[]],i=new Map;function a(e,o){let s=i.get(e);if(s!=null){if(s<=o)return;let t=r[s].indexOf(e);t>-1&&r[s].splice(t,1),e instanceof iR&&n.delete(e.compartment)}if(i.set(e,o),Array.isArray(e))for(let t of e)a(t,o);else if(e instanceof iR){if(n.has(e.compartment))throw RangeError(`Duplicate use of compartment in extensions`);let r=t.get(e.compartment)||e.inner;n.set(e.compartment,r),a(r,o)}else if(e instanceof nR)a(e.inner,e.prec);else if(e instanceof QL)r[o].push(e),e.provides&&a(e.provides,o);else if(e instanceof qL)r[o].push(e),e.facet.extensions&&a(e.facet.extensions,$L.default);else{let t=e.extension;if(!t)throw Error(`Unrecognized extension value in extension set (${e}).`);if(t==e)throw Error(`Unrecognized extension value in extension set (${e}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);a(t,o)}}return a(e,$L.default),r.reduce((e,t)=>e.concat(t))}function sR(e,t){if(t&1)return 2;let n=t>>1,r=e.status[n];if(r==4)throw Error(`Cyclic dependency between fields and/or facets`);if(r&2)return r;e.status[n]=4;let i=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|i}function cR(e,t){return t&1?e.config.staticValues[t>>1]:e.values[t>>1]}var lR=X.define(),uR=X.define({combine:e=>e.some(e=>e),static:!0}),dR=X.define({combine:e=>e.length?e[0]:void 0,static:!0}),fR=X.define(),pR=X.define(),mR=X.define(),hR=X.define({combine:e=>e.length?e[0]:!1}),gR=class{constructor(e,t){this.type=e,this.value=t}static define(){return new _R}},_R=class{of(e){return new gR(this,e)}},vR=class{constructor(e){this.map=e}of(e){return new yR(this,e)}},yR=class e{constructor(e,t){this.type=e,this.value=t}map(t){let n=this.type.map(this.value,t);return n===void 0?void 0:n==this.value?this:new e(this.type,n)}is(e){return this.type==e}static define(e={}){return new vR(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let r of e){let e=r.map(t);e&&n.push(e)}return n}};yR.reconfigure=yR.define(),yR.appendConfig=yR.define();var bR=class e{constructor(t,n,r,i,a,o){this.startState=t,this.changes=n,this.selection=r,this.effects=i,this.annotations=a,this.scrollIntoView=o,this._doc=null,this._state=null,r&&WL(r,n.newLength),a.some(t=>t.type==e.time)||(this.annotations=a.concat(e.time.of(Date.now())))}static create(t,n,r,i,a,o){return new e(t,n,r,i,a,o)}get newDoc(){return this._doc||=this.changes.apply(this.startState.doc)}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let n=this.annotation(e.userEvent);return!!(n&&(n==t||n.length>t.length&&n.slice(0,t.length)==t&&n[t.length]==`.`))}};bR.time=gR.define(),bR.userEvent=gR.define(),bR.addToHistory=gR.define(),bR.remote=gR.define();function xR(e,t){let n=[];for(let r=0,i=0;;){let a,o;if(r<e.length&&(i==t.length||t[i]>=e[r]))a=e[r++],o=e[r++];else if(i<t.length)a=t[i++],o=t[i++];else return n;!n.length||n[n.length-1]<a?n.push(a,o):n[n.length-1]<o&&(n[n.length-1]=o)}}function SR(e,t,n){let r,i,a;return n?(r=t.changes,i=IL.empty(t.changes.length),a=e.changes.compose(t.changes)):(r=t.changes.map(e.changes),i=e.changes.mapDesc(t.changes,!0),a=e.changes.compose(r)),{changes:a,selection:t.selection?t.selection.map(i):e.selection?.map(r),effects:yR.mapEffects(e.effects,r).concat(yR.mapEffects(t.effects,i)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function CR(e,t,n){let r=t.selection,i=OR(t.annotations);return t.userEvent&&(i=i.concat(bR.userEvent.of(t.userEvent))),{changes:t.changes instanceof IL?t.changes:IL.of(t.changes||[],n,e.facet(dR)),selection:r&&(r instanceof Y?r:Y.single(r.anchor,r.head)),effects:OR(t.effects),annotations:i,scrollIntoView:!!t.scrollIntoView}}function wR(e,t,n){let r=CR(e,t.length?t[0]:{},e.doc.length);t.length&&t[0].filter===!1&&(n=!1);for(let i=1;i<t.length;i++){t[i].filter===!1&&(n=!1);let a=!!t[i].sequential;r=SR(r,CR(e,t[i],a?r.changes.newLength:e.doc.length),a)}let i=bR.create(e,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return ER(n?TR(i):i)}function TR(e){let t=e.startState,n=!0;for(let r of t.facet(fR)){let t=r(e);if(t===!1){n=!1;break}Array.isArray(t)&&(n=n===!0?t:xR(n,t))}if(n!==!0){let r,i;if(n===!1)i=e.changes.invertedDesc,r=IL.empty(t.doc.length);else{let t=e.changes.filter(n);r=t.changes,i=t.filtered.mapDesc(t.changes).invertedDesc}e=bR.create(t,r,e.selection&&e.selection.map(i),yR.mapEffects(e.effects,i),e.annotations,e.scrollIntoView)}let r=t.facet(pR);for(let n=r.length-1;n>=0;n--){let i=r[n](e);e=i instanceof bR?i:Array.isArray(i)&&i.length==1&&i[0]instanceof bR?i[0]:wR(t,OR(i),!1)}return e}function ER(e){let t=e.startState,n=t.facet(mR),r=e;for(let i=n.length-1;i>=0;i--){let a=n[i](e);a&&Object.keys(a).length&&(r=SR(r,CR(t,a,e.changes.newLength),!0))}return r==e?e:bR.create(t,e.changes,e.selection,r.effects,r.annotations,r.scrollIntoView)}var DR=[];function OR(e){return e==null?DR:Array.isArray(e)?e:[e]}var kR=(function(e){return e[e.Word=0]=`Word`,e[e.Space=1]=`Space`,e[e.Other=2]=`Other`,e})(kR||={}),AR=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,jR;try{jR=RegExp(`[\\p{Alphabetic}\\p{Number}_]`,`u`)}catch{}function MR(e){if(jR)return jR.test(e);for(let t=0;t<e.length;t++){let n=e[t];if(/\w/.test(n)||n>`€`&&(n.toUpperCase()!=n.toLowerCase()||AR.test(n)))return!0}return!1}function NR(e){return t=>{if(!/\S/.test(t))return kR.Space;if(MR(t))return kR.Word;for(let n=0;n<e.length;n++)if(t.indexOf(e[n])>-1)return kR.Word;return kR.Other}}var PR=class e{constructor(e,t,n,r,i,a){this.config=e,this.doc=t,this.selection=n,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=i,a&&(a._state=this);for(let e=0;e<this.config.dynamicSlots.length;e++)sR(this,e<<1);this.computeSlot=null}field(e,t=!0){let n=this.config.address[e.id];if(n==null){if(t)throw RangeError(`Field is not present in this state`);return}return sR(this,n),cR(this,n)}update(...e){return wR(this,e,!0)}applyTransaction(t){let n=this.config,{base:r,compartments:i}=n;for(let e of t.effects)e.is(rR.reconfigure)?(n&&=(i=new Map,n.compartments.forEach((e,t)=>i.set(t,e)),null),i.set(e.value.compartment,e.value.extension)):e.is(yR.reconfigure)?(n=null,r=e.value):e.is(yR.appendConfig)&&(n=null,r=OR(r).concat(e.value));let a;n?a=t.startState.values.slice():(n=aR.resolve(r,i,this),a=new e(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(e,t)=>t.reconfigure(e,this),null).values);let o=t.startState.facet(uR)?t.newSelection:t.newSelection.asSingle();new e(n,t.newDoc,o,a,(e,n)=>n.update(e,t),t)}replaceSelection(e){return typeof e==`string`&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:Y.cursor(t.from+e.length,-1)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),r=this.changes(n.changes),i=[n.range],a=OR(n.effects);for(let n=1;n<t.ranges.length;n++){let o=e(t.ranges[n]),s=this.changes(o.changes),c=s.map(r);for(let e=0;e<n;e++)i[e]=i[e].map(c);let l=r.mapDesc(s,!0);i.push(o.range.map(l)),r=r.compose(c),a=yR.mapEffects(a,c).concat(yR.mapEffects(OR(o.effects),l))}return{changes:r,selection:Y.create(i,t.mainIndex),effects:a}}changes(t=[]){return t instanceof IL?t:IL.of(t,this.doc.length,this.facet(e.lineSeparator))}toText(t){return gL.of(t.split(this.facet(e.lineSeparator)||NL))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(sR(this,t),cR(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let r=e[n];r instanceof QL&&this.config.address[r.id]!=null&&(t[n]=r.spec.toJSON(this.field(e[n]),this))}return t}static fromJSON(t,n={},r){if(!t||typeof t.doc!=`string`)throw RangeError(`Invalid JSON representation for EditorState`);let i=[];if(r){for(let e in r)if(Object.prototype.hasOwnProperty.call(t,e)){let n=r[e],a=t[e];i.push(n.init(e=>n.spec.fromJSON(a,e)))}}return e.create({doc:t.doc,selection:Y.fromJSON(t.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(t={}){let n=aR.resolve(t.extensions||[],new Map),r=t.doc instanceof gL?t.doc:gL.of((t.doc||``).split(n.staticFacet(e.lineSeparator)||NL)),i=t.selection?t.selection instanceof Y?t.selection:Y.single(t.selection.anchor,t.selection.head):Y.single(0);return WL(i,r.length),n.staticFacet(uR)||(i=i.asSingle()),new e(n,r,i,n.dynamicSlots.map(()=>null),(e,t)=>t.create(e),null)}get tabSize(){return this.facet(e.tabSize)}get lineBreak(){return this.facet(e.lineSeparator)||`
19
- `}get readOnly(){return this.facet(hR)}phrase(t,...n){for(let n of this.facet(e.phrases))if(Object.prototype.hasOwnProperty.call(n,t)){t=n[t];break}return n.length&&(t=t.replace(/\$(\$|\d*)/g,(e,t)=>{if(t==`$`)return`$`;let r=+(t||1);return!r||r>n.length?e:n[r-1]})),t}languageDataAt(e,t,n=-1){let r=[];for(let i of this.facet(lR))for(let a of i(this,t,n))Object.prototype.hasOwnProperty.call(a,e)&&r.push(a[e]);return r}charCategorizer(e){let t=this.languageDataAt(`wordChars`,e);return NR(t.length?t[0]:``)}wordAt(e){let{text:t,from:n,length:r}=this.doc.lineAt(e),i=this.charCategorizer(e),a=e-n,o=e-n;for(;a>0;){let e=DL(t,a,!1);if(i(t.slice(e,a))!=kR.Word)break;a=e}for(;o<r;){let e=DL(t,o);if(i(t.slice(o,e))!=kR.Word)break;o=e}return a==o?null:Y.range(a+n,o+n)}};PR.allowMultipleSelections=uR,PR.tabSize=X.define({combine:e=>e.length?e[0]:4}),PR.lineSeparator=dR,PR.readOnly=hR,PR.phrases=X.define({compare(e,t){let n=Object.keys(e),r=Object.keys(t);return n.length==r.length&&n.every(n=>e[n]==t[n])}}),PR.languageData=lR,PR.changeFilter=fR,PR.transactionFilter=pR,PR.transactionExtender=mR,rR.reconfigure=yR.define();function FR(e,t,n={}){let r={};for(let t of e)for(let e of Object.keys(t)){let i=t[e],a=r[e];if(a===void 0)r[e]=i;else if(a!==i&&i!==void 0){if(Object.hasOwnProperty.call(n,e))r[e]=n[e](a,i);else throw Error(`Config merge conflict for field `+e)}}for(let e in t)r[e]===void 0&&(r[e]=t[e]);return r}var IR=class{eq(e){return this==e}range(e,t=e){return RR.create(e,t,this)}};IR.prototype.startSide=IR.prototype.endSide=0,IR.prototype.point=!1,IR.prototype.mapMode=PL.TrackDel;function LR(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}var RR=class e{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(t,n,r){return new e(t,n,r)}};function zR(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}var BR=class e{constructor(e,t,n,r){this.from=e,this.to=t,this.value=n,this.maxPoint=r}get length(){return HR(this.to)}findIndex(e,t,n,r=0){let i=n?this.to:this.from;for(let a=r,o=i.length;;){if(a==o)return a;let r=a+o>>1,s=i[r]-e||(n?this.value[r].endSide:this.value[r].startSide)-t;if(r==a)return s>=0?a:o;s>=0?o=r:a=r+1}}between(e,t,n,r){for(let i=this.findIndex(t,-1e9,!0),a=this.findIndex(n,1e9,!1,i);i<a;i++)if(r(this.from[i]+e,this.to[i]+e,this.value[i])===!1)return!1}map(t,n,r,i,a){let o=[],s=[],c=[],l=-1,u=-1;iter:for(let e=0;e<this.value.length;e++){let d=this.value[e],f=this.from[e]+t,p=this.to[e]+t,m,h;if(f==p){let e=n.mapPos(f,d.startSide,d.mapMode);if(e==null||(m=h=e,d.startSide!=d.endSide&&(h=n.mapPos(f,d.endSide),h<m)))continue}else if(m=n.mapPos(f,d.startSide),h=n.mapPos(p,d.endSide),m>h||m==h&&d.startSide>0&&d.endSide<=0)continue;if(!((h-m||d.endSide-d.startSide)<0)){if(l<0&&(l=m),d.point&&(u=Math.max(u,h-m)),(m-r||d.startSide-i)>=0)o.push(d),s.push(m-l),c.push(h-l),r=h,i=d.endSide;else{if(m==h)for(let e=o.length;e>0;e--){if((m-(c[e-1]+l)||d.startSide-o[e-1].endSide)>=0){o.splice(e,0,d),s.splice(e,0,m-l),c.splice(e,0,h-l);continue iter}if((m-(s[e-1]+l)||d.endSide-o[e-1].startSide)>0)break}a(m,h,d)}}}return{mapped:o.length?new e(s,c,o,u):null,pos:l}}},VR=class e{constructor(e,t,n,r){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=r}static create(t,n,r,i){return new e(t,n,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(t){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:a=this.length}=t,o=t.filter;if(n.length==0&&!o)return this;if(r&&(n=n.slice().sort(zR)),this.isEmpty)return n.length?e.of(n):this;let s=new KR(this,null,-1).goto(0),c=0,l=[],u=new WR;for(;s.value||c<n.length;)if(c<n.length&&(s.from-n[c].from||s.startSide-n[c].value.startSide)>=0){let e=n[c++];u.addInner(e.from,e.to,e.value,!1)||l.push(e)}else s.rangeIndex==1&&s.chunkIndex<this.chunk.length&&(c==n.length||this.chunkEnd(s.chunkIndex)<n[c].from)&&(!o||i>this.chunkEnd(s.chunkIndex)||a<this.chunkPos[s.chunkIndex])&&u.addChunk(this.chunkPos[s.chunkIndex],this.chunk[s.chunkIndex])?s.nextChunk():((!o||i>s.to||a<s.from||o(s.from,s.to,s.value))&&(u.addInner(s.from,s.to,s.value,!1)||l.push(RR.create(s.from,s.to,s.value))),s.next());return u.finishInner(this.nextLayer.isEmpty&&!l.length?e.empty:this.nextLayer.update({add:l,filter:o,filterFrom:i,filterTo:a}))}map(t){if(t.empty||this.isEmpty)return this;let n=[],r=[],i=-1,a,o=(e,t,n)=>{a||=new WR,a.addRange(e,t,n,!1)};for(let e=0;e<this.chunk.length;e++){let a=this.chunkPos[e],s=this.chunk[e],c=t.touchesRange(a,a+s.length);if(c===!1)i=Math.max(i,s.maxPoint),n.push(s),r.push(t.mapPos(a));else if(c===!0){let[e,c]=n.length?[HR(r)+HR(n).length,HR(HR(n).value).endSide]:[-1,-1],{mapped:l,pos:u}=s.map(a,t,e,c,o);l&&(i=Math.max(i,l.maxPoint),n.push(l),r.push(u))}}let s=this.nextLayer.map(t);return a&&(s=a.finishInner(s)),n.length==0?s:new e(r,n,s||e.empty,i)}between(e,t,n){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let i=this.chunkPos[r],a=this.chunk[r];if(t>=i&&e<=i+a.length&&a.between(i,e-i,t-i,n)===!1)return}this.nextLayer.between(e,t,n)}}iter(e=0){return qR.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return qR.from(e).goto(t)}static compare(e,t,n,r,i=-1){let a=e.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),o=t.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),s=GR(a,o,n),c=new YR(a,s,i),l=new YR(o,s,i);n.iterGaps((e,t,n)=>XR(c,e,l,t,n,r)),n.empty&&n.length==0&&XR(c,0,l,0,0,r)}static eq(e,t,n=0,r){r??=1e9-1;let i=e.filter(e=>!e.isEmpty&&t.indexOf(e)<0),a=t.filter(t=>!t.isEmpty&&e.indexOf(t)<0);if(i.length!=a.length)return!1;if(!i.length)return!0;let o=GR(i,a),s=new YR(i,o,0).goto(n),c=new YR(a,o,0).goto(n);for(;;){if(s.to!=c.to||!ZR(s.active,c.active)||s.point&&(!c.point||!LR(s.point,c.point)))return!1;if(s.to>r)return!0;s.next(),c.next()}}static spans(e,t,n,r,i=-1){let a=new YR(e,null,i).goto(t),o=t,s=a.openStart;for(;;){let e=Math.min(a.to,n);if(a.point){let n=a.activeForPoint(a.to),i=a.pointFrom<t?n.length+1:a.point.startSide<0?n.length:Math.min(n.length,s);r.point(o,e,a.point,n,i,a.pointRank),s=Math.min(a.openEnd(e),n.length)}else e>o&&(r.span(o,e,a.active,s),s=a.openEnd(e));if(a.to>n)return s+(a.point&&a.to>n?1:0);o=a.to,a.next()}}static of(e,t=!1){let n=new WR;for(let r of e instanceof RR?[e]:t?UR(e):e)n.add(r.from,r.to,r.value);return n.finish()}static join(t){if(!t.length)return e.empty;let n=HR(t);for(let r=t.length-2;r>=0;r--)for(let i=t[r];i!=e.empty;i=i.nextLayer)n=new e(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}};VR.empty=new VR([],[],null,-1);function HR(e){return e[e.length-1]}function UR(e){if(e.length>1)for(let t=e[0],n=1;n<e.length;n++){let r=e[n];if(zR(t,r)>0)return e.slice().sort(zR);t=r}return e}VR.empty.nextLayer=VR.empty;var WR=class e{finishChunk(e){this.chunks.push(new BR(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,n){this.addRange(e,t,n,!0)}addRange(t,n,r,i){this.addInner(t,n,r,i)||(this.nextLayer||=new e).addRange(t,n,r,i)}addInner(e,t,n,r){let i=e-this.lastTo||n.startSide-this.last.endSide;if(r&&i<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(VR.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=VR.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}};function GR(e,t,n){let r=new Map;for(let t of e)for(let e=0;e<t.chunk.length;e++)t.chunk[e].maxPoint<=0&&r.set(t.chunk[e],t.chunkPos[e]);let i=new Set;for(let e of t)for(let t=0;t<e.chunk.length;t++){let a=r.get(e.chunk[t]);a!=null&&(n?n.mapPos(a):a)==e.chunkPos[t]&&!n?.touchesRange(a,a+e.chunk[t].length)&&i.add(e.chunk[t])}return i}var KR=class{constructor(e,t,n,r=0){this.layer=e,this.skip=t,this.minPoint=n,this.rank=r}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,n){for(;this.chunkIndex<this.layer.chunk.length;){let t=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(t)||this.layer.chunkEnd(this.chunkIndex)<e||t.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let r=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!n||this.rangeIndex<r)&&this.setRangeIndex(r)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],n=e+t.from[this.rangeIndex];if(this.from=n,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}},qR=class e{constructor(e){this.heap=e}static from(t,n=null,r=-1){let i=[];for(let e=0;e<t.length;e++)for(let a=t[e];!a.isEmpty;a=a.nextLayer)a.maxPoint>=r&&i.push(new KR(a,n,r,e));return i.length==1?i[0]:new e(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let e=this.heap.length>>1;e>=0;e--)JR(this.heap,e);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let e=this.heap.length>>1;e>=0;e--)JR(this.heap,e);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),JR(this.heap,0)}}};function JR(e,t){for(let n=e[t];;){let r=(t<<1)+1;if(r>=e.length)break;let i=e[r];if(r+1<e.length&&i.compare(e[r+1])>=0&&(i=e[r+1],r++),n.compare(i)<0)break;e[r]=n,e[t]=i,t=r}}var YR=class{constructor(e,t,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=qR.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){QR(this.active,e),QR(this.activeTo,e),QR(this.activeRank,e),this.minActive=ez(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:r,rank:i}=this.cursor;for(;t<this.activeRank.length&&(i-this.activeRank[t]||r-this.activeTo[t])>0;)t++;$R(this.active,t,n),$R(this.activeTo,t,r),$R(this.activeRank,t,i),e&&$R(e,t,this.cursor.from),this.minActive=ez(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),n&&QR(n,r)}else if(!this.cursor.value){this.to=this.endSide=1e9;break}else if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let e=this.cursor.value;if(!e.point)this.addActive(n),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=e,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=e.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}}if(n){this.openStart=0;for(let t=n.length-1;t>=0&&n[t]<e;t--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}};function XR(e,t,n,r,i,a){e.goto(t),n.goto(r);let o=r+i,s=r,c=r-t,l=!!a.boundChange;for(let t=!1;;){let r=e.to+c-n.to,i=r||e.endSide-n.endSide,u=i<0?e.to+c:n.to,d=Math.min(u,o);if(e.point||n.point?(e.point&&n.point&&LR(e.point,n.point)&&ZR(e.activeForPoint(e.to),n.activeForPoint(n.to))||a.comparePoint(s,d,e.point,n.point),t=!1):(t&&=(a.boundChange(s),!1),d>s&&!ZR(e.active,n.active)&&a.compareRange(s,d,e.active,n.active),l&&d<o&&(r||e.openEnd(u)!=n.openEnd(u))&&(t=!0)),u>o)break;s=u,i<=0&&e.next(),i>=0&&n.next()}}function ZR(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n]&&!LR(e[n],t[n]))return!1;return!0}function QR(e,t){for(let n=t,r=e.length-1;n<r;n++)e[n]=e[n+1];e.pop()}function $R(e,t,n){for(let n=e.length-1;n>=t;n--)e[n+1]=e[n];e[t]=n}function ez(e,t){let n=-1,r=1e9;for(let i=0;i<t.length;i++)(t[i]-r||e[i].endSide-e[n].endSide)<0&&(n=i,r=t[i]);return n}function tz(e,t,n=e.length){let r=0;for(let i=0;i<n&&i<e.length;)e.charCodeAt(i)==9?(r+=t-r%t,i++):(r++,i=DL(e,i));return r}function nz(e,t,n,r){for(let r=0,i=0;;){if(i>=t)return r;if(r==e.length)break;i+=e.charCodeAt(r)==9?n-i%n:1,r=DL(e,r)}return r===!0?-1:e.length}for(var rz=`ͼ`,iz=typeof Symbol>`u`?`__ͼ`:Symbol.for(rz),az=typeof Symbol>`u`?`__styleSet`+Math.floor(Math.random()*1e8):Symbol(`styleSet`),oz=typeof globalThis<`u`?globalThis:typeof window<`u`?window:{},sz=class{constructor(e,t){this.rules=[];let{finish:n}=t||{};function r(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}function i(e,t,a,o){let s=[],c=/^@(\w+)\b/.exec(e[0]),l=c&&c[1]==`keyframes`;if(c&&t==null)return a.push(e[0]+`;`);for(let n in t){let o=t[n];if(/&/.test(n))i(n.split(/,\s*/).map(t=>e.map(e=>t.replace(/&/,e))).reduce((e,t)=>e.concat(t)),o,a);else if(o&&typeof o==`object`){if(!c)throw RangeError(`The value of a property (`+n+`) should be a primitive value.`);i(r(n),o,s,l)}else o!=null&&s.push(n.replace(/_.*/,``).replace(/[A-Z]/g,e=>`-`+e.toLowerCase())+`: `+o+`;`)}(s.length||l)&&a.push((n&&!c&&!o?e.map(n):e).join(`, `)+` {`+s.join(` `)+`}`)}for(let t in e)i(r(t),e[t],this.rules)}getRules(){return this.rules.join(`
20
- `)}static newName(){let e=oz[iz]||1;return oz[iz]=e+1,rz+e.toString(36)}static mount(e,t,n){let r=e[az],i=n&&n.nonce;r?i&&r.setNonce(i):r=new lz(e,i),r.mount(Array.isArray(t)?t:[t],e)}},cz=new Map,lz=class{constructor(e,t){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let t=cz.get(n);if(t)return e[az]=t;this.sheet=new r.CSSStyleSheet,cz.set(n,this)}else this.styleTag=n.createElement(`style`),t&&this.styleTag.setAttribute(`nonce`,t);this.modules=[],e[az]=this}mount(e,t){let n=this.sheet,r=0,i=0,a=!1;for(let t=0;t<e.length;t++){let o=e[t],s=this.modules.indexOf(o);if(s<i&&s>-1&&(this.modules.splice(s,1),a=!0,i--,s=-1),s==-1){if(this.modules.splice(i++,0,o),a=!0,n)for(let e=0;e<o.rules.length;e++)n.insertRule(o.rules[e],r++)}else{for(;i<s;)r+=this.modules[i++].rules.length;r+=o.rules.length,i++}}if(n)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{if(a){let e=``;for(let t=0;t<this.modules.length;t++)e+=this.modules[t].getRules()+`
21
- `;this.styleTag.textContent=e}let e=t.head||t;this.styleTag.parentNode!=e&&e.insertBefore(this.styleTag,e.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute(`nonce`)!=e&&this.styleTag.setAttribute(`nonce`,e)}},uz={8:`Backspace`,9:`Tab`,10:`Enter`,12:`NumLock`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,44:`PrintScreen`,45:`Insert`,46:`Delete`,59:`;`,61:`=`,91:`Meta`,92:`Meta`,106:`*`,107:`+`,108:`,`,109:`-`,110:`.`,111:`/`,144:`NumLock`,145:`ScrollLock`,160:`Shift`,161:`Shift`,162:`Control`,163:`Control`,164:`Alt`,165:`Alt`,173:`-`,186:`;`,187:`=`,188:`,`,189:`-`,190:`.`,191:`/`,192:"`",219:`[`,220:`\\`,221:`]`,222:`'`},dz={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},fz=typeof navigator<`u`&&/Mac/.test(navigator.platform),pz=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),mz=0;mz<10;mz++)uz[48+mz]=uz[96+mz]=String(mz);for(var mz=1;mz<=24;mz++)uz[mz+111]=`F`+mz;for(var mz=65;mz<=90;mz++)uz[mz]=String.fromCharCode(mz+32),dz[mz]=String.fromCharCode(mz);for(var hz in uz)dz.hasOwnProperty(hz)||(dz[hz]=uz[hz]);function gz(e){var t=!(fz&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||pz&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?dz:uz)[e.keyCode]||e.key||`Unidentified`;return t==`Esc`&&(t=`Escape`),t==`Del`&&(t=`Delete`),t==`Left`&&(t=`ArrowLeft`),t==`Up`&&(t=`ArrowUp`),t==`Right`&&(t=`ArrowRight`),t==`Down`&&(t=`ArrowDown`),t}function _z(){var e=arguments[0];typeof e==`string`&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&typeof n==`object`&&n.nodeType==null&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];typeof i==`string`?e.setAttribute(r,i):i!=null&&(e[r]=i)}t++}for(;t<arguments.length;t++)vz(e,arguments[t]);return e}function vz(e,t){if(typeof t==`string`)e.appendChild(document.createTextNode(t));else if(t!=null){if(t.nodeType!=null)e.appendChild(t);else if(Array.isArray(t))for(var n=0;n<t.length;n++)vz(e,t[n]);else throw RangeError(`Unsupported child node: `+t)}}var yz=typeof navigator<`u`?navigator:{userAgent:``,vendor:``,platform:``},bz=typeof document<`u`?document:{documentElement:{style:{}}},xz=/Edge\/(\d+)/.exec(yz.userAgent),Sz=/MSIE \d/.test(yz.userAgent),Cz=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(yz.userAgent),wz=!!(Sz||Cz||xz),Tz=!wz&&/gecko\/(\d+)/i.test(yz.userAgent),Ez=!wz&&/Chrome\/(\d+)/.exec(yz.userAgent),Dz=`webkitFontSmoothing`in bz.documentElement.style,Oz=!wz&&/Apple Computer/.test(yz.vendor),kz=Oz&&(/Mobile\/\w+/.test(yz.userAgent)||yz.maxTouchPoints>2),Z={mac:kz||/Mac/.test(yz.platform),windows:/Win/.test(yz.platform),linux:/Linux|X11/.test(yz.platform),ie:wz,ie_version:Sz?bz.documentMode||6:Cz?+Cz[1]:xz?+xz[1]:0,gecko:Tz,gecko_version:Tz?+(/Firefox\/(\d+)/.exec(yz.userAgent)||[0,0])[1]:0,chrome:!!Ez,chrome_version:Ez?+Ez[1]:0,ios:kz,android:/Android\b/.test(yz.userAgent),webkit:Dz,webkit_version:Dz?+(/\bAppleWebKit\/(\d+)/.exec(yz.userAgent)||[0,0])[1]:0,safari:Oz,safari_version:Oz?+(/\bVersion\/(\d+(\.\d+)?)/.exec(yz.userAgent)||[0,0])[1]:0,tabSize:bz.documentElement.style.tabSize==null?`-moz-tab-size`:`tab-size`};function Az(e,t){for(let n in e)n==`class`&&t.class?t.class+=` `+e.class:n==`style`&&t.style?t.style+=`;`+e.style:t[n]=e[n];return t}var jz=Object.create(null);function Mz(e,t,n){if(e==t)return!0;e||=jz,t||=jz;let r=Object.keys(e),i=Object.keys(t);if(r.length-(n&&r.indexOf(n)>-1?1:0)!=i.length-(n&&i.indexOf(n)>-1?1:0))return!1;for(let a of r)if(a!=n&&(i.indexOf(a)==-1||e[a]!==t[a]))return!1;return!0}function Nz(e,t){for(let n=e.attributes.length-1;n>=0;n--){let r=e.attributes[n].name;t[r]??e.removeAttribute(r)}for(let n in t){let r=t[n];n==`style`?e.style.cssText=r:e.getAttribute(n)!=r&&e.setAttribute(n,r)}}function Pz(e,t,n){let r=!1;if(t)for(let i in t)n&&i in n||(r=!0,i==`style`?e.style.cssText=``:e.removeAttribute(i));if(n)for(let i in n)t&&t[i]==n[i]||(r=!0,i==`style`?e.style.cssText=n[i]:e.setAttribute(i,n[i]));return r}function Fz(e){let t=Object.create(null);for(let n=0;n<e.attributes.length;n++){let r=e.attributes[n];t[r.name]=r.value}return t}var Iz=class{eq(e){return!1}updateDOM(e,t,n){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}},Lz=(function(e){return e[e.Text=0]=`Text`,e[e.WidgetBefore=1]=`WidgetBefore`,e[e.WidgetAfter=2]=`WidgetAfter`,e[e.WidgetRange=3]=`WidgetRange`,e})(Lz||={}),Q=class extends IR{constructor(e,t,n,r){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=r}get heightRelevant(){return!1}static mark(e){return new Rz(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return t+=n&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new Bz(e,t,t,n,e.widget||null,!1)}static replace(e){let t=!!e.block,n,r;if(e.isBlockGap)n=-5e8,r=4e8;else{let{start:i,end:a}=Vz(e,t);n=(i?t?-3e8:-1:5e8)-1,r=(a?t?2e8:1:-6e8)+1}return new Bz(e,n,r,t,e.widget||null,!0)}static line(e){return new zz(e)}static set(e,t=!1){return VR.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}};Q.none=VR.empty;var Rz=class e extends Q{constructor(e){let{start:t,end:n}=Vz(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||`span`,this.attrs=e.class&&e.attributes?Az(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||jz}eq(t){return this==t||t instanceof e&&this.tagName==t.tagName&&Mz(this.attrs,t.attrs)}range(e,t=e){if(e>=t)throw RangeError(`Mark decorations may not be empty`);return super.range(e,t)}};Rz.prototype.point=!1;var zz=class e extends Q{constructor(e){super(-2e8,-2e8,null,e)}eq(t){return t instanceof e&&this.spec.class==t.spec.class&&Mz(this.spec.attributes,t.spec.attributes)}range(e,t=e){if(t!=e)throw RangeError(`Line decoration ranges must be zero-length`);return super.range(e,t)}};zz.prototype.mapMode=PL.TrackBefore,zz.prototype.point=!0;var Bz=class e extends Q{constructor(e,t,n,r,i,a){super(t,n,i,e),this.block=r,this.isReplace=a,this.mapMode=r?t<=0?PL.TrackBefore:PL.TrackAfter:PL.TrackDel}get type(){return this.startSide==this.endSide?this.startSide<=0?Lz.WidgetBefore:Lz.WidgetAfter:Lz.WidgetRange}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof e&&Hz(this.widget,t.widget)&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw RangeError(`Invalid range for replacement decoration`);if(!this.isReplace&&t!=e)throw RangeError(`Widget decorations can only have zero-length ranges`);return super.range(e,t)}};Bz.prototype.point=!0;function Vz(e,t=!1){let{inclusiveStart:n,inclusiveEnd:r}=e;return n??=e.inclusive,r??=e.inclusive,{start:n??t,end:r??t}}function Hz(e,t){return e==t||!!(e&&t&&e.compare(t))}function Uz(e,t,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=e?n[i]=Math.max(n[i],t):n.push(e,t)}var Wz=class e extends IR{constructor(e,t,n){super(),this.tagName=e,this.attributes=t,this.rank=n}eq(t){return t==this||t instanceof e&&this.tagName==t.tagName&&Mz(this.attributes,t.attributes)}static create(t){return new e(t.tagName,t.attributes||jz,t.rank==null?50:Math.max(0,Math.min(t.rank,100)))}static set(e,t=!1){return VR.of(e,t)}};Wz.prototype.startSide=Wz.prototype.endSide=-1;function Gz(e){let t;return t=e.nodeType==11?e.getSelection?e:e.ownerDocument:e,t.getSelection()}function Kz(e,t){return t?e==t||e.contains(t.nodeType==1?t:t.parentNode):!1}function qz(e,t){if(!t.anchorNode)return!1;try{return Kz(e,t.anchorNode)}catch{return!1}}function Jz(e){return e.nodeType==3?dB(e,0,e.nodeValue.length).getClientRects():e.nodeType==1?e.getClientRects():[]}function Yz(e,t,n,r){return n?Qz(e,t,n,r,-1)||Qz(e,t,n,r,1):!1}function Xz(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t}function Zz(e){return e.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function Qz(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:$z(e))){if(e.nodeName==`DIV`)return!1;let n=e.parentNode;if(!n||n.nodeType!=1)return!1;t=Xz(e)+(i<0?0:1),e=n}else if(e.nodeType==1){if(e=e.childNodes[t+(i<0?-1:0)],e.nodeType==1&&e.contentEditable==`false`)return!1;t=i<0?$z(e):0}else return!1}}function $z(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function eB(e,t){let{left:n,right:r}=e;if(n==r)return e;let i=t?n:r;return{left:i,right:i,top:e.top,bottom:e.bottom}}function tB(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function nB(e,t){let n=t.width/e.offsetWidth,r=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(t.height-e.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function rB(e,t,n,r,i,a,o,s){let c=e.ownerDocument,l=c.defaultView||window;for(let u=e,d=!1;u&&!d;)if(u.nodeType==1){let e,f=u==c.body,p=1,m=1;if(f)e=tB(l);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(d=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let t=u.getBoundingClientRect();({scaleX:p,scaleY:m}=nB(u,t)),e={left:t.left,right:t.left+u.clientWidth*p,top:t.top,bottom:t.top+u.clientHeight*m}}let h=0,g=0;if(i==`nearest`)t.top<e.top+o?(g=t.top-(e.top+o),n>0&&t.bottom>e.bottom+g&&(g=t.bottom-e.bottom+o)):t.bottom>e.bottom-o&&(g=t.bottom-e.bottom+o,n<0&&t.top-g<e.top&&(g=t.top-(e.top+o)));else{let r=t.bottom-t.top,a=e.bottom-e.top;g=(i==`center`&&r<=a?t.top+r/2-a/2:i==`start`||i==`center`&&n<0?t.top-o:t.bottom-a+o)-e.top}if(r==`nearest`?t.left<e.left+a?(h=t.left-(e.left+a),n>0&&t.right>e.right+h&&(h=t.right-e.right+a)):t.right>e.right-a&&(h=t.right-e.right+a,n<0&&t.left<e.left+h&&(h=t.left-(e.left+a))):h=(r==`center`?t.left+(t.right-t.left)/2-(e.right-e.left)/2:r==`start`==s?t.left-a:t.right-(e.right-e.left)+a)-e.left,h||g){if(f)l.scrollBy(h,g);else{let e=0,n=0;if(g){let e=u.scrollTop;u.scrollTop+=g/m,n=(u.scrollTop-e)*m}if(h){let t=u.scrollLeft;u.scrollLeft+=h/p,e=(u.scrollLeft-t)*p}t={left:t.left-e,top:t.top-n,right:t.right-e,bottom:t.bottom-n},e&&Math.abs(e-h)<1&&(r=`nearest`),n&&Math.abs(n-g)<1&&(i=`nearest`)}}if(f)break;(t.top<e.top||t.bottom>e.bottom||t.left<e.left||t.right>e.right)&&(t={left:Math.max(t.left,e.left),right:Math.min(t.right,e.right),top:Math.max(t.top,e.top),bottom:Math.min(t.bottom,e.bottom)}),u=u.assignedSlot||u.parentNode}else if(u.nodeType==11)u=u.host;else break}function iB(e,t=!0){let n=e.ownerDocument,r=null,i=null;for(let a=e.parentNode;a&&!(a==n.body||(!t||r)&&i);)if(a.nodeType==1)!i&&a.scrollHeight>a.clientHeight&&(i=a),t&&!r&&a.scrollWidth>a.clientWidth&&(r=a),a=a.assignedSlot||a.parentNode;else if(a.nodeType==11)a=a.host;else break;return{x:r,y:i}}var aB=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:n}=e;this.set(t,Math.min(e.anchorOffset,t?$z(t):0),n,Math.min(e.focusOffset,n?$z(n):0))}set(e,t,n,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=r}};function oB(e){let t=[];for(let n=e;n;n=n.nodeType==11?n.host:n.parentNode)n.nodeType==1&&t.push({node:n,left:n.scrollLeft,top:n.scrollTop});return t}function sB(e,t=!0){for(let{node:n,left:r,top:i}of e)t&&n.scrollTop!=i&&(n.scrollTop=i),n.scrollLeft!=r&&(n.scrollLeft=r)}var cB=null;Z.safari&&Z.safari_version>=26&&(cB=!1);function lB(e){if(e.setActive)return e.setActive();if(cB)return e.focus(cB);let t=oB(e);e.focus(cB==null?{get preventScroll(){return cB={preventScroll:!0},!0}}:void 0),cB||(cB=!1,sB(t))}var uB;function dB(e,t,n=t){let r=uB||=document.createRange();return r.setEnd(e,n),r.setStart(e,t),r}function fB(e,t,n,r){let i={key:t,code:t,keyCode:n,which:n,cancelable:!0};r&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=r);let a=new KeyboardEvent(`keydown`,i);a.synthetic=!0,e.dispatchEvent(a);let o=new KeyboardEvent(`keyup`,i);return o.synthetic=!0,e.dispatchEvent(o),a.defaultPrevented||o.defaultPrevented}function pB(e){for(;e;){if(e&&(e.nodeType==9||e.nodeType==11&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}function mB(e,t){let n=t.focusNode,r=t.focusOffset;if(!n||t.anchorNode!=n||t.anchorOffset!=r)return!1;for(r=Math.min(r,$z(n));;)if(r){if(n.nodeType!=1)return!1;let e=n.childNodes[r-1];e.contentEditable==`false`?r--:(n=e,r=$z(n))}else if(n==e)return!0;else r=Xz(n),n=n.parentNode}function hB(e){return e instanceof Window?e.pageYOffset>Math.max(0,e.document.documentElement.scrollHeight-e.innerHeight-4):e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function gB(e,t){for(let n=e,r=t;;)if(n.nodeType==3&&r>0)return{node:n,offset:r};else if(n.nodeType==1&&r>0){if(n.contentEditable==`false`)return null;n=n.childNodes[r-1],r=$z(n)}else if(n.parentNode&&!Zz(n))r=Xz(n),n=n.parentNode;else return null}function _B(e,t){for(let n=e,r=t;;)if(n.nodeType==3&&r<n.nodeValue.length)return{node:n,offset:r};else if(n.nodeType==1&&r<n.childNodes.length){if(n.contentEditable==`false`)return null;n=n.childNodes[r],r=0}else if(n.parentNode&&!Zz(n))r=Xz(n)+1,n=n.parentNode;else return null}var vB=class e{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(t,n){return new e(t.parentNode,Xz(t),n)}static after(t,n){return new e(t.parentNode,Xz(t)+1,n)}},yB=(function(e){return e[e.LTR=0]=`LTR`,e[e.RTL=1]=`RTL`,e})(yB||={}),bB=yB.LTR,xB=yB.RTL;function SB(e){let t=[];for(let n=0;n<e.length;n++)t.push(1<<e[n]);return t}var CB=SB(`88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008`),wB=SB(`4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333`),TB=Object.create(null),EB=[];for(let e of[`()`,`[]`,`{}`]){let t=e.charCodeAt(0),n=e.charCodeAt(1);TB[t]=n,TB[n]=-t}function DB(e){return e<=247?CB[e]:1424<=e&&e<=1524?2:1536<=e&&e<=1785?wB[e-1536]:1774<=e&&e<=2220?4:8192<=e&&e<=8204?256:64336<=e&&e<=65023?4:1}var OB=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/,kB=class{get dir(){return this.level%2?xB:bB}constructor(e,t,n){this.from=e,this.to=t,this.level=n}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,n,r){let i=-1;for(let a=0;a<e.length;a++){let o=e[a];if(o.from<=t&&o.to>=t){if(o.level==n)return a;(i<0||(r==0?e[i].level>o.level:r<0?o.from<t:o.to>t))&&(i=a)}}if(i<0)throw RangeError(`Index out of range`);return i}};function AB(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.from!=i.from||r.to!=i.to||r.direction!=i.direction||!AB(r.inner,i.inner))return!1}return!0}var jB=[];function MB(e,t,n,r,i){for(let a=0;a<=r.length;a++){let o=a?r[a-1].to:t,s=a<r.length?r[a].from:n,c=a?256:i;for(let t=o,n=c,r=c;t<s;t++){let i=DB(e.charCodeAt(t));i==512?i=n:i==8&&r==4&&(i=16),jB[t]=i==4?2:i,i&7&&(r=i),n=i}for(let e=o,t=c,r=c;e<s;e++){let i=jB[e];if(i==128)e<s-1&&t==jB[e+1]&&t&24?i=jB[e]=t:jB[e]=256;else if(i==64){let i=e+1;for(;i<s&&jB[i]==64;)i++;let a=e&&t==8||i<n&&jB[i]==8?r==1?1:8:256;for(let t=e;t<i;t++)jB[t]=a;e=i-1}else i==8&&r==1&&(jB[e]=1);t=i,i&7&&(r=i)}}}function NB(e,t,n,r,i){let a=i==1?2:1;for(let o=0,s=0,c=0;o<=r.length;o++){let l=o?r[o-1].to:t,u=o<r.length?r[o].from:n;for(let t=l,n,r,o;t<u;t++)if(r=TB[n=e.charCodeAt(t)]){if(r<0){for(let e=s-3;e>=0;e-=3)if(EB[e+1]==-r){let n=EB[e+2],r=n&2?i:n&4?n&1?a:i:0;r&&(jB[t]=jB[EB[e]]=r),s=e;break}}else if(EB.length==189)break;else EB[s++]=t,EB[s++]=n,EB[s++]=c}else if((o=jB[t])==2||o==1){let e=o==i;c=+!e;for(let t=s-3;t>=0;t-=3){let n=EB[t+2];if(n&2)break;if(e)EB[t+2]|=2;else{if(n&4)break;EB[t+2]|=4}}}}}function PB(e,t,n,r){for(let i=0,a=r;i<=n.length;i++){let o=i?n[i-1].to:e,s=i<n.length?n[i].from:t;for(let c=o;c<s;){let o=jB[c];if(o==256){let o=c+1;for(;;)if(o==s){if(i==n.length)break;o=n[i++].to,s=i<n.length?n[i].from:t}else if(jB[o]==256)o++;else break;let l=a==1,u=l==((o<t?jB[o]:r)==1)?l?1:2:r;for(let t=o,r=i,a=r?n[r-1].to:e;t>c;)t==a&&(t=n[--r].from,a=r?n[r-1].to:e),jB[--t]=u;c=o}else a=o,c++}}}function FB(e,t,n,r,i,a,o){let s=r%2?2:1;if(r%2==i%2)for(let c=t,l=0;c<n;){let t=!0,u=!1;if(l==a.length||c<a[l].from){let e=jB[c];e!=s&&(t=!1,u=e==16)}let d=!t&&s==1?[]:null,f=t?r:r+1,p=c;run:for(;;)if(l<a.length&&p==a[l].from){if(u)break run;let m=a[l];if(!t)for(let e=m.to,t=l+1;;){if(e==n)break run;if(t<a.length&&a[t].from==e)e=a[t++].to;else if(jB[e]==s)break run;else break}l++,d?d.push(m):(m.from>c&&o.push(new kB(c,m.from,f)),IB(e,m.direction==bB==!(f%2)?r:r+1,i,m.inner,m.from,m.to,o),c=m.to),p=m.to}else if(p==n||(t?jB[p]!=s:jB[p]==s))break;else p++;d?FB(e,c,p,r+1,i,d,o):c<p&&o.push(new kB(c,p,f)),c=p}else for(let c=n,l=a.length;c>t;){let n=!0,u=!1;if(!l||c>a[l-1].to){let e=jB[c-1];e!=s&&(n=!1,u=e==16)}let d=!n&&s==1?[]:null,f=n?r:r+1,p=c;run:for(;;)if(l&&p==a[l-1].to){if(u)break run;let m=a[--l];if(!n)for(let e=m.from,n=l;;){if(e==t)break run;if(n&&a[n-1].to==e)e=a[--n].from;else if(jB[e-1]==s)break run;else break}d?d.push(m):(m.to<c&&o.push(new kB(m.to,c,f)),IB(e,m.direction==bB==!(f%2)?r:r+1,i,m.inner,m.from,m.to,o),c=m.from),p=m.from}else if(p==t||(n?jB[p-1]!=s:jB[p-1]==s))break;else p--;d?FB(e,p,c,r+1,i,d,o):p<c&&o.push(new kB(p,c,f)),c=p}}function IB(e,t,n,r,i,a,o){let s=t%2?2:1;MB(e,i,a,r,s),NB(e,i,a,r,s),PB(i,a,r,s),FB(e,i,a,t,n,r,o)}function LB(e,t,n){if(!e)return[new kB(0,0,+(t==xB))];if(t==bB&&!n.length&&!OB.test(e))return RB(e.length);if(n.length)for(;e.length>jB.length;)jB[jB.length]=256;let r=[],i=t==bB?0:1;return IB(e,i,i,n,0,e.length,r),r}function RB(e){return[new kB(0,e,0)]}var zB=``;function BB(e,t,n,r,i){if(!e.length)return null;let a=r.head-e.from,o;if(r.head==e.from&&r.assoc<0){if(!i)return null;a=t[o=0].side(!1,n)}else if(r.head==e.to&&r.assoc>0){if(i)return null;a=t[o=t.length-1].side(!0,n)}else o=kB.find(t,a,r.bidiLevel??-1,r.assoc);let s=t[o],c=s.side(i,n);if(a==c){let e=o+=i?1:-1;if(e<0||e>=t.length)return null;s=t[o=e],a=s.side(!i,n),c=s.side(i,n)}let l=DL(e.text,a,s.forward(i,n));(l<s.from||l>s.to)&&(l=c),zB=e.text.slice(Math.min(a,l),Math.max(a,l));let u=o==(i?t.length-1:0)?null:t[o+(i?1:-1)];if(l==c){if(!u)return i?Y.cursor(e.to,1):Y.cursor(e.from,-1);if(u.level+ +!i<s.level)return Y.cursor(u.side(!i,n)+e.from,u.forward(i,n)?1:-1,u.level)}return Y.cursor(l+e.from,s.forward(i,n)?-1:1,s.level)}function VB(e,t,n){for(let r=t;r<n;r++){let t=DB(e.charCodeAt(r));if(t==1)return bB;if(t==2||t==4)return xB}return bB}var HB=X.define(),UB=X.define(),WB=X.define(),GB=X.define(),KB=X.define(),qB=X.define(),JB=X.define(),YB=X.define(),XB=X.define(),ZB=X.define({combine:e=>e.some(e=>e)}),QB=X.define({combine:e=>e.some(e=>e)}),$B=X.define(),eV=class e{constructor(e,t,n,r,i,a=!1){this.range=e,this.y=t,this.x=n,this.yMargin=r,this.xMargin=i,this.isSnapshot=a}map(t){return t.empty?this:new e(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new e(Y.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}},tV=yR.define({map:(e,t)=>e.map(t)}),nV=yR.define();function rV(e,t,n){let r=e.facet(GB);r.length?r[0](t):window.onerror&&window.onerror(String(t),n,void 0,void 0,t)||(n?console.error(n+`:`,t):console.error(t))}var iV=X.define({combine:e=>!e.length||e[0]}),aV=0,oV=X.define({combine(e){return e.filter((t,n)=>{for(let r=0;r<n;r++)if(e[r].plugin==t.plugin)return!1;return!0})}}),sV=class e{constructor(e,t,n,r,i){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=r,this.baseExtensions=i(this),this.extension=this.baseExtensions.concat(oV.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(oV.of({plugin:this,arg:e}))}static define(t,n){let{eventHandlers:r,eventObservers:i,provide:a,decorations:o}=n||{};return new e(aV++,t,r,i,e=>{let t=[];return o&&t.push(dV.of(t=>{let n=t.plugin(e);return n?o(n):Q.none})),a&&t.push(a(e)),t})}static fromClass(t,n){return e.define((e,n)=>new t(e,n),n)}},cV=class{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(!this.value){if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){rV(e.state,t,`CodeMirror plugin crashed`),this.deactivate()}}else if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(t){if(rV(e.state,t,`CodeMirror plugin crashed`),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}return this}destroy(e){if(this.value?.destroy)try{this.value.destroy()}catch(t){rV(e.state,t,`CodeMirror plugin crashed`)}}deactivate(){this.spec=this.value=null}},lV=X.define(),uV=X.define(),dV=X.define(),fV=X.define(),pV=X.define(),mV=X.define(),hV=X.define();function gV(e,t){let n=e.state.facet(hV);if(!n.length)return n;let r=n.map(t=>t instanceof Function?t(e):t),i=[];return VR.spans(r,t.from,t.to,{point(){},span(e,n,r,a){let o=e-t.from,s=n-t.from,c=i;for(let e=r.length-1;e>=0;e--,a--){let n=r[e].spec.bidiIsolate,i;if(n??=VB(t.text,o,s),a>0&&c.length&&(i=c[c.length-1]).to==o&&i.direction==n)i.to=s,c=i.inner;else{let e={from:o,to:s,direction:n,inner:[]};c.push(e),c=e.inner}}}}),i}var _V=X.define();function vV(e){let t=0,n=0,r=0,i=0;for(let a of e.state.facet(_V)){let o=a(e);o&&(o.left!=null&&(t=Math.max(t,o.left)),o.right!=null&&(n=Math.max(n,o.right)),o.top!=null&&(r=Math.max(r,o.top)),o.bottom!=null&&(i=Math.max(i,o.bottom)))}return{left:t,right:n,top:r,bottom:i}}var yV=X.define(),bV=class e{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}join(t){return new e(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(e){let t=e.length,n=this;for(;t>0;t--){let r=e[t-1];if(!(r.fromA>n.toA)){if(r.toA<n.fromA)break;n=n.join(r),e.splice(t-1,1)}}return e.splice(t,0,n),e}static extendWithRanges(t,n){if(n.length==0)return t;let r=[];for(let i=0,a=0,o=0;;){let s=i<t.length?t[i].fromB:1e9,c=a<n.length?n[a]:1e9,l=Math.min(s,c);if(l==1e9)break;let u=l+o,d=l,f=u;for(;;)if(a<n.length&&n[a]<=d){let e=n[a+1];a+=2,d=Math.max(d,e);for(let e=i;e<t.length&&t[e].fromB<=d;e++)o=t[e].toA-t[e].toB;f=Math.max(f,e+o)}else if(i<t.length&&t[i].fromB<=d){let e=t[i++];d=Math.max(d,e.toB),f=Math.max(f,e.toA),o=e.toA-e.toB}else break;r.push(new e(u,f,l,d))}return r}},xV=class e{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=IL.empty(this.startState.doc.length);for(let e of n)this.changes=this.changes.compose(e.changes);let r=[];this.changes.iterChangedRanges((e,t,n,i)=>r.push(new bV(e,t,n,i))),this.changedRanges=r}static create(t,n,r){return new e(t,n,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}},SV=[],CV=class{constructor(e,t,n=0){this.dom=e,this.length=t,this.flags=n,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return SV}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let e=this.domAttrs;e&&Nz(this.dom,e)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:``)+(this.breakAfter?`#`:``)}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,t=this.posAtStart){let n=t;for(let t of this.children){if(t==e)return n;n+=t.length+t.breakAfter}throw RangeError(`Invalid child in posBefore`)}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,t,n){return null}domPosFor(e,t){let n=Xz(this.dom),r=this.length?e>0:t>0;return new vB(this.parent.dom,n+ +!!r,e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof EV)return e;return null}static get(e){return e.cmTile}},wV=class extends CV{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let t=this.dom,n=null,r,i=e?.node==t?e:null,a=0;for(let o of this.children){if(o.sync(e),a+=o.length+o.breakAfter,r=n?n.nextSibling:t.firstChild,i&&r!=o.dom&&(i.written=!0),o.dom.parentNode==t)for(;r&&r!=o.dom;)r=TV(r);else t.insertBefore(o.dom,r);n=o.dom}for(r=n?n.nextSibling:t.firstChild,i&&r&&(i.written=!0);r;)r=TV(r);this.length=a}};function TV(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}var EV=class extends wV{constructor(e,t){super(t),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let t=CV.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],n=this,r=0,i=0;;)if(r==n.children.length){if(!t.length)return;n=n.parent,n.breakAfter&&i++,r=t.pop()}else{let a=n.children[r++];if(a instanceof DV)t.push(r),n=a,r=0;else{let t=i+a.length,n=e(a,i);if(n!==void 0)return n;i=t+a.breakAfter}}}resolveBlock(e,t){let n,r=-1,i,a=-1;if(this.blockTiles((o,s)=>{let c=s+o.length;if(e>=s&&e<=c){if(o.isWidget()&&t>=-1&&t<=1){if(o.flags&32)return!0;o.flags&16&&(n=void 0)}(s<e||e==c&&(t<-1?o.length:o.covers(1)))&&(!n||!o.isWidget()&&n.isWidget())&&(n=o,r=e-s),(c>e||e==s&&(t>1?o.length:o.covers(-1)))&&(!i||!o.isWidget()&&i.isWidget())&&(i=o,a=e-s)}}),!n&&!i)throw Error(`No tile at position `+e);return n&&t<0||!i?{tile:n,offset:r}:{tile:i,offset:a}}},DV=class e extends wV{constructor(e,t){super(e),this.wrapper=t}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(t,n){let r=new e(n||document.createElement(t.tagName),t);return n||(r.flags|=4),r}},OV=class e extends wV{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(t,n,r){let i=new e(n||document.createElement(`div`),t);return(!n||!r)&&(i.flags|=4),i}get domAttrs(){return this.attrs}resolveInline(e,t,n){let r=null,i=-1,a=null,o=-1;function s(e,c){for(let l=0,u=0;l<e.children.length&&u<=c;l++){let d=e.children[l],f=u+d.length;f>=c&&(d.isComposite()?s(d,c-u):(!a||a.isHidden&&(t>0&&!(a.flags&32)||n&&AV(a,d)))&&(f>c||d.flags&32&&t<=1)?(a=d,o=c-u):(u<c||d.flags&16&&!d.isHidden&&t>=-1)&&(r=d,i=c-u)),u=f}}s(this,e);let c=(t<0?r:a)||r||a;return c?{tile:c,offset:c==r?i:o}:null}coordsIn(e,t,n){let r=this.resolveInline(e,t,!0);return r?r.tile.coordsIn(Math.max(0,r.offset),t,n):kV(this)}domIn(e,t){let n=this.resolveInline(e,t);if(n){let{tile:e,offset:r}=n;if(this.dom.contains(e.dom))return e.isText()?new vB(e.dom,Math.min(e.dom.nodeValue.length,r)):e.domPosFor(r,e.flags&16?1:e.flags&32?-1:t);let i=n.tile.parent,a=!1;for(let e of i.children){if(a)return new vB(e.dom,0);e==n.tile&&(a=!0)}}return new vB(this.dom,0)}};function kV(e){let t=e.dom.lastChild;if(!t)return e.dom.getBoundingClientRect();let n=Jz(t);return n[n.length-1]||null}function AV(e,t){let n=e.coordsIn(0,1),r=t.coordsIn(0,1);return n&&r&&r.top<n.bottom}var jV=class e extends wV{constructor(e,t){super(e),this.mark=t}get domAttrs(){return this.mark.attrs}static of(t,n){let r=new e(n||document.createElement(t.tagName),t);return n||(r.flags|=4),r}},MV=class e extends CV{constructor(e,t){super(e,t.length),this.text=t}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,t,n){let r=this.dom.nodeValue.length;e>r&&(e=r);let i=e,a=e,o=0;e==0&&t<0||e==r&&t>=0?Z.chrome||Z.gecko||(e?(i--,o=1):a<r&&(a++,o=-1)):t<0?i--:a<r&&a++;let s=dB(this.dom,i,a).getClientRects();if(!s.length)return null;let c=s[(o?o<0:t>=0)?0:s.length-1];return Z.safari&&!o&&c.width==0&&(c=Array.prototype.find.call(s,e=>e.width)||c),n==null?c:eB(c,(o?o>0:t<0)==n)}static of(t,n){let r=new e(n||document.createTextNode(t),t);return n||(r.flags|=2),r}},NV=class e extends CV{constructor(e,t,n,r){super(e,t,r),this.widget=n}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,t){return this.coordsInWidget(e,t,!1)}coordsInWidget(e,t,n){let r=this.widget.coordsAt(this.dom,e,t);if(r)return r;if(n)return eB(this.dom.getBoundingClientRect(),this.length?e==0:t<=0);{let t=this.dom.getClientRects(),n=null;if(!t.length)return null;let r=this.flags&16?!0:this.flags&32?!1:e>0;for(let i=r?t.length-1:0;n=t[i],!(e>0?i==0:i==t.length-1||n.top<n.bottom);i+=r?-1:1);return eB(n,!r)}}get overrideDOMText(){if(!this.length)return gL.empty;let{root:e}=this;if(!e)return gL.empty;let t=this.posAtStart;return e.view.state.doc.slice(t,t+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(t,n,r,i,a){return a||(a=t.toDOM(n),t.editable||(a.contentEditable=`false`)),new e(a,r,t,i)}},PV=class extends CV{constructor(e){let t=document.createElement(`img`);t.className=`cm-widgetBuffer`,t.setAttribute(`aria-hidden`,`true`),super(t,0,e)}get isHidden(){return!0}get overrideDOMText(){return gL.empty}coordsIn(e,t,n){let r=this.dom.getBoundingClientRect();return n==null?r:eB(r,t>0==n)}},FV=class{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,t,n){let{tile:r,index:i,beforeBreak:a,parents:o}=this;for(;e||t>0;)if(!r.isComposite()){let t=r.length;if(i<t&&e){let a=Math.min(e,t-i);n&&n.skip(r,i,i+a),e-=a,i+=a}if(i==t)a=!!r.breakAfter,{tile:r,index:i}=o.pop(),i++;else if(!e)break}else if(a){if(!e)break;n&&n.break(),e--,a=!1}else if(i==r.children.length){if(!e&&!o.length)break;n&&n.leave(r),a=!!r.breakAfter,{tile:r,index:i}=o.pop(),i++}else{let s=r.children[i],c=s.breakAfter;(t>0?s.length<=e:s.length<e)&&(!n||n.skip(s,0,s.length)!==!1||!s.isComposite)?(a=!!c,i++,e-=s.length):(o.push({tile:r,index:i}),r=s,i=0,n&&s.isComposite()&&n.enter(s))}return this.tile=r,this.index=i,this.beforeBreak=a,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}},IV=class{constructor(e,t,n,r){this.from=e,this.to=t,this.wrapper=n,this.rank=r}},LV=class{constructor(e,t,n){this.cache=e,this.root=t,this.blockWrappers=n,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,t,n,r){this.flushBuffer();let i=this.ensureMarks(t,n),a=i.lastChild;if(a&&a.isText()&&!(a.flags&8)&&a.length+e.length<512){this.cache.reused.set(a,2);let t=i.children[i.children.length-1]=new MV(a.dom,a.text+e);t.parent=i}else i.append(r||MV.of(e,this.cache.find(MV)?.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,t){let n=this.curLine;n.dom!=t.line.dom&&(n.setDOM(this.cache.reused.has(t.line)?qV(t.line.dom):t.line.dom),this.cache.reused.set(t.line,2));let r=n;for(let e=t.marks.length-1;e>=0;e--){let n=t.marks[e],i=r.lastChild;if(i instanceof jV&&i.mark.eq(n.mark))i.dom!=n.dom&&i.setDOM(qV(n.dom)),r=i;else{let{dom:e}=n;this.cache.reused.get(n)&&CV.get(n.dom)&&(e=qV(n.dom));let t=jV.of(n.mark,e);r.append(t),r=t}this.cache.reused.set(n,2)}let i=CV.get(e.text);i&&this.cache.reused.set(i,2);let a=new MV(e.text,e.text.nodeValue);a.flags|=8,this.pos=e.range.toB,r.append(a)}addInlineWidget(e,t,n){let r=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);r||this.flushBuffer();let i=this.ensureMarks(t,n);!r&&!(e.flags&16)&&i.append(this.getBuffer(1)),i.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,t,n){this.flushBuffer(),this.ensureMarks(t,n).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let t=this.afterWidget||this.lastBlock;t.length+=e,this.pos+=e}addLineStart(e,t){e||=WV;let n=OV.start(e,t||this.cache.find(OV)?.dom,!!t);this.getBlockPos().append(this.lastBlock=this.curLine=n)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,t){let n=this.curLine;for(let r=e.length-1;r>=0;r--){let i=e[r],a;if(t>0&&(a=n.lastChild)&&a instanceof jV&&a.mark.eq(i))n=a,t--;else{let e=jV.of(i,this.cache.find(jV,e=>e.mark.eq(i))?.dom);n.append(e),n=e,t=0}}return n}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!HV(this.curLine,!1)||e.dom.nodeName!=`BR`&&e.isWidget()&&!(Z.ios&&HV(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(YV,0,32)||new NV(YV.toDOM(),0,YV,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let t=e.rank*102+e.value.rank,n=new IV(e.from,e.to,e.value,t),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-n.rank||this.wrappers[r-1].to-n.to)<0;)r--;this.wrappers.splice(r,0,n)}this.wrapperPos=this.pos}getBlockPos(){this.updateBlockWrappers();let e=this.root;for(let t of this.wrappers){let n=e.lastChild;if(t.from<this.pos&&n instanceof DV&&n.wrapper.eq(t.wrapper))e=n;else{let n=DV.of(t.wrapper,this.cache.find(DV,e=>e.wrapper.eq(t.wrapper))?.dom);e.append(n),e=n}}return e}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let t=2|(e<0?16:32),n=this.cache.find(PV,void 0,1);return n&&(n.flags=t),n||new PV(t)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}},RV=class{constructor(e){this.skipCount=0,this.text=``,this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text=``,this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:t,lineBreak:n,done:r}=this.cursor.next(this.skipCount);if(this.skipCount=0,r)throw Error(`Ran out of text content when drawing inline views`);this.text=t;let i=this.textOff=Math.min(e,t.length);return n?null:t.slice(0,i)}let t=Math.min(this.text.length,this.textOff+e),n=this.text.slice(this.textOff,t);return this.textOff=t,n}},zV=[NV,OV,MV,jV,PV,DV,EV];for(let e=0;e<zV.length;e++)zV[e].bucket=e;var BV=class{constructor(e){this.view=e,this.buckets=zV.map(()=>[]),this.index=zV.map(()=>0),this.reused=new Map}add(e){let t=e.constructor.bucket,n=this.buckets[t];n.length<6?n.push(e):n[this.index[t]=(this.index[t]+1)%6]=e}find(e,t,n=2){let r=e.bucket,i=this.buckets[r],a=this.index[r];for(let e=0;e<i.length;e++){let o=(e+a)%i.length,s=i[o];if((!t||t(s))&&!this.reused.has(s))return i.splice(o,1),o<a&&this.index[r]--,this.reused.set(s,n),s}return null}findWidget(e,t,n){let r=this.buckets[0];if(r.length)for(let i=0,a=0;;i++){if(i==r.length){if(a)return null;a=1,i=0}let o=r[i];if(!this.reused.has(o)&&(a==0?o.widget.compare(e):o.widget.constructor==e.constructor&&e.updateDOM(o.dom,this.view,o.widget)))return r.splice(i,1),i<this.index[0]&&this.index[0]--,o.widget==e&&o.length==t&&(o.flags&497)==n?(this.reused.set(o,1),o):(this.reused.set(o,2),new NV(o.dom,t,e,o.flags&-498|n))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,t=2){if(!this.reused.has(e))return this.reused.set(e,t),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}},VV=class{constructor(e,t,n,r,i){this.view=e,this.decorations=r,this.disallowBlockEffectsFor=i,this.openWidget=!1,this.openMarks=0,this.cache=new BV(e),this.text=new RV(e.state.doc),this.builder=new LV(this.cache,new EV(e,e.contentDOM),VR.iter(n)),this.cache.reused.set(t,2),this.old=new FV(t),this.reuseWalker={skip:(e,t,n)=>{if(this.cache.add(e),e.isComposite())return!1},enter:e=>this.cache.add(e),leave:()=>{},break:()=>{}}}run(e,t){let n=t&&this.getCompositionContext(t.text);for(let r=0,i=0,a=0;;){let o=a<e.length?e[a++]:null,s=o?o.fromA:this.old.root.length;if(s>r){let e=s-r;this.preserve(e,!a,!o),r=s,i+=e}if(!o)break;t&&o.fromA<=t.range.fromA&&o.toA>=t.range.toA?(this.forward(o.fromA,t.range.fromA,t.range.fromA<t.range.toA?1:-1),this.emit(i,t.range.fromB),this.builder.flushBuffer(),this.cache.clear(),this.builder.addComposition(t,n),this.text.skip(t.range.toB-t.range.fromB),this.forward(t.range.fromA,o.toA),this.emit(t.range.toB,o.toB)):(this.forward(o.fromA,o.toA),this.emit(i,o.toB)),i=o.toB,r=o.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,t,n){let r=KV(this.old),i=this.openMarks;this.old.advance(e,n?1:-1,{skip:(e,t,n)=>{if(e.isWidget()){if(this.openWidget)this.builder.continueWidget(n-t);else{let a=n>0||t<e.length?NV.of(e.widget,this.view,n-t,e.flags&496,this.cache.maybeReuse(e)):this.cache.reuse(e);a.flags&256?(a.flags&=-2,this.builder.addBlockWidget(a)):(this.builder.ensureLine(null),this.builder.addInlineWidget(a,r,i),i=r.length)}}else if(e.isText())this.builder.ensureLine(null),!t&&n==e.length&&!this.cache.reused.has(e)?this.builder.addText(e.text,r,i,this.cache.reuse(e)):(this.cache.add(e),this.builder.addText(e.text.slice(t,n),r,i)),i=r.length;else if(e.isLine())e.flags&=-2,this.cache.reused.set(e,1),this.builder.addLine(e);else if(e instanceof PV)this.cache.add(e);else if(e instanceof jV)this.builder.ensureLine(null),this.builder.addMark(e,r,i),this.cache.reused.set(e,1),i=r.length;else return!1;this.openWidget=!1},enter:e=>{e.isLine()?this.builder.addLineStart(e.attrs,this.cache.maybeReuse(e)):(this.cache.add(e),e instanceof jV&&r.unshift(e.mark)),this.openWidget=!1},leave:e=>{e.isLine()?r.length&&=i=0:e instanceof jV&&(r.shift(),i=Math.min(i,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let n=null,r=this.builder,i=-1,a=VR.spans(this.decorations,e,t,{point:(e,t,a,o,s,c)=>{if(a instanceof Bz){if(this.disallowBlockEffectsFor[c]){if(a.block)throw RangeError(`Block decorations may not be specified via plugins`);if(t>this.view.state.doc.lineAt(e).to)throw RangeError(`Decorations that replace line breaks may not be specified via plugins`)}if(i=o.length,s>o.length)r.continueWidget(t-e);else{let i=a.widget||(a.block?JV.block:JV.inline),c=UV(a),l=this.cache.findWidget(i,t-e,c)||NV.of(i,this.view,t-e,c);a.block?(a.startSide>0&&r.addLineStartIfNotCovered(n),r.addBlockWidget(l)):(r.ensureLine(n),r.addInlineWidget(l,o,s))}n=null}else n=GV(n,a);t>e&&this.text.skip(t-e)},span:(e,t,a,o)=>{for(let i=e;i<t;){let s=this.text.next(Math.min(512,t-i));s==null?(r.addLineStartIfNotCovered(n),r.addBreak(),i++):(r.ensureLine(n),r.addText(s,a,i==e?o:a.length),i+=s.length),n=null}i=a.length}});i>-1&&(this.openWidget=a>i),this.openWidget||r.addLineStartIfNotCovered(n),this.openMarks=a}forward(e,t,n=1){t-e<=10?this.old.advance(t-e,n,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(t-e-10,-1),this.old.advance(5,n,this.reuseWalker))}getCompositionContext(e){let t=[],n=null;for(let r=e.parentNode;;r=r.parentNode){let e=CV.get(r);if(r==this.view.contentDOM)break;e instanceof jV?t.push(e):e?.isLine()?n=e:e instanceof DV||(r.nodeName==`DIV`&&!n?n=new OV(r,WV):n||t.push(jV.of(new Rz({tagName:r.nodeName.toLowerCase(),attributes:Fz(r)}),r)))}return n?{line:n,marks:t}:null}};function HV(e,t){let n=e=>{for(let r of e.children)if((t?r.isText():r.length)||n(r))return!0;return!1};return n(e)}function UV(e){let t=e.isReplace?(e.startSide<0?64:0)|(e.endSide>0?128:0):e.startSide>0?32:16;return e.block&&(t|=256),t}var WV={class:`cm-line`};function GV(e,t){let n=t.spec.attributes,r=t.spec.class;return!n&&!r?e:(e||={class:`cm-line`},n&&Az(n,e),r&&(e.class+=` `+r),e)}function KV(e){let t=[];for(let n=e.parents.length;n>1;n--){let r=n==e.parents.length?e.tile:e.parents[n].tile;r instanceof jV&&t.push(r.mark)}return t}function qV(e){let t=CV.get(e);return t&&t.setDOM(e.cloneNode()),e}var JV=class extends Iz{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}};JV.inline=new JV(`span`),JV.block=new JV(`div`);var YV=new class extends Iz{toDOM(){return document.createElement(`br`)}get isHidden(){return!0}get editable(){return!0}},XV=class{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=Q.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new EV(e,e.contentDOM),this.updateInner([new bV(0,0,0,e.state.doc.length)],null)}update(e){let t=e.changedRanges;this.minWidth>0&&t.length&&(t.every(({fromA:e,toA:t})=>t<this.minWidthFrom||e>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let n=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(this.domChanged?.newSel?n=this.domChanged.newSel.head:!sH(e.changes,this.hasComposition)&&!e.selectionSet&&(n=e.state.selection.main.head));let r=n>-1?eH(this.view,e.changes,n):null;if(this.domChanged=null,this.hasComposition){let{from:n,to:r}=this.hasComposition;t=new bV(n,r,e.changes.mapPos(n,-1),e.changes.mapPos(r,1)).addToSet(t.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(Z.ie||Z.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let i=this.decorations,a=this.blockWrappers;this.updateDeco();let o=rH(i,this.decorations,e.changes);o.length&&(t=bV.extendWithRanges(t,o));let s=aH(a,this.blockWrappers,e.changes);return s.length&&(t=bV.extendWithRanges(t,s)),r&&!t.some(e=>e.fromA<=r.range.fromA&&e.toA>=r.range.toA)&&(t=r.range.addToSet(t.slice())),this.tile.flags&2&&t.length==0?!1:(this.updateInner(t,r),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t){this.view.viewState.mustMeasureContent=!0;let{observer:n}=this.view;n.ignore(()=>{if(t||e.length){let n=this.tile,r=new VV(this.view,n,this.blockWrappers,this.decorations,this.dynamicDecorationMap);t&&CV.get(t.text)&&r.cache.reused.set(CV.get(t.text),2),this.tile=r.run(e,t),ZV(n,r.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+`px`,this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+`px`:``;let r=Z.chrome||Z.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(r),r&&(r.written||n.selectionRange.focusNode!=r.node||!this.tile.dom.contains(r.node))&&(this.forceSelection=!0),this.tile.dom.style.height=``});let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let e of this.tile.children)e.isWidget()&&e.widget instanceof cH&&r.push(e.dom);n.updateGaps(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let e of t.effects)e.is(nV)&&(this.editContextFormatting=e.value)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:n}=this.tile,r=this.view.root.activeElement,i=r==n,a=!i&&!(this.view.state.facet(iV)||n.tabIndex>-1)&&qz(n,this.view.observer.selectionRange)&&!(r&&n.contains(r));if(!(i||t||a))return;let o=this.forceSelection;this.forceSelection=!1;let s=this.view.state.selection.main,c,l;if(s.empty?l=c=this.inlineDOMNearPos(s.anchor,s.assoc||1):(l=this.inlineDOMNearPos(s.head,s.head==s.from?1:-1),c=this.inlineDOMNearPos(s.anchor,s.anchor==s.from?1:-1)),Z.gecko&&s.empty&&!this.hasComposition&&QV(c)){let e=document.createTextNode(``);this.view.observer.ignore(()=>c.node.insertBefore(e,c.node.childNodes[c.offset]||null)),c=l=new vB(e,0),o=!0}let u=this.view.observer.selectionRange;(o||!u.focusNode||(!Yz(c.node,c.offset,u.anchorNode,u.anchorOffset)||!Yz(l.node,l.offset,u.focusNode,u.focusOffset))&&!this.suppressWidgetCursorChange(u,s))&&(this.view.observer.ignore(()=>{Z.android&&Z.chrome&&n.contains(u.focusNode)&&oH(u.focusNode,n)&&(n.blur(),n.focus({preventScroll:!0}));let e=Gz(this.view.root);if(e){if(s.empty){if(Z.gecko){let e=tH(c.node,c.offset);if(e&&e!=3){let t=(e==1?gB:_B)(c.node,c.offset);t&&(c=new vB(t.node,t.offset))}}e.collapse(c.node,c.offset),s.bidiLevel!=null&&e.caretBidiLevel!==void 0&&(e.caretBidiLevel=s.bidiLevel)}else if(e.extend){e.collapse(c.node,c.offset);try{e.extend(l.node,l.offset)}catch{}}else{let t=document.createRange();s.anchor>s.head&&([c,l]=[l,c]),t.setEnd(l.node,l.offset),t.setStart(c.node,c.offset),e.removeAllRanges(),e.addRange(t)}}a&&this.view.root.activeElement==n&&(n.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(c,l)),this.impreciseAnchor=c.precise?null:new vB(u.anchorNode,u.anchorOffset),this.impreciseHead=l.precise?null:new vB(u.focusNode,u.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&Yz(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=Gz(e.root),{anchorNode:r,anchorOffset:i}=e.observer.selectionRange;if(!n||!t.empty||!t.assoc||!n.modify)return;let a=this.lineAt(t.head,t.assoc);if(!a)return;let o=a.posAtStart;if(t.head==o||t.head==o+a.length)return;let s=this.coordsAt(t.head,-1),c=this.coordsAt(t.head,1);if(!s||!c||s.bottom>c.top)return;let l=this.domAtPos(t.head+t.assoc,t.assoc);n.collapse(l.node,l.offset),n.modify(`move`,t.assoc<0?`forward`:`backward`,`lineboundary`),e.observer.readSelectionRange();let u=e.observer.selectionRange;e.docView.posFromDOM(u.anchorNode,u.anchorOffset)!=t.from&&n.collapse(r,i)}posFromDOM(e,t){let n=this.tile.nearest(e);if(!n)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let r=n.posAtStart;if(n.isComposite()){let i;if(e==n.dom)i=n.dom.childNodes[t];else{let r=$z(e)==0?0:t==0?-1:1;for(;;){let t=e.parentNode;if(t==n.dom)break;r==0&&t.firstChild!=t.lastChild&&(r=e==t.firstChild?-1:1),e=t}i=r<0?e:e.nextSibling}if(i==n.dom.firstChild)return r;for(;i&&!CV.get(i);)i=i.nextSibling;if(!i)return r+n.length;for(let e=0,t=r;;e++){let r=n.children[e];if(r.dom==i)return t;t+=r.length+r.breakAfter}}else if(n.isText())return e==n.dom?r+t:r+(t?n.length:0);else return r}domAtPos(e,t){let{tile:n,offset:r}=this.tile.resolveBlock(e,t);return n.isWidget()?n.domPosFor(r,t):n.domIn(r,t)}inlineDOMNearPos(e,t){let n,r=-1,i=!1,a,o=-1,s=!1;return this.tile.blockTiles((t,c)=>{if(t.isWidget()){if(t.flags&32&&c>=e)return!0;t.flags&16&&(i=!0)}else{let l=c+t.length;if(c<=e&&(n=t,r=e-c,i=l<e),l>=e&&!a&&(a=t,o=e-c,s=c>e),c>e&&a)return!0}}),!n&&!a?this.domAtPos(e,t):(i&&a?n=null:s&&n&&(a=null),n&&t<0||!a?n.domIn(r,t):a.domIn(o,t))}coordsAt(e,t,n){let{tile:r,offset:i}=this.tile.resolveBlock(e,t);return r.isWidget()?r.widget instanceof cH?null:r.coordsInWidget(i,t,!0):r.coordsIn(i,t,n)}lineAt(e,t){let{tile:n}=this.tile.resolveBlock(e,t);return n.isLine()?n:null}coordsForChar(e){let{tile:t,offset:n}=this.tile.resolveBlock(e,1);if(!t.isLine())return null;function r(e,t){if(e.isComposite())for(let n of e.children){if(n.length>=t){let e=r(n,t);if(e)return e}if(t-=n.length,t<0)break}else if(e.isText()&&t<e.length){let n=DL(e.text,t);if(n==t)return null;let r=dB(e.dom,t,n).getClientRects();for(let e=0;e<r.length;e++){let t=r[e];if(e==r.length-1||t.top<t.bottom&&t.left<t.right)return t}}return null}return r(t,n)}measureVisibleLineHeights(e){let t=[],{from:n,to:r}=e,i=this.view.contentDOM.clientWidth,a=i>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,o=-1,s=this.view.textDirection==yB.LTR,c=0,l=(e,u,d)=>{for(let f=0;f<e.children.length&&!(u>r);f++){let r=e.children[f],p=u+r.length,m=r.dom.getBoundingClientRect(),{height:h}=m;if(d&&!f&&(c+=m.top-d.top),r instanceof DV)p>n&&l(r,u,m);else if(u>=n&&(c>0&&t.push(-c),t.push(h+c),c=0,a)){let e=r.dom.lastChild,t=e?Jz(e):[];if(t.length){let e=t[t.length-1],n=s?e.right-m.left:m.right-e.left;n>o&&(o=n,this.minWidth=i,this.minWidthFrom=u,this.minWidthTo=p)}}d&&f==e.children.length-1&&(c+=d.bottom-m.bottom),u=p+r.breakAfter}};return l(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return getComputedStyle(t.dom).direction==`rtl`?yB.RTL:yB.LTR}measureTextSize(){let e=this.tile.blockTiles(e=>{if(e.isLine()&&e.children.length&&e.length<=20){let t=0,n;for(let r of e.children){if(!r.isText()||/[^ -~]/.test(r.text))return;let e=Jz(r.dom);if(e.length!=1)return;t+=e[0].width,n=e[0].height}if(t)return{lineHeight:e.dom.getBoundingClientRect().height,charWidth:t/e.length,textHeight:n}}});if(e)return e;let t=document.createElement(`div`),n,r,i;return t.className=`cm-line`,t.style.width=`99999px`,t.style.position=`absolute`,t.textContent=`abc def ghi jkl mno pqr stu`,this.view.observer.ignore(()=>{this.tile.dom.appendChild(t);let e=Jz(t.firstChild)[0];n=t.getBoundingClientRect().height,r=e&&e.width?e.width/27:7,i=e&&e.height?e.height:n,t.remove()}),{lineHeight:n,charWidth:r,textHeight:i}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,r=0;;r++){let i=r==t.viewports.length?null:t.viewports[r],a=i?i.from-1:this.view.state.doc.length;if(a>n){let r=(t.lineBlockAt(a).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(Q.replace({widget:new cH(r),block:!0,inclusive:!0,isBlockGap:!0}).range(n,a))}if(!i)break;n=i.to+1}return Q.set(e)}updateDeco(){let e=1,t=this.view.state.facet(dV).map(t=>(this.dynamicDecorationMap[e++]=typeof t==`function`)?t(this.view):t),n=!1,r=this.view.state.facet(pV).map((e,t)=>{let r=typeof e==`function`;return r&&(n=!0),r?e(this.view):e});for(r.length&&(this.dynamicDecorationMap[e++]=n,t.push(VR.join(r))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(fV).map(e=>typeof e==`function`?e(this.view):e)}scrollIntoView(e){if(e.isSnapshot){let t=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=t.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let t of this.view.state.facet($B))try{if(t(this.view,e.range,e))return!0}catch(e){rV(this.view.state,e,`scroll handler`)}let{range:t}=e,n=this.coordsAt(t.head,t.assoc||(t.head>t.anchor?-1:1)),r;if(!n)return;!t.empty&&(r=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(n={left:Math.min(n.left,r.left),top:Math.min(n.top,r.top),right:Math.max(n.right,r.right),bottom:Math.max(n.bottom,r.bottom)});let i=vV(this.view),a={left:n.left-i.left,top:n.top-i.top,right:n.right+i.right,bottom:n.bottom+i.bottom},{offsetWidth:o,offsetHeight:s}=this.view.scrollDOM;if(rB(this.view.scrollDOM,a,t.head<t.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,o),-o),Math.max(Math.min(e.yMargin,s),-s),this.view.textDirection==yB.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(n.top>window.visualViewport.offsetTop+window.visualViewport.height||n.bottom<window.visualViewport.offsetTop)){let e=this.view.docView.lineAt(t.head,1);if(e){let t=oB(e.dom);e.dom.scrollIntoView({block:`nearest`}),sB(t,!1)}}}lineHasWidget(e){let t=e=>e.isWidget()||e.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){ZV(this.tile)}};function ZV(e,t){let n=t?.get(e);if(n!=1){n??e.destroy();for(let n of e.children)ZV(n,t)}}function QV(e){return e.node.nodeType==1&&e.node.firstChild&&(e.offset==0||e.node.childNodes[e.offset-1].contentEditable==`false`)&&(e.offset==e.node.childNodes.length||e.node.childNodes[e.offset].contentEditable==`false`)}function $V(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let r=gB(n.focusNode,n.focusOffset),i=_B(n.focusNode,n.focusOffset),a=r||i;if(i&&r&&i.node!=r.node){let t=CV.get(i.node);if(!t||t.isText()&&t.text!=i.node.nodeValue)a=i;else if(e.docView.lastCompositionAfterCursor){let e=CV.get(r.node);!e||e.isText()&&e.text!=r.node.nodeValue||(a=i)}}if(e.docView.lastCompositionAfterCursor=a!=r,!a)return null;let o=t-a.offset;return{from:o,to:o+a.node.nodeValue.length,node:a.node}}function eH(e,t,n){let r=$V(e,n);if(!r)return null;let{node:i,from:a,to:o}=r,s=i.nodeValue;if(/[\n\r]/.test(s)||e.state.doc.sliceString(r.from,r.to)!=s)return null;let c=t.invertedDesc;return{range:new bV(c.mapPos(a),c.mapPos(o),a,o),text:i}}function tH(e,t){return e.nodeType==1?(t&&e.childNodes[t-1].contentEditable==`false`?1:0)|(t<e.childNodes.length&&e.childNodes[t].contentEditable==`false`?2:0):0}var nH=class{constructor(){this.changes=[]}compareRange(e,t){Uz(e,t,this.changes)}comparePoint(e,t){Uz(e,t,this.changes)}boundChange(e){Uz(e,e,this.changes)}};function rH(e,t,n){let r=new nH;return VR.compare(e,t,n,r),r.changes}var iH=class{constructor(){this.changes=[]}compareRange(e,t){Uz(e,t,this.changes)}comparePoint(){}boundChange(e){Uz(e,e,this.changes)}};function aH(e,t,n){let r=new iH;return VR.compare(e,t,n,r),r.changes}function oH(e,t){for(let n=e;n&&n!=t;n=n.assignedSlot||n.parentNode)if(n.nodeType==1&&n.contentEditable==`false`)return!0;return!1}function sH(e,t){let n=!1;return t&&e.iterChangedRanges((e,r)=>{e<t.to&&r>t.from&&(n=!0)}),n}var cH=class extends Iz{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement(`div`);return e.className=`cm-gap`,this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+`px`,!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}};function lH(e,t,n=1){let r=e.charCategorizer(t),i=e.doc.lineAt(t),a=t-i.from;if(i.length==0)return Y.cursor(t);a==0?n=1:a==i.length&&(n=-1);let o=a,s=a;n<0?o=DL(i.text,a,!1):s=DL(i.text,a);let c=r(i.text.slice(o,s));for(;o>0;){let e=DL(i.text,o,!1);if(r(i.text.slice(e,o))!=c)break;o=e}for(;s<i.length;){let e=DL(i.text,s);if(r(i.text.slice(s,e))!=c)break;s=e}return Y.undirectionalRange(o+i.from,s+i.from)}function uH(e,t,n,r,i){let a=Math.round((r-t.left)*e.defaultCharacterWidth);if(e.lineWrapping&&n.height>e.defaultLineHeight*1.5){let t=e.viewState.heightOracle.textHeight,r=Math.floor((i-n.top-(e.defaultLineHeight-t)*.5)/t);a+=r*e.viewState.heightOracle.lineLength}let o=e.state.sliceDoc(n.from,n.to);return n.from+nz(o,a,e.state.tabSize)}function dH(e,t,n){let r=e.lineBlockAt(t);if(Array.isArray(r.type)){let e;for(let i of r.type){if(i.from>t)break;if(!(i.to<t)){if(i.from<t&&i.to>t)return i;(!e||i.type==Lz.Text&&(e.type!=i.type||(n<0?i.from<t:i.to>t)))&&(e=i)}}return e||r}return r}function fH(e,t,n,r){let i=dH(e,t.head,t.assoc||-1),a=!r||i.type!=Lz.Text||!(e.lineWrapping||i.widgetLineBreaks)?null:e.coordsAtPos(t.assoc<0&&t.head>i.from?t.head-1:t.head);if(a){let t=e.dom.getBoundingClientRect(),r=e.textDirectionAt(i.from),o=e.posAtCoords({x:n==(r==yB.LTR)?t.right-1:t.left+1,y:(a.top+a.bottom)/2});if(o!=null)return Y.cursor(o,n?-1:1)}return Y.cursor(n?i.to:i.from,n?-1:1)}function pH(e,t,n,r){let i=e.state.doc.lineAt(t.head),a=e.bidiSpans(i),o=e.textDirectionAt(i.from);for(let s=t,c=null;;){let t=BB(i,a,o,s,n),l=zB;if(!t){if(i.number==(n?e.state.doc.lines:1))return s;l=`
22
- `,i=e.state.doc.line(i.number+(n?1:-1)),a=e.bidiSpans(i),t=n?Y.cursor(i.from,-1):Y.cursor(i.to,1)}if(!c){if(!r)return t;c=r(l)}else if(!c(l))return s;s=t}}function mH(e,t,n){let r=e.state.charCategorizer(t),i=r(n);return e=>{let t=r(e);return i==kR.Space&&(i=t),i==t}}function hH(e,t,n,r){let i=t.head,a=n?1:-1;if(i==(n?e.state.doc.length:0))return Y.cursor(i,t.assoc);let o=t.goalColumn,s,c=e.contentDOM.getBoundingClientRect(),l=e.coordsAtPos(i,t.assoc||((t.empty?n:t.head==t.from)?1:-1)),u=e.documentTop;if(l)o??=l.left-c.left,s=a<0?l.top:l.bottom;else{let t=e.viewState.lineBlockAt(i);o??=Math.min(c.right-c.left,e.defaultCharacterWidth*(i-t.from)),s=(a<0?t.top:t.bottom)+u}let d=c.left+o,f=e.viewState.heightOracle.textHeight>>1,p=r??f;for(let t=0;;t+=f){let r=s+(p+t)*a,i=bH(e,{x:d,y:r},!1,a);if(n?r>c.bottom:r<c.top)return Y.cursor(i.pos,i.assoc);let l=e.coordsAtPos(i.pos,i.assoc),u=l?(l.top+l.bottom)/2:0;if(!l||(n?u>s:u<s))return Y.cursor(i.pos,i.assoc,void 0,o)}}function gH(e,t,n){for(;;){let r=0;for(let i of e)i.between(t-1,t+1,(e,i,a)=>{if(t>e&&t<i){let a=r||n||(t-e<i-t?-1:1);t=a<0?e:i,r=a}});if(!r)return t}}function _H(e,t){let n=null;for(let r=0;r<t.ranges.length;r++){let i=t.ranges[r],a=null;if(i.empty){let t=gH(e,i.from,0);t!=i.from&&(a=Y.cursor(t,-1))}else{let t=gH(e,i.from,-1),n=gH(e,i.to,1);(t!=i.from||n!=i.to)&&(a=i.undirectional?Y.undirectionalRange(i.from,i.to):Y.range(i.from==i.anchor?t:n,i.from==i.head?t:n))}a&&(n||=t.ranges.slice(),n[r]=a)}return n?Y.create(n,t.mainIndex):t}function vH(e,t,n){let r=gH(e.state.facet(mV).map(t=>t(e)),n.from,t.head>n.from?-1:1);return r==n.from?n:Y.cursor(r,r<n.from?1:-1)}var yH=class{constructor(e,t){this.pos=e,this.assoc=t}};function bH(e,t,n,r){let i=e.contentDOM.getBoundingClientRect(),a=i.top+e.viewState.paddingTop,{x:o,y:s}=t,c=s-a,l;for(;;){if(c<0)return new yH(0,1);if(c>e.viewState.docHeight)return new yH(e.state.doc.length,-1);if(l=e.elementAtHeight(c),r==null)break;if(l.type==Lz.Text){if(r<0?l.to<e.viewport.from:l.from>e.viewport.to)break;let t=e.docView.coordsAt(r<0?l.from:l.to,r>0?-1:1);if(t&&(r<0?t.top<=c+a:t.bottom>=c+a))break}let t=e.viewState.heightOracle.textHeight/2;c=r>0?l.bottom+t:l.top-t}if(e.viewport.from>=l.to||e.viewport.to<=l.from){if(n)return null;if(l.type==Lz.Text){let t=uH(e,i,l,o,s);return new yH(t,t==l.from?1:-1)}}if(l.type!=Lz.Text)return c<(l.top+l.bottom)/2?new yH(l.from,1):new yH(l.to,-1);let u=e.docView.lineAt(l.from,2);return(!u||u.length!=l.length)&&(u=e.docView.lineAt(l.from,-2)),new xH(e,o,s,e.textDirectionAt(l.from)).scanTile(u,l.from)}var xH=class{constructor(e,t,n,r){this.view=e,this.x=t,this.y=n,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,t){let{line:n,spans:r}=this.bidiSpansAt(e);return r[kB.find(r,e-n.from,-1,t)].level==this.baseDir}dirAt(e,t){let{line:n,spans:r}=this.bidiSpansAt(e);return r[kB.find(r,e-n.from,-1,t)].dir}bidiIn(e,t){let{spans:n,line:r}=this.bidiSpansAt(e);return n.length>1||n.length&&(n[0].level!=this.baseDir||n[0].to+r.from<t)}scan(e,t,n=!1){let r=0,i=e.length-1,a=new Set,o=this.bidiIn(e[0],e[i]),s,c,l=-1,u=1e9,d;search:for(;r<i;){let n=i-r,f=r+i>>1;adjust:if(a.has(f)){for(let e=1;e<n;e++){let t=f+e;if(t>=i&&(t-=n),!a.has(t)){f=t;break adjust}}break search}a.add(f);let p=t(f),m=0;if(p)for(let e=0;e<p.length;e++){let t=p[e];if(!(t.width==0&&p.length>1)){if(t.bottom<this.y)(!s||s.bottom<t.bottom)&&(s=t),m=1;else if(t.top>this.y)(!c||c.top>t.top)&&(c=t),m=-1;else{let e=t.left>this.x?this.x-t.left:t.right<this.x?this.x-t.right:0,n=Math.abs(e);n<u&&(l=f,u=n,d=t),e&&(m=e<0==(this.baseDir==yB.LTR)?-1:1)}}}m==-1&&(!o||this.baseDirAt(e[f],1))?i=f:m==1&&(!o||this.baseDirAt(e[f+1],-1))&&(r=f+1)}if(!d){if(!c&&!s)return{i:0,after:!1};let n=s&&(!c||this.y-s.bottom<c.top-this.y)?s:c;return this.y=(n.top+n.bottom)/2,this.scan(e,t,!0)}if(u&&!n){let{top:n,bottom:r}=d;if(s&&s.bottom>(n+n+r)/3)return this.y=s.bottom-1,this.scan(e,t,!0);if(c&&c.top<(n+r+r)/3)return this.y=c.top+1,this.scan(e,t,!0)}let f=(o?this.dirAt(e[l],1):this.baseDir)==yB.LTR;return{i:l,after:this.x>(d.left+d.right)/2==f}}scanText(e,t){let n=[];for(let r=0;r<e.length;r=DL(e.text,r))n.push(t+r);n.push(t+e.length);let r=this.scan(n,r=>{let i=n[r]-t,a=n[r+1]-t;return dB(e.dom,i,a).getClientRects()});return r.after?new yH(n[r.i+1],-1):new yH(n[r.i],1)}scanTile(e,t){if(!e.length)return new yH(t,1);if(e.children.length==1){let n=e.children[0];if(n.isText())return this.scanText(n,t);if(n.isComposite())return this.scanTile(n,t)}let n=[t];for(let r=0,i=t;r<e.children.length;r++)n.push(i+=e.children[r].length);let r=this.scan(n,t=>{let n=e.children[t];return n.flags&48?null:(n.dom.nodeType==1?n.dom:dB(n.dom,0,n.length)).getClientRects()}),i=e.children[r.i],a=n[r.i];return i.isText()?this.scanText(i,a):i.isComposite()?this.scanTile(i,a):r.after?new yH(n[r.i+1],-1):new yH(a,1)}},SH=`￿`,CH=class{constructor(e,t){this.points=e,this.view=t,this.text=``,this.lineSeparator=t.state.facet(PR.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=SH}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let r=e;;){this.findPointBefore(n,r);let e=this.text.length;this.readNode(r);let i=CV.get(r),a=r.nextSibling;if(a==t){i?.breakAfter&&!a&&n!=this.view.contentDOM&&this.lineBreak();break}let o=CV.get(a);(i&&o?i.breakAfter:(i?i.breakAfter:Zz(r))||Zz(a)&&(r.nodeName!=`BR`||i?.isWidget())&&this.text.length>e)&&!TH(a,t)&&this.lineBreak(),r=a}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let i=-1,a=1,o;if(this.lineSeparator?(i=t.indexOf(this.lineSeparator,n),a=this.lineSeparator.length):(o=r.exec(t))&&(i=o.index,a=o[0].length),this.append(t.slice(n,i<0?t.length:i)),i<0)break;if(this.lineBreak(),a>1)for(let t of this.points)t.node==e&&t.pos>this.text.length&&(t.pos-=a-1);n=i+a}}readNode(e){let t=CV.get(e),n=t&&t.overrideDOMText;if(n!=null){this.findPointInside(e,n.length);for(let e=n.iter();!e.next().done;)e.lineBreak?this.lineBreak():this.append(e.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName==`BR`?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(e.nodeType==3?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(wH(e,n.node,n.offset)?t:0))}};function wH(e,t,n){for(;;){if(!t||n<$z(t))return!1;if(t==e)return!0;n=Xz(t)+1,t=t.parentNode}}function TH(e,t){let n;for(;e!=t&&e;e=e.nextSibling){let t=CV.get(e);if(!t?.isWidget())return!1;t&&(n||=[]).push(t)}if(n){for(let e of n)if(e.overrideDOMText?.length)return!1}return!0}var EH=class{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}},DH=class{constructor(e,t,n,r){this.typeOver=r,this.bounds=null,this.text=``,this.domChanged=t>-1;let{impreciseHead:i,impreciseAnchor:a}=e.docView,o=e.state.selection;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=OH(e.docView.tile,t,n,0))){let t=i||a?[]:NH(e),n=new CH(t,e);n.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=n.text,this.newSel=PH(t,this.bounds.from)}else{let t=e.observer.selectionRange,n=i&&i.node==t.focusNode&&i.offset==t.focusOffset||!Kz(e.contentDOM,t.focusNode)?o.main.head:e.docView.posFromDOM(t.focusNode,t.focusOffset),r=a&&a.node==t.anchorNode&&a.offset==t.anchorOffset||!Kz(e.contentDOM,t.anchorNode)?o.main.anchor:e.docView.posFromDOM(t.anchorNode,t.anchorOffset),s=e.viewport;if((Z.ios||Z.chrome)&&n!=r&&Math.min(n,r)<=o.main.from&&Math.max(n,r)>=o.main.to&&(s.from>0||s.to<e.state.doc.length)){let t=Math.min(n,r),i=Math.max(n,r),a=s.from-t,o=s.to-i;(a==0||a==1||t==0)&&(o==0||o==-1||i==e.state.doc.length)&&(n=0,r=e.state.doc.length)}if(e.inputState.composing>-1&&o.ranges.length>1)this.newSel=o.replaceRange(Y.range(r,n));else if(e.lineWrapping&&r==n&&!(o.main.empty&&o.main.head==n)&&e.inputState.lastTouchTime>Date.now()-100){let t=e.coordsAtPos(n,-1),r=0;t&&(r=e.inputState.lastTouchY<=t.bottom?-1:1),this.newSel=Y.create([Y.cursor(n,r)])}else this.newSel=Y.single(r,n)}}};function OH(e,t,n,r){if(e.isComposite()){let i=-1,a=-1,o=-1,s=-1;for(let c=0,l=r,u=r;c<e.children.length;c++){let r=e.children[c],d=l+r.length;if(l<t&&d>n)return OH(r,t,n,l);if(d>=t&&i==-1&&(i=c,a=l),l>n&&r.dom.parentNode==e.dom){o=c,s=u;break}u=d,l=d+r.breakAfter}return{from:a,to:s<0?r+e.length:s,startDOM:(i?e.children[i-1].dom.nextSibling:null)||e.dom.firstChild,endDOM:o<e.children.length&&o>=0?e.children[o].dom:null}}return e.isText()?{from:r,to:r+e.length,startDOM:e.dom,endDOM:e.dom.nextSibling}:null}function kH(e,t){let n,{newSel:r}=t,{state:i}=e,a=i.selection.main,o=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:e,to:r}=t.bounds,s=a.from,c=null;(o===8||Z.android&&t.text.length<r-e)&&(s=a.to,c=`end`);let l=i.doc.sliceString(e,r,SH),u,d;!a.empty&&a.from>=e&&a.to<=r&&(t.typeOver||l!=t.text)&&l.slice(0,a.from-e)==t.text.slice(0,a.from-e)&&l.slice(a.to-e)==t.text.slice(u=t.text.length-(l.length-(a.to-e)))?n={from:a.from,to:a.to,insert:gL.of(t.text.slice(a.from-e,u).split(SH))}:(d=MH(l,t.text,s-e,c))&&(Z.chrome&&o==13&&d.toB==d.from+2&&t.text.slice(d.from,d.toB)==`￿￿`&&d.toB--,n={from:e+d.from,to:e+d.toA,insert:gL.of(t.text.slice(d.from,d.toB).split(SH))})}else r&&(!e.hasFocus&&i.facet(iV)||FH(r,a))&&(r=null);if(!n&&!r)return!1;if((Z.mac||Z.android)&&n&&n.from==n.to&&n.from==a.head-1&&/^\. ?$/.test(n.insert.toString())&&e.contentDOM.getAttribute(`autocorrect`)==`off`?(r&&n.insert.length==2&&(r=Y.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:gL.of([n.insert.toString().replace(`.`,` `)])}):i.doc.lineAt(a.from).to<a.to&&e.docView.lineHasWidget(a.to)&&e.inputState.insertingTextAt>Date.now()-50?n={from:a.from,to:a.to,insert:i.toText(e.inputState.insertingText)}:Z.chrome&&n&&n.from==n.to&&n.from==a.head&&n.insert.toString()==`
23
- `&&e.lineWrapping&&(r&&=Y.single(r.main.anchor-1,r.main.head-1),n={from:a.from,to:a.to,insert:gL.of([` `])}),n)return AH(e,n,r,o);if(r&&!FH(r,a)){let t=!1,n=`select`;return e.inputState.lastSelectionTime>Date.now()-50&&(e.inputState.lastSelectionOrigin==`select`&&(t=!0),n=e.inputState.lastSelectionOrigin,n==`select.pointer`&&(r=_H(i.facet(mV).map(t=>t(e)),r))),e.dispatch({selection:r,scrollIntoView:t,userEvent:n}),!0}return!1}function AH(e,t,n,r=-1){if(Z.ios&&e.inputState.flushIOSKey(t))return!0;let i=e.state.selection.main;if(Z.android&&(t.to==i.to&&(t.from==i.from||t.from==i.from-1&&e.state.sliceDoc(t.from,i.from)==` `)&&t.insert.length==1&&t.insert.lines==2&&fB(e.contentDOM,`Enter`,13)||(t.from==i.from-1&&t.to==i.to&&t.insert.length==0||r==8&&t.insert.length<t.to-t.from&&t.to>i.head)&&fB(e.contentDOM,`Backspace`,8)||t.from==i.from&&t.to==i.to+1&&t.insert.length==0&&fB(e.contentDOM,`Delete`,46)))return!0;let a=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let o,s=()=>o||=jH(e,t,n);return e.state.facet(qB).some(n=>n(e,t.from,t.to,a,s))||e.dispatch(s()),!0}function jH(e,t,n){let r,i=e.state,a=i.selection.main,o=-1;if(t.from==t.to&&t.from<a.from||t.from>a.to){let n=t.from<a.from?-1:1,r=n<0?a.from:a.to,s=gH(i.facet(mV).map(t=>t(e)),r,n);t.from==s&&(o=s)}if(o>-1)r={changes:t,selection:Y.cursor(t.from+t.insert.length,-1)};else if(t.from>=a.from&&t.to<=a.to&&t.to-t.from>=(a.to-a.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let n=a.from<t.from?i.sliceDoc(a.from,t.from):``,o=a.to>t.to?i.sliceDoc(t.to,a.to):``;r=i.replaceSelection(e.state.toText(n+t.insert.sliceString(0,void 0,e.state.lineBreak)+o))}else{let o=i.changes(t),s=n&&n.main.to<=o.newLength?n.main:void 0;if(i.selection.ranges.length>1&&(e.inputState.composing>=0||e.inputState.compositionPendingChange)&&t.to<=a.to+10&&t.to>=a.to-10){let c=e.state.sliceDoc(t.from,t.to),l,u=n&&$V(e,n.main.head);if(u){let e=t.insert.length-(t.to-t.from);l={from:u.from,to:u.to-e}}else l=e.state.doc.lineAt(a.head);let d=a.to-t.to;r=i.changeByRange(n=>{if(n.from==a.from&&n.to==a.to)return{changes:o,range:s||n.map(o)};let r=n.to-d,u=r-c.length;if(e.state.sliceDoc(u,r)!=c||r>=l.from&&u<=l.to)return{range:n};let f=i.changes({from:u,to:r,insert:t.insert}),p=n.to-a.to;return{changes:f,range:s?Y.range(Math.max(0,s.anchor+p),Math.max(0,s.head+p)):n.map(f)}})}else r={changes:o,selection:s&&i.selection.replaceRange(s)}}let s=`input.type`;return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,s+=`.compose`,e.inputState.compositionFirstChange&&(s+=`.start`,e.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:s,scrollIntoView:!0})}function MH(e,t,n,r){let i=Math.min(e.length,t.length),a=0;for(;a<i&&e.charCodeAt(a)==t.charCodeAt(a);)a++;if(a==i&&e.length==t.length)return null;let o=e.length,s=t.length;for(;o>0&&s>0&&e.charCodeAt(o-1)==t.charCodeAt(s-1);)o--,s--;if(r==`end`){let e=Math.max(0,a-Math.min(o,s));n-=o+e-a}if(o<a&&e.length<t.length){let e=n<=a&&n>=o?a-n:0;a-=e,s=a+(s-o),o=a}else if(s<a){let e=n<=a&&n>=s?a-n:0;a-=e,o=a+(o-s),s=a}return{from:a,toA:o,toB:s}}function NH(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}=e.observer.selectionRange;return n&&(t.push(new EH(n,r)),(i!=n||a!=r)&&t.push(new EH(i,a))),t}function PH(e,t){if(e.length==0)return null;let n=e[0].pos,r=e.length==2?e[1].pos:n;return n<0||r<0?null:n==r?Y.create([Y.cursor(r+t,-1)]):Y.single(n+t,r+t)}function FH(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}var IH=class{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.touchActive=!1,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.lastIOSMomentumScroll=0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText=``,this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,Z.safari&&e.contentDOM.addEventListener(`input`,()=>null),Z.gecko&&yU(e.contentDOM.ownerDocument)}handleEvent(e){XH(this.view,e)&&!this.ignoreDuringComposition(e)&&(e.type==`keydown`&&this.keydown(e)||(this.view.updateState==0?this.runHandlers(e.type,e):Promise.resolve().then(()=>this.runHandlers(e.type,e))))}runHandlers(e,t){let n=this.handlers[e];if(n){for(let e of n.observers)e(this.view,t);for(let e of n.handlers){if(t.defaultPrevented)break;if(e(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=zH(e),n=this.handlers,r=this.view.contentDOM;for(let e in t)if(e!=`scroll`){let i=!t[e].handlers.length,a=n[e];a&&i!=!a.handlers.length&&(r.removeEventListener(e,this.handleEvent),a=null),a||r.addEventListener(e,this.handleEvent,{passive:i})}for(let e in n)e!=`scroll`&&!t[e]&&r.removeEventListener(e,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&HH.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),Z.android&&Z.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;if(Z.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&(BH.some(t=>t.keyCode==e.keyCode)&&!e.ctrlKey||VH.indexOf(e.key)>-1&&e.ctrlKey)){let t={ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey,shiftKey:e.shiftKey};t.shiftKey&&Z.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&LH(this.view.win)&&(t.shiftKey=!1);let n=this.pendingIOSKey={key:e.key,keyCode:e.keyCode,mods:t};return setTimeout(()=>{this.pendingIOSKey==n&&this.flushIOSKey()},50),!0}return e.keyCode!=229&&this.view.observer.forceFlush(),!1}flushIOSKey(e){let t=this.pendingIOSKey;return!t||this.view.observer.pendingRecords().length||t.key==`Enter`&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,fB(this.view.contentDOM,t.key,t.keyCode,t.mods))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:Z.safari&&!Z.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}};function LH(e){return e.visualViewport?e.visualViewport.height*e.visualViewport.scale/e.document.documentElement.clientHeight<.85:!1}function RH(e,t){return(n,r)=>{try{return t.call(e,r,n)}catch(e){rV(n.state,e)}}}function zH(e){let t=Object.create(null);function n(e){return t[e]||(t[e]={observers:[],handlers:[]})}for(let t of e){let e=t.spec,r=e&&e.plugin.domEventHandlers,i=e&&e.plugin.domEventObservers;if(r)for(let e in r){let i=r[e];i&&n(e).handlers.push(RH(t.value,i))}if(i)for(let e in i){let r=i[e];r&&n(e).observers.push(RH(t.value,r))}}for(let e in ZH)n(e).handlers.push(ZH[e]);for(let e in QH)n(e).observers.push(QH[e]);return t}var BH=[{key:`Backspace`,keyCode:8,inputType:`deleteContentBackward`},{key:`Enter`,keyCode:13,inputType:`insertParagraph`},{key:`Enter`,keyCode:13,inputType:`insertLineBreak`},{key:`Delete`,keyCode:46,inputType:`deleteContentForward`}],VH=`dthko`,HH=[16,17,18,20,91,92,224,225],UH=6;function WH(e){return Math.max(0,e)*.7+8}function GH(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}var KH=class{constructor(e,t,n,r){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=iB(e.contentDOM),this.atoms=e.state.facet(mV).map(t=>t(e));let i=e.contentDOM.ownerDocument;i.addEventListener(`mousemove`,this.move=this.move.bind(this)),i.addEventListener(`mouseup`,this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(PR.allowMultipleSelections)&&qH(e,t),this.dragging=YH(e,t)&&cU(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&GH(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,n=0,r=0,i=0,a=this.view.win.innerWidth,o=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:i,bottom:o}=this.scrollParents.y.getBoundingClientRect());let s=vV(this.view);e.clientX-s.left<=r+UH?t=-WH(r-e.clientX):e.clientX+s.right>=a-UH&&(t=WH(e.clientX-a)),e.clientY-s.top<=i+UH?n=-WH(i-e.clientY):e.clientY+s.bottom>=o-UH&&(n=WH(e.clientY-o)),this.setScrollSpeed(t,n)}up(e){this.dragging??this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener(`mousemove`,this.move),e.removeEventListener(`mouseup`,this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:t}=this,n=_H(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!n.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:n,userEvent:`select.pointer`}),this.mustSelect=!1}update(e){e.transactions.some(e=>e.isUserEvent(`input.type`))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}};function qH(e,t){let n=e.state.facet(HB);return n.length?n[0](t):Z.mac?t.metaKey:t.ctrlKey}function JH(e,t){let n=e.state.facet(UB);return n.length?n[0](t):Z.mac?!t.altKey:!t.ctrlKey}function YH(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let r=Gz(e.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let e=0;e<i.length;e++){let n=i[e];if(n.left<=t.clientX&&n.right>=t.clientX&&n.top<=t.clientY&&n.bottom>=t.clientY)return!0}return!1}function XH(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target,r;n!=e.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=CV.get(n))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(t))return!1;return!0}var ZH=Object.create(null),QH=Object.create(null),$H=Z.ie&&Z.ie_version<15||Z.ios&&Z.webkit_version<604;function eU(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement(`textarea`));n.style.cssText=`position: fixed; left: -10000px; top: 10px`,n.focus(),setTimeout(()=>{e.focus(),n.remove(),nU(e,n.value)},50)}function tU(e,t,n){for(let r of e.facet(t))n=r(n,e);return n}function nU(e,t){t=tU(e.state,YB,t);let{state:n}=e,r,i=1,a=n.toText(t),o=a.lines==n.selection.ranges.length;if(mU!=null&&n.selection.ranges.every(e=>e.empty)&&mU==a.toString()){let e=-1;r=n.changeByRange(r=>{let s=n.doc.lineAt(r.from);if(s.from==e)return{range:r};e=s.from;let c=n.toText((o?a.line(i++).text:t)+n.lineBreak);return{changes:{from:s.from,insert:c},range:Y.cursor(r.from+c.length,-1)}})}else r=o?n.changeByRange(e=>{let t=a.line(i++);return{changes:{from:e.from,to:e.to,insert:t.text},range:Y.cursor(e.from+t.length,-1)}}):n.replaceSelection(a);e.dispatch(r,{userEvent:`input.paste`,scrollIntoView:!0})}QH.scroll=e=>{let t=e.inputState;t.lastScrollTop=e.scrollDOM.scrollTop,t.lastScrollLeft=e.scrollDOM.scrollLeft,Z.ios&&!t.touchActive&&(t.lastIOSMomentumScroll=Date.now())},QH.wheel=QH.mousewheel=e=>{e.inputState.lastWheelEvent=Date.now()},ZH.keydown=(e,t)=>(e.inputState.setSelectionOrigin(`select`),t.keyCode==27&&e.inputState.tabFocusMode!=0&&(e.inputState.tabFocusMode=Date.now()+2e3),!1),QH.touchstart=(e,t)=>{let n=e.inputState,r=t.targetTouches[0];n.touchActive=!0,n.lastTouchTime=Date.now(),r&&(n.lastTouchX=r.clientX,n.lastTouchY=r.clientY),n.setSelectionOrigin(`select.pointer`)},QH.touchmove=e=>{e.inputState.setSelectionOrigin(`select.pointer`)},QH.touchend=(e,t)=>{e.inputState.touchActive=!1},ZH.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of e.state.facet(WB))if(n=r(e,t),n)break;if(!n&&t.button==0&&(n=lU(e,t)),n){let r=!e.hasFocus;e.inputState.startMouseSelection(new KH(e,t,n,r)),r&&e.observer.ignore(()=>{lB(e.contentDOM);let t=e.root.activeElement;t&&!t.contains(e.contentDOM)&&t.blur()});let i=e.inputState.mouseSelection;if(i)return i.start(t),i.dragging===!1}else e.inputState.setSelectionOrigin(`select.pointer`);return!1};function rU(e,t,n,r){if(r==1)return Y.cursor(t,n);if(r==2)return lH(e.state,t,n);{let r=e.docView.lineAt(t,n),i=e.state.doc.lineAt(r?r.posAtEnd:t),a=r?r.posAtStart:i.from,o=r?r.posAtEnd:i.to;return o<e.state.doc.length&&o==i.to&&o++,Y.undirectionalRange(a,o)}}var iU=Z.ie&&Z.ie_version<=11,aU=null,oU=0,sU=0;function cU(e){if(!iU)return e.detail;let t=aU,n=sU;return aU=e,sU=Date.now(),oU=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(oU+1)%3:1}function lU(e,t){let n=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),r=cU(t),i=e.state.selection;return{update(e){e.docChanged&&(n.pos=e.changes.mapPos(n.pos),i=i.map(e.changes))},get(t,a,o){let s=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),c,l=rU(e,s.pos,s.assoc,r);if(n.pos!=s.pos&&!a){let t=rU(e,n.pos,n.assoc,r),i=Math.min(t.from,l.from),a=Math.max(t.to,l.to);l=i<l.from?Y.range(i,a,l.assoc):Y.range(a,i,l.assoc)}return a?i.replaceRange(i.main.extend(l.from,l.to,l.assoc)):o&&r==1&&i.ranges.length>1&&(c=uU(i,s.pos))?c:o?i.addRange(l):Y.create([l])}}}function uU(e,t){for(let n=0;n<e.ranges.length;n++){let{from:r,to:i}=e.ranges[n];if(r<=t&&i>=t)return Y.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-+(e.mainIndex>n))}return null}ZH.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let r=e.docView.tile.nearest(t.target);if(r&&r.isWidget()){let e=r.posAtStart,t=e+r.length;(e>=n.to||t<=n.from)&&(n=Y.undirectionalRange(e,t))}}let{inputState:r}=e;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData(`Text`,tU(e.state,XB,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed=`copyMove`),!1},ZH.dragend=e=>(e.inputState.draggedContent=null,!1);function dU(e,t,n,r){if(n=tU(e.state,YB,n),!n)return;let i=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:a}=e.inputState,o=r&&a&&JH(e,t)?{from:a.from,to:a.to}:null,s={from:i,insert:n},c=e.state.changes(o?[o,s]:s);e.focus(),e.dispatch({changes:c,selection:{anchor:c.mapPos(i,-1),head:c.mapPos(i,1)},userEvent:o?`move.drop`:`input.drop`}),e.inputState.draggedContent=null}ZH.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,a=()=>{++i==n.length&&dU(e,t,r.filter(e=>e!=null).join(e.state.lineBreak),!1)};for(let e=0;e<n.length;e++){let t=new FileReader;t.onerror=a,t.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(t.result)||(r[e]=t.result),a()},t.readAsText(n[e])}return!0}{let n=t.dataTransfer.getData(`Text`);if(n)return dU(e,t,n,!0),!0}return!1},ZH.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=$H?null:t.clipboardData;return n?(nU(e,n.getData(`text/plain`)||n.getData(`text/uri-list`)),!0):(eU(e),!1)};function fU(e,t){let n=e.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement(`textarea`));r.style.cssText=`position: fixed; left: -10000px; top: 10px`,r.value=t,r.focus(),r.selectionEnd=t.length,r.selectionStart=0,setTimeout(()=>{r.remove(),e.focus()},50)}function pU(e){let t=[],n=[],r=!1;for(let r of e.selection.ranges)r.empty||(t.push(e.sliceDoc(r.from,r.to)),n.push(r));if(!t.length){let i=-1;for(let{from:r}of e.selection.ranges){let a=e.doc.lineAt(r);a.number>i&&(t.push(a.text),n.push({from:a.from,to:Math.min(e.doc.length,a.to+1)})),i=a.number}r=!0}return{text:tU(e,XB,t.join(e.lineBreak)),ranges:n,linewise:r}}var mU=null;ZH.copy=ZH.cut=(e,t)=>{if(!qz(e.contentDOM,e.observer.selectionRange))return!1;let{text:n,ranges:r,linewise:i}=pU(e.state);if(!n&&!i)return!1;mU=i?n:null,t.type==`cut`&&!e.state.readOnly&&e.dispatch({changes:r,scrollIntoView:!0,userEvent:`delete.cut`});let a=$H?null:t.clipboardData;return a?(a.clearData(),a.setData(`text/plain`,n),!0):(fU(e,n),!1)};var hU=gR.define();function gU(e,t){let n=[];for(let r of e.facet(JB)){let i=r(e,t);i&&n.push(i)}return n.length?e.update({effects:n,annotations:hU.of(!0)}):null}function _U(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=gU(e.state,t);n?e.dispatch(n):e.update([])}},10)}QH.focus=e=>{e.inputState.lastFocusTime=Date.now(),!e.scrollDOM.scrollTop&&(e.inputState.lastScrollTop||e.inputState.lastScrollLeft)&&(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),_U(e)},QH.blur=e=>{e.observer.clearSelectionRange(),_U(e)},QH.compositionstart=QH.compositionupdate=e=>{if(!e.observer.editContext&&(e.inputState.compositionFirstChange??(e.inputState.compositionFirstChange=!0),e.inputState.composing<0)){let{main:t}=e.state.selection;!t.empty&&e.lineBlockAt(t.from).from!=e.lineBlockAt(t.to).from&&e.dispatch({changes:e.state.selection.ranges.filter(e=>!e.empty).map(e=>({from:e.from,to:e.to})),userEvent:`input`}),e.inputState.composing=0}},QH.compositionend=e=>{e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,Z.chrome&&Z.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))},QH.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()},ZH.beforeinput=(e,t)=>{if((t.inputType==`insertText`||t.inputType==`insertCompositionText`)&&(e.inputState.insertingText=t.data,e.inputState.insertingTextAt=Date.now()),t.inputType==`insertReplacementText`&&e.observer.editContext){let n=t.dataTransfer?.getData(`text/plain`),r=t.getTargetRanges();if(n&&r.length){let t=r[0];return AH(e,{from:e.posAtDOM(t.startContainer,t.startOffset),to:e.posAtDOM(t.endContainer,t.endOffset),insert:e.state.toText(n)},null),!0}}let n;if(Z.chrome&&Z.android&&(n=BH.find(e=>e.inputType==t.inputType))&&(e.observer.delayAndroidKey(n.key,n.keyCode),n.key==`Backspace`||n.key==`Delete`)){let t=window.visualViewport?.height||0;setTimeout(()=>{(window.visualViewport?.height||0)>t+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return Z.ios&&t.inputType==`deleteContentForward`&&e.observer.flushSoon(),Z.safari&&t.inputType==`insertText`&&e.inputState.composing>=0&&setTimeout(()=>QH.compositionend(e,t),20),!1};var vU=new Set;function yU(e){vU.has(e)||(vU.add(e),e.addEventListener(`copy`,()=>{}),e.addEventListener(`cut`,()=>{}))}var bU=[`pre-wrap`,`normal`,`pre-line`,`break-spaces`],xU=!1;function SU(){xU=!1}var CU=class{constructor(e){this.lineWrapping=e,this.doc=gL.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return bU.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];r<0?n++:this.heightSamples[Math.floor(r*10)]||(t=!0,this.heightSamples[Math.floor(r*10)]=!0)}return t}refresh(e,t,n,r,i,a){let o=bU.indexOf(e)>-1,s=Math.abs(t-this.lineHeight)>.3||this.lineWrapping!=o;if(this.lineWrapping=o,this.lineHeight=t,this.charWidth=n,this.textHeight=r,this.lineLength=i,s){this.heightSamples={};for(let e=0;e<a.length;e++){let t=a[e];t<0?e++:this.heightSamples[Math.floor(t*10)]=!0}}return s}},wU=class{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}},TU=class e{constructor(e,t,n,r,i){this.from=e,this.length=t,this.top=n,this.height=r,this._content=i}get type(){return typeof this._content==`number`?Lz.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof Bz?this._content.widget:null}get widgetLineBreaks(){return typeof this._content==`number`?this._content:0}join(t){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(t._content)?t._content:[t]);return new e(this.from,this.length+t.length,this.top,this.height+t.height,n)}},EU=(function(e){return e[e.ByPos=0]=`ByPos`,e[e.ByHeight=1]=`ByHeight`,e[e.ByPosNoHeight=2]=`ByPosNoHeight`,e})(EU||={}),DU=.001,OU=class e{constructor(e,t,n=2){this.length=e,this.height=t,this.flags=n}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>DU&&(xU=!0),this.height=e)}replace(t,n,r){return e.of(r)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,r){let i=this,a=n.doc;for(let o=r.length-1;o>=0;o--){let{fromA:s,toA:c,fromB:l,toB:u}=r[o],d=i.lineAt(s,EU.ByPosNoHeight,n.setDoc(t),0,0),f=d.to>=c?d:i.lineAt(c,EU.ByPosNoHeight,n,0,0);for(u+=f.to-c,c=f.to;o>0&&d.from<=r[o-1].toA;)s=r[o-1].fromA,l=r[o-1].fromB,o--,s<d.from&&(d=i.lineAt(s,EU.ByPosNoHeight,n,0,0));l+=d.from-s,s=d.from;let p=LU.build(n.setDoc(a),e,l,u);i=kU(i,i.replace(s,c,p))}return i.updateHeight(n,0)}static empty(){return new MU(0,0,0)}static of(t){if(t.length==1)return t[0];let n=0,r=t.length,i=0,a=0;for(;;)if(n==r){if(i>a*2){let e=t[n-1];e.break?t.splice(--n,1,e.left,null,e.right):t.splice(--n,1,e.left,e.right),r+=1+e.break,i-=e.size}else if(a>i*2){let e=t[r];e.break?t.splice(r,1,e.left,null,e.right):t.splice(r,1,e.left,e.right),r+=2+e.break,a-=e.size}else break}else if(i<a){let e=t[n++];e&&(i+=e.size)}else{let e=t[--r];e&&(a+=e.size)}let o=!1;return t[n-1]==null?(o=!0,n--):t[n]??(o=!0,r++),new PU(e.of(t.slice(0,n)),o,e.of(t.slice(r)))}};function kU(e,t){return e==t?e:(e.constructor!=t.constructor&&(xU=!0),t)}OU.prototype.size=1;var AU=Q.replace({}),jU=class extends OU{constructor(e,t,n){super(e,t),this.deco=n,this.spaceAbove=0}mainBlock(e,t){return new TU(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,t,n,r){return this.spaceAbove&&e<n+this.spaceAbove?new TU(r,0,n,this.spaceAbove,AU):this.mainBlock(n,r)}lineAt(e,t,n,r,i){let a=this.mainBlock(r,i);return this.spaceAbove?this.blockAt(0,n,r,i).join(a):a}forEachLine(e,t,n,r,i,a){e<=i+this.length&&t>=i&&a(this.lineAt(0,EU.ByPos,n,r,i))}setMeasuredHeight(e){let t=e.heights[e.index++];t<0?(this.spaceAbove=-t,t=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(t)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}},MU=class e extends jU{constructor(e,t,n){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=n}mainBlock(e,t){return new TU(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(t,n,r){let i=r[0];return r.length==1&&(i instanceof e||i instanceof NU&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof NU?i=new e(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):OU.of(r)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more?this.setMeasuredHeight(r):(n||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:``}${this.widgetHeight?`:`+this.widgetHeight:``})`}},NU=class e extends OU{constructor(e){super(e,0)}heightMetrics(e,t){let n=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,i=r-n+1,a,o=0;if(e.lineWrapping){let t=Math.min(this.height,e.lineHeight*i);a=t/i,this.length>i+1&&(o=(this.height-t)/(this.length-i-1))}else a=this.height/i;return{firstLine:n,lastLine:r,perLine:a,perChar:o}}blockAt(e,t,n,r){let{firstLine:i,lastLine:a,perLine:o,perChar:s}=this.heightMetrics(t,r);if(t.lineWrapping){let i=r+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length)),a=t.doc.lineAt(i),c=o+a.length*s,l=Math.max(n,e-c/2);return new TU(a.from,a.length,l,c,0)}{let r=Math.max(0,Math.min(a-i,Math.floor((e-n)/o))),{from:s,length:c}=t.doc.line(i+r);return new TU(s,c,n+o*r,o,0)}}lineAt(e,t,n,r,i){if(t==EU.ByHeight)return this.blockAt(e,n,r,i);if(t==EU.ByPosNoHeight){let{from:t,to:r}=n.doc.lineAt(e);return new TU(t,r-t,0,0,0)}let{firstLine:a,perLine:o,perChar:s}=this.heightMetrics(n,i),c=n.doc.lineAt(e),l=o+c.length*s,u=c.number-a,d=r+o*u+s*(c.from-i-u);return new TU(c.from,c.length,Math.max(r,Math.min(d,r+this.height-l)),l,0)}forEachLine(e,t,n,r,i,a){e=Math.max(e,i),t=Math.min(t,i+this.length);let{firstLine:o,perLine:s,perChar:c}=this.heightMetrics(n,i);for(let l=e,u=r;l<=t;){let t=n.doc.lineAt(l);if(l==e){let n=t.number-o;u+=s*n+c*(e-i-n)}let r=s+c*t.length;a(new TU(t.from,t.length,u,r,0)),u+=r,l=t.to+1}}replace(t,n,r){let i=this.length-n;if(i>0){let t=r[r.length-1];t instanceof e?r[r.length-1]=new e(t.length+i):r.push(null,new e(i-1))}if(t>0){let n=r[0];n instanceof e?r[0]=new e(t+n.length):r.unshift(new e(t-1),null)}return OU.of(r)}decomposeLeft(t,n){n.push(new e(t-1),null)}decomposeRight(t,n){n.push(null,new e(this.length-t-1))}updateHeight(t,n=0,r=!1,i){let a=n+this.length;if(i&&i.from<=n+this.length&&i.more){let r=[],o=Math.max(n,i.from),s=-1;for(i.from>n&&r.push(new e(i.from-n-1).updateHeight(t,n));o<=a&&i.more;){let e=t.doc.lineAt(o).length;r.length&&r.push(null);let n=i.heights[i.index++],a=0;n<0&&(a=-n,n=i.heights[i.index++]),s==-1?s=n:Math.abs(n-s)>=DU&&(s=-2);let c=new MU(e,n,a);c.outdated=!1,r.push(c),o+=e+1}o<=a&&r.push(null,new e(a-o).updateHeight(t,o));let c=OU.of(r);return(s<0||Math.abs(c.height-this.height)>=DU||Math.abs(s-this.heightMetrics(t,n).perLine)>=DU)&&(xU=!0),kU(this,c)}return(r||this.outdated)&&(this.setHeight(t.heightForGap(n,n+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}},PU=class extends OU{constructor(e,t,n){super(e.length+ +!!t+n.length,e.height+n.height,+!!t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return this.flags&1}blockAt(e,t,n,r){let i=n+this.left.height;return e<i?this.left.blockAt(e,t,n,r):this.right.blockAt(e,t,i,r+this.left.length+this.break)}lineAt(e,t,n,r,i){let a=r+this.left.height,o=i+this.left.length+this.break,s=t==EU.ByHeight?e<a:e<o,c=s?this.left.lineAt(e,t,n,r,i):this.right.lineAt(e,t,n,a,o);if(this.break||(s?c.to<o:c.from>o))return c;let l=t==EU.ByPosNoHeight?EU.ByPosNoHeight:EU.ByPos;return s?c.join(this.right.lineAt(o,l,n,a,o)):this.left.lineAt(o,l,n,r,i).join(c)}forEachLine(e,t,n,r,i,a){let o=r+this.left.height,s=i+this.left.length+this.break;if(this.break)e<s&&this.left.forEachLine(e,t,n,r,i,a),t>=s&&this.right.forEachLine(e,t,n,o,s,a);else{let c=this.lineAt(s,EU.ByPos,n,r,i);e<c.from&&this.left.forEachLine(e,Math.min(t,c.from-1),n,r,i,a),c.to>=e&&c.from<=t&&a(c),t>c.to&&this.right.forEachLine(Math.max(e,c.to+1),t,n,o,s,a)}}replace(e,t,n){let r=this.left.length+this.break;if(t<r)return this.balanced(this.left.replace(e,t,n),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,n));let i=[];e>0&&this.decomposeLeft(e,i);let a=i.length;for(let e of n)i.push(e);if(e>0&&FU(i,a-1),t<this.length){let e=i.length;this.decomposeRight(t,i),FU(i,e)}return OU.of(i)}decomposeLeft(e,t){let n=this.left.length;if(e<=n)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(n++,e>=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,r=n+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e<n&&this.left.decomposeRight(e,t),this.break&&e<r&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?OU.of(this.break?[e,null,t]:[e,t]):(this.left=kU(this.left,e),this.right=kU(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,r){let{left:i,right:a}=this,o=t+i.length+this.break,s=null;return r&&r.from<=t+i.length&&r.more?s=i=i.updateHeight(e,t,n,r):i.updateHeight(e,t,n),r&&r.from<=o+a.length&&r.more?s=a=a.updateHeight(e,o,n,r):a.updateHeight(e,o,n),s?this.balanced(i,a):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?` `:`-`)+this.right}};function FU(e,t){let n,r;e[t]==null&&(n=e[t-1])instanceof NU&&(r=e[t+1])instanceof NU&&e.splice(t-1,3,new NU(n.length+1+r.length))}var IU=5,LU=class e{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let e=Math.min(t,this.lineEnd),n=this.nodes[this.nodes.length-1];n instanceof MU?n.length+=e-this.pos:(e>this.pos||!this.isCovered)&&this.nodes.push(new MU(e-this.pos,-1,0)),this.writtenTo=e,t>e&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e<t||n.heightRelevant){let r=n.widget?n.widget.estimatedHeight:0,i=n.widget?n.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let a=t-e;n.block?this.addBlock(new jU(a,r,n)):(a||i||r>=IU)&&this.addLineDeco(r,i,a)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new MU(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let n=new NU(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof MU)return e;let t=new MU(0,-1,0);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos+=e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let r=this.ensureLine();r.length+=n,r.collapsed+=n,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=t,this.writtenTo=this.pos+=n}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof MU)&&!this.isCovered?this.nodes.push(new MU(0,-1,0)):(this.writtenTo<this.pos||t==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let n=e;for(let e of this.nodes)e instanceof MU&&e.updateHeight(this.oracle,n),n+=e?e.length:1;return this.nodes}static build(t,n,r,i){let a=new e(r,t);return VR.spans(n,r,i,a,0),a.finish(r)}};function RU(e,t,n){let r=new zU;return VR.compare(e,t,n,r,0),r.changes}var zU=class{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,n,r){(e<t||n&&n.heightRelevant||r&&r.heightRelevant)&&Uz(e,t,this.changes,5)}};function BU(e,t){let n=e.getBoundingClientRect(),r=e.ownerDocument,i=r.defaultView||window,a=Math.max(0,n.left),o=Math.min(i.innerWidth,n.right),s=Math.max(0,n.top),c=Math.min(i.innerHeight,n.bottom);for(let t=e.parentNode;t&&t!=r.body;)if(t.nodeType==1){let n=t,r=window.getComputedStyle(n);if((n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)&&r.overflow!=`visible`){let r=n.getBoundingClientRect();a=Math.max(a,r.left),o=Math.min(o,r.right),s=Math.max(s,r.top),c=Math.min(t==e.parentNode?i.innerHeight:c,r.bottom)}t=r.position==`absolute`||r.position==`fixed`?n.offsetParent:n.parentNode}else if(t.nodeType==11)t=t.host;else break;return{left:a-n.left,right:Math.max(a,o)-n.left,top:s-(n.top+t),bottom:Math.max(s,c)-(n.top+t)}}function VU(e){let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView||window;return t.left<n.innerWidth&&t.right>0&&t.top<n.innerHeight&&t.bottom>0}function HU(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}var UU=class{constructor(e,t,n,r){this.from=e,this.to=t,this.size=n,this.displaySize=r}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.from!=i.from||r.to!=i.to||r.size!=i.size)return!1}return!0}draw(e,t){return Q.replace({widget:new WU(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}},WU=class extends Iz{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement(`div`);return this.vertical?e.style.height=this.size+`px`:(e.style.width=this.size+`px`,e.style.height=`2px`,e.style.display=`inline-block`),e}get estimatedHeight(){return this.vertical?this.size:-1}},GU=class{constructor(e,t){this.view=e,this.state=t,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=ZU,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=yB.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let n=t.facet(uV).some(e=>typeof e!=`function`&&e.class==`cm-lineWrapping`);this.heightOracle=new CU(n),this.stateDeco=QU(t),this.heightMap=OU.empty().applyChanges(this.stateDeco,gL.empty,this.heightOracle.setDoc(t.doc),[new bV(0,0,0,t.doc.length)]);for(let e=0;e<2&&(this.viewport=this.getViewport(0,null),this.updateForViewport());e++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Q.set(this.lineGaps.map(e=>e.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let r=n?t.head:t.anchor;if(!e.some(({from:e,to:t})=>r>=e&&r<=t)){let{from:t,to:n}=this.lineBlockAt(r);e.push(new KU(t,n))}}return this.viewports=e.sort((e,t)=>e.from-t.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?ZU:new $U(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(eW(e,this.scaler))})}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=QU(this.state);let r=e.changedRanges,i=bV.extendWithRanges(r,RU(n,this.stateDeco,e?e.changes:IL.empty(this.state.doc.length))),a=this.heightMap.height,o=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);SU(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),i),(this.heightMap.height!=a||xU)&&(e.flags|=2),o?(this.scrollAnchorPos=e.changes.mapPos(o.from,-1),this.scrollAnchorHeight=o.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=a);let s=i.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<s.from||t.range.head>s.to)||!this.viewportIsAppropriate(s))&&(s=this.getViewport(0,t));let c=s.from!=this.viewport.from||s.to!=this.viewport.to;this.viewport=s,e.flags|=this.updateForViewport(),(c||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(QB)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,t=e.contentDOM,n=window.getComputedStyle(t),r=this.heightOracle,i=n.whiteSpace;this.defaultTextDirection=n.direction==`rtl`?yB.RTL:yB.LTR;let a=this.heightOracle.mustRefreshForWrapping(i)||this.mustMeasureContent===`refresh`,o=t.getBoundingClientRect(),s=a||this.mustMeasureContent||this.contentDOMHeight!=o.height;this.contentDOMHeight=o.height,this.mustMeasureContent=!1;let c=0,l=0;if(o.width&&o.height){let{scaleX:e,scaleY:n}=nB(t,o);(e>.005&&Math.abs(this.scaleX-e)>.005||n>.005&&Math.abs(this.scaleY-n)>.005)&&(this.scaleX=e,this.scaleY=n,c|=16,a=s=!0)}let u=(parseInt(n.paddingTop)||0)*this.scaleY,d=(parseInt(n.paddingBottom)||0)*this.scaleY;(this.paddingTop!=u||this.paddingBottom!=d)&&(this.paddingTop=u,this.paddingBottom=d,c|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(s=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=16);let f=iB(this.view.contentDOM,!1).y;f!=this.scrollParent&&(this.scrollParent=f,this.scrollAnchorHeight=-1,this.scrollOffset=0);let p=this.getScrollOffset();this.scrollOffset!=p&&(this.scrollAnchorHeight=-1,this.scrollOffset=p),this.scrolledToBottom=hB(this.scrollParent||e.win);let m=(this.printing?HU:BU)(t,this.paddingTop),h=m.top-this.pixelViewport.top,g=m.bottom-this.pixelViewport.bottom;this.pixelViewport=m;let _=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(_!=this.inView&&(this.inView=_,_&&(s=!0)),!this.inView&&!this.scrollTarget&&!VU(e.dom))return 0;let v=o.width;if((this.contentDOMWidth!=v||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=o.width,this.editorHeight=e.scrollDOM.clientHeight,c|=16),s){let t=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(t)&&(a=!0),a||r.lineWrapping&&Math.abs(v-this.contentDOMWidth)>r.charWidth){let{lineHeight:n,charWidth:o,textHeight:s}=e.docView.measureTextSize();a=n>0&&r.refresh(i,n,o,s,Math.max(5,v/o),t),a&&(e.docView.minWidth=0,c|=16)}h>0&&g>0?l=Math.max(h,g):h<0&&g<0&&(l=Math.min(h,g)),SU();for(let n of this.viewports){let i=n.from==this.viewport.from?t:e.docView.measureVisibleLineHeights(n);this.heightMap=(a?OU.empty().applyChanges(this.stateDeco,gL.empty,this.heightOracle,[new bV(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,a,new wU(n.from,i))}xU&&(c|=2)}let y=!this.viewportIsAppropriate(this.viewport,l)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return y&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(l,this.scrollTarget),c|=this.updateForViewport()),(c&2||y)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,i=this.heightOracle,{visibleTop:a,visibleBottom:o}=this,s=new KU(r.lineAt(a-n*1e3,EU.ByHeight,i,0,0).from,r.lineAt(o+(1-n)*1e3,EU.ByHeight,i,0,0).to);if(t){let{head:e}=t.range;if(e<s.from||e>s.to){let n=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),a=r.lineAt(e,EU.ByPos,i,0,0),o;o=t.y==`center`?(a.top+a.bottom)/2-n/2:t.y==`start`||t.y==`nearest`&&e<s.from?a.top:a.bottom-n,s=new KU(r.lineAt(o-500,EU.ByHeight,i,0,0).from,r.lineAt(o+n+500,EU.ByHeight,i,0,0).to)}}return s}mapViewport(e,t){let n=t.mapPos(e.from,-1),r=t.mapPos(e.to,1);return new KU(this.heightMap.lineAt(n,EU.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,EU.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},n=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,EU.ByPos,this.heightOracle,0,0),{bottom:i}=this.heightMap.lineAt(t,EU.ByPos,this.heightOracle,0,0),{visibleTop:a,visibleBottom:o}=this;return(e==0||r<=a-Math.max(10,Math.min(-n,250)))&&(t==this.state.doc.length||i>=o+Math.max(10,Math.min(n,250)))&&r>a-2e3&&i<o+2e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let n=[];for(let r of e)t.touchesRange(r.from,r.to)||n.push(new UU(t.mapPos(r.from),t.mapPos(r.to),r.size,r.displaySize));return n}ensureLineGaps(e,t){let n=this.heightOracle.lineWrapping,r=n?1e4:2e3,i=r>>1,a=r<<1;if(this.defaultTextDirection!=yB.LTR&&!n)return[];let o=[],s=(r,a,c,l)=>{if(a-r<i)return;let u=this.state.selection.main,d=[u.from];u.empty||d.push(u.to);for(let e of d)if(e>r&&e<a){s(r,e-10,c,l),s(e+10,a,c,l);return}let f=XU(e,e=>e.from>=c.from&&e.to<=c.to&&Math.abs(e.from-r)<i&&Math.abs(e.to-a)<i&&!d.some(t=>e.from<t&&e.to>t));if(!f){if(a<c.to&&t&&n&&t.visibleRanges.some(e=>e.from<=a&&e.to>=a)){let e=t.moveToLineBoundary(Y.cursor(a),!1,!0).head;e>r&&(a=e)}let e=this.gapSize(c,r,a,l);f=new UU(r,a,e,n||e<2e6?e:2e6)}o.push(f)},c=t=>{if(t.length<a||t.type!=Lz.Text)return;let i=qU(t.from,t.to,this.stateDeco);if(i.total<a)return;let o=this.scrollTarget?this.scrollTarget.range.head:null,c,l;if(n){let e=r/this.heightOracle.lineLength*this.heightOracle.lineHeight,n,a;if(o!=null){let r=YU(i,o),s=((this.visibleBottom-this.visibleTop)/2+e)/t.height;n=r-s,a=r+s}else n=(this.visibleTop-t.top-e)/t.height,a=(this.visibleBottom-t.top+e)/t.height;c=JU(i,n),l=JU(i,a)}else{let n=i.total*this.heightOracle.charWidth,a=r*this.heightOracle.charWidth,s=0;if(n>2e6)for(let n of e)n.from>=t.from&&n.from<t.to&&n.size!=n.displaySize&&n.from*this.heightOracle.charWidth+s<this.pixelViewport.left&&(s=n.size-n.displaySize);let u=this.pixelViewport.left+s,d=this.pixelViewport.right+s,f,p;if(o!=null){let e=YU(i,o),t=((d-u)/2+a)/n;f=e-t,p=e+t}else f=(u-a)/n,p=(d+a)/n;c=JU(i,f),l=JU(i,p)}c>t.from&&s(t.from,c,t,i),l<t.to&&s(l,t.to,t,i)};for(let e of this.viewportLines)Array.isArray(e.type)?e.type.forEach(c):c(e);return o}gapSize(e,t,n,r){let i=YU(r,n)-YU(r,t);return this.heightOracle.lineWrapping?e.height*i:r.total*this.heightOracle.charWidth*i}updateLineGaps(e){UU.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=Q.set(e.map(e=>e.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let n=[];VR.spans(t,this.viewport.from,this.viewport.to,{span(e,t){n.push({from:e,to:t})},point(){}},20);let r=0;if(n.length!=this.visibleRanges.length)r=12;else for(let t=0;t<n.length&&!(r&8);t++){let i=this.visibleRanges[t],a=n[t];(i.from!=a.from||i.to!=a.to)&&(r|=4,e&&e.mapPos(i.from,-1)==a.from&&e.mapPos(i.to,1)==a.to||(r|=8))}return this.visibleRanges=n,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||eW(this.heightMap.lineAt(e,EU.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||eW(this.heightMap.lineAt(this.scaler.fromDOM(e),EU.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop*this.scaleY:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return eW(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}},KU=class{constructor(e,t){this.from=e,this.to=t}};function qU(e,t,n){let r=[],i=e,a=0;return VR.spans(n,e,t,{span(){},point(e,t){e>i&&(r.push({from:i,to:e}),a+=e-i),i=t}},20),i<t&&(r.push({from:i,to:t}),a+=t-i),{total:a,ranges:r}}function JU({total:e,ranges:t},n){if(n<=0)return t[0].from;if(n>=1)return t[t.length-1].to;let r=Math.floor(e*n);for(let e=0;;e++){let{from:n,to:i}=t[e],a=i-n;if(r<=a)return n+r;r-=a}}function YU(e,t){let n=0;for(let{from:r,to:i}of e.ranges){if(t<=i){n+=t-r;break}n+=i-r}return n/e.total}function XU(e,t){for(let n of e)if(t(n))return n}var ZU={toDOM(e){return e},fromDOM(e){return e},scale:1,eq(e){return e==this}};function QU(e){let t=e.facet(dV).filter(e=>typeof e!=`function`),n=e.facet(pV).filter(e=>typeof e!=`function`);return n.length&&t.push(VR.join(n)),t}var $U=class e{constructor(e,t,n){let r=0,i=0,a=0;this.viewports=n.map(({from:n,to:i})=>{let a=t.lineAt(n,EU.ByPos,e,0,0).top,o=t.lineAt(i,EU.ByPos,e,0,0).bottom;return r+=o-a,{from:n,to:i,top:a,bottom:o,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(t.height-r);for(let e of this.viewports)e.domTop=a+(e.top-i)*this.scale,a=e.domBottom=e.domTop+(e.bottom-e.top),i=e.bottom}toDOM(e){for(let t=0,n=0,r=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.top)return r+(e-n)*this.scale;if(e<=i.bottom)return i.domTop+(e-i.top);n=i.bottom,r=i.domBottom}}fromDOM(e){for(let t=0,n=0,r=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.domTop)return n+(e-r)/this.scale;if(e<=i.domBottom)return i.top+(e-i.domTop);n=i.bottom,r=i.domBottom}}eq(t){return t instanceof e&&this.scale==t.scale&&this.viewports.length==t.viewports.length&&this.viewports.every((e,n)=>e.from==t.viewports[n].from&&e.to==t.viewports[n].to)}};function eW(e,t){if(t.scale==1)return e;let n=t.toDOM(e.top),r=t.toDOM(e.bottom);return new TU(e.from,e.length,n,r-n,Array.isArray(e._content)?e._content.map(e=>eW(e,t)):e._content)}var tW=X.define({combine:e=>e.join(` `)}),nW=X.define({combine:e=>e.indexOf(!0)>-1}),rW=sz.newName(),iW=sz.newName(),aW=sz.newName(),oW={"&light":`.`+iW,"&dark":`.`+aW};function sW(e,t,n){return new sz(t,{finish(t){return/&/.test(t)?t.replace(/&\w*/,t=>{if(t==`&`)return e;if(!n||!n[t])throw RangeError(`Unsupported selector: ${t}`);return n[t]}):e+` `+t}})}var cW=sW(`.`+rW,{"&":{position:`relative !important`,boxSizing:`border-box`,"&.cm-focused":{outline:`1px dotted #212121`},display:`flex !important`,flexDirection:`column`},".cm-scroller":{display:`flex !important`,alignItems:`flex-start !important`,fontFamily:`monospace`,lineHeight:1.4,height:`100%`,overflowX:`auto`,position:`relative`,zIndex:0,overflowAnchor:`none`},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:`block`,whiteSpace:`pre`,wordWrap:`normal`,boxSizing:`border-box`,minHeight:`100%`,padding:`4px 0`,outline:`none`,"&[contenteditable=true]":{WebkitUserModify:`read-write-plaintext-only`}},".cm-lineWrapping":{whiteSpace_fallback:`pre-wrap`,whiteSpace:`break-spaces`,wordBreak:`break-word`,overflowWrap:`anywhere`,flexShrink:1},"&light .cm-content":{caretColor:`black`},"&dark .cm-content":{caretColor:`white`},".cm-line":{display:`block`,padding:`0 2px 0 6px`},".cm-layer":{userSelect:`none`,position:`absolute`,left:0,top:0,contain:`size style`,"& > *":{position:`absolute`}},"&light .cm-selectionBackground":{background:`#d9d9d9`},"&dark .cm-selectionBackground":{background:`#222`},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:`#d7d4f0`},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:`#233`},".cm-cursorLayer":{pointerEvents:`none`},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:`steps(1) cm-blink 1.2s infinite`},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:`1.2px solid black`,marginLeft:`-0.6px`,pointerEvents:`none`},".cm-cursor":{display:`none`},"&dark .cm-cursor":{borderLeftColor:`#ddd`},".cm-selectionHandle":{backgroundColor:`currentColor`,width:`1.5px`},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:`""`,backgroundColor:`inherit`,borderRadius:`50%`,width:`8px`,height:`8px`,position:`absolute`,left:`-3.25px`},".cm-selectionHandle-start::before":{top:`-8px`},".cm-selectionHandle-end::before":{bottom:`-8px`},".cm-dropCursor":{position:`absolute`},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:`block`},".cm-iso":{unicodeBidi:`isolate`},".cm-announced":{position:`fixed`,top:`-10000px`},"@media print":{".cm-announced":{display:`none`}},"&light .cm-activeLine":{backgroundColor:`#cceeff44`},"&dark .cm-activeLine":{backgroundColor:`#99eeff33`},"&light .cm-specialChar":{color:`red`},"&dark .cm-specialChar":{color:`#f78`},".cm-gutters":{flexShrink:0,display:`flex`,height:`100%`,boxSizing:`border-box`,zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:`#f5f5f5`,color:`#6c6c6c`,border:`0px solid #ddd`,"&.cm-gutters-before":{borderRightWidth:`1px`},"&.cm-gutters-after":{borderLeftWidth:`1px`}},"&dark .cm-gutters":{backgroundColor:`#333338`,color:`#ccc`},".cm-gutter":{display:`flex !important`,flexDirection:`column`,flexShrink:0,boxSizing:`border-box`,minHeight:`100%`,overflow:`hidden`},".cm-gutterElement":{boxSizing:`border-box`},".cm-lineNumbers .cm-gutterElement":{padding:`0 3px 0 5px`,minWidth:`20px`,textAlign:`right`,whiteSpace:`nowrap`},"&light .cm-activeLineGutter":{backgroundColor:`#e2f2ff`},"&dark .cm-activeLineGutter":{backgroundColor:`#222227`},".cm-panels":{boxSizing:`border-box`,position:`sticky`,left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:`#f5f5f5`,color:`black`},".cm-panels-top":{top:`0`},".cm-panels-bottom":{bottom:`0`},"&light .cm-panels-top":{borderBottom:`1px solid #ddd`},"&light .cm-panels-bottom":{borderTop:`1px solid #ddd`},"&dark .cm-panels":{backgroundColor:`#333338`,color:`white`},".cm-dialog":{padding:`2px 19px 4px 6px`,position:`relative`,"& label":{fontSize:`80%`}},".cm-dialog-close":{position:`absolute`,top:`3px`,right:`4px`,backgroundColor:`inherit`,border:`none`,font:`inherit`,fontSize:`14px`,padding:`0`},".cm-tab":{display:`inline-block`,overflow:`hidden`,verticalAlign:`bottom`},".cm-widgetBuffer":{verticalAlign:`text-top`,height:`1em`,width:0,display:`inline`},".cm-placeholder":{color:`#888`,display:`inline-block`,verticalAlign:`top`,userSelect:`none`},".cm-highlightSpace":{background:`radial-gradient(circle at 50% 55%, #aaa 20%, transparent 0) no-repeat`,backgroundSize:`.4em`,backgroundPosition:`calc(min(50%, 0px)) center`},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:`auto 100%`,backgroundPosition:`right 90%`,backgroundRepeat:`no-repeat`},".cm-trailingSpace":{backgroundColor:`#ff332255`},".cm-button":{verticalAlign:`middle`,color:`inherit`,fontSize:`70%`,padding:`.2em 1em`,borderRadius:`1px`},"&light .cm-button":{backgroundImage:`linear-gradient(#eff1f5, #d9d9df)`,border:`1px solid #888`,"&:active":{backgroundImage:`linear-gradient(#b4b4b4, #d0d3d6)`}},"&dark .cm-button":{backgroundImage:`linear-gradient(#393939, #111)`,border:`1px solid #888`,"&:active":{backgroundImage:`linear-gradient(#111, #333)`}},".cm-textfield":{verticalAlign:`middle`,color:`inherit`,fontSize:`70%`,border:`1px solid silver`,padding:`.2em .5em`},"&light .cm-textfield":{backgroundColor:`white`},"&dark .cm-textfield":{border:`1px solid #555`,backgroundColor:`inherit`}},oW),lW={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},uW=Z.ie&&Z.ie_version<=11,dW=class{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new aB,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let e of t)this.queue.push(e);(Z.ie&&Z.ie_version<=11||Z.ios&&e.composing)&&t.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&Z.android&&e.constructor.EDIT_CONTEXT!==!1&&!(Z.chrome&&Z.chrome_version<126)&&(this.editContext=new hW(e),e.state.facet(iV)&&(e.contentDOM.editContext=this.editContext.editContext)),uW&&(this.onCharData=e=>{this.queue.push({target:e.target,type:`characterData`,oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia(`print`)),typeof ResizeObserver==`function`&&(this.resizeScroll=new ResizeObserver(()=>{this.view.docView?.lastUpdate<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver==`function`&&(this.intersection=new IntersectionObserver(e=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent(`Event`)))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(e=>{e.length>0&&e[e.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent(`Event`))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers(`scroll`,e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type!=`change`&&e.type||e.matches)&&(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,n)=>t!=e[n]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,r=this.selectionRange;if(n.state.facet(iV)?n.root.activeElement!=this.dom:!qz(this.dom,r))return;let i=r.anchorNode&&n.docView.tile.nearest(r.anchorNode);if(i&&i.isWidget()&&i.widget.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(Z.ie&&Z.ie_version<=11||Z.android&&Z.chrome)&&!n.state.selection.main.empty&&r.focusNode&&Yz(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=Gz(e.root);if(!t)return!1;let n=Z.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&mW(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let r=qz(this.dom,n);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&mB(this.dom,n)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(n),r&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let n=this.dom;n;)if(n.nodeType==1)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==n?e++:t||=this.scrollTargets.slice(0,e),t&&t.push(n),n=n.assignedSlot||n.parentNode;else if(n.nodeType==11)n=n.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let e of this.scrollTargets)e.removeEventListener(`scroll`,this.onScroll);for(let e of this.scrollTargets=t)e.addEventListener(`scroll`,this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||=(this.observer.observe(this.dom,lW),uW&&this.dom.addEventListener(`DOMCharacterDataModified`,this.onCharData),!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),uW&&this.dom.removeEventListener(`DOMCharacterDataModified`,this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){if(!this.delayedAndroidKey){let e=()=>{let e=this.delayedAndroidKey;e&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=e.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&e.force&&fB(this.dom,e.key,e.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(e)}(!this.delayedAndroidKey||e==`Enter`)&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!this.delayedAndroidKey?.force})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,r=!1;for(let i of e){let e=this.readMutation(i);e&&(e.typeOver&&(r=!0),t==-1?{from:t,to:n}=e:(t=Math.min(e.from,t),n=Math.max(e.to,n)))}return{from:t,to:n,typeOver:r}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),r=this.selectionChanged&&qz(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let i=new DH(this.view,e,t,n);return this.view.docView.domChanged={newSel:i.newSel?i.newSel.main:null},i}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let n=this.view.state,r=kH(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!FH(this.view.state.selection,t.newSel.main))&&this.view.update([]),r}readMutation(e){let t=this.view.docView.tile.nearest(e.target);if(!t||t.isWidget())return null;if(t.markDirty(e.type==`attributes`),e.type==`childList`){let n=fW(t,e.previousSibling||e.target.previousSibling,-1),r=fW(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}return e.type==`characterData`?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener(`resize`,this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener(`change`,this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener(`beforeprint`,this.onPrint),e.addEventListener(`scroll`,this.onScroll),e.document.addEventListener(`selectionchange`,this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener(`scroll`,this.onScroll),e.removeEventListener(`resize`,this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener(`change`,this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener(`beforeprint`,this.onPrint),e.document.removeEventListener(`selectionchange`,this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(iV)!=e.state.facet(iV)&&(e.view.contentDOM.editContext=e.state.facet(iV)?this.editContext.editContext:null))}destroy(){var e,t,n;this.stop(),(e=this.intersection)==null||e.disconnect(),(t=this.gapIntersection)==null||t.disconnect(),(n=this.resizeScroll)==null||n.disconnect();for(let e of this.scrollTargets)e.removeEventListener(`scroll`,this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}};function fW(e,t,n){for(;t;){let r=CV.get(t);if(r&&r.parent==e)return r;let i=t.parentNode;t=i==e.dom?n>0?t.nextSibling:t.previousSibling:i}return null}function pW(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.docView.domAtPos(e.state.selection.main.anchor,1);return Yz(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function mW(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return pW(e,n)}let n=null;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.contentDOM.addEventListener(`beforeinput`,r,!0),e.dom.ownerDocument.execCommand(`indent`),e.contentDOM.removeEventListener(`beforeinput`,r,!0),n?pW(e,n):null}var hW=class{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=n=>{let r=e.state.selection.main,{anchor:i,head:a}=r,o=this.toEditorPos(n.updateRangeStart),s=this.toEditorPos(n.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:n.updateRangeStart,editorBase:o,drifted:!1});let c=s-o>n.text.length;o==this.from&&i<this.from?o=i:s==this.to&&i>this.to&&(s=i);let l=MH(e.state.sliceDoc(o,s),n.text,(c?r.from:r.to)-o,c?`end`:null);if(!l){let t=Y.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));FH(t,r)||e.dispatch({selection:t,userEvent:`select`});return}let u={from:l.from+o,to:l.toA+o,insert:gL.of(n.text.slice(l.from,l.toB).split(`
24
- `))};if((Z.mac||Z.android)&&u.from==a-1&&/^\. ?$/.test(n.text)&&e.contentDOM.getAttribute(`autocorrect`)==`off`&&(u={from:o,to:s,insert:gL.of([n.text.replace(`.`,` `)])}),this.pendingContextChange=u,!e.state.readOnly){let t=this.to-this.from+(u.to-u.from+u.insert.length);AH(e,u,Y.single(this.toEditorPos(n.selectionStart,t),this.toEditorPos(n.selectionEnd,t)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),u.from<u.to&&!u.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,n.updateRangeStart-1),Math.min(t.text.length,n.updateRangeStart+1)))&&this.handlers.compositionend(n)},this.handlers.characterboundsupdate=n=>{let r=[],i=null;for(let t=this.toEditorPos(n.rangeStart),a=this.toEditorPos(n.rangeEnd);t<a;t++){let n=e.coordsForChar(t);i=n&&new DOMRect(n.left,n.top,n.right-n.left,n.bottom-n.top)||i||new DOMRect,r.push(i)}t.updateCharacterBounds(n.rangeStart,r)},this.handlers.textformatupdate=t=>{let n=[];for(let e of t.getTextFormats()){let t=e.underlineStyle,r=e.underlineThickness;if(!/none/i.test(t)&&!/none/i.test(r)){let i=this.toEditorPos(e.rangeStart),a=this.toEditorPos(e.rangeEnd);if(i<a){let e=`text-decoration: underline ${/^[a-z]/.test(t)?t+` `:t==`Dashed`?`dashed `:t==`Squiggle`?`wavy `:``}${/thin/i.test(r)?1:2}px`;n.push(Q.mark({attributes:{style:e}}).range(i,a))}}}e.dispatch({effects:nV.of(Q.set(n))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:t}=this.composing;this.composing=null,t&&this.reset(e.state)}};for(let e in this.handlers)t.addEventListener(e,this.handlers[e]);this.measureReq={read:e=>{let t=Gz(e.root);t&&t.rangeCount&&this.editContext.updateSelectionBounds(t.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,r=this.pendingContextChange;return e.changes.iterChanges((i,a,o,s,c)=>{if(n)return;let l=c.length-(a-i);if(r&&a>=r.to){if(r.from==i&&r.to==a&&r.insert.eq(c)){r=this.pendingContextChange=null,t+=l,this.to+=l;return}r=null,this.revertPending(e.state)}if(i+=t,a+=t,a<=this.from)this.from+=l,this.to+=l;else if(i<this.to){if(i<this.from||a>this.to||this.to-this.from+c.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(i),this.toContextPos(a),c.toString()),this.to+=l}t+=l}),r&&!n&&this.revertPending(e.state),!n}update(e){let t=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(e=>!e.isUserEvent(`input.type`)&&e.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(n,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>3e4)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}},$=class e{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.clearAnnouncement=-1,this.contentDOM=document.createElement(`div`),this.scrollDOM=document.createElement(`div`),this.scrollDOM.tabIndex=-1,this.scrollDOM.className=`cm-scroller`,this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement(`div`),this.announceDOM.className=`cm-announced`,this.announceDOM.setAttribute(`aria-live`,`polite`),this.dom=document.createElement(`div`),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:t}=e;this.dispatchTransactions=e.dispatchTransactions||t&&(e=>e.forEach(e=>t(e,this)))||(e=>this.update(e)),this.dispatch=this.dispatch.bind(this),this._root=e.root||pB(e.parent)||document,this.viewState=new GU(this,e.state||PR.create(e)),e.scrollTo&&e.scrollTo.is(tV)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(oV).map(e=>new cV(e));for(let e of this.plugins)e.update(this);this.observer=new dW(this),this.inputState=new IH(this),this.inputState.ensureHandlers(this.plugins),this.docView=new XV(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),document.fonts?.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent=`refresh`,this.requestMeasure()})}dispatch(...e){let t=e.length==1&&e[0]instanceof bR?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(t){if(this.updateState!=0)throw Error(`Calls to EditorView.update are not allowed while an update is in progress`);let n=!1,r=!1,i,a=this.state;for(let e of t){if(e.startState!=a)throw RangeError(`Trying to update state with a transaction that doesn't start from the previous state.`);a=e.state}if(this.destroyed){this.viewState.state=a;return}let o=this.hasFocus,s=0,c=null;t.some(e=>e.annotation(hU))?(this.inputState.notifiedFocused=o,s=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,c=gU(a,o),c||(s=1));let l=this.observer.delayedAndroidKey,u=null;if(l?(this.observer.clearDelayedAndroidKey(),u=this.observer.readChange(),(u&&!this.state.doc.eq(a.doc)||!this.state.selection.eq(a.selection))&&(u=null)):this.observer.clear(),a.facet(PR.phrases)!=this.state.facet(PR.phrases))return this.setState(a);i=xV.create(this,a,t),i.flags|=s;let d=this.viewState.scrollTarget;try{this.updateState=2;for(let n of t){if(d&&=d.map(n.changes),n.scrollIntoView){let{main:t}=n.state.selection,{x:r,y:i}=this.state.facet(e.cursorScrollMargin);d=new eV(t.empty?t:Y.cursor(t.head,t.head>t.anchor?-1:1),`nearest`,`nearest`,i,r)}for(let e of n.effects)e.is(tV)&&(d=e.value.clip(this.state))}this.viewState.update(i,d),this.bidiCache=vW.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(yV)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(n,t.some(e=>e.isUserEvent(`select.pointer`)))}finally{this.updateState=0}if(i.startState.facet(tW)!=i.state.facet(tW)&&(this.viewState.mustMeasureContent=!0),(n||r||d||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!i.empty)for(let e of this.state.facet(KB))try{e(i)}catch(e){rV(this.state,e,`update listener`)}(c||u)&&Promise.resolve().then(()=>{c&&this.state==c.startState&&this.dispatch(c),u&&!kH(this,u)&&l.force&&fB(this.contentDOM,l.key,l.keyCode)})}setState(e){if(this.updateState!=0)throw Error(`Calls to EditorView.setState are not allowed while an update is in progress`);if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let e of this.plugins)e.destroy(this);this.viewState=new GU(this,e),this.plugins=e.facet(oV).map(e=>new cV(e)),this.pluginMap.clear();for(let e of this.plugins)e.update(this);this.docView.destroy(),this.docView=new XV(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(oV),n=e.state.facet(oV);if(t!=n){let r=[];for(let i of n){let n=t.indexOf(i);if(n<0)r.push(new cV(i));else{let t=this.plugins[n];t.mustUpdate=e,r.push(t)}}for(let t of this.plugins)t.mustUpdate!=e&&t.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let t of this.plugins)t.mustUpdate=e;for(let e=0;e<this.plugins.length;e++)this.plugins[e].update(this);t!=n&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(e){rV(this.state,e,`doc view update listener`)}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.viewState.scrollParent,r=this.viewState.getScrollOffset(),{scrollAnchorPos:i,scrollAnchorHeight:a,scaleY:o}=this.viewState;Math.abs(r-this.viewState.scrollOffset)>1&&(a=-1),this.viewState.scrollAnchorHeight=-1;try{for(let e=0;;e++){if(a<0){if(hB(n||this.win))i=-1,a=this.viewState.heightMap.height/this.viewState.scaleY;else{let e=this.viewState.scrollAnchorAt(r);i=e.from,a=e.top}o=this.viewState.scaleY}this.updateState=1;let s=this.viewState.measure();if(!s&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(e>5){console.warn(this.measureRequests.length?`Measure loop restarted more than 5 times`:`Viewport failed to stabilize`);break}let c=[];s&4||([this.measureRequests,c]=[c,this.measureRequests]);let l=c.map(e=>{try{return e.read(this)}catch(e){return rV(this.state,e),_W}}),u=xV.create(this,this.state,[]),d=!1;u.flags|=s,t?t.flags|=s:t=u,this.updateState=2,u.empty||(this.updatePlugins(u),this.inputState.update(u),this.updateAttrs(),d=this.docView.update(u),d&&this.docViewUpdate());for(let e=0;e<c.length;e++)if(l[e]!=_W)try{let t=c[e];t.write&&t.write(l[e],this)}catch(e){rV(this.state,e)}if(d&&this.docView.updateSelection(!0),!u.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight){if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,a=-1;continue}{let e=(i<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(i).top)/this.viewState.scaleY-a/o;if((e>1||e<-1)&&!(Z.ios&&this.inputState.lastIOSMomentumScroll>Date.now()-100)&&(n==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){r+=e,n?i<0?n.scrollTop=n.scrollHeight:n.scrollTop+=e:this.win.scrollBy(0,e),a=-1;continue}}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let e of this.state.facet(KB))e(t)}get themeClasses(){return rW+` `+(this.state.facet(nW)?aW:iW)+` `+this.state.facet(tW)}updateAttrs(){let e=yW(this,lV,{class:`cm-editor`+(this.hasFocus?` cm-focused `:` `)+this.themeClasses}),t={spellcheck:`false`,autocorrect:`off`,autocapitalize:`off`,writingsuggestions:`false`,translate:`no`,contenteditable:this.state.facet(iV)?`true`:`false`,class:`cm-content`,style:`${Z.tabSize}: ${this.state.tabSize}`,role:`textbox`,"aria-multiline":`true`};this.state.readOnly&&(t[`aria-readonly`]=`true`),yW(this,uV,t);let n=this.observer.ignore(()=>{let n=Pz(this.contentDOM,this.contentAttrs,t),r=Pz(this.dom,this.editorAttrs,e);return n||r});return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(t){let n=!0;for(let r of t)for(let t of r.effects)if(t.is(e.announce)){n&&=(this.announceDOM.textContent=``,this.win.clearTimeout(this.clearAnnouncement),this.clearAnnouncement=this.win.setTimeout(()=>{this.announceDOM.textContent=`\xA0`},200),!1);let e=this.announceDOM.appendChild(document.createElement(`div`));e.textContent=t.value}}mountStyles(){this.styleModules=this.state.facet(yV);let t=this.state.facet(e.cspNonce);sz.mount(this.root,this.styleModules.concat(cW).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(this.updateState==2)throw Error(`Reading the editor layout isn't allowed during an update`);this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(t===void 0||t&&t.plugin!=e)&&this.pluginMap.set(e,t=this.plugins.find(t=>t.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,n){return vH(this,e,pH(this,e,t,n))}moveByGroup(e,t){return vH(this,e,pH(this,e,t,t=>mH(this,e.head,t)))}visualLineSide(e,t){return t?Y.cursor(e.to,1):Y.cursor(e.from,-1)}moveToLineBoundary(e,t,n=!0){return fH(this,e,t,n)}moveVertically(e,t,n){return vH(this,e,hH(this,e,t,n))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let n=bH(this,e,t);return n&&n.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),bH(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let n=this.state.doc.lineAt(e),r=this.bidiSpans(n),i=r[kB.find(r,e-n.from,-1,t)];return n.length&&(e==n.from&&t<0||e==n.to&&t>0)&&i.dir!=this.textDirectionAt(n.from)&&(e==n.to?(e=n.from+i.from,t=1):(e=n.from+i.to,t=-1)),this.docView.coordsAt(e,t,i.dir==yB.RTL)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(ZB)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>gW)return RB(e.length);let t=this.textDirectionAt(e.from),n;for(let r of this.bidiCache)if(r.from==e.from&&r.dir==t&&(r.fresh||AB(r.isolates,n=gV(this,e))))return r.order;n||=gV(this,e);let r=LB(e.text,t,n);return this.bidiCache.push(new vW(e.from,e.to,t,n,!0,r)),r}get hasFocus(){return(this.dom.ownerDocument.hasFocus()||Z.safari&&this.inputState?.lastContextMenu>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{lB(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.win.clearTimeout(this.clearAnnouncement),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return tV.of(new eV(typeof e==`number`?Y.cursor(e):e,t.y??`nearest`,t.x??`nearest`,t.yMargin??5,t.xMargin??5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return tV.of(new eV(Y.cursor(n.from),`start`,`start`,n.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e==`boolean`?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return sV.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return sV.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=sz.newName(),r=[tW.of(n),yV.of(sW(`.${n}`,e))];return t&&t.dark&&r.push(nW.of(!0)),r}static baseTheme(e){return tR.lowest(yV.of(sW(`.`+rW,e,oW)))}static findFromDOM(e){let t=e.querySelector(`.cm-content`);return(t&&CV.get(t)||CV.get(e))?.root?.view||null}};$.styleModule=yV,$.inputHandler=qB,$.clipboardInputFilter=YB,$.clipboardOutputFilter=XB,$.scrollHandler=$B,$.focusChangeEffect=JB,$.perLineTextDirection=ZB,$.exceptionSink=GB,$.updateListener=KB,$.editable=iV,$.mouseSelectionStyle=WB,$.dragMovesSelection=UB,$.clickAddsSelectionRange=HB,$.decorations=dV,$.blockWrappers=fV,$.outerDecorations=pV,$.atomicRanges=mV,$.bidiIsolatedRanges=hV,$.cursorScrollMargin=X.define({combine:e=>{let t=5,n=5;for(let r of e)typeof r==`number`?t=n=r:{x:t,y:n}=r;return{x:t,y:n}}}),$.scrollMargins=_V,$.darkTheme=nW,$.cspNonce=X.define({combine:e=>e.length?e[0]:``}),$.contentAttributes=uV,$.editorAttributes=lV,$.lineWrapping=$.contentAttributes.of({class:`cm-lineWrapping`}),$.announce=yR.define();var gW=4096,_W={},vW=class e{constructor(e,t,n,r,i,a){this.from=e,this.to=t,this.dir=n,this.isolates=r,this.fresh=i,this.order=a}static update(t,n){if(n.empty&&!t.some(e=>e.fresh))return t;let r=[],i=t.length?t[t.length-1].dir:yB.LTR;for(let a=Math.max(0,t.length-10);a<t.length;a++){let o=t[a];o.dir==i&&!n.touchesRange(o.from,o.to)&&r.push(new e(n.mapPos(o.from,1),n.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return r}};function yW(e,t,n){for(let r=e.state.facet(t),i=r.length-1;i>=0;i--){let t=r[i],a=typeof t==`function`?t(e):t;a&&Az(a,n)}return n}var bW=Z.mac?`mac`:Z.windows?`win`:Z.linux?`linux`:`key`;function xW(e,t){let n=e.split(/-(?!$)/),r=n[n.length-1];r==`Space`&&(r=` `);let i,a,o,s;for(let e=0;e<n.length-1;++e){let r=n[e];if(/^(cmd|meta|m)$/i.test(r))s=!0;else if(/^a(lt)?$/i.test(r))i=!0;else if(/^(c|ctrl|control)$/i.test(r))a=!0;else if(/^s(hift)?$/i.test(r))o=!0;else if(/^mod$/i.test(r))t==`mac`?s=!0:a=!0;else throw Error(`Unrecognized modifier name: `+r)}return i&&(r=`Alt-`+r),a&&(r=`Ctrl-`+r),s&&(r=`Meta-`+r),o&&(r=`Shift-`+r),r}function SW(e,t,n){return t.altKey&&(e=`Alt-`+e),t.ctrlKey&&(e=`Ctrl-`+e),t.metaKey&&(e=`Meta-`+e),n!==!1&&t.shiftKey&&(e=`Shift-`+e),e}var CW=tR.default($.domEventHandlers({keydown(e,t){return MW(EW(t.state),e,t,`editor`)}})),wW=X.define({enables:CW}),TW=new WeakMap;function EW(e){let t=e.facet(wW),n=TW.get(t);return n||TW.set(t,n=AW(t.reduce((e,t)=>e.concat(t),[]))),n}function DW(e,t,n){return MW(EW(e.state),t,e,n)}var OW=null,kW=4e3;function AW(e,t=bW){let n=Object.create(null),r=Object.create(null),i=(e,t)=>{let n=r[e];if(n==null)r[e]=t;else if(n!=t)throw Error(`Key binding `+e+` is used both as a regular binding and as a multi-stroke prefix`)},a=(e,r,a,o,s)=>{let c=n[e]||(n[e]=Object.create(null)),l=r.split(/ (?!$)/).map(e=>xW(e,t));for(let t=1;t<l.length;t++){let n=l.slice(0,t).join(` `);i(n,!0),c[n]||(c[n]={preventDefault:!0,stopPropagation:!1,run:[t=>{let r=OW={view:t,prefix:n,scope:e};return setTimeout(()=>{OW==r&&(OW=null)},kW),!0}]})}let u=l.join(` `);i(u,!1);let d=c[u]||(c[u]={preventDefault:!1,stopPropagation:!1,run:(c._any?.run)?.slice()||[]});a&&d.run.push(a),o&&(d.preventDefault=!0),s&&(d.stopPropagation=!0)};for(let r of e){let e=r.scope?r.scope.split(` `):[`editor`];if(r.any)for(let t of e){let e=n[t]||(n[t]=Object.create(null));e._any||={preventDefault:!1,stopPropagation:!1,run:[]};let{any:i}=r;for(let t in e)e[t].run.push(e=>i(e,jW))}let i=r[t]||r.key;if(i)for(let t of e)a(t,i,r.run,r.preventDefault,r.stopPropagation),r.shift&&a(t,`Shift-`+i,r.shift,r.preventDefault,r.stopPropagation)}return n}var jW=null;function MW(e,t,n,r){jW=t;let i=gz(t),a=ML(AL(i,0))==i.length&&i!=` `,o=``,s=!1,c=!1,l=!1;OW&&OW.view==n&&OW.scope==r&&(o=OW.prefix+` `,HH.indexOf(t.keyCode)<0&&(c=!0,OW=null));let u=new Set,d=e=>{if(e){for(let t of e.run)if(!u.has(t)&&(u.add(t),t(n)))return e.stopPropagation&&(l=!0),!0;e.preventDefault&&(e.stopPropagation&&(l=!0),c=!0)}return!1},f=e[r],p,m;return f&&(d(f[o+SW(i,t,!a)])?s=!0:a&&(t.altKey||t.metaKey||t.ctrlKey)&&!(Z.windows&&t.ctrlKey&&t.altKey)&&!(Z.mac&&t.altKey&&!(t.ctrlKey||t.metaKey))&&(p=uz[t.keyCode])&&p!=i?(d(f[o+SW(p,t,!0)])||t.shiftKey&&(m=dz[t.keyCode])!=i&&m!=p&&d(f[o+SW(m,t,!1)]))&&(s=!0):a&&t.shiftKey&&d(f[o+SW(i,t,!0)])&&(s=!0),!s&&d(f._any)&&(s=!0)),c&&(s=!0),s&&l&&t.stopPropagation(),jW=null,s}var NW=class e{constructor(e,t,n,r,i){this.className=e,this.left=t,this.top=n,this.width=r,this.height=i}draw(){let e=document.createElement(`div`);return e.className=this.className,this.adjust(e),e}update(e,t){return t.className==this.className&&(this.adjust(e),!0)}adjust(e){e.style.left=this.left+`px`,e.style.top=this.top+`px`,this.width!=null&&(e.style.width=this.width+`px`),e.style.height=this.height+`px`}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(t,n,r){if(r.empty){let i=t.coordsAtPos(r.head,r.assoc||1);if(!i)return[];let a=PW(t);return[new e(n,i.left-a.left,i.top-a.top,null,i.bottom-i.top)]}return IW(t,n,r)}};function PW(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==yB.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function FW(e,t,n,r){let i=e.coordsAtPos(t,n*2);if(!i)return r;let a=e.dom.getBoundingClientRect(),o=(i.top+i.bottom)/2,s=e.posAtCoords({x:a.left+1,y:o}),c=e.posAtCoords({x:a.right-1,y:o});return s==null||c==null?r:{from:Math.max(r.from,Math.min(s,c)),to:Math.min(r.to,Math.max(s,c))}}function IW(e,t,n){if(n.to<=e.viewport.from||n.from>=e.viewport.to)return[];let r=Math.max(n.from,e.viewport.from),i=Math.min(n.to,e.viewport.to),a=e.textDirection==yB.LTR,o=e.contentDOM,s=o.getBoundingClientRect(),c=PW(e),l=o.querySelector(`.cm-line`),u=l&&window.getComputedStyle(l),d=s.left+(u?parseInt(u.paddingLeft)+Math.min(0,parseInt(u.textIndent)):0),f=s.right-(u?parseInt(u.paddingRight):0),p=dH(e,r,1),m=dH(e,i,-1),h=p.type==Lz.Text?p:null,g=m.type==Lz.Text?m:null;if(h&&(e.lineWrapping||p.widgetLineBreaks)&&(h=FW(e,r,1,h)),g&&(e.lineWrapping||m.widgetLineBreaks)&&(g=FW(e,i,-1,g)),h&&g&&h.from==g.from&&h.to==g.to)return v(y(n.from,n.to,h));{let t=h?y(n.from,null,h):b(p,!1),r=g?y(null,n.to,g):b(m,!0),i=[];return(h||p).to<(g||m).from-(h&&g?1:0)||p.widgetLineBreaks>1&&t.bottom+e.defaultLineHeight/2<r.top?i.push(_(d,t.bottom,f,r.top)):t.bottom<r.top&&e.elementAtHeight((t.bottom+r.top)/2).type==Lz.Text&&(t.bottom=r.top=(t.bottom+r.top)/2),v(t).concat(i).concat(v(r))}function _(e,n,r,i){return new NW(t,e-c.left,n-c.top,Math.max(0,r-e),i-n)}function v({top:e,bottom:t,horizontal:n}){let r=[];for(let i=0;i<n.length;i+=2)r.push(_(n[i],e,n[i+1],t));return r}function y(t,n,r){let i=1e9,o=-1e9,s=[];function c(t,n,c,l,u){let p=e.coordsAtPos(t,t==r.to?-2:2),m=e.coordsAtPos(c,c==r.from?2:-2);p&&m&&(i=Math.min(p.top,m.top,i),o=Math.max(p.bottom,m.bottom,o),u==yB.LTR?s.push(a&&n?d:p.left,a&&l?f:m.right):s.push(!a&&l?d:m.left,!a&&n?f:p.right))}let l=t??r.from,u=n??r.to;for(let r of e.visibleRanges)if(r.to>l&&r.from<u)for(let i=Math.max(r.from,l),a=Math.min(r.to,u);;){let r=e.state.doc.lineAt(i);for(let o of e.bidiSpans(r)){let e=o.from+r.from,s=o.to+r.from;if(e>=a)break;s>i&&c(Math.max(e,i),t==null&&e<=l,Math.min(s,a),n==null&&s>=u,o.dir)}if(i=r.to+1,i>=a)break}return s.length==0&&c(l,t==null,u,n==null,e.textDirection),{top:i,bottom:o,horizontal:s}}function b(e,t){let n=s.top+(t?e.top:e.bottom);return{top:n,bottom:n,horizontal:[]}}}function LW(e,t){return e.constructor==t.constructor&&e.eq(t)}var RW=class{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement(`div`)),this.dom.classList.add(`cm-layer`),t.above&&this.dom.classList.add(`cm-layer-above`),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute(`aria-hidden`,`true`),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(zW)!=e.state.facet(zW)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,n=e.facet(zW);for(;t<n.length&&n[t]!=this.layer;)t++;this.dom.style.zIndex=String((this.layer.above?150:-1)-t)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:t}=this.view;(e!=this.scaleX||t!=this.scaleY)&&(this.scaleX=e,this.scaleY=t,this.dom.style.transform=`scale(${1/e}, ${1/t})`)}draw(e){if(e.length!=this.drawn.length||e.some((e,t)=>!LW(e,this.drawn[t]))){let t=this.dom.firstChild,n=0;for(let r of e)r.update&&t&&r.constructor&&this.drawn[n].constructor&&r.update(t,this.drawn[n])?(t=t.nextSibling,n++):this.dom.insertBefore(r.draw(),t);for(;t;){let e=t.nextSibling;t.remove(),t=e}this.drawn=e,Z.webkit&&(this.dom.style.display=this.dom.firstChild?``:`none`)}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}},zW=X.define();function BW(e){return[sV.define(t=>new RW(t,e)),zW.of(e)]}var VW=X.define({combine(e){return FR(e,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function HW(e={}){return[VW.of(e),WW,KW,JW,QB.of(!0)]}function UW(e){return e.startState.facet(VW)!=e.state.facet(VW)}var WW=BW({above:!0,markers(e){let{state:t}=e,n=t.facet(VW),r=[];for(let i of t.selection.ranges){let a=i==t.selection.main;if(i.empty||n.drawRangeCursor&&!(a&&Z.ios&&n.iosSelectionHandles)){let t=a?`cm-cursor cm-cursor-primary`:`cm-cursor cm-cursor-secondary`,n=i.empty?i:Y.cursor(i.head,i.assoc);for(let i of NW.forRange(e,t,n))r.push(i)}}return r},update(e,t){e.transactions.some(e=>e.selection)&&(t.style.animationName=t.style.animationName==`cm-blink`?`cm-blink2`:`cm-blink`);let n=UW(e);return n&&GW(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){GW(t.state,e)},class:`cm-cursorLayer`});function GW(e,t){t.style.animationDuration=e.facet(VW).cursorBlinkRate+`ms`}var KW=BW({above:!1,markers(e){let t=[],{main:n,ranges:r}=e.state.selection;for(let n of r)if(!n.empty)for(let r of NW.forRange(e,`cm-selectionBackground`,n))t.push(r);if(Z.ios&&!n.empty&&e.state.facet(VW).iosSelectionHandles){for(let r of NW.forRange(e,`cm-selectionHandle cm-selectionHandle-start`,Y.cursor(n.from,1)))t.push(r);for(let r of NW.forRange(e,`cm-selectionHandle cm-selectionHandle-end`,Y.cursor(n.to,1)))t.push(r)}return t},update(e,t){return e.docChanged||e.selectionSet||e.viewportChanged||UW(e)},class:`cm-selectionLayer`}),qW=Z.gecko&&Z.gecko_version==153?`#ffffff01`:`transparent`,JW=tR.highest($.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:`${qW} !important`},caretColor:`transparent !important`},".cm-content":{caretColor:`transparent !important`,"& :focus":{caretColor:`initial !important`,"&::selection, & ::selection":{backgroundColor:`Highlight !important`}}}})),YW=yR.define({map(e,t){return e==null?null:t.mapPos(e)}}),XW=QL.define({create(){return null},update(e,t){return e!=null&&(e=t.changes.mapPos(e)),t.effects.reduce((e,t)=>t.is(YW)?t.value:e,e)}}),ZW=sV.fromClass(class{constructor(e){this.view=e,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(e){var t;let n=e.state.field(XW);n==null?this.cursor!=null&&((t=this.cursor)==null||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement(`div`)),this.cursor.className=`cm-dropCursor`),(e.startState.field(XW)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(XW),n=t!=null&&e.coordsAtPos(t);if(!n)return null;let r=e.scrollDOM.getBoundingClientRect();return{left:n.left-r.left+e.scrollDOM.scrollLeft*e.scaleX,top:n.top-r.top+e.scrollDOM.scrollTop*e.scaleY,height:n.bottom-n.top}}drawCursor(e){if(this.cursor){let{scaleX:t,scaleY:n}=this.view;e?(this.cursor.style.left=e.left/t+`px`,this.cursor.style.top=e.top/n+`px`,this.cursor.style.height=e.height/n+`px`):this.cursor.style.left=`-100000px`}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(e){this.view.state.field(XW)!=e&&this.view.dispatch({effects:YW.of(e)})}},{eventObservers:{dragover(e){this.setDropPos(this.view.posAtCoords({x:e.clientX,y:e.clientY}))},dragleave(e){(e.target==this.view.contentDOM||!this.view.contentDOM.contains(e.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function QW(){return[XW,ZW]}function $W(e,t,n,r,i){t.lastIndex=0;for(let a=e.iterRange(n,r),o=n,s;!a.next().done;o+=a.value.length)if(!a.lineBreak)for(;s=t.exec(a.value);)i(o+s.index,s)}function eG(e,t){let n=e.visibleRanges;if(n.length==1&&n[0].from==e.viewport.from&&n[0].to==e.viewport.to)return n;let r=[];for(let{from:i,to:a}of n)i=Math.max(e.state.doc.lineAt(i).from,i-t),a=Math.min(e.state.doc.lineAt(a).to,a+t),r.length&&r[r.length-1].to>=i?r[r.length-1].to=a:r.push({from:i,to:a});return r}var tG=class{constructor(e){let{regexp:t,decoration:n,decorate:r,boundary:i,maxLength:a=1e3}=e;if(!t.global)throw RangeError(`The regular expression given to MatchDecorator should have its 'g' flag set`);if(this.regexp=t,r)this.addMatch=(e,t,n,i)=>r(i,n,n+e[0].length,e,t);else if(typeof n==`function`)this.addMatch=(e,t,r,i)=>{let a=n(e,t,r);a&&i(r,r+e[0].length,a)};else if(n)this.addMatch=(e,t,r,i)=>i(r,r+e[0].length,n);else throw RangeError(`Either 'decorate' or 'decoration' should be provided to MatchDecorator`);this.boundary=i,this.maxLength=a}createDeco(e){let t=new WR,n=t.add.bind(t);for(let{from:t,to:r}of eG(e,this.maxLength))$W(e.state.doc,this.regexp,t,r,(t,r)=>this.addMatch(r,e,t,n));return t.finish()}updateDeco(e,t){let n=1e9,r=-1;return e.docChanged&&e.changes.iterChanges((t,i,a,o)=>{o>=e.view.viewport.from&&a<=e.view.viewport.to&&(n=Math.min(a,n),r=Math.max(o,r))}),e.viewportMoved||r-n>1e3?this.createDeco(e.view):r>-1?this.updateRange(e.view,t.map(e.changes),n,r):t}updateRange(e,t,n,r){for(let i of e.visibleRanges){let a=Math.max(i.from,n),o=Math.min(i.to,r);if(o>=a){let n=e.state.doc.lineAt(a),r=n.to<o?e.state.doc.lineAt(o):n,s=Math.max(i.from,n.from),c=Math.min(i.to,r.to);if(this.boundary){for(;a>n.from;a--)if(this.boundary.test(n.text[a-1-n.from])){s=a;break}for(;o<r.to;o++)if(this.boundary.test(r.text[o-r.from])){c=o;break}}let l=[],u,d=(e,t,n)=>l.push(n.range(e,t));if(n==r)for(this.regexp.lastIndex=s-n.from;(u=this.regexp.exec(n.text))&&u.index<c-n.from;)this.addMatch(u,e,u.index+n.from,d);else $W(e.state.doc,this.regexp,s,c,(t,n)=>this.addMatch(n,e,t,d));t=t.update({filterFrom:s,filterTo:c,filter:(e,t)=>e<s||t>c,add:l})}}return t}},nG=/x/.unicode==null?`g`:`gu`,rG=RegExp(`[\0-\b
25
- --Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩-]`,nG),iG={0:`null`,7:`bell`,8:`backspace`,10:`newline`,11:`vertical tab`,13:`carriage return`,27:`escape`,8203:`zero width space`,8204:`zero width non-joiner`,8205:`zero width joiner`,8206:`left-to-right mark`,8207:`right-to-left mark`,8232:`line separator`,8237:`left-to-right override`,8238:`right-to-left override`,8294:`left-to-right isolate`,8295:`right-to-left isolate`,8297:`pop directional isolate`,8233:`paragraph separator`,65279:`zero width no-break space`,65532:`object replacement`},aG=null;function oG(){if(aG==null&&typeof document<`u`&&document.body){let e=document.body.style;aG=(e.tabSize??e.MozTabSize)!=null}return aG||!1}var sG=X.define({combine(e){let t=FR(e,{render:null,specialChars:rG,addSpecialChars:null});return(t.replaceTabs=!oG())&&(t.specialChars=RegExp(` |`+t.specialChars.source,nG)),t.addSpecialChars&&(t.specialChars=RegExp(t.specialChars.source+`|`+t.addSpecialChars.source,nG)),t}});function cG(e={}){return[sG.of(e),uG()]}var lG=null;function uG(){return lG||=sV.fromClass(class{constructor(e){this.view=e,this.decorations=Q.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(sG)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new tG({regexp:e.specialChars,decoration:(t,n,r)=>{let{doc:i}=n.state,a=AL(t[0],0);if(a==9){let e=i.lineAt(r),t=n.state.tabSize,a=tz(e.text,t,r-e.from);return Q.replace({widget:new mG((t-a%t)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[a]||(this.decorationCache[a]=Q.replace({widget:new pG(e,a)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(sG);e.startState.facet(sG)==t?this.decorations=this.decorator.updateDeco(e,this.decorations):(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view))}},{decorations:e=>e.decorations})}var dG=`•`;function fG(e){return e>=32?dG:e==10?`␤`:String.fromCharCode(9216+e)}var pG=class extends Iz{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=fG(this.code),n=e.state.phrase(`Control character`)+` `+(iG[this.code]||`0x`+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,n,t);if(r)return r;let i=document.createElement(`span`);return i.textContent=t,i.title=n,i.setAttribute(`aria-label`,n),i.className=`cm-specialChar`,i}ignoreEvent(){return!1}},mG=class extends Iz{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement(`span`);return e.textContent=` `,e.className=`cm-tab`,e.style.width=this.width+`px`,e}ignoreEvent(){return!1}};function hG(){return _G}var gG=Q.line({class:`cm-activeLine`}),_G=sV.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let r of e.state.selection.ranges){let i=e.lineBlockAt(r.head);i.from>t&&(n.push(gG.range(i.from)),t=i.from)}return Q.set(n)}},{decorations:e=>e.decorations}),vG=class extends Iz{constructor(e){super(),this.content=e}toDOM(e){let t=document.createElement(`span`);return t.className=`cm-placeholder`,t.style.pointerEvents=`none`,t.appendChild(typeof this.content==`string`?document.createTextNode(this.content):typeof this.content==`function`?this.content(e):this.content.cloneNode(!0)),t.setAttribute(`aria-hidden`,`true`),t}coordsAt(e){let t=e.firstChild?Jz(e.firstChild):[];if(!t.length)return null;let n=window.getComputedStyle(e.parentNode),r=eB(t[0],n.direction!=`rtl`),i=parseInt(n.lineHeight);return r.bottom-r.top>i*1.5?{left:r.left,right:r.right,top:r.top,bottom:r.top+i}:r}ignoreEvent(){return!1}};function yG(e){let t=sV.fromClass(class{constructor(t){this.view=t,this.placeholder=e?Q.set([Q.widget({widget:new vG(e),side:1}).range(0)]):Q.none}get decorations(){return this.view.state.doc.length?Q.none:this.placeholder}},{decorations:e=>e.decorations});return typeof e==`string`?[t,$.contentAttributes.of({"aria-placeholder":e})]:t}var bG=2e3;function xG(e,t,n){let r=Math.min(t.line,n.line),i=Math.max(t.line,n.line),a=[];if(t.off>bG||n.off>bG||t.col<0||n.col<0){let o=Math.min(t.off,n.off),s=Math.max(t.off,n.off);for(let t=r;t<=i;t++){let n=e.doc.line(t);n.length<=s&&a.push(Y.range(n.from+o,n.to+s))}}else{let o=Math.min(t.col,n.col),s=Math.max(t.col,n.col);for(let t=r;t<=i;t++){let n=e.doc.line(t),r=nz(n.text,o,e.tabSize,!0);if(r<0)a.push(Y.cursor(n.to));else{let t=nz(n.text,s,e.tabSize);a.push(Y.range(n.from+r,n.from+t))}}}return a}function SG(e,t){let n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}function CG(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1),r=e.state.doc.lineAt(n),i=n-r.from,a=i>bG?-1:i==r.length?SG(e,t.clientX):tz(r.text,e.state.tabSize,n-r.from);return{line:r.number,col:a,off:i}}function wG(e,t){let n=CG(e,t),r=e.state.selection;return n?{update(e){if(e.docChanged){let t=e.changes.mapPos(e.startState.doc.line(n.line).from),i=e.state.doc.lineAt(t);n={line:i.number,col:n.col,off:Math.min(n.off,i.length)},r=r.map(e.changes)}},get(t,i,a){let o=CG(e,t);if(!o)return r;let s=xG(e.state,n,o);return s.length?a?Y.create(s.concat(r.ranges)):Y.create(s):r}}:null}function TG(e){let t=e?.eventFilter||(e=>e.altKey&&e.button==0);return $.mouseSelectionStyle.of((e,n)=>t(n)?wG(e,n):null)}var EG={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},DG={style:`cursor: crosshair`};function OG(e={}){let[t,n]=EG[e.key||`Alt`],r=sV.fromClass(class{constructor(e){this.view=e,this.isDown=!1}set(e){this.isDown!=e&&(this.isDown=e,this.view.update([]))}},{eventObservers:{keydown(e){this.set(e.keyCode==t||n(e))},keyup(e){(e.keyCode==t||!n(e))&&this.set(!1)},mousemove(e){this.set(n(e))}}});return[r,$.contentAttributes.of(e=>e.plugin(r)?.isDown?DG:null)]}var kG=`-10000px`,AG=class{constructor(e,t,n,r){this.facet=t,this.createTooltipView=n,this.removeTooltipView=r,this.input=e.state.facet(t),this.tooltips=this.input.filter(e=>e);let i=null;this.tooltipViews=this.tooltips.map(e=>i=n(e,i))}update(e,t){var n;let r=e.state.facet(this.facet),i=r.filter(e=>e);if(r===this.input){for(let t of this.tooltipViews)t.update&&t.update(e);return!1}let a=[],o=t?[]:null;for(let n=0;n<i.length;n++){let r=i[n],s=-1;if(r){for(let e=0;e<this.tooltips.length;e++){let t=this.tooltips[e];t&&t.create==r.create&&(s=e)}if(s<0)a[n]=this.createTooltipView(r,n?a[n-1]:null),o&&(o[n]=!!r.above);else{let r=a[n]=this.tooltipViews[s];o&&(o[n]=t[s]),r.update&&r.update(e)}}}for(let e of this.tooltipViews)a.indexOf(e)<0&&(this.removeTooltipView(e),(n=e.destroy)==null||n.call(e));return t&&(o.forEach((e,n)=>t[n]=e),t.length=o.length),this.input=r,this.tooltips=i,this.tooltipViews=a,!0}};function jG(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}var MG=X.define({combine:e=>({position:Z.ios?`absolute`:e.find(e=>e.position)?.position||`fixed`,parent:e.find(e=>e.parent)?.parent||null,tooltipSpace:e.find(e=>e.tooltipSpace)?.tooltipSpace||jG})}),NG=new WeakMap,PG=sV.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(MG);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver==`function`?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new AG(e,RG,(e,t)=>this.createTooltip(e,t),e=>{this.resizeObserver&&this.resizeObserver.unobserve(e.dom),e.dom.remove()}),this.above=this.manager.tooltips.map(e=>!!e.above),this.intersectionObserver=typeof IntersectionObserver==`function`?new IntersectionObserver(e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener(`resize`,this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement(`div`),this.container.style.position=`relative`,this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,r=e.state.facet(MG);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let e of this.manager.tooltipViews)e.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let e of this.manager.tooltipViews)this.container.appendChild(e.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e,t){let n=e.create(this.view),r=t?t.dom:null;if(n.dom.classList.add(`cm-tooltip`),e.arrow&&!n.dom.querySelector(`.cm-tooltip > .cm-tooltip-arrow`)){let e=document.createElement(`div`);e.className=`cm-tooltip-arrow`,n.dom.appendChild(e)}return n.dom.style.position=this.position,n.dom.style.top=kG,n.dom.style.left=`0px`,this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var e,t,n;this.view.win.removeEventListener(`resize`,this.measureSoon);for(let t of this.manager.tooltipViews)t.dom.remove(),(e=t.destroy)==null||e.call(t);this.parent&&this.container.remove(),(t=this.resizeObserver)==null||t.disconnect(),(n=this.intersectionObserver)==null||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=1,t=1,n=!1;if(this.position==`fixed`&&this.manager.tooltipViews.length){let{dom:e}=this.manager.tooltipViews[0];if(Z.safari){let t=e.getBoundingClientRect();n=Math.abs(t.top+1e4)>1||Math.abs(t.left)>1}else n=!!e.offsetParent&&e.offsetParent!=this.container.ownerDocument.body}if(n||this.position==`absolute`){if(this.parent){let n=this.parent.getBoundingClientRect();n.width&&n.height&&(e=n.width/this.parent.offsetWidth,t=n.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState)}let r=this.view.scrollDOM.getBoundingClientRect(),i=vV(this.view);return{visible:{left:r.left+i.left,top:r.top+i.top,right:r.right-i.right,bottom:r.bottom-i.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((e,t)=>{let n=this.manager.tooltipViews[t];return n.getCoords?n.getCoords(e.pos):this.view.coordsAtPos(e.pos)}),size:this.manager.tooltipViews.map(({dom:e})=>e.getBoundingClientRect()),space:this.view.state.facet(MG).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(e){if(e.makeAbsolute){this.madeAbsolute=!0,this.position=`absolute`;for(let e of this.manager.tooltipViews)e.dom.style.position=`absolute`}let{visible:t,space:n,scaleX:r,scaleY:i}=e,a=[];for(let o=0;o<this.manager.tooltips.length;o++){let s=this.manager.tooltips[o],c=this.manager.tooltipViews[o],{dom:l}=c,u=e.pos[o],d=e.size[o];if(!u||s.clip!==!1&&(u.bottom<=Math.max(t.top,n.top)||u.top>=Math.min(t.bottom,n.bottom)||u.right<Math.max(t.left,n.left)-.1||u.left>Math.min(t.right,n.right)+.1)){l.style.top=kG;continue}let f=s.arrow?c.dom.querySelector(`.cm-tooltip-arrow`):null,p=f?7:0,m=d.right-d.left,h=NG.get(c)??d.bottom-d.top,g=c.offset||LG,_=this.view.textDirection==yB.LTR,v=d.width>n.right-n.left?_?n.left:n.right-d.width:_?Math.max(n.left,Math.min(u.left-(f?14:0)+g.x,n.right-m)):Math.min(Math.max(n.left,u.left-m+(f?14:0)-g.x),n.right-m),y=this.above[o];!s.strictSide&&(y?u.top-h-p-g.y<n.top:u.bottom+h+p+g.y>n.bottom)&&y==n.bottom-u.bottom>u.top-n.top&&(y=this.above[o]=!y);let b=(y?u.top-n.top:n.bottom-u.bottom)-p;if(b<h&&c.resize!==!1){if(b<this.view.defaultLineHeight){l.style.top=kG;continue}NG.set(c,h),l.style.height=(h=b)/i+`px`}else l.style.height&&(l.style.height=``);let x=y?u.top-h-p-g.y:u.bottom+p+g.y,S=v+m;if(c.overlap!==!0)for(let e of a)e.left<S&&e.right>v&&e.top<x+h&&e.bottom>x&&(x=y?e.top-h-2-p:e.bottom+p+2);if(this.position==`absolute`?(l.style.top=(x-e.parent.top)/i+`px`,FG(l,(v-e.parent.left)/r)):(l.style.top=x/i+`px`,FG(l,v/r)),f){let e=u.left+(_?g.x:-g.x)-(v+14-7);f.style.left=e/r+`px`}c.overlap!==!0&&a.push({left:v,top:x,right:S,bottom:x+h}),l.classList.toggle(`cm-tooltip-above`,y),l.classList.toggle(`cm-tooltip-below`,!y),c.positioned&&c.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let e of this.manager.tooltipViews)e.dom.style.top=kG}},{eventObservers:{scroll(){this.maybeMeasure()}}});function FG(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+`px`)}var IG=$.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:`border-box`},"&light .cm-tooltip":{border:`1px solid #bbb`,backgroundColor:`#f5f5f5`},"&light .cm-tooltip-section:not(:first-child)":{borderTop:`1px solid #bbb`},"&dark .cm-tooltip":{backgroundColor:`#333338`,color:`white`},".cm-tooltip-arrow":{height:`7px`,width:`14px`,position:`absolute`,zIndex:-1,overflow:`hidden`,"&:before, &:after":{content:`''`,position:`absolute`,width:0,height:0,borderLeft:`7px solid transparent`,borderRight:`7px solid transparent`},".cm-tooltip-above &":{bottom:`-7px`,"&:before":{borderTop:`7px solid #bbb`},"&:after":{borderTop:`7px solid #f5f5f5`,bottom:`1px`}},".cm-tooltip-below &":{top:`-7px`,"&:before":{borderBottom:`7px solid #bbb`},"&:after":{borderBottom:`7px solid #f5f5f5`,top:`1px`}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:`#333338`,borderBottomColor:`#333338`},"&:after":{borderTopColor:`transparent`,borderBottomColor:`transparent`}}}),LG={x:0,y:0},RG=X.define({enables:[PG,IG]}),zG=X.define({combine:e=>e.reduce((e,t)=>e.concat(t),[])}),BG=class e{static create(t){return new e(t)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement(`div`),this.dom.classList.add(`cm-tooltip-hover`),this.manager=new AG(e,zG,(e,t)=>this.createHostedView(e,t),e=>e.dom.remove())}createHostedView(e,t){let n=e.create(this.view);return n.dom.classList.add(`cm-tooltip-section`),this.dom.insertBefore(n.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&n.mount&&n.mount(this.view),n}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)==null||e.call(t)}passProp(e){let t;for(let n of this.manager.tooltipViews){let r=n[e];if(r!==void 0){if(t===void 0)t=r;else if(t!==r)return}}return t}get offset(){return this.passProp(`offset`)}get getCoords(){return this.passProp(`getCoords`)}get overlap(){return this.passProp(`overlap`)}get resize(){return this.passProp(`resize`)}},VG=RG.compute([zG],e=>{let t=e.facet(zG);return t.length===0?null:{pos:Math.min(...t.map(e=>e.pos)),end:Math.max(...t.map(e=>e.end??e.pos)),create:BG.create,above:t[0].above,arrow:t.some(e=>e.arrow)}}),HG=X.define(),UG=class{constructor(e,t,n,r,i,a){this.view=e,this.source=t,this.field=n,this.locked=r,this.setHover=i,this.hoverTime=a,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener(`mouseleave`,this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener(`mousemove`,this.mousemove=this.mousemove.bind(this))}update(e){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:t}=this,n=e.docView.tile.nearest(t.target);if(!n)return;let r,i=1;if(n.isWidget())r=n.posAtStart;else{if(r=e.posAtCoords(t),r==null)return;let n=e.coordsAtPos(r);if(!n||t.y<n.top||t.y>n.bottom||t.x<n.left-e.defaultCharacterWidth||t.x>n.right+e.defaultCharacterWidth)return;let a=e.bidiSpans(e.state.doc.lineAt(r)).find(e=>e.from<=r&&e.to>=r),o=a&&a.dir==yB.RTL?-1:1;i=t.x<n.left?-o:o}this.activateHover(e,r,i)}activateHover(e,t,n,r){let i=this.source(e,t,n),a=t=>{if(t&&(!Array.isArray(t)||t.length)){let n=Array.isArray(t)?t:[t];r&&this.locked.set(n,r),e.dispatch({effects:this.setHover.of(n)})}};if(i&&`then`in i){let n=this.pending={pos:t};i.then(e=>{this.pending==n&&(this.pending=null,a(e))},t=>rV(e.state,t,`hover tooltip`))}else a(i)}get tooltip(){let e=this.view.plugin(PG),t=e?e.manager.tooltips.findIndex(e=>e.create==BG.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:t,tooltip:n}=this;if(t.length&&!this.locked.has(t)&&n&&!GG(n.dom,e)||this.pending){let{pos:n}=t[0]||this.pending,r=t[0]?.end??n;(n==r?this.view.posAtCoords(this.lastMove)!=n:!KG(this.view,n,r,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length&&!this.locked.has(t)){let{tooltip:t}=this;t&&t.dom.contains(e.relatedTarget)?this.watchTooltipLeave(t.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=n=>{e.removeEventListener(`mouseleave`,t);let{active:r}=this;r.length&&!this.locked.has(r)&&!this.view.dom.contains(n.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener(`mouseleave`,t)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener(`mouseleave`,this.mouseleave),this.view.dom.removeEventListener(`mousemove`,this.mousemove)}},WG=4;function GG(e,t){let{left:n,right:r,top:i,bottom:a}=e.getBoundingClientRect(),o;if(o=e.querySelector(`.cm-tooltip-arrow`)){let e=o.getBoundingClientRect();i=Math.min(e.top,i),a=Math.max(e.bottom,a)}return t.clientX>=n-WG&&t.clientX<=r+WG&&t.clientY>=i-WG&&t.clientY<=a+WG}function KG(e,t,n,r,i,a){let o=e.scrollDOM.getBoundingClientRect(),s=e.documentTop+e.documentPadding.top+e.contentHeight;if(o.left>r||o.right<r||o.top>i||Math.min(o.bottom,s)<i)return!1;let c=e.posAtCoords({x:r,y:i},!1);return c>=t&&c<=n}function qG(e,t={}){let n=yR.define(),r=new WeakMap,i=QL.define({create(){return[]},update(e,a){let o=r.get(e);if(e.length&&(t.hideOnChange&&(a.docChanged||a.selection)||o&&o(a)?e=[]:t.hideOn&&(e=e.filter(e=>!t.hideOn(a,e)))),a.docChanged&&e.length){let t=[];for(let n of e){let e=a.changes.mapPos(n.pos,-1,PL.TrackDel);if(e!=null){let r=Object.assign(Object.create(null),n);r.pos=e,r.end!=null&&(r.end=a.changes.mapPos(r.end)),t.push(r)}}e=t}for(let t of a.effects)t.is(n)&&(e=t.value,o=void 0),(t.is(XG)&&!t.value||t.value==i)&&(e=[]);return e.length&&o&&r.set(e,o),e},provide:e=>zG.from(e)}),a=sV.define(a=>new UG(a,e,i,r,n,t.hoverTime||300));return{active:i,extension:[i,a,HG.of(a),VG]}}function JG(e,t,n,r={}){let i=e.state.facet(HG).map(t=>e.plugin(t)).filter(e=>!!e);if(r.tooltip&&r.tooltip.active){let e=i.find(e=>e.field==r.tooltip.active);e&&(i=[e])}for(let a of i)a.activateHover(e,t,n,r.until??(()=>!1))}function YG(e,t){let n=e.plugin(PG);if(!n)return null;let r=n.manager.tooltips.indexOf(t);return r<0?null:n.manager.tooltipViews[r]}var XG=yR.define(),ZG=X.define({combine(e){let t,n;for(let r of e)t||=r.topContainer,n||=r.bottomContainer;return{topContainer:t,bottomContainer:n}}});function QG(e,t){let n=e.plugin($G),r=n?n.specs.indexOf(t):-1;return r>-1?n.panels[r]:null}var $G=sV.fromClass(class{constructor(e){this.input=e.state.facet(nK),this.specs=this.input.filter(e=>e),this.panels=this.specs.map(t=>t(e));let t=e.state.facet(ZG);this.top=new eK(e,!0,t.topContainer),this.bottom=new eK(e,!1,t.bottomContainer),this.top.sync(this.panels.filter(e=>e.top)),this.bottom.sync(this.panels.filter(e=>!e.top));for(let e of this.panels)e.dom.classList.add(`cm-panel`),e.mount&&e.mount()}update(e){let t=e.state.facet(ZG);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new eK(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new eK(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(nK);if(n!=this.input){let t=n.filter(e=>e),r=[],i=[],a=[],o=[];for(let n of t){let t=this.specs.indexOf(n),s;t<0?(s=n(e.view),o.push(s)):(s=this.panels[t],s.update&&s.update(e)),r.push(s),(s.top?i:a).push(s)}this.specs=t,this.panels=r,this.top.sync(i),this.bottom.sync(a);for(let e of o)e.dom.classList.add(`cm-panel`),e.mount&&e.mount()}else for(let t of this.panels)t.update&&t.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>$.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})}),eK=class{constructor(e,t,n){this.view=e,this.top=t,this.container=n,this.dom=void 0,this.classes=``,this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&=(this.dom.remove(),void 0);return}if(!this.dom){this.dom=document.createElement(`div`),this.dom.className=this.top?`cm-panels cm-panels-top`:`cm-panels cm-panels-bottom`;let e=this.container||this.view.dom;e.insertBefore(this.dom,this.top?e.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=tK(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=tK(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(this.container&&this.classes!=this.view.themeClasses){for(let e of this.classes.split(` `))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(` `))e&&this.container.classList.add(e)}}};function tK(e){let t=e.nextSibling;return e.remove(),t}var nK=X.define({enables:$G});function rK(e,t){let n,r=new Promise(e=>n=e),i=e=>cK(e,t,n);e.state.field(aK,!1)?e.dispatch({effects:oK.of(i)}):e.dispatch({effects:yR.appendConfig.of(aK.init(()=>[i]))});let a=sK.of(i);return{close:a,result:r.then(t=>((e.win.queueMicrotask||(t=>e.win.setTimeout(t,10)))(()=>{e.state.field(aK).indexOf(i)>-1&&e.dispatch({effects:a})}),t))}}function iK(e,t){let n=e.state.field(aK,!1)||[];for(let r of n){let n=QG(e,r);if(n&&n.dom.classList.contains(t))return n}return null}var aK=QL.define({create(){return[]},update(e,t){for(let n of t.effects)n.is(oK)?e=[n.value].concat(e):n.is(sK)&&(e=e.filter(e=>e!=n.value));return e},provide:e=>nK.computeN([e],t=>t.field(e))}),oK=yR.define(),sK=yR.define();function cK(e,t,n){let r=t.content?t.content(e,()=>o(null)):null;if(!r){if(r=_z(`form`),t.input){let e=_z(`input`,t.input);/^(text|password|number|email|tel|url)$/.test(e.type)&&e.classList.add(`cm-textfield`),e.name||=`input`,r.appendChild(_z(`label`,(t.label||``)+`: `,e))}else r.appendChild(document.createTextNode(t.label||``));r.appendChild(document.createTextNode(` `)),r.appendChild(_z(`button`,{class:`cm-button`,type:`submit`},t.submitLabel||`OK`))}let i=r.nodeName==`FORM`?[r]:r.querySelectorAll(`form`);for(let e=0;e<i.length;e++){let t=i[e];t.addEventListener(`keydown`,e=>{e.keyCode==27?(e.preventDefault(),o(null)):e.keyCode==13&&(e.preventDefault(),o(t))}),t.addEventListener(`submit`,e=>{e.preventDefault(),o(t)})}let a=_z(`div`,r,_z(`button`,{onclick:()=>o(null),"aria-label":e.state.phrase(`close`),class:`cm-dialog-close`,type:`button`},[`×`]));t.class&&(a.className=t.class),a.classList.add(`cm-dialog`);function o(t){a.contains(a.ownerDocument.activeElement)&&e.focus(),n(t)}return{dom:a,top:t.top,mount:()=>{if(t.focus){let e;e=typeof t.focus==`string`?r.querySelector(t.focus):r.querySelector(`input`)||r.querySelector(`button`),e&&`select`in e?e.select():e&&`focus`in e&&e.focus()}}}}var lK=class extends IR{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}};lK.prototype.elementClass=``,lK.prototype.toDOM=void 0,lK.prototype.mapMode=PL.TrackBefore,lK.prototype.startSide=lK.prototype.endSide=-1,lK.prototype.point=!0;var uK=X.define(),dK=X.define(),fK={class:``,renderEmptyElements:!1,elementStyle:``,markers:()=>VR.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:`before`},pK=X.define();function mK(e){return[gK(),pK.of({...fK,...e})]}var hK=X.define({combine:e=>e.some(e=>e)});function gK(e){let t=[_K];return e&&e.fixed===!1&&t.push(hK.of(!0)),t}var _K=sV.fromClass(class{constructor(e){this.view=e,this.domAfter=null,this.prevViewport=e.viewport,this.dom=document.createElement(`div`),this.dom.className=`cm-gutters cm-gutters-before`,this.dom.setAttribute(`aria-hidden`,`true`),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+`px`,this.gutters=e.state.facet(pK).map(t=>new xK(e,t)),this.fixed=!e.state.facet(hK);for(let e of this.gutters)e.config.side==`after`?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position=`sticky`),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement(`div`),this.domAfter.className=`cm-gutters cm-gutters-after`,this.domAfter.setAttribute(`aria-hidden`,`true`),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+`px`,this.domAfter.style.position=this.fixed?`sticky`:``,this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(e){if(this.updateGutters(e)){let t=this.prevViewport,n=e.view.viewport,r=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}if(e.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+`px`;this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(hK)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?`sticky`:``,this.domAfter&&(this.domAfter.style.position=this.fixed?`sticky`:``)),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=VR.iter(this.view.state.facet(uK),this.view.viewport.from),r=[],i=this.gutters.map(e=>new bK(e,this.view.viewport,-this.view.documentPadding.top));for(let e of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(e.type)){let t=!0;for(let a of e.type)if(a.type==Lz.Text&&t){yK(n,r,a.from);for(let e of i)e.line(this.view,a,r);t=!1}else if(a.widget)for(let e of i)e.widget(this.view,a)}else if(e.type==Lz.Text){yK(n,r,e.from);for(let t of i)t.line(this.view,e,r)}else if(e.widget)for(let t of i)t.widget(this.view,e);for(let e of i)e.finish();e&&(this.view.scrollDOM.insertBefore(this.dom,t),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(e){let t=e.startState.facet(pK),n=e.state.facet(pK),r=e.docChanged||e.heightChanged||e.viewportChanged||!VR.eq(e.startState.facet(uK),e.state.facet(uK),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let t of this.gutters)t.update(e)&&(r=!0);else{r=!0;let i=[];for(let r of n){let n=t.indexOf(r);n<0?i.push(new xK(this.view,r)):(this.gutters[n].update(e),i.push(this.gutters[n]))}for(let e of this.gutters)e.dom.remove(),i.indexOf(e)<0&&e.destroy();for(let e of i)e.config.side==`after`?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.gutters=i}return r}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:e=>$.scrollMargins.of(t=>{let n=t.plugin(e);if(!n||n.gutters.length==0||!n.fixed)return null;let r=n.dom.offsetWidth*t.scaleX,i=n.domAfter?n.domAfter.offsetWidth*t.scaleX:0;return t.textDirection==yB.LTR?{left:r,right:i}:{right:r,left:i}})});function vK(e){return Array.isArray(e)?e:[e]}function yK(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}var bK=class{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=VR.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:r}=this,i=(t.top-this.height)/e.scaleY,a=t.height/e.scaleY;if(this.i==r.elements.length){let t=new SK(e,a,i,n);r.elements.push(t),r.dom.appendChild(t.dom)}else r.elements[this.i].update(e,a,i,n);this.height=t.bottom,this.i++}line(e,t,n){let r=[];yK(this.cursor,r,t.from),n.length&&(r=r.concat(n));let i=this.gutter.config.lineMarker(e,t,r);i&&r.unshift(i);let a=this.gutter;(r.length!=0||a.config.renderEmptyElements)&&this.addElement(e,t,r)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t),r=n?[n]:null;for(let n of e.state.facet(dK)){let i=n(e,t.widget,t);i&&(r||=[]).push(i)}r&&this.addElement(e,t,r)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}},xK=class{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement(`div`),this.dom.className=`cm-gutter`+(this.config.class?` `+this.config.class:``);for(let n in t.domEventHandlers)this.dom.addEventListener(n,r=>{let i=r.target,a;if(i!=this.dom&&this.dom.contains(i)){for(;i.parentNode!=this.dom;)i=i.parentNode;let e=i.getBoundingClientRect();a=(e.top+e.bottom)/2}else a=r.clientY;let o=e.lineBlockAtHeight(a-e.documentTop);t.domEventHandlers[n](e,o,r)&&r.preventDefault()});this.markers=vK(t.markers(e)),t.initialSpacer&&(this.spacer=new SK(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+=`visibility: hidden; pointer-events: none`)}update(e){let t=this.markers;if(this.markers=vK(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let t=this.config.updateSpacer(this.spacer.markers[0],e);t!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[t])}let n=e.view.viewport;return!VR.eq(this.markers,t,n.from,n.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}},SK=class{constructor(e,t,n,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement(`div`),this.dom.className=`cm-gutterElement`,this.update(e,t,n,r)}update(e,t,n,r){this.height!=t&&(this.height=t,this.dom.style.height=t+`px`),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+`px`:``),CK(this.markers,r)||this.setMarkers(e,r)}setMarkers(e,t){let n=`cm-gutterElement`,r=this.dom.firstChild;for(let i=0,a=0;;){let o=a,s=i<t.length?t[i++]:null,c=!1;if(s){let e=s.elementClass;e&&(n+=` `+e);for(let e=a;e<this.markers.length;e++)if(this.markers[e].compare(s)){o=e,c=!0;break}}else o=this.markers.length;for(;a<o;){let e=this.markers[a++];if(e.toDOM){e.destroy(r);let t=r.nextSibling;r.remove(),r=t}}if(!s)break;s.toDOM&&(c?r=r.nextSibling:this.dom.insertBefore(s.toDOM(e),r)),c&&a++}this.dom.className=n,this.markers=t}destroy(){this.setMarkers(null,[])}};function CK(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].compare(t[n]))return!1;return!0}var wK=X.define(),TK=X.define(),EK=X.define({combine(e){return FR(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let n=Object.assign({},e);for(let e in t){let r=n[e],i=t[e];n[e]=r?(e,t,n)=>r(e,t,n)||i(e,t,n):i}return n}})}}),DK=class extends lK{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}};function OK(e,t){return e.state.facet(EK).formatNumber(t,e.state)}var kK=pK.compute([EK],e=>({class:`cm-lineNumbers`,renderEmptyElements:!1,markers(e){return e.state.facet(wK)},lineMarker(e,t,n){return n.some(e=>e.toDOM)?null:new DK(OK(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,n)=>{for(let r of e.state.facet(TK)){let i=r(e,t,n);if(i)return i}return null},lineMarkerChange:e=>e.startState.facet(EK)!=e.state.facet(EK),initialSpacer(e){return new DK(OK(e,jK(e.state.doc.lines)))},updateSpacer(e,t){let n=OK(t.view,jK(t.view.state.doc.lines));return n==e.number?e:new DK(n)},domEventHandlers:e.facet(EK).domEventHandlers,side:`before`}));function AK(e={}){return[EK.of(e),gK(),kK]}function jK(e){let t=9;for(;t<e;)t=t*10+9;return t}var MK=new class extends lK{constructor(){super(...arguments),this.elementClass=`cm-activeLineGutter`}},NK=uK.compute([`selection`],e=>{let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.head).from;i>n&&(n=i,t.push(MK.range(i)))}return VR.of(t)});function PK(){return NK}var FK=new EF;function IK(e){return X.define({combine:e?t=>t.concat(e):void 0})}var LK=new EF,RK=class{constructor(e,t,n=[],r=``){this.data=e,this.name=r,PR.prototype.hasOwnProperty(`tree`)||Object.defineProperty(PR.prototype,"tree",{get(){return VK(this)}}),this.parser=t,this.extension=[XK.of(this),PR.languageData.of((e,t,n)=>{let r=zK(e,t,n),i=r.type.prop(FK);if(!i)return[];let a=e.facet(i),o=r.type.prop(LK);if(o){let i=r.resolve(t-r.from,n);for(let t of o)if(t.test(i,e)){let n=e.facet(t.facet);return t.type==`replace`?n:n.concat(a)}}return a})].concat(n)}isActiveAt(e,t,n=-1){return zK(e,t,n).type.prop(FK)==this.data}findRegions(e){let t=e.facet(XK);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],r=(e,t)=>{if(e.prop(FK)==this.data){n.push({from:t,to:t+e.length});return}let i=e.prop(EF.mounted);if(i){if(i.tree.prop(FK)==this.data){if(i.overlay)for(let e of i.overlay)n.push({from:e.from+t,to:e.to+t});else n.push({from:t,to:t+e.length});return}if(i.overlay){let e=n.length;if(r(i.tree,i.overlay[0].from+t),n.length>e)return}}for(let n=0;n<e.children.length;n++){let i=e.children[n];i instanceof PF&&r(i,e.positions[n]+t)}};return r(VK(e),0),n}get allowsNesting(){return!0}};RK.setState=yR.define();function zK(e,t,n){let r=e.facet(XK),i=VK(e).topNode;if(!r||r.allowsNesting)for(let e=i;e;e=e.enter(t,n,NF.ExcludeBuffers|NF.EnterBracketed))e.type.isTop&&(i=e);return i}var BK=class e extends RK{constructor(e,t,n){super(e,t,[],n),this.parser=t}static define(t){let n=IK(t.languageData);return new e(n,t.parser.configure({props:[FK.add(e=>e.isTop?n:void 0)]}),t.name)}configure(t,n){return new e(this.data,this.parser.configure(t),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}};function VK(e){let t=e.field(RK.state,!1);return t?t.tree:PF.empty}var HK=class{constructor(e){this.doc=e,this.cursorPos=0,this.string=``,this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e<n||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}},UK=null,WK=class e{constructor(e,t,n=[],r,i,a,o,s){this.parser=e,this.state=t,this.fragments=n,this.tree=r,this.treeLen=i,this.viewport=a,this.skipped=o,this.scheduleOn=s,this.parse=null,this.tempSkipped=[]}static create(t,n,r){return new e(t,n,[],PF.empty,0,r,[],null)}startParse(){return this.parser.startParse(new HK(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=PF.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{if(typeof e==`number`){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||=this.startParse(),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let n=this.parse.advance();if(n){if(this.fragments=this.withoutTempSkipped(eI.addTree(n,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=this.parse.stoppedAt??this.state.doc.length,this.tree=n,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0}if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(eI.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=UK;UK=this;try{return e()}finally{UK=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=GK(e,t.from,t.to);return e}changes(t,n){let{fragments:r,tree:i,treeLen:a,viewport:o,skipped:s}=this;if(this.takeTree(),!t.empty){let e=[];if(t.iterChangedRanges((t,n,r,i)=>e.push({fromA:t,toA:n,fromB:r,toB:i})),r=eI.applyChanges(r,e),i=PF.empty,a=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length){s=[];for(let e of this.skipped){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);n<r&&s.push({from:n,to:r})}}}return new e(this.parser,n,r,i,a,o,s,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let t=0;t<this.skipped.length;t++){let{from:n,to:r}=this.skipped[t];n<e.to&&r>e.from&&(this.fragments=GK(this.fragments,n,r),this.skipped.splice(t--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&=(this.takeTree(),null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends tI{createParse(t,n,r){let i=r[0].from,a=r[r.length-1].to;return{parsedPos:i,advance(){let t=UK;if(t){for(let e of r)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=a,new PF(kF.none,[],[],a-i)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return UK}};function GK(e,t,n){return eI.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}var KK=class e{constructor(e){this.context=e,this.tree=e.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(t.changes,t.state),r=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new e(n)}static init(t){let n=Math.min(3e3,t.doc.length),r=WK.create(t.facet(XK).parser,t,{from:0,to:n});return r.work(20,n)||r.takeTree(),new e(r)}};RK.state=QL.define({create:KK.init,update(e,t){for(let e of t.effects)if(e.is(RK.setState))return e.value;return t.startState.facet(XK)==t.state.facet(XK)?e.apply(t):KK.init(t.state)}});var qK=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<`u`&&(qK=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});var JK=typeof navigator<`u`&&navigator.scheduling?.isInputPending?()=>navigator.scheduling.isInputPending():null,YK=sV.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(RK.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(RK.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=qK(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:r}}=this.view,i=n.field(RK.state);if(i.tree==i.context.tree&&i.context.isDone(r+1e5))return;let a=Date.now()+Math.min(this.chunkBudget,100,e&&!JK?Math.max(25,e.timeRemaining()-5):1e9),o=i.context.treeLen<r&&n.doc.length>r+1e3,s=i.context.work(()=>JK&&JK()||Date.now()>a,r+(o?0:1e5));this.chunkBudget-=Date.now()-t,(s||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:RK.setState.of(new KK(i.context))})),this.chunkBudget>0&&(!s||o)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(e){e.scheduleOn&&=(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(e=>rV(this.view.state,e)).then(()=>this.workScheduled--),null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),XK=X.define({combine(e){return e.length?e[0]:null},enables:e=>[RK.state,YK,$.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]}),ZK=class{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}},QK=X.define(),$K=X.define({combine:e=>{if(!e.length)return` `;let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(e=>e!=t[0]))throw Error(`Invalid indent unit: `+JSON.stringify(e[0]));return t}});function eq(e){let t=e.facet($K);return t.charCodeAt(0)==9?e.tabSize*t.length:t.length}function tq(e,t){let n=``,r=e.tabSize,i=e.facet($K)[0];if(i==` `){for(;t>=r;)n+=` `,t-=r;i=` `}for(let e=0;e<t;e++)n+=i;return n}function nq(e,t){e instanceof PR&&(e=new rq(e));for(let n of e.state.facet(QK)){let r=n(e,t);if(r!==void 0)return r}let n=VK(e.state);return n.length>=t?aq(e,n,t):null}var rq=class{constructor(e,t={}){this.state=e,this.options=t,this.unit=eq(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:i}=this.options;return r!=null&&r>=n.from&&r<=n.to?i&&r==e?{text:``,from:e}:(t<0?r<e:r<=e)?{text:n.text.slice(r-n.from),from:r}:{text:n.text.slice(0,r-n.from),from:n.from}:n}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return``;let{text:n,from:r}=this.lineAt(e,t);return n.slice(e-r,Math.min(n.length,e+100-r))}column(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.countColumn(n,e-r),a=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return a>-1&&(i+=a-this.countColumn(n,n.search(/\S|$/))),i}countColumn(e,t=e.length){return tz(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.options.overrideIndentation;if(i){let e=i(r);if(e>-1)return e}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}},iq=new EF;function aq(e,t,n){let r=t.resolveStack(n),i=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let e=[];for(let t=i;t&&!(t.from<r.node.from||t.to>r.node.to||t.from==r.node.from&&t.type==r.node.type);t=t.parent)e.push(t);for(let t=e.length-1;t>=0;t--)r={node:e[t],next:r}}return oq(r,e,n)}function oq(e,t,n){for(let r=e;r;r=r.next){let e=cq(r.node);if(e)return e(uq.create(t,n,r))}return 0}function sq(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}function cq(e){let t=e.type.prop(iq);if(t)return t;let n=e.firstChild,r;if(n&&(r=n.type.prop(EF.closedBy))){let t=e.lastChild,n=t&&r.indexOf(t.name)>-1;return e=>pq(e,!0,1,void 0,n&&!sq(e)?t.from:void 0)}return e.parent==null?lq:null}function lq(){return 0}var uq=class e extends rq{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.context=n}get node(){return this.context.node}static create(t,n,r){return new e(t,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(dq(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return oq(this.context.next,this.base,this.pos)}};function dq(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function fq(e){let t=e.node,n=t.childAfter(t.from),r=t.lastChild;if(!n)return null;let i=e.options.simulateBreak,a=e.state.doc.lineAt(n.from),o=i==null||i<=a.from?a.to:Math.min(a.to,i);for(let e=n.to;;){let i=t.childAfter(e);if(!i||i==r)return null;if(!i.type.isSkipped){if(i.from>=o)return null;let e=/^ */.exec(a.text.slice(n.to-a.from))[0].length;return{from:n.from,to:n.to+e}}e=i.to}}function pq(e,t,n,r,i){let a=e.textAfter,o=a.match(/^\s*/)[0].length,s=r&&a.slice(o,o+r.length)==r||i==e.pos+o,c=t?fq(e):null;return c?s?e.column(c.from):e.column(c.to):e.baseIndent+(s?0:e.unit*n)}function mq({except:e,units:t=1}={}){return n=>{let r=e&&e.test(n.textAfter);return n.baseIndent+(r?0:t*n.unit)}}var hq=200;function gq(){return PR.transactionFilter.of(e=>{if(!e.docChanged||!e.isUserEvent(`input.type`)&&!e.isUserEvent(`input.complete`))return e;let t=e.startState.languageDataAt(`indentOnInput`,e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:r}=e.newSelection.main,i=n.lineAt(r);if(r>i.from+hq)return e;let a=n.sliceString(i.from,r);if(!t.some(e=>e.test(a)))return e;let{state:o}=e,s=-1,c=[];for(let{head:e}of o.selection.ranges){let t=o.doc.lineAt(e);if(t.from==s)continue;s=t.from;let n=nq(o,t.from);if(n==null)continue;let r=/^\s*/.exec(t.text)[0],i=tq(o,n);r!=i&&c.push({from:t.from,to:t.from+r.length,insert:i})}return c.length?[e,{changes:c,sequential:!0}]:e})}var _q=X.define(),vq=new EF;function yq(e){let t=e.firstChild,n=e.lastChild;return t&&t.to<n.from?{from:t.to,to:n.type.isError?e.to:n.from}:null}function bq(e,t,n){let r=VK(e);if(r.length<n)return null;let i=r.resolveStack(n,1),a=null;for(let o=i;o;o=o.next){let i=o.node;if(i.to<=n||i.from>n)continue;if(a&&i.from<t)break;let s=i.type.prop(vq);if(s&&(i.to<r.length-50||r.length==e.doc.length||!xq(i))){let r=s(i,e);r&&r.from<=n&&r.from>=t&&r.to>n&&(a=r)}}return a}function xq(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function Sq(e,t,n){for(let r of e.facet(_q)){let i=r(e,t,n);if(i)return i}return bq(e,t,n)}function Cq(e,t){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);return n>=r?void 0:{from:n,to:r}}var wq=yR.define({map:Cq}),Tq=yR.define({map:Cq});function Eq(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some(e=>e.from<=n&&e.to>=n)||t.push(e.lineBlockAt(n));return t}var Dq=QL.define({create(){return Q.none},update(e,t){t.isUserEvent(`delete`)&&t.changes.iterChangedRanges((t,n)=>e=Oq(e,t,n)),e=e.map(t.changes);let n=[];for(let r of t.effects)r.is(wq)&&!Aq(e,r.value.from,r.value.to)?n.push(r.value):r.is(Tq)&&(e=e.update({filter:(e,t)=>r.value.from!=e||r.value.to!=t,filterFrom:r.value.from,filterTo:r.value.to}));if(n.length){let{preparePlaceholder:r}=t.state.facet(Lq),i=n.map(e=>(r?Q.replace({widget:new Vq(r(t.state,e))}):Bq).range(e.from,e.to));e=e.update({add:i})}return t.selection&&(e=Oq(e,t.selection.main.head)),e},provide:e=>$.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,(e,t)=>{n.push(e,t)}),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw RangeError(`Invalid JSON for fold state`);let t=[];for(let n=0;n<e.length;){let r=e[n++],i=e[n++];if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid JSON for fold state`);t.push(Bq.range(r,i))}return Q.set(t,!0)}});function Oq(e,t,n=t){let r=!1;return e.between(t,n,(e,i)=>{e<n&&i>t&&(r=!0)}),r?e.update({filterFrom:t,filterTo:n,filter:(e,r)=>e>=n||r<=t}):e}function kq(e,t,n){var r;let i=null;return(r=e.field(Dq,!1))==null||r.between(t,n,(e,t)=>{(!i||i.from>e)&&(i={from:e,to:t})}),i}function Aq(e,t,n){let r=!1;return e.between(t,t,(e,i)=>{e==t&&i==n&&(r=!0)}),r}function jq(e,t){return e.field(Dq,!1)?t:t.concat(yR.appendConfig.of(Rq()))}var Mq=e=>{for(let t of Eq(e)){let n=Sq(e.state,t.from,t.to);if(n)return e.dispatch({effects:jq(e.state,[wq.of(n),Pq(e,n)])}),!0}return!1},Nq=e=>{if(!e.state.field(Dq,!1))return!1;let t=[];for(let n of Eq(e)){let r=kq(e.state,n.from,n.to);r&&t.push(Tq.of(r),Pq(e,r,!1))}return t.length&&e.dispatch({effects:t}),t.length>0};function Pq(e,t,n=!0){let r=e.state.doc.lineAt(t.from).number,i=e.state.doc.lineAt(t.to).number;return $.announce.of(`${e.state.phrase(n?`Folded lines`:`Unfolded lines`)} ${r} ${e.state.phrase(`to`)} ${i}.`)}var Fq=[{key:`Ctrl-Shift-[`,mac:`Cmd-Alt-[`,run:Mq},{key:`Ctrl-Shift-]`,mac:`Cmd-Alt-]`,run:Nq},{key:`Ctrl-Alt-[`,run:e=>{let{state:t}=e,n=[];for(let r=0;r<t.doc.length;){let i=e.lineBlockAt(r),a=Sq(t,i.from,i.to);a&&n.push(wq.of(a)),r=(a?e.lineBlockAt(a.to):i).to+1}return n.length&&e.dispatch({effects:jq(e.state,n)}),!!n.length}},{key:`Ctrl-Alt-]`,run:e=>{let t=e.state.field(Dq,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(e,t)=>{n.push(Tq.of({from:e,to:t}))}),e.dispatch({effects:n}),!0}}],Iq={placeholderDOM:null,preparePlaceholder:null,placeholderText:`…`},Lq=X.define({combine(e){return FR(e,Iq)}});function Rq(e){let t=[Dq,Gq];return e&&t.push(Lq.of(e)),t}function zq(e,t){let{state:n}=e,r=n.facet(Lq),i=t=>{let n=e.lineBlockAt(e.posAtDOM(t.target)),r=kq(e.state,n.from,n.to);r&&e.dispatch({effects:Tq.of(r)}),t.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(e,i,t);let a=document.createElement(`span`);return a.textContent=r.placeholderText,a.setAttribute(`aria-label`,n.phrase(`folded code`)),a.title=n.phrase(`unfold`),a.className=`cm-foldPlaceholder`,a.onclick=i,a}var Bq=Q.replace({widget:new class extends Iz{toDOM(e){return zq(e,null)}}}),Vq=class extends Iz{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return zq(e,this.value)}},Hq={openText:`⌄`,closedText:`›`,markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1},Uq=class extends lK{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement(`span`);return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?`Fold line`:`Unfold line`),t}};function Wq(e={}){let t={...Hq,...e},n=new Uq(t,!0),r=new Uq(t,!1),i=sV.fromClass(class{constructor(e){this.from=e.viewport.from,this.markers=this.buildMarkers(e)}update(e){(e.docChanged||e.viewportChanged||e.startState.facet(XK)!=e.state.facet(XK)||e.startState.field(Dq,!1)!=e.state.field(Dq,!1)||VK(e.startState)!=VK(e.state)||t.foldingChanged(e))&&(this.markers=this.buildMarkers(e.view))}buildMarkers(e){let t=new WR;for(let i of e.viewportLineBlocks){let a=kq(e.state,i.from,i.to)?r:Sq(e.state,i.from,i.to)?n:null;a&&t.add(i.from,i.from,a)}return t.finish()}}),{domEventHandlers:a}=t;return[i,mK({class:`cm-foldGutter`,markers(e){return e.plugin(i)?.markers||VR.empty},initialSpacer(){return new Uq(t,!1)},domEventHandlers:{...a,click:(e,t,n)=>{if(a.click&&a.click(e,t,n))return!0;let r=kq(e.state,t.from,t.to);if(r)return e.dispatch({effects:Tq.of(r)}),!0;let i=Sq(e.state,t.from,t.to);return i?(e.dispatch({effects:wq.of(i)}),!0):!1}}}),Rq()]}var Gq=$.baseTheme({".cm-foldPlaceholder":{backgroundColor:`#eee`,border:`1px solid #ddd`,color:`#888`,borderRadius:`.2em`,margin:`0 1px`,padding:`0 1px`,cursor:`pointer`},".cm-foldGutter span":{padding:`0 1px`,cursor:`pointer`}}),Kq=class e{constructor(e,t){this.specs=e;let n;function r(e){let t=sz.newName();return(n||=Object.create(null))[`.`+t]=e,t}let i=typeof t.all==`string`?t.all:t.all?r(t.all):void 0,a=t.scope;this.scope=a instanceof RK?e=>e.prop(FK)==a.data:a?e=>e==a:void 0,this.style=LI(e.map(e=>({tag:e.tag,class:e.class||r(Object.assign({},e,{tag:null}))})),{all:i}).style,this.module=n?new sz(n):null,this.themeType=t.themeType}static define(t,n){return new e(t,n||{})}},qq=X.define(),Jq=X.define({combine(e){return e.length?[e[0]]:null}});function Yq(e){let t=e.facet(qq);return t.length?t:e.facet(Jq)}function Xq(e,t){let n=[Qq],r;return e instanceof Kq&&(e.module&&n.push($.styleModule.of(e.module)),r=e.themeType),t?.fallback?n.push(Jq.of(e)):r?n.push(qq.computeN([$.darkTheme],t=>t.facet($.darkTheme)==(r==`dark`)?[e]:[])):n.push(qq.of(e)),n}var Zq=class{constructor(e){this.markCache=Object.create(null),this.tree=VK(e.state),this.decorations=this.buildDeco(e,Yq(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=VK(e.state),n=Yq(e.state),r=n!=Yq(e.startState),{viewport:i}=e.view,a=e.changes.mapPos(this.decoratedTo,1);t.length<i.to&&!r&&t.type==this.tree.type&&a>=i.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=a):(t!=this.tree||e.viewportChanged||r)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=i.to)}buildDeco(e,t){if(!t||!this.tree.length)return Q.none;let n=new WR;for(let{from:r,to:i}of e.visibleRanges)zI(this.tree,t,(e,t,r)=>{n.add(e,t,this.markCache[r]||(this.markCache[r]=Q.mark({class:r})))},r,i);return n.finish()}},Qq=tR.high(sV.fromClass(Zq,{decorations:e=>e.decorations})),$q=Kq.define([{tag:J.meta,color:`#404740`},{tag:J.link,textDecoration:`underline`},{tag:J.heading,textDecoration:`underline`,fontWeight:`bold`},{tag:J.emphasis,fontStyle:`italic`},{tag:J.strong,fontWeight:`bold`},{tag:J.strikethrough,textDecoration:`line-through`},{tag:J.keyword,color:`#708`},{tag:[J.atom,J.bool,J.url,J.contentSeparator,J.labelName],color:`#219`},{tag:[J.literal,J.inserted],color:`#164`},{tag:[J.string,J.deleted],color:`#a11`},{tag:[J.regexp,J.escape,J.special(J.string)],color:`#e40`},{tag:J.definition(J.variableName),color:`#00f`},{tag:J.local(J.variableName),color:`#30a`},{tag:[J.typeName,J.namespace],color:`#085`},{tag:J.className,color:`#167`},{tag:[J.special(J.variableName),J.macroName],color:`#256`},{tag:J.definition(J.propertyName),color:`#00c`},{tag:J.comment,color:`#940`},{tag:J.invalid,color:`#f00`}]),eJ=$.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:`#328c8252`},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:`#bb555544`}}),tJ=1e4,nJ=`()[]{}`,rJ=X.define({combine(e){return FR(e,{afterCursor:!0,brackets:nJ,maxScanDistance:tJ,renderMatch:oJ})}}),iJ=Q.mark({class:`cm-matchingBracket`}),aJ=Q.mark({class:`cm-nonmatchingBracket`});function oJ(e){let t=[],n=e.matched?iJ:aJ;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}function sJ(e){let t=[],n=e.facet(rJ);for(let r of e.selection.ranges){if(!r.empty)continue;let i=pJ(e,r.head,-1,n)||r.head>0&&pJ(e,r.head-1,1,n)||n.afterCursor&&(pJ(e,r.head,1,n)||r.head<e.doc.length&&pJ(e,r.head+1,-1,n));i&&(t=t.concat(n.renderMatch(i,e)))}return Q.set(t,!0)}var cJ=[sV.fromClass(class{constructor(e){this.paused=!1,this.decorations=sJ(e.state)}update(e){(e.docChanged||e.selectionSet||this.paused)&&(e.view.composing?(this.decorations=this.decorations.map(e.changes),this.paused=!0):(this.decorations=sJ(e.state),this.paused=!1))}},{decorations:e=>e.decorations}),eJ];function lJ(e={}){return[rJ.of(e),cJ]}var uJ=new EF;function dJ(e,t,n){let r=e.prop(t<0?EF.openedBy:EF.closedBy);if(r)return r;if(e.name.length==1){let r=n.indexOf(e.name);if(r>-1&&r%2==+(t<0))return[n[r+t]]}return null}function fJ(e){let t=e.type.prop(uJ);return t?t(e.node):e}function pJ(e,t,n,r={}){let i=r.maxScanDistance||tJ,a=r.brackets||nJ,o=VK(e),s=o.resolveInner(t,n);for(let r=s;r;r=r.parent){let i=dJ(r.type,n,a);if(i&&r.from<r.to){let o=fJ(r);if(o&&(n>0?t>=o.from&&t<o.to:t>o.from&&t<=o.to))return mJ(e,t,n,r,o,i,a)}}return hJ(e,t,n,o,s.type,i,a)}function mJ(e,t,n,r,i,a,o){let s=r.parent,c={from:i.from,to:i.to},l=0,u=s?.cursor();if(u&&(n<0?u.childBefore(r.from):u.childAfter(r.to)))do if(n<0?u.to<=r.from:u.from>=r.to){if(l==0&&a.indexOf(u.type.name)>-1&&u.from<u.to){let e=fJ(u);return{start:c,end:e?{from:e.from,to:e.to}:void 0,matched:!0}}if(dJ(u.type,n,o))l++;else if(dJ(u.type,-n,o)){if(l==0){let e=fJ(u);return{start:c,end:e&&e.from<e.to?{from:e.from,to:e.to}:void 0,matched:!1}}l--}}while(n<0?u.prevSibling():u.nextSibling());return{start:c,matched:!1}}function hJ(e,t,n,r,i,a,o){if(n<0?!t:t==e.doc.length)return null;let s=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),c=o.indexOf(s);if(c<0||c%2==0!=n>0)return null;let l={from:n<0?t-1:t,to:n>0?t+1:t},u=e.doc.iterRange(t,n>0?e.doc.length:0),d=0;for(let e=0;!u.next().done&&e<=a;){let a=u.value;n<0&&(e+=a.length);let s=t+e*n;for(let e=n>0?0:a.length-1,t=n>0?a.length:-1;e!=t;e+=n){let t=o.indexOf(a[e]);if(!(t<0||r.resolveInner(s+e,1).type!=i)){if(t%2==0==n>0)d++;else if(d==1)return{start:l,end:{from:s+e,to:s+e+1},matched:t>>1==c>>1};else d--}}n>0&&(e+=a.length)}return u.done?{start:l,matched:!1}:null}var gJ=Object.create(null),_J=[kF.none],vJ=[],yJ=Object.create(null),bJ=Object.create(null);for(let[e,t]of[[`variable`,`variableName`],[`variable-2`,`variableName.special`],[`string-2`,`string.special`],[`def`,`variableName.definition`],[`tag`,`tagName`],[`attribute`,`attributeName`],[`type`,`typeName`],[`builtin`,`variableName.standard`],[`qualifier`,`modifier`],[`error`,`invalid`],[`header`,`heading`],[`property`,`propertyName`]])bJ[e]=SJ(gJ,t);function xJ(e,t){vJ.indexOf(e)>-1||(vJ.push(e),console.warn(t))}function SJ(e,t){let n=[];for(let r of t.split(` `)){let t=[];for(let n of r.split(`.`)){let r=e[n]||J[n];r?typeof r==`function`?t.length?t=t.map(r):xJ(n,`Modifier ${n} used at start of tag`):t.length?xJ(n,`Tag ${n} used as modifier`):t=Array.isArray(r)?r:[r]:xJ(n,`Unknown highlighting tag ${n}`)}for(let e of t)n.push(e)}if(!n.length)return 0;let r=t.replace(/ /g,`_`),i=r+` `+n.map(e=>e.id),a=yJ[i];if(a)return a.id;let o=yJ[i]=kF.define({id:_J.length,name:r,props:[PI({[r]:n})]});return _J.push(o),o.id}yB.RTL,yB.LTR;var CJ=()=>e=>{try{JSON.parse(e.state.doc.toString())}catch(t){if(!(t instanceof SyntaxError))throw t;let n=wJ(t,e.state.doc);return[{from:n,message:t.message,severity:`error`,to:n}]}return[]};function wJ(e,t){let n;return(n=e.message.match(/at position (\d+)/))?Math.min(+n[1],t.length):(n=e.message.match(/at line (\d+) column (\d+)/))?Math.min(t.line(+n[1]).from+ +n[2]-1,t.length):0}var TJ=BK.define({name:`json`,parser:rL.configure({props:[iq.add({Object:mq({except:/^\s*\}/}),Array:mq({except:/^\s*\]/})}),vq.add({"Object Array":yq})]}),languageData:{closeBrackets:{brackets:[`[`,`{`,`"`]},indentOnInput:/^\s*[\}\]]$/}});function EJ(){return new ZK(TJ)}var DJ=class{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}},OJ=class e{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(t,n,r){let i=r.facet(GJ).markerFilter;i&&(t=i(t,r));let a=t.slice().sort((e,t)=>e.from-t.from||e.to-t.to),o=new WR,s=[],c=0,l=r.doc.iter(),u=0,d=r.doc.length;for(let e=0;;){let t=e==a.length?null:a[e];if(!t&&!s.length)break;let n,r;if(s.length)n=c,r=s.reduce((e,t)=>Math.min(e,t.to),t&&t.from>n?t.from:1e8);else{if(n=t.from,n>d)break;r=t.to,s.push(t),e++}for(;e<a.length;){let t=a[e];if(t.from==n&&(t.to>t.from||t.to==n))s.push(t),e++,r=Math.min(t.to,r);else{r=Math.min(t.from,r);break}}r=Math.min(r,d);let i=!1;if(s.some(e=>e.from==n&&(e.to==r||r==d))&&(i=n==r,!i&&r-n<10)){let e=n-(u+l.value.length);e>0&&(l.next(e),u=n);for(let e=n;;){if(e>=r){i=!0;break}if(!l.lineBreak&&u+l.value.length>e)break;e=u+l.value.length,u+=l.value.length,l.next()}}let f=rY(s);if(i)o.add(n,n,Q.widget({widget:new XJ(f),diagnostics:s.slice()}));else{let e=s.reduce((e,t)=>t.markClass?e+` `+t.markClass:e,``);o.add(n,r,Q.mark({class:`cm-lintRange cm-lintRange-`+f+e,diagnostics:s.slice(),inclusiveEnd:s.some(e=>e.to>r)}))}if(c=r,c==d)break;for(let e=0;e<s.length;e++)s[e].to<=c&&s.splice(e--,1)}let f=o.finish();return new e(f,n,kJ(f))}};function kJ(e,t=null,n=0){let r=null;return e.between(n,1e9,(e,n,{spec:i})=>{if(!(t&&i.diagnostics.indexOf(t)<0)){if(!r)r=new DJ(e,n,t||i.diagnostics[0]);else if(i.diagnostics.indexOf(r.diagnostic)<0)return!1;else r=new DJ(r.from,n,r.diagnostic)}}),r}function AJ(e,t){let n=t.pos,r=t.end||n,i=e.state.facet(GJ).hideOn(e,n,r);if(i!=null)return i;let a=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(e=>e.is(NJ))||e.changes.touchesRange(a.from,Math.max(a.to,r)))}function jJ(e,t){return e.field(IJ,!1)?t:t.concat(yR.appendConfig.of(aY))}function MJ(e,t){return{effects:jJ(e,[NJ.of(t)])}}var NJ=yR.define(),PJ=yR.define(),FJ=yR.define(),IJ=QL.define({create(){return new OJ(Q.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,i=e.panel;if(e.selected){let i=t.changes.mapPos(e.selected.from,1);r=kJ(n,e.selected.diagnostic,i)||kJ(n,null,i)}!n.size&&i&&t.state.facet(GJ).autoPanel&&(i=null),e=new OJ(n,i,r)}for(let n of t.effects)if(n.is(NJ)){let r=t.state.facet(GJ).autoPanel?n.value.length?QJ.open:null:e.panel;e=OJ.init(n.value,r,t.state)}else n.is(PJ)?e=new OJ(e.diagnostics,n.value?QJ.open:null,e.selected):n.is(FJ)&&(e=new OJ(e.diagnostics,e.panel,n.value));return e},provide:e=>[nK.from(e,e=>e.panel),$.decorations.from(e,e=>e.diagnostics)]}),LJ=Q.mark({class:`cm-lintRange cm-lintRange-active`});function RJ(e,t,n){let{diagnostics:r}=e.state.field(IJ),i,a=-1,o=-1;r.between(t-+(n<0),t+ +(n>0),(e,r,{spec:s})=>{if(t>=e&&t<=r&&(e==r||(t>e||n>0)&&(t<r||n<0)))return i=s.diagnostics,a=e,o=r,!1});let s=e.state.facet(GJ).tooltipFilter;return i&&s&&(i=s(i,e.state)),i?{pos:a,end:o,above:!0,create(){return{dom:zJ(e,i)}}}:null}function zJ(e,t){return _z(`ul`,{class:`cm-tooltip-lint`},t.map(t=>YJ(e,t,!1)))}var BJ=e=>{let t=e.state.field(IJ,!1);(!t||!t.panel)&&e.dispatch({effects:jJ(e.state,[PJ.of(!0)])});let n=QG(e,QJ.open);return n&&n.dom.querySelector(`.cm-panel-lint ul`).focus(),!0},VJ=e=>{let t=e.state.field(IJ,!1);return!t||!t.panel?!1:(e.dispatch({effects:PJ.of(!1)}),!0)},HJ=[{key:`Mod-Shift-m`,run:BJ,preventDefault:!0},{key:`F8`,run:e=>{let t=e.state.field(IJ,!1);if(!t)return!1;let n=e.state.selection.main,r=kJ(t.diagnostics,null,n.to+1);return!r&&(r=kJ(t.diagnostics,null,0),!r||r.from==n.from&&r.to==n.to)?!1:(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),JG(e,r.from,1,{tooltip:iY,until:e=>e.docChanged||e.newSelection.main.head<r.from||e.newSelection.main.head>r.to}),!0)}}],UJ=sV.fromClass(class{constructor(e){this.view=e,this.timeout=-1,this.set=!0;let{delay:t}=e.state.facet(GJ);this.lintTime=Date.now()+t,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,t)}run(){clearTimeout(this.timeout);let e=Date.now();if(e<this.lintTime-10)this.timeout=setTimeout(this.run,this.lintTime-e);else{this.set=!1;let{state:e}=this.view,{sources:t}=e.facet(GJ);t.length&&WJ(t.map(e=>Promise.resolve(e(this.view))),t=>{this.view.state.doc==e.doc&&this.view.dispatch(MJ(this.view.state,t.reduce((e,t)=>e.concat(t))))},e=>{rV(this.view.state,e)})}}update(e){let t=e.state.facet(GJ);(e.docChanged||t!=e.startState.facet(GJ)||t.needsRefresh&&t.needsRefresh(e))&&(this.lintTime=Date.now()+t.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,t.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}});function WJ(e,t,n){let r=[],i=-1;for(let a of e)a.then(n=>{r.push(n),clearTimeout(i),r.length==e.length?t(r):i=setTimeout(()=>t(r),200)},n)}var GJ=X.define({combine(e){return{sources:e.map(e=>e.source).filter(e=>e!=null),...FR(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:KJ,tooltipFilter:KJ,needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t,hideOn:(e,t)=>e?t?(n,r,i)=>e(n,r,i)||t(n,r,i):e:t,autoPanel:(e,t)=>e||t})}}});function KJ(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function qJ(e,t={}){return[GJ.of({source:e,config:t}),UJ,aY]}function JJ(e){let t=[];if(e)actions:for(let{name:n}of e){for(let e=0;e<n.length;e++){let r=n[e];if(/[a-zA-Z]/.test(r)&&!t.some(e=>e.toLowerCase()==r.toLowerCase())){t.push(r);continue actions}}t.push(``)}return t}function YJ(e,t,n){let r=n?JJ(t.actions):[];return _z(`li`,{class:`cm-diagnostic cm-diagnostic-`+t.severity},_z(`span`,{class:`cm-diagnosticText`},t.renderMessage?t.renderMessage(e):t.message),t.actions?.map((n,i)=>{let a=!1,o=r=>{if(r.preventDefault(),a)return;a=!0;let i=kJ(e.state.field(IJ).diagnostics,t);i&&n.apply(e,i.from,i.to)},{name:s}=n,c=r[i]?s.indexOf(r[i]):-1,l=c<0?s:[s.slice(0,c),_z(`u`,s.slice(c,c+1)),s.slice(c+1)];return _z(`button`,{type:`button`,class:`cm-diagnosticAction`+(n.markClass?` `+n.markClass:``),onclick:o,onmousedown:o,"aria-label":` Action: ${s}${c<0?``:` (access key "${r[i]})"`}.`},l)}),t.source&&_z(`div`,{class:`cm-diagnosticSource`},t.source))}var XJ=class extends Iz{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return _z(`span`,{class:`cm-lintPoint cm-lintPoint-`+this.sev})}},ZJ=class{constructor(e,t){this.diagnostic=t,this.id=`item_`+Math.floor(Math.random()*4294967295).toString(16),this.dom=YJ(e,t,!0),this.dom.id=this.id,this.dom.setAttribute(`role`,`option`)}},QJ=class e{constructor(e){this.view=e,this.items=[];let t=t=>{if(!(t.ctrlKey||t.altKey||t.metaKey)){if(t.keyCode==27)VJ(this.view),this.view.focus();else if(t.keyCode==38||t.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(t.keyCode==40||t.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(t.keyCode==36)this.moveSelection(0);else if(t.keyCode==35)this.moveSelection(this.items.length-1);else if(t.keyCode==13)this.view.focus();else if(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:n}=this.items[this.selectedIndex],r=JJ(n.actions);for(let i=0;i<r.length;i++)if(r[i].toUpperCase().charCodeAt(0)==t.keyCode){let t=kJ(this.view.state.field(IJ).diagnostics,n);t&&n.actions[i].apply(e,t.from,t.to)}}else return;t.preventDefault()}},n=e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)};this.list=_z(`ul`,{tabIndex:0,role:`listbox`,"aria-label":this.view.state.phrase(`Diagnostics`),onkeydown:t,onclick:n}),this.dom=_z(`div`,{class:`cm-panel-lint`},this.list,_z(`button`,{type:`button`,name:`close`,"aria-label":this.view.state.phrase(`close`),onclick:()=>VJ(this.view)},`×`)),this.update()}get selectedIndex(){let e=this.view.state.field(IJ).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(IJ),n=0,r=!1,i=null,a=new Set;for(e.between(0,this.view.state.doc.length,(e,o,{spec:s})=>{for(let e of s.diagnostics){if(a.has(e))continue;a.add(e);let o=-1,s;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==e){o=t;break}o<0?(s=new ZJ(this.view,e),this.items.splice(n,0,s),r=!0):(s=this.items[o],o>n&&(this.items.splice(n,o-n),r=!0)),t&&s.diagnostic==t.diagnostic?s.dom.hasAttribute(`aria-selected`)||(s.dom.setAttribute(`aria-selected`,`true`),i=s):s.dom.hasAttribute(`aria-selected`)&&s.dom.removeAttribute(`aria-selected`),n++}});n<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();this.items.length==0&&(this.items.push(new ZJ(this.view,{from:-1,to:-1,severity:`info`,message:this.view.state.phrase(`No diagnostics`)})),r=!0),i?(this.list.setAttribute(`aria-activedescendant`,i.id),this.view.requestMeasure({key:this,read:()=>({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute(`aria-activedescendant`),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=kJ(this.view.state.field(IJ).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:FJ.of(t)})}static open(t){return new e(t)}};function $J(e,t=`viewBox="0 0 40 40"`){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function eY(e){return $J(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,`width="6" height="3"`)}var tY=$.baseTheme({".cm-diagnostic":{padding:`3px 6px 3px 8px`,marginLeft:`-1px`,display:`block`,whiteSpace:`pre-wrap`},".cm-diagnostic-error":{borderLeft:`5px solid #d11`},".cm-diagnostic-warning":{borderLeft:`5px solid orange`},".cm-diagnostic-info":{borderLeft:`5px solid #999`},".cm-diagnostic-hint":{borderLeft:`5px solid #66d`},".cm-diagnosticAction":{font:`inherit`,border:`none`,padding:`2px 4px`,backgroundColor:`#444`,color:`white`,borderRadius:`3px`,marginLeft:`8px`,cursor:`pointer`},".cm-diagnosticSource":{fontSize:`70%`,opacity:.7},".cm-lintRange":{backgroundPosition:`left bottom`,backgroundRepeat:`repeat-x`,paddingBottom:`0.7px`},".cm-lintRange-error":{backgroundImage:eY(`#f11`)},".cm-lintRange-warning":{backgroundImage:eY(`orange`)},".cm-lintRange-info":{backgroundImage:eY(`#999`)},".cm-lintRange-hint":{backgroundImage:eY(`#66d`)},".cm-lintRange-active":{backgroundColor:`#ffdd9980`},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:`relative`,"&:after":{content:`""`,position:`absolute`,bottom:0,left:`-2px`,borderLeft:`3px solid transparent`,borderRight:`3px solid transparent`,borderBottom:`4px solid #d11`}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:`orange`}},".cm-lintPoint-info":{"&:after":{borderBottomColor:`#999`}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:`#66d`}},".cm-panel.cm-panel-lint":{position:`relative`,"& ul":{maxHeight:`100px`,overflowY:`auto`,"& [aria-selected]":{backgroundColor:`#ddd`,"& u":{textDecoration:`underline`}},"&:focus [aria-selected]":{background_fallback:`#bdf`,backgroundColor:`Highlight`,color_fallback:`white`,color:`HighlightText`},"& u":{textDecoration:`none`},padding:0,margin:0},"& [name=close]":{position:`absolute`,top:`0`,right:`2px`,background:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:`#86714a80`},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:`#2e343e`}}});function nY(e){return e==`error`?4:e==`warning`?3:e==`info`?2:1}function rY(e){let t=`hint`,n=1;for(let r of e){let e=nY(r.severity);e>n&&(n=e,t=r.severity)}return t}var iY=qG(RJ,{hideOn:AJ}),aY=[IJ,$.decorations.compute([IJ],e=>{let{selected:t,panel:n}=e.field(IJ);return!t||!n||t.from==t.to?Q.none:Q.set([LJ.range(t.from,t.to)])}),iY,tY];function oY(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var sY=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=fY(e.state,n.from);return r.line?lY(e):r.block?dY(e):!1};function cY(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return i?(r(n.update(i)),!0):!1}}var lY=cY(_Y,0),uY=cY(gY,0),dY=cY((e,t)=>gY(e,t,hY(t)),0);function fY(e,t){let n=e.languageDataAt(`commentTokens`,t,1);return n.length?n[0]:{}}var pY=50;function mY(e,{open:t,close:n},r,i){let a=e.sliceDoc(r-pY,r),o=e.sliceDoc(i,i+pY),s=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(o)[0].length,l=a.length-s;if(a.slice(l-t.length,l)==t&&o.slice(c,c+n.length)==n)return{open:{pos:r-s,margin:s&&1},close:{pos:i+c,margin:c&&1}};let u,d;i-r<=100?u=d=e.sliceDoc(r,i):(u=e.sliceDoc(r,r+pY),d=e.sliceDoc(i-pY,i));let f=/^\s*/.exec(u)[0].length,p=/\s*$/.exec(d)[0].length,m=d.length-p-n.length;return u.slice(f,f+t.length)==t&&d.slice(m,m+n.length)==n?{open:{pos:r+f+t.length,margin:+!!/\s/.test(u.charAt(f+t.length))},close:{pos:i-p-n.length,margin:+!!/\s/.test(d.charAt(m-1))}}:null}function hY(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let a=t.length-1;a>=0&&t[a].to>r.from?t[a].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}function gY(e,t,n=t.selection.ranges){let r=n.map(e=>fY(t,e.from).block);if(!r.every(e=>e))return null;let i=n.map((e,n)=>mY(t,r[n],e.from,e.to));if(e!=2&&!i.every(e=>e))return{changes:t.changes(n.map((e,t)=>i[t]?[]:[{from:e.from,insert:r[t].open+` `},{from:e.to,insert:` `+r[t].close}]))};if(e!=1&&i.some(e=>e)){let e=[];for(let t=0,n;t<i.length;t++)if(n=i[t]){let i=r[t],{open:a,close:o}=n;e.push({from:a.pos-i.open.length,to:a.pos+a.margin},{from:o.pos-o.margin,to:o.pos+i.close.length})}return{changes:e}}return null}function _Y(e,t,n=t.selection.ranges){let r=[],i=-1;ranges:for(let{from:e,to:a}of n){let n=r.length,o=1e9,s;for(let n=e;n<=a;){let c=t.doc.lineAt(n);if(s==null&&(s=fY(t,c.from).line,!s))continue ranges;if(c.from>i&&(e==a||a>c.from)){i=c.from;let e=/^\s*/.exec(c.text)[0].length,t=e==c.length,n=c.text.slice(e,e+s.length)==s?e:-1;e<c.text.length&&e<o&&(o=e),r.push({line:c,comment:n,token:s,indent:e,empty:t,single:!1})}n=c.to+1}if(o<1e9)for(let e=n;e<r.length;e++)r[e].indent<r[e].line.text.length&&(r[e].indent=o);r.length==n+1&&(r[n].single=!0)}if(e!=2&&r.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:i,empty:a,single:o}of r)(o||!a)&&e.push({from:t.from+i,insert:n+` `});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}if(e!=1&&r.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:i}of r)if(n>=0){let r=t.from+n,a=r+i.length;t.text[a-t.from]==` `&&a++,e.push({from:r,to:a})}return{changes:e}}return null}var vY=gR.define(),yY=gR.define(),bY=X.define(),xY=X.define({combine(e){return FR(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}}),SY=QL.define({create(){return VY.empty},update(e,t){let n=t.state.facet(xY),r=t.annotation(vY);if(r){let i=kY.fromTransaction(t,r.selection),a=r.side,o=a==0?e.undone:e.done;return o=i?AY(o,o.length,n.minDepth,i):IY(o,t.startState.selection),new VY(a==0?r.rest:o,a==0?o:r.rest)}let i=t.annotation(yY);if((i==`full`||i==`before`)&&(e=e.isolate()),t.annotation(bR.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=kY.fromTransaction(t),o=t.annotation(bR.time),s=t.annotation(bR.userEvent);return a?e=e.addChanges(a,o,s,n,t):t.selection&&(e=e.addSelection(t.startState.selection,o,s,n.newGroupDelay)),(i==`full`||i==`after`)&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}},fromJSON(e){return new VY(e.done.map(kY.fromJSON),e.undone.map(kY.fromJSON))}});function CY(e={}){return[SY,xY.of(e),$.domEventHandlers({beforeinput(e,t){let n=e.inputType==`historyUndo`?TY:e.inputType==`historyRedo`?EY:null;return n?(e.preventDefault(),n(t)):!1}})]}function wY(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(SY,!1);if(!i)return!1;let a=i.pop(e,n,t);return a?(r(a),!0):!1}}var TY=wY(0,!1),EY=wY(1,!1),DY=wY(0,!0),OY=wY(1,!0),kY=class e{constructor(e,t,n,r,i){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=i}setSelAfter(t){return new e(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){return{changes:this.changes?.toJSON(),mapped:this.mapped?.toJSON(),startSelection:this.startSelection?.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(t){return new e(t.changes&&IL.fromJSON(t.changes),[],t.mapped&&FL.fromJSON(t.mapped),t.startSelection&&Y.fromJSON(t.startSelection),t.selectionsAfter.map(Y.fromJSON))}static fromTransaction(t,n){let r=PY;for(let e of t.startState.facet(bY)){let n=e(t);n.length&&(r=r.concat(n))}return!r.length&&t.changes.empty?null:new e(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,PY)}static selection(t){return new e(void 0,PY,void 0,void 0,t)}};function AY(e,t,n,r){let i=t+1>n+20?t-n-1:0,a=e.slice(i,t);return a.push(r),a}function jY(e,t){let n=[],r=!1;return e.iterChangedRanges((e,t)=>n.push(e,t)),t.iterChangedRanges((e,t,i,a)=>{for(let e=0;e<n.length;){let t=n[e++],o=n[e++];a>=t&&i<=o&&(r=!0)}}),r}function MY(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((e,n)=>e.empty!=t.ranges[n].empty).length===0}function NY(e,t){return e.length?t.length?e.concat(t):e:t}var PY=[],FY=200;function IY(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-FY));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),AY(e,e.length-1,1e9,n.setSelAfter(r)))}return[kY.selection([t])]}function LY(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function RY(e,t){if(!e.length)return e;let n=e.length,r=PY;for(;n;){let i=zY(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let t=e.slice(0,n);return t[n-1]=i,t}t=i.mapped,n--,r=i.selectionsAfter}return r.length?[kY.selection(r)]:PY}function zY(e,t,n){let r=NY(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):PY,n);if(!e.changes)return kY.selection(r);let i=e.changes.map(t),a=t.mapDesc(e.changes,!0),o=e.mapped?e.mapped.composeDesc(a):a;return new kY(i,yR.mapEffects(e.effects,t),o,e.startSelection.map(a),r)}var BY=/^(input\.type|delete)($|\.)/,VY=class e{constructor(e,t,n=0,r=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new e(this.done,this.undone):this}addChanges(t,n,r,i,a){let o=this.done,s=o[o.length-1];return o=s&&s.changes&&!s.changes.empty&&t.changes&&(!r||BY.test(r))&&(!s.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(a,jY(s.changes,t.changes))||r==`input.type.compose`)?AY(o,o.length-1,i.minDepth,new kY(t.changes.compose(s.changes),NY(yR.mapEffects(t.effects,s.changes),s.effects),s.mapped,s.startSelection,PY)):AY(o,o.length,i.minDepth,t),new e(o,PY,n,r)}addSelection(t,n,r,i){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:PY;return a.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&MY(a[a.length-1],t)?this:new e(IY(this.done,t),this.undone,n,r)}addMapping(t){return new e(RY(this.done,t),RY(this.undone,t),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=e==0?this.done:this.undone;if(r.length==0)return null;let i=r[r.length-1],a=i.selectionsAfter[0]||(i.startSelection?i.startSelection.map(i.changes.invertedDesc,1):t.selection);if(n&&i.selectionsAfter.length)return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:vY.of({side:e,rest:LY(r),selection:a}),userEvent:e==0?`select.undo`:`select.redo`,scrollIntoView:!0});if(i.changes){let n=r.length==1?PY:r.slice(0,r.length-1);return i.mapped&&(n=RY(n,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:vY.of({side:e,rest:n,selection:a}),filter:!1,userEvent:e==0?`undo`:`redo`,scrollIntoView:!0})}return null}};VY.empty=new VY(PY,PY);var HY=[{key:`Mod-z`,run:TY,preventDefault:!0},{key:`Mod-y`,mac:`Mod-Shift-z`,run:EY,preventDefault:!0},{linux:`Ctrl-Shift-z`,run:EY,preventDefault:!0},{key:`Mod-u`,run:DY,preventDefault:!0},{key:`Alt-u`,mac:`Mod-Shift-u`,run:OY,preventDefault:!0}];function UY(e,t){return Y.create(e.ranges.map(t),e.mainIndex)}function WY(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:`select`})}function GY({state:e,dispatch:t},n){let r=UY(e.selection,n);return!r.eq(e.selection,!0)&&(t(WY(e,r)),!0)}function KY(e,t){return Y.cursor(t?e.to:e.from)}function qY(e,t){return GY(e,n=>n.empty?e.moveByChar(n,t):KY(n,t))}function JY(e){return e.textDirectionAt(e.state.selection.main.head)==yB.LTR}var YY=e=>qY(e,!JY(e)),XY=e=>qY(e,JY(e));function ZY(e,t){return GY(e,n=>n.empty?e.moveByGroup(n,t):KY(n,t))}var QY=e=>ZY(e,!JY(e)),$Y=e=>ZY(e,JY(e));typeof Intl<`u`&&Intl.Segmenter;function eX(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function tX(e,t,n){let r=VK(e).resolveInner(t.head),i=n?EF.closedBy:EF.openedBy;for(let a=t.head;;){let t=n?r.childAfter(a):r.childBefore(a);if(!t)break;eX(e,t,i)?r=t:a=n?t.to:t.from}let a=r.type.prop(i),o,s;return s=a&&(o=n?pJ(e,r.from,1):pJ(e,r.to,-1))&&o.matched?n?o.end.to:o.end.from:n?r.to:r.from,Y.cursor(s,n?-1:1)}var nX=e=>GY(e,t=>tX(e.state,t,!JY(e))),rX=e=>GY(e,t=>tX(e.state,t,JY(e)));function iX(e,t){return GY(e,n=>{if(!n.empty)return KY(n,t);let r=e.moveVertically(n,t);return r.head==n.head?e.moveToLineBoundary(n,t):r})}var aX=e=>iX(e,!1),oX=e=>iX(e,!0);function sX(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,i;if(t){for(let t of e.state.facet($.scrollMargins)){let i=t(e);i?.top&&(n=Math.max(i?.top,n)),i?.bottom&&(r=Math.max(i?.bottom,r))}i=e.scrollDOM.clientHeight-n-r}else i=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,i-5)}}function cX(e,t){let n=sX(e),{state:r}=e,i=UY(r.selection,r=>r.empty?e.moveVertically(r,t,n.height):KY(r,t));if(i.eq(r.selection))return!1;let a;if(n.selfScroll){let t=e.coordsAtPos(r.selection.main.head),o=e.scrollDOM.getBoundingClientRect(),s=o.top+n.marginTop,c=o.bottom-n.marginBottom;t&&t.top>s&&t.bottom<c&&(a=$.scrollIntoView(i.main.head,{y:`start`,yMargin:t.top-s}))}return e.dispatch(WY(r,i),{effects:a}),!0}var lX=e=>cX(e,!1),uX=e=>cX(e,!0);function dX(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let n=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;n&&t.head!=r.from+n&&(i=Y.cursor(r.from+n))}return i}var fX=e=>GY(e,t=>dX(e,t,!0)),pX=e=>GY(e,t=>dX(e,t,!1)),mX=e=>GY(e,t=>dX(e,t,!JY(e))),hX=e=>GY(e,t=>dX(e,t,JY(e))),gX=e=>GY(e,t=>e.moveToLineBoundary(t,!1,!1)),_X=e=>GY(e,t=>e.moveToLineBoundary(t,!0,!1));function vX(e,t,n){let r=!1,i=UY(e.selection,t=>{let i=pJ(e,t.head,-1)||pJ(e,t.head,1)||t.head>0&&pJ(e,t.head-1,1)||t.head<e.doc.length&&pJ(e,t.head+1,-1);if(!i||!i.end)return t;r=!0;let a=i.start.from==t.head?i.end.to:i.end.from;return n?Y.range(t.anchor,a):Y.cursor(a)});return r?(t(WY(e,i)),!0):!1}var yX=({state:e,dispatch:t})=>vX(e,t,!1);function bX(e,t,n){let r=UY(e.state.selection,e=>{e.undirectional&&e.head>=e.anchor!=t&&(e=Y.range(e.head,e.anchor));let r=n(e);return Y.range(e.anchor,r.head,r.goalColumn,r.bidiLevel||void 0,r.assoc)});return!r.eq(e.state.selection)&&(e.dispatch(WY(e.state,r)),!0)}function xX(e,t){return bX(e,t,n=>e.moveByChar(n,t))}var SX=e=>xX(e,!JY(e)),CX=e=>xX(e,JY(e));function wX(e,t){return bX(e,t,n=>e.moveByGroup(n,t))}var TX=e=>wX(e,!JY(e)),EX=e=>wX(e,JY(e)),DX=e=>{let t=!JY(e);return bX(e,t,n=>tX(e.state,n,t))},OX=e=>{let t=JY(e);return bX(e,t,n=>tX(e.state,n,t))};function kX(e,t){return bX(e,t,n=>e.moveVertically(n,t))}var AX=e=>kX(e,!1),jX=e=>kX(e,!0);function MX(e,t){return bX(e,t,n=>e.moveVertically(n,t,sX(e).height))}var NX=e=>MX(e,!1),PX=e=>MX(e,!0),FX=e=>bX(e,!0,t=>dX(e,t,!0)),IX=e=>bX(e,!1,t=>dX(e,t,!1)),LX=e=>{let t=!JY(e);return bX(e,t,n=>dX(e,n,t))},RX=e=>{let t=JY(e);return bX(e,t,n=>dX(e,n,t))},zX=e=>bX(e,!1,t=>Y.cursor(e.lineBlockAt(t.head).from)),BX=e=>bX(e,!0,t=>Y.cursor(e.lineBlockAt(t.head).to)),VX=({state:e,dispatch:t})=>(t(WY(e,{anchor:0})),!0),HX=({state:e,dispatch:t})=>(t(WY(e,{anchor:e.doc.length})),!0),UX=({state:e,dispatch:t})=>(t(WY(e,{anchor:e.selection.main.anchor,head:0})),!0),WX=({state:e,dispatch:t})=>(t(WY(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),GX=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:`select`})),!0),KX=({state:e,dispatch:t})=>{let n=dZ(e).map(({from:t,to:n})=>Y.undirectionalRange(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:Y.create(n),userEvent:`select`})),!0},qX=({state:e,dispatch:t})=>{let n=UY(e.selection,t=>{let n=VK(e),r=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=r.node.from&&e.node.to<=r.node.to&&(r=e)}for(let e=r;e;e=e.next){let{node:n}=e;if((n.from<t.from&&n.to>=t.to||n.to>t.to&&n.from<=t.from)&&e.next)return Y.undirectionalRange(n.from,n.to)}return t});return!n.eq(e.selection)&&(t(WY(e,n)),!0)};function JX(e,t){let{state:n}=e,r=n.selection,i=n.selection.ranges.slice();for(let r of n.selection.ranges){let a=n.doc.lineAt(r.head);if(t?a.to<e.state.doc.length:a.from>0)for(let n=r;;){let r=e.moveVertically(n,t);if(r.head<a.from||r.head>a.to){i.some(e=>e.head==r.head)||i.push(r);break}if(r.head==n.head)break;n=r}}return i.length!=r.ranges.length&&(e.dispatch(WY(n,Y.create(i,i.length-1))),!0)}var YX=e=>JX(e,!1),XX=e=>JX(e,!0),ZX=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=Y.create([n.main]):n.main.empty||(r=Y.create([Y.cursor(n.main.head)])),r?(t(WY(e,r)),!0):!1};function QX(e,t){if(e.state.readOnly)return!1;let n=`delete.selection`,{state:r}=e,i=r.changeByRange(r=>{let{from:i,to:a}=r;if(i==a){let o=t(r);o<i?(n=`delete.backward`,o=$X(e,o,!1)):o>i&&(n=`delete.forward`,o=$X(e,o,!0)),i=Math.min(i,o),a=Math.max(a,o)}else i=$X(e,i,!1),a=$X(e,a,!0);return i==a?{range:r}:{changes:{from:i,to:a},range:Y.cursor(i,i<r.head?-1:1)}});return!i.changes.empty&&(e.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n==`delete.selection`?$.announce.of(r.phrase(`Selection deleted`)):void 0})),!0)}function $X(e,t,n){if(e instanceof $)for(let r of e.state.facet($.atomicRanges).map(t=>t(e)))r.between(t,t,(e,r)=>{e<t&&r>t&&(t=n?r:e)});return t}var eZ=(e,t,n)=>QX(e,r=>{let i=r.from,{state:a}=e,o=a.doc.lineAt(i),s,c;if(n&&!t&&i>o.from&&i<o.from+200&&!/[^ \t]/.test(s=o.text.slice(0,i-o.from))){if(s[s.length-1]==` `)return i-1;let e=tz(s,a.tabSize)%eq(a)||eq(a);for(let t=0;t<e&&s[s.length-1-t]==` `;t++)i--;c=i}else c=DL(o.text,i-o.from,t,t)+o.from,c==i&&o.number!=(t?a.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(o.text.slice(c-o.from,i-o.from))&&(c=DL(o.text,c-o.from,!1,!1)+o.from);return c}),tZ=e=>eZ(e,!1,!0),nZ=e=>eZ(e,!0,!1),rZ=(e,t)=>QX(e,n=>{let r=n.head,{state:i}=e,a=i.doc.lineAt(r),o=i.charCategorizer(r);for(let e=null;;){if(r==(t?a.to:a.from)){r==n.head&&a.number!=(t?i.doc.lines:1)&&(r+=t?1:-1);break}let s=DL(a.text,r-a.from,t)+a.from,c=a.text.slice(Math.min(r,s)-a.from,Math.max(r,s)-a.from),l=o(c);if(e!=null&&l!=e)break;(c!=` `||r!=n.head)&&(e=l),r=s}return r}),iZ=e=>rZ(e,!1),aZ=e=>rZ(e,!0),oZ=e=>QX(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),sZ=e=>QX(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),cZ=e=>QX(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),lZ=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:gL.of([``,``])},range:Y.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:`input`})),!0},uZ=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||t.from==0||t.from==e.doc.length)return{range:t};let n=t.from,r=e.doc.lineAt(n),i=n==r.from?n-1:DL(r.text,n-r.from,!1)+r.from,a=n==r.to?n+1:DL(r.text,n-r.from,!0)+r.from;return{changes:{from:i,to:a,insert:e.doc.slice(n,a).append(e.doc.slice(i,n))},range:Y.cursor(a)}});return!n.changes.empty&&(t(e.update(n,{scrollIntoView:!0,userEvent:`move.character`})),!0)};function dZ(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),a=e.doc.lineAt(r.to);if(!r.empty&&r.to==a.from&&(a=e.doc.lineAt(r.to-1)),n>=i.number){let e=t[t.length-1];e.to=a.to,e.ranges.push(r)}else t.push({from:i.from,to:a.to,ranges:[r]});n=a.number+1}return t}function fZ(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let t of dZ(e)){if(n?t.to==e.doc.length:t.from==0)continue;let a=e.doc.lineAt(n?t.to+1:t.from-1),o=a.length+1;if(n){r.push({from:t.to,to:a.to},{from:t.from,insert:a.text+e.lineBreak});for(let n of t.ranges)i.push(Y.range(Math.min(e.doc.length,n.anchor+o),Math.min(e.doc.length,n.head+o)))}else{r.push({from:a.from,to:t.from},{from:t.to,insert:e.lineBreak+a.text});for(let e of t.ranges)i.push(Y.range(e.anchor-o,e.head-o))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:Y.create(i,e.selection.mainIndex),userEvent:`move.line`})),!0):!1}var pZ=({state:e,dispatch:t})=>fZ(e,t,!1),mZ=({state:e,dispatch:t})=>fZ(e,t,!0);function hZ(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of dZ(e))n?r.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):r.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});let i=e.changes(r);return t(e.update({changes:i,selection:e.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:`input.copyline`})),!0}var gZ=({state:e,dispatch:t})=>hZ(e,t,!1),_Z=({state:e,dispatch:t})=>hZ(e,t,!0),vZ=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(dZ(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),r=UY(t.selection,t=>{let n;if(e.lineWrapping){let r=e.lineBlockAt(t.head),i=e.coordsAtPos(t.head,t.assoc||1);i&&(n=r.bottom+e.documentTop-i.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:`delete.line`}),!0};function yZ(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=VK(e).resolveInner(t),r=n.childBefore(t),i=n.childAfter(t),a;return r&&i&&r.to<=t&&i.from>=t&&(a=r.type.prop(EF.closedBy))&&a.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}var bZ=SZ(!1),xZ=SZ(!0);function SZ(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(n=>{let{from:r,to:i}=n,a=t.doc.lineAt(r),o=!e&&r==i&&yZ(t,r);e&&(r=i=(i<=a.to?a:t.doc.lineAt(i)).to);let s=new rq(t,{simulateBreak:r,simulateDoubleBreak:!!o}),c=nq(s,r);for(c??=tz(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize);i<a.to&&/\s/.test(a.text[i-a.from]);)i++;o?{from:r,to:i}=o:r>a.from&&r<a.from+100&&!/\S/.test(a.text.slice(0,r))&&(r=a.from);let l=[``,tq(t,c)];return o&&l.push(tq(t,s.lineIndent(a.from,-1))),{changes:{from:r,to:i,insert:gL.of(l)},range:Y.cursor(r+1+l[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:`input`})),!0}}function CZ(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let a=r.from;a<=r.to;){let o=e.doc.lineAt(a);o.number>n&&(r.empty||r.to>o.from)&&(t(o,i,r),n=o.number),a=o.to+1}let a=e.changes(i);return{changes:i,range:Y.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}var wZ=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new rq(e,{overrideIndentation:e=>n[e]??-1}),i=CZ(e,(t,i,a)=>{let o=nq(r,t.from);if(o==null)return;/\S/.test(t.text)||(o=0);let s=/^\s*/.exec(t.text)[0],c=tq(e,o);(s!=c||a.from<t.from+s.length)&&(n[t.from]=o,i.push({from:t.from,to:t.from+s.length,insert:c}))});return i.changes.empty||t(e.update(i,{userEvent:`indent`})),!0},TZ=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(CZ(e,(t,n)=>{n.push({from:t.from,insert:e.facet($K)})}),{userEvent:`input.indent`})),!0),EZ=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(CZ(e,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let i=tz(r,e.tabSize),a=0,o=tq(e,Math.max(0,i-eq(e)));for(;a<r.length&&a<o.length&&r.charCodeAt(a)==o.charCodeAt(a);)a++;n.push({from:t.from+a,to:t.from+r.length,insert:o.slice(a)})}),{userEvent:`delete.dedent`})),!0),DZ=e=>(e.setTabFocusMode(),!0),OZ=[{key:`Ctrl-b`,run:YY,shift:SX,preventDefault:!0},{key:`Ctrl-f`,run:XY,shift:CX},{key:`Ctrl-p`,run:aX,shift:AX},{key:`Ctrl-n`,run:oX,shift:jX},{key:`Ctrl-a`,run:gX,shift:zX},{key:`Ctrl-e`,run:_X,shift:BX},{key:`Ctrl-d`,run:nZ},{key:`Ctrl-h`,run:tZ},{key:`Ctrl-k`,run:oZ},{key:`Ctrl-Alt-h`,run:iZ},{key:`Ctrl-o`,run:lZ},{key:`Ctrl-t`,run:uZ},{key:`Ctrl-v`,run:uX}],kZ=[{key:`ArrowLeft`,run:YY,shift:SX,preventDefault:!0},{key:`Mod-ArrowLeft`,mac:`Alt-ArrowLeft`,run:QY,shift:TX,preventDefault:!0},{mac:`Cmd-ArrowLeft`,run:mX,shift:LX,preventDefault:!0},{key:`ArrowRight`,run:XY,shift:CX,preventDefault:!0},{key:`Mod-ArrowRight`,mac:`Alt-ArrowRight`,run:$Y,shift:EX,preventDefault:!0},{mac:`Cmd-ArrowRight`,run:hX,shift:RX,preventDefault:!0},{key:`ArrowUp`,run:aX,shift:AX,preventDefault:!0},{mac:`Cmd-ArrowUp`,run:VX,shift:UX},{mac:`Ctrl-ArrowUp`,run:lX,shift:NX},{key:`ArrowDown`,run:oX,shift:jX,preventDefault:!0},{mac:`Cmd-ArrowDown`,run:HX,shift:WX},{mac:`Ctrl-ArrowDown`,run:uX,shift:PX},{key:`PageUp`,run:lX,shift:NX},{key:`PageDown`,run:uX,shift:PX},{key:`Home`,run:pX,shift:IX,preventDefault:!0},{key:`Mod-Home`,run:VX,shift:UX},{key:`End`,run:fX,shift:FX,preventDefault:!0},{key:`Mod-End`,run:HX,shift:WX},{key:`Enter`,run:bZ,shift:bZ},{key:`Mod-a`,run:GX},{key:`Backspace`,run:tZ,shift:tZ,preventDefault:!0},{key:`Delete`,run:nZ,preventDefault:!0},{key:`Mod-Backspace`,mac:`Alt-Backspace`,run:iZ,preventDefault:!0},{key:`Mod-Delete`,mac:`Alt-Delete`,run:aZ,preventDefault:!0},{mac:`Mod-Backspace`,run:sZ,preventDefault:!0},{mac:`Mod-Delete`,run:cZ,preventDefault:!0}].concat(OZ.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),AZ=[{key:`Alt-ArrowLeft`,mac:`Ctrl-ArrowLeft`,run:nX,shift:DX},{key:`Alt-ArrowRight`,mac:`Ctrl-ArrowRight`,run:rX,shift:OX},{key:`Alt-ArrowUp`,run:pZ},{key:`Shift-Alt-ArrowUp`,run:gZ},{key:`Alt-ArrowDown`,run:mZ},{key:`Shift-Alt-ArrowDown`,run:_Z},{key:`Mod-Alt-ArrowUp`,run:YX},{key:`Mod-Alt-ArrowDown`,run:XX},{key:`Escape`,run:ZX},{key:`Mod-Enter`,run:xZ},{key:`Alt-l`,mac:`Ctrl-l`,run:KX},{key:`Mod-i`,run:qX,preventDefault:!0},{key:`Mod-[`,run:EZ},{key:`Mod-]`,run:TZ},{key:`Mod-Alt-\\`,run:wZ},{key:`Shift-Mod-k`,run:vZ},{key:`Shift-Mod-\\`,run:yX},{key:`Mod-/`,run:sY},{key:`Alt-A`,mac:`Ctrl-A`,run:uY},{key:`Ctrl-m`,mac:`Shift-Alt-m`,run:DZ}].concat(kZ),jZ={key:`Tab`,run:TZ,shift:EZ},MZ=typeof String.prototype.normalize==`function`?e=>e.normalize(`NFKD`):e=>e,NZ=class{constructor(e,t,n=0,r=e.length,i,a){this.test=a,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer=``,this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=i?e=>i(MZ(e)):MZ,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return AL(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=jL(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=ML(e);let r=this.normalize(t);if(r.length)for(let e=0,i=n,a=!0;;e++){let n=r.charCodeAt(e),o=this.match(n,i,a,this.bufferPos+this.bufferStart,e==r.length-1);if(o)return this.value=o,this;if(e==r.length-1)break;a&&e<t.length&&t.charCodeAt(e)==n?i++:a=!1}}}match(e,t,n,r,i){let a=null;for(let t=0;t<this.matches.length;){let n=this.matches[t],o=!1;this.query.charCodeAt(n.index)==e&&(n.index==this.query.length-1?a={from:n.from,to:r,precise:i&&n.precise}:(n.index++,o=!0)),o?t++:this.matches.splice(t,1)}return this.query.charCodeAt(0)==e&&(this.query.length==1?a={from:t,to:r,precise:n&&i}:this.matches.push({from:t,index:1,precise:n})),a&&this.test&&!this.test(a.from,a.to,this.buffer,this.bufferStart)&&(a=null),a}};typeof Symbol<`u`&&(NZ.prototype[Symbol.iterator]=function(){return this});var PZ={from:-1,to:-1,match:/.*/.exec(``),precise:!0},FZ=`gm`+(/x/.unicode==null?``:`u`),IZ=class{constructor(e,t,n,r=0,i=e.length){if(this.text=e,this.to=i,this.curLine=``,this.done=!1,this.value=PZ,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new zZ(e,t,n,r,i);this.re=new RegExp(t,FZ+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.iter=e.iter();let a=e.lineAt(r);this.curLineStart=a.from,this.matchPos=VZ(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine=``:(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine=``:this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=VZ(this.text,r+ +(n==r)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,precise:!0,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}},LZ=new WeakMap,RZ=class e{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(t,n,r){let i=LZ.get(t);if(!i||i.from>=r||i.to<=n){let i=new e(n,t.sliceString(n,r));return LZ.set(t,i),i}if(i.from==n&&i.to==r)return i;let{text:a,from:o}=i;return o>n&&(a=t.sliceString(n,o)+a,o=n),i.to<r&&(a+=t.sliceString(i.to,r)),LZ.set(t,new e(o,a)),new e(n,a.slice(n-o,r-o))}},zZ=class{constructor(e,t,n,r,i){this.text=e,this.to=i,this.done=!1,this.value=PZ,this.matchPos=VZ(e,r),this.re=new RegExp(t,FZ+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.flat=RZ.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,precise:!0,match:t},this.matchPos=VZ(this.text,n+ +(e==n)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=RZ.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}};typeof Symbol<`u`&&(IZ.prototype[Symbol.iterator]=zZ.prototype[Symbol.iterator]=function(){return this});function BZ(e){try{return new RegExp(e,FZ),!0}catch{return!1}}function VZ(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}var HZ=e=>{let t=iK(e,`cm-goto-line`);if(t){let e=t.dom.querySelector(`input[type=text]`);return e&&e.select(),!0}let{state:n}=e,r=String(n.doc.lineAt(e.state.selection.main.head).number),{close:i,result:a}=rK(e,{class:`cm-goto-line`,label:n.phrase(`Go to line`),input:{type:`text`,name:`line`,value:r},focus:!0,submitLabel:n.phrase(`go`)});return a.then(t=>{let r=t&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.elements.line.value);if(!r){e.dispatch({effects:i});return}let a=n.doc.lineAt(n.selection.main.head),[,o,s,c,l]=r,u=c?+c.slice(1):0,d=s?+s:a.number;if(s&&l){let e=d/100;o&&(e=e*(o==`-`?-1:1)+a.number/n.doc.lines),d=Math.round(n.doc.lines*e)}else s&&o&&(d=d*(o==`-`?-1:1)+a.number);let f=n.doc.line(Math.max(1,Math.min(n.doc.lines,d))),p=Y.cursor(f.from+Math.max(0,Math.min(u,f.length)));e.dispatch({effects:[i,$.scrollIntoView(p.from,{y:`center`})],selection:p})}),!0},UZ={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},WZ=X.define({combine(e){return FR(e,UZ,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function GZ(e){let t=[ZZ,XZ];return e&&t.push(WZ.of(e)),t}var KZ=Q.mark({class:`cm-selectionMatch`}),qZ=Q.mark({class:`cm-selectionMatch cm-selectionMatch-main`});function JZ(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=kR.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=kR.Word)}function YZ(e,t,n,r){return e(t.sliceDoc(n,n+1))==kR.Word&&e(t.sliceDoc(r-1,r))==kR.Word}var XZ=sV.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(WZ),{state:n}=e,r=n.selection;if(r.ranges.length>1)return Q.none;let i=r.main,a,o=null;if(i.empty){if(!t.highlightWordAroundCursor)return Q.none;let e=n.wordAt(i.head);if(!e)return Q.none;o=n.charCategorizer(i.head),a=n.sliceDoc(e.from,e.to)}else{let e=i.to-i.from;if(e<t.minSelectionLength||e>200)return Q.none;if(t.wholeWords){if(a=n.sliceDoc(i.from,i.to),o=n.charCategorizer(i.head),!(JZ(o,n,i.from,i.to)&&YZ(o,n,i.from,i.to)))return Q.none}else if(a=n.sliceDoc(i.from,i.to),!a)return Q.none}let s=[];for(let r of e.visibleRanges){let e=new NZ(n.doc,a,r.from,r.to);for(;!e.next().done;){let{from:r,to:a}=e.value;if((!o||JZ(o,n,r,a))&&(i.empty&&r<=i.from&&a>=i.to?s.push(qZ.range(r,a)):(r>=i.to||a<=i.from)&&s.push(KZ.range(r,a)),s.length>t.maxMatches))return Q.none}}return Q.set(s)}},{decorations:e=>e.decorations}),ZZ=$.baseTheme({".cm-selectionMatch":{backgroundColor:`#99ff7780`},".cm-searchMatch .cm-selectionMatch":{backgroundColor:`transparent`}}),QZ=({state:e,dispatch:t})=>{let{selection:n}=e,r=Y.create(n.ranges.map(t=>e.wordAt(t.head)||Y.cursor(t.head)),n.mainIndex);return!r.eq(n)&&(t(e.update({selection:r})),!0)};function $Z(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),a=i&&i.from==n.from&&i.to==n.to;for(let n=!1,i=new NZ(e.doc,t,r[r.length-1].to);;)if(i.next(),i.done){if(n)return null;i=new NZ(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),n=!0}else{if(n&&r.some(e=>e.from==i.value.from))continue;if(a){let t=e.wordAt(i.value.from);if(!t||t.from!=i.value.from||t.to!=i.value.to)continue}return i.value}}var eQ=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return QZ({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=r))return!1;let i=$Z(e,r);return i?(t(e.update({selection:e.selection.addRange(Y.range(i.from,i.to),!1),effects:$.scrollIntoView(i.to)})),!0):!1},tQ=X.define({combine(e){return FR(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new FQ(e),scrollToMatch:e=>$.scrollIntoView(e)})}}),nQ=class{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||``,this.valid=!!this.search&&(!this.regexp||BZ(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>t==`n`?`
26
- `:t==`r`?`\r`:t==`t`?` `:`\\`)}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new pQ(this):new sQ(this)}getCursor(e,t=0,n){let r=e.doc?e:PR.create({doc:e});return n??=r.doc.length,this.regexp?lQ(this,r,t,n):aQ(this,r,t,n)}},rQ=class{constructor(e){this.spec=e}};function iQ(e,t,n){return(r,i,a,o)=>n&&!n(r,i,a,o)?!1:e(r>=o&&i<=o+a.length?a.slice(r-o,i-o):t.doc.sliceString(r,i),t,r,i)}function aQ(e,t,n,r){let i;return e.wholeWord&&(i=oQ(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(i=iQ(e.test,t,i)),new NZ(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase(),i)}function oQ(e,t){return(n,r,i,a)=>((a>n||a+i.length<r)&&(a=Math.max(0,n-2),i=e.sliceString(a,Math.min(e.length,r+2))),(t(uQ(i,n-a))!=kR.Word||t(dQ(i,n-a))!=kR.Word)&&(t(dQ(i,r-a))!=kR.Word||t(uQ(i,r-a))!=kR.Word))}var sQ=class extends rQ{constructor(e){super(e)}nextMatch(e,t,n){let r=aQ(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=aQ(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),i=aQ(this.spec,e,n,r),a=null;for(;!i.nextOverlapping().done;)a=i.value;if(a)return a;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length),r&&(r.from!=t||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=aQ(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=aQ(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}};function cQ(e,t,n){return(r,i,a)=>(!n||n(r,i,a))&&e(a[0],t,r,i)}function lQ(e,t,n,r){let i;return e.wholeWord&&(i=fQ(t.charCategorizer(t.selection.main.head))),e.test&&(i=cQ(e.test,t,i)),new IZ(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:i},n,r)}function uQ(e,t){return e.slice(DL(e,t,!1),t)}function dQ(e,t){return e.slice(t,DL(e,t))}function fQ(e){return(t,n,r)=>!r[0].length||(e(uQ(r.input,r.index))!=kR.Word||e(dQ(r.input,r.index))!=kR.Word)&&(e(dQ(r.input,r.index+r[0].length))!=kR.Word||e(uQ(r.input,r.index+r[0].length))!=kR.Word)}var pQ=class extends rQ{nextMatch(e,t,n){let r=lQ(this.spec,e,n,e.doc.length).next();return r.done&&(r=lQ(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let i=Math.max(t,n-r*1e4),a=lQ(this.spec,e,i,n),o=null;for(;!a.next().done;)o=a.value;if(o&&(i==t||o.from>i+10))return o;if(i==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if(n==`&`)return e.match[0];if(n==`$`)return`$`;for(let t=n.length;t>0;t--){let r=+n.slice(0,t);if(r>0&&r<e.match.length)return e.match[r]+n.slice(t)}return t})}matchAll(e,t){let n=lQ(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=lQ(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}},mQ=yR.define(),hQ=yR.define(),gQ=QL.define({create(e){return new _Q(kQ(e).create(),null)},update(e,t){for(let n of t.effects)n.is(mQ)?e=new _Q(n.value.create(),e.panel):n.is(hQ)&&(e=new _Q(e.query,n.value?OQ:null));return e},provide:e=>nK.from(e,e=>e.panel)}),_Q=class{constructor(e,t){this.query=e,this.panel=t}},vQ=Q.mark({class:`cm-searchMatch`}),yQ=Q.mark({class:`cm-searchMatch cm-searchMatch-selected`}),bQ=sV.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(gQ))}update(e){let t=e.state.field(gQ);(t!=e.startState.field(gQ)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return Q.none;let{view:n}=this,r=new WR;for(let t=0,i=n.visibleRanges,a=i.length;t<a;t++){let{from:o,to:s}=i[t];for(;t<a-1&&s>i[t+1].from-500;)s=i[++t].to;e.highlight(n.state,o,s,(e,t)=>{let i=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);r.add(e,t,i?yQ:vQ)})}return r.finish()}},{decorations:e=>e.decorations});function xQ(e){return t=>{let n=t.state.field(gQ,!1);return n&&n.query.spec.valid?e(t,n):MQ(t)}}var SQ=xQ((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=Y.single(r.from,r.to),a=e.state.facet(tQ);return e.dispatch({selection:i,effects:[zQ(e,r),a.scrollToMatch(i.main,e)],userEvent:`select.search`}),jQ(e),!0}),CQ=xQ((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let a=Y.single(i.from,i.to),o=e.state.facet(tQ);return e.dispatch({selection:a,effects:[zQ(e,i),o.scrollToMatch(a.main,e)],userEvent:`select.search`}),jQ(e),!0}),wQ=xQ((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:Y.create(n.map(e=>Y.range(e.from,e.to))),userEvent:`select.search.matches`}),!0)}),TQ=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,a=[],o=0;for(let t=new NZ(e.doc,e.sliceDoc(r,i));!t.next().done;){if(a.length>1e3)return!1;t.value.from==r&&(o=a.length),a.push(Y.range(t.value.from,t.value.to))}return t(e.update({selection:Y.create(a,o),userEvent:`select.search.matches`})),!0},EQ=xQ((e,{query:t})=>{let{state:n}=e,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let a=t.nextMatch(n,r,r);if(!a)return!1;let o=a,s=[],c,l,u=[];o.precise?o.from==r&&o.to==i&&(l=n.toText(t.getReplacement(o)),s.push({from:o.from,to:o.to,insert:l}),o=t.nextMatch(n,o.from,o.to),u.push($.announce.of(n.phrase(`replaced match on line $`,n.doc.lineAt(r).number)+`.`))):o=t.nextMatch(n,o.from,o.to);let d=e.state.changes(s);return o&&(c=Y.single(o.from,o.to).map(d),u.push(zQ(e,o)),u.push(n.facet(tQ).scrollToMatch(c.main,e))),e.dispatch({changes:d,selection:c,effects:u,userEvent:`input.replace`}),!0}),DQ=xQ((e,{query:t})=>{if(e.state.readOnly)return!1;let n=[];for(let r of t.matchAll(e.state,1e9)){let{from:e,to:i,precise:a}=r;a&&n.push({from:e,to:i,insert:t.getReplacement(r)})}if(!n.length)return!1;let r=e.state.phrase(`replaced $ matches`,n.length)+`.`;return e.dispatch({changes:n,effects:$.announce.of(r),userEvent:`input.replace.all`}),!0});function OQ(e){return e.state.facet(tQ).createPanel(e)}function kQ(e,t){let n=e.selection.main,r=n.empty||n.to>n.from+100?``:e.sliceDoc(n.from,n.to);if(t&&!r)return t;let i=e.facet(tQ);return new nQ({search:t?.literal??i.literal?r:r.replace(/\n/g,`\\n`),caseSensitive:t?.caseSensitive??i.caseSensitive,literal:t?.literal??i.literal,regexp:t?.regexp??i.regexp,wholeWord:t?.wholeWord??i.wholeWord})}function AQ(e){let t=QG(e,OQ);return t&&t.dom.querySelector(`[main-field]`)}function jQ(e){let t=AQ(e);t&&t==e.root.activeElement&&t.select()}var MQ=e=>{let t=e.state.field(gQ,!1);if(t&&t.panel){let n=AQ(e);if(n&&n!=e.root.activeElement){let r=kQ(e.state,t.query.spec);r.valid&&e.dispatch({effects:mQ.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[hQ.of(!0),t?mQ.of(kQ(e.state,t.query.spec)):yR.appendConfig.of(VQ)]});return!0},NQ=e=>{let t=e.state.field(gQ,!1);if(!t||!t.panel)return!1;let n=QG(e,OQ);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:hQ.of(!1)}),!0},PQ=[{key:`Mod-f`,run:MQ,scope:`editor search-panel`},{key:`F3`,run:SQ,shift:CQ,scope:`editor search-panel`,preventDefault:!0},{key:`Mod-g`,run:SQ,shift:CQ,scope:`editor search-panel`,preventDefault:!0},{key:`Escape`,run:NQ,scope:`editor search-panel`},{key:`Mod-Shift-l`,run:TQ},{key:`Mod-Alt-g`,run:HZ},{key:`Mod-d`,run:eQ,preventDefault:!0}],FQ=class{constructor(e){this.view=e;let t=this.query=e.state.field(gQ).query.spec;this.commit=this.commit.bind(this),this.searchField=_z(`input`,{value:t.search,placeholder:IQ(e,`Find`),"aria-label":IQ(e,`Find`),class:`cm-textfield`,name:`search`,form:``,"main-field":`true`,onchange:this.commit,onkeyup:this.commit}),this.replaceField=_z(`input`,{value:t.replace,placeholder:IQ(e,`Replace`),"aria-label":IQ(e,`Replace`),class:`cm-textfield`,name:`replace`,form:``,onchange:this.commit,onkeyup:this.commit}),this.caseField=_z(`input`,{type:`checkbox`,name:`case`,form:``,checked:t.caseSensitive,onchange:this.commit}),this.reField=_z(`input`,{type:`checkbox`,name:`re`,form:``,checked:t.regexp,onchange:this.commit}),this.wordField=_z(`input`,{type:`checkbox`,name:`word`,form:``,checked:t.wholeWord,onchange:this.commit});function n(e,t,n){return _z(`button`,{class:`cm-button`,name:e,onclick:t,type:`button`},n)}this.dom=_z(`div`,{onkeydown:e=>this.keydown(e),class:`cm-search`},[this.searchField,n(`next`,()=>SQ(e),[IQ(e,`next`)]),n(`prev`,()=>CQ(e),[IQ(e,`previous`)]),n(`select`,()=>wQ(e),[IQ(e,`all`)]),_z(`label`,null,[this.caseField,IQ(e,`match case`)]),_z(`label`,null,[this.reField,IQ(e,`regexp`)]),_z(`label`,null,[this.wordField,IQ(e,`by word`)]),...e.state.readOnly?[]:[_z(`br`),this.replaceField,n(`replace`,()=>EQ(e),[IQ(e,`replace`)]),n(`replaceAll`,()=>DQ(e),[IQ(e,`replace all`)])],_z(`button`,{name:`close`,onclick:()=>NQ(e),"aria-label":IQ(e,`close`),type:`button`},[`×`])])}commit(){let e=new nQ({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:mQ.of(e)}))}keydown(e){DW(this.view,e,`search-panel`)?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?CQ:SQ)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),EQ(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(mQ)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(tQ).top}};function IQ(e,t){return e.state.phrase(t)}var LQ=30,RQ=/[\s\.,:;?!]/;function zQ(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),i=e.state.doc.lineAt(n).to,a=Math.max(r.from,t-LQ),o=Math.min(i,n+LQ),s=e.state.sliceDoc(a,o);if(a!=r.from){for(let e=0;e<LQ;e++)if(!RQ.test(s[e+1])&&RQ.test(s[e])){s=s.slice(e);break}}if(o!=i){for(let e=s.length-1;e>s.length-LQ;e--)if(!RQ.test(s[e-1])&&RQ.test(s[e])){s=s.slice(0,e);break}}return $.announce.of(`${e.state.phrase(`current match`)}. ${s} ${e.state.phrase(`on line`)} ${r.number}.`)}var BQ=$.baseTheme({".cm-panel.cm-search":{padding:`2px 6px 4px`,position:`relative`,"& [name=close]":{position:`absolute`,top:`0`,right:`4px`,backgroundColor:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0},"& input, & button, & label":{margin:`.2em .6em .2em 0`},"& input[type=checkbox]":{marginRight:`.2em`},"& label":{fontSize:`80%`,whiteSpace:`pre`}},"&light .cm-searchMatch":{backgroundColor:`#ffff0054`},"&dark .cm-searchMatch":{backgroundColor:`#00ffff8a`},"&light .cm-searchMatch-selected":{backgroundColor:`#ff6a0054`},"&dark .cm-searchMatch-selected":{backgroundColor:`#ff00ff8a`}}),VQ=[gQ,tR.low(bQ),BQ],HQ=class{constructor(e,t,n,r){this.state=e,this.pos=t,this.explicit=n,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=VK(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),r=t.text.slice(n-t.from,this.pos-t.from),i=r.search(JQ(e,!1));return i<0?null:{from:n+i,to:this.pos,text:r.slice(i)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,n){e==`abort`&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}};function UQ(e){let t=Object.keys(e).join(``),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,``)),`[${n?`\\w`:``}${t.replace(/[^\w\s]/g,`\\$&`)}]`}function WQ(e){let t=Object.create(null),n=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let e=1;e<r.length;e++)n[r[e]]=!0}let r=UQ(t)+UQ(n)+`*$`;return[RegExp(`^`+r),new RegExp(r)]}function GQ(e){let t=e.map(e=>typeof e==`string`?{label:e}:e),[n,r]=t.every(e=>/^\w+$/.test(e.label))?[/\w*$/,/\w+$/]:WQ(t);return e=>{let i=e.matchBefore(r);return i||e.explicit?{from:i?i.from:e.pos,options:t,validFor:n}:null}}var KQ=class{constructor(e,t,n,r){this.completion=e,this.source=t,this.match=n,this.score=r}};function qQ(e){return e.selection.main.from}function JQ(e,t){let{source:n}=e,r=t&&n[0]!=`^`,i=n[n.length-1]!=`$`;return!r&&!i?e:RegExp(`${r?`^`:``}(?:${n})${i?`$`:``}`,e.flags??(e.ignoreCase?`i`:``))}var YQ=gR.define();function XQ(e,t,n,r){let{main:i}=e.selection,a=n-i.from,o=r-i.from;return{...e.changeByRange(s=>{if(s!=i&&n!=r&&e.sliceDoc(s.from+a,s.from+o)!=e.sliceDoc(n,r))return{range:s};let c=e.toText(t);return{changes:{from:s.from+a,to:r==i.from?s.to:s.from+o,insert:c},range:Y.cursor(s.from+a+c.length)}}),scrollIntoView:!0,userEvent:`input.complete`}}var ZQ=new WeakMap;function QQ(e){if(!Array.isArray(e))return e;let t=ZQ.get(e);return t||ZQ.set(e,t=GQ(e)),t}var $Q=yR.define(),e$=yR.define(),t$=class{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let n=AL(e,t),r=ML(n);this.chars.push(n);let i=e.slice(t,t+r),a=i.toUpperCase();this.folded.push(AL(a==i?i.toLowerCase():a,0)),t+=r}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:n,any:r,precise:i,byWord:a}=this;if(t.length==1){let r=AL(e,0),i=ML(r),a=i==e.length?0:-100;if(r!=t[0]){if(r==n[0])a+=-200;else return null}return this.ret(a,[0,i])}let o=e.indexOf(this.pattern);if(o==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let s=t.length,c=0;if(o<0){for(let i=0,a=Math.min(e.length,200);i<a&&c<s;){let a=AL(e,i);(a==t[c]||a==n[c])&&(r[c++]=i),i+=ML(a)}if(c<s)return null}let l=0,u=0,d=!1,f=0,p=-1,m=-1,h=/[a-z]/.test(e),g=!0;for(let r=0,c=Math.min(e.length,200),_=0;r<c&&u<s;){let c=AL(e,r);o<0&&(l<s&&c==t[l]&&(i[l++]=r),f<s&&(c==t[f]||c==n[f]?(f==0&&(p=r),m=r+1,f++):f=0));let v,y=c<255?c>=48&&c<=57||c>=97&&c<=122?2:+(c>=65&&c<=90):(v=jL(c))==v.toLowerCase()?v==v.toUpperCase()?0:2:1;(!r||y==1&&h||_==0&&y!=0)&&(t[u]==c||n[u]==c&&(d=!0)?a[u++]=r:a.length&&(g=!1)),_=y,r+=ML(c)}return u==s&&a[0]==0&&g?this.result(-100+(d?-200:0),a,e):f==s&&p==0?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):o>-1?this.ret(-700-e.length,[o,o+this.pattern.length]):f==s?this.ret(-900-e.length,[p,m]):u==s?this.result(-100+(d?-200:0)+-700+(g?0:-1100),a,e):t.length==2?null:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,t,n){let r=[],i=0;for(let e of t){let t=e+(this.astral?ML(AL(n,e)):1);i&&r[i-1]==e?r[i-1]=t:(r[i++]=e,r[i++]=t)}return this.ret(e-n.length,r)}},n$=class{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),n=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return n==null?null:(this.matched=[0,t.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}},r$=X.define({combine(e){return FR(e,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>``,optionClass:()=>``,aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:a$,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>i$(e(n),t(n)),optionClass:(e,t)=>n=>i$(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function i$(e,t){return e?t?e+` `+t:e:t}function a$(e,t,n,r,i,a){let o=e.textDirection==yB.RTL,s=o,c=!1,l=`top`,u,d,f=t.left-i.left,p=i.right-t.right,m=r.right-r.left,h=r.bottom-r.top;if(s&&f<Math.min(m,p)?s=!1:!s&&p<Math.min(m,f)&&(s=!0),m<=(s?f:p))u=Math.max(i.top,Math.min(n.top,i.bottom-h))-t.top,d=Math.min(400,s?f:p);else{c=!0,d=Math.min(400,(o?t.right:i.right-t.left)-30);let e=i.bottom-t.bottom;e>=h||e>t.top?u=n.bottom-t.top:(l=`bottom`,u=t.bottom-n.top)}let g=(t.bottom-t.top)/a.offsetHeight,_=(t.right-t.left)/a.offsetWidth;return{style:`${l}: ${u/g}px; max-width: ${d/_}px`,class:`cm-completionInfo-`+(c?o?`left-narrow`:`right-narrow`:s?`left`:`right`)}}var o$=yR.define();function s$(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(e){let t=document.createElement(`div`);return t.classList.add(`cm-completionIcon`),e.type&&t.classList.add(...e.type.split(/\s+/g).map(e=>`cm-completionIcon-`+e)),t.setAttribute(`aria-hidden`,`true`),t},position:20}),t.push({render(e,t,n,r){let i=document.createElement(`span`);i.className=`cm-completionLabel`;let a=e.displayLabel||e.label,o=0;for(let e=0;e<r.length;){let t=r[e++],n=r[e++];t>o&&i.appendChild(document.createTextNode(a.slice(o,t)));let s=i.appendChild(document.createElement(`span`));s.appendChild(document.createTextNode(a.slice(t,n))),s.className=`cm-completionMatchedText`,o=n}return o<a.length&&i.appendChild(document.createTextNode(a.slice(o))),i},position:50},{render(e){if(!e.detail)return null;let t=document.createElement(`span`);return t.className=`cm-completionDetail`,t.textContent=e.detail,t},position:80}),t.sort((e,t)=>e.position-t.position).map(e=>e.render)}function c$(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let e=Math.floor(t/n);return{from:e*n,to:(e+1)*n}}let r=Math.ceil((e-t)/n);return{from:e-r*n,to:e-(r-1)*n}}var l$=class{constructor(e,t,n){this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:e=>this.placeInfo(e),key:this},this.space=null,this.currentClass=``;let r=e.state.field(t),{options:i,selected:a}=r.open,o=e.state.facet(r$);this.optionContent=s$(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=c$(i.length,a,o.maxRenderedOptions),this.dom=document.createElement(`div`),this.dom.className=`cm-tooltip-autocomplete`,this.updateTooltipClass(e.state),this.dom.addEventListener(`mousedown`,n=>{let{options:r}=e.state.field(t).open;for(let t=n.target,i;t&&t!=this.dom;t=t.parentNode)if(t.nodeName==`LI`&&(i=/-(\d+)$/.exec(t.id))&&+i[1]<r.length){this.applyCompletion(e,r[+i[1]]),n.preventDefault();return}if(n.target==this.list){let t=this.list.classList.contains(`cm-completionListIncompleteTop`)&&n.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains(`cm-completionListIncompleteBottom`)&&n.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;t!=null&&(e.dispatch({effects:o$.of(t)}),n.preventDefault())}}),this.dom.addEventListener(`focusout`,t=>{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(r$).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:e$.of(null)})}),this.showOptions(i,r.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener(`scroll`,()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){let t=e.state.field(this.stateField),n=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),t!=n){let{options:r,selected:i,disabled:a}=t.open;(!n.open||n.open.options!=r)&&(this.range=c$(r.length,i,e.state.facet(r$).maxRenderedOptions),this.showOptions(r,t.id)),this.updateSel(),a!=n.open?.disabled&&this.dom.classList.toggle(`cm-tooltip-autocomplete-disabled`,!!a)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let e of this.currentClass.split(` `))e&&this.dom.classList.remove(e);for(let e of t.split(` `))e&&this.dom.classList.add(e);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=c$(t.options.length,t.selected,this.view.state.facet(r$).maxRenderedOptions),this.showOptions(t.options,e.id));let n=this.updateSelectedOption(t.selected);if(n){this.destroyInfo();let{completion:r}=t.options[t.selected],{info:i}=r;if(!i)return;let a=typeof i==`string`?document.createTextNode(i):i(r);if(!a)return;`then`in a?a.then(t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,r)}).catch(e=>rV(this.view.state,e,`completion info`)):(this.addInfoPane(a,r),n.setAttribute(`aria-describedby`,this.info.id))}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement(`div`);if(n.className=`cm-tooltip cm-completionInfo`,n.id=`cm-completionInfo-`+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)n.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:r}=e;n.appendChild(t),this.infoDestroy=r||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,r=this.range.from;n;n=n.nextSibling,r++)n.nodeName!=`LI`||!n.id?r--:r==e?n.hasAttribute(`aria-selected`)||(n.setAttribute(`aria-selected`,`true`),t=n):n.hasAttribute(`aria-selected`)&&(n.removeAttribute(`aria-selected`),n.removeAttribute(`aria-describedby`));return t&&d$(this.list,t),t}measureInfo(){let e=this.dom.querySelector(`[aria-selected]`);if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),r=e.getBoundingClientRect(),i=this.space;if(!i){let e=this.dom.ownerDocument.documentElement;i={left:0,top:0,right:e.clientWidth,bottom:e.clientHeight}}return r.top>Math.min(i.bottom,t.bottom)-10||r.bottom<Math.max(i.top,t.top)+10?null:this.view.state.facet(r$).positionInfo(this.view,t,r,n,i,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className=`cm-tooltip cm-completionInfo `+(e.class||``)):this.info.style.cssText=`top: -1e6px`)}createListBox(e,t,n){let r=document.createElement(`ul`);r.id=t,r.setAttribute(`role`,`listbox`),r.setAttribute(`aria-expanded`,`true`),r.setAttribute(`aria-label`,this.view.state.phrase(`Completions`)),r.addEventListener(`mousedown`,e=>{e.target==r&&e.preventDefault()});let i=null;for(let a=n.from;a<n.to;a++){let{completion:o,match:s}=e[a],{section:c}=o;if(c){let e=typeof c==`string`?c:c.name;if(e!=i&&(a>n.from||n.from==0)){if(i=e,typeof c!=`string`&&c.header)r.appendChild(c.header(c));else{let t=r.appendChild(document.createElement(`completion-section`));t.textContent=e}}}let l=r.appendChild(document.createElement(`li`));l.id=t+`-`+a,l.setAttribute(`role`,`option`);let u=this.optionClass(o);u&&(l.className=u);for(let e of this.optionContent){let t=e(o,this.view.state,this.view,s);t&&l.appendChild(t)}}return n.from&&r.classList.add(`cm-completionListIncompleteTop`),n.to<e.length&&r.classList.add(`cm-completionListIncompleteBottom`),r}destroyInfo(){this.info&&=(this.infoDestroy&&this.infoDestroy(),this.info.remove(),null)}destroy(){this.destroyInfo()}};function u$(e,t){return n=>new l$(n,e,t)}function d$(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=n.height/e.offsetHeight;r.top<n.top?e.scrollTop-=(n.top-r.top)/i:r.bottom>n.bottom&&(e.scrollTop+=(r.bottom-n.bottom)/i)}function f$(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+ +!!e.type}function p$(e,t){let n=[],r=null,i=null,a=e=>{n.push(e);let{section:t}=e.completion;if(t){r||=[];let e=typeof t==`string`?t:t.name;r.some(t=>t.name==e)||r.push(typeof t==`string`?{name:e}:t)}},o=t.facet(r$);for(let r of e)if(r.hasResult()){let e=r.result.getMatch;if(r.result.filter===!1)for(let t of r.result.options)a(new KQ(t,r.source,e?e(t):[],1e9-n.length));else{let n=t.sliceDoc(r.from,r.to),s,c=o.filterStrict?new n$(n):new t$(n);for(let t of r.result.options)if(s=c.match(t.label)){let n=t.displayLabel?e?e(t,s.matched):[]:s.matched,o=s.score+(t.boost||0);if(a(new KQ(t,r.source,n,o)),typeof t.section==`object`&&t.section.rank===`dynamic`){let{name:e}=t.section;i||=Object.create(null),i[e]=Math.max(o,i[e]||-1e9)}}}}if(r){let e=Object.create(null),t=0,a=(e,t)=>(e.rank===`dynamic`&&t.rank===`dynamic`?i[t.name]-i[e.name]:0)||(typeof e.rank==`number`?e.rank:1e9)-(typeof t.rank==`number`?t.rank:1e9)||(e.name<t.name?-1:1);for(let n of r.sort(a))t-=1e5,e[n.name]=t;for(let t of n){let{section:n}=t.completion;n&&(t.score+=e[typeof n==`string`?n:n.name])}}let s=[],c=null,l=o.compareCompletions;for(let e of n.sort((e,t)=>t.score-e.score||l(e.completion,t.completion))){let t=e.completion;!c||c.label!=t.label||c.detail!=t.detail||c.type!=null&&t.type!=null&&c.type!=t.type||c.apply!=t.apply||c.boost!=t.boost?s.push(e):f$(e.completion)>f$(c)&&(s[s.length-1]=e),c=e.completion}return s}var m$=class e{constructor(e,t,n,r,i,a){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=r,this.selected=i,this.disabled=a}setSelected(t,n){return t==this.selected||t>=this.options.length?this:new e(this.options,y$(n,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,n,r,i,a,o){if(i&&!o&&t.some(e=>e.isPending))return i.setDisabled();let s=p$(t,n);if(!s.length)return i&&t.some(e=>e.isPending)?i.setDisabled():null;let c=n.facet(r$).selectOnOpen?0:-1;if(i&&i.selected!=c&&i.selected!=-1){let e=i.options[i.selected].completion;for(let t=0;t<s.length;t++)if(s[t].completion==e){c=t;break}}return new e(s,y$(r,c),{pos:t.reduce((e,t)=>t.hasResult()?Math.min(e,t.from):e,1e8),create:O$,above:a.aboveCursor},i?i.timestamp:Date.now(),c,!1)}map(t){return new e(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new e(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}},h$=class e{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new e(b$,`cm-ac-`+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:n}=t,r=n.facet(r$),i=(r.override||n.languageDataAt(`autocomplete`,qQ(n)).map(QQ)).map(e=>(this.active.find(t=>t.source==e)||new S$(e,+!!this.active.some(e=>e.state!=0))).update(t,r));i.length==this.active.length&&i.every((e,t)=>e==this.active[t])&&(i=this.active);let a=this.open,o=t.effects.some(e=>e.is(T$));a&&t.docChanged&&(a=a.map(t.changes)),t.selection||i.some(e=>e.hasResult()&&t.changes.touchesRange(e.from,e.to))||!g$(i,this.active)||o?a=m$.build(i,n,this.id,a,r,o):a&&a.disabled&&!i.some(e=>e.isPending)&&(a=null),!a&&i.every(e=>!e.isPending)&&i.some(e=>e.hasResult())&&(i=i.map(e=>e.hasResult()?new S$(e.source,0):e));for(let e of t.effects)e.is(o$)&&(a&&=a.setSelected(e.value,this.id));return i==this.active&&a==this.open?this:new e(i,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?_$:v$}};function g$(e,t){if(e==t)return!0;for(let n=0,r=0;;){for(;n<e.length&&!e[n].hasResult();)n++;for(;r<t.length&&!t[r].hasResult();)r++;let i=n==e.length,a=r==t.length;if(i||a)return i==a;if(e[n++].result!=t[r++].result)return!1}}var _$={"aria-autocomplete":`list`},v$={};function y$(e,t){let n={"aria-autocomplete":`list`,"aria-haspopup":`listbox`,"aria-controls":e};return t>-1&&(n[`aria-activedescendant`]=e+`-`+t),n}var b$=[];function x$(e,t){if(e.isUserEvent(`input.complete`)){let n=e.annotation(YQ);if(n&&t.activateOnCompletion(n))return 12}let n=e.isUserEvent(`input.type`);return n&&t.activateOnTyping?5:n?1:e.isUserEvent(`delete.backward`)?2:e.selection?8:e.docChanged?16:0}var S$=class e{constructor(e,t,n=!1){this.source=e,this.state=t,this.explicit=n}hasResult(){return!1}get isPending(){return this.state==1}update(t,n){let r=x$(t,n),i=this;(r&8||r&16&&this.touches(t))&&(i=new e(i.source,0)),r&4&&i.state==0&&(i=new e(this.source,1)),i=i.updateFor(t,r);for(let n of t.effects)if(n.is($Q))i=new e(i.source,1,n.value);else if(n.is(e$))i=new e(i.source,0);else if(n.is(T$))for(let e of n.value)e.source==i.source&&(i=e);return i}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(qQ(e.state))}},C$=class e extends S${constructor(e,t,n,r,i,a){super(e,3,t),this.limit=n,this.result=r,this.from=i,this.to=a}hasResult(){return!0}updateFor(t,n){if(!(n&3))return this.map(t.changes);let r=this.result;r.map&&!t.changes.empty&&(r=r.map(r,t.changes));let i=t.changes.mapPos(this.from),a=t.changes.mapPos(this.to,1),o=qQ(t.state);if(o>a||!r||n&2&&(qQ(t.startState)==this.from||o<this.limit))return new S$(this.source,n&4?1:0);let s=t.changes.mapPos(this.limit);return w$(r.validFor,t.state,i,a)?new e(this.source,this.explicit,s,r,i,a):r.update&&(r=r.update(r,i,a,new HQ(t.state,o,!1)))?new e(this.source,this.explicit,s,r,r.from,r.to??qQ(t.state)):new S$(this.source,1,this.explicit)}map(t){if(t.empty)return this;let n=this.result.map?this.result.map(this.result,t):this.result;return n?new e(this.source,this.explicit,t.mapPos(this.limit),n,t.mapPos(this.from),t.mapPos(this.to,1)):new S$(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}};function w$(e,t,n,r){if(!e)return!1;let i=t.sliceDoc(n,r);return typeof e==`function`?e(i,n,r,t):JQ(e,!0).test(i)}var T$=yR.define({map(e,t){return e.map(e=>e.map(t))}}),E$=QL.define({create(){return h$.start()},update(e,t){return e.update(t)},provide:e=>[RG.from(e,e=>e.tooltip),$.contentAttributes.from(e,e=>e.attrs)]});function D$(e,t){let n=t.completion.apply||t.completion.label,r=e.state.field(E$).active.find(e=>e.source==t.source);return r instanceof C$&&(typeof n==`string`?e.dispatch({...XQ(e.state,n,r.from,r.to),annotations:YQ.of(t.completion)}):n(e,t.completion,r.from,r.to),!0)}var O$=u$(E$,D$);function k$(e,t=`option`){return n=>{let r=n.state.field(E$,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(r$).interactionDelay)return!1;let i=1,a;t==`page`&&(a=YG(n,r.open.tooltip))&&(i=Math.max(2,Math.floor(a.dom.offsetHeight/a.dom.querySelector(`li`).offsetHeight)-1));let{length:o}=r.open.options,s=r.open.selected>-1?r.open.selected+i*(e?1:-1):e?0:o-1;return s<0?s=t==`page`?0:o-1:s>=o&&(s=t==`page`?o-1:0),n.dispatch({effects:o$.of(s)}),!0}}var A$=e=>{let t=e.state.field(E$,!1);return e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(r$).interactionDelay?!1:D$(e,t.open.options[t.open.selected])},j$=e=>e.state.field(E$,!1)?(e.dispatch({effects:$Q.of(!0)}),!0):!1,M$=e=>{let t=e.state.field(E$,!1);return!t||!t.active.some(e=>e.state!=0)?!1:(e.dispatch({effects:e$.of(null)}),!0)},N$=class{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}},P$=50,F$=1e3,I$=sV.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(E$).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(E$),n=e.state.facet(r$);if(!e.selectionSet&&!e.docChanged&&e.startState.field(E$)==t)return;let r=e.transactions.some(e=>{let t=x$(e,n);return t&8||(e.selection||e.docChanged)&&!(t&3)});for(let t=0;t<this.running.length;t++){let n=this.running[t];if(r||n.context.abortOnDocChange&&e.docChanged||n.updates.length+e.transactions.length>P$&&Date.now()-n.time>F$){for(let e of n.context.abortListeners)try{e()}catch(e){rV(this.view.state,e)}n.context.abortListeners=null,this.running.splice(t--,1)}else n.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(e=>e.effects.some(e=>e.is($Q)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(e=>e.isPending&&!this.running.some(t=>t.active.source==e.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let t of e.transactions)t.isUserEvent(`input.type`)?this.composing=2:this.composing==2&&t.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(E$);for(let e of t.active)e.isPending&&!this.running.some(t=>t.active.source==e.source)&&this.startQuery(e);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(r$).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=new HQ(t,qQ(t),e.explicit,this.view),r=new N$(e,n);this.running.push(r),Promise.resolve(e.source(n)).then(e=>{r.context.aborted||(r.done=e||null,this.scheduleAccept())},e=>{this.view.dispatch({effects:e$.of(null)}),rV(this.view.state,e)})}scheduleAccept(){this.running.every(e=>e.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(r$).updateSyncTime))}accept(){this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(r$),n=this.view.state.field(E$);for(let r=0;r<this.running.length;r++){let i=this.running[r];if(i.done===void 0)continue;if(this.running.splice(r--,1),i.done){let n=qQ(i.updates.length?i.updates[0].startState:this.view.state),r=Math.min(n,i.done.from+ +!i.active.explicit),a=new C$(i.active.source,i.active.explicit,r,i.done,i.done.from,i.done.to??n);for(let e of i.updates)a=a.update(e,t);if(a.hasResult()){e.push(a);continue}}let a=n.active.find(e=>e.source==i.active.source);if(a&&a.isPending){if(i.done==null){let n=new S$(i.active.source,0);for(let e of i.updates)n=n.update(e,t);n.isPending||e.push(n)}else this.startQuery(a)}}(e.length||n.open&&n.open.disabled)&&this.view.dispatch({effects:T$.of(e)})}},{eventHandlers:{blur(e){let t=this.view.state.field(E$,!1);if(t&&t.tooltip&&this.view.state.facet(r$).closeOnBlur){let n=t.open&&YG(this.view,t.open.tooltip);(!n||!n.dom.contains(e.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:e$.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:$Q.of(!1)}),20),this.composing=0}}}),L$=typeof navigator==`object`&&/Win/.test(navigator.platform),R$=tR.highest($.domEventHandlers({keydown(e,t){let n=t.state.field(E$,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(L$&&e.altKey)||e.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(e=>e.source==r.source),a=r.completion.commitCharacters||i.result.commitCharacters;return a&&a.indexOf(e.key)>-1&&D$(t,r),!1}})),z$=$.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:`monospace`,whiteSpace:`nowrap`,overflow:`hidden auto`,maxWidth_fallback:`700px`,maxWidth:`min(700px, 95vw)`,minWidth:`250px`,maxHeight:`10em`,height:`100%`,listStyle:`none`,margin:0,padding:0,"& > li, & > completion-section":{padding:`1px 3px`,lineHeight:1.2},"& > li":{overflowX:`hidden`,textOverflow:`ellipsis`,cursor:`pointer`},"& > completion-section":{display:`list-item`,borderBottom:`1px solid silver`,paddingLeft:`0.5em`,opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:`#17c`,color:`white`},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:`#777`},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:`#347`,color:`white`},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:`#444`},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:`"···"`,opacity:.5,display:`block`,textAlign:`center`,cursor:`pointer`},".cm-tooltip.cm-completionInfo":{position:`absolute`,padding:`3px 9px`,width:`max-content`,maxWidth:`400px`,boxSizing:`border-box`,whiteSpace:`pre-line`},".cm-completionInfo.cm-completionInfo-left":{right:`100%`},".cm-completionInfo.cm-completionInfo-right":{left:`100%`},".cm-completionInfo.cm-completionInfo-left-narrow":{right:`30px`},".cm-completionInfo.cm-completionInfo-right-narrow":{left:`30px`},"&light .cm-snippetField":{backgroundColor:`#00000022`},"&dark .cm-snippetField":{backgroundColor:`#ffffff22`},".cm-snippetFieldPosition":{verticalAlign:`text-top`,width:0,height:`1.15em`,display:`inline-block`,margin:`0 -0.7px -.7em`,borderLeft:`1.4px dotted #888`},".cm-completionMatchedText":{textDecoration:`underline`},".cm-completionDetail":{marginLeft:`0.5em`,fontStyle:`italic`},".cm-completionIcon":{fontSize:`90%`,width:`.8em`,display:`inline-block`,textAlign:`center`,paddingRight:`.6em`,opacity:`0.6`,boxSizing:`content-box`},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:`'ƒ'`}},".cm-completionIcon-class":{"&:after":{content:`'○'`}},".cm-completionIcon-interface":{"&:after":{content:`'◌'`}},".cm-completionIcon-variable":{"&:after":{content:`'𝑥'`}},".cm-completionIcon-constant":{"&:after":{content:`'𝐶'`}},".cm-completionIcon-type":{"&:after":{content:`'𝑡'`}},".cm-completionIcon-enum":{"&:after":{content:`'∪'`}},".cm-completionIcon-property":{"&:after":{content:`'□'`}},".cm-completionIcon-keyword":{"&:after":{content:`'🔑︎'`}},".cm-completionIcon-namespace":{"&:after":{content:`'▢'`}},".cm-completionIcon-text":{"&:after":{content:`'abc'`,fontSize:`50%`,verticalAlign:`middle`}}}),B$={brackets:[`(`,`[`,`{`,`'`,`"`],before:`)]}:;>`,stringPrefixes:[]},V$=yR.define({map(e,t){return t.mapPos(e,-1,PL.TrackAfter)??void 0}}),H$=new class extends IR{};H$.startSide=1,H$.endSide=-1;var U$=QL.define({create(){return VR.empty},update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:e=>e>=n.from&&e<=n.to})}for(let n of t.effects)n.is(V$)&&(e=e.update({add:[H$.range(n.value,n.value+1)]}));return e}});function W$(){return[Y$,U$]}var G$=`()[]{}<>«»»«[]{}`;function K$(e){for(let t=0;t<16;t+=2)if(G$.charCodeAt(t)==e)return G$.charAt(t+1);return jL(e<128?e:e+1)}function q$(e,t){return e.languageDataAt(`closeBrackets`,t)[0]||B$}var J$=typeof navigator==`object`&&/Android\b/.test(navigator.userAgent),Y$=$.inputHandler.of((e,t,n,r)=>{if((J$?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let i=e.state.selection.main;if(r.length>2||r.length==2&&ML(AL(r,0))==1||t!=i.from||n!=i.to)return!1;let a=Z$(e.state,r);return a?(e.dispatch(a),!0):!1}),X$=[{key:`Backspace`,run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=q$(e,e.selection.main.head).brackets||B$.brackets,r=null,i=e.changeByRange(t=>{if(t.empty){let r=e1(e.doc,t.head);for(let i of n)if(i==r&&$$(e.doc,t.head)==K$(AL(i,0)))return{changes:{from:t.head-i.length,to:t.head+i.length},range:Y.cursor(t.head-i.length)}}return{range:r=t}});return r||t(e.update(i,{scrollIntoView:!0,userEvent:`delete.backward`})),!r}}];function Z$(e,t){let n=q$(e,e.selection.main.head),r=n.brackets||B$.brackets;for(let i of r){let a=K$(AL(i,0));if(t==i)return a==i?r1(e,i,r.indexOf(i+i+i)>-1,n):t1(e,i,a,n.before||B$.before);if(t==a&&Q$(e,e.selection.main.from))return n1(e,i,a)}return null}function Q$(e,t){let n=!1;return e.field(U$).between(0,e.doc.length,e=>{e==t&&(n=!0)}),n}function $$(e,t){let n=e.sliceString(t,t+2);return n.slice(0,ML(AL(n,0)))}function e1(e,t){let n=e.sliceString(t-2,t);return ML(AL(n,0))==n.length?n:n.slice(1)}function t1(e,t,n,r){let i=null,a=e.changeByRange(a=>{if(!a.empty)return{changes:[{insert:t,from:a.from},{insert:n,from:a.to}],effects:V$.of(a.to+t.length),range:Y.range(a.anchor+t.length,a.head+t.length)};let o=$$(e.doc,a.head);return!o||/\s/.test(o)||r.indexOf(o)>-1?{changes:{insert:t+n,from:a.head},effects:V$.of(a.head+t.length),range:Y.cursor(a.head+t.length)}:{range:i=a}});return i?null:e.update(a,{scrollIntoView:!0,userEvent:`input.type`})}function n1(e,t,n){let r=null,i=e.changeByRange(t=>t.empty&&$$(e.doc,t.head)==n?{changes:{from:t.head,to:t.head+n.length,insert:n},range:Y.cursor(t.head+n.length)}:r={range:t});return r?null:e.update(i,{scrollIntoView:!0,userEvent:`input.type`})}function r1(e,t,n,r){let i=r.stringPrefixes||B$.stringPrefixes,a=null,o=e.changeByRange(r=>{if(!r.empty)return{changes:[{insert:t,from:r.from},{insert:t,from:r.to}],effects:V$.of(r.to+t.length),range:Y.range(r.anchor+t.length,r.head+t.length)};let o=r.head,s=$$(e.doc,o),c;if(s==t){if(i1(e,o))return{changes:{insert:t+t,from:o},effects:V$.of(o+t.length),range:Y.cursor(o+t.length)};if(Q$(e,o)){let r=n&&e.sliceDoc(o,o+t.length*3)==t+t+t?t+t+t:t;return{changes:{from:o,to:o+r.length,insert:r},range:Y.cursor(o+r.length)}}}else if(n&&e.sliceDoc(o-2*t.length,o)==t+t&&(c=o1(e,o-2*t.length,i))>-1&&i1(e,c))return{changes:{insert:t+t+t+t,from:o},effects:V$.of(o+t.length),range:Y.cursor(o+t.length)};else if(e.charCategorizer(o)(s)!=kR.Word&&o1(e,o,i)>-1&&!a1(e,o,t,i))return{changes:{insert:t+t,from:o},effects:V$.of(o+t.length),range:Y.cursor(o+t.length)};return{range:a=r}});return a?null:e.update(o,{scrollIntoView:!0,userEvent:`input.type`})}function i1(e,t){let n=VK(e).resolveInner(t+1);return n.parent&&n.from==t}function a1(e,t,n,r){let i=VK(e).resolveInner(t,-1),a=r.reduce((e,t)=>Math.max(e,t.length),0);for(let o=0;o<5;o++){let o=e.sliceDoc(i.from,Math.min(i.to,i.from+n.length+a)),s=o.indexOf(n);if(!s||s>-1&&r.indexOf(o.slice(0,s))>-1){let t=i.firstChild;for(;t&&t.from==i.from&&t.to-t.from>n.length+s;){if(e.sliceDoc(t.to-n.length,t.to)==n)return!1;t=t.firstChild}return!0}let c=i.to==t&&i.parent;if(!c)break;i=c}return!1}function o1(e,t,n){let r=e.charCategorizer(t);if(r(e.sliceDoc(t-1,t))!=kR.Word)return t;for(let i of n){let n=t-i.length;if(e.sliceDoc(n,t)==i&&r(e.sliceDoc(n-1,n))!=kR.Word)return n}return-1}function s1(e={}){return[R$,E$,r$.of(e),I$,l1,z$]}var c1=[{key:`Ctrl-Space`,run:j$},{mac:"Alt-`",run:j$},{mac:`Alt-i`,run:j$},{key:`Escape`,run:M$},{key:`ArrowDown`,run:k$(!0)},{key:`ArrowUp`,run:k$(!1)},{key:`PageDown`,run:k$(!0,`page`)},{key:`PageUp`,run:k$(!1,`page`)},{key:`Enter`,run:A$}],l1=tR.highest(wW.computeN([r$],e=>e.facet(r$).defaultKeymap?[c1]:[])),u1=function(e){e===void 0&&(e={});var t=e.crosshairCursor,n=t!==void 0&&t,r=[];e.closeBracketsKeymap!==!1&&(r=r.concat(X$)),e.defaultKeymap!==!1&&(r=r.concat(AZ)),e.searchKeymap!==!1&&(r=r.concat(PQ)),e.historyKeymap!==!1&&(r=r.concat(HY)),e.foldKeymap!==!1&&(r=r.concat(Fq)),e.completionKeymap!==!1&&(r=r.concat(c1)),e.lintKeymap!==!1&&(r=r.concat(HJ));var i=[];return e.lineNumbers!==!1&&i.push(AK()),e.highlightActiveLineGutter!==!1&&i.push(PK()),e.highlightSpecialChars!==!1&&i.push(cG()),e.history!==!1&&i.push(CY()),e.foldGutter!==!1&&i.push(Wq()),e.drawSelection!==!1&&i.push(HW()),e.dropCursor!==!1&&i.push(QW()),e.allowMultipleSelections!==!1&&i.push(PR.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&i.push(gq()),e.syntaxHighlighting!==!1&&i.push(Xq($q,{fallback:!0})),e.bracketMatching!==!1&&i.push(lJ()),e.closeBrackets!==!1&&i.push(W$()),e.autocompletion!==!1&&i.push(s1()),e.rectangularSelection!==!1&&i.push(TG()),n!==!1&&i.push(OG()),e.highlightActiveLine!==!1&&i.push(hG()),e.highlightSelectionMatches!==!1&&i.push(GZ()),e.tabSize&&typeof e.tabSize==`number`&&i.push($K.of(` `.repeat(e.tabSize))),i.concat([wW.of(r.flat())]).filter(Boolean)},d1=`#e5c07b`,f1=`#e06c75`,p1=`#56b6c2`,m1=`#ffffff`,h1=`#abb2bf`,g1=`#7d8799`,_1=`#61afef`,v1=`#98c379`,y1=`#d19a66`,b1=`#c678dd`,x1=`#21252b`,S1=`#2c313a`,C1=`#282c34`,w1=`#353a42`,T1=`#3E4451`,E1=`#528bff`,D1=[$.theme({"&":{color:h1,backgroundColor:C1},".cm-content":{caretColor:E1},".cm-cursor, .cm-dropCursor":{borderLeftColor:E1},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:T1},".cm-panels":{backgroundColor:x1,color:h1},".cm-panels.cm-panels-top":{borderBottom:`2px solid black`},".cm-panels.cm-panels-bottom":{borderTop:`2px solid black`},".cm-searchMatch":{backgroundColor:`#72a1ff59`,outline:`1px solid #457dff`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:`#6199ff2f`},".cm-activeLine":{backgroundColor:`#6699ff0b`},".cm-selectionMatch":{backgroundColor:`#aafe661a`},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:`#bad0f847`},".cm-gutters":{backgroundColor:C1,color:g1,border:`none`},".cm-activeLineGutter":{backgroundColor:S1},".cm-foldPlaceholder":{backgroundColor:`transparent`,border:`none`,color:`#ddd`},".cm-tooltip":{border:`none`,backgroundColor:w1},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:w1,borderBottomColor:w1},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:S1,color:h1}}},{dark:!0}),Xq(Kq.define([{tag:J.keyword,color:b1},{tag:[J.name,J.deleted,J.character,J.propertyName,J.macroName],color:f1},{tag:[J.function(J.variableName),J.labelName],color:_1},{tag:[J.color,J.constant(J.name),J.standard(J.name)],color:y1},{tag:[J.definition(J.name),J.separator],color:h1},{tag:[J.typeName,J.className,J.number,J.changed,J.annotation,J.modifier,J.self,J.namespace],color:d1},{tag:[J.operator,J.operatorKeyword,J.url,J.escape,J.regexp,J.link,J.special(J.string)],color:p1},{tag:[J.meta,J.comment],color:g1},{tag:J.strong,fontWeight:`bold`},{tag:J.emphasis,fontStyle:`italic`},{tag:J.strikethrough,textDecoration:`line-through`},{tag:J.link,color:g1,textDecoration:`underline`},{tag:J.heading,fontWeight:`bold`,color:f1},{tag:[J.atom,J.bool,J.special(J.variableName)],color:y1},{tag:[J.processingInstruction,J.string,J.inserted],color:v1},{tag:J.invalid,color:m1}]))],O1=$.theme({"&":{backgroundColor:`#fff`}},{dark:!1}),k1=function(e){e===void 0&&(e={});var t=e,n=t.indentWithTab,r=n===void 0||n,i=t.editable,a=i===void 0||i,o=t.readOnly,s=o!==void 0&&o,c=t.theme,l=c===void 0?`light`:c,u=t.placeholder,d=u===void 0?``:u,f=t.basicSetup,p=f===void 0||f,m=[];switch(r&&m.unshift(wW.of([jZ])),p&&(typeof p==`boolean`?m.unshift(u1()):m.unshift(u1(p))),d&&m.unshift(yG(d)),l){case`light`:m.push(O1);break;case`dark`:m.push(D1);break;case`none`:break;default:m.push(l)}return a===!1&&m.push($.editable.of(!1)),s&&m.push(PR.readOnly.of(!0)),[...m]},A1=e=>({line:e.state.doc.lineAt(e.state.selection.main.from),lineCount:e.state.doc.lines,lineBreak:e.state.lineBreak,length:e.state.doc.length,readOnly:e.state.readOnly,tabSize:e.state.tabSize,selection:e.state.selection,selectionAsSingle:e.state.selection.asSingle().main,ranges:e.state.selection.ranges,selectionCode:e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to),selections:e.state.selection.ranges.map(t=>e.state.sliceDoc(t.from,t.to)),selectedText:e.state.selection.ranges.some(e=>!e.empty)}),j1=class{constructor(e,t){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=t,this.timeoutMS=t,this.callbacks.push(e)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var e=this.callbacks.slice();this.callbacks.length=0,e.forEach(e=>{try{e()}catch(e){console.error(`TimeoutLatch callback error:`,e)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}},M1=class{constructor(){this.interval=null,this.latches=new Set}add(e){this.latches.add(e),this.start()}remove(e){this.latches.delete(e),this.latches.size===0&&this.stop()}start(){this.interval===null&&(this.interval=setInterval(()=>{this.latches.forEach(e=>{e.tick(),e.isDone&&this.remove(e)})},1))}stop(){this.interval!==null&&(clearInterval(this.interval),this.interval=null)}},N1=null,P1=()=>typeof window>`u`?new M1:(N1||=new M1,N1),F1=$.theme({"& .cm-scroller":{height:`100% !important`}}),I1=null,L1=null;function R1(e,t,n,r,i,a){if(!e&&!t&&!n&&!r&&!i&&!a)return null;var o=JSON.stringify({height:e,minHeight:t,maxHeight:n,width:r,minWidth:i,maxWidth:a});return o===I1?L1:(I1=o,L1=$.theme({"&":{height:e,minHeight:t,maxHeight:n,width:r,minWidth:i,maxWidth:a}}),L1)}var z1=gR.define(),B1=200,V1=[];function H1(e){var t=e.value,n=e.selection,r=e.onChange,i=e.onStatistics,a=e.onCreateEditor,o=e.onUpdate,s=e.extensions,c=s===void 0?V1:s,l=e.autoFocus,u=e.theme,d=u===void 0?`light`:u,f=e.height,p=f===void 0?null:f,m=e.minHeight,h=m===void 0?null:m,g=e.maxHeight,_=g===void 0?null:g,v=e.width,y=v===void 0?null:v,b=e.minWidth,x=b===void 0?null:b,S=e.maxWidth,C=S===void 0?null:S,w=e.placeholder,T=w===void 0?``:w,E=e.editable,D=E===void 0||E,ee=e.readOnly,O=ee!==void 0&&ee,te=e.indentWithTab,k=te===void 0||te,ne=e.basicSetup,re=ne===void 0||ne,ie=e.root,A=e.initialState,ae=(0,P.useState)(),oe=ae[0],se=ae[1],ce=(0,P.useState)(),j=ce[0],le=ce[1],ue=(0,P.useState)(),de=ue[0],fe=ue[1],pe=(0,P.useState)(()=>({current:null}))[0],me=(0,P.useState)(()=>({current:null}))[0],he=R1(p,h,_,y,x,C),ge=$.updateListener.of(e=>{e.docChanged&&typeof r==`function`&&!e.transactions.some(e=>e.annotation(z1))&&(pe.current?pe.current.reset():(pe.current=new j1(()=>{if(me.current){var e=me.current;me.current=null,e()}pe.current=null},B1),P1().add(pe.current)),r(e.state.doc.toString(),e)),i&&i(A1(e))}),_e=k1({theme:d,editable:D,readOnly:O,placeholder:T,indentWithTab:k,basicSetup:re}),ve=[ge,...he?[he]:[],F1,..._e];return o&&typeof o==`function`&&ve.push($.updateListener.of(o)),ve=ve.concat(c),(0,P.useLayoutEffect)(()=>{if(oe&&!de){var e={doc:t,selection:n,extensions:ve},r=A?PR.fromJSON(A.json,e,A.fields):PR.create(e);if(fe(r),!j){var i=new $({state:r,parent:oe,root:ie});le(i),a&&a(i,r)}}return()=>{j&&(fe(void 0),le(void 0))}},[oe,de]),(0,P.useEffect)(()=>{e.container&&se(e.container)},[e.container]),(0,P.useEffect)(()=>()=>{j&&(j.destroy(),le(void 0)),pe.current&&=(pe.current.cancel(),null)},[j]),(0,P.useEffect)(()=>{l&&j&&j.focus()},[l,j]),(0,P.useEffect)(()=>{j&&j.dispatch({effects:yR.reconfigure.of(ve)})},[d,c,p,h,_,y,x,C,T,D,O,k,re,r,o]),(0,P.useEffect)(()=>{if(t!==void 0){var e=j?j.state.doc.toString():``;if(j&&t!==e){var n=pe.current&&!pe.current.isDone,r=()=>{j&&t!==j.state.doc.toString()&&j.dispatch({changes:{from:0,to:j.state.doc.toString().length,insert:t||``},annotations:[z1.of(!0)]})};n?me.current=r:r()}}},[t,j]),{state:de,setState:fe,view:j,setView:le,container:oe,setContainer:se}}var U1=[`className`,`value`,`selection`,`extensions`,`onChange`,`onStatistics`,`onCreateEditor`,`onUpdate`,`autoFocus`,`theme`,`height`,`minHeight`,`maxHeight`,`width`,`minWidth`,`maxWidth`,`basicSetup`,`placeholder`,`indentWithTab`,`editable`,`readOnly`,`root`,`initialState`],W1=(0,P.forwardRef)((e,t)=>{var n=e.className,r=e.value,i=r===void 0?``:r,a=e.selection,o=e.extensions,s=o===void 0?[]:o,c=e.onChange,l=e.onStatistics,u=e.onCreateEditor,d=e.onUpdate,f=e.autoFocus,p=e.theme,m=p===void 0?`light`:p,h=e.height,g=e.minHeight,_=e.maxHeight,v=e.width,y=e.minWidth,b=e.maxWidth,x=e.basicSetup,S=e.placeholder,C=e.indentWithTab,w=e.editable,T=e.readOnly,E=e.root,D=e.initialState,ee=oY(e,U1),O=(0,P.useRef)(null),te=H1({root:E,value:i,autoFocus:f,theme:m,height:h,minHeight:g,maxHeight:_,width:v,minWidth:y,maxWidth:b,basicSetup:x,placeholder:S,indentWithTab:C,editable:w,readOnly:T,selection:a,onChange:c,onStatistics:l,onCreateEditor:u,onUpdate:d,extensions:s,initialState:D}),k=te.state,ne=te.view,re=te.container,ie=te.setContainer;(0,P.useImperativeHandle)(t,()=>({editor:O.current,state:k,view:ne}),[O,re,k,ne]);var A=(0,P.useCallback)(e=>{O.current=e,ie(e)},[ie]);if(typeof i!=`string`)throw Error(`value must be typeof string but got `+typeof i);var ae=typeof m==`string`?`cm-theme-`+m:`cm-theme`;return(0,F.jsx)(`div`,rt({ref:A,className:``+ae+(n?` `+n:``)},ee))});W1.displayName=`CodeMirror`;function G1(e,t=!1){let n=e.length,r=0,i=``,a=0,o=16,s=0,c=0,l=0,u=0,d=0;function f(t,n){let i=0,a=0;for(;i<t||!n;){let t=e.charCodeAt(r);if(t>=48&&t<=57)a=a*16+t-48;else if(t>=65&&t<=70)a=a*16+t-65+10;else if(t>=97&&t<=102)a=a*16+t-97+10;else break;r++,i++}return i<t&&(a=-1),a}function p(e){r=e,i=``,a=0,o=16,d=0}function m(){let t=r;if(e.charCodeAt(r)===48)r++;else for(r++;r<e.length&&J1(e.charCodeAt(r));)r++;if(r<e.length&&e.charCodeAt(r)===46){if(r++,r<e.length&&J1(e.charCodeAt(r)))for(r++;r<e.length&&J1(e.charCodeAt(r));)r++;else return d=3,e.substring(t,r)}let n=r;if(r<e.length&&(e.charCodeAt(r)===69||e.charCodeAt(r)===101)){if(r++,(r<e.length&&e.charCodeAt(r)===43||e.charCodeAt(r)===45)&&r++,r<e.length&&J1(e.charCodeAt(r))){for(r++;r<e.length&&J1(e.charCodeAt(r));)r++;n=r}else d=3}return e.substring(t,n)}function h(){let t=``,i=r;for(;;){if(r>=n){t+=e.substring(i,r),d=2;break}let a=e.charCodeAt(r);if(a===34){t+=e.substring(i,r),r++;break}if(a===92){if(t+=e.substring(i,r),r++,r>=n){d=2;break}switch(e.charCodeAt(r++)){case 34:t+=`"`;break;case 92:t+=`\\`;break;case 47:t+=`/`;break;case 98:t+=`\b`;break;case 102:t+=`\f`;break;case 110:t+=`
27
- `;break;case 114:t+=`\r`;break;case 116:t+=` `;break;case 117:let e=f(4,!0);e>=0?t+=String.fromCharCode(e):d=4;break;default:d=5}i=r;continue}if(a>=0&&a<=31){if(q1(a)){t+=e.substring(i,r),d=2;break}d=6}r++}return t}function g(){if(i=``,d=0,a=r,c=s,u=l,r>=n)return a=n,o=17;let t=e.charCodeAt(r);if(K1(t)){do r++,i+=String.fromCharCode(t),t=e.charCodeAt(r);while(K1(t));return o=15}if(q1(t))return r++,i+=String.fromCharCode(t),t===13&&e.charCodeAt(r)===10&&(r++,i+=`
28
- `),s++,l=r,o=14;switch(t){case 123:return r++,o=1;case 125:return r++,o=2;case 91:return r++,o=3;case 93:return r++,o=4;case 58:return r++,o=6;case 44:return r++,o=5;case 34:return r++,i=h(),o=10;case 47:let c=r-1;if(e.charCodeAt(r+1)===47){for(r+=2;r<n&&!q1(e.charCodeAt(r));)r++;return i=e.substring(c,r),o=12}if(e.charCodeAt(r+1)===42){r+=2;let t=n-1,a=!1;for(;r<t;){let t=e.charCodeAt(r);if(t===42&&e.charCodeAt(r+1)===47){r+=2,a=!0;break}r++,q1(t)&&(t===13&&e.charCodeAt(r)===10&&r++,s++,l=r)}return a||(r++,d=1),i=e.substring(c,r),o=13}return i+=String.fromCharCode(t),r++,o=16;case 45:if(i+=String.fromCharCode(t),r++,r===n||!J1(e.charCodeAt(r)))return o=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return i+=m(),o=11;default:for(;r<n&&_(t);)r++,t=e.charCodeAt(r);if(a!==r){switch(i=e.substring(a,r),i){case`true`:return o=8;case`false`:return o=9;case`null`:return o=7}return o=16}return i+=String.fromCharCode(t),r++,o=16}}function _(e){if(K1(e)||q1(e))return!1;switch(e){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function v(){let e;do e=g();while(e>=12&&e<=15);return e}return{setPosition:p,getPosition:()=>r,scan:t?v:g,getToken:()=>o,getTokenValue:()=>i,getTokenOffset:()=>a,getTokenLength:()=>r-a,getTokenStartLine:()=>c,getTokenStartCharacter:()=>a-u,getTokenError:()=>d}}function K1(e){return e===32||e===9}function q1(e){return e===10||e===13}function J1(e){return e>=48&&e<=57}var Y1;(function(e){e[e.lineFeed=10]=`lineFeed`,e[e.carriageReturn=13]=`carriageReturn`,e[e.space=32]=`space`,e[e._0=48]=`_0`,e[e._1=49]=`_1`,e[e._2=50]=`_2`,e[e._3=51]=`_3`,e[e._4=52]=`_4`,e[e._5=53]=`_5`,e[e._6=54]=`_6`,e[e._7=55]=`_7`,e[e._8=56]=`_8`,e[e._9=57]=`_9`,e[e.a=97]=`a`,e[e.b=98]=`b`,e[e.c=99]=`c`,e[e.d=100]=`d`,e[e.e=101]=`e`,e[e.f=102]=`f`,e[e.g=103]=`g`,e[e.h=104]=`h`,e[e.i=105]=`i`,e[e.j=106]=`j`,e[e.k=107]=`k`,e[e.l=108]=`l`,e[e.m=109]=`m`,e[e.n=110]=`n`,e[e.o=111]=`o`,e[e.p=112]=`p`,e[e.q=113]=`q`,e[e.r=114]=`r`,e[e.s=115]=`s`,e[e.t=116]=`t`,e[e.u=117]=`u`,e[e.v=118]=`v`,e[e.w=119]=`w`,e[e.x=120]=`x`,e[e.y=121]=`y`,e[e.z=122]=`z`,e[e.A=65]=`A`,e[e.B=66]=`B`,e[e.C=67]=`C`,e[e.D=68]=`D`,e[e.E=69]=`E`,e[e.F=70]=`F`,e[e.G=71]=`G`,e[e.H=72]=`H`,e[e.I=73]=`I`,e[e.J=74]=`J`,e[e.K=75]=`K`,e[e.L=76]=`L`,e[e.M=77]=`M`,e[e.N=78]=`N`,e[e.O=79]=`O`,e[e.P=80]=`P`,e[e.Q=81]=`Q`,e[e.R=82]=`R`,e[e.S=83]=`S`,e[e.T=84]=`T`,e[e.U=85]=`U`,e[e.V=86]=`V`,e[e.W=87]=`W`,e[e.X=88]=`X`,e[e.Y=89]=`Y`,e[e.Z=90]=`Z`,e[e.asterisk=42]=`asterisk`,e[e.backslash=92]=`backslash`,e[e.closeBrace=125]=`closeBrace`,e[e.closeBracket=93]=`closeBracket`,e[e.colon=58]=`colon`,e[e.comma=44]=`comma`,e[e.dot=46]=`dot`,e[e.doubleQuote=34]=`doubleQuote`,e[e.minus=45]=`minus`,e[e.openBrace=123]=`openBrace`,e[e.openBracket=91]=`openBracket`,e[e.plus=43]=`plus`,e[e.slash=47]=`slash`,e[e.formFeed=12]=`formFeed`,e[e.tab=9]=`tab`})(Y1||={}),Array(20).fill(0).map((e,t)=>` `.repeat(t));var X1=200;Array(X1).fill(0).map((e,t)=>`
29
- `+` `.repeat(t)),Array(X1).fill(0).map((e,t)=>`\r`+` `.repeat(t)),Array(X1).fill(0).map((e,t)=>`\r
30
- `+` `.repeat(t)),Array(X1).fill(0).map((e,t)=>`
31
- `+` `.repeat(t)),Array(X1).fill(0).map((e,t)=>`\r`+` `.repeat(t)),Array(X1).fill(0).map((e,t)=>`\r
32
- `+` `.repeat(t));var Z1;(function(e){e.DEFAULT={allowTrailingComma:!1}})(Z1||={});function Q1(e,t=[],n=Z1.DEFAULT){let r={type:`array`,offset:-1,length:-1,children:[],parent:void 0};function i(e){r.type===`property`&&(r.length=e-r.offset,r=r.parent)}function a(e){return r.children.push(e),e}e0(e,{onObjectBegin:e=>{r=a({type:`object`,offset:e,length:-1,parent:r,children:[]})},onObjectProperty:(e,t,n)=>{r=a({type:`property`,offset:t,length:-1,parent:r,children:[]}),r.children.push({type:`string`,value:e,offset:t,length:n,parent:r})},onObjectEnd:(e,t)=>{i(e+t),r.length=e+t-r.offset,r=r.parent,i(e+t)},onArrayBegin:(e,t)=>{r=a({type:`array`,offset:e,length:-1,parent:r,children:[]})},onArrayEnd:(e,t)=>{r.length=e+t-r.offset,r=r.parent,i(e+t)},onLiteralValue:(e,t,n)=>{a({type:t0(e),offset:t,length:n,parent:r,value:e}),i(t+n)},onSeparator:(e,t,n)=>{r.type===`property`&&(e===`:`?r.colonOffset=t:e===`,`&&i(t))},onError:(e,n,r)=>{t.push({error:e,offset:n,length:r})}},n);let o=r.children[0];return o&&delete o.parent,o}function $1(e,t){if(!e)return;let n=e;for(let e of t)if(typeof e==`string`){if(n.type!==`object`||!Array.isArray(n.children))return;let t=!1;for(let r of n.children)if(Array.isArray(r.children)&&r.children[0].value===e&&r.children.length===2){n=r.children[1],t=!0;break}if(!t)return}else{let t=e;if(n.type!==`array`||t<0||!Array.isArray(n.children)||t>=n.children.length)return;n=n.children[t]}return n}function e0(e,t,n=Z1.DEFAULT){let r=G1(e,!1),i=[],a=0;function o(e){return e?()=>a===0&&e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function s(e){return e?t=>a===0&&e(t,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function c(e){return e?t=>a===0&&e(t,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice()):()=>!0}function l(e){return e?()=>{a>0?a++:e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice())===!1&&(a=1)}:()=>!0}function u(e){return e?()=>{a>0&&a--,a===0&&e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter())}:()=>!0}let d=l(t.onObjectBegin),f=c(t.onObjectProperty),p=u(t.onObjectEnd),m=l(t.onArrayBegin),h=u(t.onArrayEnd),g=c(t.onLiteralValue),_=s(t.onSeparator),v=o(t.onComment),y=s(t.onError),b=n&&n.disallowComments,x=n&&n.allowTrailingComma;function S(){for(;;){let e=r.scan();switch(r.getTokenError()){case 4:C(14);break;case 5:C(15);break;case 3:C(13);break;case 1:b||C(11);break;case 2:C(12);break;case 6:C(16)}switch(e){case 12:case 13:b?C(10):v();break;case 16:C(1);break;case 15:case 14:break;default:return e}}}function C(e,t=[],n=[]){if(y(e),t.length+n.length>0){let e=r.getToken();for(;e!==17;){if(t.indexOf(e)!==-1){S();break}if(n.indexOf(e)!==-1)break;e=S()}}}function w(e){let t=r.getTokenValue();return e?g(t):(f(t),i.push(t)),S(),!0}function T(){switch(r.getToken()){case 11:let e=r.getTokenValue(),t=Number(e);isNaN(t)&&(C(2),t=0),g(t);break;case 7:g(null);break;case 8:g(!0);break;case 9:g(!1);break;default:return!1}return S(),!0}function E(){return r.getToken()===10?(w(!1),r.getToken()===6?(_(`:`),S(),O()||C(4,[],[2,5])):C(5,[],[2,5]),i.pop(),!0):(C(3,[],[2,5]),!1)}function D(){d(),S();let e=!1;for(;r.getToken()!==2&&r.getToken()!==17;){if(r.getToken()===5){if(e||C(4,[],[]),_(`,`),S(),r.getToken()===2&&x)break}else e&&C(6,[],[]);E()||C(4,[],[2,5]),e=!0}return p(),r.getToken()===2?S():C(7,[2],[]),!0}function ee(){m(),S();let e=!0,t=!1;for(;r.getToken()!==4&&r.getToken()!==17;){if(r.getToken()===5){if(t||C(4,[],[]),_(`,`),S(),r.getToken()===4&&x)break}else t&&C(6,[],[]);e?(i.push(0),e=!1):i[i.length-1]++,O()||C(4,[],[4,5]),t=!0}return h(),e||i.pop(),r.getToken()===4?S():C(8,[4],[]),!0}function O(){switch(r.getToken()){case 3:return ee();case 1:return D();case 10:return w(!0);default:return T()}}return S(),r.getToken()===17?n.allowEmptyContent?!0:(C(4,[],[]),!1):O()?(r.getToken()!==17&&C(9,[],[]),!0):(C(4,[],[]),!1)}function t0(e){switch(typeof e){case`boolean`:return`boolean`;case`number`:return`number`;case`string`:return`string`;case`object`:return e?Array.isArray(e)?`array`:`object`:`null`;default:return`null`}}var n0;(function(e){e[e.None=0]=`None`,e[e.UnexpectedEndOfComment=1]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=2]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=3]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=4]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=5]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=6]=`InvalidCharacter`})(n0||={});var r0;(function(e){e[e.OpenBraceToken=1]=`OpenBraceToken`,e[e.CloseBraceToken=2]=`CloseBraceToken`,e[e.OpenBracketToken=3]=`OpenBracketToken`,e[e.CloseBracketToken=4]=`CloseBracketToken`,e[e.CommaToken=5]=`CommaToken`,e[e.ColonToken=6]=`ColonToken`,e[e.NullKeyword=7]=`NullKeyword`,e[e.TrueKeyword=8]=`TrueKeyword`,e[e.FalseKeyword=9]=`FalseKeyword`,e[e.StringLiteral=10]=`StringLiteral`,e[e.NumericLiteral=11]=`NumericLiteral`,e[e.LineCommentTrivia=12]=`LineCommentTrivia`,e[e.BlockCommentTrivia=13]=`BlockCommentTrivia`,e[e.LineBreakTrivia=14]=`LineBreakTrivia`,e[e.Trivia=15]=`Trivia`,e[e.Unknown=16]=`Unknown`,e[e.EOF=17]=`EOF`})(r0||={});var i0=Q1,a0=$1,o0;(function(e){e[e.InvalidSymbol=1]=`InvalidSymbol`,e[e.InvalidNumberFormat=2]=`InvalidNumberFormat`,e[e.PropertyNameExpected=3]=`PropertyNameExpected`,e[e.ValueExpected=4]=`ValueExpected`,e[e.ColonExpected=5]=`ColonExpected`,e[e.CommaExpected=6]=`CommaExpected`,e[e.CloseBraceExpected=7]=`CloseBraceExpected`,e[e.CloseBracketExpected=8]=`CloseBracketExpected`,e[e.EndOfFileExpected=9]=`EndOfFileExpected`,e[e.InvalidCommentToken=10]=`InvalidCommentToken`,e[e.UnexpectedEndOfComment=11]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=12]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=13]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=14]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=15]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=16]=`InvalidCharacter`})(o0||={});function s0(e,t){let n=i0(e);return n===void 0?[]:t.map(e=>{let t=a0(n,c0(e.path))??n;return{from:t.offset,to:t.offset+t.length,severity:e.kind===`binding`?`warning`:`error`,message:e.message}})}function c0(e){if(e===``)return[];let t=[];for(let n of e.matchAll(/\[("(?:[^"\\]|\\.)*")\]|([^.[]+)/g))n[1]===void 0?t.push(/^\d+$/.test(n[2])?Number(n[2]):n[2]):t.push(JSON.parse(n[1]));return t}function l0({recipe:e,onSave:t}){let[n,r]=(0,P.useState)(e?.text??``),[i,a]=(0,P.useState)(!1),[o,s]=(0,P.useState)();(0,P.useEffect)(()=>{r(e?.text??``)},[e?.file,e?.text]);let c=(0,P.useMemo)(()=>[EJ(),qJ(t=>{let n=CJ()(t);return e===void 0||n.length>0?n:s0(t.state.doc.toString(),e.issues)})],[e]);if(e===void 0)return(0,F.jsx)(I,{p:4,color:`fg.muted`,children:(0,F.jsx)(U,{children:`Select a recipe to see its JSON.`})});let l=d0(n),u=n!==e.text,d=async()=>{if(l===void 0){a(!0),s(void 0);try{await t(e.file,JSON.parse(n))}catch(e){s(e instanceof Error?e.message:String(e))}finally{a(!1)}}};return(0,F.jsxs)(Qw,{h:`full`,p:2,gap:2,children:[(0,F.jsxs)(Qw,{direction:`row`,align:`center`,justify:`space-between`,children:[(0,F.jsx)(u0,{issueCount:e.issues.length,syntaxError:l}),(0,F.jsx)(Lw,{size:`sm`,onClick:()=>{d()},disabled:l!==void 0||i||!u,loading:i,children:`Save`})]}),e.issues.length>0&&l===void 0&&(0,F.jsx)(Qw,{gap:0,fontSize:`xs`,color:`fg.muted`,children:e.issues.map(e=>(0,F.jsxs)(U,{children:[(0,F.jsx)(U,{as:`span`,fontFamily:`mono`,children:e.path}),`: `,e.message]},`${e.path}:${e.message}`))}),o!==void 0&&(0,F.jsx)(U,{color:`fg.error`,fontSize:`sm`,children:o}),(0,F.jsx)(I,{flex:`1`,minH:0,fontFamily:`mono`,fontSize:`sm`,borderWidth:`1px`,borderColor:`border`,rounded:`md`,overflow:`hidden`,children:(0,F.jsx)(W1,{value:n,height:`100%`,extensions:c,onChange:e=>{r(e)},basicSetup:{tabSize:2}})})]})}function u0({issueCount:e,syntaxError:t}){return t===void 0?e>0?(0,F.jsxs)(kw,{colorPalette:`orange`,children:[e,` issue`,e===1?``:`s`]}):(0,F.jsx)(kw,{colorPalette:`green`,children:`valid`}):(0,F.jsxs)(kw,{colorPalette:`red`,children:[`invalid JSON: `,t]})}function d0(e){try{JSON.parse(e);return}catch(e){return e instanceof Error?e.message:String(e)}}function f0({records:e,onCellClick:t,highlightedField:n,onHoverField:r,onSelectRecord:i}){if(e.length===0)return(0,F.jsx)(I,{p:4,color:`fg.muted`,children:(0,F.jsx)(U,{children:`No records yet. Run a sample to see them here.`})});let a=m0(e);if(a.length===0)return(0,F.jsx)(I,{p:4,color:`fg.muted`,children:(0,F.jsxs)(U,{children:[e.length,` record`,e.length===1?``:`s`,` emitted, but no output field is mapped yet, so there is nothing to show as columns. Add fields in the Record tab.`]})});let o=e=>r===void 0?{}:{onMouseEnter:()=>{r(e)},onMouseLeave:()=>{r(void 0)}};return(0,F.jsx)(bE,{h:`full`,children:(0,F.jsxs)(vE,{size:`sm`,stickyHeader:!0,children:[(0,F.jsx)(xE,{children:(0,F.jsx)(yE,{children:a.map(e=>(0,F.jsx)(SE,{bg:e===n?`orange.subtle`:void 0,"data-highlighted":e===n,...o(e),children:e},e))})}),(0,F.jsx)(wE,{children:e.map((e,r)=>(0,F.jsx)(yE,{cursor:i===void 0?void 0:`pointer`,onClick:i===void 0?void 0:()=>{i(r)},children:a.map(i=>(0,F.jsx)(p0,{value:e.data[i],highlighted:i===n,onClick:t===void 0?void 0:e=>{e.stopPropagation(),t(r,i)},...o(i)},i))},e.key??`row-${r}`))})]})})}function p0({value:e,onClick:t,highlighted:n=!1,onMouseEnter:r,onMouseLeave:i}){let a=n?`orange.subtle`:void 0;return e===void 0?(0,F.jsx)(CE,{color:`fg.muted`,fontStyle:`italic`,bg:a,"data-highlighted":n,onMouseEnter:r,onMouseLeave:i,children:`missing`}):e===null?t===void 0?(0,F.jsx)(CE,{color:`fg.muted`,fontStyle:`italic`,bg:a,"data-highlighted":n,onMouseEnter:r,onMouseLeave:i,children:`null`}):(0,F.jsx)(CE,{color:`fg.muted`,fontStyle:`italic`,cursor:`pointer`,textDecoration:`underline`,title:`Why is this missing?`,bg:a,"data-highlighted":n,onClick:t,onMouseEnter:r,onMouseLeave:i,children:`null`}):(0,F.jsx)(CE,{bg:a,"data-highlighted":n,onMouseEnter:r,onMouseLeave:i,children:typeof e==`object`?JSON.stringify(e):String(e)})}function m0(e){let t=[];for(let n of e)for(let e of Object.keys(n.data))t.includes(e)||t.push(e);return t}var h0={json:`application/json`,jsonl:`application/x-ndjson`,csv:`text/csv`};function g0(e,t,n=`records`){return{filename:`${n}.${t}`,mimeType:h0[t],content:_0(e,t)}}function _0(e,t){return t===`json`?v0(e):t===`jsonl`?y0(e):b0(e)}function v0(e){return JSON.stringify(e.map(e=>e.data),null,2)}function y0(e){return e.map(e=>JSON.stringify(e.data)).join(`
33
- `)+(e.length===0?``:`
34
- `)}function b0(e){let t=m0(e),n=[t.map(e=>S0(e)).join(`,`)];for(let r of e)n.push(t.map(e=>S0(x0(r.data[e]))).join(`,`));return n.join(`\r
35
- `)+(e.length===0?``:`\r
36
- `)}function x0(e){return e==null?``:typeof e==`object`?JSON.stringify(e):String(e)}function S0(e){return/["\r\n,]/.test(e)?`"${e.replace(/"/g,`""`)}"`:e}function C0({records:e,onSelectRecord:t}){return e.length===0?(0,F.jsx)(I,{p:4,color:`fg.muted`,children:(0,F.jsx)(U,{children:`No records yet. Run a sample to see them here.`})}):(0,F.jsx)(I,{as:`pre`,p:2,h:`full`,overflow:`auto`,fontFamily:`mono`,fontSize:`xs`,whiteSpace:`pre-wrap`,children:y0(e).trimEnd().split(`
37
- `).map((e,n)=>(0,F.jsx)(I,{as:`span`,display:`block`,cursor:t===void 0?void 0:`pointer`,_hover:t===void 0?void 0:{bg:`bg.muted`},onClick:t===void 0?void 0:()=>{t(n)},children:e},n))})}function w0({record:e,index:t,onClose:n}){return(0,F.jsx)(rT,{open:e!==void 0,onOpenChange:e=>{e.open||n()},size:`lg`,placement:`center`,scrollBehavior:`inside`,children:(0,F.jsxs)(w_,{children:[(0,F.jsx)(lT,{}),(0,F.jsx)(aT,{children:(0,F.jsxs)(oT,{children:[(0,F.jsxs)(dT,{display:`flex`,flexDirection:`row`,alignItems:`center`,justifyContent:`space-between`,children:[(0,F.jsxs)(I,{minW:0,children:[(0,F.jsxs)(sT,{children:[`Record `,t===void 0?``:t+1]}),e?.key!=null&&(0,F.jsx)(U,{fontSize:`xs`,color:`fg.muted`,truncate:!0,title:e.key,children:e.key})]}),(0,F.jsx)(cT,{asChild:!0,children:(0,F.jsx)(Yw,{size:`sm`,"aria-label":`Close record`})})]}),(0,F.jsx)(uT,{pb:4,children:(0,F.jsx)(I,{as:`pre`,fontFamily:`mono`,fontSize:`xs`,whiteSpace:`pre-wrap`,wordBreak:`break-word`,children:e===void 0?``:JSON.stringify(e.data,null,2)})})]})})]})})}function T0({records:e,onCellClick:t,highlightedField:n,onHoverField:r}){let[i,a]=(0,P.useState)(`table`),[o,s]=(0,P.useState)(!1),[c,l]=(0,P.useState)();function u(t){let n=g0(e,t);O0(n.filename,n.mimeType,n.content)}return(0,F.jsxs)(I,{flex:`1`,minH:`0`,display:`flex`,flexDirection:`column`,children:[(0,F.jsx)(D0,{view:i,onViewChange:a,onExport:u,onEnlarge:()=>{s(!0)},exportDisabled:e.length===0}),(0,F.jsx)(I,{flex:`1`,minH:`0`,overflow:`auto`,children:(0,F.jsx)(E0,{view:i,records:e,onCellClick:t,highlightedField:n,onHoverField:r,onSelectRecord:l})}),(0,F.jsx)(rT,{open:o,onOpenChange:e=>{s(e.open)},size:`cover`,placement:`center`,children:(0,F.jsxs)(w_,{children:[(0,F.jsx)(lT,{}),(0,F.jsx)(aT,{children:(0,F.jsxs)(oT,{h:`85vh`,display:`flex`,flexDirection:`column`,children:[(0,F.jsxs)(dT,{display:`flex`,flexDirection:`row`,alignItems:`center`,justifyContent:`space-between`,children:[(0,F.jsxs)(sT,{children:[`Records (`,e.length,`)`]}),(0,F.jsx)(cT,{asChild:!0,children:(0,F.jsx)(Yw,{size:`sm`,"aria-label":`Close`})})]}),(0,F.jsxs)(uT,{flex:`1`,minH:`0`,display:`flex`,flexDirection:`column`,gap:2,pb:4,children:[(0,F.jsx)(D0,{view:i,onViewChange:a,onExport:u,exportDisabled:e.length===0}),(0,F.jsx)(I,{flex:`1`,minH:`0`,overflow:`auto`,children:(0,F.jsx)(E0,{view:i,records:e,onCellClick:t,highlightedField:n,onHoverField:r,onSelectRecord:l})})]})]})})]})}),(0,F.jsx)(w0,{record:c===void 0?void 0:e[c],index:c,onClose:()=>{l(void 0)}})]})}function E0({view:e,records:t,onCellClick:n,highlightedField:r,onHoverField:i,onSelectRecord:a}){return e===`table`?(0,F.jsx)(f0,{records:t,onCellClick:n,highlightedField:r,onHoverField:i,onSelectRecord:a}):(0,F.jsx)(C0,{records:t,onSelectRecord:a})}function D0({view:e,onViewChange:t,onExport:n,onEnlarge:r,exportDisabled:i}){return(0,F.jsxs)(K,{px:2,py:1,gap:2,borderBottomWidth:`1px`,flexShrink:0,children:[(0,F.jsx)(Lw,{size:`2xs`,variant:e===`table`?`solid`:`outline`,onClick:()=>{t(`table`)},children:`Table`}),(0,F.jsx)(Lw,{size:`2xs`,variant:e===`jsonl`?`solid`:`outline`,onClick:()=>{t(`jsonl`)},children:`JSONL`}),(0,F.jsx)(NT,{size:`xs`,width:`7em`,variant:`outline`,disabled:i,children:(0,F.jsxs)(FT,{"aria-label":`Export records`,value:``,onChange:e=>{let t=e.target.value;t!==``&&n(t),e.target.value=``},children:[(0,F.jsx)(`option`,{value:``,disabled:!0,children:`Export…`}),(0,F.jsx)(`option`,{value:`json`,children:`JSON`}),(0,F.jsx)(`option`,{value:`jsonl`,children:`JSONL`}),(0,F.jsx)(`option`,{value:`csv`,children:`CSV`})]})}),r!==void 0&&(0,F.jsx)(Lw,{size:`2xs`,variant:`outline`,onClick:r,marginStart:`auto`,children:`Enlarge`})]})}function O0(e,t,n){let r=new Blob([n],{type:t}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=e,document.body.append(a),a.click(),a.remove(),URL.revokeObjectURL(i)}function k0({rejected:e,onClick:t}){return e.length===0?null:(0,F.jsxs)(Qw,{borderTopWidth:`1px`,gap:0,flexShrink:0,maxH:`30%`,overflow:`auto`,children:[(0,F.jsxs)(I,{px:3,py:1,fontSize:`xs`,fontWeight:`semibold`,color:`fg.muted`,children:[`Rejected (`,e.length,`)`]}),(0,F.jsx)(vE,{size:`sm`,children:(0,F.jsx)(wE,{children:e.map((e,n)=>(0,F.jsxs)(yE,{cursor:t===void 0?void 0:`pointer`,onClick:t===void 0?void 0:()=>{t(n)},children:[(0,F.jsx)(CE,{fontFamily:`mono`,fontWeight:`medium`,children:e.field}),(0,F.jsx)(CE,{color:`fg.error`,children:(0,F.jsx)(U,{truncate:!0,children:e.reason})})]},`${e.field}-${n}`))})})]})}function A0({lines:e}){return e.length===0?(0,F.jsx)(I,{p:4,color:`fg.muted`,children:(0,F.jsx)(U,{children:`No trace yet. Run a sample to see it here.`})}):(0,F.jsx)(I,{as:`pre`,p:2,h:`full`,overflow:`auto`,fontFamily:`mono`,fontSize:`xs`,whiteSpace:`pre-wrap`,children:e.join(`
38
- `)})}function j0({loading:e,view:t,error:n}){return e===!0?(0,F.jsxs)(Qw,{p:4,direction:`row`,align:`center`,color:`fg.muted`,children:[(0,F.jsx)(Mw,{size:`sm`}),(0,F.jsx)(U,{children:`Working it out…`})]}):n===void 0?t===void 0?(0,F.jsx)(I,{p:4,color:`fg.muted`,children:(0,F.jsx)(U,{children:`Click a missing or rejected value in the Records tab to see why here.`})}):(0,F.jsxs)(Qw,{p:4,gap:2,children:[(0,F.jsxs)(Qw,{direction:`row`,gap:2,align:`center`,children:[(0,F.jsx)(kw,{colorPalette:t.outcome===`rejected`?`red`:`orange`,children:t.outcome}),(0,F.jsx)(U,{fontFamily:`mono`,fontSize:`sm`,fontWeight:`medium`,children:t.field})]}),(0,F.jsx)(U,{children:t.sentence}),t.policy!==void 0&&(0,F.jsxs)(U,{fontSize:`xs`,color:`fg.muted`,children:[`policy: `,t.policy]}),t.stepPath!==void 0&&(0,F.jsxs)(U,{fontSize:`xs`,color:`fg.muted`,children:[`step: `,t.stepPath]})]}):(0,F.jsx)(I,{p:4,children:(0,F.jsx)(U,{color:`fg.error`,children:n})})}function M0({records:e,traceLines:t,rejected:n=[],onExplainMissing:r,onExplainRejected:i,whyLoading:a,whyView:o,whyError:s,highlightedField:c,onHoverField:l}){return(0,F.jsxs)(Bc,{defaultValue:`records`,h:`full`,display:`flex`,flexDirection:`column`,children:[(0,F.jsxs)(Uc,{children:[(0,F.jsxs)(Vc,{value:`records`,children:[`Records (`,e.length,`)`]}),(0,F.jsx)(Vc,{value:`trace`,children:`Trace`}),(0,F.jsx)(Vc,{value:`why`,children:`Why?`})]}),(0,F.jsxs)(Hc,{value:`records`,flex:`1`,minH:`0`,p:0,display:`flex`,flexDirection:`column`,children:[(0,F.jsx)(T0,{records:e,onCellClick:r,highlightedField:c,onHoverField:l}),(0,F.jsx)(k0,{rejected:n,onClick:i})]}),(0,F.jsx)(Hc,{value:`trace`,flex:`1`,minH:`0`,overflow:`auto`,p:0,children:(0,F.jsx)(A0,{lines:t})}),(0,F.jsx)(Hc,{value:`why`,flex:`1`,minH:`0`,overflow:`auto`,p:0,children:(0,F.jsx)(j0,{loading:a,view:o,error:s})})]})}function N0(e){return e!==void 0&&`each`in e}function P0(e){let t={};for(let[n,r]of Object.entries(e))!N0(r)&&typeof r.from==`string`&&(t[n]=r.from);return t}var F0=[`string`,`number`,`integer`,`boolean`,`date`,`datetime`,`currency`,`url`,`enum`,`array`,`object`,`json`],I0=[`fail`,`skip-record`,`null`,`default`],L0=/^[A-Z_][\w-]*$/i,R0=`trim.lowercase.uppercase.replace.regex.split.join.first.last.nth.slice.concat.coalesce.default.number.integer.boolean.toString.padStart.padEnd.currency.date.absoluteUrl.urlEncode.flatten.unique.sum.count.template.jsonpath.lookup.group`.split(`.`),z0={replace:[{name:`pattern`},{name:`replacement`},{name:`flags`}],regex:[{name:`pattern`},{name:`group`,numeric:!0},{name:`flags`}],split:[{name:`separator`}],join:[{name:`separator`}],nth:[{name:`index`,numeric:!0}],slice:[{name:`start`,numeric:!0},{name:`end`,numeric:!0}],concat:[{name:`separator`}],default:[{name:`value`}],number:[{name:`locale`}],boolean:[{name:`truthy`}],padStart:[{name:`length`,numeric:!0},{name:`char`}],padEnd:[{name:`length`,numeric:!0},{name:`char`}],currency:[{name:`locale`},{name:`currency`}],date:[{name:`format`},{name:`timezone`}],absoluteUrl:[{name:`base`}],template:[{name:`value`}],jsonpath:[{name:`path`}],lookup:[{name:`in`},{name:`key`},{name:`pick`}],group:[{name:`by`}]};function B0(e){return z0[e]??[]}function V0({transforms:e,trace:t,onChange:n}){let[r,i]=(0,P.useState)(!1),a=EA(),o=(t,r)=>{n(e.map((e,n)=>n===t?r:e))},s=t=>{n(e.filter((e,n)=>n!==t))},c=(t,r)=>{let i=t+r;if(i<0||i>=e.length)return;let a=[...e],o=a[t];a[t]=a[i],a[i]=o,n(a)},l=t=>{n([...e,t===`hook`?{op:t,name:a?.[0]??`myHook`}:{op:t}]),i(!1)};return(0,F.jsxs)(Qw,{direction:`row`,gap:2,wrap:`wrap`,align:`flex-start`,children:[e.map((n,r)=>(0,F.jsx)(H0,{transform:n,value:t?.steps[r]?.value,failed:t!==void 0&&t.steps.length<=r,onChange:e=>{o(r,e)},onRemove:()=>{s(r)},onMoveLeft:r===0?void 0:()=>{c(r,-1)},onMoveRight:r===e.length-1?void 0:()=>{c(r,1)}},r)),r?(0,F.jsx)(NT,{size:`xs`,width:`140px`,children:(0,F.jsxs)(FT,{defaultValue:``,onChange:e=>{e.target.value!==``&&l(e.target.value)},children:[(0,F.jsx)(`option`,{value:``,disabled:!0,children:`op…`}),R0.map(e=>(0,F.jsx)(`option`,{value:e,children:e},e)),(0,F.jsx)(`option`,{value:`hook`,children:`hook (your code)`})]})}):(0,F.jsx)(Lw,{size:`xs`,variant:`outline`,onClick:()=>{i(!0)},children:`+ transform`})]})}function H0({transform:e,value:t,failed:n,onChange:r,onRemove:i,onMoveLeft:a,onMoveRight:o}){let[s,c]=(0,P.useState)(!1),l=e.op===`hook`,u=l?[]:B0(e.op),d=l||u.length>0;return(0,F.jsxs)(I,{borderWidth:`1px`,borderRadius:`md`,borderColor:n?`red.subtle`:void 0,px:2,py:1,fontSize:`xs`,children:[(0,F.jsxs)(K,{gap:1,children:[a!==void 0&&(0,F.jsx)(Jw,{"aria-label":`Move left`,size:`2xs`,variant:`ghost`,onClick:a,children:`‹`}),(0,F.jsxs)(U,{as:d?`button`:`span`,fontWeight:`medium`,cursor:d?`pointer`:void 0,onClick:d?()=>{c(!s)}:void 0,children:[e.op,l&&typeof e.name==`string`?`: ${e.name}`:``]}),o!==void 0&&(0,F.jsx)(Jw,{"aria-label":`Move right`,size:`2xs`,variant:`ghost`,onClick:o,children:`›`}),(0,F.jsx)(Jw,{"aria-label":`Remove ${e.op}`,size:`2xs`,variant:`ghost`,colorPalette:`red`,onClick:i,children:`×`})]}),t!==void 0&&(0,F.jsxs)(kw,{mt:1,size:`sm`,colorPalette:n?`red`:`gray`,fontFamily:`mono`,maxW:`160px`,overflow:`hidden`,textOverflow:`ellipsis`,children:[`→ `,typeof t==`object`?JSON.stringify(t):String(t)]}),s&&l&&(0,F.jsx)(Qw,{mt:1,gap:1,children:(0,F.jsx)(DA,{size:`xs`,ariaLabel:`Hook name`,value:typeof e.name==`string`?e.name:``,onChange:t=>{r({...e,name:t})}})}),s&&u.length>0&&(0,F.jsx)(Qw,{mt:1,gap:1,children:u.map(t=>(0,F.jsxs)(K,{gap:1,children:[(0,F.jsx)(U,{color:`fg.muted`,minW:`70px`,children:t.name}),(0,F.jsx)(ET,{size:`2xs`,value:e[t.name]===void 0?``:String(e[t.name]),onChange:n=>{let i=n.target.value;r({...e,[t.name]:t.numeric?Number(i):i})}})]},t.name))})]})}function U0({name:e,field:t,rule:n,scopeIds:r,trace:i,missing:a,rejected:o,depth:s=0,stepId:c,highlighted:l=!1,onHoverStepId:u,onFieldChange:d,onRuleChange:f,onRename:p,onRemove:m,onExplainMissing:h,onExplainRejected:g}){let[_,v]=(0,P.useState)(!1),[y,b]=(0,P.useState)(e),[x,S]=(0,P.useState)(),[C,w]=(0,P.useState)(!1),T=t.generated!==void 0;return(0,F.jsxs)(I,{"data-testid":`${e}-row`,"data-highlighted":l,borderWidth:`1px`,borderRadius:`md`,p:2,ml:s*5,borderColor:l?`orange.solid`:o===void 0?void 0:`red.subtle`,bg:l?`orange.subtle`:void 0,onMouseEnter:c===void 0||u===void 0?void 0:()=>{u(c)},onMouseLeave:c===void 0||u===void 0?void 0:()=>{u(void 0)},children:[(0,F.jsxs)(K,{gap:2,align:`center`,wrap:`wrap`,children:[(0,F.jsxs)(Qw,{gap:0,children:[(0,F.jsx)(ET,{size:`xs`,width:`140px`,value:y,onChange:e=>{b(e.target.value)},onBlur:()=>{if(y!==e){if(!L0.test(y)){S(`a field name has no dots`);return}S(void 0),p(y)}}}),x!==void 0&&(0,F.jsx)(U,{fontSize:`2xs`,color:`fg.error`,children:x})]}),(0,F.jsx)(NT,{size:`xs`,width:`110px`,children:(0,F.jsx)(FT,{value:t.type,onChange:e=>{d({...t,type:e.target.value})},children:F0.map(e=>(0,F.jsx)(`option`,{value:e,children:e},e))})}),(0,F.jsx)(I,{"data-testid":`${e}-source-drop`,minW:`140px`,borderWidth:`1px`,borderStyle:`dashed`,borderRadius:`sm`,px:2,py:`2px`,fontSize:`xs`,bg:C?`colorPalette.subtle`:void 0,colorPalette:`blue`,onDragOver:e=>{e.dataTransfer.types.includes(`application/x-opencraw-pill`)&&(e.preventDefault(),w(!0))},onDragLeave:()=>{w(!1)},onDrop:e=>{e.preventDefault(),w(!1);let t=e.dataTransfer.getData(`application/x-opencraw-pill`)||e.dataTransfer.getData(`text/plain`);t!==``&&f({...n,from:t})},children:T?(0,F.jsxs)(U,{color:`fg.muted`,children:[`generated: `,t.generated]}):(0,F.jsx)(NT,{size:`xs`,children:(0,F.jsxs)(FT,{value:typeof n?.from==`string`?n.from:``,onChange:e=>{f(e.target.value===``?void 0:{...n,from:e.target.value})},children:[(0,F.jsx)(`option`,{value:``,children:`(drop a pill, or pick)`}),r.map(e=>(0,F.jsx)(`option`,{value:e,children:e},e))]})})}),(0,F.jsxs)(Uw,{size:`xs`,checked:t.key===!0,onCheckedChange:e=>{d({...t,key:e.checked===!0})},children:[(0,F.jsx)(qw,{}),(0,F.jsx)(Kw,{}),(0,F.jsx)(Ww,{children:`key`})]}),(0,F.jsxs)(Uw,{size:`xs`,checked:t.required===!0,disabled:T,onCheckedChange:e=>{d({...t,required:e.checked===!0})},children:[(0,F.jsx)(qw,{}),(0,F.jsx)(Kw,{}),(0,F.jsx)(Ww,{children:`required`})]}),a===!0&&(0,F.jsx)(Lw,{size:`2xs`,variant:`outline`,colorPalette:`orange`,onClick:h,children:`Why null?`}),o!==void 0&&(0,F.jsxs)(Lw,{size:`2xs`,variant:`outline`,colorPalette:`red`,onClick:g,title:o.reason,children:[o.count,` rejected`]}),(0,F.jsx)(Lw,{size:`2xs`,variant:`ghost`,onClick:()=>{v(!_)},children:_?`less`:`more`}),(0,F.jsx)(Jw,{"aria-label":`Remove ${e}`,size:`2xs`,variant:`ghost`,colorPalette:`red`,onClick:m,ml:`auto`,children:`×`})]}),!T&&t.type!==`object`&&(0,F.jsx)(I,{mt:2,children:(0,F.jsx)(V0,{transforms:n?.transform??[],trace:i,onChange:e=>{f(n===void 0?void 0:{...n,transform:e.length===0?void 0:e})}})}),_&&(0,F.jsxs)(Qw,{mt:2,direction:`row`,gap:3,wrap:`wrap`,fontSize:`xs`,children:[(0,F.jsxs)(Uw,{size:`xs`,checked:t.nullable===!0,onCheckedChange:e=>{d({...t,nullable:e.checked===!0})},children:[(0,F.jsx)(qw,{}),(0,F.jsx)(Kw,{}),(0,F.jsx)(Ww,{children:`nullable`})]}),(0,F.jsxs)(K,{gap:1,children:[(0,F.jsx)(U,{color:`fg.muted`,children:`onMissing`}),(0,F.jsx)(NT,{size:`xs`,width:`110px`,children:(0,F.jsxs)(FT,{value:t.onMissing??``,onChange:e=>{d({...t,onMissing:e.target.value===``?void 0:e.target.value})},children:[(0,F.jsx)(`option`,{value:``,children:`(recipe default)`}),I0.map(e=>(0,F.jsx)(`option`,{value:e,children:e},e))]})})]}),(0,F.jsxs)(K,{gap:1,children:[(0,F.jsx)(U,{color:`fg.muted`,children:`default`}),(0,F.jsx)(ET,{size:`xs`,width:`120px`,value:t.default===void 0?``:String(t.default),onChange:e=>{d({...t,default:e.target.value===``?void 0:e.target.value})}})]}),t.type===`currency`&&(0,F.jsxs)(K,{gap:1,children:[(0,F.jsx)(U,{color:`fg.muted`,children:`currency`}),(0,F.jsx)(ET,{size:`xs`,width:`60px`,value:t.currency??``,onChange:e=>{d({...t,currency:e.target.value||void 0})}})]}),(t.type===`date`||t.type===`datetime`)&&(0,F.jsxs)(K,{gap:1,children:[(0,F.jsx)(U,{color:`fg.muted`,children:`format`}),(0,F.jsx)(ET,{size:`xs`,width:`100px`,value:t.format??``,onChange:e=>{d({...t,format:e.target.value||void 0})}})]}),t.type===`enum`&&(0,F.jsxs)(K,{gap:1,children:[(0,F.jsx)(U,{color:`fg.muted`,children:`values`}),(0,F.jsx)(ET,{size:`xs`,width:`160px`,placeholder:`a, b, c`,value:(t.values??[]).join(`, `),onChange:e=>{d({...t,values:e.target.value.split(`,`).map(e=>e.trim()).filter(e=>e!==``)})}})]}),(0,F.jsxs)(K,{gap:1,children:[(0,F.jsx)(U,{color:`fg.muted`,children:`pattern`}),(0,F.jsx)(ET,{size:`xs`,width:`120px`,value:t.pattern??``,onChange:e=>{d({...t,pattern:e.target.value||void 0})}})]}),(0,F.jsxs)(K,{gap:1,children:[(0,F.jsx)(U,{color:`fg.muted`,children:`min`}),(0,F.jsx)(ET,{size:`xs`,width:`60px`,value:t.min??``,onChange:e=>{d({...t,min:e.target.value===``?void 0:Number(e.target.value)})}})]}),(0,F.jsxs)(K,{gap:1,children:[(0,F.jsx)(U,{color:`fg.muted`,children:`max`}),(0,F.jsx)(ET,{size:`xs`,width:`60px`,value:t.max??``,onChange:e=>{d({...t,max:e.target.value===``?void 0:Number(e.target.value)})}})]})]})]})}function W0(e){let t=K0(e);if(t===void 0)return[];let n=[];return G0(t,n),n}function G0(e,t){for(let n of e){if(typeof n!=`object`||!n)continue;let e=n;for(let n of[`id`,`as`]){let r=e[n];typeof r==`string`&&r.length>0&&!t.includes(r)&&t.push(r)}let r=K0(e);r!==void 0&&G0(r,t),Array.isArray(e.else)&&G0(e.else,t)}}function K0(e){if(typeof e!=`object`||!e)return;let t=e.steps;return Array.isArray(t)?t:void 0}function q0({inputRecipe:e,outputRecipe:t,records:n,rejected:r,onSaveInput:i,onSaveOutput:a,onExplainMissing:o,onExplainRejected:s}){let[c,l]=(0,P.useState)(),[u,d]=(0,P.useState)(),[f,p]=(0,P.useState)(),[m,h]=(0,P.useState)(),[g,_]=(0,P.useState)(0),[v,y]=(0,P.useState)(!1),[b,x]=(0,P.useState)(),S=qO(e=>e.hoveredStepId),C=qO(e=>e.setHoveredStepId);if((0,P.useEffect)(()=>{let n=t===void 0?void 0:JSON.parse(t.text),r=e===void 0?void 0:JSON.parse(e.text);l(n),d(r),p(n===void 0?void 0:JSON.stringify(n)),h(r===void 0?void 0:JSON.stringify(r)),_(0)},[e?.file,e?.text,t?.file,t?.text]),e===void 0)return(0,F.jsx)(I,{p:4,color:`fg.muted`,children:(0,F.jsx)(U,{children:`Select a recipe to see its output fields.`})});if(t===void 0||c===void 0||u===void 0)return(0,F.jsx)(I,{p:4,color:`fg.muted`,children:(0,F.jsx)(U,{children:`This recipe names no output recipe found in this workspace.`})});let w=W0(u),T=n[g],E=JSON.stringify(c)!==f||JSON.stringify(u)!==m,D=(e,t)=>{let n={...c.fields};t===void 0?delete n[e]:n[e]=t,l({...c,fields:n})},ee=(e,t)=>{if(t===e||c.fields[t]!==void 0)return;let n={};for(let[r,i]of Object.entries(c.fields))n[r===e?t:r]=i;l({...c,fields:n});let r={...u.mapping};r[e]!==void 0&&(r[t]=r[e],delete r[e]),d({...u,mapping:r})},O=(e,t)=>{let n={...u.mapping};t===void 0?delete n[e]:n[e]=t,d({...u,mapping:n})},te=()=>{let e=`field`,t=1;for(;c.fields[e]!==void 0;)e=`field${t}`,t+=1;D(e,{type:`string`})},k=async()=>{y(!0),x(void 0);try{await a(t.file,c),await i(e.file,u)}catch(e){x(e instanceof Error?e.message:String(e))}finally{y(!1)}};return(0,F.jsxs)(Qw,{h:`full`,p:2,gap:2,overflow:`auto`,children:[(0,F.jsxs)(K,{justify:`space-between`,wrap:`wrap`,children:[(0,F.jsxs)(K,{gap:3,fontSize:`xs`,color:`fg.muted`,children:[(0,F.jsxs)(K,{gap:1,children:[(0,F.jsx)(U,{children:`onMissing`}),(0,F.jsx)(NT,{size:`xs`,width:`110px`,children:(0,F.jsxs)(FT,{value:c.onMissing??``,onChange:e=>{l({...c,onMissing:e.target.value===``?void 0:e.target.value})},children:[(0,F.jsx)(`option`,{value:``,children:`(fail/null)`}),I0.filter(e=>e!=="default").map(e=>(0,F.jsx)(`option`,{value:e,children:e},e))]})})]}),n.length>0&&(0,F.jsxs)(K,{gap:1,children:[(0,F.jsx)(U,{children:`record`}),(0,F.jsx)(NT,{size:`xs`,width:`70px`,children:(0,F.jsx)(FT,{value:g,onChange:e=>{_(Number(e.target.value))},children:n.map((e,t)=>(0,F.jsxs)(`option`,{value:t,children:[`#`,t+1]},e.key??t))})})]})]}),(0,F.jsxs)(K,{children:[b!==void 0&&(0,F.jsx)(U,{color:`fg.error`,fontSize:`xs`,children:b}),(0,F.jsx)(Lw,{size:`xs`,onClick:()=>{k()},disabled:!E||v,loading:v,children:`Save`})]})]}),(0,F.jsx)(Qw,{gap:2,children:Object.entries(c.fields).map(([e,t])=>(0,F.jsx)(J0,{name:e,field:t,target:e,input:u,record:T,rejected:r,scopeIds:w,hoveredStepId:S,onHoverStepId:C,setRule:O,onFieldChange:t=>{D(e,t)},onRename:t=>{ee(e,t)},onRemove:()=>{D(e,void 0)},onExplainMissing:o===void 0?void 0:()=>{o(g,e)},onExplainRejected:s===void 0?void 0:()=>{let t=r.findIndex(t=>t.field===e);t!==-1&&s(t)}},e))}),(0,F.jsx)(I,{children:(0,F.jsx)(Lw,{size:`xs`,variant:`outline`,onClick:te,children:`+ field`})})]})}function J0({name:e,field:t,target:n,input:r,record:i,rejected:a,scopeIds:o,depth:s=0,hoveredStepId:c,onHoverStepId:l,setRule:u,onFieldChange:d,onRename:f,onRemove:p,onExplainMissing:m,onExplainRejected:h}){if(t.type===`object`&&t.fields!==void 0)return(0,F.jsxs)(Qw,{gap:1,children:[(0,F.jsx)(U0,{name:e,field:t,scopeIds:o,depth:s,onFieldChange:d,onRename:f,onRemove:p,onRuleChange:()=>{}}),Object.entries(t.fields).map(([e,f])=>(0,F.jsx)(J0,{name:e,field:f,target:`${n}.${e}`,input:r,record:i,rejected:a,scopeIds:o,depth:s+1,hoveredStepId:c,onHoverStepId:l,setRule:u,onFieldChange:n=>{d({...t,fields:{...t.fields,[e]:n}})},onRename:n=>{let r={},i=Object.entries(t.fields??{});for(let[t,a]of i)r[t===e?n:t]=a;d({...t,fields:r})},onRemove:()=>{let n={...t.fields};delete n[e],d({...t,fields:n})}},e))]});if(t.type===`array`&&t.items?.type===`object`&&t.items.fields!==void 0){let i=r.mapping[n],a=N0(i)?i:void 0,f=t.items,p=f.fields;return(0,F.jsxs)(Qw,{gap:1,borderWidth:`1px`,borderRadius:`md`,p:2,ml:s*5,children:[(0,F.jsxs)(K,{gap:2,children:[(0,F.jsx)(U,{fontWeight:`medium`,fontSize:`sm`,children:e}),(0,F.jsx)(U,{fontSize:`xs`,color:`fg.muted`,children:`each`}),(0,F.jsx)(ET,{size:`xs`,width:`140px`,placeholder:`list id (e.g. items)`,value:a?.each??``,onChange:e=>{u(n,e.target.value===``?void 0:{each:e.target.value,fields:a?.fields??{}})}})]}),Object.entries(p).map(([e,r])=>{let i=a?.fields[e],m=typeof i?.from==`string`?i.from:void 0;return(0,F.jsx)(U0,{name:e,field:r,rule:i,scopeIds:o,depth:s+1,stepId:m,highlighted:m!==void 0&&m===c,onHoverStepId:l,onFieldChange:n=>{d({...t,items:{...f,fields:{...p,[e]:n}}})},onRename:n=>{let r={};for(let[t,i]of Object.entries(p))r[t===e?n:t]=i;d({...t,items:{...f,fields:r}})},onRemove:()=>{let n={...p};delete n[e],d({...t,items:{...f,fields:n}})},onRuleChange:t=>{let r={...a?.fields};t===void 0?delete r[e]:r[e]=t,u(n,{each:a?.each??``,fields:r})}},e)})]})}let g=r.mapping[n],_=g===void 0||N0(g)?void 0:g,v=i?.data[e],y=i?.mapping?.[n],b=a.filter(e=>e.field===n),x=typeof _?.from==`string`?_.from:void 0;return(0,F.jsx)(U0,{name:e,field:t,rule:_,scopeIds:o,trace:y,missing:v===null,rejected:b.length===0?void 0:{count:b.length,reason:b[b.length-1].reason},depth:s,stepId:x,highlighted:x!==void 0&&x===c,onHoverStepId:l,onFieldChange:d,onRename:f,onRemove:p,onRuleChange:e=>{u(n,e)},onExplainMissing:m,onExplainRejected:h})}function Y0(e){if(e.trim()===``)return{ok:!1};try{return{ok:!0,value:JSON.parse(e)}}catch{return{ok:!1}}}function X0(e){let t={};for(let[n,r]of Object.entries(e)){if(!r.enabled)continue;let e=Y0(r.text);e.ok&&(t[n]=e.value)}return Object.keys(t).length===0?void 0:t}var Z0=GO(e=>({entries:{},setEnabled:(t,n)=>{e(e=>({entries:{...e.entries,[t]:{text:e.entries[t]?.text??`null`,enabled:n}}}))},setText:(t,n)=>{e(e=>({entries:{...e.entries,[t]:{enabled:e.entries[t]?.enabled??!1,text:n}}}))}})),Q0={hook:`hook`,captcha:`captcha solver`,access:`access plugin`};function $0({remote:e}){let t=Z0(e=>e.entries),n=Z0(e=>e.setEnabled),r=Z0(e=>e.setText);return e.length===0?null:(0,F.jsxs)(Qw,{gap:1,mt:1,"data-testid":`hook-stubs`,children:[(0,F.jsx)(U,{fontSize:`xs`,children:`These call outside this machine: a sample run waits for them, and they may cost.`}),e.map(e=>{let i=t[e.name],a=e.kind===`hook`,o=i?.text??`null`,s=i?.enabled??!1,c=Y0(o).ok;return(0,F.jsxs)(K,{gap:2,wrap:`wrap`,"data-testid":`remote-${e.name}`,children:[(0,F.jsx)(U,{fontSize:`xs`,children:`${Q0[e.kind]} ${e.name} → ${e.label}`}),a&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(Uw,{size:`xs`,checked:s,onCheckedChange:t=>{n(e.name,t.checked===!0)},children:[(0,F.jsx)(qw,{}),(0,F.jsx)(Kw,{}),(0,F.jsx)(Ww,{children:`stub ${e.name}`})]}),(0,F.jsx)(ET,{size:`xs`,width:`220px`,fontFamily:`mono`,"aria-label":`stub value of ${e.name}`,"aria-invalid":!c,value:o,onChange:t=>{r(e.name,t.target.value)}}),!c&&(0,F.jsx)(U,{fontSize:`xs`,color:`red.fg`,children:`not JSON: the hook is called`})]})]},`${e.kind}:${e.name}`)})]})}function e2(e){return[...e.dataTransfer.types].includes(`Files`)}function t2(e){e2(e)&&(e.preventDefault(),e.dataTransfer.dropEffect=`copy`)}function n2({onFile:e,children:t,...n}){let[r,i]=(0,P.useState)(0),a=r>0;function o(e){e2(e)&&(e.preventDefault(),i(e=>e+1))}function s(e){e2(e)&&i(e=>Math.max(0,e-1))}function c(t){if(!e2(t))return;t.preventDefault(),i(0);let n=t.dataTransfer.files[0];n!==void 0&&e(n)}return(0,F.jsxs)(I,{position:`relative`,"data-testid":`document-drop-zone`,onDragEnter:o,onDragOver:t2,onDragLeave:s,onDrop:c,...n,children:[t,a&&(0,F.jsx)(I,{role:`status`,position:`absolute`,inset:0,zIndex:`overlay`,display:`flex`,alignItems:`center`,justifyContent:`center`,bg:`blue.subtle/80`,borderWidth:`3px`,borderStyle:`dashed`,borderColor:`blue.solid`,pointerEvents:`none`,children:(0,F.jsx)(U,{fontSize:`lg`,fontWeight:`semibold`,color:`blue.fg`,children:`Drop to start a recipe from this file`})})]})}function r2(){let e=globalThis.opencrawDesktop;return typeof e?.chooseFolder==`function`?{chooseFolder:e.chooseFolder}:void 0}function i2({hooks:e}){return e===void 0?null:(0,F.jsxs)(I,{px:4,py:1,bg:`orange.subtle`,color:`orange.fg`,fontSize:`sm`,"data-testid":`hooks-bar`,children:[`Hooks loaded from ${e.source} (runs as your code): ${e.names.length===0?`none exported`:e.names.join(`, `)}`,e.remote!==void 0&&(0,F.jsx)($0,{remote:e.remote})]})}function a2(){let e=IO(),t=qO(e=>e.commitFolder),[n,r]=(0,P.useState)(!1),[i,a]=(0,P.useState)();async function o(){a(void 0),r(!0);try{let n=await e.chooseFolder();n!==void 0&&t(n)}catch(e){a(e instanceof Error?e.message:String(e))}finally{r(!1)}}return{browse:o,pending:n,error:i}}var o2=/^[a-z0-9][a-z0-9-]*$/,s2=`https://example.com`;function c2(e){if(e.trim()!==``)try{let{protocol:t}=new URL(e.trim());return t===`http:`||t===`https:`?void 0:`use an http:// or https:// address`}catch{return`use a full address, like https://example.com/books`}}function l2(e,t,n=s2){return d2(e,t,{mode:`web`,start:[{url:n}],steps:[{type:`goto`,url:`{{start.url}}`},{type:`emit`}]})}function u2(e,t,n){return d2(e,t,{mode:`api`,start:[{url:n}],steps:[{type:`request`,id:`doc`,url:`{{start.url}}`}]})}function d2(e,t,n){let r=e.endsWith(`/`)?e.slice(0,-1):e;return{outputPath:`${r}/${t}.ocw-out.json`,output:{kind:`output`,id:t,version:1,fields:{}},inputPath:`${r}/${t}.ocw-in.json`,input:{kind:`input`,id:t,output:t,...n,mapping:{}}}}function f2(e){let t=e.replace(/\.[^.]+$/,``).toLowerCase().split(/[^a-z0-9]+/).filter(e=>e!==``).join(`-`);return t===``?`document`:t}function p2(e,t){let n=new Set(t);if(!n.has(e))return e;for(let t=2;;t+=1)if(!n.has(`${e}-${t}`))return`${e}-${t}`}function m2(){let e=IO(),t=ek(),n=qO(e=>e.commitFolder),r=qO(e=>e.selectRecipe);return async(i,a,o)=>{let s=(await e.openWorkspace(i)).recipes.map(e=>e.id).filter(e=>e!==void 0),c=p2(f2(a),s),l=u2(i,c,o);await t.mutateAsync({path:l.outputPath,recipe:l.output}),await t.mutateAsync({path:l.inputPath,recipe:l.input}),qO.getState().openFolder!==i&&n(i),r(c)}}function h2(){let e=tk(),t=m2(),n=qO(e=>e.folder),r=qO(e=>e.openFolder),[i,a]=(0,P.useState)(),[o,s]=(0,P.useState)(!1);async function c(i){let o=(r??n).trim();if(o===``){a(`Type a workspace folder in the toolbar first, then drop the file again: that is where the copy and the recipe go.`);return}a(void 0),s(!0);try{let{url:n}=await e.mutateAsync({folder:o,name:i.name,bytes:await g2(i)});await t(o,i.name,n)}catch(e){a(e instanceof Error?e.message:String(e))}finally{s(!1)}}return{importFile:c,pending:o,error:i}}function g2(e){return new Promise((t,n)=>{let r=new FileReader;r.addEventListener(`error`,()=>{n(r.error??Error(`could not read ${e.name}`))}),r.addEventListener(`load`,()=>{let e=String(r.result);t(e.slice(e.indexOf(`,`)+1))}),r.readAsDataURL(e)})}function _2(e){return e.slice(Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`))+1)}function v2(){let e=IO(),t=qO(e=>e.commitFolder),n=qO(e=>e.selectRecipe),r=m2(),[i,a]=(0,P.useState)();return(0,P.useEffect)(()=>{let i=e.initialOpen;if(i===void 0)return;let o=()=>{let e=new URLSearchParams(globalThis.location.search);e.delete(`open`),globalThis.history.replaceState({},``,`${globalThis.location.pathname}?${e.toString()}`)};(async()=>{try{let a=await e.openPath(i,e.initialFolder);a.kind===`document`?await r(a.folder,_2(a.path),a.url):(t(a.folder),a.kind===`recipe`&&a.recipeId!==void 0&&n(a.recipeId))}catch(e){a(e instanceof Error?e.message:String(e))}finally{o()}})()},[]),i}function y2({folder:e,onCreated:t}){let[n,r]=(0,P.useState)(!1),[i,a]=(0,P.useState)(``),[o,s]=(0,P.useState)(``),[c,l]=(0,P.useState)(),u=ek(),d=i.length===0?void 0:b2(i),f=c2(o);function p(){r(!1),a(``),s(``),l(void 0)}async function m(){if(e===void 0||b2(i)!==void 0||c2(o)!==void 0)return;l(void 0);let n=l2(e,i,o.trim()===``?void 0:o.trim());try{await u.mutateAsync({path:n.outputPath,recipe:n.output}),await u.mutateAsync({path:n.inputPath,recipe:n.input}),t(i),p()}catch(e){l(e instanceof Error?e.message:String(e))}}return(0,F.jsxs)(rT,{open:n,onOpenChange:e=>{e.open?r(!0):p()},children:[(0,F.jsx)(iT,{asChild:!0,children:(0,F.jsx)(Lw,{size:`sm`,variant:`outline`,disabled:e===void 0,children:`+ New recipe`})}),(0,F.jsxs)(w_,{children:[(0,F.jsx)(lT,{}),(0,F.jsx)(aT,{children:(0,F.jsxs)(oT,{children:[(0,F.jsxs)(dT,{display:`flex`,flexDirection:`row`,alignItems:`center`,justifyContent:`space-between`,children:[(0,F.jsx)(sT,{children:`New recipe`}),(0,F.jsx)(cT,{asChild:!0,children:(0,F.jsx)(Yw,{size:`sm`,"aria-label":`Close`})})]}),(0,F.jsxs)(uT,{display:`flex`,flexDirection:`column`,gap:3,pb:4,children:[(0,F.jsxs)(xT,{invalid:d!==void 0,children:[(0,F.jsx)(ST,{children:`Recipe id`}),(0,F.jsx)(ET,{size:`sm`,placeholder:`books`,value:i,onChange:e=>{a(e.target.value)},onKeyDown:e=>{e.key===`Enter`&&m()}}),d!==void 0&&(0,F.jsx)(CT,{children:d})]}),(0,F.jsxs)(xT,{invalid:f!==void 0,children:[(0,F.jsx)(ST,{children:`Start URL (optional)`}),(0,F.jsx)(ET,{size:`sm`,placeholder:`https://example.com/books`,value:o,onChange:e=>{s(e.target.value)},onKeyDown:e=>{e.key===`Enter`&&m()}}),f!==void 0&&(0,F.jsx)(CT,{children:f})]}),(0,F.jsxs)(U,{fontSize:`xs`,color:`fg.muted`,children:[`Writes `,(0,F.jsxs)(U,{as:`span`,fontFamily:`mono`,children:[i||`<id>`,`.ocw-in.json`]}),` and`,` `,(0,F.jsxs)(U,{as:`span`,fontFamily:`mono`,children:[i||`<id>`,`.ocw-out.json`]})," into the open folder: a `web` recipe with one page and no fields mapped yet, ready to build out in the Steps tab."]}),c!==void 0&&(0,F.jsx)(U,{color:`fg.error`,fontSize:`sm`,children:c}),(0,F.jsx)(Lw,{size:`sm`,colorPalette:`blue`,alignSelf:`flex-end`,onClick:()=>{m()},disabled:i.length===0||d!==void 0||f!==void 0||u.isPending,loading:u.isPending,children:`Create`})]})]})})]})]})}function b2(e){return o2.test(e)?void 0:`lowercase letters, digits and hyphens, starting with a letter or digit`}var x2=`.pdf,.xlsx,.xlsm,.xls,.csv,.tsv,.pptx,.docx,.md,.markdown,.html,.htm,.json,.jsonl,.yaml,.yml,.xml`;function S2(e){return/[^/\\]+(?=[/\\]*$)/u.exec(e)?.[0]??``}function C2({folder:e,onFolderChange:t,onOpen:n,onChooseFolder:r,onBrowse:i,browsing:a,openFolder:o,inputs:s,selectedRecipeId:c,onSelectRecipe:l,onRecipeCreated:u,onImportFile:d,importing:f,running:p,onRunSample:m,onStop:h}){let g=(0,P.useRef)(null);return(0,F.jsxs)(K,{gap:2,p:2,borderBottomWidth:`1px`,wrap:`wrap`,children:[(0,F.jsx)(U,{fontWeight:`semibold`,flexShrink:0,children:`OpenCraw Studio`}),r===void 0?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(ET,{size:`sm`,flex:`1 1 8em`,minW:`8em`,maxW:`24em`,placeholder:`recipe folder`,value:e,onChange:e=>{t(e.target.value)},onKeyDown:e=>{e.key===`Enter`&&n()}}),(0,F.jsx)(Lw,{size:`sm`,onClick:n,children:`Open`}),i!==void 0&&(0,F.jsx)(Lw,{size:`sm`,variant:`outline`,onClick:i,disabled:a,loading:a,title:`Pick the folder in the operating system dialog`,children:`Browse…`})]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Lw,{size:`sm`,onClick:r,children:`Open folder…`}),(0,F.jsx)(U,{fontSize:`sm`,color:`fg.muted`,truncate:!0,maxW:`16em`,title:o??e,children:S2(o??e)})]}),(0,F.jsx)(NT,{size:`sm`,flex:`1 1 8em`,minW:`8em`,maxW:`16em`,disabled:s.length===0,children:(0,F.jsxs)(FT,{value:c??``,onChange:e=>{l(e.target.value)},children:[(0,F.jsx)(`option`,{value:``,disabled:!0,children:s.length===0?`no input recipes`:`select a recipe`}),s.map(e=>(0,F.jsx)(`option`,{value:e.id??e.file,children:e.id??e.file},e.file))]})}),(0,F.jsx)(y2,{folder:o,onCreated:u}),(0,F.jsx)(Lw,{size:`sm`,variant:`outline`,onClick:()=>{g.current?.click()},disabled:f,loading:f,title:`Start a recipe from a PDF, spreadsheet, deck, Word, CSV, JSON, YAML, XML or Markdown file (or drop one anywhere)`,children:`Open document…`}),(0,F.jsx)(`input`,{ref:g,type:`file`,accept:x2,"aria-label":`Open document`,hidden:!0,onChange:e=>{let t=e.target.files?.[0];e.target.value=``,t!==void 0&&d(t)}}),(0,F.jsxs)(K,{gap:2,flexShrink:0,children:[(0,F.jsx)(Lw,{size:`sm`,colorPalette:`blue`,onClick:m,disabled:c===void 0||p,loading:p,children:`Run sample`}),(0,F.jsx)(Lw,{size:`sm`,variant:`outline`,onClick:h,disabled:!p,children:`Stop`})]})]})}function w2(){let[e]=(0,P.useState)(()=>LO());return(0,F.jsx)(jE,{client:e,children:(0,F.jsx)(nn,{value:Sw,children:(0,F.jsx)(T2,{})})})}function T2(){let e=IO();ak();let t=qO(e=>e.folder),n=qO(e=>e.openFolder),r=qO(e=>e.selectedRecipeId),i=qO(e=>e.editorTab),a=qO(e=>e.setFolder),o=qO(e=>e.commitFolder),s=qO(e=>e.selectRecipe),c=qO(e=>e.setEditorTab),l=qO(e=>e.hoveredStepId),u=qO(e=>e.setHoveredStepId),d=zO(n),f=$O(),p=QO(),m=YO(e=>e.running),h=YO(e=>e.records),g=YO(e=>e.rejected),_=YO(e=>e.traceLines),v=YO(e=>e.error),y=rk(),b=Z0(e=>e.entries),x=ik(),S=ek(),C=nk(),w=lk(),T=h2(),E=a2(),D=v2();(0,P.useEffect)(()=>{e.initialFolder!==void 0&&o(e.initialFolder)},[]),(0,P.useEffect)(()=>{if(r!==void 0||d.data===void 0)return;let e=d.data.recipes.find(e=>e.kind===`input`);e?.id!==void 0&&s(e.id)},[d.data,r,s]);let ee=(0,P.useMemo)(()=>{if(p!==void 0&&p.kind===`input`)try{let e=JSON.parse(p.text).output;return d.data?.recipes.find(t=>t.kind===`output`&&t.id===e)}catch{return}},[p,d.data]),O=(0,P.useMemo)(()=>{if(p===void 0||p.kind!==`input`)return{};try{let e=JSON.parse(p.text).mapping;return e===void 0?{}:P0(e)}catch{return{}}},[p]),te=Object.keys(O).find(e=>O[e]===l&&l!==void 0),k=(0,P.useMemo)(()=>r2(),[]),ne=k===void 0?void 0:()=>{k.chooseFolder()},re=e=>{w.mutate(e)},ie=D??T.error??E.error??E2(d.error)??v;return(0,F.jsx)(wA.Provider,{value:d.data?.hooks?.names,children:(0,F.jsxs)(n2,{onFile:e=>{T.importFile(e)},h:`100vh`,display:`flex`,flexDirection:`column`,children:[(0,F.jsx)(C2,{folder:t,onFolderChange:a,onOpen:()=>{o(t)},onChooseFolder:ne,onBrowse:()=>{E.browse()},browsing:E.pending,openFolder:n,inputs:f,selectedRecipeId:r,onSelectRecipe:s,onRecipeCreated:s,onImportFile:e=>{T.importFile(e)},importing:T.pending,running:m,onRunSample:()=>{r!==void 0&&y.mutate({recipeId:r,stubs:X0(b)})},onStop:()=>{x.mutate()}}),(0,F.jsx)(i2,{hooks:d.data?.hooks}),ie!==void 0&&(0,F.jsx)(I,{px:4,py:1,bg:`red.subtle`,color:`red.fg`,fontSize:`sm`,children:ie}),(0,F.jsxs)(QT,{orientation:`vertical`,panels:[{id:`workspace`,minSize:20},{id:`preview`,minSize:10}],defaultSize:[70,30],flex:`1`,minH:`0`,children:[(0,F.jsx)($T,{id:`workspace`,overflow:`hidden`,children:(0,F.jsxs)(QT,{panels:[{id:`content`,minSize:20},{id:`editor`,minSize:20}],h:`full`,children:[(0,F.jsx)($T,{id:`content`,overflow:`auto`,children:(0,F.jsx)(xF,{recipe:p,onSaveOutline:async(e,t)=>{await C.mutateAsync({path:e,outline:t})},onSaveRecipe:async(e,t)=>{await S.mutateAsync({path:e,recipe:t})}})}),(0,F.jsx)(nE,{id:`content:editor`}),(0,F.jsxs)($T,{id:`editor`,overflow:`hidden`,display:`flex`,flexDirection:`column`,children:[(0,F.jsxs)(K,{gap:1,px:2,pt:2,borderBottomWidth:`1px`,flexShrink:0,children:[(0,F.jsx)(D2,{label:`Steps`,active:i===`steps`,onClick:()=>{c(`steps`)}}),(0,F.jsx)(D2,{label:`Record`,active:i===`record`,onClick:()=>{c(`record`)}}),(0,F.jsx)(D2,{label:`JSON`,active:i===`json`,onClick:()=>{c(`json`)}})]}),(0,F.jsxs)(I,{flex:`1`,minH:`0`,overflow:`auto`,children:[i===`steps`&&(0,F.jsx)(MM,{recipe:p,onSaveOutline:async(e,t)=>{await C.mutateAsync({path:e,outline:t})}}),i===`record`&&(0,F.jsx)(q0,{inputRecipe:p,outputRecipe:ee,records:h,rejected:g,onSaveInput:async(e,t)=>{await S.mutateAsync({path:e,recipe:t})},onSaveOutput:async(e,t)=>{await S.mutateAsync({path:e,recipe:t})},onExplainMissing:r===void 0?void 0:(e,t)=>{re({kind:`missing`,recipeId:r,recordIndex:e,field:t})},onExplainRejected:r===void 0?void 0:e=>{re({kind:`rejected`,recipeId:r,rejectedIndex:e})}}),i===`json`&&(0,F.jsx)(l0,{recipe:p,onSave:async(e,t)=>{await S.mutateAsync({path:e,recipe:t})}})]})]})]})}),(0,F.jsx)(nE,{id:`workspace:preview`}),(0,F.jsx)($T,{id:`preview`,overflow:`hidden`,borderTopWidth:`1px`,children:(0,F.jsx)(M0,{records:h,traceLines:_,rejected:g,onExplainMissing:r===void 0?void 0:(e,t)=>{re({kind:`missing`,recipeId:r,recordIndex:e,field:t})},onExplainRejected:r===void 0?void 0:e=>{re({kind:`rejected`,recipeId:r,rejectedIndex:e})},whyLoading:w.isPending,whyView:w.data,whyError:E2(w.error),highlightedField:te,onHoverField:e=>{u(e===void 0?void 0:O[e])}})})]})]})})}function E2(e){if(e!=null)return e instanceof Error?e.message:String(e)}function D2({label:e,active:t,onClick:n}){return(0,F.jsx)(U,{as:`button`,px:3,py:1,fontSize:`sm`,fontWeight:t?`semibold`:`normal`,color:t?`fg`:`fg.muted`,borderBottomWidth:`2px`,borderColor:t?`colorPalette.solid`:`transparent`,colorPalette:`blue`,cursor:`pointer`,onClick:n,children:e})}nt.createRoot(document.getElementById(`root`)).render((0,F.jsx)(P.StrictMode,{children:(0,F.jsx)(w2,{})}));export{OP as t};